forked from ohrionmartin/subform-power
Initial commit
This commit is contained in:
340
LICENSE.txt
Normal file
340
LICENSE.txt
Normal file
@@ -0,0 +1,340 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
45
README.md
Normal file
45
README.md
Normal file
@@ -0,0 +1,45 @@
|
||||
# Subform Power (1.0.0)
|
||||
|
||||
Demonstration of subform super power
|
||||
|
||||
# Build Details
|
||||
|
||||
+ *Company*: [Nampharm](https://nampharm.com.na)
|
||||
+ *Author*: [Oh Martin](mailto:oh@nampharm.com.na)
|
||||
+ *Name*: [Subform Power](https://nampharm.com.na)
|
||||
+ *First Build*: 24th May, 2024
|
||||
+ *Last Build*: 27th June, 2024
|
||||
+ *Version*: 1.0.0
|
||||
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
|
||||
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
## Build Time
|
||||
|
||||
**69 Hours** or **9 Eight Hour Days** (actual time the author saved -
|
||||
due to [Automated Component Builder](https://www.joomlacomponentbuilder.com))
|
||||
|
||||
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
|
||||
> never making one mistake or taking any coffee break.)
|
||||
|
||||
+ *Line count*: **24593**
|
||||
+ *File count*: **229**
|
||||
+ *Folder count*: **78**
|
||||
|
||||
**45 Hours** or **5 Eight Hour Days** (the actual time the author spent)
|
||||
|
||||
> (with the following break down:
|
||||
> **debugging @17hours** = codingtime / 4;
|
||||
> **planning @10hours** = codingtime / 7;
|
||||
> **mapping @7hours** = codingtime / 10;
|
||||
> **office @11hours** = codingtime / 6;)
|
||||
|
||||
**114 Hours** or **14 Eight Hour Days**
|
||||
(a total of the realistic time frame for this project)
|
||||
|
||||
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
|
||||
> with the normal everyday realities at the office, that includes the component planning, mapping & debugging.)
|
||||
|
||||
Project duration: **2.8 weeks** or **0.6 months**
|
||||
|
||||
> This **component** was build with a Joomla [Automated Component Builder](https://www.joomlacomponentbuilder.com).
|
||||
> Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io)
|
1246
SubformpowerInstallerScript.php
Normal file
1246
SubformpowerInstallerScript.php
Normal file
File diff suppressed because it is too large
Load Diff
45
admin/README.txt
Normal file
45
admin/README.txt
Normal file
@@ -0,0 +1,45 @@
|
||||
# Subform Power (1.0.0)
|
||||
|
||||
Demonstration of subform super power
|
||||
|
||||
# Build Details
|
||||
|
||||
+ *Company*: [Nampharm](https://nampharm.com.na)
|
||||
+ *Author*: [Oh Martin](mailto:oh@nampharm.com.na)
|
||||
+ *Name*: [Subform Power](https://nampharm.com.na)
|
||||
+ *First Build*: 24th May, 2024
|
||||
+ *Last Build*: 27th June, 2024
|
||||
+ *Version*: 1.0.0
|
||||
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
|
||||
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
## Build Time
|
||||
|
||||
**69 Hours** or **9 Eight Hour Days** (actual time the author saved -
|
||||
due to [Automated Component Builder](https://www.joomlacomponentbuilder.com))
|
||||
|
||||
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
|
||||
> never making one mistake or taking any coffee break.)
|
||||
|
||||
+ *Line count*: **24593**
|
||||
+ *File count*: **229**
|
||||
+ *Folder count*: **78**
|
||||
|
||||
**45 Hours** or **5 Eight Hour Days** (the actual time the author spent)
|
||||
|
||||
> (with the following break down:
|
||||
> **debugging @17hours** = codingtime / 4;
|
||||
> **planning @10hours** = codingtime / 7;
|
||||
> **mapping @7hours** = codingtime / 10;
|
||||
> **office @11hours** = codingtime / 6;)
|
||||
|
||||
**114 Hours** or **14 Eight Hour Days**
|
||||
(a total of the realistic time frame for this project)
|
||||
|
||||
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
|
||||
> with the normal everyday realities at the office, that includes the component planning, mapping & debugging.)
|
||||
|
||||
Project duration: **2.8 weeks** or **0.6 months**
|
||||
|
||||
> This **component** was build with a Joomla [Automated Component Builder](https://www.joomlacomponentbuilder.com).
|
||||
> Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io)
|
67
admin/access.xml
Normal file
67
admin/access.xml
Normal file
@@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<access component="com_subformpower">
|
||||
<section name="component">
|
||||
<action name="core.admin" title="JACTION_ADMIN" description="JACTION_ADMIN_COMPONENT_DESC" />
|
||||
<action name="core.options" title="JACTION_OPTIONS" description="JACTION_OPTIONS_COMPONENT_DESC" />
|
||||
<action name="core.manage" title="JACTION_MANAGE" description="JACTION_MANAGE_COMPONENT_DESC" />
|
||||
<action name="core.export" title="COM_SUBFORMPOWER_EXPORT_DATA" description="COM_SUBFORMPOWER_EXPORT_DATA_DESC" />
|
||||
<action name="core.import" title="COM_SUBFORMPOWER_IMPORT_DATA" description="COM_SUBFORMPOWER_IMPORT_DATA_DESC" />
|
||||
<action name="core.batch" title="COM_SUBFORMPOWER_USE_BATCH" description="COM_SUBFORMPOWER_USE_BATCH_DESC" />
|
||||
<action name="core.version" title="COM_SUBFORMPOWER_EDIT_VERSIONS" description="COM_SUBFORMPOWER_EDIT_VERSIONS_DESC" />
|
||||
<action name="core.create" title="JACTION_CREATE" description="JACTION_CREATE_COMPONENT_DESC" />
|
||||
<action name="core.delete" title="JACTION_DELETE" description="JACTION_DELETE_COMPONENT_DESC" />
|
||||
<action name="core.edit" title="JACTION_EDIT" description="JACTION_EDIT_COMPONENT_DESC" />
|
||||
<action name="core.edit.state" title="JACTION_EDITSTATE" description="JACTION_ACCESS_EDITSTATE_DESC" />
|
||||
<action name="core.edit.own" title="JACTION_EDITOWN" description="JACTION_EDITOWN_COMPONENT_DESC" />
|
||||
<action name="core.edit.created_by" title="COM_SUBFORMPOWER_EDIT_CREATED_BY" description="COM_SUBFORMPOWER_EDIT_CREATED_BY_DESC" />
|
||||
<action name="core.edit.created" title="COM_SUBFORMPOWER_EDIT_CREATED_DATE" description="COM_SUBFORMPOWER_EDIT_CREATED_DATE_DESC" />
|
||||
<action name="country.access" title="COM_SUBFORMPOWER_COUNTRIES_ACCESS" description="COM_SUBFORMPOWER_COUNTRIES_ACCESS_DESC" />
|
||||
<action name="country.batch" title="COM_SUBFORMPOWER_COUNTRIES_BATCH_USE" description="COM_SUBFORMPOWER_COUNTRIES_BATCH_USE_DESC" />
|
||||
<action name="country.create" title="COM_SUBFORMPOWER_COUNTRIES_CREATE" description="COM_SUBFORMPOWER_COUNTRIES_CREATE_DESC" />
|
||||
<action name="country.dashboard_add" title="COM_SUBFORMPOWER_COUNTRIES_DASHBOARD_ADD" description="COM_SUBFORMPOWER_COUNTRIES_DASHBOARD_ADD_DESC" />
|
||||
<action name="country.dashboard_list" title="COM_SUBFORMPOWER_COUNTRIES_DASHBOARD_LIST" description="COM_SUBFORMPOWER_COUNTRIES_DASHBOARD_LIST_DESC" />
|
||||
<action name="country.delete" title="COM_SUBFORMPOWER_COUNTRIES_DELETE" description="COM_SUBFORMPOWER_COUNTRIES_DELETE_DESC" />
|
||||
<action name="country.edit" title="COM_SUBFORMPOWER_COUNTRIES_EDIT" description="COM_SUBFORMPOWER_COUNTRIES_EDIT_DESC" />
|
||||
<action name="country.edit.guid" title="COM_SUBFORMPOWER_COUNTRIES_EDIT_GUID" description="COM_SUBFORMPOWER_COUNTRIES_EDIT_GUID_DESC" />
|
||||
<action name="country.edit.own" title="COM_SUBFORMPOWER_COUNTRIES_EDIT_OWN" description="COM_SUBFORMPOWER_COUNTRIES_EDIT_OWN_DESC" />
|
||||
<action name="country.edit.state" title="COM_SUBFORMPOWER_COUNTRIES_EDIT_STATE" description="COM_SUBFORMPOWER_COUNTRIES_EDIT_STATE_DESC" />
|
||||
<action name="country.version" title="COM_SUBFORMPOWER_COUNTRIES_EDIT_VERSION" description="COM_SUBFORMPOWER_COUNTRIES_EDIT_VERSION_DESC" />
|
||||
<action name="country.export" title="COM_SUBFORMPOWER_COUNTRIES_EXPORT" description="COM_SUBFORMPOWER_COUNTRIES_EXPORT_DESC" />
|
||||
<action name="country.import" title="COM_SUBFORMPOWER_COUNTRIES_IMPORT" description="COM_SUBFORMPOWER_COUNTRIES_IMPORT_DESC" />
|
||||
<action name="country.submenu" title="COM_SUBFORMPOWER_COUNTRIES_SUBMENU" description="COM_SUBFORMPOWER_COUNTRIES_SUBMENU_DESC" />
|
||||
<action name="currency.access" title="COM_SUBFORMPOWER_CURRENCIES_ACCESS" description="COM_SUBFORMPOWER_CURRENCIES_ACCESS_DESC" />
|
||||
<action name="currency.batch" title="COM_SUBFORMPOWER_CURRENCIES_BATCH_USE" description="COM_SUBFORMPOWER_CURRENCIES_BATCH_USE_DESC" />
|
||||
<action name="currency.create" title="COM_SUBFORMPOWER_CURRENCIES_CREATE" description="COM_SUBFORMPOWER_CURRENCIES_CREATE_DESC" />
|
||||
<action name="currency.dashboard_add" title="COM_SUBFORMPOWER_CURRENCIES_DASHBOARD_ADD" description="COM_SUBFORMPOWER_CURRENCIES_DASHBOARD_ADD_DESC" />
|
||||
<action name="currency.dashboard_list" title="COM_SUBFORMPOWER_CURRENCIES_DASHBOARD_LIST" description="COM_SUBFORMPOWER_CURRENCIES_DASHBOARD_LIST_DESC" />
|
||||
<action name="currency.delete" title="COM_SUBFORMPOWER_CURRENCIES_DELETE" description="COM_SUBFORMPOWER_CURRENCIES_DELETE_DESC" />
|
||||
<action name="currency.edit" title="COM_SUBFORMPOWER_CURRENCIES_EDIT" description="COM_SUBFORMPOWER_CURRENCIES_EDIT_DESC" />
|
||||
<action name="currency.edit.guid" title="COM_SUBFORMPOWER_CURRENCIES_EDIT_GUID" description="COM_SUBFORMPOWER_CURRENCIES_EDIT_GUID_DESC" />
|
||||
<action name="currency.edit.own" title="COM_SUBFORMPOWER_CURRENCIES_EDIT_OWN" description="COM_SUBFORMPOWER_CURRENCIES_EDIT_OWN_DESC" />
|
||||
<action name="currency.edit.state" title="COM_SUBFORMPOWER_CURRENCIES_EDIT_STATE" description="COM_SUBFORMPOWER_CURRENCIES_EDIT_STATE_DESC" />
|
||||
<action name="currency.version" title="COM_SUBFORMPOWER_CURRENCIES_EDIT_VERSION" description="COM_SUBFORMPOWER_CURRENCIES_EDIT_VERSION_DESC" />
|
||||
<action name="currency.export" title="COM_SUBFORMPOWER_CURRENCIES_EXPORT" description="COM_SUBFORMPOWER_CURRENCIES_EXPORT_DESC" />
|
||||
<action name="currency.import" title="COM_SUBFORMPOWER_CURRENCIES_IMPORT" description="COM_SUBFORMPOWER_CURRENCIES_IMPORT_DESC" />
|
||||
<action name="currency.submenu" title="COM_SUBFORMPOWER_CURRENCIES_SUBMENU" description="COM_SUBFORMPOWER_CURRENCIES_SUBMENU_DESC" />
|
||||
</section>
|
||||
<section name="country">
|
||||
<action name="country.edit" title="COM_SUBFORMPOWER_COUNTRIES_EDIT" description="COM_SUBFORMPOWER_COUNTRIES_EDIT_DESC" />
|
||||
<action name="country.edit.own" title="COM_SUBFORMPOWER_COUNTRIES_EDIT_OWN" description="COM_SUBFORMPOWER_COUNTRIES_EDIT_OWN_DESC" />
|
||||
<action name="country.edit.state" title="COM_SUBFORMPOWER_COUNTRIES_EDIT_STATE" description="COM_SUBFORMPOWER_COUNTRIES_EDIT_STATE_DESC" />
|
||||
<action name="country.create" title="COM_SUBFORMPOWER_COUNTRIES_CREATE" description="COM_SUBFORMPOWER_COUNTRIES_CREATE_DESC" />
|
||||
<action name="country.delete" title="COM_SUBFORMPOWER_COUNTRIES_DELETE" description="COM_SUBFORMPOWER_COUNTRIES_DELETE_DESC" />
|
||||
<action name="country.access" title="COM_SUBFORMPOWER_COUNTRIES_ACCESS" description="COM_SUBFORMPOWER_COUNTRIES_ACCESS_DESC" />
|
||||
<action name="country.edit.guid" title="COM_SUBFORMPOWER_COUNTRIES_EDIT_GUID" description="COM_SUBFORMPOWER_COUNTRIES_EDIT_GUID_DESC" />
|
||||
<action name="country.version" title="COM_SUBFORMPOWER_COUNTRIES_EDIT_VERSION" description="COM_SUBFORMPOWER_COUNTRIES_EDIT_VERSION_DESC" />
|
||||
</section>
|
||||
<section name="currency">
|
||||
<action name="currency.edit" title="COM_SUBFORMPOWER_CURRENCIES_EDIT" description="COM_SUBFORMPOWER_CURRENCIES_EDIT_DESC" />
|
||||
<action name="currency.edit.own" title="COM_SUBFORMPOWER_CURRENCIES_EDIT_OWN" description="COM_SUBFORMPOWER_CURRENCIES_EDIT_OWN_DESC" />
|
||||
<action name="currency.edit.state" title="COM_SUBFORMPOWER_CURRENCIES_EDIT_STATE" description="COM_SUBFORMPOWER_CURRENCIES_EDIT_STATE_DESC" />
|
||||
<action name="currency.create" title="COM_SUBFORMPOWER_CURRENCIES_CREATE" description="COM_SUBFORMPOWER_CURRENCIES_CREATE_DESC" />
|
||||
<action name="currency.delete" title="COM_SUBFORMPOWER_CURRENCIES_DELETE" description="COM_SUBFORMPOWER_CURRENCIES_DELETE_DESC" />
|
||||
<action name="currency.access" title="COM_SUBFORMPOWER_CURRENCIES_ACCESS" description="COM_SUBFORMPOWER_CURRENCIES_ACCESS_DESC" />
|
||||
<action name="currency.edit.guid" title="COM_SUBFORMPOWER_CURRENCIES_EDIT_GUID" description="COM_SUBFORMPOWER_CURRENCIES_EDIT_GUID_DESC" />
|
||||
<action name="currency.version" title="COM_SUBFORMPOWER_CURRENCIES_EDIT_VERSION" description="COM_SUBFORMPOWER_CURRENCIES_EDIT_VERSION_DESC" />
|
||||
</section>
|
||||
</access>
|
24
admin/assets/css/admin.css
Normal file
24
admin/assets/css/admin.css
Normal file
@@ -0,0 +1,24 @@
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage admin.css
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* CSS Document */
|
||||
.no-click {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
22
admin/assets/css/countries.css
Normal file
22
admin/assets/css/countries.css
Normal file
@@ -0,0 +1,22 @@
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage countries.css
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
22
admin/assets/css/country.css
Normal file
22
admin/assets/css/country.css
Normal file
@@ -0,0 +1,22 @@
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage country.css
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
22
admin/assets/css/currencies.css
Normal file
22
admin/assets/css/currencies.css
Normal file
@@ -0,0 +1,22 @@
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage currencies.css
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
22
admin/assets/css/currency.css
Normal file
22
admin/assets/css/currency.css
Normal file
@@ -0,0 +1,22 @@
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage currency.css
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
172
admin/assets/css/dashboard.css
Normal file
172
admin/assets/css/dashboard.css
Normal file
@@ -0,0 +1,172 @@
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage dashboard.css
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
.dashboard-container {
|
||||
margin-left: 10px;
|
||||
margin-top: 10px;
|
||||
width: 100%;
|
||||
}
|
||||
.dashboard-container [class*="span"] {
|
||||
display: block;
|
||||
float: none;
|
||||
margin-left: 0;
|
||||
width: auto;
|
||||
}
|
||||
.dashboard-container:before, .dashboard-container:after {
|
||||
content: "";
|
||||
display: table;
|
||||
}
|
||||
.dashboard-container:after {
|
||||
clear: both;
|
||||
}
|
||||
.dashboard-container [class*="span"] {
|
||||
box-sizing: border-box;
|
||||
display: block;
|
||||
float: left;
|
||||
min-height: 145px;
|
||||
min-width: 96px;
|
||||
width: 100%;
|
||||
}
|
||||
.dashboard-container [class*="span"]:first-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
.dashboard-wraper {
|
||||
background: none repeat scroll 0 0 hsl(0, 0%, 93%);
|
||||
border-radius: 5px;
|
||||
float: left;
|
||||
margin: 1%;
|
||||
padding: 3px;
|
||||
width: 17%;
|
||||
min-height: 194px;
|
||||
min-width: 96px;
|
||||
}
|
||||
.dashboard-content a {
|
||||
background: linear-gradient(to bottom, hsl(0, 0%, 100%) 0%, hsl(0, 0%, 96%) 47%, hsl(0, 0%, 93%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0);
|
||||
border: 1px solid hsl(0, 0%, 85%);
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 0 3px hsla(0, 0%, 0%, 0.1) inset;
|
||||
color: hsl(0, 0%, 20%);
|
||||
display: block;
|
||||
min-height: 89px;
|
||||
padding: 10px;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
}
|
||||
.dashboard-content a:hover {
|
||||
background: linear-gradient(to bottom, hsl(0, 0%, 90%) 0%, hsl(0, 0%, 100%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0);
|
||||
color: hsl(200, 100%, 30%);
|
||||
text-decoration: none;
|
||||
}
|
||||
.dashboard-title {
|
||||
display: block;
|
||||
padding-top: 5px;
|
||||
}
|
||||
.dashboard-info {
|
||||
background: linear-gradient(to bottom, hsl(0, 0%, 100%) 0%, hsl(0, 0%, 96%) 47%, hsl(0, 0%, 93%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0);
|
||||
border: 1px solid hsl(0, 0%, 85%);
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 0 3px hsla(0, 0%, 0%, 0.1) inset;
|
||||
color: hsl(0, 0%, 20%);
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
padding: 10px;
|
||||
text-align: center;
|
||||
}
|
||||
.dashboard-info span {
|
||||
display: block;
|
||||
text-align: center;
|
||||
}
|
||||
.dashboard-info img {
|
||||
margin: 0 auto;
|
||||
}
|
||||
.dashboard-table {
|
||||
border-top: 1px solid hsl(0, 0%, 87%);
|
||||
margin-top: 5px;
|
||||
width: 100%;
|
||||
}
|
||||
.dashboard-info h5 {
|
||||
font-size: 11px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.dashboard-block {
|
||||
background: linear-gradient(to bottom, hsl(0, 0%, 95%) 0%, hsl(0, 0%, 86%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0);
|
||||
border: 1px solid hsl(0, 0%, 76%);
|
||||
border-radius: 3px;
|
||||
box-shadow: 0 1px 0 hsl(0, 0%, 98%) inset;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.dashboard-block .dashboard-block-head {
|
||||
background: linear-gradient(to bottom, hsl(0, 0%, 95%) 0%, hsl(0, 0%, 86%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0);
|
||||
border-bottom: 1px solid hsl(0, 0%, 76%);
|
||||
border-radius: 3px 3px 0 0;
|
||||
box-shadow: 0 1px 0 hsl(0, 0%, 98%) inset, 0 0 3px hsl(0, 0%, 87%);
|
||||
height: 40px;
|
||||
position: relative;
|
||||
}
|
||||
.dashboard-block .dashboard-block-head h5 {
|
||||
font-size: 12px;
|
||||
margin: 0;
|
||||
padding-left: 10px;
|
||||
padding-top: 11px;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.dashboard-block .dashboard-block-content {
|
||||
background: none repeat scroll 0 0 hsl(0, 0%, 93%);
|
||||
border-radius: 0 0 3px 3px;
|
||||
}
|
||||
.dashboard-block .dashboard-block-box {
|
||||
background: none repeat scroll 0 0 hsl(0, 0%, 100%);
|
||||
border-top: 1px solid hsl(0, 0%, 82%);
|
||||
box-shadow: 0 0 5px hsl(0, 0%, 87%) inset;
|
||||
}
|
||||
.dashboard-block .dashboard-block-content .dashboard-block-box {
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
.dashboard-block .dashboard-block-content .dashboard-block-box .dashboard-block-table {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
.dashboard-block-table {
|
||||
background-color: hsla(0, 0%, 0%, 0);
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
margin-bottom: 20px;
|
||||
max-width: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
.dashboard-block-table th, .dashboard-block-table td {
|
||||
border-top: 1px solid hsl(0, 0%, 87%);
|
||||
line-height: 20px;
|
||||
padding: 5px;
|
||||
text-align: left;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.dashboard-badge {
|
||||
background-color: hsl(0, 0%, 60%);
|
||||
border-radius: 9px;
|
||||
color: hsl(0, 0%, 100%);
|
||||
font-size: 11.844px;
|
||||
font-weight: bold;
|
||||
line-height: 14px;
|
||||
padding: 1px 9px 2px;
|
||||
text-shadow: 0 -1px 0 hsla(0, 0%, 0%, 0.25);
|
||||
vertical-align: baseline;
|
||||
white-space: nowrap;
|
||||
}
|
1
admin/assets/css/index.html
Normal file
1
admin/assets/css/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
1
admin/assets/images/icons/index.html
Normal file
1
admin/assets/images/icons/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
BIN
admin/assets/images/import.gif
Normal file
BIN
admin/assets/images/import.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 65 KiB |
1
admin/assets/images/index.html
Normal file
1
admin/assets/images/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
1
admin/assets/index.html
Normal file
1
admin/assets/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
20
admin/assets/js/admin.js
Normal file
20
admin/assets/js/admin.js
Normal file
@@ -0,0 +1,20 @@
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage admin.js
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* JS Document */
|
1
admin/assets/js/index.html
Normal file
1
admin/assets/js/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
87
admin/config.xml
Normal file
87
admin/config.xml
Normal file
@@ -0,0 +1,87 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<config>
|
||||
<fieldset
|
||||
addruleprefix="JCB\Component\Subformpower\Administrator\Rule"
|
||||
addfieldprefix="JCB\Component\Subformpower\Administrator\Field"
|
||||
name="global_config"
|
||||
label="COM_SUBFORMPOWER_CONFIG_GLOBAL_LABEL"
|
||||
description="COM_SUBFORMPOWER_CONFIG_GLOBAL_DESC">
|
||||
<field
|
||||
name="check_in"
|
||||
type="list"
|
||||
default="0"
|
||||
label="COM_SUBFORMPOWER_CONFIG_CHECK_TIMER_LABEL"
|
||||
description="COM_SUBFORMPOWER_CONFIG_CHECK_TIMER_DESC">
|
||||
<option
|
||||
value="-5 hours">COM_SUBFORMPOWER_CONFIG_CHECK_TIMER_OPTION_ONE</option>
|
||||
<option
|
||||
value="-12 hours">COM_SUBFORMPOWER_CONFIG_CHECK_TIMER_OPTION_TWO</option>
|
||||
<option
|
||||
value="-1 day">COM_SUBFORMPOWER_CONFIG_CHECK_TIMER_OPTION_THREE</option>
|
||||
<option
|
||||
value="-2 day">COM_SUBFORMPOWER_CONFIG_CHECK_TIMER_OPTION_FOUR</option>
|
||||
<option
|
||||
value="-1 week">COM_SUBFORMPOWER_CONFIG_CHECK_TIMER_OPTION_FIVE</option>
|
||||
<option
|
||||
value="0">COM_SUBFORMPOWER_CONFIG_CHECK_TIMER_OPTION_SIX</option>
|
||||
</field>
|
||||
<field type="spacer" name="spacerAuthor" hr="true" />
|
||||
<field
|
||||
name="save_history"
|
||||
type="radio"
|
||||
class="btn-group btn-group-yesno"
|
||||
default="1"
|
||||
label="JGLOBAL_SAVE_HISTORY_OPTIONS_LABEL"
|
||||
description="JGLOBAL_SAVE_HISTORY_OPTIONS_DESC"
|
||||
>
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
<field
|
||||
name="history_limit"
|
||||
type="text"
|
||||
filter="integer"
|
||||
label="JGLOBAL_HISTORY_LIMIT_OPTIONS_LABEL"
|
||||
description="JGLOBAL_HISTORY_LIMIT_OPTIONS_DESC"
|
||||
default="10"
|
||||
/>
|
||||
<field type="spacer" name="spacerHistory" hr="true" />
|
||||
<field name="autorTitle"
|
||||
type="spacer"
|
||||
label="COM_SUBFORMPOWER_CONFIG_AUTHOR"
|
||||
/>
|
||||
<field name="autorName"
|
||||
type="text"
|
||||
label="COM_SUBFORMPOWER_CONFIG_AUTHOR_NAME_LABEL"
|
||||
description="COM_SUBFORMPOWER_CONFIG_AUTHOR_NAME_DESC"
|
||||
size="60"
|
||||
default="Oh Martin"
|
||||
readonly="true"
|
||||
class="readonly"
|
||||
/>
|
||||
<field name="autorEmail"
|
||||
type="email"
|
||||
label="COM_SUBFORMPOWER_CONFIG_AUTHOR_EMAIL_LABEL"
|
||||
description="COM_SUBFORMPOWER_CONFIG_AUTHOR_EMAIL_DESC"
|
||||
size="60"
|
||||
default="oh@nampharm.com.na"
|
||||
readonly="true"
|
||||
class="readonly"
|
||||
/>
|
||||
</fieldset>
|
||||
<fieldset
|
||||
name="permissions"
|
||||
label="JCONFIG_PERMISSIONS_LABEL"
|
||||
description="JCONFIG_PERMISSIONS_DESC">
|
||||
<field
|
||||
name="rules"
|
||||
type="rules"
|
||||
label="JCONFIG_PERMISSIONS_LABEL"
|
||||
class="inputbox"
|
||||
validate="rules"
|
||||
filter="rules"
|
||||
component="com_subformpower"
|
||||
section="component"
|
||||
/>
|
||||
</fieldset>
|
||||
</config>
|
237
admin/forms/country.xml
Normal file
237
admin/forms/country.xml
Normal file
@@ -0,0 +1,237 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<form
|
||||
addruleprefix="JCB\Component\Subformpower\Administrator\Rule"
|
||||
addfieldprefix="JCB\Component\Subformpower\Administrator\Field"
|
||||
>
|
||||
<config>
|
||||
<inlinehelp button="show"/>
|
||||
</config>
|
||||
<fieldset name="details">
|
||||
<!-- Default Fields. -->
|
||||
<!-- Id Field. Type: Text (joomla) -->
|
||||
<field
|
||||
name="id"
|
||||
type="text" class="readonly" label="JGLOBAL_FIELD_ID_LABEL"
|
||||
description ="JGLOBAL_FIELD_ID_DESC" size="10" default="0"
|
||||
readonly="true"
|
||||
/>
|
||||
<!-- Date Created Field. Type: Calendar (joomla) -->
|
||||
<field
|
||||
name="created"
|
||||
type="calendar"
|
||||
label="COM_SUBFORMPOWER_COUNTRY_CREATED_DATE_LABEL"
|
||||
description="COM_SUBFORMPOWER_COUNTRY_CREATED_DATE_DESC"
|
||||
size="22"
|
||||
format="%Y-%m-%d %H:%M:%S"
|
||||
filter="user_utc"
|
||||
/>
|
||||
<!-- User Created Field. Type: User (joomla) -->
|
||||
<field
|
||||
name="created_by"
|
||||
type="user"
|
||||
label="COM_SUBFORMPOWER_COUNTRY_CREATED_BY_LABEL"
|
||||
description="COM_SUBFORMPOWER_COUNTRY_CREATED_BY_DESC"
|
||||
/>
|
||||
<!-- Published Field. Type: List (joomla) -->
|
||||
<field name="published" type="list" label="JSTATUS"
|
||||
description="JFIELD_PUBLISHED_DESC" class="chzn-color-state"
|
||||
filter="intval" size="1" default="1" >
|
||||
<option value="1">
|
||||
JPUBLISHED</option>
|
||||
<option value="0">
|
||||
JUNPUBLISHED</option>
|
||||
<option value="2">
|
||||
JARCHIVED</option>
|
||||
<option value="-2">
|
||||
JTRASHED</option>
|
||||
</field>
|
||||
<!-- Date Modified Field. Type: Calendar (joomla) -->
|
||||
<field name="modified" type="calendar" class="readonly"
|
||||
label="COM_SUBFORMPOWER_COUNTRY_MODIFIED_DATE_LABEL" description="COM_SUBFORMPOWER_COUNTRY_MODIFIED_DATE_DESC"
|
||||
size="22" readonly="true" format="%Y-%m-%d %H:%M:%S" filter="user_utc" />
|
||||
<!-- User Modified Field. Type: User (joomla) -->
|
||||
<field name="modified_by" type="user"
|
||||
label="COM_SUBFORMPOWER_COUNTRY_MODIFIED_BY_LABEL"
|
||||
description="COM_SUBFORMPOWER_COUNTRY_MODIFIED_BY_DESC"
|
||||
class="readonly"
|
||||
readonly="true"
|
||||
filter="unset"
|
||||
/>
|
||||
<!-- Access Field. Type: Accesslevel (joomla) -->
|
||||
<field name="access"
|
||||
type="accesslevel"
|
||||
label="JFIELD_ACCESS_LABEL"
|
||||
description="JFIELD_ACCESS_DESC"
|
||||
default="1"
|
||||
required="false"
|
||||
/>
|
||||
<!-- Ordering Field. Type: Numbers (joomla) -->
|
||||
<field
|
||||
name="ordering"
|
||||
type="number"
|
||||
class="inputbox validate-ordering"
|
||||
label="COM_SUBFORMPOWER_COUNTRY_ORDERING_LABEL"
|
||||
description=""
|
||||
default="0"
|
||||
size="6"
|
||||
required="false"
|
||||
/>
|
||||
<!-- Version Field. Type: Text (joomla) -->
|
||||
<field
|
||||
name="version"
|
||||
type="text"
|
||||
class="readonly"
|
||||
label="COM_SUBFORMPOWER_COUNTRY_VERSION_LABEL"
|
||||
description="COM_SUBFORMPOWER_COUNTRY_VERSION_DESC"
|
||||
size="6"
|
||||
default="1"
|
||||
readonly="true"
|
||||
filter="unset"
|
||||
/>
|
||||
<!-- Was added due to Permissions JS needing a Title field -->
|
||||
<!-- Let us know at gh-629 should this change -->
|
||||
<!-- https://github.com/vdm-io/Joomla-Component-Builder/issues/629#issuecomment-750117235 -->
|
||||
<field
|
||||
name="title"
|
||||
type="hidden"
|
||||
default="subformpower country"
|
||||
/>
|
||||
<!-- Dynamic Fields. -->
|
||||
<!-- Name Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="name"
|
||||
label="COM_SUBFORMPOWER_COUNTRY_NAME_LABEL"
|
||||
default=""
|
||||
description="COM_SUBFORMPOWER_COUNTRY_NAME_DESCRIPTION"
|
||||
message="COM_SUBFORMPOWER_COUNTRY_NAME_MESSAGE"
|
||||
hint="COM_SUBFORMPOWER_COUNTRY_NAME_HINT"
|
||||
/>
|
||||
<!-- Phonecode Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="phonecode"
|
||||
label="COM_SUBFORMPOWER_COUNTRY_PHONECODE_LABEL"
|
||||
default=""
|
||||
description="COM_SUBFORMPOWER_COUNTRY_PHONECODE_DESCRIPTION"
|
||||
message="COM_SUBFORMPOWER_COUNTRY_PHONECODE_MESSAGE"
|
||||
hint="COM_SUBFORMPOWER_COUNTRY_PHONECODE_HINT"
|
||||
/>
|
||||
<!-- Isothree Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="isothree"
|
||||
label="COM_SUBFORMPOWER_COUNTRY_ISOTHREE_LABEL"
|
||||
default=""
|
||||
description="COM_SUBFORMPOWER_COUNTRY_ISOTHREE_DESCRIPTION"
|
||||
message="COM_SUBFORMPOWER_COUNTRY_ISOTHREE_MESSAGE"
|
||||
hint="COM_SUBFORMPOWER_COUNTRY_ISOTHREE_HINT"
|
||||
/>
|
||||
<!-- Timezone Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="timezone"
|
||||
label="COM_SUBFORMPOWER_COUNTRY_TIMEZONE_LABEL"
|
||||
default=""
|
||||
description="COM_SUBFORMPOWER_COUNTRY_TIMEZONE_DESCRIPTION"
|
||||
message="COM_SUBFORMPOWER_COUNTRY_TIMEZONE_MESSAGE"
|
||||
hint="COM_SUBFORMPOWER_COUNTRY_TIMEZONE_HINT"
|
||||
/>
|
||||
<!-- Numcode Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="numcode"
|
||||
label="COM_SUBFORMPOWER_COUNTRY_NUMCODE_LABEL"
|
||||
default=""
|
||||
description="COM_SUBFORMPOWER_COUNTRY_NUMCODE_DESCRIPTION"
|
||||
message="COM_SUBFORMPOWER_COUNTRY_NUMCODE_MESSAGE"
|
||||
hint="COM_SUBFORMPOWER_COUNTRY_NUMCODE_HINT"
|
||||
/>
|
||||
<!-- Iso Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="iso"
|
||||
label="COM_SUBFORMPOWER_COUNTRY_ISO_LABEL"
|
||||
default=""
|
||||
description="COM_SUBFORMPOWER_COUNTRY_ISO_DESCRIPTION"
|
||||
message="COM_SUBFORMPOWER_COUNTRY_ISO_MESSAGE"
|
||||
hint="COM_SUBFORMPOWER_COUNTRY_ISO_HINT"
|
||||
/>
|
||||
<!-- Guid Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="guid"
|
||||
label="COM_SUBFORMPOWER_COUNTRY_GUID_LABEL"
|
||||
size="40"
|
||||
maxlength="40"
|
||||
description="COM_SUBFORMPOWER_COUNTRY_GUID_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="true"
|
||||
filter="CMD"
|
||||
validate="guid"
|
||||
hint="COM_SUBFORMPOWER_COUNTRY_GUID_HINT"
|
||||
/>
|
||||
<!-- Currency Field. Type: Subform. (joomla) -->
|
||||
<field
|
||||
type="subform"
|
||||
name="currency"
|
||||
label="COM_SUBFORMPOWER_COUNTRY_CURRENCY_LABEL"
|
||||
layout="joomla.form.field.subform.repeatable-table"
|
||||
multiple="true"
|
||||
buttons="add,remove,move"
|
||||
icon="list"
|
||||
max="50">
|
||||
<form hidden="true" name="list_currency_modal" repeat="true">
|
||||
<!-- Guid Field. Type: Hidden. (joomla) -->
|
||||
<field
|
||||
type="hidden"
|
||||
name="guid"
|
||||
default="0"
|
||||
filter="STRING"
|
||||
/>
|
||||
<!-- Name Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="name"
|
||||
label="COM_SUBFORMPOWER_COUNTRY_NAME_LABEL"
|
||||
default=""
|
||||
description="COM_SUBFORMPOWER_COUNTRY_NAME_DESCRIPTION"
|
||||
message="COM_SUBFORMPOWER_COUNTRY_NAME_MESSAGE"
|
||||
hint="COM_SUBFORMPOWER_COUNTRY_NAME_HINT"
|
||||
/>
|
||||
<!-- Symbol Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="symbol"
|
||||
label="COM_SUBFORMPOWER_COUNTRY_SYMBOL_LABEL"
|
||||
default=""
|
||||
description="COM_SUBFORMPOWER_COUNTRY_SYMBOL_DESCRIPTION"
|
||||
message="COM_SUBFORMPOWER_COUNTRY_SYMBOL_MESSAGE"
|
||||
hint="COM_SUBFORMPOWER_COUNTRY_SYMBOL_HINT"
|
||||
/>
|
||||
</form>
|
||||
</field>
|
||||
</fieldset>
|
||||
|
||||
<!-- Access Control Fields. -->
|
||||
<fieldset name="accesscontrol">
|
||||
<!-- Asset Id Field. Type: Hidden (joomla) -->
|
||||
<field
|
||||
name="asset_id"
|
||||
type="hidden"
|
||||
filter="unset"
|
||||
/>
|
||||
<!-- Rules Field. Type: Rules (joomla) -->
|
||||
<field
|
||||
name="rules"
|
||||
type="rules"
|
||||
label="Permissions in relation to this country"
|
||||
translate_label="false"
|
||||
filter="rules"
|
||||
validate="rules"
|
||||
class="inputbox"
|
||||
component="com_subformpower"
|
||||
section="country"
|
||||
/>
|
||||
</fieldset>
|
||||
</form>
|
169
admin/forms/currency.xml
Normal file
169
admin/forms/currency.xml
Normal file
@@ -0,0 +1,169 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<form
|
||||
addruleprefix="JCB\Component\Subformpower\Administrator\Rule"
|
||||
addfieldprefix="JCB\Component\Subformpower\Administrator\Field"
|
||||
>
|
||||
<config>
|
||||
<inlinehelp button="show"/>
|
||||
</config>
|
||||
<fieldset name="details">
|
||||
<!-- Default Fields. -->
|
||||
<!-- Id Field. Type: Text (joomla) -->
|
||||
<field
|
||||
name="id"
|
||||
type="text" class="readonly" label="JGLOBAL_FIELD_ID_LABEL"
|
||||
description ="JGLOBAL_FIELD_ID_DESC" size="10" default="0"
|
||||
readonly="true"
|
||||
/>
|
||||
<!-- Date Created Field. Type: Calendar (joomla) -->
|
||||
<field
|
||||
name="created"
|
||||
type="calendar"
|
||||
label="COM_SUBFORMPOWER_CURRENCY_CREATED_DATE_LABEL"
|
||||
description="COM_SUBFORMPOWER_CURRENCY_CREATED_DATE_DESC"
|
||||
size="22"
|
||||
format="%Y-%m-%d %H:%M:%S"
|
||||
filter="user_utc"
|
||||
/>
|
||||
<!-- User Created Field. Type: User (joomla) -->
|
||||
<field
|
||||
name="created_by"
|
||||
type="user"
|
||||
label="COM_SUBFORMPOWER_CURRENCY_CREATED_BY_LABEL"
|
||||
description="COM_SUBFORMPOWER_CURRENCY_CREATED_BY_DESC"
|
||||
/>
|
||||
<!-- Published Field. Type: List (joomla) -->
|
||||
<field name="published" type="list" label="JSTATUS"
|
||||
description="JFIELD_PUBLISHED_DESC" class="chzn-color-state"
|
||||
filter="intval" size="1" default="1" >
|
||||
<option value="1">
|
||||
JPUBLISHED</option>
|
||||
<option value="0">
|
||||
JUNPUBLISHED</option>
|
||||
<option value="2">
|
||||
JARCHIVED</option>
|
||||
<option value="-2">
|
||||
JTRASHED</option>
|
||||
</field>
|
||||
<!-- Date Modified Field. Type: Calendar (joomla) -->
|
||||
<field name="modified" type="calendar" class="readonly"
|
||||
label="COM_SUBFORMPOWER_CURRENCY_MODIFIED_DATE_LABEL" description="COM_SUBFORMPOWER_CURRENCY_MODIFIED_DATE_DESC"
|
||||
size="22" readonly="true" format="%Y-%m-%d %H:%M:%S" filter="user_utc" />
|
||||
<!-- User Modified Field. Type: User (joomla) -->
|
||||
<field name="modified_by" type="user"
|
||||
label="COM_SUBFORMPOWER_CURRENCY_MODIFIED_BY_LABEL"
|
||||
description="COM_SUBFORMPOWER_CURRENCY_MODIFIED_BY_DESC"
|
||||
class="readonly"
|
||||
readonly="true"
|
||||
filter="unset"
|
||||
/>
|
||||
<!-- Access Field. Type: Accesslevel (joomla) -->
|
||||
<field name="access"
|
||||
type="accesslevel"
|
||||
label="JFIELD_ACCESS_LABEL"
|
||||
description="JFIELD_ACCESS_DESC"
|
||||
default="1"
|
||||
required="false"
|
||||
/>
|
||||
<!-- Ordering Field. Type: Numbers (joomla) -->
|
||||
<field
|
||||
name="ordering"
|
||||
type="number"
|
||||
class="inputbox validate-ordering"
|
||||
label="COM_SUBFORMPOWER_CURRENCY_ORDERING_LABEL"
|
||||
description=""
|
||||
default="0"
|
||||
size="6"
|
||||
required="false"
|
||||
/>
|
||||
<!-- Version Field. Type: Text (joomla) -->
|
||||
<field
|
||||
name="version"
|
||||
type="text"
|
||||
class="readonly"
|
||||
label="COM_SUBFORMPOWER_CURRENCY_VERSION_LABEL"
|
||||
description="COM_SUBFORMPOWER_CURRENCY_VERSION_DESC"
|
||||
size="6"
|
||||
default="1"
|
||||
readonly="true"
|
||||
filter="unset"
|
||||
/>
|
||||
<!-- Was added due to Permissions JS needing a Title field -->
|
||||
<!-- Let us know at gh-629 should this change -->
|
||||
<!-- https://github.com/vdm-io/Joomla-Component-Builder/issues/629#issuecomment-750117235 -->
|
||||
<field
|
||||
name="title"
|
||||
type="hidden"
|
||||
default="subformpower currency"
|
||||
/>
|
||||
<!-- Dynamic Fields. -->
|
||||
<!-- Name Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="name"
|
||||
label="COM_SUBFORMPOWER_CURRENCY_NAME_LABEL"
|
||||
default=""
|
||||
description="COM_SUBFORMPOWER_CURRENCY_NAME_DESCRIPTION"
|
||||
message="COM_SUBFORMPOWER_CURRENCY_NAME_MESSAGE"
|
||||
hint="COM_SUBFORMPOWER_CURRENCY_NAME_HINT"
|
||||
/>
|
||||
<!-- Symbol Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="symbol"
|
||||
label="COM_SUBFORMPOWER_CURRENCY_SYMBOL_LABEL"
|
||||
default=""
|
||||
description="COM_SUBFORMPOWER_CURRENCY_SYMBOL_DESCRIPTION"
|
||||
message="COM_SUBFORMPOWER_CURRENCY_SYMBOL_MESSAGE"
|
||||
hint="COM_SUBFORMPOWER_CURRENCY_SYMBOL_HINT"
|
||||
/>
|
||||
<!-- Country Field. Type: Countries. (custom) -->
|
||||
<field
|
||||
type="countries"
|
||||
name="country"
|
||||
label="COM_SUBFORMPOWER_CURRENCY_COUNTRY_LABEL"
|
||||
description="COM_SUBFORMPOWER_CURRENCY_COUNTRY_DESCRIPTION"
|
||||
message="COM_SUBFORMPOWER_CURRENCY_COUNTRY_MESSAGE"
|
||||
class="list_class"
|
||||
layout="joomla.form.field.list-fancy-select"
|
||||
validate="guid"
|
||||
button="true"
|
||||
/>
|
||||
<!-- Guid Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="guid"
|
||||
label="COM_SUBFORMPOWER_CURRENCY_GUID_LABEL"
|
||||
size="40"
|
||||
maxlength="40"
|
||||
description="COM_SUBFORMPOWER_CURRENCY_GUID_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="true"
|
||||
filter="CMD"
|
||||
validate="guid"
|
||||
hint="COM_SUBFORMPOWER_CURRENCY_GUID_HINT"
|
||||
/>
|
||||
</fieldset>
|
||||
|
||||
<!-- Access Control Fields. -->
|
||||
<fieldset name="accesscontrol">
|
||||
<!-- Asset Id Field. Type: Hidden (joomla) -->
|
||||
<field
|
||||
name="asset_id"
|
||||
type="hidden"
|
||||
filter="unset"
|
||||
/>
|
||||
<!-- Rules Field. Type: Rules (joomla) -->
|
||||
<field
|
||||
name="rules"
|
||||
type="rules"
|
||||
label="Permissions in relation to this currency"
|
||||
translate_label="false"
|
||||
filter="rules"
|
||||
validate="rules"
|
||||
class="inputbox"
|
||||
component="com_subformpower"
|
||||
section="currency"
|
||||
/>
|
||||
</fieldset>
|
||||
</form>
|
98
admin/forms/filter_countries.xml
Normal file
98
admin/forms/filter_countries.xml
Normal file
@@ -0,0 +1,98 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<form
|
||||
addruleprefix="JCB\Component\Subformpower\Administrator\Rule"
|
||||
addfieldprefix="JCB\Component\Subformpower\Administrator\Field"
|
||||
>
|
||||
<fields name="filter">
|
||||
<field
|
||||
type="text"
|
||||
name="search"
|
||||
inputmode="search"
|
||||
label="COM_SUBFORMPOWER_FILTER_SEARCH"
|
||||
description="COM_SUBFORMPOWER_FILTER_SEARCH_COUNTRIES"
|
||||
hint="JSEARCH_FILTER"
|
||||
/>
|
||||
<field
|
||||
type="status"
|
||||
name="published"
|
||||
label="COM_SUBFORMPOWER_FILTER_PUBLISHED"
|
||||
description="COM_SUBFORMPOWER_FILTER_PUBLISHED_COUNTRIES"
|
||||
class="js-select-submit-on-change"
|
||||
>
|
||||
<option value="">JOPTION_SELECT_PUBLISHED</option>
|
||||
</field>
|
||||
<field
|
||||
type="accesslevel"
|
||||
name="access"
|
||||
label="JGRID_HEADING_ACCESS"
|
||||
hint="JOPTION_SELECT_ACCESS"
|
||||
multiple="true"
|
||||
class="js-select-submit-on-change"
|
||||
layout="joomla.form.field.list-fancy-select"
|
||||
/>
|
||||
<field
|
||||
type="countriesfilterphonecode"
|
||||
name="phonecode"
|
||||
label="COM_SUBFORMPOWER_COUNTRY_PHONECODE_LABEL"
|
||||
multiple="false"
|
||||
class="js-select-submit-on-change"
|
||||
/>
|
||||
<field
|
||||
type="countriesfilterisothree"
|
||||
name="isothree"
|
||||
label="COM_SUBFORMPOWER_COUNTRY_ISOTHREE_LABEL"
|
||||
multiple="false"
|
||||
class="js-select-submit-on-change"
|
||||
/>
|
||||
<field
|
||||
type="countriesfilternumcode"
|
||||
name="numcode"
|
||||
label="COM_SUBFORMPOWER_COUNTRY_NUMCODE_LABEL"
|
||||
multiple="false"
|
||||
class="js-select-submit-on-change"
|
||||
/>
|
||||
<field
|
||||
type="countriesfilteriso"
|
||||
name="iso"
|
||||
label="COM_SUBFORMPOWER_COUNTRY_ISO_LABEL"
|
||||
multiple="false"
|
||||
class="js-select-submit-on-change"
|
||||
/>
|
||||
<input type="hidden" name="form_submited" value="1"/>
|
||||
</fields>
|
||||
|
||||
<fields name="list">
|
||||
<field
|
||||
name="fullordering"
|
||||
type="list"
|
||||
label="JGLOBAL_SORT_BY"
|
||||
class="js-select-submit-on-change"
|
||||
default="a.id DESC"
|
||||
validate="options"
|
||||
>
|
||||
<option value="">JGLOBAL_SORT_BY</option>
|
||||
<option value="a.ordering ASC">JGRID_HEADING_ORDERING_ASC</option>
|
||||
<option value="a.ordering DESC">JGRID_HEADING_ORDERING_DESC</option>
|
||||
<option value="a.published ASC">JSTATUS_ASC</option>
|
||||
<option value="a.published DESC">JSTATUS_DESC</option>
|
||||
<option value="a.phonecode ASC">COM_SUBFORMPOWER_FILTER_PHONECODE_ASCENDING</option>
|
||||
<option value="a.phonecode DESC">COM_SUBFORMPOWER_FILTER_PHONECODE_DESCENDING</option>
|
||||
<option value="a.isothree ASC">COM_SUBFORMPOWER_FILTER_ISOTHREE_ASCENDING</option>
|
||||
<option value="a.isothree DESC">COM_SUBFORMPOWER_FILTER_ISOTHREE_DESCENDING</option>
|
||||
<option value="a.numcode ASC">COM_SUBFORMPOWER_FILTER_NUMCODE_ASCENDING</option>
|
||||
<option value="a.numcode DESC">COM_SUBFORMPOWER_FILTER_NUMCODE_DESCENDING</option>
|
||||
<option value="a.iso ASC">COM_SUBFORMPOWER_FILTER_ISO_ASCENDING</option>
|
||||
<option value="a.iso DESC">COM_SUBFORMPOWER_FILTER_ISO_DESCENDING</option>
|
||||
<option value="a.id ASC">JGRID_HEADING_ID_ASC</option>
|
||||
<option value="a.id DESC">JGRID_HEADING_ID_DESC</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="limit"
|
||||
type="limitbox"
|
||||
label="JGLOBAL_LIST_LIMIT"
|
||||
default="25"
|
||||
class="js-select-submit-on-change"
|
||||
/>
|
||||
</fields>
|
||||
</form>
|
71
admin/forms/filter_currencies.xml
Normal file
71
admin/forms/filter_currencies.xml
Normal file
@@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<form
|
||||
addruleprefix="JCB\Component\Subformpower\Administrator\Rule"
|
||||
addfieldprefix="JCB\Component\Subformpower\Administrator\Field"
|
||||
>
|
||||
<fields name="filter">
|
||||
<field
|
||||
type="text"
|
||||
name="search"
|
||||
inputmode="search"
|
||||
label="COM_SUBFORMPOWER_FILTER_SEARCH"
|
||||
description="COM_SUBFORMPOWER_FILTER_SEARCH_CURRENCIES"
|
||||
hint="JSEARCH_FILTER"
|
||||
/>
|
||||
<field
|
||||
type="status"
|
||||
name="published"
|
||||
label="COM_SUBFORMPOWER_FILTER_PUBLISHED"
|
||||
description="COM_SUBFORMPOWER_FILTER_PUBLISHED_CURRENCIES"
|
||||
class="js-select-submit-on-change"
|
||||
>
|
||||
<option value="">JOPTION_SELECT_PUBLISHED</option>
|
||||
</field>
|
||||
<field
|
||||
type="accesslevel"
|
||||
name="access"
|
||||
label="JGRID_HEADING_ACCESS"
|
||||
hint="JOPTION_SELECT_ACCESS"
|
||||
multiple="true"
|
||||
class="js-select-submit-on-change"
|
||||
layout="joomla.form.field.list-fancy-select"
|
||||
/>
|
||||
<field
|
||||
type="currenciesfiltersymbol"
|
||||
name="symbol"
|
||||
label="COM_SUBFORMPOWER_CURRENCY_SYMBOL_LABEL"
|
||||
multiple="false"
|
||||
class="js-select-submit-on-change"
|
||||
/>
|
||||
<input type="hidden" name="form_submited" value="1"/>
|
||||
</fields>
|
||||
|
||||
<fields name="list">
|
||||
<field
|
||||
name="fullordering"
|
||||
type="list"
|
||||
label="JGLOBAL_SORT_BY"
|
||||
class="js-select-submit-on-change"
|
||||
default="a.id DESC"
|
||||
validate="options"
|
||||
>
|
||||
<option value="">JGLOBAL_SORT_BY</option>
|
||||
<option value="a.ordering ASC">JGRID_HEADING_ORDERING_ASC</option>
|
||||
<option value="a.ordering DESC">JGRID_HEADING_ORDERING_DESC</option>
|
||||
<option value="a.published ASC">JSTATUS_ASC</option>
|
||||
<option value="a.published DESC">JSTATUS_DESC</option>
|
||||
<option value="a.symbol ASC">COM_SUBFORMPOWER_FILTER_SYMBOL_ASCENDING</option>
|
||||
<option value="a.symbol DESC">COM_SUBFORMPOWER_FILTER_SYMBOL_DESCENDING</option>
|
||||
<option value="a.id ASC">JGRID_HEADING_ID_ASC</option>
|
||||
<option value="a.id DESC">JGRID_HEADING_ID_DESC</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="limit"
|
||||
type="limitbox"
|
||||
label="JGLOBAL_LIST_LIMIT"
|
||||
default="25"
|
||||
class="js-select-submit-on-change"
|
||||
/>
|
||||
</fields>
|
||||
</form>
|
1
admin/forms/index.html
Normal file
1
admin/forms/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
1
admin/index.html
Normal file
1
admin/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
317
admin/language/en-GB/en-GB.com_subformpower.ini
Normal file
317
admin/language/en-GB/en-GB.com_subformpower.ini
Normal file
@@ -0,0 +1,317 @@
|
||||
COM_SUBFORMPOWER="Subform Power"
|
||||
COM_SUBFORMPOWER_ARCHIVED="Archived"
|
||||
COM_SUBFORMPOWER_AUTHOR="Author"
|
||||
COM_SUBFORMPOWER_BACK="Back"
|
||||
COM_SUBFORMPOWER_CLOSE_NEW="Close & New"
|
||||
COM_SUBFORMPOWER_CONFIG_AUTHOR="Author Info"
|
||||
COM_SUBFORMPOWER_CONFIG_AUTHOR_EMAIL_DESC="The email address of the author of this component."
|
||||
COM_SUBFORMPOWER_CONFIG_AUTHOR_EMAIL_LABEL="Author Email"
|
||||
COM_SUBFORMPOWER_CONFIG_AUTHOR_NAME_DESC="The name of the author of this component."
|
||||
COM_SUBFORMPOWER_CONFIG_AUTHOR_NAME_LABEL="Author Name"
|
||||
COM_SUBFORMPOWER_CONFIG_CHECK_TIMER_DESC="Set the intervals for the auto checkin fuction of tables that checks out the items to an user."
|
||||
COM_SUBFORMPOWER_CONFIG_CHECK_TIMER_LABEL="Check in timer"
|
||||
COM_SUBFORMPOWER_CONFIG_CHECK_TIMER_OPTION_FIVE="Once a week"
|
||||
COM_SUBFORMPOWER_CONFIG_CHECK_TIMER_OPTION_FOUR="Every second day"
|
||||
COM_SUBFORMPOWER_CONFIG_CHECK_TIMER_OPTION_ONE="Every five hours"
|
||||
COM_SUBFORMPOWER_CONFIG_CHECK_TIMER_OPTION_SIX="Never"
|
||||
COM_SUBFORMPOWER_CONFIG_CHECK_TIMER_OPTION_THREE="Once a day"
|
||||
COM_SUBFORMPOWER_CONFIG_CHECK_TIMER_OPTION_TWO="Every twelve hours"
|
||||
COM_SUBFORMPOWER_CONFIG_GLOBAL_DESC="The Global Parameters"
|
||||
COM_SUBFORMPOWER_CONFIG_GLOBAL_LABEL="Global"
|
||||
COM_SUBFORMPOWER_CONTRIBUTOR="Contributor"
|
||||
COM_SUBFORMPOWER_CONTRIBUTORS="Contributors"
|
||||
COM_SUBFORMPOWER_COUNTRIES="Countries"
|
||||
COM_SUBFORMPOWER_COUNTRIES_ACCESS="Countries Access"
|
||||
COM_SUBFORMPOWER_COUNTRIES_ACCESS_DESC="Allows the users in this group to access access countries"
|
||||
COM_SUBFORMPOWER_COUNTRIES_BATCH_OPTIONS="Batch process the selected Countries"
|
||||
COM_SUBFORMPOWER_COUNTRIES_BATCH_TIP="All changes will be applied to all selected Countries"
|
||||
COM_SUBFORMPOWER_COUNTRIES_BATCH_USE="Countries Batch Use"
|
||||
COM_SUBFORMPOWER_COUNTRIES_BATCH_USE_DESC="Allows the users in this group to use batch copy/update method of batch countries"
|
||||
COM_SUBFORMPOWER_COUNTRIES_CREATE="Countries Create"
|
||||
COM_SUBFORMPOWER_COUNTRIES_CREATE_DESC="Allows the users in this group to create create countries"
|
||||
COM_SUBFORMPOWER_COUNTRIES_DASHBOARD_ADD="Countries Dashboard Add"
|
||||
COM_SUBFORMPOWER_COUNTRIES_DASHBOARD_ADD_DESC="Allows the users in this group to dashboard add of country"
|
||||
COM_SUBFORMPOWER_COUNTRIES_DASHBOARD_LIST="Countries Dashboard List"
|
||||
COM_SUBFORMPOWER_COUNTRIES_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of country"
|
||||
COM_SUBFORMPOWER_COUNTRIES_DELETE="Countries Delete"
|
||||
COM_SUBFORMPOWER_COUNTRIES_DELETE_DESC="Allows the users in this group to delete delete countries"
|
||||
COM_SUBFORMPOWER_COUNTRIES_EDIT="Countries Edit"
|
||||
COM_SUBFORMPOWER_COUNTRIES_EDIT_DESC="Allows the users in this group to edit the country"
|
||||
COM_SUBFORMPOWER_COUNTRIES_EDIT_GUID="Countries Edit Guid"
|
||||
COM_SUBFORMPOWER_COUNTRIES_EDIT_GUID_DESC="Allows the users in this group to edit guid of country"
|
||||
COM_SUBFORMPOWER_COUNTRIES_EDIT_OWN="Countries Edit Own"
|
||||
COM_SUBFORMPOWER_COUNTRIES_EDIT_OWN_DESC="Allows the users in this group to edit edit own countries created by them"
|
||||
COM_SUBFORMPOWER_COUNTRIES_EDIT_STATE="Countries Edit State"
|
||||
COM_SUBFORMPOWER_COUNTRIES_EDIT_STATE_DESC="Allows the users in this group to update the state of the country"
|
||||
COM_SUBFORMPOWER_COUNTRIES_EDIT_VERSION="Countries Edit Version"
|
||||
COM_SUBFORMPOWER_COUNTRIES_EDIT_VERSION_DESC="Allows the users in this group to edit versions of version countries"
|
||||
COM_SUBFORMPOWER_COUNTRIES_EMPTYSTATE_BUTTON_ADD="Add your first country"
|
||||
COM_SUBFORMPOWER_COUNTRIES_EMPTYSTATE_CONTENT="country view (dynamic build)"
|
||||
COM_SUBFORMPOWER_COUNTRIES_EMPTYSTATE_TITLE="No countries have been created yet."
|
||||
COM_SUBFORMPOWER_COUNTRIES_EXPORT="Countries Export"
|
||||
COM_SUBFORMPOWER_COUNTRIES_EXPORT_DESC="Allows the users in this group to export export countries"
|
||||
COM_SUBFORMPOWER_COUNTRIES_IMPORT="Countries Import"
|
||||
COM_SUBFORMPOWER_COUNTRIES_IMPORT_DESC="Allows the users in this group to import import countries"
|
||||
COM_SUBFORMPOWER_COUNTRIES_N_ITEMS_ARCHIVED="%s Countries archived."
|
||||
COM_SUBFORMPOWER_COUNTRIES_N_ITEMS_ARCHIVED_1="%s Country archived."
|
||||
COM_SUBFORMPOWER_COUNTRIES_N_ITEMS_CHECKED_IN_0="No Country successfully checked in."
|
||||
COM_SUBFORMPOWER_COUNTRIES_N_ITEMS_CHECKED_IN_1="%d Country successfully checked in."
|
||||
COM_SUBFORMPOWER_COUNTRIES_N_ITEMS_CHECKED_IN_MORE="%d Countries successfully checked in."
|
||||
COM_SUBFORMPOWER_COUNTRIES_N_ITEMS_DELETED="%s Countries deleted."
|
||||
COM_SUBFORMPOWER_COUNTRIES_N_ITEMS_DELETED_1="%s Country deleted."
|
||||
COM_SUBFORMPOWER_COUNTRIES_N_ITEMS_FAILED_PUBLISHING="%s Countries failed publishing."
|
||||
COM_SUBFORMPOWER_COUNTRIES_N_ITEMS_FAILED_PUBLISHING_1="%s Country failed publishing."
|
||||
COM_SUBFORMPOWER_COUNTRIES_N_ITEMS_FEATURED="%s Countries featured."
|
||||
COM_SUBFORMPOWER_COUNTRIES_N_ITEMS_FEATURED_1="%s Country featured."
|
||||
COM_SUBFORMPOWER_COUNTRIES_N_ITEMS_PUBLISHED="%s Countries published."
|
||||
COM_SUBFORMPOWER_COUNTRIES_N_ITEMS_PUBLISHED_1="%s Country published."
|
||||
COM_SUBFORMPOWER_COUNTRIES_N_ITEMS_TRASHED="%s Countries trashed."
|
||||
COM_SUBFORMPOWER_COUNTRIES_N_ITEMS_TRASHED_1="%s Country trashed."
|
||||
COM_SUBFORMPOWER_COUNTRIES_N_ITEMS_UNFEATURED="%s Countries unfeatured."
|
||||
COM_SUBFORMPOWER_COUNTRIES_N_ITEMS_UNFEATURED_1="%s Country unfeatured."
|
||||
COM_SUBFORMPOWER_COUNTRIES_N_ITEMS_UNPUBLISHED="%s Countries unpublished."
|
||||
COM_SUBFORMPOWER_COUNTRIES_N_ITEMS_UNPUBLISHED_1="%s Country unpublished."
|
||||
COM_SUBFORMPOWER_COUNTRIES_SUBMENU="Countries Submenu"
|
||||
COM_SUBFORMPOWER_COUNTRIES_SUBMENU_DESC="Allows the users in this group to submenu of country"
|
||||
COM_SUBFORMPOWER_COUNTRY="Country"
|
||||
COM_SUBFORMPOWER_COUNTRY_CREATED_BY_DESC="The user that created this Country."
|
||||
COM_SUBFORMPOWER_COUNTRY_CREATED_BY_LABEL="Created By"
|
||||
COM_SUBFORMPOWER_COUNTRY_CREATED_DATE_DESC="The date this Country was created."
|
||||
COM_SUBFORMPOWER_COUNTRY_CREATED_DATE_LABEL="Created Date"
|
||||
COM_SUBFORMPOWER_COUNTRY_CURRENCIES="Currencies"
|
||||
COM_SUBFORMPOWER_COUNTRY_CURRENCY_LABEL="Currencies"
|
||||
COM_SUBFORMPOWER_COUNTRY_DETAILS="Details"
|
||||
COM_SUBFORMPOWER_COUNTRY_EDIT="Editing the Country"
|
||||
COM_SUBFORMPOWER_COUNTRY_ERROR_UNIQUE_ALIAS="Another Country has the same alias."
|
||||
COM_SUBFORMPOWER_COUNTRY_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Country has the same alias ."
|
||||
COM_SUBFORMPOWER_COUNTRY_GUID_DESCRIPTION="Globally Unique Identifier"
|
||||
COM_SUBFORMPOWER_COUNTRY_GUID_HINT="Auto Generated"
|
||||
COM_SUBFORMPOWER_COUNTRY_GUID_LABEL="GUID"
|
||||
COM_SUBFORMPOWER_COUNTRY_ID="Id"
|
||||
COM_SUBFORMPOWER_COUNTRY_ISOTHREE_DESCRIPTION="The isothree is set here."
|
||||
COM_SUBFORMPOWER_COUNTRY_ISOTHREE_HINT="Isothree Here!"
|
||||
COM_SUBFORMPOWER_COUNTRY_ISOTHREE_LABEL="Isothree"
|
||||
COM_SUBFORMPOWER_COUNTRY_ISOTHREE_MESSAGE="Error! Please add some isothree here."
|
||||
COM_SUBFORMPOWER_COUNTRY_ISO_DESCRIPTION="The iso is set here."
|
||||
COM_SUBFORMPOWER_COUNTRY_ISO_HINT="Iso Here!"
|
||||
COM_SUBFORMPOWER_COUNTRY_ISO_LABEL="Iso"
|
||||
COM_SUBFORMPOWER_COUNTRY_ISO_MESSAGE="Error! Please add some iso here."
|
||||
COM_SUBFORMPOWER_COUNTRY_MODIFIED_BY_DESC="The last user that modified this Country."
|
||||
COM_SUBFORMPOWER_COUNTRY_MODIFIED_BY_LABEL="Modified By"
|
||||
COM_SUBFORMPOWER_COUNTRY_MODIFIED_DATE_DESC="The date this Country was modified."
|
||||
COM_SUBFORMPOWER_COUNTRY_MODIFIED_DATE_LABEL="Modified Date"
|
||||
COM_SUBFORMPOWER_COUNTRY_MORE_STUFF="More Stuff"
|
||||
COM_SUBFORMPOWER_COUNTRY_NAME_DESCRIPTION="The name is set here."
|
||||
COM_SUBFORMPOWER_COUNTRY_NAME_HINT="Name Here!"
|
||||
COM_SUBFORMPOWER_COUNTRY_NAME_LABEL="Name"
|
||||
COM_SUBFORMPOWER_COUNTRY_NAME_MESSAGE="Error! Please add some name here."
|
||||
COM_SUBFORMPOWER_COUNTRY_NEW="A New Country"
|
||||
COM_SUBFORMPOWER_COUNTRY_NUMCODE_DESCRIPTION="The numcode is set here."
|
||||
COM_SUBFORMPOWER_COUNTRY_NUMCODE_HINT="Numcode Here!"
|
||||
COM_SUBFORMPOWER_COUNTRY_NUMCODE_LABEL="Numcode"
|
||||
COM_SUBFORMPOWER_COUNTRY_NUMCODE_MESSAGE="Error! Please add some numcode here."
|
||||
COM_SUBFORMPOWER_COUNTRY_ORDERING_LABEL="Ordering"
|
||||
COM_SUBFORMPOWER_COUNTRY_PERMISSION="Permissions"
|
||||
COM_SUBFORMPOWER_COUNTRY_PHONECODE_DESCRIPTION="The phonecode is set here."
|
||||
COM_SUBFORMPOWER_COUNTRY_PHONECODE_HINT="Phonecode Here!"
|
||||
COM_SUBFORMPOWER_COUNTRY_PHONECODE_LABEL="Phonecode"
|
||||
COM_SUBFORMPOWER_COUNTRY_PHONECODE_MESSAGE="Error! Please add some phonecode here."
|
||||
COM_SUBFORMPOWER_COUNTRY_PUBLISHING="Publishing"
|
||||
COM_SUBFORMPOWER_COUNTRY_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Country to customise the alias."
|
||||
COM_SUBFORMPOWER_COUNTRY_STATUS="Status"
|
||||
COM_SUBFORMPOWER_COUNTRY_SYMBOL_DESCRIPTION="The symbol is set here."
|
||||
COM_SUBFORMPOWER_COUNTRY_SYMBOL_HINT="Symbol Here!"
|
||||
COM_SUBFORMPOWER_COUNTRY_SYMBOL_LABEL="Symbol"
|
||||
COM_SUBFORMPOWER_COUNTRY_SYMBOL_MESSAGE="Error! Please add some symbol here."
|
||||
COM_SUBFORMPOWER_COUNTRY_TIMEZONE_DESCRIPTION="The timezone is set here."
|
||||
COM_SUBFORMPOWER_COUNTRY_TIMEZONE_HINT="Timezone Here!"
|
||||
COM_SUBFORMPOWER_COUNTRY_TIMEZONE_LABEL="Timezone"
|
||||
COM_SUBFORMPOWER_COUNTRY_TIMEZONE_MESSAGE="Error! Please add some timezone here."
|
||||
COM_SUBFORMPOWER_COUNTRY_VERSION_DESC="A count of the number of times this Country has been revised."
|
||||
COM_SUBFORMPOWER_COUNTRY_VERSION_LABEL="Version"
|
||||
COM_SUBFORMPOWER_CREATE_NEW_S="Create New %s"
|
||||
COM_SUBFORMPOWER_CURRENCIES="Currencies"
|
||||
COM_SUBFORMPOWER_CURRENCIES_ACCESS="Currencies Access"
|
||||
COM_SUBFORMPOWER_CURRENCIES_ACCESS_DESC="Allows the users in this group to access access currencies"
|
||||
COM_SUBFORMPOWER_CURRENCIES_BATCH_OPTIONS="Batch process the selected Currencies"
|
||||
COM_SUBFORMPOWER_CURRENCIES_BATCH_TIP="All changes will be applied to all selected Currencies"
|
||||
COM_SUBFORMPOWER_CURRENCIES_BATCH_USE="Currencies Batch Use"
|
||||
COM_SUBFORMPOWER_CURRENCIES_BATCH_USE_DESC="Allows the users in this group to use batch copy/update method of batch currencies"
|
||||
COM_SUBFORMPOWER_CURRENCIES_CREATE="Currencies Create"
|
||||
COM_SUBFORMPOWER_CURRENCIES_CREATE_DESC="Allows the users in this group to create create currencies"
|
||||
COM_SUBFORMPOWER_CURRENCIES_DASHBOARD_ADD="Currencies Dashboard Add"
|
||||
COM_SUBFORMPOWER_CURRENCIES_DASHBOARD_ADD_DESC="Allows the users in this group to dashboard add of currency"
|
||||
COM_SUBFORMPOWER_CURRENCIES_DASHBOARD_LIST="Currencies Dashboard List"
|
||||
COM_SUBFORMPOWER_CURRENCIES_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of currency"
|
||||
COM_SUBFORMPOWER_CURRENCIES_DELETE="Currencies Delete"
|
||||
COM_SUBFORMPOWER_CURRENCIES_DELETE_DESC="Allows the users in this group to delete delete currencies"
|
||||
COM_SUBFORMPOWER_CURRENCIES_EDIT="Currencies Edit"
|
||||
COM_SUBFORMPOWER_CURRENCIES_EDIT_DESC="Allows the users in this group to edit the currency"
|
||||
COM_SUBFORMPOWER_CURRENCIES_EDIT_GUID="Currencies Edit Guid"
|
||||
COM_SUBFORMPOWER_CURRENCIES_EDIT_GUID_DESC="Allows the users in this group to edit guid of currency"
|
||||
COM_SUBFORMPOWER_CURRENCIES_EDIT_OWN="Currencies Edit Own"
|
||||
COM_SUBFORMPOWER_CURRENCIES_EDIT_OWN_DESC="Allows the users in this group to edit edit own currencies created by them"
|
||||
COM_SUBFORMPOWER_CURRENCIES_EDIT_STATE="Currencies Edit State"
|
||||
COM_SUBFORMPOWER_CURRENCIES_EDIT_STATE_DESC="Allows the users in this group to update the state of the currency"
|
||||
COM_SUBFORMPOWER_CURRENCIES_EDIT_VERSION="Currencies Edit Version"
|
||||
COM_SUBFORMPOWER_CURRENCIES_EDIT_VERSION_DESC="Allows the users in this group to edit versions of version currencies"
|
||||
COM_SUBFORMPOWER_CURRENCIES_EMPTYSTATE_BUTTON_ADD="Add your first currency"
|
||||
COM_SUBFORMPOWER_CURRENCIES_EMPTYSTATE_CONTENT="currency view (dynamic build)"
|
||||
COM_SUBFORMPOWER_CURRENCIES_EMPTYSTATE_TITLE="No currencies have been created yet."
|
||||
COM_SUBFORMPOWER_CURRENCIES_EXPORT="Currencies Export"
|
||||
COM_SUBFORMPOWER_CURRENCIES_EXPORT_DESC="Allows the users in this group to export export currencies"
|
||||
COM_SUBFORMPOWER_CURRENCIES_IMPORT="Currencies Import"
|
||||
COM_SUBFORMPOWER_CURRENCIES_IMPORT_DESC="Allows the users in this group to import import currencies"
|
||||
COM_SUBFORMPOWER_CURRENCIES_N_ITEMS_ARCHIVED="%s Currencies archived."
|
||||
COM_SUBFORMPOWER_CURRENCIES_N_ITEMS_ARCHIVED_1="%s Currency archived."
|
||||
COM_SUBFORMPOWER_CURRENCIES_N_ITEMS_CHECKED_IN_0="No Currency successfully checked in."
|
||||
COM_SUBFORMPOWER_CURRENCIES_N_ITEMS_CHECKED_IN_1="%d Currency successfully checked in."
|
||||
COM_SUBFORMPOWER_CURRENCIES_N_ITEMS_CHECKED_IN_MORE="%d Currencies successfully checked in."
|
||||
COM_SUBFORMPOWER_CURRENCIES_N_ITEMS_DELETED="%s Currencies deleted."
|
||||
COM_SUBFORMPOWER_CURRENCIES_N_ITEMS_DELETED_1="%s Currency deleted."
|
||||
COM_SUBFORMPOWER_CURRENCIES_N_ITEMS_FAILED_PUBLISHING="%s Currencies failed publishing."
|
||||
COM_SUBFORMPOWER_CURRENCIES_N_ITEMS_FAILED_PUBLISHING_1="%s Currency failed publishing."
|
||||
COM_SUBFORMPOWER_CURRENCIES_N_ITEMS_FEATURED="%s Currencies featured."
|
||||
COM_SUBFORMPOWER_CURRENCIES_N_ITEMS_FEATURED_1="%s Currency featured."
|
||||
COM_SUBFORMPOWER_CURRENCIES_N_ITEMS_PUBLISHED="%s Currencies published."
|
||||
COM_SUBFORMPOWER_CURRENCIES_N_ITEMS_PUBLISHED_1="%s Currency published."
|
||||
COM_SUBFORMPOWER_CURRENCIES_N_ITEMS_TRASHED="%s Currencies trashed."
|
||||
COM_SUBFORMPOWER_CURRENCIES_N_ITEMS_TRASHED_1="%s Currency trashed."
|
||||
COM_SUBFORMPOWER_CURRENCIES_N_ITEMS_UNFEATURED="%s Currencies unfeatured."
|
||||
COM_SUBFORMPOWER_CURRENCIES_N_ITEMS_UNFEATURED_1="%s Currency unfeatured."
|
||||
COM_SUBFORMPOWER_CURRENCIES_N_ITEMS_UNPUBLISHED="%s Currencies unpublished."
|
||||
COM_SUBFORMPOWER_CURRENCIES_N_ITEMS_UNPUBLISHED_1="%s Currency unpublished."
|
||||
COM_SUBFORMPOWER_CURRENCIES_SUBMENU="Currencies Submenu"
|
||||
COM_SUBFORMPOWER_CURRENCIES_SUBMENU_DESC="Allows the users in this group to submenu of currency"
|
||||
COM_SUBFORMPOWER_CURRENCY="Currency"
|
||||
COM_SUBFORMPOWER_CURRENCY_COUNTRY_DESCRIPTION="The primary currency id is set here."
|
||||
COM_SUBFORMPOWER_CURRENCY_COUNTRY_LABEL="Country"
|
||||
COM_SUBFORMPOWER_CURRENCY_COUNTRY_MESSAGE="Error! Please add some primary currency id here."
|
||||
COM_SUBFORMPOWER_CURRENCY_CREATED_BY_DESC="The user that created this Currency."
|
||||
COM_SUBFORMPOWER_CURRENCY_CREATED_BY_LABEL="Created By"
|
||||
COM_SUBFORMPOWER_CURRENCY_CREATED_DATE_DESC="The date this Currency was created."
|
||||
COM_SUBFORMPOWER_CURRENCY_CREATED_DATE_LABEL="Created Date"
|
||||
COM_SUBFORMPOWER_CURRENCY_DETAILS="Details"
|
||||
COM_SUBFORMPOWER_CURRENCY_EDIT="Editing the Currency"
|
||||
COM_SUBFORMPOWER_CURRENCY_ERROR_UNIQUE_ALIAS="Another Currency has the same alias."
|
||||
COM_SUBFORMPOWER_CURRENCY_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Currency has the same alias ."
|
||||
COM_SUBFORMPOWER_CURRENCY_GUID_DESCRIPTION="Globally Unique Identifier"
|
||||
COM_SUBFORMPOWER_CURRENCY_GUID_HINT="Auto Generated"
|
||||
COM_SUBFORMPOWER_CURRENCY_GUID_LABEL="GUID"
|
||||
COM_SUBFORMPOWER_CURRENCY_ID="Id"
|
||||
COM_SUBFORMPOWER_CURRENCY_MODIFIED_BY_DESC="The last user that modified this Currency."
|
||||
COM_SUBFORMPOWER_CURRENCY_MODIFIED_BY_LABEL="Modified By"
|
||||
COM_SUBFORMPOWER_CURRENCY_MODIFIED_DATE_DESC="The date this Currency was modified."
|
||||
COM_SUBFORMPOWER_CURRENCY_MODIFIED_DATE_LABEL="Modified Date"
|
||||
COM_SUBFORMPOWER_CURRENCY_NAME_DESCRIPTION="The name is set here."
|
||||
COM_SUBFORMPOWER_CURRENCY_NAME_HINT="Name Here!"
|
||||
COM_SUBFORMPOWER_CURRENCY_NAME_LABEL="Name"
|
||||
COM_SUBFORMPOWER_CURRENCY_NAME_MESSAGE="Error! Please add some name here."
|
||||
COM_SUBFORMPOWER_CURRENCY_NEW="A New Currency"
|
||||
COM_SUBFORMPOWER_CURRENCY_ORDERING_LABEL="Ordering"
|
||||
COM_SUBFORMPOWER_CURRENCY_PERMISSION="Permissions"
|
||||
COM_SUBFORMPOWER_CURRENCY_PUBLISHING="Publishing"
|
||||
COM_SUBFORMPOWER_CURRENCY_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Currency to customise the alias."
|
||||
COM_SUBFORMPOWER_CURRENCY_STATUS="Status"
|
||||
COM_SUBFORMPOWER_CURRENCY_SYMBOL_DESCRIPTION="The symbol is set here."
|
||||
COM_SUBFORMPOWER_CURRENCY_SYMBOL_HINT="Symbol Here!"
|
||||
COM_SUBFORMPOWER_CURRENCY_SYMBOL_LABEL="Symbol"
|
||||
COM_SUBFORMPOWER_CURRENCY_SYMBOL_MESSAGE="Error! Please add some symbol here."
|
||||
COM_SUBFORMPOWER_CURRENCY_VERSION_DESC="A count of the number of times this Currency has been revised."
|
||||
COM_SUBFORMPOWER_CURRENCY_VERSION_LABEL="Version"
|
||||
COM_SUBFORMPOWER_DASH="Dashboard"
|
||||
COM_SUBFORMPOWER_DASHBOARD="Subform Power Dashboard"
|
||||
COM_SUBFORMPOWER_DASHBOARD_COUNTRIES="Countries<br /><br />"
|
||||
COM_SUBFORMPOWER_DASHBOARD_COUNTRY_ADD="Add Country<br /><br />"
|
||||
COM_SUBFORMPOWER_DASHBOARD_CURRENCIES="Currencies<br /><br />"
|
||||
COM_SUBFORMPOWER_DASHBOARD_CURRENCY_ADD="Add Currency<br /><br />"
|
||||
COM_SUBFORMPOWER_DATE="Date"
|
||||
COM_SUBFORMPOWER_EDIT_CREATED_BY="Edit Created By"
|
||||
COM_SUBFORMPOWER_EDIT_CREATED_BY_DESC="Allows users in this group to edit created by."
|
||||
COM_SUBFORMPOWER_EDIT_CREATED_DATE="Edit Created Date"
|
||||
COM_SUBFORMPOWER_EDIT_CREATED_DATE_DESC="Allows users in this group to edit created date."
|
||||
COM_SUBFORMPOWER_EDIT_S="Edit %s"
|
||||
COM_SUBFORMPOWER_EDIT_VERSIONS="Edit Version"
|
||||
COM_SUBFORMPOWER_EDIT_VERSIONS_DESC="Allows users in this group to edit versions."
|
||||
COM_SUBFORMPOWER_EXPORT_DATA="Export Data"
|
||||
COM_SUBFORMPOWER_EXPORT_DATA_DESC="Allows users in this group to export data."
|
||||
COM_SUBFORMPOWER_EXPORT_FAILED="Export Failed"
|
||||
COM_SUBFORMPOWER_FILTER_ISOTHREE_ASCENDING="Isothree ascending"
|
||||
COM_SUBFORMPOWER_FILTER_ISOTHREE_DESCENDING="Isothree descending"
|
||||
COM_SUBFORMPOWER_FILTER_ISO_ASCENDING="Iso ascending"
|
||||
COM_SUBFORMPOWER_FILTER_ISO_DESCENDING="Iso descending"
|
||||
COM_SUBFORMPOWER_FILTER_NUMCODE_ASCENDING="Numcode ascending"
|
||||
COM_SUBFORMPOWER_FILTER_NUMCODE_DESCENDING="Numcode descending"
|
||||
COM_SUBFORMPOWER_FILTER_PHONECODE_ASCENDING="Phonecode ascending"
|
||||
COM_SUBFORMPOWER_FILTER_PHONECODE_DESCENDING="Phonecode descending"
|
||||
COM_SUBFORMPOWER_FILTER_PUBLISHED="Status"
|
||||
COM_SUBFORMPOWER_FILTER_PUBLISHED_COUNTRIES="Status options for countries"
|
||||
COM_SUBFORMPOWER_FILTER_PUBLISHED_CURRENCIES="Status options for currencies"
|
||||
COM_SUBFORMPOWER_FILTER_SEARCH="Searchcountries"
|
||||
COM_SUBFORMPOWER_FILTER_SEARCH_COUNTRIES="Search the country items. Prefix with ID: to search for an item by ID."
|
||||
COM_SUBFORMPOWER_FILTER_SEARCH_CURRENCIES="Search the currency items. Prefix with ID: to search for an item by ID."
|
||||
COM_SUBFORMPOWER_FILTER_SELECT_ISO="Select Iso"
|
||||
COM_SUBFORMPOWER_FILTER_SELECT_ISOTHREE="Select Isothree"
|
||||
COM_SUBFORMPOWER_FILTER_SELECT_NUMCODE="Select Numcode"
|
||||
COM_SUBFORMPOWER_FILTER_SELECT_PHONECODE="Select Phonecode"
|
||||
COM_SUBFORMPOWER_FILTER_SELECT_SYMBOL="Select Symbol"
|
||||
COM_SUBFORMPOWER_FILTER_SYMBOL_ASCENDING="Symbol ascending"
|
||||
COM_SUBFORMPOWER_FILTER_SYMBOL_DESCENDING="Symbol descending"
|
||||
COM_SUBFORMPOWER_HELP_MANAGER="Help"
|
||||
COM_SUBFORMPOWER_IMPORT_CONTINUE="Continue"
|
||||
COM_SUBFORMPOWER_IMPORT_DATA="Import Data"
|
||||
COM_SUBFORMPOWER_IMPORT_DATA_DESC="Allows users in this group to import data."
|
||||
COM_SUBFORMPOWER_IMPORT_ERROR="Import error."
|
||||
COM_SUBFORMPOWER_IMPORT_FAILED="Import Failed"
|
||||
COM_SUBFORMPOWER_IMPORT_FILE_COLUMNS="File Columns"
|
||||
COM_SUBFORMPOWER_IMPORT_FORMATS_ACCEPTED="formats accepted"
|
||||
COM_SUBFORMPOWER_IMPORT_FROM_DIRECTORY="Directory"
|
||||
COM_SUBFORMPOWER_IMPORT_FROM_UPLOAD="Upload"
|
||||
COM_SUBFORMPOWER_IMPORT_FROM_URL="URL"
|
||||
COM_SUBFORMPOWER_IMPORT_GET_BOTTON="Get File"
|
||||
COM_SUBFORMPOWER_IMPORT_IGNORE_COLUMN="-- Ignore This Column --"
|
||||
COM_SUBFORMPOWER_IMPORT_LINK_FILE_TO_TABLE_COLUMNS="Link File to Table Columns"
|
||||
COM_SUBFORMPOWER_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE="Does not have a valid file type."
|
||||
COM_SUBFORMPOWER_IMPORT_MSG_ENTER_A_URL="Please enter a url."
|
||||
COM_SUBFORMPOWER_IMPORT_MSG_INVALID_URL="Invalid url."
|
||||
COM_SUBFORMPOWER_IMPORT_MSG_NO_FILE_SELECTED="No import file selected."
|
||||
COM_SUBFORMPOWER_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE="Path does not have a valid file."
|
||||
COM_SUBFORMPOWER_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY="Please enter the file directory."
|
||||
COM_SUBFORMPOWER_IMPORT_MSG_PLEASE_SELECT_ALL_COLUMNS="Please link all columns."
|
||||
COM_SUBFORMPOWER_IMPORT_MSG_PLEASE_SELECT_A_DIRECTORY="Please enter the file directory."
|
||||
COM_SUBFORMPOWER_IMPORT_MSG_PLEASE_SELECT_A_FILE="Please select a file to import."
|
||||
COM_SUBFORMPOWER_IMPORT_MSG_WARNIMPORTFILE="Warning, import file error."
|
||||
COM_SUBFORMPOWER_IMPORT_MSG_WARNIMPORTUPLOADERROR="Warning, import upload error."
|
||||
COM_SUBFORMPOWER_IMPORT_NO_IMPORT_TYPE_FOUND="Import type not found."
|
||||
COM_SUBFORMPOWER_IMPORT_PLEASE_SELECT_COLUMN="-- Please Select Column --"
|
||||
COM_SUBFORMPOWER_IMPORT_SELECT_FILE="Select File"
|
||||
COM_SUBFORMPOWER_IMPORT_SELECT_FILE_DIRECTORY="Set the path to file"
|
||||
COM_SUBFORMPOWER_IMPORT_SELECT_FILE_FOR_COUNTRIES="Select the file to import data to countries."
|
||||
COM_SUBFORMPOWER_IMPORT_SELECT_FILE_FOR_CURRENCIES="Select the file to import data to currencies."
|
||||
COM_SUBFORMPOWER_IMPORT_SELECT_FILE_URL="Enter file URL"
|
||||
COM_SUBFORMPOWER_IMPORT_SUCCESS="Great! Import successful."
|
||||
COM_SUBFORMPOWER_IMPORT_TABLE_COLUMNS="Table Columns"
|
||||
COM_SUBFORMPOWER_IMPORT_TITLE="Data Importer"
|
||||
COM_SUBFORMPOWER_IMPORT_UNABLE_TO_FIND_IMPORT_PACKAGE="Package to import not found."
|
||||
COM_SUBFORMPOWER_IMPORT_UPDATE_DATA="Import Data"
|
||||
COM_SUBFORMPOWER_IMPORT_UPLOAD_BOTTON="Upload File"
|
||||
COM_SUBFORMPOWER_INACTIVE="Inactive"
|
||||
COM_SUBFORMPOWER_KEEP_ORIGINAL_ACCESS="- Keep Original Access -"
|
||||
COM_SUBFORMPOWER_KEEP_ORIGINAL_CATEGORY="- Keep Original Category -"
|
||||
COM_SUBFORMPOWER_KEEP_ORIGINAL_STATE="- Keep Original State -"
|
||||
COM_SUBFORMPOWER_LICENSE="License"
|
||||
COM_SUBFORMPOWER_NEW="New"
|
||||
COM_SUBFORMPOWER_NOT_FOUND_OR_ACCESS_DENIED="Not found or access denied!"
|
||||
COM_SUBFORMPOWER_NO_ACCESS_GRANTED="No Access Granted!"
|
||||
COM_SUBFORMPOWER_PUBLISHED="Published"
|
||||
COM_SUBFORMPOWER_SAVE_SUCCESS="Great! Item successfully saved."
|
||||
COM_SUBFORMPOWER_SAVE_WARNING="The value already existed so please select another."
|
||||
COM_SUBFORMPOWER_SELECT_COUNTRY="Select country"
|
||||
COM_SUBFORMPOWER_SUBMENU_COUNTRIES="Countries"
|
||||
COM_SUBFORMPOWER_SUBMENU_CURRENCIES="Currencies"
|
||||
COM_SUBFORMPOWER_SUBMENU_DASHBOARD="Dashboard"
|
||||
COM_SUBFORMPOWER_TRASHED="Trashed"
|
||||
COM_SUBFORMPOWER_USE_BATCH="Use Batch"
|
||||
COM_SUBFORMPOWER_USE_BATCH_DESC="Allows users in this group to use batch copy/update method."
|
||||
COM_SUBFORMPOWER_VERSION="Version"
|
||||
COM_SUBFORMPOWER_WEBSITE="Website"
|
74
admin/language/en-GB/en-GB.com_subformpower.sys.ini
Normal file
74
admin/language/en-GB/en-GB.com_subformpower.sys.ini
Normal file
@@ -0,0 +1,74 @@
|
||||
COM_SUBFORMPOWER="Subform Power"
|
||||
COM_SUBFORMPOWER_CONFIGURATION="Subform Power Configuration"
|
||||
COM_SUBFORMPOWER_COUNTRIES_ACCESS="Countries Access"
|
||||
COM_SUBFORMPOWER_COUNTRIES_ACCESS_DESC="Allows the users in this group to access access countries"
|
||||
COM_SUBFORMPOWER_COUNTRIES_BATCH_USE="Countries Batch Use"
|
||||
COM_SUBFORMPOWER_COUNTRIES_BATCH_USE_DESC="Allows the users in this group to use batch copy/update method of batch countries"
|
||||
COM_SUBFORMPOWER_COUNTRIES_CREATE="Countries Create"
|
||||
COM_SUBFORMPOWER_COUNTRIES_CREATE_DESC="Allows the users in this group to create create countries"
|
||||
COM_SUBFORMPOWER_COUNTRIES_DASHBOARD_ADD="Countries Dashboard Add"
|
||||
COM_SUBFORMPOWER_COUNTRIES_DASHBOARD_ADD_DESC="Allows the users in this group to dashboard add of country"
|
||||
COM_SUBFORMPOWER_COUNTRIES_DASHBOARD_LIST="Countries Dashboard List"
|
||||
COM_SUBFORMPOWER_COUNTRIES_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of country"
|
||||
COM_SUBFORMPOWER_COUNTRIES_DELETE="Countries Delete"
|
||||
COM_SUBFORMPOWER_COUNTRIES_DELETE_DESC="Allows the users in this group to delete delete countries"
|
||||
COM_SUBFORMPOWER_COUNTRIES_EDIT="Countries Edit"
|
||||
COM_SUBFORMPOWER_COUNTRIES_EDIT_DESC="Allows the users in this group to edit the country"
|
||||
COM_SUBFORMPOWER_COUNTRIES_EDIT_GUID="Countries Edit Guid"
|
||||
COM_SUBFORMPOWER_COUNTRIES_EDIT_GUID_DESC="Allows the users in this group to edit guid of country"
|
||||
COM_SUBFORMPOWER_COUNTRIES_EDIT_OWN="Countries Edit Own"
|
||||
COM_SUBFORMPOWER_COUNTRIES_EDIT_OWN_DESC="Allows the users in this group to edit edit own countries created by them"
|
||||
COM_SUBFORMPOWER_COUNTRIES_EDIT_STATE="Countries Edit State"
|
||||
COM_SUBFORMPOWER_COUNTRIES_EDIT_STATE_DESC="Allows the users in this group to update the state of the country"
|
||||
COM_SUBFORMPOWER_COUNTRIES_EDIT_VERSION="Countries Edit Version"
|
||||
COM_SUBFORMPOWER_COUNTRIES_EDIT_VERSION_DESC="Allows the users in this group to edit versions of version countries"
|
||||
COM_SUBFORMPOWER_COUNTRIES_EXPORT="Countries Export"
|
||||
COM_SUBFORMPOWER_COUNTRIES_EXPORT_DESC="Allows the users in this group to export export countries"
|
||||
COM_SUBFORMPOWER_COUNTRIES_IMPORT="Countries Import"
|
||||
COM_SUBFORMPOWER_COUNTRIES_IMPORT_DESC="Allows the users in this group to import import countries"
|
||||
COM_SUBFORMPOWER_COUNTRIES_SUBMENU="Countries Submenu"
|
||||
COM_SUBFORMPOWER_COUNTRIES_SUBMENU_DESC="Allows the users in this group to submenu of country"
|
||||
COM_SUBFORMPOWER_CURRENCIES_ACCESS="Currencies Access"
|
||||
COM_SUBFORMPOWER_CURRENCIES_ACCESS_DESC="Allows the users in this group to access access currencies"
|
||||
COM_SUBFORMPOWER_CURRENCIES_BATCH_USE="Currencies Batch Use"
|
||||
COM_SUBFORMPOWER_CURRENCIES_BATCH_USE_DESC="Allows the users in this group to use batch copy/update method of batch currencies"
|
||||
COM_SUBFORMPOWER_CURRENCIES_CREATE="Currencies Create"
|
||||
COM_SUBFORMPOWER_CURRENCIES_CREATE_DESC="Allows the users in this group to create create currencies"
|
||||
COM_SUBFORMPOWER_CURRENCIES_DASHBOARD_ADD="Currencies Dashboard Add"
|
||||
COM_SUBFORMPOWER_CURRENCIES_DASHBOARD_ADD_DESC="Allows the users in this group to dashboard add of currency"
|
||||
COM_SUBFORMPOWER_CURRENCIES_DASHBOARD_LIST="Currencies Dashboard List"
|
||||
COM_SUBFORMPOWER_CURRENCIES_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of currency"
|
||||
COM_SUBFORMPOWER_CURRENCIES_DELETE="Currencies Delete"
|
||||
COM_SUBFORMPOWER_CURRENCIES_DELETE_DESC="Allows the users in this group to delete delete currencies"
|
||||
COM_SUBFORMPOWER_CURRENCIES_EDIT="Currencies Edit"
|
||||
COM_SUBFORMPOWER_CURRENCIES_EDIT_DESC="Allows the users in this group to edit the currency"
|
||||
COM_SUBFORMPOWER_CURRENCIES_EDIT_GUID="Currencies Edit Guid"
|
||||
COM_SUBFORMPOWER_CURRENCIES_EDIT_GUID_DESC="Allows the users in this group to edit guid of currency"
|
||||
COM_SUBFORMPOWER_CURRENCIES_EDIT_OWN="Currencies Edit Own"
|
||||
COM_SUBFORMPOWER_CURRENCIES_EDIT_OWN_DESC="Allows the users in this group to edit edit own currencies created by them"
|
||||
COM_SUBFORMPOWER_CURRENCIES_EDIT_STATE="Currencies Edit State"
|
||||
COM_SUBFORMPOWER_CURRENCIES_EDIT_STATE_DESC="Allows the users in this group to update the state of the currency"
|
||||
COM_SUBFORMPOWER_CURRENCIES_EDIT_VERSION="Currencies Edit Version"
|
||||
COM_SUBFORMPOWER_CURRENCIES_EDIT_VERSION_DESC="Allows the users in this group to edit versions of version currencies"
|
||||
COM_SUBFORMPOWER_CURRENCIES_EXPORT="Currencies Export"
|
||||
COM_SUBFORMPOWER_CURRENCIES_EXPORT_DESC="Allows the users in this group to export export currencies"
|
||||
COM_SUBFORMPOWER_CURRENCIES_IMPORT="Currencies Import"
|
||||
COM_SUBFORMPOWER_CURRENCIES_IMPORT_DESC="Allows the users in this group to import import currencies"
|
||||
COM_SUBFORMPOWER_CURRENCIES_SUBMENU="Currencies Submenu"
|
||||
COM_SUBFORMPOWER_CURRENCIES_SUBMENU_DESC="Allows the users in this group to submenu of currency"
|
||||
COM_SUBFORMPOWER_EDIT_CREATED_BY="Edit Created By"
|
||||
COM_SUBFORMPOWER_EDIT_CREATED_BY_DESC="Allows users in this group to edit created by."
|
||||
COM_SUBFORMPOWER_EDIT_CREATED_DATE="Edit Created Date"
|
||||
COM_SUBFORMPOWER_EDIT_CREATED_DATE_DESC="Allows users in this group to edit created date."
|
||||
COM_SUBFORMPOWER_EDIT_VERSIONS="Edit Version"
|
||||
COM_SUBFORMPOWER_EDIT_VERSIONS_DESC="Allows users in this group to edit versions."
|
||||
COM_SUBFORMPOWER_EXPORT_DATA="Export Data"
|
||||
COM_SUBFORMPOWER_EXPORT_DATA_DESC="Allows users in this group to export data."
|
||||
COM_SUBFORMPOWER_IMPORT_DATA="Import Data"
|
||||
COM_SUBFORMPOWER_IMPORT_DATA_DESC="Allows users in this group to import data."
|
||||
COM_SUBFORMPOWER_MENU="» Subform Power"
|
||||
COM_SUBFORMPOWER_MENU_COUNTRIES="Countries"
|
||||
COM_SUBFORMPOWER_MENU_CURRENCIES="Currencies"
|
||||
COM_SUBFORMPOWER_MENU_DASHBOARD="Dashboard"
|
||||
COM_SUBFORMPOWER_USE_BATCH="Use Batch"
|
||||
COM_SUBFORMPOWER_USE_BATCH_DESC="Allows users in this group to use batch copy/update method."
|
1
admin/language/en-GB/index.html
Normal file
1
admin/language/en-GB/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
1
admin/language/index.html
Normal file
1
admin/language/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
161
admin/layouts/country/currencies_fullwidth.php
Normal file
161
admin/layouts/country/currencies_fullwidth.php
Normal file
@@ -0,0 +1,161 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage currencies_fullwidth.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\HTML\HTMLHelper as Html;
|
||||
use JCB\Component\Subformpower\Administrator\Helper\SubformpowerHelper;
|
||||
use JCB\Joomla\Utilities\StringHelper;
|
||||
use JCB\Joomla\Utilities\ArrayHelper;
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
// set the defaults
|
||||
$items = $displayData->vvvcurrencies;
|
||||
$user = Factory::getApplication()->getIdentity();
|
||||
$id = $displayData->item->id;
|
||||
// set the edit URL
|
||||
$edit = "index.php?option=com_subformpower&view=currencies&task=currency.edit";
|
||||
// set a return value
|
||||
$return = ($id) ? "index.php?option=com_subformpower&view=country&layout=edit&id=" . $id : "";
|
||||
// check for a return value
|
||||
$jinput = Factory::getApplication()->input;
|
||||
if ($_return = $jinput->get('return', null, 'base64'))
|
||||
{
|
||||
$return .= "&return=" . $_return;
|
||||
}
|
||||
// check if return value was set
|
||||
if (StringHelper::check($return))
|
||||
{
|
||||
// set the referral values
|
||||
$ref = ($id) ? "&ref=country&refid=" . $id . "&return=" . urlencode(base64_encode($return)) : "&return=" . urlencode(base64_encode($return));
|
||||
}
|
||||
else
|
||||
{
|
||||
$ref = ($id) ? "&ref=country&refid=" . $id : "";
|
||||
}
|
||||
// set the create new URL
|
||||
$new = "index.php?option=com_subformpower&view=currencies&task=currency.edit" . $ref;
|
||||
// set the create new and close URL
|
||||
$close_new = "index.php?option=com_subformpower&view=currencies&task=currency.edit";
|
||||
// load the action object
|
||||
$can = SubformpowerHelper::getActions('currency');
|
||||
|
||||
?>
|
||||
<div class="form-vertical">
|
||||
<?php if ($can->get('currency.create')): ?>
|
||||
<div class="btn-group">
|
||||
<a class="btn btn-small btn-success" href="<?php echo $new; ?>"><span class="icon-new icon-white"></span> <?php echo Text::_('COM_SUBFORMPOWER_NEW'); ?></a>
|
||||
<a class="btn btn-small" onclick="Joomla.submitbutton('country.cancel');" href="<?php echo $close_new; ?>"><span class="icon-new"></span> <?php echo Text::_('COM_SUBFORMPOWER_CLOSE_NEW'); ?></a>
|
||||
</div><br /><br />
|
||||
<?php endif; ?>
|
||||
<?php if (ArrayHelper::check($items)): ?>
|
||||
<table class="footable table data currencies metro-blue" data-page-size="20" data-filter="#filter_currencies">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-toggle="true">
|
||||
<?php echo Text::_('COM_SUBFORMPOWER_CURRENCY_NAME_LABEL'); ?>
|
||||
</th>
|
||||
<th data-hide="phone">
|
||||
<?php echo Text::_('COM_SUBFORMPOWER_CURRENCY_SYMBOL_LABEL'); ?>
|
||||
</th>
|
||||
<th data-hide="phone">
|
||||
<?php echo Text::_('COM_SUBFORMPOWER_CURRENCY_COUNTRY_LABEL'); ?>
|
||||
</th>
|
||||
<th width="10" data-hide="phone,tablet">
|
||||
<?php echo Text::_('COM_SUBFORMPOWER_CURRENCY_STATUS'); ?>
|
||||
</th>
|
||||
<th width="5" data-type="numeric" data-hide="phone,tablet">
|
||||
<?php echo Text::_('COM_SUBFORMPOWER_CURRENCY_ID'); ?>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($items as $i => $item): ?>
|
||||
<?php
|
||||
$canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $user->id || $item->checked_out == 0;
|
||||
$userChkOut = Factory::getContainer()->
|
||||
get(\Joomla\CMS\User\UserFactoryInterface::class)->
|
||||
loadUserById($item->checked_out);
|
||||
$canDo = SubformpowerHelper::getActions('currency',$item,'currencies');
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<?php if ($canDo->get('currency.edit')): ?>
|
||||
<a href="<?php echo $edit; ?>&id=<?php echo $item->id; ?><?php echo $ref; ?>"><?php echo $displayData->escape($item->name); ?></a>
|
||||
<?php if ($item->checked_out): ?>
|
||||
<?php echo Html::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'currencies.', $canCheckin); ?>
|
||||
<?php endif; ?>
|
||||
<?php else: ?>
|
||||
<?php echo $displayData->escape($item->name); ?>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $displayData->escape($item->symbol); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $displayData->escape($item->country_name); ?>
|
||||
</td>
|
||||
<?php if ($item->published == 1): ?>
|
||||
<td class="center" data-value="1">
|
||||
<span class="status-metro status-published" title="<?php echo Text::_('COM_SUBFORMPOWER_PUBLISHED'); ?>">
|
||||
<?php echo Text::_('COM_SUBFORMPOWER_PUBLISHED'); ?>
|
||||
</span>
|
||||
</td>
|
||||
<?php elseif ($item->published == 0): ?>
|
||||
<td class="center" data-value="2">
|
||||
<span class="status-metro status-inactive" title="<?php echo Text::_('COM_SUBFORMPOWER_INACTIVE'); ?>">
|
||||
<?php echo Text::_('COM_SUBFORMPOWER_INACTIVE'); ?>
|
||||
</span>
|
||||
</td>
|
||||
<?php elseif ($item->published == 2): ?>
|
||||
<td class="center" data-value="3">
|
||||
<span class="status-metro status-archived" title="<?php echo Text::_('COM_SUBFORMPOWER_ARCHIVED'); ?>">
|
||||
<?php echo Text::_('COM_SUBFORMPOWER_ARCHIVED'); ?>
|
||||
</span>
|
||||
</td>
|
||||
<?php elseif ($item->published == -2): ?>
|
||||
<td class="center" data-value="4">
|
||||
<span class="status-metro status-trashed" title="<?php echo Text::_('COM_SUBFORMPOWER_TRASHED'); ?>">
|
||||
<?php echo Text::_('COM_SUBFORMPOWER_TRASHED'); ?>
|
||||
</span>
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
<td class="nowrap center hidden-phone">
|
||||
<?php echo $item->id; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
<tfoot class="hide-if-no-paging">
|
||||
<tr>
|
||||
<td colspan="5">
|
||||
<div class="pagination pagination-centered"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<?php else: ?>
|
||||
<div class="alert alert-no-items">
|
||||
<?php echo Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
61
admin/layouts/country/details_above.php
Normal file
61
admin/layouts/country/details_above.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage details_above.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: [
|
||||
'name'
|
||||
];
|
||||
|
||||
// Ensure $fields is treated as an array and count its size.
|
||||
$size = count((array) $fields);
|
||||
|
||||
// Use a ternary operator to determine the class.
|
||||
// If there are 1 to 4 fields, set the class to divide the 12-grid column equally among the fields.
|
||||
// For more than 4 fields, default to four columns (3-grid each) for medium and larger screens.
|
||||
$css_class = ($size > 0 && $size <= 4) ? 'col-12 col-md-' . round(12 / $size) : 'col-12 col-md-3';
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: [];
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<div class="row title-alias form-vertical mb-3">
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, ['class' => $css_class . ' control-wrapper-' . $field]); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
53
admin/layouts/country/details_left.php
Normal file
53
admin/layouts/country/details_left.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage details_left.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'iso',
|
||||
'numcode',
|
||||
'timezone'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: [];
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
52
admin/layouts/country/details_right.php
Normal file
52
admin/layouts/country/details_right.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage details_right.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'isothree',
|
||||
'phonecode'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: [];
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
1
admin/layouts/country/index.html
Normal file
1
admin/layouts/country/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
53
admin/layouts/country/more_stuff_fullwidth.php
Normal file
53
admin/layouts/country/more_stuff_fullwidth.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage more_stuff_fullwidth.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'currency'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: [];
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<div class="form-vertical">
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
56
admin/layouts/country/publishing.php
Normal file
56
admin/layouts/country/publishing.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage publishing.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'guid',
|
||||
'title',
|
||||
'created',
|
||||
'created_by',
|
||||
'modified',
|
||||
'modified_by'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: [];
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
56
admin/layouts/country/publlshing.php
Normal file
56
admin/layouts/country/publlshing.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage publlshing.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'published',
|
||||
'ordering',
|
||||
'access',
|
||||
'version',
|
||||
'hits',
|
||||
'id'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: [];
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
61
admin/layouts/currency/details_above.php
Normal file
61
admin/layouts/currency/details_above.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage details_above.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: [
|
||||
'name'
|
||||
];
|
||||
|
||||
// Ensure $fields is treated as an array and count its size.
|
||||
$size = count((array) $fields);
|
||||
|
||||
// Use a ternary operator to determine the class.
|
||||
// If there are 1 to 4 fields, set the class to divide the 12-grid column equally among the fields.
|
||||
// For more than 4 fields, default to four columns (3-grid each) for medium and larger screens.
|
||||
$css_class = ($size > 0 && $size <= 4) ? 'col-12 col-md-' . round(12 / $size) : 'col-12 col-md-3';
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: [];
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<div class="row title-alias form-vertical mb-3">
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, ['class' => $css_class . ' control-wrapper-' . $field]); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
51
admin/layouts/currency/details_left.php
Normal file
51
admin/layouts/currency/details_left.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage details_left.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'symbol'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: [];
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
51
admin/layouts/currency/details_right.php
Normal file
51
admin/layouts/currency/details_right.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage details_right.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'country'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: [];
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
1
admin/layouts/currency/index.html
Normal file
1
admin/layouts/currency/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
56
admin/layouts/currency/publishing.php
Normal file
56
admin/layouts/currency/publishing.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage publishing.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'guid',
|
||||
'title',
|
||||
'created',
|
||||
'created_by',
|
||||
'modified',
|
||||
'modified_by'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: [];
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
56
admin/layouts/currency/publlshing.php
Normal file
56
admin/layouts/currency/publlshing.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage publlshing.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'published',
|
||||
'ordering',
|
||||
'access',
|
||||
'version',
|
||||
'hits',
|
||||
'id'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: [];
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
1
admin/presets/index.html
Normal file
1
admin/presets/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
1
admin/services/index.html
Normal file
1
admin/services/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
87
admin/services/provider.php
Normal file
87
admin/services/provider.php
Normal file
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage provider.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// The power autoloader for this project (JPATH_ADMINISTRATOR) area.
|
||||
$power_autoloader = JPATH_ADMINISTRATOR . '/components/com_subformpower/src/Helper/PowerloaderHelper.php';
|
||||
if (file_exists($power_autoloader))
|
||||
{
|
||||
require_once $power_autoloader;
|
||||
}
|
||||
|
||||
// (soon) use Joomla\CMS\Association\AssociationExtensionInterface;
|
||||
use Joomla\CMS\Categories\CategoryFactoryInterface;
|
||||
use Joomla\CMS\Component\Router\RouterFactoryInterface;
|
||||
use Joomla\CMS\Dispatcher\ComponentDispatcherFactoryInterface;
|
||||
use Joomla\CMS\Extension\ComponentInterface;
|
||||
use Joomla\CMS\Extension\Service\Provider\CategoryFactory;
|
||||
use Joomla\CMS\Extension\Service\Provider\ComponentDispatcherFactory;
|
||||
use Joomla\CMS\Extension\Service\Provider\MVCFactory;
|
||||
use Joomla\CMS\Extension\Service\Provider\RouterFactory;
|
||||
use Joomla\CMS\HTML\Registry;
|
||||
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
|
||||
use JCB\Component\Subformpower\Administrator\Extension\SubformpowerComponent;
|
||||
// (soon) use JCB\Component\Subformpower\Administrator\Helper\AssociationsHelper;
|
||||
use Joomla\DI\Container;
|
||||
use Joomla\DI\ServiceProviderInterface;
|
||||
|
||||
// No direct access to this file
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* The JCB Subformpower service provider.
|
||||
*
|
||||
* @since 4.0.0
|
||||
*/
|
||||
return new class () implements ServiceProviderInterface
|
||||
{
|
||||
/**
|
||||
* Registers the service provider with a DI container.
|
||||
*
|
||||
* @param Container $container The DI container.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 4.0.0
|
||||
*/
|
||||
public function register(Container $container)
|
||||
{
|
||||
// (soon) $container->set(AssociationExtensionInterface::class, new AssociationsHelper());
|
||||
|
||||
$container->registerServiceProvider(new CategoryFactory('\\JCB\\Component\\Subformpower'));
|
||||
$container->registerServiceProvider(new MVCFactory('\\JCB\\Component\\Subformpower'));
|
||||
$container->registerServiceProvider(new ComponentDispatcherFactory('\\JCB\\Component\\Subformpower'));
|
||||
$container->registerServiceProvider(new RouterFactory('\\JCB\\Component\\Subformpower'));
|
||||
|
||||
$container->set(
|
||||
ComponentInterface::class,
|
||||
function (Container $container) {
|
||||
$component = new SubformpowerComponent($container->get(ComponentDispatcherFactoryInterface::class));
|
||||
|
||||
$component->setRegistry($container->get(Registry::class));
|
||||
$component->setMVCFactory($container->get(MVCFactoryInterface::class));
|
||||
$component->setCategoryFactory($container->get(CategoryFactoryInterface::class));
|
||||
// (soon) $component->setAssociationExtension($container->get(AssociationExtensionInterface::class));
|
||||
$component->setRouterFactory($container->get(RouterFactoryInterface::class));
|
||||
|
||||
return $component;
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
1
admin/sql/index.html
Normal file
1
admin/sql/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
66
admin/sql/install.mysql.utf8.sql
Normal file
66
admin/sql/install.mysql.utf8.sql
Normal file
@@ -0,0 +1,66 @@
|
||||
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
|
||||
SET time_zone = "+00:00";
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `#__subformpower_country` (
|
||||
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.',
|
||||
`guid` VARCHAR(36) NOT NULL DEFAULT '',
|
||||
`iso` VARCHAR(255) NOT NULL DEFAULT '',
|
||||
`isothree` VARCHAR(255) NOT NULL DEFAULT '',
|
||||
`name` VARCHAR(255) NOT NULL DEFAULT '',
|
||||
`numcode` VARCHAR(255) NOT NULL DEFAULT '',
|
||||
`phonecode` VARCHAR(255) NOT NULL DEFAULT '',
|
||||
`timezone` VARCHAR(255) NOT NULL DEFAULT '',
|
||||
`params` TEXT NULL,
|
||||
`published` TINYINT(3) NOT NULL DEFAULT 1,
|
||||
`created_by` INT(10) unsigned NOT NULL DEFAULT 0,
|
||||
`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,
|
||||
`created` DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
`modified` DATETIME DEFAULT NULL,
|
||||
`checked_out` int(11) unsigned NOT NULL DEFAULT 0,
|
||||
`checked_out_time` DATETIME DEFAULT NULL,
|
||||
`version` INT(10) unsigned NOT NULL DEFAULT 1,
|
||||
`hits` INT(10) unsigned NOT NULL DEFAULT 0,
|
||||
`access` INT(10) unsigned NOT NULL DEFAULT 0,
|
||||
`ordering` INT(11) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_name` (`name`),
|
||||
KEY `idx_guid` (`guid`),
|
||||
KEY `idx_access` (`access`),
|
||||
KEY `idx_checkout` (`checked_out`),
|
||||
KEY `idx_createdby` (`created_by`),
|
||||
KEY `idx_modifiedby` (`modified_by`),
|
||||
KEY `idx_state` (`published`)
|
||||
) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8 DEFAULT COLLATE=utf8_general_ci;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `#__subformpower_currency` (
|
||||
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.',
|
||||
`country` VARCHAR(36) NOT NULL DEFAULT '',
|
||||
`guid` VARCHAR(36) NOT NULL DEFAULT '',
|
||||
`name` VARCHAR(255) NOT NULL DEFAULT '',
|
||||
`symbol` VARCHAR(255) NULL DEFAULT '',
|
||||
`params` TEXT NULL,
|
||||
`published` TINYINT(3) NOT NULL DEFAULT 1,
|
||||
`created_by` INT(10) unsigned NOT NULL DEFAULT 0,
|
||||
`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,
|
||||
`created` DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
`modified` DATETIME DEFAULT NULL,
|
||||
`checked_out` int(11) unsigned NOT NULL DEFAULT 0,
|
||||
`checked_out_time` DATETIME DEFAULT NULL,
|
||||
`version` INT(10) unsigned NOT NULL DEFAULT 1,
|
||||
`hits` INT(10) unsigned NOT NULL DEFAULT 0,
|
||||
`access` INT(10) unsigned NOT NULL DEFAULT 0,
|
||||
`ordering` INT(11) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_name` (`name`),
|
||||
KEY `idx_country` (`country`),
|
||||
KEY `idx_guid` (`guid`),
|
||||
KEY `idx_access` (`access`),
|
||||
KEY `idx_checkout` (`checked_out`),
|
||||
KEY `idx_createdby` (`created_by`),
|
||||
KEY `idx_modifiedby` (`modified_by`),
|
||||
KEY `idx_state` (`published`)
|
||||
) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8 DEFAULT COLLATE=utf8_general_ci;
|
||||
|
||||
|
3
admin/sql/uninstall.mysql.utf8.sql
Normal file
3
admin/sql/uninstall.mysql.utf8.sql
Normal file
@@ -0,0 +1,3 @@
|
||||
DROP TABLE IF EXISTS `#__subformpower_country`;
|
||||
DROP TABLE IF EXISTS `#__subformpower_currency`;
|
||||
|
1
admin/sql/updates/index.html
Normal file
1
admin/sql/updates/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
1
admin/sql/updates/mysql/index.html
Normal file
1
admin/sql/updates/mysql/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
1
admin/sql/xml/index.html
Normal file
1
admin/sql/xml/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
128
admin/src/Controller/CountriesController.php
Normal file
128
admin/src/Controller/CountriesController.php
Normal file
@@ -0,0 +1,128 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage CountriesController.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
namespace JCB\Component\Subformpower\Administrator\Controller;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\MVC\Controller\AdminController;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
use Joomla\CMS\Router\Route;
|
||||
use Joomla\CMS\Session\Session;
|
||||
use JCB\Component\Subformpower\Administrator\Helper\SubformpowerHelper;
|
||||
use JCB\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
|
||||
use JCB\Joomla\Utilities\ObjectHelper;
|
||||
|
||||
// No direct access to this file
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* Countries Admin Controller
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
class CountriesController extends AdminController
|
||||
{
|
||||
/**
|
||||
* The prefix to use with controller messages.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $text_prefix = 'COM_SUBFORMPOWER_COUNTRIES';
|
||||
|
||||
/**
|
||||
* Proxy for getModel.
|
||||
*
|
||||
* @param string $name The model name. Optional.
|
||||
* @param string $prefix The class prefix. Optional.
|
||||
* @param array $config Configuration array for model. Optional.
|
||||
*
|
||||
* @return \Joomla\CMS\MVC\Model\BaseDatabaseModel
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getModel($name = 'Country', $prefix = 'Administrator', $config = ['ignore_request' => true])
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
}
|
||||
|
||||
public function exportData()
|
||||
{
|
||||
// Check for request forgeries
|
||||
Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
|
||||
// check if export is allowed for this user.
|
||||
$user = Factory::getApplication()->getIdentity();
|
||||
if ($user->authorise('country.export', 'com_subformpower') && $user->authorise('core.export', 'com_subformpower'))
|
||||
{
|
||||
// Get the input
|
||||
$input = Factory::getApplication()->input;
|
||||
$pks = $input->post->get('cid', array(), 'array');
|
||||
// Sanitize the input
|
||||
$pks = ArrayHelper::toInteger($pks);
|
||||
// Get the model
|
||||
$model = $this->getModel('Countries');
|
||||
// get the data to export
|
||||
$data = $model->getExportData($pks);
|
||||
if (UtilitiesArrayHelper::check($data))
|
||||
{
|
||||
// now set the data to the spreadsheet
|
||||
$date = Factory::getDate();
|
||||
SubformpowerHelper::xls($data,'Countries_'.$date->format('jS_F_Y'),'Countries exported ('.$date->format('jS F, Y').')','countries');
|
||||
}
|
||||
}
|
||||
// Redirect to the list screen with error.
|
||||
$message = Text::_('COM_SUBFORMPOWER_EXPORT_FAILED');
|
||||
$this->setRedirect(Route::_('index.php?option=com_subformpower&view=countries', false), $message, 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
public function importData()
|
||||
{
|
||||
// Check for request forgeries
|
||||
Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
|
||||
// check if import is allowed for this user.
|
||||
$user = Factory::getApplication()->getIdentity();
|
||||
if ($user->authorise('country.import', 'com_subformpower') && $user->authorise('core.import', 'com_subformpower'))
|
||||
{
|
||||
// Get the import model
|
||||
$model = $this->getModel('Countries');
|
||||
// get the headers to import
|
||||
$headers = $model->getExImPortHeaders();
|
||||
if (ObjectHelper::check($headers))
|
||||
{
|
||||
// Load headers to session.
|
||||
$session = Factory::getSession();
|
||||
$headers = json_encode($headers);
|
||||
$session->set('country_VDM_IMPORTHEADERS', $headers);
|
||||
$session->set('backto_VDM_IMPORT', 'countries');
|
||||
$session->set('dataType_VDM_IMPORTINTO', 'country');
|
||||
// Redirect to import view.
|
||||
$message = Text::_('COM_SUBFORMPOWER_IMPORT_SELECT_FILE_FOR_COUNTRIES');
|
||||
$this->setRedirect(Route::_('index.php?option=com_subformpower&view=import', false), $message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Redirect to the list screen with error.
|
||||
$message = Text::_('COM_SUBFORMPOWER_IMPORT_FAILED');
|
||||
$this->setRedirect(Route::_('index.php?option=com_subformpower&view=countries', false), $message, 'error');
|
||||
return;
|
||||
}
|
||||
}
|
352
admin/src/Controller/CountryController.php
Normal file
352
admin/src/Controller/CountryController.php
Normal file
@@ -0,0 +1,352 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage CountryController.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
namespace JCB\Component\Subformpower\Administrator\Controller;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Form\FormFactoryInterface;
|
||||
use Joomla\CMS\Application\CMSApplication;
|
||||
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
|
||||
use Joomla\Input\Input;
|
||||
use Joomla\CMS\Versioning\VersionableControllerTrait;
|
||||
use Joomla\CMS\MVC\Controller\FormController;
|
||||
use Joomla\CMS\MVC\Model\BaseDatabaseModel;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
use Joomla\CMS\Router\Route;
|
||||
use Joomla\CMS\Session\Session;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
use JCB\Component\Subformpower\Administrator\Helper\SubformpowerHelper;
|
||||
|
||||
// No direct access to this file
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* Country Form Controller
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
class CountryController extends FormController
|
||||
{
|
||||
use VersionableControllerTrait;
|
||||
|
||||
/**
|
||||
* The prefix to use with controller messages.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $text_prefix = 'COM_SUBFORMPOWER_COUNTRY';
|
||||
|
||||
/**
|
||||
* Current or most recently performed task.
|
||||
*
|
||||
* @var string
|
||||
* @since 12.2
|
||||
* @note Replaces _task.
|
||||
*/
|
||||
protected $task;
|
||||
|
||||
/**
|
||||
* The URL view list variable.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $view_list = 'countries';
|
||||
|
||||
/**
|
||||
* Method override to check if you can add a new record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowAdd($data = [])
|
||||
{
|
||||
// Get user object.
|
||||
$user = $this->app->getIdentity();
|
||||
// Access check.
|
||||
$access = $user->authorise('country.access', 'com_subformpower');
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('country.create', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can edit an existing record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
* @param string $key The name of the key for the primary key.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowEdit($data = [], $key = 'id')
|
||||
{
|
||||
// get user object.
|
||||
$user = $this->app->getIdentity();
|
||||
// get record id.
|
||||
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('country.access', 'com_subformpower.country.' . (int) $recordId) && $user->authorise('country.access', 'com_subformpower'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($recordId)
|
||||
{
|
||||
// The record has been set. Check the record permissions.
|
||||
$permission = $user->authorise('country.edit', 'com_subformpower.country.' . (int) $recordId);
|
||||
if (!$permission)
|
||||
{
|
||||
if ($user->authorise('country.edit.own', 'com_subformpower.country.' . $recordId))
|
||||
{
|
||||
// Now test the owner is the user.
|
||||
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
|
||||
if (empty($ownerId))
|
||||
{
|
||||
// Need to do a lookup from the model.
|
||||
$record = $this->getModel()->getItem($recordId);
|
||||
|
||||
if (empty($record))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
$ownerId = $record->created_by;
|
||||
}
|
||||
|
||||
// If the owner matches 'me' then allow.
|
||||
if ($ownerId == $user->id)
|
||||
{
|
||||
if ($user->authorise('country.edit.own', 'com_subformpower'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Since there is no permission, revert to the component permissions.
|
||||
return $user->authorise('country.edit', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the URL arguments to append to an item redirect.
|
||||
*
|
||||
* @param integer $recordId The primary key id for the item.
|
||||
* @param string $urlVar The name of the URL variable for the id.
|
||||
*
|
||||
* @return string The arguments to append to the redirect URL.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
|
||||
{
|
||||
// get the referral options (old method use return instead see parent)
|
||||
$ref = $this->input->get('ref', 0, 'string');
|
||||
$refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// get redirect info.
|
||||
$append = parent::getRedirectToItemAppend($recordId, $urlVar);
|
||||
|
||||
// set the referral options
|
||||
if ($refid && $ref)
|
||||
{
|
||||
$append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append;
|
||||
}
|
||||
elseif ($ref)
|
||||
{
|
||||
$append = '&ref='. (string) $ref . $append;
|
||||
}
|
||||
|
||||
return $append;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to run batch operations.
|
||||
*
|
||||
* @param object $model The model.
|
||||
*
|
||||
* @return boolean True if successful, false otherwise and internal error is set.
|
||||
*
|
||||
* @since 2.5
|
||||
*/
|
||||
public function batch($model = null)
|
||||
{
|
||||
Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
|
||||
|
||||
// Set the model
|
||||
$model = $this->getModel('Country', '', []);
|
||||
|
||||
// Preset the redirect
|
||||
$this->setRedirect(Route::_('index.php?option=com_subformpower&view=countries' . $this->getRedirectToListAppend(), false));
|
||||
|
||||
return parent::batch($model);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to cancel an edit.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
*
|
||||
* @return boolean True if access level checks pass, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function cancel($key = null)
|
||||
{
|
||||
// get the referral options
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// Check if there is a return value
|
||||
$return = $this->input->get('return', null, 'base64');
|
||||
|
||||
$cancel = parent::cancel($key);
|
||||
|
||||
if (!is_null($return) && Uri::isInternal(base64_decode($return)))
|
||||
{
|
||||
$redirect = base64_decode($return);
|
||||
|
||||
// Redirect to the return value.
|
||||
$this->setRedirect(
|
||||
Route::_(
|
||||
$redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->refid && $this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
Route::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
Route::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to save a record.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
* @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
|
||||
*
|
||||
* @return boolean True if successful, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function save($key = null, $urlVar = null)
|
||||
{
|
||||
// get the referral options
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// Check if there is a return value
|
||||
$return = $this->input->get('return', null, 'base64');
|
||||
$canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return)));
|
||||
|
||||
if ($this->ref || $this->refid || $canReturn)
|
||||
{
|
||||
// to make sure the item is checkedin on redirect
|
||||
$this->task = 'save';
|
||||
}
|
||||
|
||||
$saved = parent::save($key, $urlVar);
|
||||
|
||||
// This is not needed since parent save already does this
|
||||
// Due to the ref and refid implementation we need to add this
|
||||
if ($canReturn)
|
||||
{
|
||||
$redirect = base64_decode($return);
|
||||
|
||||
// Redirect to the return value.
|
||||
$this->setRedirect(
|
||||
Route::_(
|
||||
$redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->refid && $this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
Route::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string) $this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
Route::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $saved;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function that allows child controller access to model data
|
||||
* after the data has been saved.
|
||||
*
|
||||
* @param BaseDatabaseModel &$model The data model object.
|
||||
* @param array $validData The validated data.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 11.1
|
||||
*/
|
||||
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
128
admin/src/Controller/CurrenciesController.php
Normal file
128
admin/src/Controller/CurrenciesController.php
Normal file
@@ -0,0 +1,128 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage CurrenciesController.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
namespace JCB\Component\Subformpower\Administrator\Controller;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\MVC\Controller\AdminController;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
use Joomla\CMS\Router\Route;
|
||||
use Joomla\CMS\Session\Session;
|
||||
use JCB\Component\Subformpower\Administrator\Helper\SubformpowerHelper;
|
||||
use JCB\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
|
||||
use JCB\Joomla\Utilities\ObjectHelper;
|
||||
|
||||
// No direct access to this file
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* Currencies Admin Controller
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
class CurrenciesController extends AdminController
|
||||
{
|
||||
/**
|
||||
* The prefix to use with controller messages.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $text_prefix = 'COM_SUBFORMPOWER_CURRENCIES';
|
||||
|
||||
/**
|
||||
* Proxy for getModel.
|
||||
*
|
||||
* @param string $name The model name. Optional.
|
||||
* @param string $prefix The class prefix. Optional.
|
||||
* @param array $config Configuration array for model. Optional.
|
||||
*
|
||||
* @return \Joomla\CMS\MVC\Model\BaseDatabaseModel
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getModel($name = 'Currency', $prefix = 'Administrator', $config = ['ignore_request' => true])
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
}
|
||||
|
||||
public function exportData()
|
||||
{
|
||||
// Check for request forgeries
|
||||
Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
|
||||
// check if export is allowed for this user.
|
||||
$user = Factory::getApplication()->getIdentity();
|
||||
if ($user->authorise('currency.export', 'com_subformpower') && $user->authorise('core.export', 'com_subformpower'))
|
||||
{
|
||||
// Get the input
|
||||
$input = Factory::getApplication()->input;
|
||||
$pks = $input->post->get('cid', array(), 'array');
|
||||
// Sanitize the input
|
||||
$pks = ArrayHelper::toInteger($pks);
|
||||
// Get the model
|
||||
$model = $this->getModel('Currencies');
|
||||
// get the data to export
|
||||
$data = $model->getExportData($pks);
|
||||
if (UtilitiesArrayHelper::check($data))
|
||||
{
|
||||
// now set the data to the spreadsheet
|
||||
$date = Factory::getDate();
|
||||
SubformpowerHelper::xls($data,'Currencies_'.$date->format('jS_F_Y'),'Currencies exported ('.$date->format('jS F, Y').')','currencies');
|
||||
}
|
||||
}
|
||||
// Redirect to the list screen with error.
|
||||
$message = Text::_('COM_SUBFORMPOWER_EXPORT_FAILED');
|
||||
$this->setRedirect(Route::_('index.php?option=com_subformpower&view=currencies', false), $message, 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
public function importData()
|
||||
{
|
||||
// Check for request forgeries
|
||||
Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
|
||||
// check if import is allowed for this user.
|
||||
$user = Factory::getApplication()->getIdentity();
|
||||
if ($user->authorise('currency.import', 'com_subformpower') && $user->authorise('core.import', 'com_subformpower'))
|
||||
{
|
||||
// Get the import model
|
||||
$model = $this->getModel('Currencies');
|
||||
// get the headers to import
|
||||
$headers = $model->getExImPortHeaders();
|
||||
if (ObjectHelper::check($headers))
|
||||
{
|
||||
// Load headers to session.
|
||||
$session = Factory::getSession();
|
||||
$headers = json_encode($headers);
|
||||
$session->set('currency_VDM_IMPORTHEADERS', $headers);
|
||||
$session->set('backto_VDM_IMPORT', 'currencies');
|
||||
$session->set('dataType_VDM_IMPORTINTO', 'currency');
|
||||
// Redirect to import view.
|
||||
$message = Text::_('COM_SUBFORMPOWER_IMPORT_SELECT_FILE_FOR_CURRENCIES');
|
||||
$this->setRedirect(Route::_('index.php?option=com_subformpower&view=import', false), $message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Redirect to the list screen with error.
|
||||
$message = Text::_('COM_SUBFORMPOWER_IMPORT_FAILED');
|
||||
$this->setRedirect(Route::_('index.php?option=com_subformpower&view=currencies', false), $message, 'error');
|
||||
return;
|
||||
}
|
||||
}
|
352
admin/src/Controller/CurrencyController.php
Normal file
352
admin/src/Controller/CurrencyController.php
Normal file
@@ -0,0 +1,352 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage CurrencyController.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
namespace JCB\Component\Subformpower\Administrator\Controller;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Form\FormFactoryInterface;
|
||||
use Joomla\CMS\Application\CMSApplication;
|
||||
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
|
||||
use Joomla\Input\Input;
|
||||
use Joomla\CMS\Versioning\VersionableControllerTrait;
|
||||
use Joomla\CMS\MVC\Controller\FormController;
|
||||
use Joomla\CMS\MVC\Model\BaseDatabaseModel;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
use Joomla\CMS\Router\Route;
|
||||
use Joomla\CMS\Session\Session;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
use JCB\Component\Subformpower\Administrator\Helper\SubformpowerHelper;
|
||||
|
||||
// No direct access to this file
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* Currency Form Controller
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
class CurrencyController extends FormController
|
||||
{
|
||||
use VersionableControllerTrait;
|
||||
|
||||
/**
|
||||
* The prefix to use with controller messages.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $text_prefix = 'COM_SUBFORMPOWER_CURRENCY';
|
||||
|
||||
/**
|
||||
* Current or most recently performed task.
|
||||
*
|
||||
* @var string
|
||||
* @since 12.2
|
||||
* @note Replaces _task.
|
||||
*/
|
||||
protected $task;
|
||||
|
||||
/**
|
||||
* The URL view list variable.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $view_list = 'currencies';
|
||||
|
||||
/**
|
||||
* Method override to check if you can add a new record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowAdd($data = [])
|
||||
{
|
||||
// Get user object.
|
||||
$user = $this->app->getIdentity();
|
||||
// Access check.
|
||||
$access = $user->authorise('currency.access', 'com_subformpower');
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('currency.create', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can edit an existing record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
* @param string $key The name of the key for the primary key.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowEdit($data = [], $key = 'id')
|
||||
{
|
||||
// get user object.
|
||||
$user = $this->app->getIdentity();
|
||||
// get record id.
|
||||
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('currency.access', 'com_subformpower.currency.' . (int) $recordId) && $user->authorise('currency.access', 'com_subformpower'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($recordId)
|
||||
{
|
||||
// The record has been set. Check the record permissions.
|
||||
$permission = $user->authorise('currency.edit', 'com_subformpower.currency.' . (int) $recordId);
|
||||
if (!$permission)
|
||||
{
|
||||
if ($user->authorise('currency.edit.own', 'com_subformpower.currency.' . $recordId))
|
||||
{
|
||||
// Now test the owner is the user.
|
||||
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
|
||||
if (empty($ownerId))
|
||||
{
|
||||
// Need to do a lookup from the model.
|
||||
$record = $this->getModel()->getItem($recordId);
|
||||
|
||||
if (empty($record))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
$ownerId = $record->created_by;
|
||||
}
|
||||
|
||||
// If the owner matches 'me' then allow.
|
||||
if ($ownerId == $user->id)
|
||||
{
|
||||
if ($user->authorise('currency.edit.own', 'com_subformpower'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Since there is no permission, revert to the component permissions.
|
||||
return $user->authorise('currency.edit', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the URL arguments to append to an item redirect.
|
||||
*
|
||||
* @param integer $recordId The primary key id for the item.
|
||||
* @param string $urlVar The name of the URL variable for the id.
|
||||
*
|
||||
* @return string The arguments to append to the redirect URL.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
|
||||
{
|
||||
// get the referral options (old method use return instead see parent)
|
||||
$ref = $this->input->get('ref', 0, 'string');
|
||||
$refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// get redirect info.
|
||||
$append = parent::getRedirectToItemAppend($recordId, $urlVar);
|
||||
|
||||
// set the referral options
|
||||
if ($refid && $ref)
|
||||
{
|
||||
$append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append;
|
||||
}
|
||||
elseif ($ref)
|
||||
{
|
||||
$append = '&ref='. (string) $ref . $append;
|
||||
}
|
||||
|
||||
return $append;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to run batch operations.
|
||||
*
|
||||
* @param object $model The model.
|
||||
*
|
||||
* @return boolean True if successful, false otherwise and internal error is set.
|
||||
*
|
||||
* @since 2.5
|
||||
*/
|
||||
public function batch($model = null)
|
||||
{
|
||||
Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
|
||||
|
||||
// Set the model
|
||||
$model = $this->getModel('Currency', '', []);
|
||||
|
||||
// Preset the redirect
|
||||
$this->setRedirect(Route::_('index.php?option=com_subformpower&view=currencies' . $this->getRedirectToListAppend(), false));
|
||||
|
||||
return parent::batch($model);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to cancel an edit.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
*
|
||||
* @return boolean True if access level checks pass, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function cancel($key = null)
|
||||
{
|
||||
// get the referral options
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// Check if there is a return value
|
||||
$return = $this->input->get('return', null, 'base64');
|
||||
|
||||
$cancel = parent::cancel($key);
|
||||
|
||||
if (!is_null($return) && Uri::isInternal(base64_decode($return)))
|
||||
{
|
||||
$redirect = base64_decode($return);
|
||||
|
||||
// Redirect to the return value.
|
||||
$this->setRedirect(
|
||||
Route::_(
|
||||
$redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->refid && $this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
Route::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
Route::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to save a record.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
* @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
|
||||
*
|
||||
* @return boolean True if successful, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function save($key = null, $urlVar = null)
|
||||
{
|
||||
// get the referral options
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// Check if there is a return value
|
||||
$return = $this->input->get('return', null, 'base64');
|
||||
$canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return)));
|
||||
|
||||
if ($this->ref || $this->refid || $canReturn)
|
||||
{
|
||||
// to make sure the item is checkedin on redirect
|
||||
$this->task = 'save';
|
||||
}
|
||||
|
||||
$saved = parent::save($key, $urlVar);
|
||||
|
||||
// This is not needed since parent save already does this
|
||||
// Due to the ref and refid implementation we need to add this
|
||||
if ($canReturn)
|
||||
{
|
||||
$redirect = base64_decode($return);
|
||||
|
||||
// Redirect to the return value.
|
||||
$this->setRedirect(
|
||||
Route::_(
|
||||
$redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->refid && $this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
Route::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string) $this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
Route::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $saved;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function that allows child controller access to model data
|
||||
* after the data has been saved.
|
||||
*
|
||||
* @param BaseDatabaseModel &$model The data model object.
|
||||
* @param array $validData The validated data.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 11.1
|
||||
*/
|
||||
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
54
admin/src/Controller/DisplayController.php
Normal file
54
admin/src/Controller/DisplayController.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage DisplayController.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
namespace JCB\Component\Subformpower\Administrator\Controller;
|
||||
|
||||
use Joomla\CMS\MVC\Controller\BaseController;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Router\Route;
|
||||
|
||||
// No direct access to this file
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* Subformpower master admin display controller.
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
class DisplayController extends BaseController
|
||||
{
|
||||
/**
|
||||
* The default view.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected $default_view = 'subformpower';
|
||||
|
||||
/**
|
||||
* display task
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function display($cachable = false, $urlparams = false)
|
||||
{
|
||||
return parent::display($cachable, $urlparams);
|
||||
}
|
||||
}
|
73
admin/src/Controller/ImportController.php
Normal file
73
admin/src/Controller/ImportController.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage ImportController.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
namespace JCB\Component\Subformpower\Administrator\Controller;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\MVC\Controller\BaseController;
|
||||
use Joomla\CMS\Router\Route;
|
||||
use Joomla\CMS\Session\Session;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
use JCB\Component\Subformpower\Administrator\Helper\SubformpowerHelper;
|
||||
|
||||
// No direct access to this file
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* Subformpower Import Base Controller
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
class ImportController extends BaseController
|
||||
{
|
||||
/**
|
||||
* Import an spreadsheet.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function import()
|
||||
{
|
||||
// Check for request forgeries
|
||||
Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
|
||||
|
||||
$model = $this->getModel('import');
|
||||
if ($model->import())
|
||||
{
|
||||
$cache = Factory::getCache('mod_menu');
|
||||
$cache->clean();
|
||||
// TODO: Reset the users acl here as well to kill off any missing bits
|
||||
}
|
||||
|
||||
$app = Factory::getApplication();
|
||||
$redirect_url = $app->getUserState('com_subformpower.redirect_url');
|
||||
if (empty($redirect_url))
|
||||
{
|
||||
$redirect_url = Route::_('index.php?option=com_subformpower&view=import', false);
|
||||
}
|
||||
else
|
||||
{
|
||||
// wipe out the user state when we're going to redirect
|
||||
$app->setUserState('com_subformpower.redirect_url', '');
|
||||
$app->setUserState('com_subformpower.message', '');
|
||||
$app->setUserState('com_subformpower.extension_message', '');
|
||||
}
|
||||
$this->setRedirect($redirect_url);
|
||||
}
|
||||
}
|
41
admin/src/Controller/SubformpowerController.php
Normal file
41
admin/src/Controller/SubformpowerController.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage SubformpowerController.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
namespace JCB\Component\Subformpower\Administrator\Controller;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\MVC\Controller\AdminController;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
use Joomla\CMS\Router\Route;
|
||||
use Joomla\CMS\Session\Session;
|
||||
use JCB\Component\Subformpower\Administrator\Helper\SubformpowerHelper;
|
||||
|
||||
// No direct access to this file
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* Subformpower Admin Controller
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
class SubformpowerController extends AdminController
|
||||
{
|
||||
|
||||
}
|
1
admin/src/Controller/index.html
Normal file
1
admin/src/Controller/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
84
admin/src/Extension/SubformpowerComponent.php
Normal file
84
admin/src/Extension/SubformpowerComponent.php
Normal file
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage SubformpowerComponent.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
namespace JCB\Component\Subformpower\Administrator\Extension;
|
||||
|
||||
use Joomla\CMS\Association\AssociationServiceInterface;
|
||||
use Joomla\CMS\Association\AssociationServiceTrait;
|
||||
use Joomla\CMS\Categories\CategoryServiceInterface;
|
||||
use Joomla\CMS\Categories\CategoryServiceTrait;
|
||||
use Joomla\CMS\Component\Router\RouterServiceInterface;
|
||||
use Joomla\CMS\Component\Router\RouterServiceTrait;
|
||||
use Joomla\CMS\Extension\BootableExtensionInterface;
|
||||
use Joomla\CMS\Extension\MVCComponent;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Fields\FieldsServiceInterface;
|
||||
use Joomla\CMS\Form\Form;
|
||||
use Joomla\CMS\HTML\HTMLRegistryAwareTrait;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Tag\TagServiceInterface;
|
||||
use Joomla\CMS\Tag\TagServiceTrait;
|
||||
use Joomla\CMS\User\UserFactoryInterface;
|
||||
// (soon) use JCB\Component\Subformpower\Administrator\Service\HTML\AdministratorService;
|
||||
use Psr\Container\ContainerInterface;
|
||||
|
||||
// No direct access to this file
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* Component class for com_subformpower
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
class SubformpowerComponent extends MVCComponent implements
|
||||
BootableExtensionInterface,
|
||||
CategoryServiceInterface,
|
||||
RouterServiceInterface
|
||||
{
|
||||
use AssociationServiceTrait;
|
||||
use HTMLRegistryAwareTrait;
|
||||
use RouterServiceTrait;
|
||||
use CategoryServiceTrait, TagServiceTrait {
|
||||
CategoryServiceTrait::getTableNameForSection insteadof TagServiceTrait;
|
||||
CategoryServiceTrait::getStateColumnForSection insteadof TagServiceTrait;
|
||||
}
|
||||
|
||||
/**
|
||||
* Booting the extension. This is the function to set up the environment of the extension like
|
||||
* registering new class loaders, etc.
|
||||
*
|
||||
* If required, some initial set up can be done from services of the container, eg.
|
||||
* registering HTML services.
|
||||
*
|
||||
* @param ContainerInterface $container The container
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 4.0.0
|
||||
*/
|
||||
public function boot(ContainerInterface $container)
|
||||
{
|
||||
// (soon) $this->getRegistry()->register('subformpoweradministrator', new AdministratorService());
|
||||
}
|
||||
|
||||
// will fix these soon
|
||||
protected function getTableNameForSection(string $section = null){}
|
||||
public function countItems(array $items, string $section){}
|
||||
|
||||
}
|
1
admin/src/Extension/index.html
Normal file
1
admin/src/Extension/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
183
admin/src/Field/CountriesField.php
Normal file
183
admin/src/Field/CountriesField.php
Normal file
@@ -0,0 +1,183 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage CountriesField.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
namespace JCB\Component\Subformpower\Administrator\Field;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Form\Field\ListField;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\HTML\HTMLHelper as Html;
|
||||
use Joomla\CMS\Component\ComponentHelper;
|
||||
use JCB\Component\Subformpower\Administrator\Helper\SubformpowerHelper;
|
||||
|
||||
// No direct access to this file
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* Countries Form Field class for the Subformpower component
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
class CountriesField extends ListField
|
||||
{
|
||||
/**
|
||||
* The countries field type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'Countries';
|
||||
|
||||
/**
|
||||
* Override to add new button
|
||||
*
|
||||
* @return string The field input markup.
|
||||
*
|
||||
* @since 3.2
|
||||
*/
|
||||
protected function getInput()
|
||||
{
|
||||
// see if we should add buttons
|
||||
$set_button = $this->getAttribute('button');
|
||||
// get html
|
||||
$html = parent::getInput();
|
||||
// if true set button
|
||||
if ($set_button === 'true')
|
||||
{
|
||||
$button = array();
|
||||
$script = array();
|
||||
$button_code_name = $this->getAttribute('name');
|
||||
// get the input from url
|
||||
$app = Factory::getApplication();
|
||||
$jinput = $app->input;
|
||||
// get the view name & id
|
||||
$values = $jinput->getArray(array(
|
||||
'id' => 'int',
|
||||
'view' => 'word'
|
||||
));
|
||||
// check if new item
|
||||
$ref = '';
|
||||
$refJ = '';
|
||||
if (!is_null($values['id']) && strlen($values['view']))
|
||||
{
|
||||
// only load referral if not new item.
|
||||
$ref = '&ref=' . $values['view'] . '&refid=' . $values['id'];
|
||||
$refJ = '&ref=' . $values['view'] . '&refid=' . $values['id'];
|
||||
// get the return value.
|
||||
$_uri = (string) \Joomla\CMS\Uri\Uri::getInstance();
|
||||
$_return = urlencode(base64_encode($_uri));
|
||||
// load return value.
|
||||
$ref .= '&return=' . $_return;
|
||||
$refJ .= '&return=' . $_return;
|
||||
}
|
||||
// get button label
|
||||
$button_label = trim($button_code_name);
|
||||
$button_label = preg_replace('/_+/', ' ', $button_label);
|
||||
$button_label = preg_replace('/\s+/', ' ', $button_label);
|
||||
$button_label = preg_replace("/[^A-Za-z ]/", '', $button_label);
|
||||
$button_label = ucfirst(strtolower($button_label));
|
||||
// get user object
|
||||
$user = Factory::getApplication()->getIdentity();
|
||||
// only add if user allowed to create country
|
||||
if ($user->authorise('country.create', 'com_subformpower') && $app->isClient('administrator')) // TODO for now only in admin area.
|
||||
{
|
||||
// build Create button
|
||||
$button[] = '<a id="'.$button_code_name.'Create" class="btn btn-small btn-success hasTooltip" title="'.Text::sprintf('COM_SUBFORMPOWER_CREATE_NEW_S', $button_label).'" style="border-radius: 0px 4px 4px 0px;"
|
||||
href="index.php?option=com_subformpower&view=country&layout=edit'.$ref.'" >
|
||||
<span class="icon-new icon-white"></span></a>';
|
||||
}
|
||||
// only add if user allowed to edit country
|
||||
if ($user->authorise('country.edit', 'com_subformpower') && $app->isClient('administrator')) // TODO for now only in admin area.
|
||||
{
|
||||
// build edit button
|
||||
$button[] = '<a id="'.$button_code_name.'Edit" class="btn btn-small btn-outline-success button-select hasTooltip" title="'.Text::sprintf('COM_SUBFORMPOWER_EDIT_S', $button_label).'" style="display: none; border-radius: 0px 4px 4px 0px;" href="#" >
|
||||
<span class="icon-edit"></span></a>';
|
||||
// build script
|
||||
$script[] = "
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
document.getElementById('jform_".$button_code_name."').addEventListener('change', function(e) {
|
||||
e.preventDefault();
|
||||
let ".$button_code_name."Value = this.value;
|
||||
".$button_code_name."Button(".$button_code_name."Value);
|
||||
});
|
||||
let ".$button_code_name."Value = document.getElementById('jform_".$button_code_name."').value;
|
||||
".$button_code_name."Button(".$button_code_name."Value);
|
||||
});
|
||||
function ".$button_code_name."Button(value) {
|
||||
var createButton = document.getElementById('".$button_code_name."Create');
|
||||
var editButton = document.getElementById('".$button_code_name."Edit');
|
||||
if (value > 0) {
|
||||
// hide the create button
|
||||
createButton.style.display = 'none';
|
||||
// show edit button
|
||||
editButton.style.display = 'block';
|
||||
let url = 'index.php?option=com_subformpower&view=countries&task=country.edit&id='+value+'".$refJ."';
|
||||
editButton.setAttribute('href', url);
|
||||
} else {
|
||||
// show the create button
|
||||
createButton.style.display = 'block';
|
||||
// hide edit button
|
||||
editButton.style.display = 'none';
|
||||
}
|
||||
}";
|
||||
}
|
||||
// check if button was created for country field.
|
||||
if (is_array($button) && count($button) > 0)
|
||||
{
|
||||
// Load the needed script.
|
||||
$document = Factory::getApplication()->getDocument();
|
||||
$document->addScriptDeclaration(implode(' ',$script));
|
||||
// return the button attached to input field.
|
||||
return '<div class="input-group">' .$html . implode('',$button).'</div>';
|
||||
}
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get a list of options for a list input.
|
||||
*
|
||||
* @return array An array of Html options.
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
// Get the databse object.
|
||||
$db = Factory::getDBO();
|
||||
$query = $db->getQuery(true);
|
||||
$query->select($db->quoteName(array('a.guid','a.name'),array('guid','country_name')));
|
||||
$query->from($db->quoteName('#__subformpower_country', 'a'));
|
||||
$query->where($db->quoteName('a.published') . ' = 1');
|
||||
$query->order('a.name ASC');
|
||||
$db->setQuery((string)$query);
|
||||
$items = $db->loadObjectList();
|
||||
$options = array();
|
||||
if ($items)
|
||||
{
|
||||
if ($this->multiple === false)
|
||||
{
|
||||
$options[] = Html::_('select.option', '', Text::_('COM_SUBFORMPOWER_SELECT_COUNTRY'));
|
||||
}
|
||||
foreach($items as $item)
|
||||
{
|
||||
$options[] = Html::_('select.option', $item->guid, $item->country_name);
|
||||
}
|
||||
}
|
||||
return $options;
|
||||
}
|
||||
}
|
83
admin/src/Field/CountriesfilterisoField.php
Normal file
83
admin/src/Field/CountriesfilterisoField.php
Normal file
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage CountriesfilterisoField.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
namespace JCB\Component\Subformpower\Administrator\Field;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Form\Field\ListField;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\HTML\HTMLHelper as Html;
|
||||
use Joomla\CMS\Component\ComponentHelper;
|
||||
use JCB\Component\Subformpower\Administrator\Helper\SubformpowerHelper;
|
||||
|
||||
// No direct access to this file
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* Countriesfilteriso Form Field class for the Subformpower component
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
class CountriesfilterisoField extends ListField
|
||||
{
|
||||
/**
|
||||
* The countriesfilteriso field type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'Countriesfilteriso';
|
||||
|
||||
/**
|
||||
* Method to get a list of options for a list input.
|
||||
*
|
||||
* @return array An array of Html options.
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
// Get a db connection.
|
||||
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface::class);
|
||||
|
||||
// Create a new query object.
|
||||
$query = $db->getQuery(true);
|
||||
|
||||
// Select the text.
|
||||
$query->select($db->quoteName('iso'));
|
||||
$query->from($db->quoteName('#__subformpower_country'));
|
||||
$query->order($db->quoteName('iso') . ' ASC');
|
||||
|
||||
// Reset the query using our newly populated query object.
|
||||
$db->setQuery($query);
|
||||
|
||||
$_results = $db->loadColumn();
|
||||
$_filter = [];
|
||||
$_filter[] = Html::_('select.option', '', '- ' . Text::_('COM_SUBFORMPOWER_FILTER_SELECT_ISO') . ' -');
|
||||
|
||||
if ($_results)
|
||||
{
|
||||
$_results = array_unique($_results);
|
||||
foreach ($_results as $iso)
|
||||
{
|
||||
// Now add the iso and its text to the options array
|
||||
$_filter[] = Html::_('select.option', $iso, $iso);
|
||||
}
|
||||
}
|
||||
return $_filter;
|
||||
}
|
||||
}
|
83
admin/src/Field/CountriesfilterisothreeField.php
Normal file
83
admin/src/Field/CountriesfilterisothreeField.php
Normal file
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage CountriesfilterisothreeField.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
namespace JCB\Component\Subformpower\Administrator\Field;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Form\Field\ListField;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\HTML\HTMLHelper as Html;
|
||||
use Joomla\CMS\Component\ComponentHelper;
|
||||
use JCB\Component\Subformpower\Administrator\Helper\SubformpowerHelper;
|
||||
|
||||
// No direct access to this file
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* Countriesfilterisothree Form Field class for the Subformpower component
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
class CountriesfilterisothreeField extends ListField
|
||||
{
|
||||
/**
|
||||
* The countriesfilterisothree field type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'Countriesfilterisothree';
|
||||
|
||||
/**
|
||||
* Method to get a list of options for a list input.
|
||||
*
|
||||
* @return array An array of Html options.
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
// Get a db connection.
|
||||
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface::class);
|
||||
|
||||
// Create a new query object.
|
||||
$query = $db->getQuery(true);
|
||||
|
||||
// Select the text.
|
||||
$query->select($db->quoteName('isothree'));
|
||||
$query->from($db->quoteName('#__subformpower_country'));
|
||||
$query->order($db->quoteName('isothree') . ' ASC');
|
||||
|
||||
// Reset the query using our newly populated query object.
|
||||
$db->setQuery($query);
|
||||
|
||||
$_results = $db->loadColumn();
|
||||
$_filter = [];
|
||||
$_filter[] = Html::_('select.option', '', '- ' . Text::_('COM_SUBFORMPOWER_FILTER_SELECT_ISOTHREE') . ' -');
|
||||
|
||||
if ($_results)
|
||||
{
|
||||
$_results = array_unique($_results);
|
||||
foreach ($_results as $isothree)
|
||||
{
|
||||
// Now add the isothree and its text to the options array
|
||||
$_filter[] = Html::_('select.option', $isothree, $isothree);
|
||||
}
|
||||
}
|
||||
return $_filter;
|
||||
}
|
||||
}
|
83
admin/src/Field/CountriesfilternumcodeField.php
Normal file
83
admin/src/Field/CountriesfilternumcodeField.php
Normal file
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage CountriesfilternumcodeField.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
namespace JCB\Component\Subformpower\Administrator\Field;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Form\Field\ListField;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\HTML\HTMLHelper as Html;
|
||||
use Joomla\CMS\Component\ComponentHelper;
|
||||
use JCB\Component\Subformpower\Administrator\Helper\SubformpowerHelper;
|
||||
|
||||
// No direct access to this file
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* Countriesfilternumcode Form Field class for the Subformpower component
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
class CountriesfilternumcodeField extends ListField
|
||||
{
|
||||
/**
|
||||
* The countriesfilternumcode field type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'Countriesfilternumcode';
|
||||
|
||||
/**
|
||||
* Method to get a list of options for a list input.
|
||||
*
|
||||
* @return array An array of Html options.
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
// Get a db connection.
|
||||
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface::class);
|
||||
|
||||
// Create a new query object.
|
||||
$query = $db->getQuery(true);
|
||||
|
||||
// Select the text.
|
||||
$query->select($db->quoteName('numcode'));
|
||||
$query->from($db->quoteName('#__subformpower_country'));
|
||||
$query->order($db->quoteName('numcode') . ' ASC');
|
||||
|
||||
// Reset the query using our newly populated query object.
|
||||
$db->setQuery($query);
|
||||
|
||||
$_results = $db->loadColumn();
|
||||
$_filter = [];
|
||||
$_filter[] = Html::_('select.option', '', '- ' . Text::_('COM_SUBFORMPOWER_FILTER_SELECT_NUMCODE') . ' -');
|
||||
|
||||
if ($_results)
|
||||
{
|
||||
$_results = array_unique($_results);
|
||||
foreach ($_results as $numcode)
|
||||
{
|
||||
// Now add the numcode and its text to the options array
|
||||
$_filter[] = Html::_('select.option', $numcode, $numcode);
|
||||
}
|
||||
}
|
||||
return $_filter;
|
||||
}
|
||||
}
|
83
admin/src/Field/CountriesfilterphonecodeField.php
Normal file
83
admin/src/Field/CountriesfilterphonecodeField.php
Normal file
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage CountriesfilterphonecodeField.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
namespace JCB\Component\Subformpower\Administrator\Field;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Form\Field\ListField;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\HTML\HTMLHelper as Html;
|
||||
use Joomla\CMS\Component\ComponentHelper;
|
||||
use JCB\Component\Subformpower\Administrator\Helper\SubformpowerHelper;
|
||||
|
||||
// No direct access to this file
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* Countriesfilterphonecode Form Field class for the Subformpower component
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
class CountriesfilterphonecodeField extends ListField
|
||||
{
|
||||
/**
|
||||
* The countriesfilterphonecode field type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'Countriesfilterphonecode';
|
||||
|
||||
/**
|
||||
* Method to get a list of options for a list input.
|
||||
*
|
||||
* @return array An array of Html options.
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
// Get a db connection.
|
||||
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface::class);
|
||||
|
||||
// Create a new query object.
|
||||
$query = $db->getQuery(true);
|
||||
|
||||
// Select the text.
|
||||
$query->select($db->quoteName('phonecode'));
|
||||
$query->from($db->quoteName('#__subformpower_country'));
|
||||
$query->order($db->quoteName('phonecode') . ' ASC');
|
||||
|
||||
// Reset the query using our newly populated query object.
|
||||
$db->setQuery($query);
|
||||
|
||||
$_results = $db->loadColumn();
|
||||
$_filter = [];
|
||||
$_filter[] = Html::_('select.option', '', '- ' . Text::_('COM_SUBFORMPOWER_FILTER_SELECT_PHONECODE') . ' -');
|
||||
|
||||
if ($_results)
|
||||
{
|
||||
$_results = array_unique($_results);
|
||||
foreach ($_results as $phonecode)
|
||||
{
|
||||
// Now add the phonecode and its text to the options array
|
||||
$_filter[] = Html::_('select.option', $phonecode, $phonecode);
|
||||
}
|
||||
}
|
||||
return $_filter;
|
||||
}
|
||||
}
|
83
admin/src/Field/CurrenciesfiltersymbolField.php
Normal file
83
admin/src/Field/CurrenciesfiltersymbolField.php
Normal file
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage CurrenciesfiltersymbolField.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
namespace JCB\Component\Subformpower\Administrator\Field;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Form\Field\ListField;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\HTML\HTMLHelper as Html;
|
||||
use Joomla\CMS\Component\ComponentHelper;
|
||||
use JCB\Component\Subformpower\Administrator\Helper\SubformpowerHelper;
|
||||
|
||||
// No direct access to this file
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* Currenciesfiltersymbol Form Field class for the Subformpower component
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
class CurrenciesfiltersymbolField extends ListField
|
||||
{
|
||||
/**
|
||||
* The currenciesfiltersymbol field type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'Currenciesfiltersymbol';
|
||||
|
||||
/**
|
||||
* Method to get a list of options for a list input.
|
||||
*
|
||||
* @return array An array of Html options.
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
// Get a db connection.
|
||||
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface::class);
|
||||
|
||||
// Create a new query object.
|
||||
$query = $db->getQuery(true);
|
||||
|
||||
// Select the text.
|
||||
$query->select($db->quoteName('symbol'));
|
||||
$query->from($db->quoteName('#__subformpower_currency'));
|
||||
$query->order($db->quoteName('symbol') . ' ASC');
|
||||
|
||||
// Reset the query using our newly populated query object.
|
||||
$db->setQuery($query);
|
||||
|
||||
$_results = $db->loadColumn();
|
||||
$_filter = [];
|
||||
$_filter[] = Html::_('select.option', '', '- ' . Text::_('COM_SUBFORMPOWER_FILTER_SELECT_SYMBOL') . ' -');
|
||||
|
||||
if ($_results)
|
||||
{
|
||||
$_results = array_unique($_results);
|
||||
foreach ($_results as $symbol)
|
||||
{
|
||||
// Now add the symbol and its text to the options array
|
||||
$_filter[] = Html::_('select.option', $symbol, $symbol);
|
||||
}
|
||||
}
|
||||
return $_filter;
|
||||
}
|
||||
}
|
1
admin/src/Field/index.html
Normal file
1
admin/src/Field/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
139
admin/src/Helper/HeaderCheck.php
Normal file
139
admin/src/Helper/HeaderCheck.php
Normal file
@@ -0,0 +1,139 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage HeaderCheck.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
namespace JCB\Component\Subformpower\Administrator\Helper;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Document\Document;
|
||||
use Joomla\CMS\Application\CMSApplication;
|
||||
|
||||
// No direct access to this file
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* Helper class for checking loaded scripts and styles in the document header.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
class HeaderCheck
|
||||
{
|
||||
/**
|
||||
* @var CMSApplication Application object
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected CMSApplication $app;
|
||||
|
||||
/**
|
||||
* @var Document object
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Document $document;
|
||||
|
||||
/**
|
||||
* Construct the app and document
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
// Initializes the application object.
|
||||
$this->app ??= Factory::getApplication();
|
||||
|
||||
// Initializes the document object.
|
||||
$this->document = $this->app->getDocument();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a JavaScript file is loaded in the document head.
|
||||
*
|
||||
* @param string $scriptName Name of the script to check.
|
||||
*
|
||||
* @return bool True if the script is loaded, false otherwise.
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function js_loaded(string $scriptName): bool
|
||||
{
|
||||
return $this->isLoaded($scriptName, 'scripts');
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a CSS file is loaded in the document head.
|
||||
*
|
||||
* @param string $scriptName Name of the stylesheet to check.
|
||||
*
|
||||
* @return bool True if the stylesheet is loaded, false otherwise.
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function css_loaded(string $scriptName): bool
|
||||
{
|
||||
return $this->isLoaded($scriptName, 'styleSheets');
|
||||
}
|
||||
|
||||
/**
|
||||
* Abstract method to check if a given script or stylesheet is loaded.
|
||||
*
|
||||
* @param string $scriptName Name of the script or stylesheet.
|
||||
* @param string $type Type of asset to check ('scripts' or 'styleSheets').
|
||||
*
|
||||
* @return bool True if the asset is loaded, false otherwise.
|
||||
* @since 3.2.0
|
||||
*/
|
||||
private function isLoaded(string $scriptName, string $type): bool
|
||||
{
|
||||
// UIkit specific check
|
||||
if ($this->isUIkit($scriptName))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
$head_data = $this->document->getHeadData();
|
||||
foreach (array_keys($head_data[$type]) as $script)
|
||||
{
|
||||
if (stristr($script, $scriptName))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for UIkit framework specific conditions.
|
||||
*
|
||||
* @param string $scriptName Name of the script or stylesheet.
|
||||
*
|
||||
* @return bool True if UIkit specific conditions are met, false otherwise.
|
||||
* @since 3.2.0
|
||||
*/
|
||||
private function isUIkit(string $scriptName): bool
|
||||
{
|
||||
if (strpos($scriptName, 'uikit') !== false)
|
||||
{
|
||||
$get_template_name = $this->app->getTemplate('template')->template;
|
||||
if (strpos($get_template_name, 'yoo') !== false)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
65
admin/src/Helper/PowerloaderHelper.php
Normal file
65
admin/src/Helper/PowerloaderHelper.php
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage PowerloaderHelper.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
// register additional namespace
|
||||
spl_autoload_register(function ($class) {
|
||||
// project-specific base directories and namespace prefix
|
||||
$search = [
|
||||
'libraries/jcb_powers/JCB.Joomla' => 'JCB\\Joomla'
|
||||
];
|
||||
// Start the search and load if found
|
||||
$found = false;
|
||||
$found_base_dir = "";
|
||||
$found_len = 0;
|
||||
foreach ($search as $base_dir => $prefix)
|
||||
{
|
||||
// does the class use the namespace prefix?
|
||||
$len = strlen($prefix);
|
||||
if (strncmp($prefix, $class, $len) === 0)
|
||||
{
|
||||
// we have a match so load the values
|
||||
$found = true;
|
||||
$found_base_dir = $base_dir;
|
||||
$found_len = $len;
|
||||
// done here
|
||||
break;
|
||||
}
|
||||
}
|
||||
// check if we found a match
|
||||
if (!$found)
|
||||
{
|
||||
// not found so move to the next registered autoloader
|
||||
return;
|
||||
}
|
||||
// get the relative class name
|
||||
$relative_class = substr($class, $found_len);
|
||||
// replace the namespace prefix with the base directory, replace namespace
|
||||
// separators with directory separators in the relative class name, append
|
||||
// with .php
|
||||
$file = JPATH_ROOT . '/' . $found_base_dir . '/src' . str_replace('\\', '/', $relative_class) . '.php';
|
||||
// if the file exists, require it
|
||||
if (file_exists($file))
|
||||
{
|
||||
require $file;
|
||||
}
|
||||
});
|
1205
admin/src/Helper/SubformpowerHelper.php
Normal file
1205
admin/src/Helper/SubformpowerHelper.php
Normal file
File diff suppressed because it is too large
Load Diff
1
admin/src/Helper/index.html
Normal file
1
admin/src/Helper/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
631
admin/src/Model/CountriesModel.php
Normal file
631
admin/src/Model/CountriesModel.php
Normal file
@@ -0,0 +1,631 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage CountriesModel.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
namespace JCB\Component\Subformpower\Administrator\Model;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Application\CMSApplicationInterface;
|
||||
use Joomla\CMS\Component\ComponentHelper;
|
||||
use Joomla\CMS\MVC\Model\ListModel;
|
||||
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
|
||||
use Joomla\CMS\Plugin\PluginHelper;
|
||||
use Joomla\CMS\Router\Route;
|
||||
use Joomla\CMS\User\User;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
use Joomla\Input\Input;
|
||||
use JCB\Component\Subformpower\Administrator\Helper\SubformpowerHelper;
|
||||
use Joomla\CMS\Helper\TagsHelper;
|
||||
use JCB\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
|
||||
use JCB\Joomla\Utilities\ObjectHelper;
|
||||
use JCB\Joomla\Utilities\StringHelper;
|
||||
|
||||
// No direct access to this file
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* Countries List Model
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
class CountriesModel extends ListModel
|
||||
{
|
||||
/**
|
||||
* The application object.
|
||||
*
|
||||
* @var CMSApplicationInterface The application instance.
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected CMSApplicationInterface $app;
|
||||
|
||||
/**
|
||||
* The styles array.
|
||||
*
|
||||
* @var array
|
||||
* @since 4.3
|
||||
*/
|
||||
protected array $styles = [
|
||||
'administrator/components/com_subformpower/assets/css/admin.css',
|
||||
'administrator/components/com_subformpower/assets/css/countries.css'
|
||||
];
|
||||
|
||||
/**
|
||||
* The scripts array.
|
||||
*
|
||||
* @var array
|
||||
* @since 4.3
|
||||
*/
|
||||
protected array $scripts = [
|
||||
'administrator/components/com_subformpower/assets/js/admin.js'
|
||||
];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request).
|
||||
* @param ?MVCFactoryInterface $factory The factory.
|
||||
*
|
||||
* @since 1.6
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function __construct($config = [], MVCFactoryInterface $factory = null)
|
||||
{
|
||||
if (empty($config['filter_fields']))
|
||||
{
|
||||
$config['filter_fields'] = array(
|
||||
'a.id','id',
|
||||
'a.published','published',
|
||||
'a.access','access',
|
||||
'a.ordering','ordering',
|
||||
'a.created_by','created_by',
|
||||
'a.modified_by','modified_by',
|
||||
'a.phonecode','phonecode',
|
||||
'a.isothree','isothree',
|
||||
'a.numcode','numcode',
|
||||
'a.iso','iso'
|
||||
);
|
||||
}
|
||||
|
||||
parent::__construct($config, $factory);
|
||||
|
||||
$this->app ??= Factory::getApplication();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to auto-populate the model state.
|
||||
*
|
||||
* Note. Calling getState in this method will result in recursion.
|
||||
*
|
||||
* @param string $ordering An optional ordering field.
|
||||
* @param string $direction An optional direction (asc|desc).
|
||||
*
|
||||
* @return void
|
||||
* @since 1.7.0
|
||||
*/
|
||||
protected function populateState($ordering = null, $direction = null)
|
||||
{
|
||||
$app = $this->app;
|
||||
|
||||
// Adjust the context to support modal layouts.
|
||||
if ($layout = $app->input->get('layout'))
|
||||
{
|
||||
$this->context .= '.' . $layout;
|
||||
}
|
||||
|
||||
// Check if the form was submitted
|
||||
$formSubmited = $app->input->post->get('form_submited');
|
||||
|
||||
$access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int');
|
||||
if ($formSubmited)
|
||||
{
|
||||
$access = $app->input->post->get('access');
|
||||
$this->setState('filter.access', $access);
|
||||
}
|
||||
|
||||
$published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '');
|
||||
$this->setState('filter.published', $published);
|
||||
|
||||
$created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', '');
|
||||
$this->setState('filter.created_by', $created_by);
|
||||
|
||||
$created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created');
|
||||
$this->setState('filter.created', $created);
|
||||
|
||||
$sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int');
|
||||
$this->setState('filter.sorting', $sorting);
|
||||
|
||||
$search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
|
||||
$this->setState('filter.search', $search);
|
||||
|
||||
$phonecode = $this->getUserStateFromRequest($this->context . '.filter.phonecode', 'filter_phonecode');
|
||||
if ($formSubmited)
|
||||
{
|
||||
$phonecode = $app->input->post->get('phonecode');
|
||||
$this->setState('filter.phonecode', $phonecode);
|
||||
}
|
||||
|
||||
$isothree = $this->getUserStateFromRequest($this->context . '.filter.isothree', 'filter_isothree');
|
||||
if ($formSubmited)
|
||||
{
|
||||
$isothree = $app->input->post->get('isothree');
|
||||
$this->setState('filter.isothree', $isothree);
|
||||
}
|
||||
|
||||
$numcode = $this->getUserStateFromRequest($this->context . '.filter.numcode', 'filter_numcode');
|
||||
if ($formSubmited)
|
||||
{
|
||||
$numcode = $app->input->post->get('numcode');
|
||||
$this->setState('filter.numcode', $numcode);
|
||||
}
|
||||
|
||||
$iso = $this->getUserStateFromRequest($this->context . '.filter.iso', 'filter_iso');
|
||||
if ($formSubmited)
|
||||
{
|
||||
$iso = $app->input->post->get('iso');
|
||||
$this->setState('filter.iso', $iso);
|
||||
}
|
||||
|
||||
// List state information.
|
||||
parent::populateState($ordering, $direction);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get an array of data items.
|
||||
*
|
||||
* @return mixed An array of data items on success, false on failure.
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getItems()
|
||||
{
|
||||
// Check in items
|
||||
$this->checkInNow();
|
||||
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// Set values to display correctly.
|
||||
if (UtilitiesArrayHelper::check($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
if (!isset($user) || !ObjectHelper::check($user))
|
||||
{
|
||||
$user = $this->getCurrentUser();
|
||||
}
|
||||
foreach ($items as $nr => &$item)
|
||||
{
|
||||
// Remove items the user can't access.
|
||||
$access = ($user->authorise('country.access', 'com_subformpower.country.' . (int) $item->id) && $user->authorise('country.access', 'com_subformpower'));
|
||||
if (!$access)
|
||||
{
|
||||
unset($items[$nr]);
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// return items
|
||||
return $items;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to build an SQL query to load the list data.
|
||||
*
|
||||
* @return string An SQL query
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getListQuery()
|
||||
{
|
||||
// Get the user object.
|
||||
$user = $this->getCurrentUser();
|
||||
// Create a new query object.
|
||||
$db = $this->getDatabase();
|
||||
$query = $db->getQuery(true);
|
||||
|
||||
// Select some fields
|
||||
$query->select('a.*');
|
||||
|
||||
// From the subformpower_item table
|
||||
$query->from($db->quoteName('#__subformpower_country', 'a'));
|
||||
|
||||
// Filter by published state
|
||||
$published = $this->getState('filter.published');
|
||||
if (is_numeric($published))
|
||||
{
|
||||
$query->where('a.published = ' . (int) $published);
|
||||
}
|
||||
elseif ($published === '')
|
||||
{
|
||||
$query->where('(a.published = 0 OR a.published = 1)');
|
||||
}
|
||||
|
||||
// Join over the asset groups.
|
||||
$query->select('ag.title AS access_level');
|
||||
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
|
||||
// Filter by access level.
|
||||
$_access = $this->getState('filter.access');
|
||||
if ($_access && is_numeric($_access))
|
||||
{
|
||||
$query->where('a.access = ' . (int) $_access);
|
||||
}
|
||||
elseif (UtilitiesArrayHelper::check($_access))
|
||||
{
|
||||
// Secure the array for the query
|
||||
$_access = ArrayHelper::toInteger($_access);
|
||||
// Filter by the Access Array.
|
||||
$query->where('a.access IN (' . implode(',', $_access) . ')');
|
||||
}
|
||||
// Implement View Level Access
|
||||
if (!$user->authorise('core.options', 'com_subformpower'))
|
||||
{
|
||||
$groups = implode(',', $user->getAuthorisedViewLevels());
|
||||
$query->where('a.access IN (' . $groups . ')');
|
||||
}
|
||||
// Filter by search.
|
||||
$search = $this->getState('filter.search');
|
||||
if (!empty($search))
|
||||
{
|
||||
if (stripos($search, 'id:') === 0)
|
||||
{
|
||||
$query->where('a.id = ' . (int) substr($search, 3));
|
||||
}
|
||||
else
|
||||
{
|
||||
$search = $db->quote('%' . $db->escape($search) . '%');
|
||||
$query->where('(a.phonecode LIKE '.$search.' OR a.isothree LIKE '.$search.' OR a.numcode LIKE '.$search.' OR a.iso LIKE '.$search.')');
|
||||
}
|
||||
}
|
||||
|
||||
// Filter by Phonecode.
|
||||
$_phonecode = $this->getState('filter.phonecode');
|
||||
if (is_numeric($_phonecode))
|
||||
{
|
||||
if (is_float($_phonecode))
|
||||
{
|
||||
$query->where('a.phonecode = ' . (float) $_phonecode);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.phonecode = ' . (int) $_phonecode);
|
||||
}
|
||||
}
|
||||
elseif (StringHelper::check($_phonecode))
|
||||
{
|
||||
$query->where('a.phonecode = ' . $db->quote($db->escape($_phonecode)));
|
||||
}
|
||||
// Filter by Isothree.
|
||||
$_isothree = $this->getState('filter.isothree');
|
||||
if (is_numeric($_isothree))
|
||||
{
|
||||
if (is_float($_isothree))
|
||||
{
|
||||
$query->where('a.isothree = ' . (float) $_isothree);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.isothree = ' . (int) $_isothree);
|
||||
}
|
||||
}
|
||||
elseif (StringHelper::check($_isothree))
|
||||
{
|
||||
$query->where('a.isothree = ' . $db->quote($db->escape($_isothree)));
|
||||
}
|
||||
// Filter by Numcode.
|
||||
$_numcode = $this->getState('filter.numcode');
|
||||
if (is_numeric($_numcode))
|
||||
{
|
||||
if (is_float($_numcode))
|
||||
{
|
||||
$query->where('a.numcode = ' . (float) $_numcode);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.numcode = ' . (int) $_numcode);
|
||||
}
|
||||
}
|
||||
elseif (StringHelper::check($_numcode))
|
||||
{
|
||||
$query->where('a.numcode = ' . $db->quote($db->escape($_numcode)));
|
||||
}
|
||||
// Filter by Iso.
|
||||
$_iso = $this->getState('filter.iso');
|
||||
if (is_numeric($_iso))
|
||||
{
|
||||
if (is_float($_iso))
|
||||
{
|
||||
$query->where('a.iso = ' . (float) $_iso);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.iso = ' . (int) $_iso);
|
||||
}
|
||||
}
|
||||
elseif (StringHelper::check($_iso))
|
||||
{
|
||||
$query->where('a.iso = ' . $db->quote($db->escape($_iso)));
|
||||
}
|
||||
|
||||
// Add the list ordering clause.
|
||||
$orderCol = $this->getState('list.ordering', 'a.id');
|
||||
$orderDirn = $this->getState('list.direction', 'desc');
|
||||
if ($orderCol != '')
|
||||
{
|
||||
// Check that the order direction is valid encase we have a field called direction as part of filers.
|
||||
$orderDirn = (is_string($orderDirn) && in_array(strtolower($orderDirn), ['asc', 'desc'])) ? $orderDirn : 'desc';
|
||||
$query->order($db->escape($orderCol . ' ' . $orderDirn));
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get list export data.
|
||||
*
|
||||
* @param array $pks The ids of the items to get
|
||||
* @param JUser $user The user making the request
|
||||
*
|
||||
* @return mixed An array of data items on success, false on failure.
|
||||
*/
|
||||
public function getExportData($pks, $user = null)
|
||||
{
|
||||
// setup the query
|
||||
if (($pks_size = UtilitiesArrayHelper::check($pks)) !== false || 'bulk' === $pks)
|
||||
{
|
||||
// Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME)
|
||||
$_export = true;
|
||||
// Get the user object if not set.
|
||||
if (!isset($user) || !ObjectHelper::check($user))
|
||||
{
|
||||
$user = $this->getCurrentUser();
|
||||
}
|
||||
// Create a new query object.
|
||||
$db = $this->getDatabase();
|
||||
$query = $db->getQuery(true);
|
||||
|
||||
// Select some fields
|
||||
$query->select('a.*');
|
||||
|
||||
// From the subformpower_country table
|
||||
$query->from($db->quoteName('#__subformpower_country', 'a'));
|
||||
// The bulk export path
|
||||
if ('bulk' === $pks)
|
||||
{
|
||||
$query->where('a.id > 0');
|
||||
}
|
||||
// A large array of ID's will not work out well
|
||||
elseif ($pks_size > 500)
|
||||
{
|
||||
// Use lowest ID
|
||||
$query->where('a.id >= ' . (int) min($pks));
|
||||
// Use highest ID
|
||||
$query->where('a.id <= ' . (int) max($pks));
|
||||
}
|
||||
// The normal default path
|
||||
else
|
||||
{
|
||||
$query->where('a.id IN (' . implode(',',$pks) . ')');
|
||||
}
|
||||
// Implement View Level Access
|
||||
if (!$user->authorise('core.options', 'com_subformpower'))
|
||||
{
|
||||
$groups = implode(',', $user->getAuthorisedViewLevels());
|
||||
$query->where('a.access IN (' . $groups . ')');
|
||||
}
|
||||
|
||||
// Order the results by ordering
|
||||
$query->order('a.ordering ASC');
|
||||
|
||||
// Load the items
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
if ($db->getNumRows())
|
||||
{
|
||||
$items = $db->loadObjectList();
|
||||
|
||||
// Set values to display correctly.
|
||||
if (UtilitiesArrayHelper::check($items))
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
{
|
||||
// Remove items the user can't access.
|
||||
$access = ($user->authorise('country.access', 'com_subformpower.country.' . (int) $item->id) && $user->authorise('country.access', 'com_subformpower'));
|
||||
if (!$access)
|
||||
{
|
||||
unset($items[$nr]);
|
||||
continue;
|
||||
}
|
||||
|
||||
// unset the values we don't want exported.
|
||||
unset($item->asset_id);
|
||||
unset($item->checked_out);
|
||||
unset($item->checked_out_time);
|
||||
}
|
||||
}
|
||||
// Add headers to items array.
|
||||
$headers = $this->getExImPortHeaders();
|
||||
if (ObjectHelper::check($headers))
|
||||
{
|
||||
array_unshift($items,$headers);
|
||||
}
|
||||
return $items;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get header.
|
||||
*
|
||||
* @return mixed An array of data items on success, false on failure.
|
||||
*/
|
||||
public function getExImPortHeaders()
|
||||
{
|
||||
// Get a db connection.
|
||||
$db = Factory::getDbo();
|
||||
// get the columns
|
||||
$columns = $db->getTableColumns("#__subformpower_country");
|
||||
if (UtilitiesArrayHelper::check($columns))
|
||||
{
|
||||
// remove the headers you don't import/export.
|
||||
unset($columns['asset_id']);
|
||||
unset($columns['checked_out']);
|
||||
unset($columns['checked_out_time']);
|
||||
$headers = new \stdClass();
|
||||
foreach ($columns as $column => $type)
|
||||
{
|
||||
$headers->{$column} = $column;
|
||||
}
|
||||
return $headers;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get a store id based on model configuration state.
|
||||
*
|
||||
* @return string A store id.
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getStoreId($id = '')
|
||||
{
|
||||
// Compile the store id.
|
||||
$id .= ':' . $this->getState('filter.id');
|
||||
$id .= ':' . $this->getState('filter.search');
|
||||
$id .= ':' . $this->getState('filter.published');
|
||||
// Check if the value is an array
|
||||
$_access = $this->getState('filter.access');
|
||||
if (UtilitiesArrayHelper::check($_access))
|
||||
{
|
||||
$id .= ':' . implode(':', $_access);
|
||||
}
|
||||
// Check if this is only an number or string
|
||||
elseif (is_numeric($_access)
|
||||
|| StringHelper::check($_access))
|
||||
{
|
||||
$id .= ':' . $_access;
|
||||
}
|
||||
$id .= ':' . $this->getState('filter.ordering');
|
||||
$id .= ':' . $this->getState('filter.created_by');
|
||||
$id .= ':' . $this->getState('filter.modified_by');
|
||||
$id .= ':' . $this->getState('filter.phonecode');
|
||||
$id .= ':' . $this->getState('filter.isothree');
|
||||
$id .= ':' . $this->getState('filter.numcode');
|
||||
$id .= ':' . $this->getState('filter.iso');
|
||||
|
||||
return parent::getStoreId($id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the styles that have to be included on the view
|
||||
*
|
||||
* @return array styles files
|
||||
* @since 4.3
|
||||
*/
|
||||
public function getStyles(): array
|
||||
{
|
||||
return $this->styles;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to set the styles that have to be included on the view
|
||||
*
|
||||
* @return void
|
||||
* @since 4.3
|
||||
*/
|
||||
public function setStyles(string $path): void
|
||||
{
|
||||
$this->styles[] = $path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the script that have to be included on the view
|
||||
*
|
||||
* @return array script files
|
||||
* @since 4.3
|
||||
*/
|
||||
public function getScripts(): array
|
||||
{
|
||||
return $this->scripts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to set the script that have to be included on the view
|
||||
*
|
||||
* @return void
|
||||
* @since 4.3
|
||||
*/
|
||||
public function setScript(string $path): void
|
||||
{
|
||||
$this->scripts[] = $path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build an SQL query to checkin all items left checked out longer then a set time.
|
||||
*
|
||||
* @return bool
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected function checkInNow(): bool
|
||||
{
|
||||
// Get set check in time
|
||||
$time = ComponentHelper::getParams('com_subformpower')->get('check_in');
|
||||
|
||||
if ($time)
|
||||
{
|
||||
// Get a db connection.
|
||||
$db = $this->getDatabase();
|
||||
// Reset query.
|
||||
$query = $db->getQuery(true);
|
||||
$query->select('*');
|
||||
$query->from($db->quoteName('#__subformpower_country'));
|
||||
// Only select items that are checked out.
|
||||
$query->where($db->quoteName('checked_out') . '!=0');
|
||||
$db->setQuery($query, 0, 1);
|
||||
$db->execute();
|
||||
if ($db->getNumRows())
|
||||
{
|
||||
// Get Yesterdays date.
|
||||
$date = Factory::getDate()->modify($time)->toSql();
|
||||
// Reset query.
|
||||
$query = $db->getQuery(true);
|
||||
|
||||
// Fields to update.
|
||||
$fields = array(
|
||||
$db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'',
|
||||
$db->quoteName('checked_out') . '=0'
|
||||
);
|
||||
|
||||
// Conditions for which records should be updated.
|
||||
$conditions = array(
|
||||
$db->quoteName('checked_out') . '!=0',
|
||||
$db->quoteName('checked_out_time') . '<\''.$date.'\''
|
||||
);
|
||||
|
||||
// Check table.
|
||||
$query->update($db->quoteName('#__subformpower_country'))->set($fields)->where($conditions);
|
||||
|
||||
$db->setQuery($query);
|
||||
|
||||
return $db->execute();
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
1097
admin/src/Model/CountryModel.php
Normal file
1097
admin/src/Model/CountryModel.php
Normal file
File diff suppressed because it is too large
Load Diff
557
admin/src/Model/CurrenciesModel.php
Normal file
557
admin/src/Model/CurrenciesModel.php
Normal file
@@ -0,0 +1,557 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage CurrenciesModel.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
namespace JCB\Component\Subformpower\Administrator\Model;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Application\CMSApplicationInterface;
|
||||
use Joomla\CMS\Component\ComponentHelper;
|
||||
use Joomla\CMS\MVC\Model\ListModel;
|
||||
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
|
||||
use Joomla\CMS\Plugin\PluginHelper;
|
||||
use Joomla\CMS\Router\Route;
|
||||
use Joomla\CMS\User\User;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
use Joomla\Input\Input;
|
||||
use JCB\Component\Subformpower\Administrator\Helper\SubformpowerHelper;
|
||||
use Joomla\CMS\Helper\TagsHelper;
|
||||
use JCB\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
|
||||
use JCB\Joomla\Utilities\ObjectHelper;
|
||||
use JCB\Joomla\Utilities\StringHelper;
|
||||
|
||||
// No direct access to this file
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* Currencies List Model
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
class CurrenciesModel extends ListModel
|
||||
{
|
||||
/**
|
||||
* The application object.
|
||||
*
|
||||
* @var CMSApplicationInterface The application instance.
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected CMSApplicationInterface $app;
|
||||
|
||||
/**
|
||||
* The styles array.
|
||||
*
|
||||
* @var array
|
||||
* @since 4.3
|
||||
*/
|
||||
protected array $styles = [
|
||||
'administrator/components/com_subformpower/assets/css/admin.css',
|
||||
'administrator/components/com_subformpower/assets/css/currencies.css'
|
||||
];
|
||||
|
||||
/**
|
||||
* The scripts array.
|
||||
*
|
||||
* @var array
|
||||
* @since 4.3
|
||||
*/
|
||||
protected array $scripts = [
|
||||
'administrator/components/com_subformpower/assets/js/admin.js'
|
||||
];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request).
|
||||
* @param ?MVCFactoryInterface $factory The factory.
|
||||
*
|
||||
* @since 1.6
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function __construct($config = [], MVCFactoryInterface $factory = null)
|
||||
{
|
||||
if (empty($config['filter_fields']))
|
||||
{
|
||||
$config['filter_fields'] = array(
|
||||
'a.id','id',
|
||||
'a.published','published',
|
||||
'a.access','access',
|
||||
'a.ordering','ordering',
|
||||
'a.created_by','created_by',
|
||||
'a.modified_by','modified_by',
|
||||
'a.symbol','symbol'
|
||||
);
|
||||
}
|
||||
|
||||
parent::__construct($config, $factory);
|
||||
|
||||
$this->app ??= Factory::getApplication();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to auto-populate the model state.
|
||||
*
|
||||
* Note. Calling getState in this method will result in recursion.
|
||||
*
|
||||
* @param string $ordering An optional ordering field.
|
||||
* @param string $direction An optional direction (asc|desc).
|
||||
*
|
||||
* @return void
|
||||
* @since 1.7.0
|
||||
*/
|
||||
protected function populateState($ordering = null, $direction = null)
|
||||
{
|
||||
$app = $this->app;
|
||||
|
||||
// Adjust the context to support modal layouts.
|
||||
if ($layout = $app->input->get('layout'))
|
||||
{
|
||||
$this->context .= '.' . $layout;
|
||||
}
|
||||
|
||||
// Check if the form was submitted
|
||||
$formSubmited = $app->input->post->get('form_submited');
|
||||
|
||||
$access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int');
|
||||
if ($formSubmited)
|
||||
{
|
||||
$access = $app->input->post->get('access');
|
||||
$this->setState('filter.access', $access);
|
||||
}
|
||||
|
||||
$published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '');
|
||||
$this->setState('filter.published', $published);
|
||||
|
||||
$created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', '');
|
||||
$this->setState('filter.created_by', $created_by);
|
||||
|
||||
$created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created');
|
||||
$this->setState('filter.created', $created);
|
||||
|
||||
$sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int');
|
||||
$this->setState('filter.sorting', $sorting);
|
||||
|
||||
$search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
|
||||
$this->setState('filter.search', $search);
|
||||
|
||||
$symbol = $this->getUserStateFromRequest($this->context . '.filter.symbol', 'filter_symbol');
|
||||
if ($formSubmited)
|
||||
{
|
||||
$symbol = $app->input->post->get('symbol');
|
||||
$this->setState('filter.symbol', $symbol);
|
||||
}
|
||||
|
||||
// List state information.
|
||||
parent::populateState($ordering, $direction);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get an array of data items.
|
||||
*
|
||||
* @return mixed An array of data items on success, false on failure.
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getItems()
|
||||
{
|
||||
// Check in items
|
||||
$this->checkInNow();
|
||||
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// Set values to display correctly.
|
||||
if (UtilitiesArrayHelper::check($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
if (!isset($user) || !ObjectHelper::check($user))
|
||||
{
|
||||
$user = $this->getCurrentUser();
|
||||
}
|
||||
foreach ($items as $nr => &$item)
|
||||
{
|
||||
// Remove items the user can't access.
|
||||
$access = ($user->authorise('currency.access', 'com_subformpower.currency.' . (int) $item->id) && $user->authorise('currency.access', 'com_subformpower'));
|
||||
if (!$access)
|
||||
{
|
||||
unset($items[$nr]);
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// return items
|
||||
return $items;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to build an SQL query to load the list data.
|
||||
*
|
||||
* @return string An SQL query
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getListQuery()
|
||||
{
|
||||
// Get the user object.
|
||||
$user = $this->getCurrentUser();
|
||||
// Create a new query object.
|
||||
$db = $this->getDatabase();
|
||||
$query = $db->getQuery(true);
|
||||
|
||||
// Select some fields
|
||||
$query->select('a.*');
|
||||
|
||||
// From the subformpower_item table
|
||||
$query->from($db->quoteName('#__subformpower_currency', 'a'));
|
||||
|
||||
// From the subformpower_country table.
|
||||
$query->select($db->quoteName(['g.name','g.id'],['country_name','country_id']));
|
||||
$query->join('LEFT', $db->quoteName('#__subformpower_country', 'g') . ' ON (' . $db->quoteName('a.country') . ' = ' . $db->quoteName('g.guid') . ')');
|
||||
|
||||
// Filter by published state
|
||||
$published = $this->getState('filter.published');
|
||||
if (is_numeric($published))
|
||||
{
|
||||
$query->where('a.published = ' . (int) $published);
|
||||
}
|
||||
elseif ($published === '')
|
||||
{
|
||||
$query->where('(a.published = 0 OR a.published = 1)');
|
||||
}
|
||||
|
||||
// Join over the asset groups.
|
||||
$query->select('ag.title AS access_level');
|
||||
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
|
||||
// Filter by access level.
|
||||
$_access = $this->getState('filter.access');
|
||||
if ($_access && is_numeric($_access))
|
||||
{
|
||||
$query->where('a.access = ' . (int) $_access);
|
||||
}
|
||||
elseif (UtilitiesArrayHelper::check($_access))
|
||||
{
|
||||
// Secure the array for the query
|
||||
$_access = ArrayHelper::toInteger($_access);
|
||||
// Filter by the Access Array.
|
||||
$query->where('a.access IN (' . implode(',', $_access) . ')');
|
||||
}
|
||||
// Implement View Level Access
|
||||
if (!$user->authorise('core.options', 'com_subformpower'))
|
||||
{
|
||||
$groups = implode(',', $user->getAuthorisedViewLevels());
|
||||
$query->where('a.access IN (' . $groups . ')');
|
||||
}
|
||||
// Filter by search.
|
||||
$search = $this->getState('filter.search');
|
||||
if (!empty($search))
|
||||
{
|
||||
if (stripos($search, 'id:') === 0)
|
||||
{
|
||||
$query->where('a.id = ' . (int) substr($search, 3));
|
||||
}
|
||||
else
|
||||
{
|
||||
$search = $db->quote('%' . $db->escape($search) . '%');
|
||||
$query->where('(a.symbol LIKE '.$search.' OR a.guid LIKE '.$search.')');
|
||||
}
|
||||
}
|
||||
|
||||
// Filter by Symbol.
|
||||
$_symbol = $this->getState('filter.symbol');
|
||||
if (is_numeric($_symbol))
|
||||
{
|
||||
if (is_float($_symbol))
|
||||
{
|
||||
$query->where('a.symbol = ' . (float) $_symbol);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where('a.symbol = ' . (int) $_symbol);
|
||||
}
|
||||
}
|
||||
elseif (StringHelper::check($_symbol))
|
||||
{
|
||||
$query->where('a.symbol = ' . $db->quote($db->escape($_symbol)));
|
||||
}
|
||||
|
||||
// Add the list ordering clause.
|
||||
$orderCol = $this->getState('list.ordering', 'a.id');
|
||||
$orderDirn = $this->getState('list.direction', 'desc');
|
||||
if ($orderCol != '')
|
||||
{
|
||||
// Check that the order direction is valid encase we have a field called direction as part of filers.
|
||||
$orderDirn = (is_string($orderDirn) && in_array(strtolower($orderDirn), ['asc', 'desc'])) ? $orderDirn : 'desc';
|
||||
$query->order($db->escape($orderCol . ' ' . $orderDirn));
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get list export data.
|
||||
*
|
||||
* @param array $pks The ids of the items to get
|
||||
* @param JUser $user The user making the request
|
||||
*
|
||||
* @return mixed An array of data items on success, false on failure.
|
||||
*/
|
||||
public function getExportData($pks, $user = null)
|
||||
{
|
||||
// setup the query
|
||||
if (($pks_size = UtilitiesArrayHelper::check($pks)) !== false || 'bulk' === $pks)
|
||||
{
|
||||
// Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME)
|
||||
$_export = true;
|
||||
// Get the user object if not set.
|
||||
if (!isset($user) || !ObjectHelper::check($user))
|
||||
{
|
||||
$user = $this->getCurrentUser();
|
||||
}
|
||||
// Create a new query object.
|
||||
$db = $this->getDatabase();
|
||||
$query = $db->getQuery(true);
|
||||
|
||||
// Select some fields
|
||||
$query->select('a.*');
|
||||
|
||||
// From the subformpower_currency table
|
||||
$query->from($db->quoteName('#__subformpower_currency', 'a'));
|
||||
// The bulk export path
|
||||
if ('bulk' === $pks)
|
||||
{
|
||||
$query->where('a.id > 0');
|
||||
}
|
||||
// A large array of ID's will not work out well
|
||||
elseif ($pks_size > 500)
|
||||
{
|
||||
// Use lowest ID
|
||||
$query->where('a.id >= ' . (int) min($pks));
|
||||
// Use highest ID
|
||||
$query->where('a.id <= ' . (int) max($pks));
|
||||
}
|
||||
// The normal default path
|
||||
else
|
||||
{
|
||||
$query->where('a.id IN (' . implode(',',$pks) . ')');
|
||||
}
|
||||
// Implement View Level Access
|
||||
if (!$user->authorise('core.options', 'com_subformpower'))
|
||||
{
|
||||
$groups = implode(',', $user->getAuthorisedViewLevels());
|
||||
$query->where('a.access IN (' . $groups . ')');
|
||||
}
|
||||
|
||||
// Order the results by ordering
|
||||
$query->order('a.ordering ASC');
|
||||
|
||||
// Load the items
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
if ($db->getNumRows())
|
||||
{
|
||||
$items = $db->loadObjectList();
|
||||
|
||||
// Set values to display correctly.
|
||||
if (UtilitiesArrayHelper::check($items))
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
{
|
||||
// Remove items the user can't access.
|
||||
$access = ($user->authorise('currency.access', 'com_subformpower.currency.' . (int) $item->id) && $user->authorise('currency.access', 'com_subformpower'));
|
||||
if (!$access)
|
||||
{
|
||||
unset($items[$nr]);
|
||||
continue;
|
||||
}
|
||||
|
||||
// unset the values we don't want exported.
|
||||
unset($item->asset_id);
|
||||
unset($item->checked_out);
|
||||
unset($item->checked_out_time);
|
||||
}
|
||||
}
|
||||
// Add headers to items array.
|
||||
$headers = $this->getExImPortHeaders();
|
||||
if (ObjectHelper::check($headers))
|
||||
{
|
||||
array_unshift($items,$headers);
|
||||
}
|
||||
return $items;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get header.
|
||||
*
|
||||
* @return mixed An array of data items on success, false on failure.
|
||||
*/
|
||||
public function getExImPortHeaders()
|
||||
{
|
||||
// Get a db connection.
|
||||
$db = Factory::getDbo();
|
||||
// get the columns
|
||||
$columns = $db->getTableColumns("#__subformpower_currency");
|
||||
if (UtilitiesArrayHelper::check($columns))
|
||||
{
|
||||
// remove the headers you don't import/export.
|
||||
unset($columns['asset_id']);
|
||||
unset($columns['checked_out']);
|
||||
unset($columns['checked_out_time']);
|
||||
$headers = new \stdClass();
|
||||
foreach ($columns as $column => $type)
|
||||
{
|
||||
$headers->{$column} = $column;
|
||||
}
|
||||
return $headers;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get a store id based on model configuration state.
|
||||
*
|
||||
* @return string A store id.
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getStoreId($id = '')
|
||||
{
|
||||
// Compile the store id.
|
||||
$id .= ':' . $this->getState('filter.id');
|
||||
$id .= ':' . $this->getState('filter.search');
|
||||
$id .= ':' . $this->getState('filter.published');
|
||||
// Check if the value is an array
|
||||
$_access = $this->getState('filter.access');
|
||||
if (UtilitiesArrayHelper::check($_access))
|
||||
{
|
||||
$id .= ':' . implode(':', $_access);
|
||||
}
|
||||
// Check if this is only an number or string
|
||||
elseif (is_numeric($_access)
|
||||
|| StringHelper::check($_access))
|
||||
{
|
||||
$id .= ':' . $_access;
|
||||
}
|
||||
$id .= ':' . $this->getState('filter.ordering');
|
||||
$id .= ':' . $this->getState('filter.created_by');
|
||||
$id .= ':' . $this->getState('filter.modified_by');
|
||||
$id .= ':' . $this->getState('filter.symbol');
|
||||
|
||||
return parent::getStoreId($id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the styles that have to be included on the view
|
||||
*
|
||||
* @return array styles files
|
||||
* @since 4.3
|
||||
*/
|
||||
public function getStyles(): array
|
||||
{
|
||||
return $this->styles;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to set the styles that have to be included on the view
|
||||
*
|
||||
* @return void
|
||||
* @since 4.3
|
||||
*/
|
||||
public function setStyles(string $path): void
|
||||
{
|
||||
$this->styles[] = $path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the script that have to be included on the view
|
||||
*
|
||||
* @return array script files
|
||||
* @since 4.3
|
||||
*/
|
||||
public function getScripts(): array
|
||||
{
|
||||
return $this->scripts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to set the script that have to be included on the view
|
||||
*
|
||||
* @return void
|
||||
* @since 4.3
|
||||
*/
|
||||
public function setScript(string $path): void
|
||||
{
|
||||
$this->scripts[] = $path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build an SQL query to checkin all items left checked out longer then a set time.
|
||||
*
|
||||
* @return bool
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected function checkInNow(): bool
|
||||
{
|
||||
// Get set check in time
|
||||
$time = ComponentHelper::getParams('com_subformpower')->get('check_in');
|
||||
|
||||
if ($time)
|
||||
{
|
||||
// Get a db connection.
|
||||
$db = $this->getDatabase();
|
||||
// Reset query.
|
||||
$query = $db->getQuery(true);
|
||||
$query->select('*');
|
||||
$query->from($db->quoteName('#__subformpower_currency'));
|
||||
// Only select items that are checked out.
|
||||
$query->where($db->quoteName('checked_out') . '!=0');
|
||||
$db->setQuery($query, 0, 1);
|
||||
$db->execute();
|
||||
if ($db->getNumRows())
|
||||
{
|
||||
// Get Yesterdays date.
|
||||
$date = Factory::getDate()->modify($time)->toSql();
|
||||
// Reset query.
|
||||
$query = $db->getQuery(true);
|
||||
|
||||
// Fields to update.
|
||||
$fields = array(
|
||||
$db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'',
|
||||
$db->quoteName('checked_out') . '=0'
|
||||
);
|
||||
|
||||
// Conditions for which records should be updated.
|
||||
$conditions = array(
|
||||
$db->quoteName('checked_out') . '!=0',
|
||||
$db->quoteName('checked_out_time') . '<\''.$date.'\''
|
||||
);
|
||||
|
||||
// Check table.
|
||||
$query->update($db->quoteName('#__subformpower_currency'))->set($fields)->where($conditions);
|
||||
|
||||
$db->setQuery($query);
|
||||
|
||||
return $db->execute();
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
984
admin/src/Model/CurrencyModel.php
Normal file
984
admin/src/Model/CurrencyModel.php
Normal file
@@ -0,0 +1,984 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage CurrencyModel.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
namespace JCB\Component\Subformpower\Administrator\Model;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Application\CMSApplicationInterface;
|
||||
use Joomla\CMS\Component\ComponentHelper;
|
||||
use Joomla\CMS\Form\Form;
|
||||
use Joomla\CMS\Filter\InputFilter;
|
||||
use Joomla\CMS\Filter\OutputFilter;
|
||||
use Joomla\CMS\MVC\Model\AdminModel;
|
||||
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
|
||||
use Joomla\CMS\Table\Table;
|
||||
use Joomla\CMS\UCM\UCMType;
|
||||
use Joomla\CMS\Versioning\VersionableModelTrait;
|
||||
use Joomla\CMS\User\User;
|
||||
use Joomla\Registry\Registry;
|
||||
use Joomla\String\StringHelper;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
use Joomla\Input\Input;
|
||||
use JCB\Component\Subformpower\Administrator\Helper\SubformpowerHelper;
|
||||
use Joomla\CMS\Helper\TagsHelper;
|
||||
use JCB\Joomla\Utilities\GuidHelper;
|
||||
use JCB\Joomla\Utilities\StringHelper as UtilitiesStringHelper;
|
||||
use JCB\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
|
||||
use JCB\Joomla\Utilities\GetHelper;
|
||||
|
||||
// No direct access to this file
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* Subformpower Currency Admin Model
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
class CurrencyModel extends AdminModel
|
||||
{
|
||||
use VersionableModelTrait;
|
||||
|
||||
/**
|
||||
* The tab layout fields array.
|
||||
*
|
||||
* @var array
|
||||
* @since 3.0.0
|
||||
*/
|
||||
protected $tabLayoutFields = array(
|
||||
'details' => array(
|
||||
'left' => array(
|
||||
'symbol'
|
||||
),
|
||||
'right' => array(
|
||||
'country'
|
||||
),
|
||||
'above' => array(
|
||||
'name'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* The styles array.
|
||||
*
|
||||
* @var array
|
||||
* @since 4.3
|
||||
*/
|
||||
protected array $styles = [
|
||||
'administrator/components/com_subformpower/assets/css/admin.css',
|
||||
'administrator/components/com_subformpower/assets/css/currency.css'
|
||||
];
|
||||
|
||||
/**
|
||||
* The scripts array.
|
||||
*
|
||||
* @var array
|
||||
* @since 4.3
|
||||
*/
|
||||
protected array $scripts = [
|
||||
'administrator/components/com_subformpower/assets/js/admin.js',
|
||||
'media/com_subformpower/js/currency.js'
|
||||
];
|
||||
|
||||
/**
|
||||
* @var string The prefix to use with controller messages.
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $text_prefix = 'COM_SUBFORMPOWER';
|
||||
|
||||
/**
|
||||
* The type alias for this content type.
|
||||
*
|
||||
* @var string
|
||||
* @since 3.2
|
||||
*/
|
||||
public $typeAlias = 'com_subformpower.currency';
|
||||
|
||||
/**
|
||||
* Returns a Table object, always creating it
|
||||
*
|
||||
* @param type $type The table type to instantiate
|
||||
* @param string $prefix A prefix for the table class name. Optional.
|
||||
* @param array $config Configuration array for model. Optional.
|
||||
*
|
||||
* @return Table A database object
|
||||
* @since 3.0
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function getTable($type = 'currency', $prefix = 'Administrator', $config = [])
|
||||
{
|
||||
// get instance of the table
|
||||
return parent::getTable($type, $prefix, $config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get a single record.
|
||||
*
|
||||
* @param integer $pk The id of the primary key.
|
||||
*
|
||||
* @return mixed Object on success, false on failure.
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getItem($pk = null)
|
||||
{
|
||||
if ($item = parent::getItem($pk))
|
||||
{
|
||||
if (!empty($item->params) && !is_array($item->params))
|
||||
{
|
||||
// Convert the params field to an array.
|
||||
$registry = new Registry;
|
||||
$registry->loadString($item->params);
|
||||
$item->params = $registry->toArray();
|
||||
}
|
||||
|
||||
if (!empty($item->metadata))
|
||||
{
|
||||
// Convert the metadata field to an array.
|
||||
$registry = new Registry;
|
||||
$registry->loadString($item->metadata);
|
||||
$item->metadata = $registry->toArray();
|
||||
}
|
||||
}
|
||||
|
||||
return $item;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the record form.
|
||||
*
|
||||
* @param array $data Data for the form.
|
||||
* @param boolean $loadData True if the form is to load its own data (default case), false if not.
|
||||
* @param array $options Optional array of options for the form creation.
|
||||
*
|
||||
* @return Form|boolean A Form object on success, false on failure
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getForm($data = [], $loadData = true, $options = ['control' => 'jform'])
|
||||
{
|
||||
// set load data option
|
||||
$options['load_data'] = $loadData;
|
||||
// check if xpath was set in options
|
||||
$xpath = false;
|
||||
if (isset($options['xpath']))
|
||||
{
|
||||
$xpath = $options['xpath'];
|
||||
unset($options['xpath']);
|
||||
}
|
||||
// check if clear form was set in options
|
||||
$clear = false;
|
||||
if (isset($options['clear']))
|
||||
{
|
||||
$clear = $options['clear'];
|
||||
unset($options['clear']);
|
||||
}
|
||||
|
||||
// Get the form.
|
||||
$form = $this->loadForm('com_subformpower.currency', 'currency', $options, $clear, $xpath);
|
||||
|
||||
if (empty($form))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$jinput = Factory::getApplication()->input;
|
||||
|
||||
// The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.
|
||||
if ($jinput->get('a_id'))
|
||||
{
|
||||
$id = $jinput->get('a_id', 0, 'INT');
|
||||
}
|
||||
// The back end uses id so we use that the rest of the time and set it to 0 by default.
|
||||
else
|
||||
{
|
||||
$id = $jinput->get('id', 0, 'INT');
|
||||
}
|
||||
|
||||
$user = Factory::getApplication()->getIdentity();
|
||||
|
||||
// Check for existing item.
|
||||
// Modify the form based on Edit State access controls.
|
||||
if ($id != 0 && (!$user->authorise('currency.edit.state', 'com_subformpower.currency.' . (int) $id))
|
||||
|| ($id == 0 && !$user->authorise('currency.edit.state', 'com_subformpower')))
|
||||
{
|
||||
// Disable fields for display.
|
||||
$form->setFieldAttribute('ordering', 'disabled', 'true');
|
||||
$form->setFieldAttribute('published', 'disabled', 'true');
|
||||
// Disable fields while saving.
|
||||
$form->setFieldAttribute('ordering', 'filter', 'unset');
|
||||
$form->setFieldAttribute('published', 'filter', 'unset');
|
||||
}
|
||||
// If this is a new item insure the greated by is set.
|
||||
if (0 == $id)
|
||||
{
|
||||
// Set the created_by to this user
|
||||
$form->setValue('created_by', null, $user->id);
|
||||
}
|
||||
// Modify the form based on Edit Creaded By access controls.
|
||||
if (!$user->authorise('core.edit.created_by', 'com_subformpower'))
|
||||
{
|
||||
// Disable fields for display.
|
||||
$form->setFieldAttribute('created_by', 'disabled', 'true');
|
||||
// Disable fields for display.
|
||||
$form->setFieldAttribute('created_by', 'readonly', 'true');
|
||||
// Disable fields while saving.
|
||||
$form->setFieldAttribute('created_by', 'filter', 'unset');
|
||||
}
|
||||
// Modify the form based on Edit Creaded Date access controls.
|
||||
if (!$user->authorise('core.edit.created', 'com_subformpower'))
|
||||
{
|
||||
// Disable fields for display.
|
||||
$form->setFieldAttribute('created', 'disabled', 'true');
|
||||
// Disable fields while saving.
|
||||
$form->setFieldAttribute('created', 'filter', 'unset');
|
||||
}
|
||||
// Modify the form based on Edit Guid access controls.
|
||||
if ($id != 0 && (!$user->authorise('currency.edit.guid', 'com_subformpower.currency.' . (int) $id))
|
||||
|| ($id == 0 && !$user->authorise('currency.edit.guid', 'com_subformpower')))
|
||||
{
|
||||
// Disable fields for display.
|
||||
$form->setFieldAttribute('guid', 'disabled', 'true');
|
||||
// Disable fields for display.
|
||||
$form->setFieldAttribute('guid', 'readonly', 'true');
|
||||
// If there is no value continue.
|
||||
if (!$form->getValue('guid'))
|
||||
{
|
||||
// Disable fields while saving.
|
||||
$form->setFieldAttribute('guid', 'filter', 'unset');
|
||||
// Disable fields while saving.
|
||||
$form->setFieldAttribute('guid', 'required', 'false');
|
||||
}
|
||||
}
|
||||
// Only load these values if no id is found
|
||||
if (0 == $id)
|
||||
{
|
||||
// Set redirected view name
|
||||
$redirectedView = $jinput->get('ref', null, 'STRING');
|
||||
// Set field name (or fall back to view name)
|
||||
$redirectedField = $jinput->get('field', $redirectedView, 'STRING');
|
||||
// Set redirected view id
|
||||
$redirectedId = $jinput->get('refid', 0, 'INT');
|
||||
// Set field id (or fall back to redirected view id)
|
||||
$redirectedValue = $jinput->get('field_id', $redirectedId, 'INT');
|
||||
if (0 != $redirectedValue && $redirectedField)
|
||||
{
|
||||
// Now set the local-redirected field default value
|
||||
$form->setValue($redirectedField, null, $redirectedValue);
|
||||
}
|
||||
}
|
||||
|
||||
// Only load the GUID if new item (or empty)
|
||||
if (0 == $id || !($val = $form->getValue('guid')))
|
||||
{
|
||||
$form->setValue('guid', null, GuidHelper::get());
|
||||
}
|
||||
|
||||
return $form;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the styles that have to be included on the view
|
||||
*
|
||||
* @return array styles files
|
||||
* @since 4.3
|
||||
*/
|
||||
public function getStyles(): array
|
||||
{
|
||||
return $this->styles;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to set the styles that have to be included on the view
|
||||
*
|
||||
* @return void
|
||||
* @since 4.3
|
||||
*/
|
||||
public function setStyles(string $path): void
|
||||
{
|
||||
$this->styles[] = $path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the script that have to be included on the view
|
||||
*
|
||||
* @return array script files
|
||||
* @since 4.3
|
||||
*/
|
||||
public function getScripts(): array
|
||||
{
|
||||
return $this->scripts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to set the script that have to be included on the view
|
||||
*
|
||||
* @return void
|
||||
* @since 4.3
|
||||
*/
|
||||
public function setScript(string $path): void
|
||||
{
|
||||
$this->scripts[] = $path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to test whether a record can be deleted.
|
||||
*
|
||||
* @param object $record A record object.
|
||||
*
|
||||
* @return boolean True if allowed to delete the record. Defaults to the permission set in the component.
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function canDelete($record)
|
||||
{
|
||||
if (empty($record->id) || ($record->published != -2))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// The record has been set. Check the record permissions.
|
||||
return $this->getCurrentUser()->authorise('currency.delete', 'com_subformpower.currency.' . (int) $record->id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to test whether a record can have its state edited.
|
||||
*
|
||||
* @param object $record A record object.
|
||||
*
|
||||
* @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component.
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function canEditState($record)
|
||||
{
|
||||
$user = $this->getCurrentUser();
|
||||
$recordId = $record->id ?? 0;
|
||||
|
||||
if ($recordId)
|
||||
{
|
||||
// The record has been set. Check the record permissions.
|
||||
$permission = $user->authorise('currency.edit.state', 'com_subformpower.currency.' . (int) $recordId);
|
||||
if (!$permission && !is_null($permission))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// In the absence of better information, revert to the component permissions.
|
||||
return $user->authorise('currency.edit.state', 'com_subformpower');
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can edit an existing record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
* @param string $key The name of the key for the primary key.
|
||||
*
|
||||
* @return boolean
|
||||
* @since 2.5
|
||||
*/
|
||||
protected function allowEdit($data = [], $key = 'id')
|
||||
{
|
||||
// Check specific edit permission then general edit permission.
|
||||
$user = Factory::getApplication()->getIdentity();
|
||||
|
||||
return $user->authorise('currency.edit', 'com_subformpower.currency.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('currency.edit', 'com_subformpower');
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare and sanitise the table data prior to saving.
|
||||
*
|
||||
* @param Table $table A Table object.
|
||||
*
|
||||
* @return void
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function prepareTable($table)
|
||||
{
|
||||
$date = Factory::getDate();
|
||||
$user = $this->getCurrentUser();
|
||||
|
||||
if (isset($table->name))
|
||||
{
|
||||
$table->name = \htmlspecialchars_decode($table->name, ENT_QUOTES);
|
||||
}
|
||||
|
||||
if (isset($table->alias) && empty($table->alias))
|
||||
{
|
||||
$table->generateAlias();
|
||||
}
|
||||
|
||||
if (empty($table->id))
|
||||
{
|
||||
$table->created = $date->toSql();
|
||||
// set the user
|
||||
if ($table->created_by == 0 || empty($table->created_by))
|
||||
{
|
||||
$table->created_by = $user->id;
|
||||
}
|
||||
// Set ordering to the last item if not set
|
||||
if (empty($table->ordering))
|
||||
{
|
||||
$db = $this->getDatabase();
|
||||
$query = $db->getQuery(true)
|
||||
->select('MAX(ordering)')
|
||||
->from($db->quoteName('#__subformpower_currency'));
|
||||
$db->setQuery($query);
|
||||
$max = $db->loadResult();
|
||||
|
||||
$table->ordering = $max + 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$table->modified = $date->toSql();
|
||||
$table->modified_by = $user->id;
|
||||
}
|
||||
|
||||
if (!empty($table->id))
|
||||
{
|
||||
// Increment the items version number.
|
||||
$table->version++;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the data that should be injected in the form.
|
||||
*
|
||||
* @return mixed The data for the form.
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function loadFormData()
|
||||
{
|
||||
// Check the session for previously entered form data.
|
||||
$data = Factory::getApplication()->getUserState('com_subformpower.edit.currency.data', []);
|
||||
|
||||
if (empty($data))
|
||||
{
|
||||
$data = $this->getItem();
|
||||
}
|
||||
|
||||
// run the perprocess of the data
|
||||
$this->preprocessData('com_subformpower.currency', $data);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the unique fields of this table.
|
||||
*
|
||||
* @return mixed An array of field names, boolean false if none is set.
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
protected function getUniqueFields()
|
||||
{
|
||||
return array('guid');
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to delete one or more records.
|
||||
*
|
||||
* @param array &$pks An array of record primary keys.
|
||||
*
|
||||
* @return boolean True if successful, false if an error occurs
|
||||
* @since 12.2
|
||||
*/
|
||||
public function delete(&$pks)
|
||||
{
|
||||
if (!parent::delete($pks))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to change the published state of one or more records.
|
||||
*
|
||||
* @param array &$pks A list of the primary keys to change.
|
||||
* @param integer $value The value of the published state.
|
||||
*
|
||||
* @return boolean True on success.
|
||||
* @since 12.2
|
||||
*/
|
||||
public function publish(&$pks, $value = 1)
|
||||
{
|
||||
if (!parent::publish($pks, $value))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to perform batch operations on an item or a set of items.
|
||||
*
|
||||
* @param array $commands An array of commands to perform.
|
||||
* @param array $pks An array of item ids.
|
||||
* @param array $contexts An array of item contexts.
|
||||
*
|
||||
* @return boolean Returns true on success, false on failure.
|
||||
* @since 12.2
|
||||
*/
|
||||
public function batch($commands, $pks, $contexts)
|
||||
{
|
||||
// Sanitize ids.
|
||||
$pks = array_unique($pks);
|
||||
ArrayHelper::toInteger($pks);
|
||||
|
||||
// Remove any values of zero.
|
||||
if (array_search(0, $pks, true))
|
||||
{
|
||||
unset($pks[array_search(0, $pks, true)]);
|
||||
}
|
||||
|
||||
if (empty($pks))
|
||||
{
|
||||
$this->setError(Text::_('JGLOBAL_NO_ITEM_SELECTED'));
|
||||
return false;
|
||||
}
|
||||
|
||||
$done = false;
|
||||
|
||||
// Set some needed variables.
|
||||
$this->user ??= $this->getCurrentUser();
|
||||
$this->table = $this->getTable();
|
||||
$this->tableClassName = get_class($this->table);
|
||||
$this->contentType = new UCMType;
|
||||
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
|
||||
$this->canDo = SubformpowerHelper::getActions('currency');
|
||||
$this->batchSet = true;
|
||||
|
||||
if (!$this->canDo->get('core.batch'))
|
||||
{
|
||||
$this->setError(Text::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->type == false)
|
||||
{
|
||||
$type = new UCMType;
|
||||
$this->type = $type->getTypeByAlias($this->typeAlias);
|
||||
}
|
||||
|
||||
$this->tagsObserver = $this->table->getObserverOfClass('JTableObserverTags');
|
||||
|
||||
if (!empty($commands['move_copy']))
|
||||
{
|
||||
$cmd = ArrayHelper::getValue($commands, 'move_copy', 'c');
|
||||
|
||||
if ($cmd == 'c')
|
||||
{
|
||||
$result = $this->batchCopy($commands, $pks, $contexts);
|
||||
|
||||
if (is_array($result))
|
||||
{
|
||||
foreach ($result as $old => $new)
|
||||
{
|
||||
$contexts[$new] = $contexts[$old];
|
||||
}
|
||||
$pks = array_values($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
elseif ($cmd == 'm' && !$this->batchMove($commands, $pks, $contexts))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$done = true;
|
||||
}
|
||||
|
||||
if (!$done)
|
||||
{
|
||||
$this->setError(Text::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
|
||||
return false;
|
||||
}
|
||||
|
||||
// Clear the cache
|
||||
$this->cleanCache();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Batch copy items to a new category or current.
|
||||
*
|
||||
* @param integer $values The new values.
|
||||
* @param array $pks An array of row IDs.
|
||||
* @param array $contexts An array of item contexts.
|
||||
*
|
||||
* @return mixed An array of new IDs on success, boolean false on failure.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
protected function batchCopy($values, $pks, $contexts)
|
||||
{
|
||||
if (empty($this->batchSet))
|
||||
{
|
||||
// Set some needed variables.
|
||||
$this->user = Factory::getApplication()->getIdentity();
|
||||
$this->table = $this->getTable();
|
||||
$this->tableClassName = get_class($this->table);
|
||||
$this->canDo = SubformpowerHelper::getActions('currency');
|
||||
}
|
||||
|
||||
if (!$this->canDo->get('currency.create') && !$this->canDo->get('currency.batch'))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// get list of unique fields
|
||||
$uniqueFields = $this->getUniqueFields();
|
||||
// remove move_copy from array
|
||||
unset($values['move_copy']);
|
||||
|
||||
// make sure published is set
|
||||
if (!isset($values['published']))
|
||||
{
|
||||
$values['published'] = 0;
|
||||
}
|
||||
elseif (isset($values['published']) && !$this->canDo->get('currency.edit.state'))
|
||||
{
|
||||
$values['published'] = 0;
|
||||
}
|
||||
|
||||
$newIds = [];
|
||||
// Parent exists so let's proceed
|
||||
while (!empty($pks))
|
||||
{
|
||||
// Pop the first ID off the stack
|
||||
$pk = array_shift($pks);
|
||||
|
||||
$this->table->reset();
|
||||
|
||||
// only allow copy if user may edit this item.
|
||||
if (!$this->user->authorise('currency.edit', $contexts[$pk]))
|
||||
{
|
||||
// Not fatal error
|
||||
$this->setError(Text::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check that the row actually exists
|
||||
if (!$this->table->load($pk))
|
||||
{
|
||||
if ($error = $this->table->getError())
|
||||
{
|
||||
// Fatal error
|
||||
$this->setError($error);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Not fatal error
|
||||
$this->setError(Text::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Only for strings
|
||||
if (UtilitiesStringHelper::check($this->table->name) && !is_numeric($this->table->name))
|
||||
{
|
||||
$this->table->name = $this->generateUnique('name',$this->table->name);
|
||||
}
|
||||
|
||||
// insert all set values
|
||||
if (UtilitiesArrayHelper::check($values))
|
||||
{
|
||||
foreach ($values as $key => $value)
|
||||
{
|
||||
if (strlen($value) > 0 && isset($this->table->$key))
|
||||
{
|
||||
$this->table->$key = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// update all unique fields
|
||||
if (UtilitiesArrayHelper::check($uniqueFields))
|
||||
{
|
||||
foreach ($uniqueFields as $uniqueField)
|
||||
{
|
||||
$this->table->$uniqueField = $this->generateUnique($uniqueField,$this->table->$uniqueField);
|
||||
}
|
||||
}
|
||||
|
||||
// Reset the ID because we are making a copy
|
||||
$this->table->id = 0;
|
||||
|
||||
// TODO: Deal with ordering?
|
||||
// $this->table->ordering = 1;
|
||||
|
||||
// Check the row.
|
||||
if (!$this->table->check())
|
||||
{
|
||||
$this->setError($this->table->getError());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!empty($this->type))
|
||||
{
|
||||
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
|
||||
}
|
||||
|
||||
// Store the row.
|
||||
if (!$this->table->store())
|
||||
{
|
||||
$this->setError($this->table->getError());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get the new item ID
|
||||
$newId = $this->table->get('id');
|
||||
|
||||
// Add the new ID to the array
|
||||
$newIds[$pk] = $newId;
|
||||
}
|
||||
|
||||
// Clean the cache
|
||||
$this->cleanCache();
|
||||
|
||||
return $newIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* Batch move items to a new category
|
||||
*
|
||||
* @param integer $value The new category ID.
|
||||
* @param array $pks An array of row IDs.
|
||||
* @param array $contexts An array of item contexts.
|
||||
*
|
||||
* @return boolean True if successful, false otherwise and internal error is set.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
protected function batchMove($values, $pks, $contexts)
|
||||
{
|
||||
if (empty($this->batchSet))
|
||||
{
|
||||
// Set some needed variables.
|
||||
$this->user = Factory::getApplication()->getIdentity();
|
||||
$this->table = $this->getTable();
|
||||
$this->tableClassName = get_class($this->table);
|
||||
$this->canDo = SubformpowerHelper::getActions('currency');
|
||||
}
|
||||
|
||||
if (!$this->canDo->get('currency.edit') && !$this->canDo->get('currency.batch'))
|
||||
{
|
||||
$this->setError(Text::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
|
||||
return false;
|
||||
}
|
||||
|
||||
// make sure published only updates if user has the permission.
|
||||
if (isset($values['published']) && !$this->canDo->get('currency.edit.state'))
|
||||
{
|
||||
unset($values['published']);
|
||||
}
|
||||
// remove move_copy from array
|
||||
unset($values['move_copy']);
|
||||
|
||||
// Parent exists so we proceed
|
||||
foreach ($pks as $pk)
|
||||
{
|
||||
if (!$this->user->authorise('currency.edit', $contexts[$pk]))
|
||||
{
|
||||
$this->setError(Text::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check that the row actually exists
|
||||
if (!$this->table->load($pk))
|
||||
{
|
||||
if ($error = $this->table->getError())
|
||||
{
|
||||
// Fatal error
|
||||
$this->setError($error);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Not fatal error
|
||||
$this->setError(Text::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// insert all set values.
|
||||
if (UtilitiesArrayHelper::check($values))
|
||||
{
|
||||
foreach ($values as $key => $value)
|
||||
{
|
||||
// Do special action for access.
|
||||
if ('access' === $key && strlen($value) > 0)
|
||||
{
|
||||
$this->table->$key = $value;
|
||||
}
|
||||
elseif (strlen($value) > 0 && isset($this->table->$key))
|
||||
{
|
||||
$this->table->$key = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Check the row.
|
||||
if (!$this->table->check())
|
||||
{
|
||||
$this->setError($this->table->getError());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!empty($this->type))
|
||||
{
|
||||
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
|
||||
}
|
||||
|
||||
// Store the row.
|
||||
if (!$this->table->store())
|
||||
{
|
||||
$this->setError($this->table->getError());
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Clean the cache
|
||||
$this->cleanCache();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to save the form data.
|
||||
*
|
||||
* @param array $data The form data.
|
||||
*
|
||||
* @return boolean True on success.
|
||||
* @since 1.6
|
||||
*/
|
||||
public function save($data)
|
||||
{
|
||||
$input = Factory::getApplication()->getInput();
|
||||
$filter = InputFilter::getInstance();
|
||||
|
||||
// set the metadata to the Item Data
|
||||
if (isset($data['metadata']) && isset($data['metadata']['author']))
|
||||
{
|
||||
$data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM');
|
||||
|
||||
$metadata = new Registry;
|
||||
$metadata->loadArray($data['metadata']);
|
||||
$data['metadata'] = (string) $metadata;
|
||||
}
|
||||
|
||||
|
||||
// Set the GUID if empty or not valid
|
||||
if (empty($data['guid']) && $data['id'] > 0)
|
||||
{
|
||||
// get the existing one
|
||||
$data['guid'] = (string) GetHelper::var('currency', $data['id'], 'id', 'guid');
|
||||
}
|
||||
// Set the GUID if empty or not valid
|
||||
while (!GuidHelper::valid($data['guid'], "currency", $data['id']))
|
||||
{
|
||||
// must always be set
|
||||
$data['guid'] = (string) GuidHelper::get();
|
||||
}
|
||||
|
||||
|
||||
// Set the Params Items to data
|
||||
if (isset($data['params']) && is_array($data['params']))
|
||||
{
|
||||
$params = new Registry;
|
||||
$params->loadArray($data['params']);
|
||||
$data['params'] = (string) $params;
|
||||
}
|
||||
|
||||
// Alter the unique field for save as copy
|
||||
if ($input->get('task') === 'save2copy')
|
||||
{
|
||||
// Automatic handling of other unique fields
|
||||
$uniqueFields = $this->getUniqueFields();
|
||||
if (UtilitiesArrayHelper::check($uniqueFields))
|
||||
{
|
||||
foreach ($uniqueFields as $uniqueField)
|
||||
{
|
||||
$data[$uniqueField] = $this->generateUnique($uniqueField,$data[$uniqueField]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (parent::save($data))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to generate a unique value.
|
||||
*
|
||||
* @param string $field name.
|
||||
* @param string $value data.
|
||||
*
|
||||
* @return string New value.
|
||||
* @since 3.0
|
||||
*/
|
||||
protected function generateUnique($field, $value)
|
||||
{
|
||||
// set field value unique
|
||||
$table = $this->getTable();
|
||||
|
||||
while ($table->load([$field => $value]))
|
||||
{
|
||||
$value = StringHelper::increment($value);
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to change the title
|
||||
*
|
||||
* @param string $title The title.
|
||||
*
|
||||
* @return array Contains the modified title and alias.
|
||||
*
|
||||
*/
|
||||
protected function _generateNewTitle($title)
|
||||
{
|
||||
|
||||
// Alter the title
|
||||
$table = $this->getTable();
|
||||
|
||||
while ($table->load(['title' => $title]))
|
||||
{
|
||||
$title = StringHelper::increment($title);
|
||||
}
|
||||
|
||||
return $title;
|
||||
}
|
||||
}
|
761
admin/src/Model/ImportModel.php
Normal file
761
admin/src/Model/ImportModel.php
Normal file
@@ -0,0 +1,761 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage ImportModel.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
namespace JCB\Component\Subformpower\Administrator\Model;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Filesystem\File;
|
||||
use Joomla\CMS\Filesystem\Folder;
|
||||
use Joomla\CMS\Filesystem\Path;
|
||||
use Joomla\CMS\Filter\OutputFilter;
|
||||
use Joomla\CMS\Installer\InstallerHelper;
|
||||
use Joomla\CMS\MVC\Model\BaseDatabaseModel;
|
||||
use Joomla\String\StringHelper;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
use PhpOffice\PhpSpreadsheet\IOFactory;
|
||||
use JCB\Component\Subformpower\Administrator\Helper\SubformpowerHelper;
|
||||
use JCB\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
|
||||
|
||||
// No direct access to this file
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
/***
|
||||
* Subformpower Import Base Database Model
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
class ImportModel extends BaseDatabaseModel
|
||||
{
|
||||
// set uploading values
|
||||
protected $use_streams = false;
|
||||
protected $allow_unsafe = false;
|
||||
protected $safeFileOptions = [];
|
||||
|
||||
/**
|
||||
* @var object JTable object
|
||||
*/
|
||||
protected $_table = null;
|
||||
|
||||
/**
|
||||
* @var object JTable object
|
||||
*/
|
||||
protected $_url = null;
|
||||
|
||||
/**
|
||||
* Model context string.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_context = 'com_subformpower.import';
|
||||
|
||||
/**
|
||||
* Import Settings
|
||||
*/
|
||||
protected $getType = NULL;
|
||||
protected $dataType = NULL;
|
||||
|
||||
/**
|
||||
* Method to auto-populate the model state.
|
||||
*
|
||||
* Note. Calling getState in this method will result in recursion.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
*/
|
||||
protected function populateState()
|
||||
{
|
||||
$app = Factory::getApplication('administrator');
|
||||
|
||||
$this->setState('message', $app->getUserState('com_subformpower.message'));
|
||||
$app->setUserState('com_subformpower.message', '');
|
||||
|
||||
// Recall the 'Import from Directory' path.
|
||||
$path = $app->getUserStateFromRequest($this->_context . '.import_directory', 'import_directory', $app->get('tmp_path'));
|
||||
$this->setState('import.directory', $path);
|
||||
parent::populateState();
|
||||
}
|
||||
|
||||
/**
|
||||
* Import an spreadsheet from either folder, url or upload.
|
||||
*
|
||||
* @return boolean result of import
|
||||
*
|
||||
*/
|
||||
public function import()
|
||||
{
|
||||
$this->setState('action', 'import');
|
||||
$app = Factory::getApplication();
|
||||
$session = Factory::getSession();
|
||||
$package = null;
|
||||
$continue = false;
|
||||
// get import type
|
||||
$this->getType = $app->input->getString('gettype', NULL);
|
||||
// get import type
|
||||
$this->dataType = $session->get('dataType_VDM_IMPORTINTO', NULL);
|
||||
|
||||
if ($package === null)
|
||||
{
|
||||
switch ($this->getType)
|
||||
{
|
||||
case 'folder':
|
||||
// Remember the 'Import from Directory' path.
|
||||
$app->getUserStateFromRequest($this->_context . '.import_directory', 'import_directory');
|
||||
$package = $this->_getPackageFromFolder();
|
||||
break;
|
||||
|
||||
case 'upload':
|
||||
$package = $this->_getPackageFromUpload();
|
||||
break;
|
||||
|
||||
case 'url':
|
||||
$package = $this->_getPackageFromUrl();
|
||||
break;
|
||||
|
||||
case 'continue':
|
||||
$continue = true;
|
||||
$package = $session->get('package', null);
|
||||
$package = json_decode($package, true);
|
||||
// clear session
|
||||
$session->clear('package');
|
||||
$session->clear('dataType');
|
||||
$session->clear('hasPackage');
|
||||
break;
|
||||
|
||||
default:
|
||||
$app->setUserState('com_subformpower.message', Text::_('COM_SUBFORMPOWER_IMPORT_NO_IMPORT_TYPE_FOUND'));
|
||||
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Was the package valid?
|
||||
if (!$package || !$package['type'])
|
||||
{
|
||||
if (in_array($this->getType, array('upload', 'url')))
|
||||
{
|
||||
$this->remove($package['packagename']);
|
||||
}
|
||||
|
||||
$app->setUserState('com_subformpower.message', Text::_('COM_SUBFORMPOWER_IMPORT_UNABLE_TO_FIND_IMPORT_PACKAGE'));
|
||||
return false;
|
||||
}
|
||||
|
||||
// first link data to table headers
|
||||
if(!$continue){
|
||||
$package = json_encode($package);
|
||||
$session->set('package', $package);
|
||||
$session->set('dataType', $this->dataType);
|
||||
$session->set('hasPackage', true);
|
||||
return true;
|
||||
}
|
||||
|
||||
// set the data
|
||||
$headerList = json_decode($session->get($this->dataType.'_VDM_IMPORTHEADERS', false), true);
|
||||
if (!$this->setData($package,$this->dataType,$headerList))
|
||||
{
|
||||
// There was an error importing the package
|
||||
$msg = Text::_('COM_SUBFORMPOWER_IMPORT_ERROR');
|
||||
$back = $session->get('backto_VDM_IMPORT', NULL);
|
||||
if ($back)
|
||||
{
|
||||
$app->setUserState('com_subformpower.redirect_url', 'index.php?option=com_subformpower&view='.$back);
|
||||
$session->clear('backto_VDM_IMPORT');
|
||||
}
|
||||
$result = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Package imported sucessfully
|
||||
$msg = Text::sprintf('COM_SUBFORMPOWER_IMPORT_SUCCESS', $package['packagename']);
|
||||
$back = $session->get('backto_VDM_IMPORT', NULL);
|
||||
if ($back)
|
||||
{
|
||||
$app->setUserState('com_subformpower.redirect_url', 'index.php?option=com_subformpower&view='.$back);
|
||||
$session->clear('backto_VDM_IMPORT');
|
||||
}
|
||||
$result = true;
|
||||
}
|
||||
|
||||
// Set some model state values
|
||||
$app->enqueueMessage($msg);
|
||||
|
||||
// remove file after import
|
||||
$this->remove($package['packagename']);
|
||||
$session->clear($this->getType.'_VDM_IMPORTHEADERS');
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Works out an importation spreadsheet from a HTTP upload
|
||||
*
|
||||
* @return spreadsheet definition or false on failure
|
||||
*/
|
||||
protected function _getPackageFromUpload()
|
||||
{
|
||||
// Get the uploaded file information
|
||||
$app = Factory::getApplication();
|
||||
$input = $app->input;
|
||||
|
||||
// Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get.
|
||||
$userfile = $input->files->get('import_package', null, 'raw');
|
||||
|
||||
// Make sure that file uploads are enabled in php
|
||||
if (!(bool) ini_get('file_uploads'))
|
||||
{
|
||||
$app->enqueueMessage(Text::_('COM_SUBFORMPOWER_IMPORT_MSG_WARNIMPORTFILE'), 'warning');
|
||||
return false;
|
||||
}
|
||||
|
||||
// If there is no uploaded file, we have a problem...
|
||||
if (!is_array($userfile))
|
||||
{
|
||||
$app->enqueueMessage(Text::_('COM_SUBFORMPOWER_IMPORT_MSG_NO_FILE_SELECTED'), 'warning');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if there was a problem uploading the file.
|
||||
if ($userfile['error'] || $userfile['size'] < 1)
|
||||
{
|
||||
$app->enqueueMessage(Text::_('COM_SUBFORMPOWER_IMPORT_MSG_WARNIMPORTUPLOADERROR'), 'warning');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Build the appropriate paths
|
||||
$config = Factory::getConfig();
|
||||
$tmp_dest = $config->get('tmp_path') . '/' . $userfile['name'];
|
||||
$tmp_src = $userfile['tmp_name'];
|
||||
|
||||
// Move uploaded file
|
||||
$p_file = File::upload($tmp_src, $tmp_dest, $this->use_streams, $this->allow_unsafe, $this->safeFileOptions);
|
||||
|
||||
// Was the package downloaded?
|
||||
if (!$p_file)
|
||||
{
|
||||
$session = Factory::getSession();
|
||||
$session->clear('package');
|
||||
$session->clear('dataType');
|
||||
$session->clear('hasPackage');
|
||||
// was not uploaded
|
||||
return false;
|
||||
}
|
||||
|
||||
// check that this is a valid spreadsheet
|
||||
$package = $this->check($userfile['name']);
|
||||
|
||||
return $package;
|
||||
}
|
||||
|
||||
/**
|
||||
* Import an spreadsheet from a directory
|
||||
*
|
||||
* @return array Spreadsheet details or false on failure
|
||||
*
|
||||
*/
|
||||
protected function _getPackageFromFolder()
|
||||
{
|
||||
$app = Factory::getApplication();
|
||||
$input = $app->input;
|
||||
|
||||
// Get the path to the package to import
|
||||
$p_dir = $input->getString('import_directory');
|
||||
$p_dir = Path::clean($p_dir);
|
||||
// Did you give us a valid path?
|
||||
if (!file_exists($p_dir))
|
||||
{
|
||||
$app->enqueueMessage(Text::_('COM_SUBFORMPOWER_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'), 'warning');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Detect the package type
|
||||
$type = $this->getType;
|
||||
|
||||
// Did you give us a valid package?
|
||||
if (!$type)
|
||||
{
|
||||
$app->enqueueMessage(Text::_('COM_SUBFORMPOWER_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'), 'warning');
|
||||
}
|
||||
|
||||
// check the extention
|
||||
if(!$this->checkExtension($p_dir))
|
||||
{
|
||||
// set error message
|
||||
$app->enqueueMessage(Text::_('COM_SUBFORMPOWER_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning');
|
||||
return false;
|
||||
}
|
||||
|
||||
$package['packagename'] = null;
|
||||
$package['dir'] = $p_dir;
|
||||
$package['type'] = $type;
|
||||
|
||||
return $package;
|
||||
}
|
||||
|
||||
/**
|
||||
* Import an spreadsheet from a URL
|
||||
*
|
||||
* @return Package details or false on failure
|
||||
*
|
||||
*/
|
||||
protected function _getPackageFromUrl()
|
||||
{
|
||||
$app = Factory::getApplication();
|
||||
$input = $app->input;
|
||||
|
||||
// Get the URL of the package to import
|
||||
$url = $input->getString('import_url');
|
||||
|
||||
// Did you give us a URL?
|
||||
if (!$url)
|
||||
{
|
||||
$app->enqueueMessage(Text::_('COM_SUBFORMPOWER_IMPORT_MSG_ENTER_A_URL'), 'warning');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Download the package at the URL given
|
||||
$p_file = InstallerHelper::downloadPackage($url);
|
||||
|
||||
// Was the package downloaded?
|
||||
if (!$p_file)
|
||||
{
|
||||
$app->enqueueMessage(Text::_('COM_SUBFORMPOWER_IMPORT_MSG_INVALID_URL'), 'warning');
|
||||
return false;
|
||||
}
|
||||
|
||||
// check that this is a valid spreadsheet
|
||||
$package = $this->check($p_file);
|
||||
|
||||
return $package;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check a file and verifies it as a spreadsheet file
|
||||
* Supports .csv .xlsx .xls and .ods
|
||||
*
|
||||
* @param string $p_filename The uploaded package filename or import directory
|
||||
*
|
||||
* @return array of elements
|
||||
*
|
||||
*/
|
||||
protected function check($archivename)
|
||||
{
|
||||
$app = Factory::getApplication();
|
||||
// Clean the name
|
||||
$archivename = Path::clean($archivename);
|
||||
|
||||
// check the extention
|
||||
if(!$this->checkExtension($archivename))
|
||||
{
|
||||
// Cleanup the import files
|
||||
$this->remove($archivename);
|
||||
$app->enqueueMessage(Text::_('COM_SUBFORMPOWER_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning');
|
||||
return false;
|
||||
}
|
||||
|
||||
$config = Factory::getConfig();
|
||||
// set Package Name
|
||||
$check['packagename'] = $archivename;
|
||||
|
||||
// set directory
|
||||
$check['dir'] = $config->get('tmp_path'). '/' .$archivename;
|
||||
|
||||
// set type
|
||||
$check['type'] = $this->getType;
|
||||
|
||||
return $check;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the extension
|
||||
*
|
||||
* @param string $file Name of the uploaded file
|
||||
*
|
||||
* @return boolean True on success
|
||||
*
|
||||
*/
|
||||
protected function checkExtension($file)
|
||||
{
|
||||
// check the extention
|
||||
switch(strtolower(pathinfo($file, PATHINFO_EXTENSION)))
|
||||
{
|
||||
case 'xls':
|
||||
case 'ods':
|
||||
case 'csv':
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up temporary uploaded spreadsheet
|
||||
*
|
||||
* @param string $package Name of the uploaded spreadsheet file
|
||||
*
|
||||
* @return boolean True on success
|
||||
*
|
||||
*/
|
||||
protected function remove($package)
|
||||
{
|
||||
jimport('joomla.filesystem.file');
|
||||
|
||||
$config = Factory::getConfig();
|
||||
$package = $config->get('tmp_path'). '/' .$package;
|
||||
|
||||
// Is the package file a valid file?
|
||||
if (is_file($package))
|
||||
{
|
||||
File::delete($package);
|
||||
}
|
||||
elseif (is_file(Path::clean($package)))
|
||||
{
|
||||
// It might also be just a base filename
|
||||
File::delete(Path::clean($package));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the data from the spreadsheet to the database
|
||||
*
|
||||
* @param string $package Paths to the uploaded package file
|
||||
*
|
||||
* @return boolean false on failure
|
||||
*
|
||||
**/
|
||||
protected function setData($package,$table,$target_headers)
|
||||
{
|
||||
if (UtilitiesArrayHelper::check($target_headers))
|
||||
{
|
||||
// make sure the file is loaded
|
||||
SubformpowerHelper::composerAutoload('phpspreadsheet');
|
||||
$jinput = Factory::getApplication()->input;
|
||||
foreach($target_headers as $header)
|
||||
{
|
||||
if (($column = $jinput->getString($header, false)) !== false ||
|
||||
($column = $jinput->getString(strtolower($header), false)) !== false)
|
||||
{
|
||||
$data['target_headers'][$header] = $column;
|
||||
}
|
||||
else
|
||||
{
|
||||
$data['target_headers'][$header] = null;
|
||||
}
|
||||
}
|
||||
// set the data
|
||||
if(isset($package['dir']))
|
||||
{
|
||||
$inputFileType = IOFactory::identify($package['dir']);
|
||||
$excelReader = IOFactory::createReader($inputFileType);
|
||||
$excelReader->setReadDataOnly(true);
|
||||
$excelObj = $excelReader->load($package['dir']);
|
||||
$data['array'] = $excelObj->getActiveSheet()->toArray(null, true,true,true);
|
||||
$excelObj->disconnectWorksheets();
|
||||
unset($excelObj);
|
||||
return $this->save($data, $table);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save the data from the file to the database
|
||||
*
|
||||
* @param string $package Paths to the uploaded package file
|
||||
*
|
||||
* @return boolean false on failure
|
||||
*
|
||||
**/
|
||||
protected function save($data,$table)
|
||||
{
|
||||
// import the data if there is any
|
||||
if(UtilitiesArrayHelper::check($data['array']))
|
||||
{
|
||||
// get user object
|
||||
$user = Factory::getUser();
|
||||
// remove header if it has headers
|
||||
$id_key = $data['target_headers']['id'];
|
||||
$published_key = $data['target_headers']['published'];
|
||||
$ordering_key = $data['target_headers']['ordering'];
|
||||
// get the first array set
|
||||
$firstSet = reset($data['array']);
|
||||
|
||||
// check if first array is a header array and remove if true
|
||||
if($firstSet[$id_key] == 'id' || $firstSet[$published_key] == 'published' || $firstSet[$ordering_key] == 'ordering')
|
||||
{
|
||||
array_shift($data['array']);
|
||||
}
|
||||
|
||||
// make sure there is still values in array and that it was not only headers
|
||||
if(UtilitiesArrayHelper::check($data['array']) && $user->authorise($table.'.import', 'com_subformpower') && $user->authorise('core.import', 'com_subformpower'))
|
||||
{
|
||||
// set target.
|
||||
$target = array_flip($data['target_headers']);
|
||||
// Get a db connection.
|
||||
$db = Factory::getDbo();
|
||||
// set some defaults
|
||||
$todayDate = Factory::getDate()->toSql();
|
||||
// get global action permissions
|
||||
$canDo = SubformpowerHelper::getActions($table);
|
||||
$canEdit = $canDo->get('core.edit');
|
||||
$canState = $canDo->get('core.edit.state');
|
||||
$canCreate = $canDo->get('core.create');
|
||||
$hasAlias = $this->getAliasesUsed($table);
|
||||
// prosses the data
|
||||
foreach($data['array'] as $row)
|
||||
{
|
||||
$found = false;
|
||||
if (isset($row[$id_key]) && is_numeric($row[$id_key]) && $row[$id_key] > 0)
|
||||
{
|
||||
// raw items import & update!
|
||||
$query = $db->getQuery(true);
|
||||
$query
|
||||
->select('version')
|
||||
->from($db->quoteName('#__subformpower_'.$table))
|
||||
->where($db->quoteName('id') . ' = '. $db->quote($row[$id_key]));
|
||||
// Reset the query using our newly populated query object.
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
$found = $db->getNumRows();
|
||||
}
|
||||
|
||||
if($found && $canEdit)
|
||||
{
|
||||
// update item
|
||||
$id = $row[$id_key];
|
||||
$version = $db->loadResult();
|
||||
// reset all buckets
|
||||
$query = $db->getQuery(true);
|
||||
$fields = array();
|
||||
// Fields to update.
|
||||
foreach($row as $key => $cell)
|
||||
{
|
||||
// ignore column
|
||||
if ('IGNORE' == $target[$key])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
// update modified
|
||||
if ('modified_by' == $target[$key])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
// update modified
|
||||
if ('modified' == $target[$key])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
// update version
|
||||
if ('version' == $target[$key])
|
||||
{
|
||||
$cell = (int) $version + 1;
|
||||
}
|
||||
// verify publish authority
|
||||
if ('published' == $target[$key] && !$canState)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
// set to update array
|
||||
if(in_array($key, $data['target_headers']) && is_numeric($cell))
|
||||
{
|
||||
$fields[] = $db->quoteName($target[$key]) . ' = ' . $cell;
|
||||
}
|
||||
elseif(in_array($key, $data['target_headers']) && is_string($cell))
|
||||
{
|
||||
$fields[] = $db->quoteName($target[$key]) . ' = ' . $db->quote($cell);
|
||||
}
|
||||
elseif(in_array($key, $data['target_headers']) && is_null($cell))
|
||||
{
|
||||
// if import data is null then set empty
|
||||
$fields[] = $db->quoteName($target[$key]) . " = ''";
|
||||
}
|
||||
}
|
||||
// load the defaults
|
||||
$fields[] = $db->quoteName('modified_by') . ' = ' . $db->quote($user->id);
|
||||
$fields[] = $db->quoteName('modified') . ' = ' . $db->quote($todayDate);
|
||||
// Conditions for which records should be updated.
|
||||
$conditions = array(
|
||||
$db->quoteName('id') . ' = ' . $id
|
||||
);
|
||||
|
||||
$query->update($db->quoteName('#__subformpower_'.$table))->set($fields)->where($conditions);
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
}
|
||||
elseif ($canCreate)
|
||||
{
|
||||
// insert item
|
||||
$query = $db->getQuery(true);
|
||||
// reset all buckets
|
||||
$columns = array();
|
||||
$values = array();
|
||||
$version = false;
|
||||
// Insert columns. Insert values.
|
||||
foreach($row as $key => $cell)
|
||||
{
|
||||
// ignore column
|
||||
if ('IGNORE' == $target[$key])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
// remove id
|
||||
if ('id' == $target[$key])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
// update created
|
||||
if ('created_by' == $target[$key])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
// update created
|
||||
if ('created' == $target[$key])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
// Make sure the alias is incremented
|
||||
if ('alias' == $target[$key])
|
||||
{
|
||||
$cell = $this->getAlias($cell,$table);
|
||||
}
|
||||
// update version
|
||||
if ('version' == $target[$key])
|
||||
{
|
||||
$cell = 1;
|
||||
$version = true;
|
||||
}
|
||||
// set to insert array
|
||||
if(in_array($key, $data['target_headers']) && is_numeric($cell))
|
||||
{
|
||||
$columns[] = $target[$key];
|
||||
$values[] = $cell;
|
||||
}
|
||||
elseif(in_array($key, $data['target_headers']) && is_string($cell))
|
||||
{
|
||||
$columns[] = $target[$key];
|
||||
$values[] = $db->quote($cell);
|
||||
}
|
||||
elseif(in_array($key, $data['target_headers']) && is_null($cell))
|
||||
{
|
||||
// if import data is null then set empty
|
||||
$columns[] = $target[$key];
|
||||
$values[] = "''";
|
||||
}
|
||||
}
|
||||
// load the defaults
|
||||
$columns[] = 'created_by';
|
||||
$values[] = $db->quote($user->id);
|
||||
$columns[] = 'created';
|
||||
$values[] = $db->quote($todayDate);
|
||||
if (!$version)
|
||||
{
|
||||
$columns[] = 'version';
|
||||
$values[] = 1;
|
||||
}
|
||||
// Prepare the insert query.
|
||||
$query
|
||||
->insert($db->quoteName('#__subformpower_'.$table))
|
||||
->columns($db->quoteName($columns))
|
||||
->values(implode(',', $values));
|
||||
// Set the query using our newly populated query object and execute it.
|
||||
$db->setQuery($query);
|
||||
$done = $db->execute();
|
||||
if ($done)
|
||||
{
|
||||
$aId = $db->insertid();
|
||||
// make sure the access of asset is set
|
||||
SubformpowerHelper::setAsset($aId,$table);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function getAlias($name,$type = false)
|
||||
{
|
||||
// sanitize the name to an alias
|
||||
if (Factory::getConfig()->get('unicodeslugs') == 1)
|
||||
{
|
||||
$alias = OutputFilter::stringURLUnicodeSlug($name);
|
||||
}
|
||||
else
|
||||
{
|
||||
$alias = OutputFilter::stringURLSafe($name);
|
||||
}
|
||||
// must be a uniqe alias
|
||||
if ($type)
|
||||
{
|
||||
return $this->getUniqe($alias,'alias',$type);
|
||||
}
|
||||
return $alias;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to generate a uniqe value.
|
||||
*
|
||||
* @param string $field name.
|
||||
* @param string $value data.
|
||||
* @param string $type table.
|
||||
*
|
||||
* @return string New value.
|
||||
*/
|
||||
protected function getUniqe($value,$field,$type)
|
||||
{
|
||||
// insure the filed is always uniqe
|
||||
while (isset($this->uniqeValueArray[$type][$field][$value]))
|
||||
{
|
||||
$value = StringHelper::increment($value, 'dash');
|
||||
}
|
||||
$this->uniqeValueArray[$type][$field][$value] = $value;
|
||||
return $value;
|
||||
}
|
||||
|
||||
protected function getAliasesUsed($table)
|
||||
{
|
||||
// Get a db connection.
|
||||
$db = $this->getDatabase();
|
||||
// first we check if there is a alias column
|
||||
$columns = $db->getTableColumns('#__subformpower_'.$table);
|
||||
if(isset($columns['alias'])){
|
||||
// Create a new query object.
|
||||
$query = $db->getQuery(true);
|
||||
$query->select($db->quoteName(array('alias')));
|
||||
$query->from($db->quoteName('#__subformpower_'.$table));
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
if ($db->getNumRows())
|
||||
{
|
||||
$aliases = $db->loadColumn();
|
||||
foreach($aliases as $alias)
|
||||
{
|
||||
$this->uniqeValueArray[$table]['alias'][$alias] = $alias;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
325
admin/src/Model/SubformpowerModel.php
Normal file
325
admin/src/Model/SubformpowerModel.php
Normal file
@@ -0,0 +1,325 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage SubformpowerModel.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
namespace JCB\Component\Subformpower\Administrator\Model;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\HTML\HTMLHelper as Html;
|
||||
use Joomla\CMS\Session\Session;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
use Joomla\CMS\Application\CMSApplicationInterface;
|
||||
use Joomla\CMS\Component\ComponentHelper;
|
||||
use Joomla\CMS\MVC\Model\ListModel;
|
||||
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
|
||||
use Joomla\CMS\Plugin\PluginHelper;
|
||||
use Joomla\CMS\Router\Route;
|
||||
use Joomla\CMS\User\User;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
use Joomla\Input\Input;
|
||||
use JCB\Component\Subformpower\Administrator\Helper\SubformpowerHelper;
|
||||
use JCB\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
|
||||
use JCB\Joomla\Utilities\StringHelper;
|
||||
|
||||
// No direct access to this file
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* Subformpower List Model
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
class SubformpowerModel extends ListModel
|
||||
{
|
||||
/**
|
||||
* The styles array.
|
||||
*
|
||||
* @var array
|
||||
* @since 4.3
|
||||
*/
|
||||
protected array $styles = [
|
||||
'administrator/components/com_subformpower/assets/css/admin.css',
|
||||
'administrator/components/com_subformpower/assets/css/dashboard.css'
|
||||
];
|
||||
|
||||
/**
|
||||
* The scripts array.
|
||||
*
|
||||
* @var array
|
||||
* @since 4.3
|
||||
*/
|
||||
protected array $scripts = [
|
||||
'administrator/components/com_subformpower/assets/js/admin.js'
|
||||
];
|
||||
|
||||
public function getIcons()
|
||||
{
|
||||
// load user for access menus
|
||||
$user = Factory::getApplication()->getIdentity();
|
||||
// reset icon array
|
||||
$icons = [];
|
||||
// view groups array
|
||||
$viewGroups = array(
|
||||
'main' => array('png.country.add', 'png.countries', 'png.currency.add', 'png.currencies')
|
||||
);
|
||||
// view access array
|
||||
$viewAccess = [
|
||||
'country.create' => 'country.create',
|
||||
'countries.access' => 'country.access',
|
||||
'country.access' => 'country.access',
|
||||
'countries.submenu' => 'country.submenu',
|
||||
'countries.dashboard_list' => 'country.dashboard_list',
|
||||
'country.dashboard_add' => 'country.dashboard_add',
|
||||
'currency.create' => 'currency.create',
|
||||
'currencies.access' => 'currency.access',
|
||||
'currency.access' => 'currency.access',
|
||||
'currencies.submenu' => 'currency.submenu',
|
||||
'currencies.dashboard_list' => 'currency.dashboard_list',
|
||||
'currency.dashboard_add' => 'currency.dashboard_add',
|
||||
];
|
||||
// loop over the $views
|
||||
foreach($viewGroups as $group => $views)
|
||||
{
|
||||
$i = 0;
|
||||
if (UtilitiesArrayHelper::check($views))
|
||||
{
|
||||
foreach($views as $view)
|
||||
{
|
||||
$add = false;
|
||||
// external views (links)
|
||||
if (strpos($view,'||') !== false)
|
||||
{
|
||||
$dwd = explode('||', $view);
|
||||
if (count($dwd) == 3)
|
||||
{
|
||||
list($type, $name, $url) = $dwd;
|
||||
$viewName = $name;
|
||||
$alt = $name;
|
||||
$url = $url;
|
||||
$image = $name . '.' . $type;
|
||||
$name = 'COM_SUBFORMPOWER_DASHBOARD_' . StringHelper::safe($name,'U');
|
||||
}
|
||||
}
|
||||
// internal views
|
||||
elseif (strpos($view,'.') !== false)
|
||||
{
|
||||
$dwd = explode('.', $view);
|
||||
if (count($dwd) == 3)
|
||||
{
|
||||
list($type, $name, $action) = $dwd;
|
||||
}
|
||||
elseif (count($dwd) == 2)
|
||||
{
|
||||
list($type, $name) = $dwd;
|
||||
$action = false;
|
||||
}
|
||||
if ($action)
|
||||
{
|
||||
$viewName = $name;
|
||||
switch($action)
|
||||
{
|
||||
case 'add':
|
||||
$url = 'index.php?option=com_subformpower&view=' . $name . '&layout=edit';
|
||||
$image = $name . '_' . $action. '.' . $type;
|
||||
$alt = $name . ' ' . $action;
|
||||
$name = 'COM_SUBFORMPOWER_DASHBOARD_'.StringHelper::safe($name,'U').'_ADD';
|
||||
$add = true;
|
||||
break;
|
||||
default:
|
||||
// check for new convention (more stable)
|
||||
if (strpos($action, '_qpo0O0oqp_') !== false)
|
||||
{
|
||||
list($action, $extension) = (array) explode('_qpo0O0oqp_', $action);
|
||||
$extension = str_replace('_po0O0oq_', '.', $extension);
|
||||
}
|
||||
else
|
||||
{
|
||||
$extension = 'com_subformpower.' . $name;
|
||||
}
|
||||
$url = 'index.php?option=com_categories&view=categories&extension=' . $extension;
|
||||
$image = $name . '_' . $action . '.' . $type;
|
||||
$alt = $viewName . ' ' . $action;
|
||||
$name = 'COM_SUBFORMPOWER_DASHBOARD_' . StringHelper::safe($name,'U') . '_' . StringHelper::safe($action,'U');
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$viewName = $name;
|
||||
$alt = $name;
|
||||
$url = 'index.php?option=com_subformpower&view=' . $name;
|
||||
$image = $name . '.' . $type;
|
||||
$name = 'COM_SUBFORMPOWER_DASHBOARD_' . StringHelper::safe($name,'U');
|
||||
$hover = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$viewName = $view;
|
||||
$alt = $view;
|
||||
$url = 'index.php?option=com_subformpower&view=' . $view;
|
||||
$image = $view . '.png';
|
||||
$name = ucwords($view).'<br /><br />';
|
||||
$hover = false;
|
||||
}
|
||||
// first make sure the view access is set
|
||||
if (UtilitiesArrayHelper::check($viewAccess))
|
||||
{
|
||||
// setup some defaults
|
||||
$dashboard_add = false;
|
||||
$dashboard_list = false;
|
||||
$accessTo = '';
|
||||
$accessAdd = '';
|
||||
// access checking start
|
||||
$accessCreate = (isset($viewAccess[$viewName.'.create'])) ? StringHelper::check($viewAccess[$viewName.'.create']):false;
|
||||
$accessAccess = (isset($viewAccess[$viewName.'.access'])) ? StringHelper::check($viewAccess[$viewName.'.access']):false;
|
||||
// set main controllers
|
||||
$accessDashboard_add = (isset($viewAccess[$viewName.'.dashboard_add'])) ? StringHelper::check($viewAccess[$viewName.'.dashboard_add']):false;
|
||||
$accessDashboard_list = (isset($viewAccess[$viewName.'.dashboard_list'])) ? StringHelper::check($viewAccess[$viewName.'.dashboard_list']):false;
|
||||
// check for adding access
|
||||
if ($add && $accessCreate)
|
||||
{
|
||||
$accessAdd = $viewAccess[$viewName.'.create'];
|
||||
}
|
||||
elseif ($add)
|
||||
{
|
||||
$accessAdd = 'core.create';
|
||||
}
|
||||
// check if access to view is set
|
||||
if ($accessAccess)
|
||||
{
|
||||
$accessTo = $viewAccess[$viewName.'.access'];
|
||||
}
|
||||
// set main access controllers
|
||||
if ($accessDashboard_add)
|
||||
{
|
||||
$dashboard_add = $user->authorise($viewAccess[$viewName.'.dashboard_add'], 'com_subformpower');
|
||||
}
|
||||
if ($accessDashboard_list)
|
||||
{
|
||||
$dashboard_list = $user->authorise($viewAccess[$viewName.'.dashboard_list'], 'com_subformpower');
|
||||
}
|
||||
if (StringHelper::check($accessAdd) && StringHelper::check($accessTo))
|
||||
{
|
||||
// check access
|
||||
if($user->authorise($accessAdd, 'com_subformpower') && $user->authorise($accessTo, 'com_subformpower') && $dashboard_add)
|
||||
{
|
||||
$icons[$group][$i] = new \StdClass;
|
||||
$icons[$group][$i]->url = $url;
|
||||
$icons[$group][$i]->name = $name;
|
||||
$icons[$group][$i]->image = $image;
|
||||
$icons[$group][$i]->alt = $alt;
|
||||
}
|
||||
}
|
||||
elseif (StringHelper::check($accessTo))
|
||||
{
|
||||
// check access
|
||||
if($user->authorise($accessTo, 'com_subformpower') && $dashboard_list)
|
||||
{
|
||||
$icons[$group][$i] = new \StdClass;
|
||||
$icons[$group][$i]->url = $url;
|
||||
$icons[$group][$i]->name = $name;
|
||||
$icons[$group][$i]->image = $image;
|
||||
$icons[$group][$i]->alt = $alt;
|
||||
}
|
||||
}
|
||||
elseif (StringHelper::check($accessAdd))
|
||||
{
|
||||
// check access
|
||||
if($user->authorise($accessAdd, 'com_subformpower') && $dashboard_add)
|
||||
{
|
||||
$icons[$group][$i] = new \StdClass;
|
||||
$icons[$group][$i]->url = $url;
|
||||
$icons[$group][$i]->name = $name;
|
||||
$icons[$group][$i]->image = $image;
|
||||
$icons[$group][$i]->alt = $alt;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$icons[$group][$i] = new \StdClass;
|
||||
$icons[$group][$i]->url = $url;
|
||||
$icons[$group][$i]->name = $name;
|
||||
$icons[$group][$i]->image = $image;
|
||||
$icons[$group][$i]->alt = $alt;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$icons[$group][$i] = new \StdClass;
|
||||
$icons[$group][$i]->url = $url;
|
||||
$icons[$group][$i]->name = $name;
|
||||
$icons[$group][$i]->image = $image;
|
||||
$icons[$group][$i]->alt = $alt;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$icons[$group][$i] = false;
|
||||
}
|
||||
}
|
||||
return $icons;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the styles that have to be included on the view
|
||||
*
|
||||
* @return array styles files
|
||||
* @since 4.3
|
||||
*/
|
||||
public function getStyles(): array
|
||||
{
|
||||
return $this->styles;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to set the styles that have to be included on the view
|
||||
*
|
||||
* @return void
|
||||
* @since 4.3
|
||||
*/
|
||||
public function setStyles(string $path): void
|
||||
{
|
||||
$this->styles[] = $path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the script that have to be included on the view
|
||||
*
|
||||
* @return array script files
|
||||
* @since 4.3
|
||||
*/
|
||||
public function getScripts(): array
|
||||
{
|
||||
return $this->scripts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to set the script that have to be included on the view
|
||||
*
|
||||
* @return void
|
||||
* @since 4.3
|
||||
*/
|
||||
public function setScript(string $path): void
|
||||
{
|
||||
$this->scripts[] = $path;
|
||||
}
|
||||
}
|
1
admin/src/Model/index.html
Normal file
1
admin/src/Model/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
71
admin/src/Rule/GuidRule.php
Normal file
71
admin/src/Rule/GuidRule.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage GuidRule.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
namespace JCB\Component\Subformpower\Administrator\Rule;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Form\Form;
|
||||
use Joomla\CMS\Form\FormRule;
|
||||
use Joomla\Registry\Registry;
|
||||
use Joomla\CMS\HTML\HTMLHelper as Html;
|
||||
use Joomla\CMS\Component\ComponentHelper;
|
||||
use JCB\Component\Subformpower\Administrator\Helper\SubformpowerHelper;
|
||||
|
||||
// No direct access to this file
|
||||
\defined('JPATH_PLATFORM') or die;
|
||||
|
||||
/**
|
||||
* Form Rule (Guid) class for the Joomla Platform.
|
||||
*
|
||||
* @since 3.5
|
||||
*/
|
||||
class GuidRule extends FormRule
|
||||
{
|
||||
/**
|
||||
* Method to test for a Globally Unique Identifier.
|
||||
*
|
||||
* @param \SimpleXMLElement $element The SimpleXMLElement object representing the `<field>` tag for the form field object.
|
||||
* @param mixed $value The form field value to validate.
|
||||
* @param string $group The field name group control value. This acts as an array container for the field.
|
||||
* For example if the field has name="foo" and the group value is set to "bar" then the
|
||||
* full field name would end up being "bar[foo]".
|
||||
* @param Registry $input An optional Registry object with the entire data set to validate against the entire form.
|
||||
* @param Form $form The form object for which the field is being tested.
|
||||
*
|
||||
* @return boolean True if the value is valid, false otherwise.
|
||||
*
|
||||
*/
|
||||
public function test(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null)
|
||||
{
|
||||
$value = trim($value);
|
||||
|
||||
// If the field is empty and not required, the field is valid.
|
||||
$required = ((string) $element['required'] == 'true' || (string) $element['required'] == 'required');
|
||||
|
||||
if (!$required && empty($value))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// thanks to Lewie https://stackoverflow.com/a/1515456/1429677
|
||||
return preg_match("/^(\{)?[a-f\d]{8}(-[a-f\d]{4}){4}[a-f\d]{8}(?(1)\})$/i", $value);
|
||||
}
|
||||
|
||||
}
|
1
admin/src/Rule/index.html
Normal file
1
admin/src/Rule/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
1
admin/src/Service/index.html
Normal file
1
admin/src/Service/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
386
admin/src/Table/CountryTable.php
Normal file
386
admin/src/Table/CountryTable.php
Normal file
@@ -0,0 +1,386 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage CountryTable.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
namespace JCB\Component\Subformpower\Administrator\Table;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Table\Table;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\String\PunycodeHelper;
|
||||
use Joomla\CMS\Access\Access as AccessRules;
|
||||
use Joomla\CMS\Access\Rules;
|
||||
use Joomla\CMS\Tag\TaggableTableInterface;
|
||||
use Joomla\CMS\Tag\TaggableTableTrait;
|
||||
use Joomla\CMS\User\CurrentUserInterface;
|
||||
use Joomla\CMS\User\CurrentUserTrait;
|
||||
use Joomla\CMS\Versioning\VersionableTableInterface;
|
||||
use Joomla\CMS\Application\ApplicationHelper;
|
||||
use Joomla\Database\DatabaseInterface;
|
||||
use Joomla\Registry\Registry;
|
||||
use Joomla\Database\DatabaseDriver;
|
||||
use Joomla\Event\DispatcherInterface;
|
||||
use Joomla\String\StringHelper;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
use JCB\Component\Subformpower\Administrator\Helper\SubformpowerHelper;
|
||||
|
||||
// No direct access to this file
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* Countries Table class
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
class CountryTable extends Table implements VersionableTableInterface, TaggableTableInterface, CurrentUserInterface
|
||||
{
|
||||
use TaggableTableTrait;
|
||||
use CurrentUserTrait;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DatabaseDriver $db Database connector object
|
||||
* @param ?DispatcherInterface $dispatcher Event dispatcher for this table
|
||||
*
|
||||
* @param object Database connector object
|
||||
* @since 4.0
|
||||
*/
|
||||
function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null)
|
||||
{
|
||||
// The type alias generally is the internal component name with the
|
||||
// content type. Ex.: com_content.article
|
||||
$this->typeAlias = 'com_subformpower.country';
|
||||
|
||||
// Ensure the params and metadata in json encoded in the bind method
|
||||
$this->_jsonEncode = ['params', 'metadata'];
|
||||
|
||||
// Indicates that columns fully support the NULL value in the database
|
||||
// $this->_supportNullValue = true; // hmmm will keep an eye on this ;)
|
||||
|
||||
parent::__construct('#__subformpower_country', 'id', $db, $dispatcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to bind an associative array or object to the Table instance.This
|
||||
* method only binds properties that are publicly accessible and optionally
|
||||
* takes an array of properties to ignore when binding.
|
||||
*
|
||||
* @param array|object $src An associative array or object to bind to the Table instance.
|
||||
* @param array|string $ignore An optional array or space separated list of properties to ignore while binding.
|
||||
*
|
||||
* @return boolean True on success.
|
||||
*
|
||||
* @since 1.7.0
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function bind($array, $ignore = '')
|
||||
{
|
||||
// Bind the rules.
|
||||
if (isset($array['rules']) && is_array($array['rules']))
|
||||
{
|
||||
$rules = new AccessRules($array['rules']);
|
||||
$this->setRules($rules);
|
||||
}
|
||||
|
||||
return parent::bind($array, $ignore);
|
||||
}
|
||||
|
||||
/**
|
||||
* Overload the store method for the Country table.
|
||||
*
|
||||
* @param boolean Toggle whether null values should be updated.
|
||||
*
|
||||
* @return boolean True on success, false on failure.
|
||||
* @since 1.6
|
||||
*/
|
||||
public function store($updateNulls = false)
|
||||
{
|
||||
$date = Factory::getDate()->toSql();
|
||||
$userId = $this->getCurrentUser()->id;
|
||||
|
||||
if ($this->id)
|
||||
{
|
||||
// Existing item
|
||||
$this->modified = $date;
|
||||
$this->modified_by = $userId;
|
||||
}
|
||||
else
|
||||
{
|
||||
// New country. A country created and created_by field can be set by the user,
|
||||
// so we don't touch either of these if they are set.
|
||||
if (!(int) $this->created)
|
||||
{
|
||||
$this->created = $date;
|
||||
}
|
||||
if (empty($this->created_by))
|
||||
{
|
||||
$this->created_by = $userId;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($this->alias))
|
||||
{
|
||||
// Verify that the alias is unique
|
||||
$table = new self($this->getDbo(), $this->getDispatcher());
|
||||
|
||||
if ($table->load(['alias' => $this->alias]) && ($table->id != $this->id || $this->id == 0))
|
||||
{
|
||||
$this->setError(Text::_('COM_SUBFORMPOWER_COUNTRY_ERROR_UNIQUE_ALIAS'));
|
||||
|
||||
if ($table->published === -2)
|
||||
{
|
||||
$this->setError(Text::_('COM_SUBFORMPOWER_COUNTRY_ERROR_UNIQUE_ALIAS_TRASHED'));
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($this->url))
|
||||
{
|
||||
// Convert IDN urls to punycode
|
||||
$this->url = PunycodeHelper::urlToPunycode($this->url);
|
||||
}
|
||||
|
||||
if (isset($this->website))
|
||||
{
|
||||
// Convert IDN urls to punycode
|
||||
$this->website = PunycodeHelper::urlToPunycode($this->website);
|
||||
}
|
||||
|
||||
return parent::store($updateNulls);
|
||||
}
|
||||
|
||||
/**
|
||||
* Overloaded check method to ensure data integrity.
|
||||
*
|
||||
* @return boolean True on success.
|
||||
*
|
||||
* @see \Joomla\CMS\Table\Table::check
|
||||
* @since 1.5
|
||||
*/
|
||||
public function check()
|
||||
{
|
||||
try {
|
||||
parent::check();
|
||||
} catch (\Exception $e) {
|
||||
$this->setError($e->getMessage());
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isset($this->alias))
|
||||
{
|
||||
// Generate a valid alias
|
||||
$this->generateAlias();
|
||||
|
||||
$table = new self($this->getDbo(), $this->getDispatcher());
|
||||
|
||||
while ($table->load(['alias' => $this->alias]) && ($table->id != $this->id || $this->id == 0))
|
||||
{
|
||||
$this->alias = StringHelper::increment($this->alias, 'dash');
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Clean up keywords -- eliminate extra spaces between phrases
|
||||
* and cr (\r) and lf (\n) characters from string.
|
||||
* Only process if not empty.
|
||||
*/
|
||||
if (!empty($this->metakey))
|
||||
{
|
||||
// Array of characters to remove.
|
||||
$bad_characters = array("\n", "\r", "\"", "<", ">");
|
||||
|
||||
// Remove bad characters.
|
||||
$after_clean = StringHelper::str_ireplace($bad_characters, "", $this->metakey);
|
||||
|
||||
// Create array using commas as delimiter.
|
||||
$keys = explode(',', $after_clean);
|
||||
$clean_keys = [];
|
||||
|
||||
foreach ($keys as $key)
|
||||
{
|
||||
// Ignore blank keywords.
|
||||
if (trim($key))
|
||||
{
|
||||
$clean_keys[] = trim($key);
|
||||
}
|
||||
}
|
||||
|
||||
// Put array back together delimited by ", "
|
||||
$this->metakey = implode(", ", $clean_keys);
|
||||
}
|
||||
|
||||
// Clean up description -- eliminate quotes and <> brackets
|
||||
if (!empty($this->metadesc))
|
||||
{
|
||||
// Only process if not empty
|
||||
$bad_characters = array("\"", "<", ">");
|
||||
$this->metadesc = StringHelper::str_ireplace($bad_characters, "", $this->metadesc);
|
||||
}
|
||||
|
||||
// If we don't have any access rules set at this point just use an empty AccessRules class
|
||||
if (!$this->getRules())
|
||||
{
|
||||
$rules = $this->getDefaultAssetValues('com_subformpower.country.'.$this->id);
|
||||
$this->setRules($rules);
|
||||
}
|
||||
|
||||
// Set ordering
|
||||
if ($this->published < 0)
|
||||
{
|
||||
// Set ordering to 0 if state is archived or trashed
|
||||
$this->ordering = 0;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the default asset values for a component.
|
||||
*
|
||||
* @param $string $component The component asset name to search for
|
||||
*
|
||||
* @return AccessRules The AccessRules object for the asset
|
||||
*/
|
||||
protected function getDefaultAssetValues($component, $try = true)
|
||||
{
|
||||
// Need to find the asset id by the name of the component.
|
||||
$db = Factory::getContainer()->get(DatabaseInterface::class);
|
||||
$query = $db->getQuery(true)
|
||||
->select($db->quoteName('id'))
|
||||
->from($db->quoteName('#__assets'))
|
||||
->where($db->quoteName('name') . ' = ' . $db->quote($component));
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
if ($db->loadRowList())
|
||||
{
|
||||
// asset already set so use saved rules
|
||||
$assetId = (int) $db->loadResult();
|
||||
return AccessRules::getAssetRules($assetId); // (TODO) instead of keeping inherited Allowed it becomes Allowed.
|
||||
}
|
||||
// try again
|
||||
elseif ($try)
|
||||
{
|
||||
$try = explode('.',$component);
|
||||
$result = $this->getDefaultAssetValues($try[0], false);
|
||||
if ($result instanceof AccessRules)
|
||||
{
|
||||
if (isset($try[1]))
|
||||
{
|
||||
$_result = (string) $result;
|
||||
$_result = json_decode($_result);
|
||||
foreach ($_result as $name => &$rule)
|
||||
{
|
||||
$v = explode('.', $name);
|
||||
if ($try[1] !== $v[0])
|
||||
{
|
||||
// remove since it is not part of this view
|
||||
unset($_result->$name);
|
||||
}
|
||||
else
|
||||
{
|
||||
// clear the value since we inherit
|
||||
$rule = [];
|
||||
}
|
||||
}
|
||||
// check if there are any view values remaining
|
||||
if (count( (array) $_result))
|
||||
{
|
||||
$_result = json_encode($_result);
|
||||
$_result = array($_result);
|
||||
// Instantiate and return the AccessRules object for the asset rules.
|
||||
$rules = new AccessRules;
|
||||
$rules->mergeCollection($_result);
|
||||
|
||||
return $rules;
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
return AccessRules::getAssetRules(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the type alias for the history table
|
||||
*
|
||||
* The type alias generally is the internal component name with the
|
||||
* content type. Ex.: com_content.article
|
||||
*
|
||||
* @return string The alias as described above
|
||||
*
|
||||
* @since 3.10.0
|
||||
*/
|
||||
public function getTypeAlias()
|
||||
{
|
||||
return $this->typeAlias;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to compute the default name of the asset.
|
||||
* The default name is in the form table_name.id
|
||||
* where id is the value of the primary key of the table.
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @since 1.7.0
|
||||
*/
|
||||
protected function _getAssetName()
|
||||
{
|
||||
$k = $this->_tbl_key;
|
||||
|
||||
return $this->getTypeAlias() . '.' . (int) $this->$k;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the parent asset under which to register this one.
|
||||
*
|
||||
* By default, all assets are registered to the ROOT node with ID, which will default to 1 if none exists.
|
||||
* An extended class can define a table and ID to lookup. If the asset does not exist it will be created.
|
||||
*
|
||||
* @param Table $table A Table object for the asset parent.
|
||||
* @param integer $id Id to look up
|
||||
*
|
||||
* @return integer
|
||||
*
|
||||
* @since 1.7.0
|
||||
*/
|
||||
protected function _getAssetParentId(Table $table = null, $id = null)
|
||||
{
|
||||
/** @var Asset $assets */
|
||||
$assets = self::getInstance('Asset', 'JTable', ['dbo' => $this->getDbo()]);
|
||||
$rootId = $assets->getRootId();
|
||||
|
||||
// load the subformpower asset
|
||||
$assets->loadByName('com_subformpower');
|
||||
|
||||
return $assets->id ?? $rootId ?? 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* This view does not actually have an alias
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function generateAlias()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
386
admin/src/Table/CurrencyTable.php
Normal file
386
admin/src/Table/CurrencyTable.php
Normal file
@@ -0,0 +1,386 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage CurrencyTable.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
namespace JCB\Component\Subformpower\Administrator\Table;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Table\Table;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\String\PunycodeHelper;
|
||||
use Joomla\CMS\Access\Access as AccessRules;
|
||||
use Joomla\CMS\Access\Rules;
|
||||
use Joomla\CMS\Tag\TaggableTableInterface;
|
||||
use Joomla\CMS\Tag\TaggableTableTrait;
|
||||
use Joomla\CMS\User\CurrentUserInterface;
|
||||
use Joomla\CMS\User\CurrentUserTrait;
|
||||
use Joomla\CMS\Versioning\VersionableTableInterface;
|
||||
use Joomla\CMS\Application\ApplicationHelper;
|
||||
use Joomla\Database\DatabaseInterface;
|
||||
use Joomla\Registry\Registry;
|
||||
use Joomla\Database\DatabaseDriver;
|
||||
use Joomla\Event\DispatcherInterface;
|
||||
use Joomla\String\StringHelper;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
use JCB\Component\Subformpower\Administrator\Helper\SubformpowerHelper;
|
||||
|
||||
// No direct access to this file
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* Currencies Table class
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
class CurrencyTable extends Table implements VersionableTableInterface, TaggableTableInterface, CurrentUserInterface
|
||||
{
|
||||
use TaggableTableTrait;
|
||||
use CurrentUserTrait;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DatabaseDriver $db Database connector object
|
||||
* @param ?DispatcherInterface $dispatcher Event dispatcher for this table
|
||||
*
|
||||
* @param object Database connector object
|
||||
* @since 4.0
|
||||
*/
|
||||
function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null)
|
||||
{
|
||||
// The type alias generally is the internal component name with the
|
||||
// content type. Ex.: com_content.article
|
||||
$this->typeAlias = 'com_subformpower.currency';
|
||||
|
||||
// Ensure the params and metadata in json encoded in the bind method
|
||||
$this->_jsonEncode = ['params', 'metadata'];
|
||||
|
||||
// Indicates that columns fully support the NULL value in the database
|
||||
// $this->_supportNullValue = true; // hmmm will keep an eye on this ;)
|
||||
|
||||
parent::__construct('#__subformpower_currency', 'id', $db, $dispatcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to bind an associative array or object to the Table instance.This
|
||||
* method only binds properties that are publicly accessible and optionally
|
||||
* takes an array of properties to ignore when binding.
|
||||
*
|
||||
* @param array|object $src An associative array or object to bind to the Table instance.
|
||||
* @param array|string $ignore An optional array or space separated list of properties to ignore while binding.
|
||||
*
|
||||
* @return boolean True on success.
|
||||
*
|
||||
* @since 1.7.0
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function bind($array, $ignore = '')
|
||||
{
|
||||
// Bind the rules.
|
||||
if (isset($array['rules']) && is_array($array['rules']))
|
||||
{
|
||||
$rules = new AccessRules($array['rules']);
|
||||
$this->setRules($rules);
|
||||
}
|
||||
|
||||
return parent::bind($array, $ignore);
|
||||
}
|
||||
|
||||
/**
|
||||
* Overload the store method for the Currency table.
|
||||
*
|
||||
* @param boolean Toggle whether null values should be updated.
|
||||
*
|
||||
* @return boolean True on success, false on failure.
|
||||
* @since 1.6
|
||||
*/
|
||||
public function store($updateNulls = false)
|
||||
{
|
||||
$date = Factory::getDate()->toSql();
|
||||
$userId = $this->getCurrentUser()->id;
|
||||
|
||||
if ($this->id)
|
||||
{
|
||||
// Existing item
|
||||
$this->modified = $date;
|
||||
$this->modified_by = $userId;
|
||||
}
|
||||
else
|
||||
{
|
||||
// New currency. A currency created and created_by field can be set by the user,
|
||||
// so we don't touch either of these if they are set.
|
||||
if (!(int) $this->created)
|
||||
{
|
||||
$this->created = $date;
|
||||
}
|
||||
if (empty($this->created_by))
|
||||
{
|
||||
$this->created_by = $userId;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($this->alias))
|
||||
{
|
||||
// Verify that the alias is unique
|
||||
$table = new self($this->getDbo(), $this->getDispatcher());
|
||||
|
||||
if ($table->load(['alias' => $this->alias]) && ($table->id != $this->id || $this->id == 0))
|
||||
{
|
||||
$this->setError(Text::_('COM_SUBFORMPOWER_CURRENCY_ERROR_UNIQUE_ALIAS'));
|
||||
|
||||
if ($table->published === -2)
|
||||
{
|
||||
$this->setError(Text::_('COM_SUBFORMPOWER_CURRENCY_ERROR_UNIQUE_ALIAS_TRASHED'));
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($this->url))
|
||||
{
|
||||
// Convert IDN urls to punycode
|
||||
$this->url = PunycodeHelper::urlToPunycode($this->url);
|
||||
}
|
||||
|
||||
if (isset($this->website))
|
||||
{
|
||||
// Convert IDN urls to punycode
|
||||
$this->website = PunycodeHelper::urlToPunycode($this->website);
|
||||
}
|
||||
|
||||
return parent::store($updateNulls);
|
||||
}
|
||||
|
||||
/**
|
||||
* Overloaded check method to ensure data integrity.
|
||||
*
|
||||
* @return boolean True on success.
|
||||
*
|
||||
* @see \Joomla\CMS\Table\Table::check
|
||||
* @since 1.5
|
||||
*/
|
||||
public function check()
|
||||
{
|
||||
try {
|
||||
parent::check();
|
||||
} catch (\Exception $e) {
|
||||
$this->setError($e->getMessage());
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isset($this->alias))
|
||||
{
|
||||
// Generate a valid alias
|
||||
$this->generateAlias();
|
||||
|
||||
$table = new self($this->getDbo(), $this->getDispatcher());
|
||||
|
||||
while ($table->load(['alias' => $this->alias]) && ($table->id != $this->id || $this->id == 0))
|
||||
{
|
||||
$this->alias = StringHelper::increment($this->alias, 'dash');
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Clean up keywords -- eliminate extra spaces between phrases
|
||||
* and cr (\r) and lf (\n) characters from string.
|
||||
* Only process if not empty.
|
||||
*/
|
||||
if (!empty($this->metakey))
|
||||
{
|
||||
// Array of characters to remove.
|
||||
$bad_characters = array("\n", "\r", "\"", "<", ">");
|
||||
|
||||
// Remove bad characters.
|
||||
$after_clean = StringHelper::str_ireplace($bad_characters, "", $this->metakey);
|
||||
|
||||
// Create array using commas as delimiter.
|
||||
$keys = explode(',', $after_clean);
|
||||
$clean_keys = [];
|
||||
|
||||
foreach ($keys as $key)
|
||||
{
|
||||
// Ignore blank keywords.
|
||||
if (trim($key))
|
||||
{
|
||||
$clean_keys[] = trim($key);
|
||||
}
|
||||
}
|
||||
|
||||
// Put array back together delimited by ", "
|
||||
$this->metakey = implode(", ", $clean_keys);
|
||||
}
|
||||
|
||||
// Clean up description -- eliminate quotes and <> brackets
|
||||
if (!empty($this->metadesc))
|
||||
{
|
||||
// Only process if not empty
|
||||
$bad_characters = array("\"", "<", ">");
|
||||
$this->metadesc = StringHelper::str_ireplace($bad_characters, "", $this->metadesc);
|
||||
}
|
||||
|
||||
// If we don't have any access rules set at this point just use an empty AccessRules class
|
||||
if (!$this->getRules())
|
||||
{
|
||||
$rules = $this->getDefaultAssetValues('com_subformpower.currency.'.$this->id);
|
||||
$this->setRules($rules);
|
||||
}
|
||||
|
||||
// Set ordering
|
||||
if ($this->published < 0)
|
||||
{
|
||||
// Set ordering to 0 if state is archived or trashed
|
||||
$this->ordering = 0;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the default asset values for a component.
|
||||
*
|
||||
* @param $string $component The component asset name to search for
|
||||
*
|
||||
* @return AccessRules The AccessRules object for the asset
|
||||
*/
|
||||
protected function getDefaultAssetValues($component, $try = true)
|
||||
{
|
||||
// Need to find the asset id by the name of the component.
|
||||
$db = Factory::getContainer()->get(DatabaseInterface::class);
|
||||
$query = $db->getQuery(true)
|
||||
->select($db->quoteName('id'))
|
||||
->from($db->quoteName('#__assets'))
|
||||
->where($db->quoteName('name') . ' = ' . $db->quote($component));
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
if ($db->loadRowList())
|
||||
{
|
||||
// asset already set so use saved rules
|
||||
$assetId = (int) $db->loadResult();
|
||||
return AccessRules::getAssetRules($assetId); // (TODO) instead of keeping inherited Allowed it becomes Allowed.
|
||||
}
|
||||
// try again
|
||||
elseif ($try)
|
||||
{
|
||||
$try = explode('.',$component);
|
||||
$result = $this->getDefaultAssetValues($try[0], false);
|
||||
if ($result instanceof AccessRules)
|
||||
{
|
||||
if (isset($try[1]))
|
||||
{
|
||||
$_result = (string) $result;
|
||||
$_result = json_decode($_result);
|
||||
foreach ($_result as $name => &$rule)
|
||||
{
|
||||
$v = explode('.', $name);
|
||||
if ($try[1] !== $v[0])
|
||||
{
|
||||
// remove since it is not part of this view
|
||||
unset($_result->$name);
|
||||
}
|
||||
else
|
||||
{
|
||||
// clear the value since we inherit
|
||||
$rule = [];
|
||||
}
|
||||
}
|
||||
// check if there are any view values remaining
|
||||
if (count( (array) $_result))
|
||||
{
|
||||
$_result = json_encode($_result);
|
||||
$_result = array($_result);
|
||||
// Instantiate and return the AccessRules object for the asset rules.
|
||||
$rules = new AccessRules;
|
||||
$rules->mergeCollection($_result);
|
||||
|
||||
return $rules;
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
return AccessRules::getAssetRules(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the type alias for the history table
|
||||
*
|
||||
* The type alias generally is the internal component name with the
|
||||
* content type. Ex.: com_content.article
|
||||
*
|
||||
* @return string The alias as described above
|
||||
*
|
||||
* @since 3.10.0
|
||||
*/
|
||||
public function getTypeAlias()
|
||||
{
|
||||
return $this->typeAlias;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to compute the default name of the asset.
|
||||
* The default name is in the form table_name.id
|
||||
* where id is the value of the primary key of the table.
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @since 1.7.0
|
||||
*/
|
||||
protected function _getAssetName()
|
||||
{
|
||||
$k = $this->_tbl_key;
|
||||
|
||||
return $this->getTypeAlias() . '.' . (int) $this->$k;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the parent asset under which to register this one.
|
||||
*
|
||||
* By default, all assets are registered to the ROOT node with ID, which will default to 1 if none exists.
|
||||
* An extended class can define a table and ID to lookup. If the asset does not exist it will be created.
|
||||
*
|
||||
* @param Table $table A Table object for the asset parent.
|
||||
* @param integer $id Id to look up
|
||||
*
|
||||
* @return integer
|
||||
*
|
||||
* @since 1.7.0
|
||||
*/
|
||||
protected function _getAssetParentId(Table $table = null, $id = null)
|
||||
{
|
||||
/** @var Asset $assets */
|
||||
$assets = self::getInstance('Asset', 'JTable', ['dbo' => $this->getDbo()]);
|
||||
$rootId = $assets->getRootId();
|
||||
|
||||
// load the subformpower asset
|
||||
$assets->loadByName('com_subformpower');
|
||||
|
||||
return $assets->id ?? $rootId ?? 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* This view does not actually have an alias
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function generateAlias()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
1
admin/src/Table/index.html
Normal file
1
admin/src/Table/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
229
admin/src/View/Countries/HtmlView.php
Normal file
229
admin/src/View/Countries/HtmlView.php
Normal file
@@ -0,0 +1,229 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage HtmlView.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
namespace JCB\Component\Subformpower\Administrator\View\Countries;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Toolbar\Toolbar;
|
||||
use Joomla\CMS\Form\FormHelper;
|
||||
use Joomla\CMS\Session\Session;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
use Joomla\CMS\Component\ComponentHelper;
|
||||
use Joomla\CMS\HTML\HTMLHelper as Html;
|
||||
use Joomla\CMS\Layout\FileLayout;
|
||||
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
|
||||
use Joomla\CMS\Plugin\PluginHelper;
|
||||
use Joomla\CMS\Toolbar\ToolbarHelper;
|
||||
use Joomla\CMS\Document\Document;
|
||||
use JCB\Component\Subformpower\Administrator\Helper\SubformpowerHelper;
|
||||
use JCB\Joomla\Utilities\ArrayHelper;
|
||||
use JCB\Joomla\Utilities\StringHelper;
|
||||
|
||||
// No direct access to this file
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* Subformpower Html View class for the Countries
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
class HtmlView extends BaseHtmlView
|
||||
{
|
||||
/**
|
||||
* Countries view display method
|
||||
*
|
||||
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
|
||||
*
|
||||
* @return void
|
||||
* @since 1.6
|
||||
*/
|
||||
public function display($tpl = null)
|
||||
{
|
||||
// Assign data to the view
|
||||
$this->items = $this->get('Items');
|
||||
$this->pagination = $this->get('Pagination');
|
||||
$this->state = $this->get('State');
|
||||
$this->styles = $this->get('Styles');
|
||||
$this->scripts = $this->get('Scripts');
|
||||
$this->user ??= Factory::getApplication()->getIdentity();
|
||||
// Load the filter form from xml.
|
||||
$this->filterForm = $this->get('FilterForm');
|
||||
// Load the active filters.
|
||||
$this->activeFilters = $this->get('ActiveFilters');
|
||||
// Add the list ordering clause.
|
||||
$this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id'));
|
||||
$this->listDirn = $this->escape($this->state->get('list.direction', 'DESC'));
|
||||
$this->saveOrder = $this->listOrder == 'a.ordering';
|
||||
// set the return here value
|
||||
$this->return_here = urlencode(base64_encode((string) Uri::getInstance()));
|
||||
// get global action permissions
|
||||
$this->canDo = SubformpowerHelper::getActions('country');
|
||||
$this->canEdit = $this->canDo->get('country.edit');
|
||||
$this->canState = $this->canDo->get('country.edit.state');
|
||||
$this->canCreate = $this->canDo->get('country.create');
|
||||
$this->canDelete = $this->canDo->get('country.delete');
|
||||
$this->canBatch = ($this->canDo->get('country.batch') && $this->canDo->get('core.batch'));
|
||||
|
||||
// If we don't have items we load the empty state
|
||||
if (is_array($this->items) && !count((array) $this->items) && $this->isEmptyState = $this->get('IsEmptyState'))
|
||||
{
|
||||
$this->setLayout('emptystate');
|
||||
}
|
||||
|
||||
// We don't need toolbar in the modal window.
|
||||
if ($this->getLayout() !== 'modal')
|
||||
{
|
||||
$this->addToolbar();
|
||||
}
|
||||
|
||||
// Check for errors.
|
||||
if (count($errors = $this->get('Errors')))
|
||||
{
|
||||
throw new \Exception(implode("\n", $errors), 500);
|
||||
}
|
||||
|
||||
// Set the html view document stuff
|
||||
$this->_prepareDocument();
|
||||
|
||||
// Display the template
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the page title and toolbar.
|
||||
*
|
||||
* @return void
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function addToolbar(): void
|
||||
{
|
||||
ToolbarHelper::title(Text::_('COM_SUBFORMPOWER_COUNTRIES'), 'joomla');
|
||||
|
||||
if ($this->canCreate)
|
||||
{
|
||||
ToolbarHelper::addNew('country.add');
|
||||
}
|
||||
|
||||
// Only load if there are items
|
||||
if (ArrayHelper::check($this->items))
|
||||
{
|
||||
if ($this->canEdit)
|
||||
{
|
||||
ToolbarHelper::editList('country.edit');
|
||||
}
|
||||
|
||||
if ($this->canState)
|
||||
{
|
||||
ToolbarHelper::publishList('countries.publish');
|
||||
ToolbarHelper::unpublishList('countries.unpublish');
|
||||
ToolbarHelper::archiveList('countries.archive');
|
||||
|
||||
if ($this->canDo->get('core.admin'))
|
||||
{
|
||||
ToolbarHelper::checkin('countries.checkin');
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete))
|
||||
{
|
||||
ToolbarHelper::deleteList('', 'countries.delete', 'JTOOLBAR_EMPTY_TRASH');
|
||||
}
|
||||
elseif ($this->canState && $this->canDelete)
|
||||
{
|
||||
ToolbarHelper::trash('countries.trash');
|
||||
}
|
||||
}
|
||||
|
||||
// set help url for this view if found
|
||||
$this->help_url = SubformpowerHelper::getHelpUrl('countries');
|
||||
if (StringHelper::check($this->help_url))
|
||||
{
|
||||
ToolbarHelper::help('COM_SUBFORMPOWER_HELP_MANAGER', false, $this->help_url);
|
||||
}
|
||||
|
||||
// add the options comp button
|
||||
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
|
||||
{
|
||||
ToolbarHelper::preferences('com_subformpower');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare some document related stuff.
|
||||
*
|
||||
* @return void
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function _prepareDocument(): void
|
||||
{
|
||||
// Load jQuery
|
||||
Html::_('jquery.framework');
|
||||
$this->getDocument()->setTitle(Text::_('COM_SUBFORMPOWER_COUNTRIES'));
|
||||
// add styles
|
||||
foreach ($this->styles as $style)
|
||||
{
|
||||
Html::_('stylesheet', $style, ['version' => 'auto']);
|
||||
}
|
||||
// add scripts
|
||||
foreach ($this->scripts as $script)
|
||||
{
|
||||
Html::_('script', $script, ['version' => 'auto']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Escapes a value for output in a view script.
|
||||
*
|
||||
* @param mixed $var The output to escape.
|
||||
* @param bool $shorten The switch to shorten.
|
||||
* @param int $length The shorting length.
|
||||
*
|
||||
* @return mixed The escaped value.
|
||||
* @since 1.6
|
||||
*/
|
||||
public function escape($var, bool $shorten = true, int $length = 50)
|
||||
{
|
||||
if (!is_string($var))
|
||||
{
|
||||
return $var;
|
||||
}
|
||||
|
||||
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of fields the table can be sorted by
|
||||
*
|
||||
* @return array containing the field name to sort by as the key and display text as value
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getSortFields()
|
||||
{
|
||||
return array(
|
||||
'a.ordering' => Text::_('JGRID_HEADING_ORDERING'),
|
||||
'a.published' => Text::_('JSTATUS'),
|
||||
'a.phonecode' => Text::_('COM_SUBFORMPOWER_COUNTRY_PHONECODE_LABEL'),
|
||||
'a.isothree' => Text::_('COM_SUBFORMPOWER_COUNTRY_ISOTHREE_LABEL'),
|
||||
'a.numcode' => Text::_('COM_SUBFORMPOWER_COUNTRY_NUMCODE_LABEL'),
|
||||
'a.iso' => Text::_('COM_SUBFORMPOWER_COUNTRY_ISO_LABEL'),
|
||||
'a.id' => Text::_('JGRID_HEADING_ID')
|
||||
);
|
||||
}
|
||||
}
|
1
admin/src/View/Countries/index.html
Normal file
1
admin/src/View/Countries/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
267
admin/src/View/Country/HtmlView.php
Normal file
267
admin/src/View/Country/HtmlView.php
Normal file
@@ -0,0 +1,267 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage HtmlView.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
namespace JCB\Component\Subformpower\Administrator\View\Country;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Toolbar\Toolbar;
|
||||
use Joomla\CMS\Form\FormHelper;
|
||||
use Joomla\CMS\Session\Session;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
use Joomla\CMS\Component\ComponentHelper;
|
||||
use Joomla\CMS\HTML\HTMLHelper as Html;
|
||||
use Joomla\CMS\Layout\FileLayout;
|
||||
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
|
||||
use Joomla\CMS\Plugin\PluginHelper;
|
||||
use Joomla\CMS\Toolbar\ToolbarHelper;
|
||||
use Joomla\CMS\Document\Document;
|
||||
use JCB\Component\Subformpower\Administrator\Helper\SubformpowerHelper;
|
||||
use JCB\Joomla\Utilities\StringHelper;
|
||||
|
||||
// No direct access to this file
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* Country Html View class
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
class HtmlView extends BaseHtmlView
|
||||
{
|
||||
/**
|
||||
* Country view display method
|
||||
*
|
||||
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
|
||||
*
|
||||
* @return void
|
||||
* @since 1.6
|
||||
*/
|
||||
public function display($tpl = null)
|
||||
{
|
||||
// set params
|
||||
$this->params = ComponentHelper::getParams('com_subformpower');
|
||||
$this->useCoreUI = true;
|
||||
// Assign the variables
|
||||
$this->form = $this->get('Form');
|
||||
$this->item = $this->get('Item');
|
||||
$this->styles = $this->get('Styles');
|
||||
$this->scripts = $this->get('Scripts');
|
||||
$this->state = $this->get('State');
|
||||
// get action permissions
|
||||
$this->canDo = SubformpowerHelper::getActions('country', $this->item);
|
||||
// get input
|
||||
$jinput = Factory::getApplication()->input;
|
||||
$this->ref = $jinput->get('ref', 0, 'word');
|
||||
$this->refid = $jinput->get('refid', 0, 'int');
|
||||
$return = $jinput->get('return', null, 'base64');
|
||||
// set the referral string
|
||||
$this->referral = '';
|
||||
if ($this->refid && $this->ref)
|
||||
{
|
||||
// return to the item that referred to this item
|
||||
$this->referral = '&ref=' . (string) $this->ref . '&refid=' . (int) $this->refid;
|
||||
}
|
||||
elseif($this->ref)
|
||||
{
|
||||
// return to the list view that referred to this item
|
||||
$this->referral = '&ref=' . (string) $this->ref;
|
||||
}
|
||||
// check return value
|
||||
if (!is_null($return))
|
||||
{
|
||||
// add the return value
|
||||
$this->referral .= '&return=' . (string) $return;
|
||||
}
|
||||
|
||||
// Get Linked view data
|
||||
$this->vvvcurrencies = $this->get('Vvvcurrencies');
|
||||
|
||||
// Set the toolbar
|
||||
$this->addToolBar();
|
||||
|
||||
// Check for errors.
|
||||
if (count($errors = $this->get('Errors')))
|
||||
{
|
||||
throw new \Exception(implode("\n", $errors), 500);
|
||||
}
|
||||
|
||||
// Set the html view document stuff
|
||||
$this->_prepareDocument();
|
||||
|
||||
// Display the template
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add the page title and toolbar.
|
||||
*
|
||||
* @return void
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function addToolbar(): void
|
||||
{
|
||||
Factory::getApplication()->input->set('hidemainmenu', true);
|
||||
$user = Factory::getApplication()->getIdentity();
|
||||
$userId = $user->id;
|
||||
$isNew = $this->item->id == 0;
|
||||
|
||||
ToolbarHelper::title( Text::_($isNew ? 'COM_SUBFORMPOWER_COUNTRY_NEW' : 'COM_SUBFORMPOWER_COUNTRY_EDIT'), 'pencil-2 article-add');
|
||||
// Built the actions for new and existing records.
|
||||
if (StringHelper::check($this->referral))
|
||||
{
|
||||
if ($this->canDo->get('country.create') && $isNew)
|
||||
{
|
||||
// We can create the record.
|
||||
ToolbarHelper::save('country.save', 'JTOOLBAR_SAVE');
|
||||
}
|
||||
elseif ($this->canDo->get('country.edit'))
|
||||
{
|
||||
// We can save the record.
|
||||
ToolbarHelper::save('country.save', 'JTOOLBAR_SAVE');
|
||||
}
|
||||
if ($isNew)
|
||||
{
|
||||
// Do not creat but cancel.
|
||||
ToolbarHelper::cancel('country.cancel', 'JTOOLBAR_CANCEL');
|
||||
}
|
||||
else
|
||||
{
|
||||
// We can close it.
|
||||
ToolbarHelper::cancel('country.cancel', 'JTOOLBAR_CLOSE');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($isNew)
|
||||
{
|
||||
// For new records, check the create permission.
|
||||
if ($this->canDo->get('country.create'))
|
||||
{
|
||||
ToolbarHelper::apply('country.apply', 'JTOOLBAR_APPLY');
|
||||
ToolbarHelper::save('country.save', 'JTOOLBAR_SAVE');
|
||||
ToolbarHelper::custom('country.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
|
||||
};
|
||||
ToolbarHelper::cancel('country.cancel', 'JTOOLBAR_CANCEL');
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($this->canDo->get('country.edit'))
|
||||
{
|
||||
// We can save the new record
|
||||
ToolbarHelper::apply('country.apply', 'JTOOLBAR_APPLY');
|
||||
ToolbarHelper::save('country.save', 'JTOOLBAR_SAVE');
|
||||
// We can save this record, but check the create permission to see
|
||||
// if we can return to make a new one.
|
||||
if ($this->canDo->get('country.create'))
|
||||
{
|
||||
ToolbarHelper::custom('country.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
|
||||
}
|
||||
}
|
||||
$canVersion = ($this->canDo->get('core.version') && $this->canDo->get('country.version'));
|
||||
if ($this->state->params->get('save_history', 1) && $this->canDo->get('country.edit') && $canVersion)
|
||||
{
|
||||
ToolbarHelper::versions('com_subformpower.country', $this->item->id);
|
||||
}
|
||||
if ($this->canDo->get('country.create'))
|
||||
{
|
||||
ToolbarHelper::custom('country.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
|
||||
}
|
||||
ToolbarHelper::cancel('country.cancel', 'JTOOLBAR_CLOSE');
|
||||
}
|
||||
}
|
||||
ToolbarHelper::divider();
|
||||
ToolbarHelper::inlinehelp();
|
||||
// set help url for this view if found
|
||||
$this->help_url = SubformpowerHelper::getHelpUrl('country');
|
||||
if (StringHelper::check($this->help_url))
|
||||
{
|
||||
ToolbarHelper::help('COM_SUBFORMPOWER_HELP_MANAGER', false, $this->help_url);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Escapes a value for output in a view script.
|
||||
*
|
||||
* @param mixed $var The output to escape.
|
||||
* @param bool $shorten The switch to shorten.
|
||||
* @param int $length The shorting length.
|
||||
*
|
||||
* @return mixed The escaped value.
|
||||
* @since 1.6
|
||||
*/
|
||||
public function escape($var, bool $shorten = true, int $length = 30)
|
||||
{
|
||||
if (!is_string($var))
|
||||
{
|
||||
return $var;
|
||||
}
|
||||
|
||||
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare some document related stuff.
|
||||
*
|
||||
* @return void
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function _prepareDocument(): void
|
||||
{
|
||||
// Load jQuery
|
||||
Html::_('jquery.framework');
|
||||
$isNew = ($this->item->id < 1);
|
||||
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_SUBFORMPOWER_COUNTRY_NEW' : 'COM_SUBFORMPOWER_COUNTRY_EDIT'));
|
||||
// add styles
|
||||
foreach ($this->styles as $style)
|
||||
{
|
||||
Html::_('stylesheet', $style, ['version' => 'auto']);
|
||||
}
|
||||
|
||||
// Add the CSS for Footable.
|
||||
Html::_('stylesheet', 'media/com_subformpower/footable-v2/css/footable.core.min.css', ['version' => 'auto']);
|
||||
|
||||
// Use the Metro Style
|
||||
if (!isset($this->fooTableStyle) || 0 == $this->fooTableStyle)
|
||||
{
|
||||
Html::_('stylesheet', 'media/com_subformpower/footable-v2/css/footable.metro.min.css', ['version' => 'auto']);
|
||||
}
|
||||
// Use the Legacy Style.
|
||||
elseif (isset($this->fooTableStyle) && 1 == $this->fooTableStyle)
|
||||
{
|
||||
Html::_('stylesheet', 'media/com_subformpower/footable-v2/css/footable.standalone.min.css', ['version' => 'auto']);
|
||||
}
|
||||
|
||||
// Add the JavaScript for Footable
|
||||
Html::_('script', 'media/com_subformpower/footable-v2/js/footable.js', ['version' => 'auto']);
|
||||
Html::_('script', 'media/com_subformpower/footable-v2/js/footable.sort.js', ['version' => 'auto']);
|
||||
Html::_('script', 'media/com_subformpower/footable-v2/js/footable.filter.js', ['version' => 'auto']);
|
||||
Html::_('script', 'media/com_subformpower/footable-v2/js/footable.paginate.js', ['version' => 'auto']);
|
||||
|
||||
$footable = "jQuery(document).ready(function() { jQuery(function () { jQuery('.footable').footable(); }); jQuery('.nav-tabs').on('click', 'li', function() { setTimeout(tableFix, 10); }); }); function tableFix() { jQuery('.footable').trigger('footable_resize'); }";
|
||||
$this->getDocument()->addScriptDeclaration($footable);
|
||||
|
||||
// add scripts
|
||||
foreach ($this->scripts as $script)
|
||||
{
|
||||
Html::_('script', $script, ['version' => 'auto']);
|
||||
}
|
||||
}
|
||||
}
|
1
admin/src/View/Country/index.html
Normal file
1
admin/src/View/Country/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
226
admin/src/View/Currencies/HtmlView.php
Normal file
226
admin/src/View/Currencies/HtmlView.php
Normal file
@@ -0,0 +1,226 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage HtmlView.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
namespace JCB\Component\Subformpower\Administrator\View\Currencies;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Toolbar\Toolbar;
|
||||
use Joomla\CMS\Form\FormHelper;
|
||||
use Joomla\CMS\Session\Session;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
use Joomla\CMS\Component\ComponentHelper;
|
||||
use Joomla\CMS\HTML\HTMLHelper as Html;
|
||||
use Joomla\CMS\Layout\FileLayout;
|
||||
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
|
||||
use Joomla\CMS\Plugin\PluginHelper;
|
||||
use Joomla\CMS\Toolbar\ToolbarHelper;
|
||||
use Joomla\CMS\Document\Document;
|
||||
use JCB\Component\Subformpower\Administrator\Helper\SubformpowerHelper;
|
||||
use JCB\Joomla\Utilities\ArrayHelper;
|
||||
use JCB\Joomla\Utilities\StringHelper;
|
||||
|
||||
// No direct access to this file
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* Subformpower Html View class for the Currencies
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
class HtmlView extends BaseHtmlView
|
||||
{
|
||||
/**
|
||||
* Currencies view display method
|
||||
*
|
||||
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
|
||||
*
|
||||
* @return void
|
||||
* @since 1.6
|
||||
*/
|
||||
public function display($tpl = null)
|
||||
{
|
||||
// Assign data to the view
|
||||
$this->items = $this->get('Items');
|
||||
$this->pagination = $this->get('Pagination');
|
||||
$this->state = $this->get('State');
|
||||
$this->styles = $this->get('Styles');
|
||||
$this->scripts = $this->get('Scripts');
|
||||
$this->user ??= Factory::getApplication()->getIdentity();
|
||||
// Load the filter form from xml.
|
||||
$this->filterForm = $this->get('FilterForm');
|
||||
// Load the active filters.
|
||||
$this->activeFilters = $this->get('ActiveFilters');
|
||||
// Add the list ordering clause.
|
||||
$this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id'));
|
||||
$this->listDirn = $this->escape($this->state->get('list.direction', 'DESC'));
|
||||
$this->saveOrder = $this->listOrder == 'a.ordering';
|
||||
// set the return here value
|
||||
$this->return_here = urlencode(base64_encode((string) Uri::getInstance()));
|
||||
// get global action permissions
|
||||
$this->canDo = SubformpowerHelper::getActions('currency');
|
||||
$this->canEdit = $this->canDo->get('currency.edit');
|
||||
$this->canState = $this->canDo->get('currency.edit.state');
|
||||
$this->canCreate = $this->canDo->get('currency.create');
|
||||
$this->canDelete = $this->canDo->get('currency.delete');
|
||||
$this->canBatch = ($this->canDo->get('currency.batch') && $this->canDo->get('core.batch'));
|
||||
|
||||
// If we don't have items we load the empty state
|
||||
if (is_array($this->items) && !count((array) $this->items) && $this->isEmptyState = $this->get('IsEmptyState'))
|
||||
{
|
||||
$this->setLayout('emptystate');
|
||||
}
|
||||
|
||||
// We don't need toolbar in the modal window.
|
||||
if ($this->getLayout() !== 'modal')
|
||||
{
|
||||
$this->addToolbar();
|
||||
}
|
||||
|
||||
// Check for errors.
|
||||
if (count($errors = $this->get('Errors')))
|
||||
{
|
||||
throw new \Exception(implode("\n", $errors), 500);
|
||||
}
|
||||
|
||||
// Set the html view document stuff
|
||||
$this->_prepareDocument();
|
||||
|
||||
// Display the template
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the page title and toolbar.
|
||||
*
|
||||
* @return void
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function addToolbar(): void
|
||||
{
|
||||
ToolbarHelper::title(Text::_('COM_SUBFORMPOWER_CURRENCIES'), 'joomla');
|
||||
|
||||
if ($this->canCreate)
|
||||
{
|
||||
ToolbarHelper::addNew('currency.add');
|
||||
}
|
||||
|
||||
// Only load if there are items
|
||||
if (ArrayHelper::check($this->items))
|
||||
{
|
||||
if ($this->canEdit)
|
||||
{
|
||||
ToolbarHelper::editList('currency.edit');
|
||||
}
|
||||
|
||||
if ($this->canState)
|
||||
{
|
||||
ToolbarHelper::publishList('currencies.publish');
|
||||
ToolbarHelper::unpublishList('currencies.unpublish');
|
||||
ToolbarHelper::archiveList('currencies.archive');
|
||||
|
||||
if ($this->canDo->get('core.admin'))
|
||||
{
|
||||
ToolbarHelper::checkin('currencies.checkin');
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete))
|
||||
{
|
||||
ToolbarHelper::deleteList('', 'currencies.delete', 'JTOOLBAR_EMPTY_TRASH');
|
||||
}
|
||||
elseif ($this->canState && $this->canDelete)
|
||||
{
|
||||
ToolbarHelper::trash('currencies.trash');
|
||||
}
|
||||
}
|
||||
|
||||
// set help url for this view if found
|
||||
$this->help_url = SubformpowerHelper::getHelpUrl('currencies');
|
||||
if (StringHelper::check($this->help_url))
|
||||
{
|
||||
ToolbarHelper::help('COM_SUBFORMPOWER_HELP_MANAGER', false, $this->help_url);
|
||||
}
|
||||
|
||||
// add the options comp button
|
||||
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
|
||||
{
|
||||
ToolbarHelper::preferences('com_subformpower');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare some document related stuff.
|
||||
*
|
||||
* @return void
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function _prepareDocument(): void
|
||||
{
|
||||
// Load jQuery
|
||||
Html::_('jquery.framework');
|
||||
$this->getDocument()->setTitle(Text::_('COM_SUBFORMPOWER_CURRENCIES'));
|
||||
// add styles
|
||||
foreach ($this->styles as $style)
|
||||
{
|
||||
Html::_('stylesheet', $style, ['version' => 'auto']);
|
||||
}
|
||||
// add scripts
|
||||
foreach ($this->scripts as $script)
|
||||
{
|
||||
Html::_('script', $script, ['version' => 'auto']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Escapes a value for output in a view script.
|
||||
*
|
||||
* @param mixed $var The output to escape.
|
||||
* @param bool $shorten The switch to shorten.
|
||||
* @param int $length The shorting length.
|
||||
*
|
||||
* @return mixed The escaped value.
|
||||
* @since 1.6
|
||||
*/
|
||||
public function escape($var, bool $shorten = true, int $length = 50)
|
||||
{
|
||||
if (!is_string($var))
|
||||
{
|
||||
return $var;
|
||||
}
|
||||
|
||||
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of fields the table can be sorted by
|
||||
*
|
||||
* @return array containing the field name to sort by as the key and display text as value
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getSortFields()
|
||||
{
|
||||
return array(
|
||||
'a.ordering' => Text::_('JGRID_HEADING_ORDERING'),
|
||||
'a.published' => Text::_('JSTATUS'),
|
||||
'a.symbol' => Text::_('COM_SUBFORMPOWER_CURRENCY_SYMBOL_LABEL'),
|
||||
'a.id' => Text::_('JGRID_HEADING_ID')
|
||||
);
|
||||
}
|
||||
}
|
1
admin/src/View/Currencies/index.html
Normal file
1
admin/src/View/Currencies/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
240
admin/src/View/Currency/HtmlView.php
Normal file
240
admin/src/View/Currency/HtmlView.php
Normal file
@@ -0,0 +1,240 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage HtmlView.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
namespace JCB\Component\Subformpower\Administrator\View\Currency;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Toolbar\Toolbar;
|
||||
use Joomla\CMS\Form\FormHelper;
|
||||
use Joomla\CMS\Session\Session;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
use Joomla\CMS\Component\ComponentHelper;
|
||||
use Joomla\CMS\HTML\HTMLHelper as Html;
|
||||
use Joomla\CMS\Layout\FileLayout;
|
||||
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
|
||||
use Joomla\CMS\Plugin\PluginHelper;
|
||||
use Joomla\CMS\Toolbar\ToolbarHelper;
|
||||
use Joomla\CMS\Document\Document;
|
||||
use JCB\Component\Subformpower\Administrator\Helper\SubformpowerHelper;
|
||||
use JCB\Joomla\Utilities\StringHelper;
|
||||
|
||||
// No direct access to this file
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* Currency Html View class
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
class HtmlView extends BaseHtmlView
|
||||
{
|
||||
/**
|
||||
* Currency view display method
|
||||
*
|
||||
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
|
||||
*
|
||||
* @return void
|
||||
* @since 1.6
|
||||
*/
|
||||
public function display($tpl = null)
|
||||
{
|
||||
// set params
|
||||
$this->params = ComponentHelper::getParams('com_subformpower');
|
||||
$this->useCoreUI = true;
|
||||
// Assign the variables
|
||||
$this->form = $this->get('Form');
|
||||
$this->item = $this->get('Item');
|
||||
$this->styles = $this->get('Styles');
|
||||
$this->scripts = $this->get('Scripts');
|
||||
$this->state = $this->get('State');
|
||||
// get action permissions
|
||||
$this->canDo = SubformpowerHelper::getActions('currency', $this->item);
|
||||
// get input
|
||||
$jinput = Factory::getApplication()->input;
|
||||
$this->ref = $jinput->get('ref', 0, 'word');
|
||||
$this->refid = $jinput->get('refid', 0, 'int');
|
||||
$return = $jinput->get('return', null, 'base64');
|
||||
// set the referral string
|
||||
$this->referral = '';
|
||||
if ($this->refid && $this->ref)
|
||||
{
|
||||
// return to the item that referred to this item
|
||||
$this->referral = '&ref=' . (string) $this->ref . '&refid=' . (int) $this->refid;
|
||||
}
|
||||
elseif($this->ref)
|
||||
{
|
||||
// return to the list view that referred to this item
|
||||
$this->referral = '&ref=' . (string) $this->ref;
|
||||
}
|
||||
// check return value
|
||||
if (!is_null($return))
|
||||
{
|
||||
// add the return value
|
||||
$this->referral .= '&return=' . (string) $return;
|
||||
}
|
||||
|
||||
// Set the toolbar
|
||||
$this->addToolBar();
|
||||
|
||||
// Check for errors.
|
||||
if (count($errors = $this->get('Errors')))
|
||||
{
|
||||
throw new \Exception(implode("\n", $errors), 500);
|
||||
}
|
||||
|
||||
// Set the html view document stuff
|
||||
$this->_prepareDocument();
|
||||
|
||||
// Display the template
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add the page title and toolbar.
|
||||
*
|
||||
* @return void
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function addToolbar(): void
|
||||
{
|
||||
Factory::getApplication()->input->set('hidemainmenu', true);
|
||||
$user = Factory::getApplication()->getIdentity();
|
||||
$userId = $user->id;
|
||||
$isNew = $this->item->id == 0;
|
||||
|
||||
ToolbarHelper::title( Text::_($isNew ? 'COM_SUBFORMPOWER_CURRENCY_NEW' : 'COM_SUBFORMPOWER_CURRENCY_EDIT'), 'pencil-2 article-add');
|
||||
// Built the actions for new and existing records.
|
||||
if (StringHelper::check($this->referral))
|
||||
{
|
||||
if ($this->canDo->get('currency.create') && $isNew)
|
||||
{
|
||||
// We can create the record.
|
||||
ToolbarHelper::save('currency.save', 'JTOOLBAR_SAVE');
|
||||
}
|
||||
elseif ($this->canDo->get('currency.edit'))
|
||||
{
|
||||
// We can save the record.
|
||||
ToolbarHelper::save('currency.save', 'JTOOLBAR_SAVE');
|
||||
}
|
||||
if ($isNew)
|
||||
{
|
||||
// Do not creat but cancel.
|
||||
ToolbarHelper::cancel('currency.cancel', 'JTOOLBAR_CANCEL');
|
||||
}
|
||||
else
|
||||
{
|
||||
// We can close it.
|
||||
ToolbarHelper::cancel('currency.cancel', 'JTOOLBAR_CLOSE');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($isNew)
|
||||
{
|
||||
// For new records, check the create permission.
|
||||
if ($this->canDo->get('currency.create'))
|
||||
{
|
||||
ToolbarHelper::apply('currency.apply', 'JTOOLBAR_APPLY');
|
||||
ToolbarHelper::save('currency.save', 'JTOOLBAR_SAVE');
|
||||
ToolbarHelper::custom('currency.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
|
||||
};
|
||||
ToolbarHelper::cancel('currency.cancel', 'JTOOLBAR_CANCEL');
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($this->canDo->get('currency.edit'))
|
||||
{
|
||||
// We can save the new record
|
||||
ToolbarHelper::apply('currency.apply', 'JTOOLBAR_APPLY');
|
||||
ToolbarHelper::save('currency.save', 'JTOOLBAR_SAVE');
|
||||
// We can save this record, but check the create permission to see
|
||||
// if we can return to make a new one.
|
||||
if ($this->canDo->get('currency.create'))
|
||||
{
|
||||
ToolbarHelper::custom('currency.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
|
||||
}
|
||||
}
|
||||
$canVersion = ($this->canDo->get('core.version') && $this->canDo->get('currency.version'));
|
||||
if ($this->state->params->get('save_history', 1) && $this->canDo->get('currency.edit') && $canVersion)
|
||||
{
|
||||
ToolbarHelper::versions('com_subformpower.currency', $this->item->id);
|
||||
}
|
||||
if ($this->canDo->get('currency.create'))
|
||||
{
|
||||
ToolbarHelper::custom('currency.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
|
||||
}
|
||||
ToolbarHelper::cancel('currency.cancel', 'JTOOLBAR_CLOSE');
|
||||
}
|
||||
}
|
||||
ToolbarHelper::divider();
|
||||
ToolbarHelper::inlinehelp();
|
||||
// set help url for this view if found
|
||||
$this->help_url = SubformpowerHelper::getHelpUrl('currency');
|
||||
if (StringHelper::check($this->help_url))
|
||||
{
|
||||
ToolbarHelper::help('COM_SUBFORMPOWER_HELP_MANAGER', false, $this->help_url);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Escapes a value for output in a view script.
|
||||
*
|
||||
* @param mixed $var The output to escape.
|
||||
* @param bool $shorten The switch to shorten.
|
||||
* @param int $length The shorting length.
|
||||
*
|
||||
* @return mixed The escaped value.
|
||||
* @since 1.6
|
||||
*/
|
||||
public function escape($var, bool $shorten = true, int $length = 30)
|
||||
{
|
||||
if (!is_string($var))
|
||||
{
|
||||
return $var;
|
||||
}
|
||||
|
||||
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare some document related stuff.
|
||||
*
|
||||
* @return void
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function _prepareDocument(): void
|
||||
{
|
||||
// Load jQuery
|
||||
Html::_('jquery.framework');
|
||||
$isNew = ($this->item->id < 1);
|
||||
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_SUBFORMPOWER_CURRENCY_NEW' : 'COM_SUBFORMPOWER_CURRENCY_EDIT'));
|
||||
// add styles
|
||||
foreach ($this->styles as $style)
|
||||
{
|
||||
Html::_('stylesheet', $style, ['version' => 'auto']);
|
||||
}
|
||||
// add scripts
|
||||
foreach ($this->scripts as $script)
|
||||
{
|
||||
Html::_('script', $script, ['version' => 'auto']);
|
||||
}
|
||||
}
|
||||
}
|
1
admin/src/View/Currency/index.html
Normal file
1
admin/src/View/Currency/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
115
admin/src/View/Import/HtmlView.php
Normal file
115
admin/src/View/Import/HtmlView.php
Normal file
@@ -0,0 +1,115 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage HtmlView.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
namespace JCB\Component\Subformpower\Administrator\View\Import;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
|
||||
use Joomla\CMS\Toolbar\ToolbarHelper;
|
||||
use JCB\Component\Subformpower\Administrator\Helper\SubformpowerHelper;
|
||||
use JCB\Joomla\Utilities\StringHelper;
|
||||
|
||||
// No direct access to this file
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* Subformpower Import Html View
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
class HtmlView extends BaseHtmlView
|
||||
{
|
||||
protected $headerList;
|
||||
protected $hasPackage = false;
|
||||
protected $headers;
|
||||
protected $hasHeader = 0;
|
||||
protected $dataType;
|
||||
|
||||
/**
|
||||
* Display the view
|
||||
*
|
||||
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
|
||||
*
|
||||
* @return void
|
||||
* @since 1.6
|
||||
*/
|
||||
public function display($tpl = null)
|
||||
{
|
||||
$paths = new \StdClass;
|
||||
$paths->first = '';
|
||||
$state = $this->get('state');
|
||||
|
||||
$this->paths = &$paths;
|
||||
$this->state = &$state;
|
||||
// get global action permissions
|
||||
$this->canDo = SubformpowerHelper::getActions('import');
|
||||
|
||||
// We don't need toolbar in the modal window.
|
||||
if ($this->getLayout() !== 'modal')
|
||||
{
|
||||
$this->addToolbar();
|
||||
}
|
||||
|
||||
// get the session object
|
||||
$session = Factory::getSession();
|
||||
// check if it has package
|
||||
$this->hasPackage = $session->get('hasPackage', false);
|
||||
$this->dataType = $session->get('dataType', false);
|
||||
if($this->hasPackage && $this->dataType)
|
||||
{
|
||||
$this->headerList = json_decode($session->get($this->dataType.'_VDM_IMPORTHEADERS', false),true);
|
||||
$this->headers = SubformpowerHelper::getFileHeaders($this->dataType);
|
||||
// clear the data type
|
||||
$session->clear('dataType');
|
||||
}
|
||||
|
||||
// Check for errors.
|
||||
if (count($errors = $this->get('Errors')))
|
||||
{
|
||||
throw new \Exception(implode("\n", $errors), 500);
|
||||
}
|
||||
|
||||
// Display the template
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the page title and toolbar.
|
||||
*
|
||||
* @return void
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function addToolbar(): void
|
||||
{
|
||||
ToolbarHelper::title(Text::_('COM_SUBFORMPOWER_IMPORT_TITLE'), 'upload');
|
||||
|
||||
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
|
||||
{
|
||||
ToolbarHelper::preferences('com_subformpower');
|
||||
}
|
||||
|
||||
// set help url for this view if found
|
||||
$this->help_url = SubformpowerHelper::getHelpUrl('import');
|
||||
if (StringHelper::check($this->help_url))
|
||||
{
|
||||
ToolbarHelper::help('COM_SUBFORMPOWER_HELP_MANAGER', false, $this->help_url);
|
||||
}
|
||||
}
|
||||
}
|
1
admin/src/View/Import/index.html
Normal file
1
admin/src/View/Import/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
119
admin/src/View/Subformpower/HtmlView.php
Normal file
119
admin/src/View/Subformpower/HtmlView.php
Normal file
@@ -0,0 +1,119 @@
|
||||
<?php
|
||||
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
||||
Nampharm
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 27th June, 2024
|
||||
@created 24th May, 2024
|
||||
@package Subform Power
|
||||
@subpackage HtmlView.php
|
||||
@author Oh Martin <https://nampharm.com.na>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
||||
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
||||
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
||||
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
||||
|
||||
/------------------------------------------------------------------------------------------------------*/
|
||||
namespace JCB\Component\Subformpower\Administrator\View\Subformpower;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\HTML\HTMLHelper as Html;
|
||||
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
|
||||
use Joomla\CMS\Toolbar\ToolbarHelper;
|
||||
use Joomla\CMS\Document\Document;
|
||||
use JCB\Component\Subformpower\Administrator\Helper\SubformpowerHelper;
|
||||
use JCB\Joomla\Utilities\StringHelper;
|
||||
|
||||
// No direct access to this file
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* Subformpower View class
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
class HtmlView extends BaseHtmlView
|
||||
{
|
||||
/**
|
||||
* View display method
|
||||
* @return void
|
||||
*/
|
||||
function display($tpl = null)
|
||||
{
|
||||
// Assign data to the view
|
||||
$this->icons = $this->get('Icons');
|
||||
$this->styles = $this->get('Styles');
|
||||
$this->scripts = $this->get('Scripts');
|
||||
$this->contributors = SubformpowerHelper::getContributors();
|
||||
|
||||
// get the manifest details of the component
|
||||
$this->manifest = SubformpowerHelper::manifest();
|
||||
|
||||
// Set the toolbar
|
||||
$this->addToolBar();
|
||||
|
||||
// Check for errors.
|
||||
if (count($errors = $this->get('Errors')))
|
||||
{
|
||||
throw new \Exception(implode("\n", $errors), 500);
|
||||
}
|
||||
|
||||
// Set the html view document stuff
|
||||
$this->_prepareDocument();
|
||||
|
||||
// Display the template
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the page title and toolbar.
|
||||
*
|
||||
* @return void
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function addToolbar(): void
|
||||
{
|
||||
$canDo = SubformpowerHelper::getActions('subformpower');
|
||||
ToolbarHelper::title(Text::_('COM_SUBFORMPOWER_DASHBOARD'), 'grid-2');
|
||||
|
||||
// set help url for this view if found
|
||||
$this->help_url = SubformpowerHelper::getHelpUrl('subformpower');
|
||||
if (StringHelper::check($this->help_url))
|
||||
{
|
||||
ToolbarHelper::help('COM_SUBFORMPOWER_HELP_MANAGER', false, $this->help_url);
|
||||
}
|
||||
|
||||
if ($canDo->get('core.admin') || $canDo->get('core.options'))
|
||||
{
|
||||
ToolbarHelper::preferences('com_subformpower');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare some document related stuff.
|
||||
*
|
||||
* @return void
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function _prepareDocument(): void
|
||||
{
|
||||
// set page title
|
||||
$this->getDocument()->setTitle(Text::_('COM_SUBFORMPOWER_DASHBOARD'));
|
||||
// add manifest to page JavaScript
|
||||
$this->getDocument()->addScriptDeclaration("var manifest = JSON.parse('" . json_encode($this->manifest) . "');", "text/javascript");
|
||||
// add styles
|
||||
foreach ($this->styles as $style)
|
||||
{
|
||||
Html::_('stylesheet', $style, ['version' => 'auto']);
|
||||
}
|
||||
// add scripts
|
||||
foreach ($this->scripts as $script)
|
||||
{
|
||||
Html::_('script', $script, ['version' => 'auto']);
|
||||
}
|
||||
}
|
||||
}
|
1
admin/src/View/Subformpower/index.html
Normal file
1
admin/src/View/Subformpower/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
1
admin/src/View/index.html
Normal file
1
admin/src/View/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
1
admin/src/index.html
Normal file
1
admin/src/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user