update - v1.0.4
This commit is contained in:
parent
b5fca2d8e4
commit
bec2f89d29
@ -12,14 +12,14 @@ Just a basic Questions & Answers.
|
||||
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
|
||||
+ *Name*: [Questions and Answers](https://www.vdm.io/)
|
||||
+ *First Build*: 30th January, 2017
|
||||
+ *Last Build*: 8th February, 2021
|
||||
+ *Last Build*: 2nd March, 2022
|
||||
+ *Version*: 1.0.x
|
||||
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
|
||||
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
# Component Number
|
||||
|
||||
+ *Line count*: **31340**
|
||||
+ *Line count*: **31397**
|
||||
+ *File count*: **207**
|
||||
+ *Folder count*: **63**
|
||||
|
||||
|
@ -12,14 +12,14 @@ Just a basic Questions & Answers.
|
||||
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
|
||||
+ *Name*: [Questions and Answers](https://www.vdm.io/)
|
||||
+ *First Build*: 30th January, 2017
|
||||
+ *Last Build*: 8th February, 2021
|
||||
+ *Last Build*: 2nd March, 2022
|
||||
+ *Version*: 1.0.x
|
||||
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
|
||||
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
# Component Number
|
||||
|
||||
+ *Line count*: **31340**
|
||||
+ *Line count*: **31397**
|
||||
+ *File count*: **207**
|
||||
+ *Folder count*: **63**
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<access component="com_questionsanswers">
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<access component="com_questionsanswers">
|
||||
<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" />
|
||||
@ -79,5 +79,5 @@
|
||||
<action name="core.edit" title="JACTION_EDIT" description="COM_CATEGORIES_ACCESS_EDIT_DESC" />
|
||||
<action name="core.edit.state" title="JACTION_EDITSTATE" description="COM_CATEGORIES_ACCESS_EDITSTATE_DESC" />
|
||||
<action name="core.edit.own" title="JACTION_EDITOWN" description="COM_CATEGORIES_ACCESS_EDITOWN_DESC" />
|
||||
</section>
|
||||
</section>
|
||||
</access>
|
@ -1,29 +1,29 @@
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage admin.css
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* CSS Document */
|
||||
.no-click {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage admin.css
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* CSS Document */
|
||||
.no-click {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
|
@ -1,177 +1,177 @@
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage dashboard.css
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* 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;
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage dashboard.css
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* 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,27 +1,27 @@
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage help_document.css
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage help_document.css
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage help_documents.css
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage help_documents.css
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
||||
|
@ -1,30 +1,30 @@
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage question_and_answer.css
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage question_and_answer.css
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
||||
#jform_question {
|
||||
height: 100px;
|
||||
}
|
||||
}
|
||||
|
@ -1,27 +1,27 @@
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage questions_and_answers.css
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage questions_and_answers.css
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
||||
|
@ -1,25 +1,25 @@
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage admin.js
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage admin.js
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* JS Document */
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<config>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<config>
|
||||
<fieldset
|
||||
addrulepath="/administrator/components/com_questionsanswers/models/rules"
|
||||
addfieldpath="/administrator/components/com_questionsanswers/models/fields"
|
||||
@ -206,20 +206,20 @@
|
||||
showon="crop_main:1"
|
||||
onchange="if(!jQuery(this).val().match(/^\d+$/)){jQuery(this).val('')};"
|
||||
/>
|
||||
</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_questionsanswers"
|
||||
section="component"
|
||||
/>
|
||||
</fieldset>
|
||||
</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_questionsanswers"
|
||||
section="component"
|
||||
/>
|
||||
</fieldset>
|
||||
</config>
|
@ -1,127 +1,127 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage controller.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
|
||||
/**
|
||||
* General Controller of Questionsanswers component
|
||||
*/
|
||||
class QuestionsanswersController extends JControllerLegacy
|
||||
{
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param array $config An optional associative array of configuration settings.
|
||||
* Recognized key values include 'name', 'default_task', 'model_path', and
|
||||
* 'view_path' (this list is not meant to be comprehensive).
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
public function __construct($config = array())
|
||||
{
|
||||
// set the default view
|
||||
$config['default_view'] = 'questionsanswers';
|
||||
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* display task
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function display($cachable = false, $urlparams = false)
|
||||
{
|
||||
// set default view if not set
|
||||
$view = $this->input->getCmd('view', 'questionsanswers');
|
||||
$data = $this->getViewRelation($view);
|
||||
$layout = $this->input->get('layout', null, 'WORD');
|
||||
$id = $this->input->getInt('id');
|
||||
|
||||
// Check for edit form.
|
||||
if(QuestionsanswersHelper::checkArray($data))
|
||||
{
|
||||
if ($data['edit'] && $layout == 'edit' && !$this->checkEditId('com_questionsanswers.edit.'.$data['view'], $id))
|
||||
{
|
||||
// Somehow the person just went to the form - we don't allow that.
|
||||
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
|
||||
$this->setMessage($this->getError(), 'error');
|
||||
// check if item was opend from other then its own list view
|
||||
$ref = $this->input->getCmd('ref', 0);
|
||||
$refid = $this->input->getInt('refid', 0);
|
||||
// set redirect
|
||||
if ($refid > 0 && QuestionsanswersHelper::checkString($ref))
|
||||
{
|
||||
// redirect to item of ref
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_questionsanswers&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false));
|
||||
}
|
||||
elseif (QuestionsanswersHelper::checkString($ref))
|
||||
{
|
||||
|
||||
// redirect to ref
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_questionsanswers&view='.(string)$ref, false));
|
||||
}
|
||||
else
|
||||
{
|
||||
// normal redirect back to the list view
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_questionsanswers&view='.$data['views'], false));
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return parent::display($cachable, $urlparams);
|
||||
}
|
||||
|
||||
protected function getViewRelation($view)
|
||||
{
|
||||
// check the we have a value
|
||||
if (QuestionsanswersHelper::checkString($view))
|
||||
{
|
||||
// the view relationships
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage controller.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
|
||||
/**
|
||||
* General Controller of Questionsanswers component
|
||||
*/
|
||||
class QuestionsanswersController extends JControllerLegacy
|
||||
{
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param array $config An optional associative array of configuration settings.
|
||||
* Recognized key values include 'name', 'default_task', 'model_path', and
|
||||
* 'view_path' (this list is not meant to be comprehensive).
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
public function __construct($config = array())
|
||||
{
|
||||
// set the default view
|
||||
$config['default_view'] = 'questionsanswers';
|
||||
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* display task
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function display($cachable = false, $urlparams = false)
|
||||
{
|
||||
// set default view if not set
|
||||
$view = $this->input->getCmd('view', 'questionsanswers');
|
||||
$data = $this->getViewRelation($view);
|
||||
$layout = $this->input->get('layout', null, 'WORD');
|
||||
$id = $this->input->getInt('id');
|
||||
|
||||
// Check for edit form.
|
||||
if(QuestionsanswersHelper::checkArray($data))
|
||||
{
|
||||
if ($data['edit'] && $layout == 'edit' && !$this->checkEditId('com_questionsanswers.edit.'.$data['view'], $id))
|
||||
{
|
||||
// Somehow the person just went to the form - we don't allow that.
|
||||
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
|
||||
$this->setMessage($this->getError(), 'error');
|
||||
// check if item was opend from other then its own list view
|
||||
$ref = $this->input->getCmd('ref', 0);
|
||||
$refid = $this->input->getInt('refid', 0);
|
||||
// set redirect
|
||||
if ($refid > 0 && QuestionsanswersHelper::checkString($ref))
|
||||
{
|
||||
// redirect to item of ref
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_questionsanswers&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false));
|
||||
}
|
||||
elseif (QuestionsanswersHelper::checkString($ref))
|
||||
{
|
||||
|
||||
// redirect to ref
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_questionsanswers&view='.(string)$ref, false));
|
||||
}
|
||||
else
|
||||
{
|
||||
// normal redirect back to the list view
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_questionsanswers&view='.$data['views'], false));
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return parent::display($cachable, $urlparams);
|
||||
}
|
||||
|
||||
protected function getViewRelation($view)
|
||||
{
|
||||
// check the we have a value
|
||||
if (QuestionsanswersHelper::checkString($view))
|
||||
{
|
||||
// the view relationships
|
||||
$views = array(
|
||||
'question_and_answer' => 'questions_and_answers',
|
||||
'help_document' => 'help_documents'
|
||||
);
|
||||
// check if this is a list view
|
||||
if (in_array($view, $views))
|
||||
{
|
||||
// this is a list view
|
||||
return array('edit' => false, 'view' => array_search($view,$views), 'views' => $view);
|
||||
}
|
||||
// check if it is an edit view
|
||||
elseif (array_key_exists($view, $views))
|
||||
{
|
||||
// this is a edit view
|
||||
return array('edit' => true, 'view' => $view, 'views' => $views[$view]);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
'help_document' => 'help_documents'
|
||||
);
|
||||
// check if this is a list view
|
||||
if (in_array($view, $views))
|
||||
{
|
||||
// this is a list view
|
||||
return array('edit' => false, 'view' => array_search($view,$views), 'views' => $view);
|
||||
}
|
||||
// check if it is an edit view
|
||||
elseif (array_key_exists($view, $views))
|
||||
{
|
||||
// this is a edit view
|
||||
return array('edit' => true, 'view' => $view, 'views' => $views[$view]);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -1,66 +1,74 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage ajax.json.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
|
||||
/**
|
||||
* Questionsanswers Ajax Controller
|
||||
*/
|
||||
class QuestionsanswersControllerAjax extends JControllerLegacy
|
||||
{
|
||||
public function __construct($config)
|
||||
{
|
||||
parent::__construct($config);
|
||||
// make sure all json stuff are set
|
||||
JFactory::getDocument()->setMimeEncoding( 'application/json' );
|
||||
JResponse::setHeader('Content-Disposition','attachment;filename="getajax.json"');
|
||||
JResponse::setHeader("Access-Control-Allow-Origin", "*");
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage ajax.json.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
|
||||
/**
|
||||
* Questionsanswers Ajax Controller
|
||||
*/
|
||||
class QuestionsanswersControllerAjax extends JControllerLegacy
|
||||
{
|
||||
public function __construct($config)
|
||||
{
|
||||
parent::__construct($config);
|
||||
// make sure all json stuff are set
|
||||
JFactory::getDocument()->setMimeEncoding( 'application/json' );
|
||||
// get the application
|
||||
$app = JFactory::getApplication();
|
||||
$app->setHeader('Content-Disposition','attachment;filename="getajax.json"');
|
||||
$app->setHeader('Access-Control-Allow-Origin', '*');
|
||||
// load the tasks
|
||||
$this->registerTask('uploadfile', 'ajax');
|
||||
$this->registerTask('removeFile', 'ajax');
|
||||
}
|
||||
|
||||
public function ajax()
|
||||
{
|
||||
$user = JFactory::getUser();
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
// Check Token!
|
||||
$token = JSession::getFormToken();
|
||||
$call_token = $jinput->get('token', 0, 'ALNUM');
|
||||
if($jinput->get($token, 0, 'ALNUM') || $token === $call_token)
|
||||
{
|
||||
$task = $this->getTask();
|
||||
switch($task)
|
||||
$this->registerTask('removeFile', 'ajax');
|
||||
}
|
||||
|
||||
public function ajax()
|
||||
{
|
||||
// get the user for later use
|
||||
$user = JFactory::getUser();
|
||||
// get the input values
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
// check if we should return raw
|
||||
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
|
||||
// return to a callback function
|
||||
$callback = $jinput->get('callback', null, 'CMD');
|
||||
// Check Token!
|
||||
$token = JSession::getFormToken();
|
||||
$call_token = $jinput->get('token', 0, 'ALNUM');
|
||||
if($jinput->get($token, 0, 'ALNUM') || $token === $call_token)
|
||||
{
|
||||
// get the task
|
||||
$task = $this->getTask();
|
||||
switch($task)
|
||||
{
|
||||
case 'uploadfile':
|
||||
try
|
||||
{
|
||||
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
|
||||
$targetValue = $jinput->get('target', NULL, 'WORD');
|
||||
$typeValue = $jinput->get('type', NULL, 'WORD');
|
||||
if($targetValue && $user->id != 0 && $typeValue)
|
||||
@ -71,7 +79,7 @@ class QuestionsanswersControllerAjax extends JControllerLegacy
|
||||
{
|
||||
$result = false;
|
||||
}
|
||||
if($callback = $jinput->get('callback', null, 'CMD'))
|
||||
if($callback)
|
||||
{
|
||||
echo $callback . "(".json_encode($result).");";
|
||||
}
|
||||
@ -86,10 +94,14 @@ class QuestionsanswersControllerAjax extends JControllerLegacy
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
if($callback = $jinput->get('callback', null, 'CMD'))
|
||||
if($callback)
|
||||
{
|
||||
echo $callback."(".json_encode($e).");";
|
||||
}
|
||||
elseif($returnRaw)
|
||||
{
|
||||
echo json_encode($e);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "(".json_encode($e).");";
|
||||
@ -99,7 +111,6 @@ class QuestionsanswersControllerAjax extends JControllerLegacy
|
||||
case 'removeFile':
|
||||
try
|
||||
{
|
||||
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
|
||||
$filenameValue = $jinput->get('filename', NULL, 'STRING');
|
||||
$targetValue = $jinput->get('target', NULL, 'WORD');
|
||||
$flushValue = $jinput->get('flush', NULL, 'INT');
|
||||
@ -112,7 +123,7 @@ class QuestionsanswersControllerAjax extends JControllerLegacy
|
||||
{
|
||||
$result = false;
|
||||
}
|
||||
if($callback = $jinput->get('callback', null, 'CMD'))
|
||||
if($callback)
|
||||
{
|
||||
echo $callback . "(".json_encode($result).");";
|
||||
}
|
||||
@ -127,28 +138,37 @@ class QuestionsanswersControllerAjax extends JControllerLegacy
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
if($callback = $jinput->get('callback', null, 'CMD'))
|
||||
if($callback)
|
||||
{
|
||||
echo $callback."(".json_encode($e).");";
|
||||
}
|
||||
elseif($returnRaw)
|
||||
{
|
||||
echo json_encode($e);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "(".json_encode($e).");";
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if($callback = $jinput->get('callback', null, 'CMD'))
|
||||
{
|
||||
echo $callback."(".json_encode(false).");";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "(".json_encode(false).");";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// return to a callback function
|
||||
if($callback)
|
||||
{
|
||||
echo $callback."(".json_encode(false).");";
|
||||
}
|
||||
elseif($returnRaw)
|
||||
{
|
||||
echo json_encode(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "(".json_encode(false).");";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,26 +1,26 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage download.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage download.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
|
@ -1,129 +1,129 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage help.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
|
||||
/**
|
||||
* Questionsanswers Help Controller
|
||||
*/
|
||||
class QuestionsanswersControllerHelp extends JControllerLegacy
|
||||
{
|
||||
public function __construct($config)
|
||||
{
|
||||
parent::__construct($config);
|
||||
// load the tasks
|
||||
$this->registerTask('getText', 'help');
|
||||
}
|
||||
|
||||
public function help()
|
||||
{
|
||||
$user = JFactory::getUser();
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
// Check Token!
|
||||
$token = JSession::getFormToken();
|
||||
$call_token = $jinput->get('token', 0, 'ALNUM');
|
||||
if($user->id != 0 && $token == $call_token)
|
||||
{
|
||||
$task = $this->getTask();
|
||||
switch($task){
|
||||
case 'getText':
|
||||
try
|
||||
{
|
||||
$idValue = $jinput->get('id', 0, 'INT');
|
||||
if($idValue)
|
||||
{
|
||||
$result = $this->getHelpDocumentText($idValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = '';
|
||||
}
|
||||
echo $result;
|
||||
// stop execution gracefully
|
||||
jexit();
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
// stop execution gracefully
|
||||
jexit();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// stop execution gracefully
|
||||
jexit();
|
||||
}
|
||||
}
|
||||
|
||||
protected function getHelpDocumentText($id)
|
||||
{
|
||||
$db = JFactory::getDbo();
|
||||
$query = $db->getQuery(true);
|
||||
$query->select(array('a.title','a.content'));
|
||||
$query->from('#__questionsanswers_help_document AS a');
|
||||
$query->where('a.id = '.(int) $id);
|
||||
$query->where('a.published = 1');
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
if($db->getNumRows())
|
||||
{
|
||||
$text = array();
|
||||
$document = $db->loadObject();
|
||||
// fix image issue
|
||||
$images['src="images'] = 'src="'.JURI::root().'images';
|
||||
$images["src='images"] = "src='".JURI::root()."images";
|
||||
$images['src="/images'] = 'src="'.JURI::root().'images';
|
||||
$images["src='/images"] = "src='".JURI::root()."images";
|
||||
// set document template
|
||||
$text[] = "<!doctype html>";
|
||||
$text[] = '<html>';
|
||||
$text[] = "<head>";
|
||||
$text[] = '<meta charset="utf-8">';
|
||||
$text[] = "<title>".$document->title."</title>";
|
||||
$text[] = '<link type="text/css" href="'.JURI::root().'media/com_questionsanswers/uikit/css/uikit.gradient.min.css" rel="stylesheet"></link>';
|
||||
$text[] = '<script type="text/javascript" src="'.JURI::root().'media/com_questionsanswers/uikit/js/uikit.min.js"></script>';
|
||||
$text[] = "</head>";
|
||||
$text[] = '<body><br />';
|
||||
$text[] = '<div class="uk-container uk-container-center uk-grid-collapse">';
|
||||
$text[] = '<div class="uk-panel uk-width-1-1 uk-panel-box uk-panel-box-primary">';
|
||||
// build the help text
|
||||
$text[] = '<h1 class="uk-panel-title">'.$document->title."</h1>";
|
||||
$text[] = str_replace(array_keys($images),array_values($images),$document->content);
|
||||
// end template
|
||||
$text[] = '</div><br /><br />';
|
||||
$text[] = '</div>';
|
||||
$text[] = "</body>";
|
||||
$text[] = "</html>";
|
||||
|
||||
return implode("\n",$text);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage help.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
|
||||
/**
|
||||
* Questionsanswers Help Controller
|
||||
*/
|
||||
class QuestionsanswersControllerHelp extends JControllerLegacy
|
||||
{
|
||||
public function __construct($config)
|
||||
{
|
||||
parent::__construct($config);
|
||||
// load the tasks
|
||||
$this->registerTask('getText', 'help');
|
||||
}
|
||||
|
||||
public function help()
|
||||
{
|
||||
$user = JFactory::getUser();
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
// Check Token!
|
||||
$token = JSession::getFormToken();
|
||||
$call_token = $jinput->get('token', 0, 'ALNUM');
|
||||
if($user->id != 0 && $token == $call_token)
|
||||
{
|
||||
$task = $this->getTask();
|
||||
switch($task){
|
||||
case 'getText':
|
||||
try
|
||||
{
|
||||
$idValue = $jinput->get('id', 0, 'INT');
|
||||
if($idValue)
|
||||
{
|
||||
$result = $this->getHelpDocumentText($idValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = '';
|
||||
}
|
||||
echo $result;
|
||||
// stop execution gracefully
|
||||
jexit();
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
// stop execution gracefully
|
||||
jexit();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// stop execution gracefully
|
||||
jexit();
|
||||
}
|
||||
}
|
||||
|
||||
protected function getHelpDocumentText($id)
|
||||
{
|
||||
$db = JFactory::getDbo();
|
||||
$query = $db->getQuery(true);
|
||||
$query->select(array('a.title','a.content'));
|
||||
$query->from('#__questionsanswers_help_document AS a');
|
||||
$query->where('a.id = '.(int) $id);
|
||||
$query->where('a.published = 1');
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
if($db->getNumRows())
|
||||
{
|
||||
$text = array();
|
||||
$document = $db->loadObject();
|
||||
// fix image issue
|
||||
$images['src="images'] = 'src="'.JURI::root().'images';
|
||||
$images["src='images"] = "src='".JURI::root()."images";
|
||||
$images['src="/images'] = 'src="'.JURI::root().'images';
|
||||
$images["src='/images"] = "src='".JURI::root()."images";
|
||||
// set document template
|
||||
$text[] = "<!doctype html>";
|
||||
$text[] = '<html>';
|
||||
$text[] = "<head>";
|
||||
$text[] = '<meta charset="utf-8">';
|
||||
$text[] = "<title>".$document->title."</title>";
|
||||
$text[] = '<link type="text/css" href="'.JURI::root().'media/com_questionsanswers/uikit/css/uikit.gradient.min.css" rel="stylesheet"></link>';
|
||||
$text[] = '<script type="text/javascript" src="'.JURI::root().'media/com_questionsanswers/uikit/js/uikit.min.js"></script>';
|
||||
$text[] = "</head>";
|
||||
$text[] = '<body><br />';
|
||||
$text[] = '<div class="uk-container uk-container-center uk-grid-collapse">';
|
||||
$text[] = '<div class="uk-panel uk-width-1-1 uk-panel-box uk-panel-box-primary">';
|
||||
// build the help text
|
||||
$text[] = '<h1 class="uk-panel-title">'.$document->title."</h1>";
|
||||
$text[] = str_replace(array_keys($images),array_values($images),$document->content);
|
||||
// end template
|
||||
$text[] = '</div><br /><br />';
|
||||
$text[] = '</div>';
|
||||
$text[] = "</body>";
|
||||
$text[] = "</html>";
|
||||
|
||||
return implode("\n",$text);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -1,70 +1,70 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage help_document.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
|
||||
/**
|
||||
* Help_document Controller
|
||||
*/
|
||||
class QuestionsanswersControllerHelp_document extends JControllerForm
|
||||
{
|
||||
/**
|
||||
* Current or most recently performed task.
|
||||
*
|
||||
* @var string
|
||||
* @since 12.2
|
||||
* @note Replaces _task.
|
||||
*/
|
||||
protected $task;
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* @param array $config A named array of configuration variables.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function __construct($config = array())
|
||||
{
|
||||
$this->view_list = 'Help_documents'; // safeguard for setting the return view listing to the main view.
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can add a new record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowAdd($data = array())
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage help_document.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
|
||||
/**
|
||||
* Help_document Controller
|
||||
*/
|
||||
class QuestionsanswersControllerHelp_document extends JControllerForm
|
||||
{
|
||||
/**
|
||||
* Current or most recently performed task.
|
||||
*
|
||||
* @var string
|
||||
* @since 12.2
|
||||
* @note Replaces _task.
|
||||
*/
|
||||
protected $task;
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* @param array $config A named array of configuration variables.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function __construct($config = array())
|
||||
{
|
||||
$this->view_list = 'Help_documents'; // safeguard for setting the return view listing to the main view.
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can add a new record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowAdd($data = array())
|
||||
{
|
||||
// Get user object.
|
||||
$user = JFactory::getUser();
|
||||
@ -76,20 +76,20 @@ class QuestionsanswersControllerHelp_document extends JControllerForm
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
return $user->authorise('help_document.create', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can edit an existing record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
* @param string $key The name of the key for the primary key.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowEdit($data = array(), $key = 'id')
|
||||
return $user->authorise('help_document.create', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can edit an existing record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
* @param string $key The name of the key for the primary key.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowEdit($data = array(), $key = 'id')
|
||||
{
|
||||
// get user object.
|
||||
$user = JFactory::getUser();
|
||||
@ -139,199 +139,199 @@ class QuestionsanswersControllerHelp_document extends JControllerForm
|
||||
}
|
||||
}
|
||||
// Since there is no permission, revert to the component permissions.
|
||||
return $user->authorise('help_document.edit', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the URL arguments to append to an item redirect.
|
||||
*
|
||||
* @param integer $recordId The primary key id for the item.
|
||||
* @param string $urlVar The name of the URL variable for the id.
|
||||
*
|
||||
* @return string The arguments to append to the redirect URL.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
|
||||
{
|
||||
// get the referral options (old method use return instead see parent)
|
||||
$ref = $this->input->get('ref', 0, 'string');
|
||||
$refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// get redirect info.
|
||||
$append = parent::getRedirectToItemAppend($recordId, $urlVar);
|
||||
|
||||
// set the referral options
|
||||
if ($refid && $ref)
|
||||
{
|
||||
$append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append;
|
||||
}
|
||||
elseif ($ref)
|
||||
{
|
||||
$append = '&ref='. (string)$ref . $append;
|
||||
}
|
||||
|
||||
return $append;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to run batch operations.
|
||||
*
|
||||
* @param object $model The model.
|
||||
*
|
||||
* @return boolean True if successful, false otherwise and internal error is set.
|
||||
*
|
||||
* @since 2.5
|
||||
*/
|
||||
public function batch($model = null)
|
||||
{
|
||||
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
|
||||
|
||||
// Set the model
|
||||
$model = $this->getModel('Help_document', '', array());
|
||||
|
||||
// Preset the redirect
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_questionsanswers&view=help_documents' . $this->getRedirectToListAppend(), false));
|
||||
|
||||
return parent::batch($model);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to cancel an edit.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
*
|
||||
* @return boolean True if access level checks pass, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function cancel($key = null)
|
||||
{
|
||||
// get the referral options
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// Check if there is a return value
|
||||
$return = $this->input->get('return', null, 'base64');
|
||||
|
||||
$cancel = parent::cancel($key);
|
||||
|
||||
if (!is_null($return) && JUri::isInternal(base64_decode($return)))
|
||||
{
|
||||
$redirect = base64_decode($return);
|
||||
|
||||
// Redirect to the return value.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
$redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->refid && $this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to save a record.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
* @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
|
||||
*
|
||||
* @return boolean True if successful, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function save($key = null, $urlVar = null)
|
||||
{
|
||||
// get the referral options
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// Check if there is a return value
|
||||
$return = $this->input->get('return', null, 'base64');
|
||||
$canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return)));
|
||||
|
||||
if ($this->ref || $this->refid || $canReturn)
|
||||
{
|
||||
// to make sure the item is checkedin on redirect
|
||||
$this->task = 'save';
|
||||
}
|
||||
|
||||
$saved = parent::save($key, $urlVar);
|
||||
|
||||
// This is not needed since parent save already does this
|
||||
// Due to the ref and refid implementation we need to add this
|
||||
if ($canReturn)
|
||||
{
|
||||
$redirect = base64_decode($return);
|
||||
|
||||
// Redirect to the return value.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
$redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->refid && $this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $saved;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function that allows child controller access to model data
|
||||
* after the data has been saved.
|
||||
*
|
||||
* @param JModel &$model The data model object.
|
||||
* @param array $validData The validated data.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 11.1
|
||||
*/
|
||||
protected function postSaveHook(JModelLegacy $model, $validData = array())
|
||||
return $user->authorise('help_document.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')
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
// get the referral options (old method use return instead see parent)
|
||||
$ref = $this->input->get('ref', 0, 'string');
|
||||
$refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// get redirect info.
|
||||
$append = parent::getRedirectToItemAppend($recordId, $urlVar);
|
||||
|
||||
// set the referral options
|
||||
if ($refid && $ref)
|
||||
{
|
||||
$append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append;
|
||||
}
|
||||
elseif ($ref)
|
||||
{
|
||||
$append = '&ref='. (string)$ref . $append;
|
||||
}
|
||||
|
||||
return $append;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to run batch operations.
|
||||
*
|
||||
* @param object $model The model.
|
||||
*
|
||||
* @return boolean True if successful, false otherwise and internal error is set.
|
||||
*
|
||||
* @since 2.5
|
||||
*/
|
||||
public function batch($model = null)
|
||||
{
|
||||
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
|
||||
|
||||
// Set the model
|
||||
$model = $this->getModel('Help_document', '', array());
|
||||
|
||||
// Preset the redirect
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_questionsanswers&view=help_documents' . $this->getRedirectToListAppend(), false));
|
||||
|
||||
return parent::batch($model);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to cancel an edit.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
*
|
||||
* @return boolean True if access level checks pass, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function cancel($key = null)
|
||||
{
|
||||
// get the referral options
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// Check if there is a return value
|
||||
$return = $this->input->get('return', null, 'base64');
|
||||
|
||||
$cancel = parent::cancel($key);
|
||||
|
||||
if (!is_null($return) && JUri::isInternal(base64_decode($return)))
|
||||
{
|
||||
$redirect = base64_decode($return);
|
||||
|
||||
// Redirect to the return value.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
$redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->refid && $this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to save a record.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
* @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
|
||||
*
|
||||
* @return boolean True if successful, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function save($key = null, $urlVar = null)
|
||||
{
|
||||
// get the referral options
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// Check if there is a return value
|
||||
$return = $this->input->get('return', null, 'base64');
|
||||
$canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return)));
|
||||
|
||||
if ($this->ref || $this->refid || $canReturn)
|
||||
{
|
||||
// to make sure the item is checkedin on redirect
|
||||
$this->task = 'save';
|
||||
}
|
||||
|
||||
$saved = parent::save($key, $urlVar);
|
||||
|
||||
// This is not needed since parent save already does this
|
||||
// Due to the ref and refid implementation we need to add this
|
||||
if ($canReturn)
|
||||
{
|
||||
$redirect = base64_decode($return);
|
||||
|
||||
// Redirect to the return value.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
$redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->refid && $this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $saved;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function that allows child controller access to model data
|
||||
* after the data has been saved.
|
||||
*
|
||||
* @param JModel &$model The data model object.
|
||||
* @param array $validData The validated data.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 11.1
|
||||
*/
|
||||
protected function postSaveHook(JModelLegacy $model, $validData = array())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,60 +1,60 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage help_documents.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
|
||||
/**
|
||||
* Help_documents Controller
|
||||
*/
|
||||
class QuestionsanswersControllerHelp_documents extends JControllerAdmin
|
||||
{
|
||||
/**
|
||||
* The prefix to use with controller messages.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $text_prefix = 'COM_QUESTIONSANSWERS_HELP_DOCUMENTS';
|
||||
|
||||
/**
|
||||
* Method to get a model object, loading it if required.
|
||||
*
|
||||
* @param string $name The model name. Optional.
|
||||
* @param string $prefix The class prefix. Optional.
|
||||
* @param array $config Configuration array for model. Optional.
|
||||
*
|
||||
* @return JModelLegacy The model.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getModel($name = 'Help_document', $prefix = 'QuestionsanswersModel', $config = array('ignore_request' => true))
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage help_documents.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
|
||||
/**
|
||||
* Help_documents Controller
|
||||
*/
|
||||
class QuestionsanswersControllerHelp_documents extends JControllerAdmin
|
||||
{
|
||||
/**
|
||||
* The prefix to use with controller messages.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $text_prefix = 'COM_QUESTIONSANSWERS_HELP_DOCUMENTS';
|
||||
|
||||
/**
|
||||
* Method to get a model object, loading it if required.
|
||||
*
|
||||
* @param string $name The model name. Optional.
|
||||
* @param string $prefix The class prefix. Optional.
|
||||
* @param array $config Configuration array for model. Optional.
|
||||
*
|
||||
* @return JModelLegacy The model.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getModel($name = 'Help_document', $prefix = 'QuestionsanswersModel', $config = array('ignore_request' => true))
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
}
|
||||
|
||||
public function exportData()
|
||||
@ -118,5 +118,5 @@ class QuestionsanswersControllerHelp_documents extends JControllerAdmin
|
||||
$message = JText::_('COM_QUESTIONSANSWERS_IMPORT_FAILED');
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_questionsanswers&view=help_documents', false), $message, 'error');
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,69 +1,69 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage import.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
|
||||
/**
|
||||
* Questionsanswers Import Controller
|
||||
*/
|
||||
class QuestionsanswersControllerImport extends JControllerLegacy
|
||||
{
|
||||
/**
|
||||
* Import an spreadsheet.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function import()
|
||||
{
|
||||
// Check for request forgeries
|
||||
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
|
||||
|
||||
$model = $this->getModel('import');
|
||||
if ($model->import())
|
||||
{
|
||||
$cache = JFactory::getCache('mod_menu');
|
||||
$cache->clean();
|
||||
// TODO: Reset the users acl here as well to kill off any missing bits
|
||||
}
|
||||
|
||||
$app = JFactory::getApplication();
|
||||
$redirect_url = $app->getUserState('com_questionsanswers.redirect_url');
|
||||
if (empty($redirect_url))
|
||||
{
|
||||
$redirect_url = JRoute::_('index.php?option=com_questionsanswers&view=import', false);
|
||||
}
|
||||
else
|
||||
{
|
||||
// wipe out the user state when we're going to redirect
|
||||
$app->setUserState('com_questionsanswers.redirect_url', '');
|
||||
$app->setUserState('com_questionsanswers.message', '');
|
||||
$app->setUserState('com_questionsanswers.extension_message', '');
|
||||
}
|
||||
$this->setRedirect($redirect_url);
|
||||
}
|
||||
}
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage import.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
|
||||
/**
|
||||
* Questionsanswers Import Controller
|
||||
*/
|
||||
class QuestionsanswersControllerImport extends JControllerLegacy
|
||||
{
|
||||
/**
|
||||
* Import an spreadsheet.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function import()
|
||||
{
|
||||
// Check for request forgeries
|
||||
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
|
||||
|
||||
$model = $this->getModel('import');
|
||||
if ($model->import())
|
||||
{
|
||||
$cache = JFactory::getCache('mod_menu');
|
||||
$cache->clean();
|
||||
// TODO: Reset the users acl here as well to kill off any missing bits
|
||||
}
|
||||
|
||||
$app = JFactory::getApplication();
|
||||
$redirect_url = $app->getUserState('com_questionsanswers.redirect_url');
|
||||
if (empty($redirect_url))
|
||||
{
|
||||
$redirect_url = JRoute::_('index.php?option=com_questionsanswers&view=import', false);
|
||||
}
|
||||
else
|
||||
{
|
||||
// wipe out the user state when we're going to redirect
|
||||
$app->setUserState('com_questionsanswers.redirect_url', '');
|
||||
$app->setUserState('com_questionsanswers.message', '');
|
||||
$app->setUserState('com_questionsanswers.extension_message', '');
|
||||
}
|
||||
$this->setRedirect($redirect_url);
|
||||
}
|
||||
}
|
||||
|
@ -1,70 +1,70 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage question_and_answer.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
|
||||
/**
|
||||
* Question_and_answer Controller
|
||||
*/
|
||||
class QuestionsanswersControllerQuestion_and_answer extends JControllerForm
|
||||
{
|
||||
/**
|
||||
* Current or most recently performed task.
|
||||
*
|
||||
* @var string
|
||||
* @since 12.2
|
||||
* @note Replaces _task.
|
||||
*/
|
||||
protected $task;
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* @param array $config A named array of configuration variables.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function __construct($config = array())
|
||||
{
|
||||
$this->view_list = 'Questions_and_answers'; // safeguard for setting the return view listing to the main view.
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can add a new record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowAdd($data = array())
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage question_and_answer.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
|
||||
/**
|
||||
* Question_and_answer Controller
|
||||
*/
|
||||
class QuestionsanswersControllerQuestion_and_answer extends JControllerForm
|
||||
{
|
||||
/**
|
||||
* Current or most recently performed task.
|
||||
*
|
||||
* @var string
|
||||
* @since 12.2
|
||||
* @note Replaces _task.
|
||||
*/
|
||||
protected $task;
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* @param array $config A named array of configuration variables.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function __construct($config = array())
|
||||
{
|
||||
$this->view_list = 'Questions_and_answers'; // safeguard for setting the return view listing to the main view.
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can add a new record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowAdd($data = array())
|
||||
{
|
||||
// Get user object.
|
||||
$user = JFactory::getUser();
|
||||
@ -76,20 +76,20 @@ class QuestionsanswersControllerQuestion_and_answer extends JControllerForm
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
return $user->authorise('question_and_answer.create', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can edit an existing record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
* @param string $key The name of the key for the primary key.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowEdit($data = array(), $key = 'id')
|
||||
return $user->authorise('question_and_answer.create', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can edit an existing record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
* @param string $key The name of the key for the primary key.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowEdit($data = array(), $key = 'id')
|
||||
{ // get user object.
|
||||
$user = JFactory::getUser();
|
||||
// get record id.
|
||||
@ -138,199 +138,199 @@ class QuestionsanswersControllerQuestion_and_answer extends JControllerForm
|
||||
}
|
||||
}
|
||||
// Since there is no permission, revert to the component permissions.
|
||||
return $user->authorise('question_and_answer.edit', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the URL arguments to append to an item redirect.
|
||||
*
|
||||
* @param integer $recordId The primary key id for the item.
|
||||
* @param string $urlVar The name of the URL variable for the id.
|
||||
*
|
||||
* @return string The arguments to append to the redirect URL.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
|
||||
{
|
||||
// get the referral options (old method use return instead see parent)
|
||||
$ref = $this->input->get('ref', 0, 'string');
|
||||
$refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// get redirect info.
|
||||
$append = parent::getRedirectToItemAppend($recordId, $urlVar);
|
||||
|
||||
// set the referral options
|
||||
if ($refid && $ref)
|
||||
{
|
||||
$append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append;
|
||||
}
|
||||
elseif ($ref)
|
||||
{
|
||||
$append = '&ref='. (string)$ref . $append;
|
||||
}
|
||||
|
||||
return $append;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to run batch operations.
|
||||
*
|
||||
* @param object $model The model.
|
||||
*
|
||||
* @return boolean True if successful, false otherwise and internal error is set.
|
||||
*
|
||||
* @since 2.5
|
||||
*/
|
||||
public function batch($model = null)
|
||||
{
|
||||
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
|
||||
|
||||
// Set the model
|
||||
$model = $this->getModel('Question_and_answer', '', array());
|
||||
|
||||
// Preset the redirect
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_questionsanswers&view=questions_and_answers' . $this->getRedirectToListAppend(), false));
|
||||
|
||||
return parent::batch($model);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to cancel an edit.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
*
|
||||
* @return boolean True if access level checks pass, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function cancel($key = null)
|
||||
{
|
||||
// get the referral options
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// Check if there is a return value
|
||||
$return = $this->input->get('return', null, 'base64');
|
||||
|
||||
$cancel = parent::cancel($key);
|
||||
|
||||
if (!is_null($return) && JUri::isInternal(base64_decode($return)))
|
||||
{
|
||||
$redirect = base64_decode($return);
|
||||
|
||||
// Redirect to the return value.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
$redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->refid && $this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to save a record.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
* @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
|
||||
*
|
||||
* @return boolean True if successful, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function save($key = null, $urlVar = null)
|
||||
{
|
||||
// get the referral options
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// Check if there is a return value
|
||||
$return = $this->input->get('return', null, 'base64');
|
||||
$canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return)));
|
||||
|
||||
if ($this->ref || $this->refid || $canReturn)
|
||||
{
|
||||
// to make sure the item is checkedin on redirect
|
||||
$this->task = 'save';
|
||||
}
|
||||
|
||||
$saved = parent::save($key, $urlVar);
|
||||
|
||||
// This is not needed since parent save already does this
|
||||
// Due to the ref and refid implementation we need to add this
|
||||
if ($canReturn)
|
||||
{
|
||||
$redirect = base64_decode($return);
|
||||
|
||||
// Redirect to the return value.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
$redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->refid && $this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $saved;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function that allows child controller access to model data
|
||||
* after the data has been saved.
|
||||
*
|
||||
* @param JModel &$model The data model object.
|
||||
* @param array $validData The validated data.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 11.1
|
||||
*/
|
||||
protected function postSaveHook(JModelLegacy $model, $validData = array())
|
||||
return $user->authorise('question_and_answer.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')
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
// get the referral options (old method use return instead see parent)
|
||||
$ref = $this->input->get('ref', 0, 'string');
|
||||
$refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// get redirect info.
|
||||
$append = parent::getRedirectToItemAppend($recordId, $urlVar);
|
||||
|
||||
// set the referral options
|
||||
if ($refid && $ref)
|
||||
{
|
||||
$append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append;
|
||||
}
|
||||
elseif ($ref)
|
||||
{
|
||||
$append = '&ref='. (string)$ref . $append;
|
||||
}
|
||||
|
||||
return $append;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to run batch operations.
|
||||
*
|
||||
* @param object $model The model.
|
||||
*
|
||||
* @return boolean True if successful, false otherwise and internal error is set.
|
||||
*
|
||||
* @since 2.5
|
||||
*/
|
||||
public function batch($model = null)
|
||||
{
|
||||
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
|
||||
|
||||
// Set the model
|
||||
$model = $this->getModel('Question_and_answer', '', array());
|
||||
|
||||
// Preset the redirect
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_questionsanswers&view=questions_and_answers' . $this->getRedirectToListAppend(), false));
|
||||
|
||||
return parent::batch($model);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to cancel an edit.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
*
|
||||
* @return boolean True if access level checks pass, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function cancel($key = null)
|
||||
{
|
||||
// get the referral options
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// Check if there is a return value
|
||||
$return = $this->input->get('return', null, 'base64');
|
||||
|
||||
$cancel = parent::cancel($key);
|
||||
|
||||
if (!is_null($return) && JUri::isInternal(base64_decode($return)))
|
||||
{
|
||||
$redirect = base64_decode($return);
|
||||
|
||||
// Redirect to the return value.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
$redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->refid && $this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to save a record.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
* @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
|
||||
*
|
||||
* @return boolean True if successful, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function save($key = null, $urlVar = null)
|
||||
{
|
||||
// get the referral options
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// Check if there is a return value
|
||||
$return = $this->input->get('return', null, 'base64');
|
||||
$canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return)));
|
||||
|
||||
if ($this->ref || $this->refid || $canReturn)
|
||||
{
|
||||
// to make sure the item is checkedin on redirect
|
||||
$this->task = 'save';
|
||||
}
|
||||
|
||||
$saved = parent::save($key, $urlVar);
|
||||
|
||||
// This is not needed since parent save already does this
|
||||
// Due to the ref and refid implementation we need to add this
|
||||
if ($canReturn)
|
||||
{
|
||||
$redirect = base64_decode($return);
|
||||
|
||||
// Redirect to the return value.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
$redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->refid && $this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $saved;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function that allows child controller access to model data
|
||||
* after the data has been saved.
|
||||
*
|
||||
* @param JModel &$model The data model object.
|
||||
* @param array $validData The validated data.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 11.1
|
||||
*/
|
||||
protected function postSaveHook(JModelLegacy $model, $validData = array())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,60 +1,60 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage questions_and_answers.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
|
||||
/**
|
||||
* Questions_and_answers Controller
|
||||
*/
|
||||
class QuestionsanswersControllerQuestions_and_answers extends JControllerAdmin
|
||||
{
|
||||
/**
|
||||
* The prefix to use with controller messages.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $text_prefix = 'COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS';
|
||||
|
||||
/**
|
||||
* Method to get a model object, loading it if required.
|
||||
*
|
||||
* @param string $name The model name. Optional.
|
||||
* @param string $prefix The class prefix. Optional.
|
||||
* @param array $config Configuration array for model. Optional.
|
||||
*
|
||||
* @return JModelLegacy The model.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getModel($name = 'Question_and_answer', $prefix = 'QuestionsanswersModel', $config = array('ignore_request' => true))
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage questions_and_answers.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
|
||||
/**
|
||||
* Questions_and_answers Controller
|
||||
*/
|
||||
class QuestionsanswersControllerQuestions_and_answers extends JControllerAdmin
|
||||
{
|
||||
/**
|
||||
* The prefix to use with controller messages.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $text_prefix = 'COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS';
|
||||
|
||||
/**
|
||||
* Method to get a model object, loading it if required.
|
||||
*
|
||||
* @param string $name The model name. Optional.
|
||||
* @param string $prefix The class prefix. Optional.
|
||||
* @param array $config Configuration array for model. Optional.
|
||||
*
|
||||
* @return JModelLegacy The model.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getModel($name = 'Question_and_answer', $prefix = 'QuestionsanswersModel', $config = array('ignore_request' => true))
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
}
|
||||
|
||||
public function exportData()
|
||||
@ -118,5 +118,5 @@ class QuestionsanswersControllerQuestions_and_answers extends JControllerAdmin
|
||||
$message = JText::_('COM_QUESTIONSANSWERS_IMPORT_FAILED');
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_questionsanswers&view=questions_and_answers', false), $message, 'error');
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,35 +1,37 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage questionsanswers.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
/**
|
||||
* Questionsanswers Controller
|
||||
*/
|
||||
class QuestionsanswersControllerQuestionsanswers extends JControllerAdmin
|
||||
{
|
||||
|
||||
}
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage questionsanswers.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Questionsanswers Controller
|
||||
*/
|
||||
class QuestionsanswersControllerQuestionsanswers extends JControllerAdmin
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -1,85 +1,85 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage headercheck.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
class questionsanswersHeaderCheck
|
||||
{
|
||||
function js_loaded($script_name)
|
||||
{
|
||||
// UIkit check point
|
||||
if (strpos($script_name,'uikit') !== false)
|
||||
{
|
||||
$app = JFactory::getApplication();
|
||||
$getTemplateName = $app->getTemplate('template')->template;
|
||||
|
||||
if (strpos($getTemplateName,'yoo') !== false)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
$document = JFactory::getDocument();
|
||||
$head_data = $document->getHeadData();
|
||||
foreach (array_keys($head_data['scripts']) as $script)
|
||||
{
|
||||
if (stristr($script, $script_name))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function css_loaded($script_name)
|
||||
{
|
||||
// UIkit check point
|
||||
if (strpos($script_name,'uikit') !== false)
|
||||
{
|
||||
$app = JFactory::getApplication();
|
||||
$getTemplateName = $app->getTemplate('template')->template;
|
||||
|
||||
if (strpos($getTemplateName,'yoo') !== false)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
$document = JFactory::getDocument();
|
||||
$head_data = $document->getHeadData();
|
||||
|
||||
foreach (array_keys($head_data['styleSheets']) as $script)
|
||||
{
|
||||
if (stristr($script, $script_name))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage headercheck.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
class questionsanswersHeaderCheck
|
||||
{
|
||||
function js_loaded($script_name)
|
||||
{
|
||||
// UIkit check point
|
||||
if (strpos($script_name,'uikit') !== false)
|
||||
{
|
||||
$app = JFactory::getApplication();
|
||||
$getTemplateName = $app->getTemplate('template')->template;
|
||||
|
||||
if (strpos($getTemplateName,'yoo') !== false)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
$document = JFactory::getDocument();
|
||||
$head_data = $document->getHeadData();
|
||||
foreach (array_keys($head_data['scripts']) as $script)
|
||||
{
|
||||
if (stristr($script, $script_name))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function css_loaded($script_name)
|
||||
{
|
||||
// UIkit check point
|
||||
if (strpos($script_name,'uikit') !== false)
|
||||
{
|
||||
$app = JFactory::getApplication();
|
||||
$getTemplateName = $app->getTemplate('template')->template;
|
||||
|
||||
if (strpos($getTemplateName,'yoo') !== false)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
$document = JFactory::getDocument();
|
||||
$head_data = $document->getHeadData();
|
||||
|
||||
foreach (array_keys($head_data['styleSheets']) as $script)
|
||||
{
|
||||
if (stristr($script, $script_name))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
@ -1,92 +1,92 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage batch_.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('JPATH_PLATFORM') or die;
|
||||
|
||||
/**
|
||||
* Utility class to render a list view batch selection options
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
abstract class JHtmlBatch_
|
||||
{
|
||||
/**
|
||||
* ListSelection
|
||||
*
|
||||
* @var array
|
||||
* @since 3.0
|
||||
*/
|
||||
protected static $ListSelection = array();
|
||||
|
||||
/**
|
||||
* Render the batch selection options.
|
||||
*
|
||||
* @return string The necessary HTML to display the batch selection options
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
public static function render()
|
||||
{
|
||||
// Collect display data
|
||||
$data = new stdClass;
|
||||
$data->ListSelection = static::getListSelection();
|
||||
|
||||
// Create a layout object and ask it to render the batch selection options
|
||||
$layout = new JLayoutFile('batchselection');
|
||||
$batchHtml = $layout->render($data);
|
||||
|
||||
return $batchHtml;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to add a list selection to the batch modal
|
||||
*
|
||||
* @param string $label Label for the menu item.
|
||||
* @param string $name Name for the filter. Also used as id.
|
||||
* @param string $options Options for the select field.
|
||||
* @param bool $noDefault Don't the label as the empty option
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
public static function addListSelection($label, $name, $options, $noDefault = false)
|
||||
{
|
||||
array_push(static::$ListSelection, array('label' => $label, 'name' => $name, 'options' => $options, 'noDefault' => $noDefault));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of all ListSelection
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
public static function getListSelection()
|
||||
{
|
||||
return static::$ListSelection;
|
||||
}
|
||||
}
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage batch_.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('JPATH_PLATFORM') or die;
|
||||
|
||||
/**
|
||||
* Utility class to render a list view batch selection options
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
abstract class JHtmlBatch_
|
||||
{
|
||||
/**
|
||||
* ListSelection
|
||||
*
|
||||
* @var array
|
||||
* @since 3.0
|
||||
*/
|
||||
protected static $ListSelection = array();
|
||||
|
||||
/**
|
||||
* Render the batch selection options.
|
||||
*
|
||||
* @return string The necessary HTML to display the batch selection options
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
public static function render()
|
||||
{
|
||||
// Collect display data
|
||||
$data = new stdClass;
|
||||
$data->ListSelection = static::getListSelection();
|
||||
|
||||
// Create a layout object and ask it to render the batch selection options
|
||||
$layout = new JLayoutFile('batchselection');
|
||||
$batchHtml = $layout->render($data);
|
||||
|
||||
return $batchHtml;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to add a list selection to the batch modal
|
||||
*
|
||||
* @param string $label Label for the menu item.
|
||||
* @param string $name Name for the filter. Also used as id.
|
||||
* @param string $options Options for the select field.
|
||||
* @param bool $noDefault Don't the label as the empty option
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
public static function addListSelection($label, $name, $options, $noDefault = false)
|
||||
{
|
||||
array_push(static::$ListSelection, array('label' => $label, 'name' => $name, 'options' => $options, 'noDefault' => $noDefault));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of all ListSelection
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
public static function getListSelection()
|
||||
{
|
||||
return static::$ListSelection;
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,62 +1,62 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage batchselection.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('JPATH_BASE') or die;
|
||||
|
||||
JHtmlBehavior::core();
|
||||
$divWrapper = range(1,120,2);
|
||||
$counter = 0;
|
||||
?>
|
||||
<?php if ($displayData->ListSelection) : ?>
|
||||
<div class="row-fluid">
|
||||
<?php foreach ($displayData->ListSelection as $ListSelection) : ?>
|
||||
<div class="control-group span6">
|
||||
<div class="controls">
|
||||
<label for="<?php echo $ListSelection['name']; ?>" class="element-invisible"><?php echo $ListSelection['label']; ?></label>
|
||||
<select name="<?php echo $ListSelection['name']; ?>" id="<?php echo $ListSelection['name']; ?>" class="span12 small">
|
||||
<?php if (!$ListSelection['noDefault']) : ?>
|
||||
<option value=""><?php echo $ListSelection['label']; ?></option>
|
||||
<?php endif; ?>
|
||||
<?php echo $ListSelection['options']; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (in_array($counter,$divWrapper)) : ?>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
<?php endif; ?>
|
||||
<?php $counter++; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<div class="control-group radio" id="batch-move-copy">
|
||||
<div class="controls">
|
||||
<label class="radio" id="batch[move_copy]c-lbl" for="batch[move_copy]c">
|
||||
<input type="radio" value="c" id="batch[move_copy]c" name="batch[move_copy]"><?php echo JText::_('Copy'); ?></label>
|
||||
<label class="radio" id="batch[move_copy]m-lbl" for="batch[move_copy]m">
|
||||
<input type="radio" checked="checked" value="m" id="batch[move_copy]m" name="batch[move_copy]"><?php echo JText::_('Update'); ?></label>
|
||||
</div>
|
||||
</div>
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage batchselection.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('JPATH_BASE') or die;
|
||||
|
||||
JHtmlBehavior::core();
|
||||
$divWrapper = range(1,120,2);
|
||||
$counter = 0;
|
||||
?>
|
||||
<?php if ($displayData->ListSelection) : ?>
|
||||
<div class="row-fluid">
|
||||
<?php foreach ($displayData->ListSelection as $ListSelection) : ?>
|
||||
<div class="control-group span6">
|
||||
<div class="controls">
|
||||
<label for="<?php echo $ListSelection['name']; ?>" class="element-invisible"><?php echo $ListSelection['label']; ?></label>
|
||||
<select name="<?php echo $ListSelection['name']; ?>" id="<?php echo $ListSelection['name']; ?>" class="span12 small">
|
||||
<?php if (!$ListSelection['noDefault']) : ?>
|
||||
<option value=""><?php echo $ListSelection['label']; ?></option>
|
||||
<?php endif; ?>
|
||||
<?php echo $ListSelection['options']; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (in_array($counter,$divWrapper)) : ?>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
<?php endif; ?>
|
||||
<?php $counter++; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<div class="control-group radio" id="batch-move-copy">
|
||||
<div class="controls">
|
||||
<label class="radio" id="batch[move_copy]c-lbl" for="batch[move_copy]c">
|
||||
<input type="radio" value="c" id="batch[move_copy]c" name="batch[move_copy]"><?php echo JText::_('Copy'); ?></label>
|
||||
<label class="radio" id="batch[move_copy]m-lbl" for="batch[move_copy]m">
|
||||
<input type="radio" checked="checked" value="m" id="batch[move_copy]m" name="batch[move_copy]"><?php echo JText::_('Update'); ?></label>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
@ -1,59 +1,59 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage details_above.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage details_above.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'title',
|
||||
'alias'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<div class="form-inline form-inline-header">
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
'alias'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<div class="form-inline form-inline-header">
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
@ -1,58 +1,58 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage details_fullwidth.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'content'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<div class="form-vertical">
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage details_fullwidth.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'content'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<div class="form-vertical">
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
@ -1,60 +1,60 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage details_left.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage details_left.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'target',
|
||||
'groups',
|
||||
'location',
|
||||
'admin_view',
|
||||
'site_view'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
'site_view'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
@ -1,58 +1,58 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage details_right.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage details_right.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'type',
|
||||
'url',
|
||||
'article'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
'article'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
@ -1,58 +1,58 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage details_under.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'not_required'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<div class="form-inline form-inline-header">
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage details_under.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'not_required'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<div class="form-inline form-inline-header">
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
@ -1,59 +1,59 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage publishing.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage publishing.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'created',
|
||||
'created_by',
|
||||
'modified',
|
||||
'modified_by'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
'modified_by'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
@ -1,60 +1,60 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage publlshing.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage publlshing.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'published',
|
||||
'ordering',
|
||||
'version',
|
||||
'hits',
|
||||
'id'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
'id'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
@ -1,61 +1,61 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage details_fullwidth.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage details_fullwidth.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'question',
|
||||
'main_image_uploader',
|
||||
'answer',
|
||||
'answer_documents_uploader'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<div class="form-vertical">
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
'answer_documents_uploader'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<div class="form-vertical">
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
@ -1,56 +1,56 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage details_rightside.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'catid'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage details_rightside.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'catid'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
@ -1,59 +1,59 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage details_under.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage details_under.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'main_image',
|
||||
'answer_documents'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<div class="form-inline form-inline-header">
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
'answer_documents'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<div class="form-inline form-inline-header">
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
@ -1,55 +1,55 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage metadata.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// JLayout for standard handling of metadata fields in the administrator content edit screens.
|
||||
$fieldSets = $form->getFieldsets('metadata');
|
||||
?>
|
||||
|
||||
<?php foreach ($fieldSets as $name => $fieldSet) : ?>
|
||||
<?php if (isset($fieldSet->description) && trim($fieldSet->description)) : ?>
|
||||
<p class="alert alert-info"><?php echo $this->escape(JText::_($fieldSet->description)); ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
// Include the real fields in this panel.
|
||||
if ($name == 'vdmmetadata')
|
||||
{
|
||||
echo $form->renderField('metadesc');
|
||||
echo $form->renderField('metakey');
|
||||
}
|
||||
|
||||
foreach ($form->getFieldset($name) as $field)
|
||||
{
|
||||
if ($field->name != 'jform[metadata][tags][]')
|
||||
{
|
||||
echo $field->renderField();
|
||||
}
|
||||
} ?>
|
||||
<?php endforeach; ?>
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage metadata.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// JLayout for standard handling of metadata fields in the administrator content edit screens.
|
||||
$fieldSets = $form->getFieldsets('metadata');
|
||||
?>
|
||||
|
||||
<?php foreach ($fieldSets as $name => $fieldSet) : ?>
|
||||
<?php if (isset($fieldSet->description) && trim($fieldSet->description)) : ?>
|
||||
<p class="alert alert-info"><?php echo $this->escape(JText::_($fieldSet->description)); ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
// Include the real fields in this panel.
|
||||
if ($name == 'vdmmetadata')
|
||||
{
|
||||
echo $form->renderField('metadesc');
|
||||
echo $form->renderField('metakey');
|
||||
}
|
||||
|
||||
foreach ($form->getFieldset($name) as $field)
|
||||
{
|
||||
if ($field->name != 'jform[metadata][tags][]')
|
||||
{
|
||||
echo $field->renderField();
|
||||
}
|
||||
} ?>
|
||||
<?php endforeach; ?>
|
||||
|
@ -1,45 +1,45 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage publishing.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage publishing.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'title',
|
||||
'created',
|
||||
'created_by',
|
||||
@ -50,17 +50,17 @@ $fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'access',
|
||||
'version',
|
||||
'hits',
|
||||
'id'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
'id'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
@ -1,33 +1,33 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage trashhelper.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage trashhelper.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('JPATH_BASE') or die('Restricted access');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
<?php if ($displayData->state->get('filter.published') == -2 && ($displayData->canState && $displayData->canDelete)) : ?>
|
||||
<script>
|
||||
@ -84,4 +84,4 @@ defined('JPATH_BASE') or die('Restricted access');
|
||||
<?= JText::_("COM_QUESTIONSANSWERS_EXIT_TRASH") ?>
|
||||
</button>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
@ -1,46 +1,46 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage ajax.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
|
||||
/**
|
||||
* Questionsanswers Ajax Model
|
||||
*/
|
||||
class QuestionsanswersModelAjax extends JModelList
|
||||
{
|
||||
protected $app_params;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
// get params
|
||||
$this->app_params = JComponentHelper::getParams('com_questionsanswers');
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage ajax.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
|
||||
/**
|
||||
* Questionsanswers Ajax Model
|
||||
*/
|
||||
class QuestionsanswersModelAjax extends JModelList
|
||||
{
|
||||
protected $app_params;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
// get params
|
||||
$this->app_params = JComponentHelper::getParams('com_questionsanswers');
|
||||
|
||||
}
|
||||
|
||||
// Used in question_and_answer
|
||||
@ -603,5 +603,5 @@ class QuestionsanswersModelAjax extends JModelList
|
||||
JFile::delete(JPath::clean($package));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,54 +1,54 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage adminviewfolderlist.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import the list field type
|
||||
jimport('joomla.form.helper');
|
||||
JFormHelper::loadFieldClass('list');
|
||||
|
||||
/**
|
||||
* Adminviewfolderlist Form Field class for the Questionsanswers component
|
||||
*/
|
||||
class JFormFieldAdminviewfolderlist extends JFormFieldList
|
||||
{
|
||||
/**
|
||||
* The adminviewfolderlist field type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'adminviewfolderlist';
|
||||
|
||||
/**
|
||||
* Method to get a list of options for a list input.
|
||||
*
|
||||
* @return array An array of JHtml options.
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage adminviewfolderlist.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import the list field type
|
||||
jimport('joomla.form.helper');
|
||||
JFormHelper::loadFieldClass('list');
|
||||
|
||||
/**
|
||||
* Adminviewfolderlist Form Field class for the Questionsanswers component
|
||||
*/
|
||||
class JFormFieldAdminviewfolderlist extends JFormFieldList
|
||||
{
|
||||
/**
|
||||
* The adminviewfolderlist field type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'adminviewfolderlist';
|
||||
|
||||
/**
|
||||
* Method to get a list of options for a list input.
|
||||
*
|
||||
* @return array An array of JHtml options.
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
// get custom folder files
|
||||
$localfolder = JPATH_COMPONENT_ADMINISTRATOR.'/views';
|
||||
// set the default
|
||||
@ -67,6 +67,6 @@ class JFormFieldAdminviewfolderlist extends JFormFieldList
|
||||
$options[] = JHtml::_('select.option', $folder, QuestionsanswersHelper::safeString($folder, 'W'));
|
||||
}
|
||||
}
|
||||
return $options;
|
||||
}
|
||||
}
|
||||
return $options;
|
||||
}
|
||||
}
|
||||
|
@ -1,54 +1,54 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage alloweddocumentformats.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import the list field type
|
||||
jimport('joomla.form.helper');
|
||||
JFormHelper::loadFieldClass('list');
|
||||
|
||||
/**
|
||||
* Alloweddocumentformats Form Field class for the Questionsanswers component
|
||||
*/
|
||||
class JFormFieldAlloweddocumentformats extends JFormFieldList
|
||||
{
|
||||
/**
|
||||
* The alloweddocumentformats field type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'alloweddocumentformats';
|
||||
|
||||
/**
|
||||
* Method to get a list of options for a list input.
|
||||
*
|
||||
* @return array An array of JHtml options.
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage alloweddocumentformats.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import the list field type
|
||||
jimport('joomla.form.helper');
|
||||
JFormHelper::loadFieldClass('list');
|
||||
|
||||
/**
|
||||
* Alloweddocumentformats Form Field class for the Questionsanswers component
|
||||
*/
|
||||
class JFormFieldAlloweddocumentformats extends JFormFieldList
|
||||
{
|
||||
/**
|
||||
* The alloweddocumentformats field type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'alloweddocumentformats';
|
||||
|
||||
/**
|
||||
* Method to get a list of options for a list input.
|
||||
*
|
||||
* @return array An array of JHtml options.
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
|
||||
// check if helper class already is set
|
||||
if (!class_exists('QuestionsanswersHelper'))
|
||||
@ -97,6 +97,6 @@ class JFormFieldAlloweddocumentformats extends JFormFieldList
|
||||
}
|
||||
}
|
||||
}
|
||||
return $options;
|
||||
}
|
||||
}
|
||||
return $options;
|
||||
}
|
||||
}
|
||||
|
@ -1,54 +1,54 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage allowedimageformats.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import the list field type
|
||||
jimport('joomla.form.helper');
|
||||
JFormHelper::loadFieldClass('list');
|
||||
|
||||
/**
|
||||
* Allowedimageformats Form Field class for the Questionsanswers component
|
||||
*/
|
||||
class JFormFieldAllowedimageformats extends JFormFieldList
|
||||
{
|
||||
/**
|
||||
* The allowedimageformats field type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'allowedimageformats';
|
||||
|
||||
/**
|
||||
* Method to get a list of options for a list input.
|
||||
*
|
||||
* @return array An array of JHtml options.
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage allowedimageformats.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import the list field type
|
||||
jimport('joomla.form.helper');
|
||||
JFormHelper::loadFieldClass('list');
|
||||
|
||||
/**
|
||||
* Allowedimageformats Form Field class for the Questionsanswers component
|
||||
*/
|
||||
class JFormFieldAllowedimageformats extends JFormFieldList
|
||||
{
|
||||
/**
|
||||
* The allowedimageformats field type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'allowedimageformats';
|
||||
|
||||
/**
|
||||
* Method to get a list of options for a list input.
|
||||
*
|
||||
* @return array An array of JHtml options.
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
|
||||
// check if helper class already is set
|
||||
if (!class_exists('QuestionsanswersHelper'))
|
||||
@ -97,6 +97,6 @@ class JFormFieldAllowedimageformats extends JFormFieldList
|
||||
}
|
||||
}
|
||||
}
|
||||
return $options;
|
||||
}
|
||||
}
|
||||
return $options;
|
||||
}
|
||||
}
|
||||
|
@ -1,54 +1,54 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage articles.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import the list field type
|
||||
jimport('joomla.form.helper');
|
||||
JFormHelper::loadFieldClass('list');
|
||||
|
||||
/**
|
||||
* Articles Form Field class for the Questionsanswers component
|
||||
*/
|
||||
class JFormFieldArticles extends JFormFieldList
|
||||
{
|
||||
/**
|
||||
* The articles field type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'articles';
|
||||
|
||||
/**
|
||||
* Method to get a list of options for a list input.
|
||||
*
|
||||
* @return array An array of JHtml options.
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage articles.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import the list field type
|
||||
jimport('joomla.form.helper');
|
||||
JFormHelper::loadFieldClass('list');
|
||||
|
||||
/**
|
||||
* Articles Form Field class for the Questionsanswers component
|
||||
*/
|
||||
class JFormFieldArticles extends JFormFieldList
|
||||
{
|
||||
/**
|
||||
* The articles field type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'articles';
|
||||
|
||||
/**
|
||||
* Method to get a list of options for a list input.
|
||||
*
|
||||
* @return array An array of JHtml options.
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
$db = JFactory::getDBO();
|
||||
$query = $db->getQuery(true);
|
||||
$query->select($db->quoteName(array('a.id','a.title','a.alias'),array('id','article_title','alias')));
|
||||
@ -66,6 +66,6 @@ class JFormFieldArticles extends JFormFieldList
|
||||
$options[] = JHtml::_('select.option', $item->id, $item->article_title . ' (' . $item->alias . ')');
|
||||
}
|
||||
}
|
||||
return $options;
|
||||
}
|
||||
}
|
||||
return $options;
|
||||
}
|
||||
}
|
||||
|
@ -1,54 +1,54 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage helpdocumentsfilterlocation.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import the list field type
|
||||
jimport('joomla.form.helper');
|
||||
JFormHelper::loadFieldClass('list');
|
||||
|
||||
/**
|
||||
* Helpdocumentsfilterlocation Form Field class for the Questionsanswers component
|
||||
*/
|
||||
class JFormFieldHelpdocumentsfilterlocation extends JFormFieldList
|
||||
{
|
||||
/**
|
||||
* The helpdocumentsfilterlocation field type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'helpdocumentsfilterlocation';
|
||||
|
||||
/**
|
||||
* Method to get a list of options for a list input.
|
||||
*
|
||||
* @return array An array of JHtml options.
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage helpdocumentsfilterlocation.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import the list field type
|
||||
jimport('joomla.form.helper');
|
||||
JFormHelper::loadFieldClass('list');
|
||||
|
||||
/**
|
||||
* Helpdocumentsfilterlocation Form Field class for the Questionsanswers component
|
||||
*/
|
||||
class JFormFieldHelpdocumentsfilterlocation extends JFormFieldList
|
||||
{
|
||||
/**
|
||||
* The helpdocumentsfilterlocation field type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'helpdocumentsfilterlocation';
|
||||
|
||||
/**
|
||||
* Method to get a list of options for a list input.
|
||||
*
|
||||
* @return array An array of JHtml options.
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
// Get a db connection.
|
||||
$db = JFactory::getDbo();
|
||||
|
||||
@ -80,6 +80,6 @@ class JFormFieldHelpdocumentsfilterlocation extends JFormFieldList
|
||||
$_filter[] = JHtml::_('select.option', $location, JText::_($text));
|
||||
}
|
||||
}
|
||||
return $_filter;
|
||||
}
|
||||
}
|
||||
return $_filter;
|
||||
}
|
||||
}
|
||||
|
@ -1,54 +1,54 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage helpdocumentsfiltertype.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import the list field type
|
||||
jimport('joomla.form.helper');
|
||||
JFormHelper::loadFieldClass('list');
|
||||
|
||||
/**
|
||||
* Helpdocumentsfiltertype Form Field class for the Questionsanswers component
|
||||
*/
|
||||
class JFormFieldHelpdocumentsfiltertype extends JFormFieldList
|
||||
{
|
||||
/**
|
||||
* The helpdocumentsfiltertype field type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'helpdocumentsfiltertype';
|
||||
|
||||
/**
|
||||
* Method to get a list of options for a list input.
|
||||
*
|
||||
* @return array An array of JHtml options.
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage helpdocumentsfiltertype.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import the list field type
|
||||
jimport('joomla.form.helper');
|
||||
JFormHelper::loadFieldClass('list');
|
||||
|
||||
/**
|
||||
* Helpdocumentsfiltertype Form Field class for the Questionsanswers component
|
||||
*/
|
||||
class JFormFieldHelpdocumentsfiltertype extends JFormFieldList
|
||||
{
|
||||
/**
|
||||
* The helpdocumentsfiltertype field type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'helpdocumentsfiltertype';
|
||||
|
||||
/**
|
||||
* Method to get a list of options for a list input.
|
||||
*
|
||||
* @return array An array of JHtml options.
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
// Get a db connection.
|
||||
$db = JFactory::getDbo();
|
||||
|
||||
@ -80,6 +80,6 @@ class JFormFieldHelpdocumentsfiltertype extends JFormFieldList
|
||||
$_filter[] = JHtml::_('select.option', $type, JText::_($text));
|
||||
}
|
||||
}
|
||||
return $_filter;
|
||||
}
|
||||
}
|
||||
return $_filter;
|
||||
}
|
||||
}
|
||||
|
@ -1,54 +1,54 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage siteviewfolderlist.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import the list field type
|
||||
jimport('joomla.form.helper');
|
||||
JFormHelper::loadFieldClass('list');
|
||||
|
||||
/**
|
||||
* Siteviewfolderlist Form Field class for the Questionsanswers component
|
||||
*/
|
||||
class JFormFieldSiteviewfolderlist extends JFormFieldList
|
||||
{
|
||||
/**
|
||||
* The siteviewfolderlist field type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'siteviewfolderlist';
|
||||
|
||||
/**
|
||||
* Method to get a list of options for a list input.
|
||||
*
|
||||
* @return array An array of JHtml options.
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage siteviewfolderlist.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import the list field type
|
||||
jimport('joomla.form.helper');
|
||||
JFormHelper::loadFieldClass('list');
|
||||
|
||||
/**
|
||||
* Siteviewfolderlist Form Field class for the Questionsanswers component
|
||||
*/
|
||||
class JFormFieldSiteviewfolderlist extends JFormFieldList
|
||||
{
|
||||
/**
|
||||
* The siteviewfolderlist field type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'siteviewfolderlist';
|
||||
|
||||
/**
|
||||
* Method to get a list of options for a list input.
|
||||
*
|
||||
* @return array An array of JHtml options.
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
// get custom folder files
|
||||
$localfolder = JPATH_COMPONENT_SITE.'/views';
|
||||
// set the default
|
||||
@ -67,6 +67,6 @@ class JFormFieldSiteviewfolderlist extends JFormFieldList
|
||||
$options[] = JHtml::_('select.option', $folder, QuestionsanswersHelper::safeString($folder, 'W'));
|
||||
}
|
||||
}
|
||||
return $options;
|
||||
}
|
||||
}
|
||||
return $options;
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<form
|
||||
addrulepath="/administrator/components/com_questionsanswers/models/rules"
|
||||
addfieldpath="/administrator/components/com_questionsanswers/models/fields"
|
||||
>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<form
|
||||
addrulepath="/administrator/components/com_questionsanswers/models/rules"
|
||||
addfieldpath="/administrator/components/com_questionsanswers/models/fields"
|
||||
>
|
||||
<fields name="filter">
|
||||
<field
|
||||
type="text"
|
||||
@ -50,8 +50,8 @@
|
||||
onchange="this.form.submit();"
|
||||
/>
|
||||
<input type="hidden" name="form_submited" value="1"/>
|
||||
</fields>
|
||||
|
||||
</fields>
|
||||
|
||||
<fields name="list">
|
||||
<field
|
||||
name="fullordering"
|
||||
@ -90,5 +90,5 @@
|
||||
default="25"
|
||||
onchange="this.form.submit();"
|
||||
/>
|
||||
</fields>
|
||||
</fields>
|
||||
</form>
|
@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<form
|
||||
addrulepath="/administrator/components/com_questionsanswers/models/rules"
|
||||
addfieldpath="/administrator/components/com_questionsanswers/models/fields"
|
||||
>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<form
|
||||
addrulepath="/administrator/components/com_questionsanswers/models/rules"
|
||||
addfieldpath="/administrator/components/com_questionsanswers/models/fields"
|
||||
>
|
||||
<fields name="filter">
|
||||
<field
|
||||
type="text"
|
||||
@ -42,8 +42,8 @@
|
||||
onchange="this.form.submit();"
|
||||
/>
|
||||
<input type="hidden" name="form_submited" value="1"/>
|
||||
</fields>
|
||||
|
||||
</fields>
|
||||
|
||||
<fields name="list">
|
||||
<field
|
||||
name="fullordering"
|
||||
@ -78,5 +78,5 @@
|
||||
default="25"
|
||||
onchange="this.form.submit();"
|
||||
/>
|
||||
</fields>
|
||||
</fields>
|
||||
</form>
|
@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<form
|
||||
addrulepath="/administrator/components/com_questionsanswers/models/rules"
|
||||
addfieldpath="/administrator/components/com_questionsanswers/models/fields"
|
||||
>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<form
|
||||
addrulepath="/administrator/components/com_questionsanswers/models/rules"
|
||||
addfieldpath="/administrator/components/com_questionsanswers/models/fields"
|
||||
>
|
||||
<fieldset name="details">
|
||||
<!-- Default Fields. -->
|
||||
<!-- Id Field. Type: Text (joomla) -->
|
||||
@ -228,8 +228,8 @@
|
||||
<option value="2">
|
||||
COM_QUESTIONSANSWERS_HELP_DOCUMENT_ALL</option>
|
||||
</field>
|
||||
</fieldset>
|
||||
|
||||
</fieldset>
|
||||
|
||||
<!-- Access Control Fields. -->
|
||||
<fieldset name="accesscontrol">
|
||||
<!-- Asset Id Field. Type: Hidden (joomla) -->
|
||||
@ -250,5 +250,5 @@
|
||||
component="com_questionsanswers"
|
||||
section="help_document"
|
||||
/>
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
</form>
|
@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<form
|
||||
addrulepath="/administrator/components/com_questionsanswers/models/rules"
|
||||
addfieldpath="/administrator/components/com_questionsanswers/models/fields"
|
||||
>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<form
|
||||
addrulepath="/administrator/components/com_questionsanswers/models/rules"
|
||||
addfieldpath="/administrator/components/com_questionsanswers/models/fields"
|
||||
>
|
||||
<fieldset name="details">
|
||||
<!-- Default Fields. -->
|
||||
<!-- Id Field. Type: Text (joomla) -->
|
||||
@ -192,8 +192,8 @@
|
||||
cols="30" rows="2"
|
||||
/>
|
||||
</fieldset>
|
||||
</fields>
|
||||
|
||||
</fields>
|
||||
|
||||
<!-- Access Control Fields. -->
|
||||
<fieldset name="accesscontrol">
|
||||
<!-- Asset Id Field. Type: Hidden (joomla) -->
|
||||
@ -214,5 +214,5 @@
|
||||
component="com_questionsanswers"
|
||||
section="question_and_answer"
|
||||
/>
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
</form>
|
@ -1,45 +1,45 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage help_document.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage help_document.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\Registry\Registry;
|
||||
use Joomla\String\StringHelper;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
|
||||
/**
|
||||
* Questionsanswers Help_document Model
|
||||
*/
|
||||
class QuestionsanswersModelHelp_document extends JModelAdmin
|
||||
{
|
||||
/**
|
||||
* The tab layout fields array.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
|
||||
/**
|
||||
* Questionsanswers Help_document Model
|
||||
*/
|
||||
class QuestionsanswersModelHelp_document extends JModelAdmin
|
||||
{
|
||||
/**
|
||||
* The tab layout fields array.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $tabLayoutFields = array(
|
||||
'details' => array(
|
||||
'left' => array(
|
||||
@ -65,100 +65,94 @@ class QuestionsanswersModelHelp_document extends JModelAdmin
|
||||
'not_required'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* @var string The prefix to use with controller messages.
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $text_prefix = 'COM_QUESTIONSANSWERS';
|
||||
|
||||
/**
|
||||
* The type alias for this content type.
|
||||
*
|
||||
* @var string
|
||||
* @since 3.2
|
||||
*/
|
||||
public $typeAlias = 'com_questionsanswers.help_document';
|
||||
|
||||
/**
|
||||
* Returns a Table object, always creating it
|
||||
*
|
||||
* @param type $type The table type to instantiate
|
||||
* @param string $prefix A prefix for the table class name. Optional.
|
||||
* @param array $config Configuration array for model. Optional.
|
||||
*
|
||||
* @return JTable A database object
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getTable($type = 'help_document', $prefix = 'QuestionsanswersTable', $config = array())
|
||||
{
|
||||
// add table path for when model gets used from other component
|
||||
$this->addTablePath(JPATH_ADMINISTRATOR . '/components/com_questionsanswers/tables');
|
||||
// get instance of the table
|
||||
return JTable::getInstance($type, $prefix, $config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get a single record.
|
||||
*
|
||||
* @param integer $pk The id of the primary key.
|
||||
*
|
||||
* @return mixed Object on success, false on failure.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getItem($pk = null)
|
||||
{
|
||||
if ($item = parent::getItem($pk))
|
||||
{
|
||||
if (!empty($item->params) && !is_array($item->params))
|
||||
{
|
||||
// Convert the params field to an array.
|
||||
$registry = new Registry;
|
||||
$registry->loadString($item->params);
|
||||
$item->params = $registry->toArray();
|
||||
}
|
||||
|
||||
if (!empty($item->metadata))
|
||||
{
|
||||
// Convert the metadata field to an array.
|
||||
$registry = new Registry;
|
||||
$registry->loadString($item->metadata);
|
||||
$item->metadata = $registry->toArray();
|
||||
);
|
||||
|
||||
/**
|
||||
* @var string The prefix to use with controller messages.
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $text_prefix = 'COM_QUESTIONSANSWERS';
|
||||
|
||||
/**
|
||||
* The type alias for this content type.
|
||||
*
|
||||
* @var string
|
||||
* @since 3.2
|
||||
*/
|
||||
public $typeAlias = 'com_questionsanswers.help_document';
|
||||
|
||||
/**
|
||||
* Returns a Table object, always creating it
|
||||
*
|
||||
* @param type $type The table type to instantiate
|
||||
* @param string $prefix A prefix for the table class name. Optional.
|
||||
* @param array $config Configuration array for model. Optional.
|
||||
*
|
||||
* @return JTable A database object
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getTable($type = 'help_document', $prefix = 'QuestionsanswersTable', $config = array())
|
||||
{
|
||||
// add table path for when model gets used from other component
|
||||
$this->addTablePath(JPATH_ADMINISTRATOR . '/components/com_questionsanswers/tables');
|
||||
// get instance of the table
|
||||
return JTable::getInstance($type, $prefix, $config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get a single record.
|
||||
*
|
||||
* @param integer $pk The id of the primary key.
|
||||
*
|
||||
* @return mixed Object on success, false on failure.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getItem($pk = null)
|
||||
{
|
||||
if ($item = parent::getItem($pk))
|
||||
{
|
||||
if (!empty($item->params) && !is_array($item->params))
|
||||
{
|
||||
// Convert the params field to an array.
|
||||
$registry = new Registry;
|
||||
$registry->loadString($item->params);
|
||||
$item->params = $registry->toArray();
|
||||
}
|
||||
|
||||
if (!empty($item->metadata))
|
||||
{
|
||||
// Convert the metadata field to an array.
|
||||
$registry = new Registry;
|
||||
$registry->loadString($item->metadata);
|
||||
$item->metadata = $registry->toArray();
|
||||
}
|
||||
|
||||
if (!empty($item->groups))
|
||||
{
|
||||
// JSON Decode groups.
|
||||
$item->groups = json_decode($item->groups,true);
|
||||
}
|
||||
|
||||
if (!empty($item->id))
|
||||
{
|
||||
$item->tags = new JHelperTags;
|
||||
$item->tags->getTagIds($item->id, 'com_questionsanswers.help_document');
|
||||
}
|
||||
}
|
||||
|
||||
return $item;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the record form.
|
||||
*
|
||||
* @param array $data Data for the form.
|
||||
* @param boolean $loadData True if the form is to load its own data (default case), false if not.
|
||||
* @param array $options Optional array of options for the form creation.
|
||||
*
|
||||
* @return mixed A JForm object on success, false on failure
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getForm($data = array(), $loadData = true, $options = array('control' => 'jform'))
|
||||
{
|
||||
// set load data option
|
||||
}
|
||||
}
|
||||
|
||||
return $item;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the record form.
|
||||
*
|
||||
* @param array $data Data for the form.
|
||||
* @param boolean $loadData True if the form is to load its own data (default case), false if not.
|
||||
* @param array $options Optional array of options for the form creation.
|
||||
*
|
||||
* @return mixed A JForm object on success, false on failure
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getForm($data = array(), $loadData = true, $options = array('control' => 'jform'))
|
||||
{
|
||||
// set load data option
|
||||
$options['load_data'] = $loadData;
|
||||
// check if xpath was set in options
|
||||
$xpath = false;
|
||||
@ -251,29 +245,29 @@ class QuestionsanswersModelHelp_document extends JModelAdmin
|
||||
$form->setValue($redirectedField, null, $redirectedValue);
|
||||
}
|
||||
}
|
||||
return $form;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the script that have to be included on the form
|
||||
*
|
||||
* @return string script files
|
||||
*/
|
||||
public function getScript()
|
||||
{
|
||||
return 'administrator/components/com_questionsanswers/models/forms/help_document.js';
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to test whether a record can be deleted.
|
||||
*
|
||||
* @param object $record A record object.
|
||||
*
|
||||
* @return boolean True if allowed to delete the record. Defaults to the permission set in the component.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function canDelete($record)
|
||||
return $form;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the script that have to be included on the form
|
||||
*
|
||||
* @return string script files
|
||||
*/
|
||||
public function getScript()
|
||||
{
|
||||
return 'media/com_questionsanswers/js/help_document.js';
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to test whether a record can be deleted.
|
||||
*
|
||||
* @param object $record A record object.
|
||||
*
|
||||
* @return boolean True if allowed to delete the record. Defaults to the permission set in the component.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function canDelete($record)
|
||||
{
|
||||
if (!empty($record->id))
|
||||
{
|
||||
@ -286,19 +280,19 @@ class QuestionsanswersModelHelp_document extends JModelAdmin
|
||||
// The record has been set. Check the record permissions.
|
||||
return $user->authorise('help_document.delete', 'com_questionsanswers.help_document.' . (int) $record->id);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to test whether a record can have its state edited.
|
||||
*
|
||||
* @param object $record A record object.
|
||||
*
|
||||
* @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function canEditState($record)
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to test whether a record can have its state edited.
|
||||
*
|
||||
* @param object $record A record object.
|
||||
*
|
||||
* @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function canEditState($record)
|
||||
{
|
||||
$user = JFactory::getUser();
|
||||
$recordId = (!empty($record->id)) ? $record->id : 0;
|
||||
@ -313,104 +307,104 @@ class QuestionsanswersModelHelp_document extends JModelAdmin
|
||||
}
|
||||
}
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
return $user->authorise('help_document.edit.state', 'com_questionsanswers');
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can edit an existing record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
* @param string $key The name of the key for the primary key.
|
||||
*
|
||||
* @return boolean
|
||||
* @since 2.5
|
||||
*/
|
||||
protected function allowEdit($data = array(), $key = 'id')
|
||||
return $user->authorise('help_document.edit.state', 'com_questionsanswers');
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can edit an existing record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
* @param string $key The name of the key for the primary key.
|
||||
*
|
||||
* @return boolean
|
||||
* @since 2.5
|
||||
*/
|
||||
protected function allowEdit($data = array(), $key = 'id')
|
||||
{
|
||||
// Check specific edit permission then general edit permission.
|
||||
$user = JFactory::getUser();
|
||||
|
||||
return $user->authorise('help_document.edit', 'com_questionsanswers.help_document.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('help_document.edit', 'com_questionsanswers');
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare and sanitise the table data prior to saving.
|
||||
*
|
||||
* @param JTable $table A JTable object.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function prepareTable($table)
|
||||
{
|
||||
$date = JFactory::getDate();
|
||||
$user = JFactory::getUser();
|
||||
|
||||
if (isset($table->name))
|
||||
{
|
||||
$table->name = htmlspecialchars_decode($table->name, ENT_QUOTES);
|
||||
}
|
||||
|
||||
if (isset($table->alias) && empty($table->alias))
|
||||
{
|
||||
$table->generateAlias();
|
||||
}
|
||||
|
||||
if (empty($table->id))
|
||||
{
|
||||
$table->created = $date->toSql();
|
||||
// set the user
|
||||
if ($table->created_by == 0 || empty($table->created_by))
|
||||
{
|
||||
$table->created_by = $user->id;
|
||||
}
|
||||
// Set ordering to the last item if not set
|
||||
if (empty($table->ordering))
|
||||
{
|
||||
$db = JFactory::getDbo();
|
||||
$query = $db->getQuery(true)
|
||||
->select('MAX(ordering)')
|
||||
->from($db->quoteName('#__questionsanswers_help_document'));
|
||||
$db->setQuery($query);
|
||||
$max = $db->loadResult();
|
||||
|
||||
$table->ordering = $max + 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$table->modified = $date->toSql();
|
||||
$table->modified_by = $user->id;
|
||||
}
|
||||
|
||||
if (!empty($table->id))
|
||||
{
|
||||
// Increment the items version number.
|
||||
$table->version++;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the data that should be injected in the form.
|
||||
*
|
||||
* @return mixed The data for the form.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function loadFormData()
|
||||
{
|
||||
// Check the session for previously entered form data.
|
||||
$data = JFactory::getApplication()->getUserState('com_questionsanswers.edit.help_document.data', array());
|
||||
|
||||
if (empty($data))
|
||||
{
|
||||
$data = $this->getItem();
|
||||
// run the perprocess of the data
|
||||
$this->preprocessData('com_questionsanswers.help_document', $data);
|
||||
}
|
||||
|
||||
return $data;
|
||||
return $user->authorise('help_document.edit', 'com_questionsanswers.help_document.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('help_document.edit', 'com_questionsanswers');
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare and sanitise the table data prior to saving.
|
||||
*
|
||||
* @param JTable $table A JTable object.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function prepareTable($table)
|
||||
{
|
||||
$date = JFactory::getDate();
|
||||
$user = JFactory::getUser();
|
||||
|
||||
if (isset($table->name))
|
||||
{
|
||||
$table->name = htmlspecialchars_decode($table->name, ENT_QUOTES);
|
||||
}
|
||||
|
||||
if (isset($table->alias) && empty($table->alias))
|
||||
{
|
||||
$table->generateAlias();
|
||||
}
|
||||
|
||||
if (empty($table->id))
|
||||
{
|
||||
$table->created = $date->toSql();
|
||||
// set the user
|
||||
if ($table->created_by == 0 || empty($table->created_by))
|
||||
{
|
||||
$table->created_by = $user->id;
|
||||
}
|
||||
// Set ordering to the last item if not set
|
||||
if (empty($table->ordering))
|
||||
{
|
||||
$db = JFactory::getDbo();
|
||||
$query = $db->getQuery(true)
|
||||
->select('MAX(ordering)')
|
||||
->from($db->quoteName('#__questionsanswers_help_document'));
|
||||
$db->setQuery($query);
|
||||
$max = $db->loadResult();
|
||||
|
||||
$table->ordering = $max + 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$table->modified = $date->toSql();
|
||||
$table->modified_by = $user->id;
|
||||
}
|
||||
|
||||
if (!empty($table->id))
|
||||
{
|
||||
// Increment the items version number.
|
||||
$table->version++;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the data that should be injected in the form.
|
||||
*
|
||||
* @return mixed The data for the form.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function loadFormData()
|
||||
{
|
||||
// Check the session for previously entered form data.
|
||||
$data = JFactory::getApplication()->getUserState('com_questionsanswers.edit.help_document.data', array());
|
||||
|
||||
if (empty($data))
|
||||
{
|
||||
$data = $this->getItem();
|
||||
// run the perprocess of the data
|
||||
$this->preprocessData('com_questionsanswers.help_document', $data);
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -459,141 +453,141 @@ class QuestionsanswersModelHelp_document extends JModelAdmin
|
||||
protected function getUniqueFields()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to delete one or more records.
|
||||
*
|
||||
* @param array &$pks An array of record primary keys.
|
||||
*
|
||||
* @return boolean True if successful, false if an error occurs.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function delete(&$pks)
|
||||
{
|
||||
if (!parent::delete($pks))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to change the published state of one or more records.
|
||||
*
|
||||
* @param array &$pks A list of the primary keys to change.
|
||||
* @param integer $value The value of the published state.
|
||||
*
|
||||
* @return boolean True on success.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function publish(&$pks, $value = 1)
|
||||
{
|
||||
if (!parent::publish($pks, $value))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to perform batch operations on an item or a set of items.
|
||||
*
|
||||
* @param array $commands An array of commands to perform.
|
||||
* @param array $pks An array of item ids.
|
||||
* @param array $contexts An array of item contexts.
|
||||
*
|
||||
* @return boolean Returns true on success, false on failure.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function batch($commands, $pks, $contexts)
|
||||
{
|
||||
// Sanitize ids.
|
||||
$pks = array_unique($pks);
|
||||
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(JText::_('JGLOBAL_NO_ITEM_SELECTED'));
|
||||
return false;
|
||||
}
|
||||
|
||||
$done = false;
|
||||
|
||||
// Set some needed variables.
|
||||
$this->user = JFactory::getUser();
|
||||
$this->table = $this->getTable();
|
||||
$this->tableClassName = get_class($this->table);
|
||||
$this->contentType = new JUcmType;
|
||||
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
|
||||
$this->canDo = QuestionsanswersHelper::getActions('help_document');
|
||||
$this->batchSet = true;
|
||||
|
||||
if (!$this->canDo->get('core.batch'))
|
||||
{
|
||||
$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->type == false)
|
||||
{
|
||||
$type = new JUcmType;
|
||||
$this->type = $type->getTypeByAlias($this->typeAlias);
|
||||
}
|
||||
|
||||
$this->tagsObserver = $this->table->getObserverOfClass('JTableObserverTags');
|
||||
|
||||
if (!empty($commands['move_copy']))
|
||||
{
|
||||
$cmd = 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(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Clear the cache
|
||||
$this->cleanCache();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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(JText::_('JGLOBAL_NO_ITEM_SELECTED'));
|
||||
return false;
|
||||
}
|
||||
|
||||
$done = false;
|
||||
|
||||
// Set some needed variables.
|
||||
$this->user = JFactory::getUser();
|
||||
$this->table = $this->getTable();
|
||||
$this->tableClassName = get_class($this->table);
|
||||
$this->contentType = new JUcmType;
|
||||
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
|
||||
$this->canDo = QuestionsanswersHelper::getActions('help_document');
|
||||
$this->batchSet = true;
|
||||
|
||||
if (!$this->canDo->get('core.batch'))
|
||||
{
|
||||
$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->type == false)
|
||||
{
|
||||
$type = new JUcmType;
|
||||
$this->type = $type->getTypeByAlias($this->typeAlias);
|
||||
}
|
||||
|
||||
$this->tagsObserver = $this->table->getObserverOfClass('JTableObserverTags');
|
||||
|
||||
if (!empty($commands['move_copy']))
|
||||
{
|
||||
$cmd = 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(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Clear the cache
|
||||
$this->cleanCache();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -840,44 +834,44 @@ class QuestionsanswersModelHelp_document extends JModelAdmin
|
||||
$this->cleanCache();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to save the form data.
|
||||
*
|
||||
* @param array $data The form data.
|
||||
*
|
||||
* @return boolean True on success.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function save($data)
|
||||
{
|
||||
$input = JFactory::getApplication()->input;
|
||||
$filter = JFilterInput::getInstance();
|
||||
|
||||
// set the metadata to the Item Data
|
||||
if (isset($data['metadata']) && isset($data['metadata']['author']))
|
||||
{
|
||||
$data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM');
|
||||
|
||||
$metadata = new JRegistry;
|
||||
$metadata->loadArray($data['metadata']);
|
||||
$data['metadata'] = (string) $metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to save the form data.
|
||||
*
|
||||
* @param array $data The form data.
|
||||
*
|
||||
* @return boolean True on success.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function save($data)
|
||||
{
|
||||
$input = JFactory::getApplication()->input;
|
||||
$filter = JFilterInput::getInstance();
|
||||
|
||||
// set the metadata to the Item Data
|
||||
if (isset($data['metadata']) && isset($data['metadata']['author']))
|
||||
{
|
||||
$data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM');
|
||||
|
||||
$metadata = new JRegistry;
|
||||
$metadata->loadArray($data['metadata']);
|
||||
$data['metadata'] = (string) $metadata;
|
||||
}
|
||||
|
||||
// Set the groups string to JSON string.
|
||||
if (isset($data['groups']))
|
||||
{
|
||||
$data['groups'] = (string) json_encode($data['groups']);
|
||||
}
|
||||
|
||||
// Set the Params Items to data
|
||||
if (isset($data['params']) && is_array($data['params']))
|
||||
{
|
||||
$params = new JRegistry;
|
||||
$params->loadArray($data['params']);
|
||||
$data['params'] = (string) $params;
|
||||
}
|
||||
|
||||
// Set the Params Items to data
|
||||
if (isset($data['params']) && is_array($data['params']))
|
||||
{
|
||||
$params = new JRegistry;
|
||||
$params->loadArray($data['params']);
|
||||
$data['params'] = (string) $params;
|
||||
}
|
||||
|
||||
// Alter the title for save as copy
|
||||
@ -945,37 +939,37 @@ class QuestionsanswersModelHelp_document extends JModelAdmin
|
||||
$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(array($field => $value)))
|
||||
{
|
||||
$value = StringHelper::increment($value);
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
if (parent::save($data))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to generate a unique value.
|
||||
*
|
||||
* @param string $field name.
|
||||
* @param string $value data.
|
||||
*
|
||||
* @return string New value.
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
protected function generateUnique($field,$value)
|
||||
{
|
||||
|
||||
// set field value unique
|
||||
$table = $this->getTable();
|
||||
|
||||
while ($table->load(array($field => $value)))
|
||||
{
|
||||
$value = StringHelper::increment($value);
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1023,5 +1017,5 @@ class QuestionsanswersModelHelp_document extends JModelAdmin
|
||||
}
|
||||
// We only had an alias
|
||||
return $alias;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,43 +1,43 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage help_documents.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
|
||||
/**
|
||||
* Help_documents Model
|
||||
*/
|
||||
class QuestionsanswersModelHelp_documents extends JModelList
|
||||
{
|
||||
public function __construct($config = array())
|
||||
{
|
||||
if (empty($config['filter_fields']))
|
||||
{
|
||||
$config['filter_fields'] = array(
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage help_documents.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
|
||||
/**
|
||||
* Help_documents Model
|
||||
*/
|
||||
class QuestionsanswersModelHelp_documents extends JModelList
|
||||
{
|
||||
public function __construct($config = array())
|
||||
{
|
||||
if (empty($config['filter_fields']))
|
||||
{
|
||||
$config['filter_fields'] = array(
|
||||
'a.id','id',
|
||||
'a.published','published',
|
||||
'a.ordering','ordering',
|
||||
@ -47,32 +47,32 @@ class QuestionsanswersModelHelp_documents extends JModelList
|
||||
'a.location','location',
|
||||
'a.admin_view','admin_view',
|
||||
'a.site_view','site_view',
|
||||
'a.title','title'
|
||||
);
|
||||
}
|
||||
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
protected function populateState($ordering = null, $direction = null)
|
||||
{
|
||||
$app = JFactory::getApplication();
|
||||
|
||||
// Adjust the context to support modal layouts.
|
||||
if ($layout = $app->input->get('layout'))
|
||||
{
|
||||
$this->context .= '.' . $layout;
|
||||
'a.title','title'
|
||||
);
|
||||
}
|
||||
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
protected function populateState($ordering = null, $direction = null)
|
||||
{
|
||||
$app = JFactory::getApplication();
|
||||
|
||||
// Adjust the context to support modal layouts.
|
||||
if ($layout = $app->input->get('layout'))
|
||||
{
|
||||
$this->context .= '.' . $layout;
|
||||
}
|
||||
|
||||
// Check if the form was submitted
|
||||
@ -133,23 +133,23 @@ class QuestionsanswersModelHelp_documents extends JModelList
|
||||
{
|
||||
$title = $app->input->post->get('title');
|
||||
$this->setState('filter.title', $title);
|
||||
}
|
||||
|
||||
// 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.
|
||||
*/
|
||||
public function getItems()
|
||||
}
|
||||
|
||||
// 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.
|
||||
*/
|
||||
public function getItems()
|
||||
{
|
||||
// check in items
|
||||
// Check in items
|
||||
$this->checkInNow();
|
||||
|
||||
// load parent items
|
||||
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// Set values to display correctly.
|
||||
@ -195,10 +195,10 @@ class QuestionsanswersModelHelp_documents extends JModelList
|
||||
$item->location = $this->selectionTranslation($item->location, 'location');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// return items
|
||||
return $items;
|
||||
|
||||
|
||||
// return items
|
||||
return $items;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -237,15 +237,15 @@ class QuestionsanswersModelHelp_documents extends JModelList
|
||||
}
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to build an SQL query to load the list data.
|
||||
*
|
||||
* @return string An SQL query
|
||||
*/
|
||||
protected function getListQuery()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to build an SQL query to load the list data.
|
||||
*
|
||||
* @return string An SQL query
|
||||
*/
|
||||
protected function getListQuery()
|
||||
{
|
||||
// Get the user object.
|
||||
$user = JFactory::getUser();
|
||||
// Create a new query object.
|
||||
@ -360,7 +360,7 @@ class QuestionsanswersModelHelp_documents extends JModelList
|
||||
$query->order($db->escape($orderCol . ' ' . $orderDirn));
|
||||
}
|
||||
|
||||
return $query;
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -477,16 +477,16 @@ class QuestionsanswersModelHelp_documents extends JModelList
|
||||
return $headers;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get a store id based on model configuration state.
|
||||
*
|
||||
* @return string A store id.
|
||||
*
|
||||
*/
|
||||
protected function getStoreId($id = '')
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get a store id based on model configuration state.
|
||||
*
|
||||
* @return string A store id.
|
||||
*
|
||||
*/
|
||||
protected function getStoreId($id = '')
|
||||
{
|
||||
// Compile the store id.
|
||||
$id .= ':' . $this->getState('filter.id');
|
||||
$id .= ':' . $this->getState('filter.search');
|
||||
@ -498,9 +498,9 @@ class QuestionsanswersModelHelp_documents extends JModelList
|
||||
$id .= ':' . $this->getState('filter.location');
|
||||
$id .= ':' . $this->getState('filter.admin_view');
|
||||
$id .= ':' . $this->getState('filter.site_view');
|
||||
$id .= ':' . $this->getState('filter.title');
|
||||
|
||||
return parent::getStoreId($id);
|
||||
$id .= ':' . $this->getState('filter.title');
|
||||
|
||||
return parent::getStoreId($id);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -519,17 +519,19 @@ class QuestionsanswersModelHelp_documents extends JModelList
|
||||
|
||||
// Get a db connection.
|
||||
$db = JFactory::getDbo();
|
||||
// reset query
|
||||
// Reset query.
|
||||
$query = $db->getQuery(true);
|
||||
$query->select('*');
|
||||
$query->from($db->quoteName('#__questionsanswers_help_document'));
|
||||
$db->setQuery($query);
|
||||
// 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
|
||||
// Get Yesterdays date.
|
||||
$date = JFactory::getDate()->modify($time)->toSql();
|
||||
// reset query
|
||||
// Reset query.
|
||||
$query = $db->getQuery(true);
|
||||
|
||||
// Fields to update.
|
||||
@ -544,7 +546,7 @@ class QuestionsanswersModelHelp_documents extends JModelList
|
||||
$db->quoteName('checked_out_time') . '<\''.$date.'\''
|
||||
);
|
||||
|
||||
// Check table
|
||||
// Check table.
|
||||
$query->update($db->quoteName('#__questionsanswers_help_document'))->set($fields)->where($conditions);
|
||||
|
||||
$db->setQuery($query);
|
||||
@ -554,5 +556,5 @@ class QuestionsanswersModelHelp_documents extends JModelList
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,377 +1,379 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage import.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
use PhpOffice\PhpSpreadsheet\IOFactory;
|
||||
|
||||
/**
|
||||
* Questionsanswers Import Model
|
||||
*/
|
||||
class QuestionsanswersModelImport extends JModelLegacy
|
||||
{
|
||||
// set uploading values
|
||||
protected $use_streams = false;
|
||||
protected $allow_unsafe = false;
|
||||
protected $safeFileOptions = array();
|
||||
|
||||
/**
|
||||
* @var object JTable object
|
||||
*/
|
||||
protected $_table = null;
|
||||
|
||||
/**
|
||||
* @var object JTable object
|
||||
*/
|
||||
protected $_url = null;
|
||||
|
||||
/**
|
||||
* Model context string.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_context = 'com_questionsanswers.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 = JFactory::getApplication('administrator');
|
||||
|
||||
$this->setState('message', $app->getUserState('com_questionsanswers.message'));
|
||||
$app->setUserState('com_questionsanswers.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 = JFactory::getApplication();
|
||||
$session = JFactory::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_questionsanswers.message', JText::_('COM_QUESTIONSANSWERS_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_questionsanswers.message', JText::_('COM_QUESTIONSANSWERS_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 = JText::_('COM_QUESTIONSANSWERS_IMPORT_ERROR');
|
||||
$back = $session->get('backto_VDM_IMPORT', NULL);
|
||||
if ($back)
|
||||
{
|
||||
$app->setUserState('com_questionsanswers.redirect_url', 'index.php?option=com_questionsanswers&view='.$back);
|
||||
$session->clear('backto_VDM_IMPORT');
|
||||
}
|
||||
$result = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Package imported sucessfully
|
||||
$msg = JText::sprintf('COM_QUESTIONSANSWERS_IMPORT_SUCCESS', $package['packagename']);
|
||||
$back = $session->get('backto_VDM_IMPORT', NULL);
|
||||
if ($back)
|
||||
{
|
||||
$app->setUserState('com_questionsanswers.redirect_url', 'index.php?option=com_questionsanswers&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 = JFactory::getApplication();
|
||||
$input = $app->input;
|
||||
|
||||
// Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get.
|
||||
$userfile = $input->files->get('import_package', null, 'raw');
|
||||
|
||||
// Make sure that file uploads are enabled in php
|
||||
if (!(bool) ini_get('file_uploads'))
|
||||
{
|
||||
$app->enqueueMessage(JText::_('COM_QUESTIONSANSWERS_IMPORT_MSG_WARNIMPORTFILE'), 'warning');
|
||||
return false;
|
||||
}
|
||||
|
||||
// If there is no uploaded file, we have a problem...
|
||||
if (!is_array($userfile))
|
||||
{
|
||||
$app->enqueueMessage(JText::_('COM_QUESTIONSANSWERS_IMPORT_MSG_NO_FILE_SELECTED'), 'warning');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if there was a problem uploading the file.
|
||||
if ($userfile['error'] || $userfile['size'] < 1)
|
||||
{
|
||||
$app->enqueueMessage(JText::_('COM_QUESTIONSANSWERS_IMPORT_MSG_WARNIMPORTUPLOADERROR'), 'warning');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Build the appropriate paths
|
||||
$config = JFactory::getConfig();
|
||||
$tmp_dest = $config->get('tmp_path') . '/' . $userfile['name'];
|
||||
$tmp_src = $userfile['tmp_name'];
|
||||
|
||||
// Move uploaded file
|
||||
jimport('joomla.filesystem.file');
|
||||
$p_file = JFile::upload($tmp_src, $tmp_dest, $this->use_streams, $this->allow_unsafe, $this->safeFileOptions);
|
||||
|
||||
// Was the package downloaded?
|
||||
if (!$p_file)
|
||||
{
|
||||
$session = JFactory::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 = JFactory::getApplication();
|
||||
$input = $app->input;
|
||||
|
||||
// Get the path to the package to import
|
||||
$p_dir = $input->getString('import_directory');
|
||||
$p_dir = JPath::clean($p_dir);
|
||||
// Did you give us a valid path?
|
||||
if (!file_exists($p_dir))
|
||||
{
|
||||
$app->enqueueMessage(JText::_('COM_QUESTIONSANSWERS_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(JText::_('COM_QUESTIONSANSWERS_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'), 'warning');
|
||||
}
|
||||
|
||||
// check the extention
|
||||
if(!$this->checkExtension($p_dir))
|
||||
{
|
||||
// set error message
|
||||
$app->enqueueMessage(JText::_('COM_QUESTIONSANSWERS_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 = JFactory::getApplication();
|
||||
$input = $app->input;
|
||||
|
||||
// Get the URL of the package to import
|
||||
$url = $input->getString('import_url');
|
||||
|
||||
// Did you give us a URL?
|
||||
if (!$url)
|
||||
{
|
||||
$app->enqueueMessage(JText::_('COM_QUESTIONSANSWERS_IMPORT_MSG_ENTER_A_URL'), 'warning');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Download the package at the URL given
|
||||
$p_file = JInstallerHelper::downloadPackage($url);
|
||||
|
||||
// Was the package downloaded?
|
||||
if (!$p_file)
|
||||
{
|
||||
$app->enqueueMessage(JText::_('COM_QUESTIONSANSWERS_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 = JFactory::getApplication();
|
||||
// Clean the name
|
||||
$archivename = JPath::clean($archivename);
|
||||
|
||||
// check the extention
|
||||
if(!$this->checkExtension($archivename))
|
||||
{
|
||||
// Cleanup the import files
|
||||
$this->remove($archivename);
|
||||
$app->enqueueMessage(JText::_('COM_QUESTIONSANSWERS_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning');
|
||||
return false;
|
||||
}
|
||||
|
||||
$config = JFactory::getConfig();
|
||||
// set Package Name
|
||||
$check['packagename'] = $archivename;
|
||||
|
||||
// set directory
|
||||
$check['dir'] = $config->get('tmp_path'). '/' .$archivename;
|
||||
|
||||
// set type
|
||||
$check['type'] = $this->getType;
|
||||
|
||||
return $check;
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage import.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\CMS\Filesystem\File;
|
||||
use Joomla\CMS\Filesystem\Folder;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
use PhpOffice\PhpSpreadsheet\IOFactory;
|
||||
|
||||
/**
|
||||
* Questionsanswers Import Model
|
||||
*/
|
||||
class QuestionsanswersModelImport extends JModelLegacy
|
||||
{
|
||||
// set uploading values
|
||||
protected $use_streams = false;
|
||||
protected $allow_unsafe = false;
|
||||
protected $safeFileOptions = array();
|
||||
|
||||
/**
|
||||
* @var object JTable object
|
||||
*/
|
||||
protected $_table = null;
|
||||
|
||||
/**
|
||||
* @var object JTable object
|
||||
*/
|
||||
protected $_url = null;
|
||||
|
||||
/**
|
||||
* Model context string.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_context = 'com_questionsanswers.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 = JFactory::getApplication('administrator');
|
||||
|
||||
$this->setState('message', $app->getUserState('com_questionsanswers.message'));
|
||||
$app->setUserState('com_questionsanswers.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 = JFactory::getApplication();
|
||||
$session = JFactory::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_questionsanswers.message', JText::_('COM_QUESTIONSANSWERS_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_questionsanswers.message', JText::_('COM_QUESTIONSANSWERS_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 = JText::_('COM_QUESTIONSANSWERS_IMPORT_ERROR');
|
||||
$back = $session->get('backto_VDM_IMPORT', NULL);
|
||||
if ($back)
|
||||
{
|
||||
$app->setUserState('com_questionsanswers.redirect_url', 'index.php?option=com_questionsanswers&view='.$back);
|
||||
$session->clear('backto_VDM_IMPORT');
|
||||
}
|
||||
$result = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Package imported sucessfully
|
||||
$msg = JText::sprintf('COM_QUESTIONSANSWERS_IMPORT_SUCCESS', $package['packagename']);
|
||||
$back = $session->get('backto_VDM_IMPORT', NULL);
|
||||
if ($back)
|
||||
{
|
||||
$app->setUserState('com_questionsanswers.redirect_url', 'index.php?option=com_questionsanswers&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 = JFactory::getApplication();
|
||||
$input = $app->input;
|
||||
|
||||
// Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get.
|
||||
$userfile = $input->files->get('import_package', null, 'raw');
|
||||
|
||||
// Make sure that file uploads are enabled in php
|
||||
if (!(bool) ini_get('file_uploads'))
|
||||
{
|
||||
$app->enqueueMessage(JText::_('COM_QUESTIONSANSWERS_IMPORT_MSG_WARNIMPORTFILE'), 'warning');
|
||||
return false;
|
||||
}
|
||||
|
||||
// If there is no uploaded file, we have a problem...
|
||||
if (!is_array($userfile))
|
||||
{
|
||||
$app->enqueueMessage(JText::_('COM_QUESTIONSANSWERS_IMPORT_MSG_NO_FILE_SELECTED'), 'warning');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if there was a problem uploading the file.
|
||||
if ($userfile['error'] || $userfile['size'] < 1)
|
||||
{
|
||||
$app->enqueueMessage(JText::_('COM_QUESTIONSANSWERS_IMPORT_MSG_WARNIMPORTUPLOADERROR'), 'warning');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Build the appropriate paths
|
||||
$config = JFactory::getConfig();
|
||||
$tmp_dest = $config->get('tmp_path') . '/' . $userfile['name'];
|
||||
$tmp_src = $userfile['tmp_name'];
|
||||
|
||||
// Move uploaded file
|
||||
jimport('joomla.filesystem.file');
|
||||
$p_file = File::upload($tmp_src, $tmp_dest, $this->use_streams, $this->allow_unsafe, $this->safeFileOptions);
|
||||
|
||||
// Was the package downloaded?
|
||||
if (!$p_file)
|
||||
{
|
||||
$session = JFactory::getSession();
|
||||
$session->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 = JFactory::getApplication();
|
||||
$input = $app->input;
|
||||
|
||||
// Get the path to the package to import
|
||||
$p_dir = $input->getString('import_directory');
|
||||
$p_dir = JPath::clean($p_dir);
|
||||
// Did you give us a valid path?
|
||||
if (!file_exists($p_dir))
|
||||
{
|
||||
$app->enqueueMessage(JText::_('COM_QUESTIONSANSWERS_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(JText::_('COM_QUESTIONSANSWERS_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'), 'warning');
|
||||
}
|
||||
|
||||
// check the extention
|
||||
if(!$this->checkExtension($p_dir))
|
||||
{
|
||||
// set error message
|
||||
$app->enqueueMessage(JText::_('COM_QUESTIONSANSWERS_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 = JFactory::getApplication();
|
||||
$input = $app->input;
|
||||
|
||||
// Get the URL of the package to import
|
||||
$url = $input->getString('import_url');
|
||||
|
||||
// Did you give us a URL?
|
||||
if (!$url)
|
||||
{
|
||||
$app->enqueueMessage(JText::_('COM_QUESTIONSANSWERS_IMPORT_MSG_ENTER_A_URL'), 'warning');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Download the package at the URL given
|
||||
$p_file = JInstallerHelper::downloadPackage($url);
|
||||
|
||||
// Was the package downloaded?
|
||||
if (!$p_file)
|
||||
{
|
||||
$app->enqueueMessage(JText::_('COM_QUESTIONSANSWERS_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 = JFactory::getApplication();
|
||||
// Clean the name
|
||||
$archivename = JPath::clean($archivename);
|
||||
|
||||
// check the extention
|
||||
if(!$this->checkExtension($archivename))
|
||||
{
|
||||
// Cleanup the import files
|
||||
$this->remove($archivename);
|
||||
$app->enqueueMessage(JText::_('COM_QUESTIONSANSWERS_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning');
|
||||
return false;
|
||||
}
|
||||
|
||||
$config = JFactory::getConfig();
|
||||
// set Package Name
|
||||
$check['packagename'] = $archivename;
|
||||
|
||||
// set directory
|
||||
$check['dir'] = $config->get('tmp_path'). '/' .$archivename;
|
||||
|
||||
// set type
|
||||
$check['type'] = $this->getType;
|
||||
|
||||
return $check;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -394,33 +396,33 @@ class QuestionsanswersModelImport extends JModelLegacy
|
||||
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 = JFactory::getConfig();
|
||||
$package = $config->get('tmp_path'). '/' .$package;
|
||||
|
||||
// Is the package file a valid file?
|
||||
if (is_file($package))
|
||||
{
|
||||
JFile::delete($package);
|
||||
}
|
||||
elseif (is_file(JPath::clean($package)))
|
||||
{
|
||||
// It might also be just a base filename
|
||||
JFile::delete(JPath::clean($package));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 = JFactory::getConfig();
|
||||
$package = $config->get('tmp_path'). '/' .$package;
|
||||
|
||||
// Is the package file a valid file?
|
||||
if (is_file($package))
|
||||
{
|
||||
File::delete($package);
|
||||
}
|
||||
elseif (is_file(JPath::clean($package)))
|
||||
{
|
||||
// It might also be just a base filename
|
||||
File::delete(JPath::clean($package));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -684,70 +686,70 @@ class QuestionsanswersModelImport extends JModelLegacy
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function getAlias($name,$type = false)
|
||||
{
|
||||
// sanitize the name to an alias
|
||||
if (JFactory::getConfig()->get('unicodeslugs') == 1)
|
||||
{
|
||||
$alias = JFilterOutput::stringURLUnicodeSlug($name);
|
||||
}
|
||||
else
|
||||
{
|
||||
$alias = JFilterOutput::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 = JString::increment($value, 'dash');
|
||||
}
|
||||
$this->uniqeValueArray[$type][$field][$value] = $value;
|
||||
return $value;
|
||||
}
|
||||
|
||||
protected function getAliasesUsed($table)
|
||||
{
|
||||
// Get a db connection.
|
||||
$db = JFactory::getDbo();
|
||||
// first we check if there is a alias column
|
||||
$columns = $db->getTableColumns('#__questionsanswers_'.$table);
|
||||
if(isset($columns['alias'])){
|
||||
// Create a new query object.
|
||||
$query = $db->getQuery(true);
|
||||
$query->select($db->quoteName(array('alias')));
|
||||
$query->from($db->quoteName('#__questionsanswers_'.$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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function getAlias($name,$type = false)
|
||||
{
|
||||
// sanitize the name to an alias
|
||||
if (JFactory::getConfig()->get('unicodeslugs') == 1)
|
||||
{
|
||||
$alias = JFilterOutput::stringURLUnicodeSlug($name);
|
||||
}
|
||||
else
|
||||
{
|
||||
$alias = JFilterOutput::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 = JString::increment($value, 'dash');
|
||||
}
|
||||
$this->uniqeValueArray[$type][$field][$value] = $value;
|
||||
return $value;
|
||||
}
|
||||
|
||||
protected function getAliasesUsed($table)
|
||||
{
|
||||
// Get a db connection.
|
||||
$db = JFactory::getDbo();
|
||||
// first we check if there is a alias column
|
||||
$columns = $db->getTableColumns('#__questionsanswers_'.$table);
|
||||
if(isset($columns['alias'])){
|
||||
// Create a new query object.
|
||||
$query = $db->getQuery(true);
|
||||
$query->select($db->quoteName(array('alias')));
|
||||
$query->from($db->quoteName('#__questionsanswers_'.$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;
|
||||
}
|
||||
}
|
||||
|
@ -1,45 +1,45 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage question_and_answer.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage question_and_answer.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\Registry\Registry;
|
||||
use Joomla\String\StringHelper;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
|
||||
/**
|
||||
* Questionsanswers Question_and_answer Model
|
||||
*/
|
||||
class QuestionsanswersModelQuestion_and_answer extends JModelAdmin
|
||||
{
|
||||
/**
|
||||
* The tab layout fields array.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
|
||||
/**
|
||||
* Questionsanswers Question_and_answer Model
|
||||
*/
|
||||
class QuestionsanswersModelQuestion_and_answer extends JModelAdmin
|
||||
{
|
||||
/**
|
||||
* The tab layout fields array.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $tabLayoutFields = array(
|
||||
'details' => array(
|
||||
'fullwidth' => array(
|
||||
@ -56,39 +56,39 @@ class QuestionsanswersModelQuestion_and_answer extends JModelAdmin
|
||||
'catid'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* @var string The prefix to use with controller messages.
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $text_prefix = 'COM_QUESTIONSANSWERS';
|
||||
|
||||
/**
|
||||
* The type alias for this content type.
|
||||
*
|
||||
* @var string
|
||||
* @since 3.2
|
||||
*/
|
||||
public $typeAlias = 'com_questionsanswers.question_and_answer';
|
||||
|
||||
/**
|
||||
* Returns a Table object, always creating it
|
||||
*
|
||||
* @param type $type The table type to instantiate
|
||||
* @param string $prefix A prefix for the table class name. Optional.
|
||||
* @param array $config Configuration array for model. Optional.
|
||||
*
|
||||
* @return JTable A database object
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getTable($type = 'question_and_answer', $prefix = 'QuestionsanswersTable', $config = array())
|
||||
{
|
||||
// add table path for when model gets used from other component
|
||||
$this->addTablePath(JPATH_ADMINISTRATOR . '/components/com_questionsanswers/tables');
|
||||
// get instance of the table
|
||||
return JTable::getInstance($type, $prefix, $config);
|
||||
);
|
||||
|
||||
/**
|
||||
* @var string The prefix to use with controller messages.
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $text_prefix = 'COM_QUESTIONSANSWERS';
|
||||
|
||||
/**
|
||||
* The type alias for this content type.
|
||||
*
|
||||
* @var string
|
||||
* @since 3.2
|
||||
*/
|
||||
public $typeAlias = 'com_questionsanswers.question_and_answer';
|
||||
|
||||
/**
|
||||
* Returns a Table object, always creating it
|
||||
*
|
||||
* @param type $type The table type to instantiate
|
||||
* @param string $prefix A prefix for the table class name. Optional.
|
||||
* @param array $config Configuration array for model. Optional.
|
||||
*
|
||||
* @return JTable A database object
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getTable($type = 'question_and_answer', $prefix = 'QuestionsanswersTable', $config = array())
|
||||
{
|
||||
// add table path for when model gets used from other component
|
||||
$this->addTablePath(JPATH_ADMINISTRATOR . '/components/com_questionsanswers/tables');
|
||||
// get instance of the table
|
||||
return JTable::getInstance($type, $prefix, $config);
|
||||
}
|
||||
|
||||
|
||||
@ -138,35 +138,35 @@ class QuestionsanswersModelQuestion_and_answer extends JModelAdmin
|
||||
}
|
||||
return $this->vastDevMod;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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();
|
||||
|
||||
|
||||
/**
|
||||
* 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();
|
||||
}
|
||||
|
||||
// Get the basic encryption.
|
||||
@ -250,32 +250,26 @@ class QuestionsanswersModelQuestion_and_answer extends JModelAdmin
|
||||
$item->links[$document] = 'index.php?option=com_questionsanswers&task=download.document&file=' . $localFile . $linkToken;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($item->id))
|
||||
{
|
||||
$item->tags = new JHelperTags;
|
||||
$item->tags->getTagIds($item->id, 'com_questionsanswers.question_and_answer');
|
||||
}
|
||||
}
|
||||
|
||||
return $item;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the record form.
|
||||
*
|
||||
* @param array $data Data for the form.
|
||||
* @param boolean $loadData True if the form is to load its own data (default case), false if not.
|
||||
* @param array $options Optional array of options for the form creation.
|
||||
*
|
||||
* @return mixed A JForm object on success, false on failure
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getForm($data = array(), $loadData = true, $options = array('control' => 'jform'))
|
||||
{
|
||||
// set load data option
|
||||
}
|
||||
}
|
||||
|
||||
return $item;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the record form.
|
||||
*
|
||||
* @param array $data Data for the form.
|
||||
* @param boolean $loadData True if the form is to load its own data (default case), false if not.
|
||||
* @param array $options Optional array of options for the form creation.
|
||||
*
|
||||
* @return mixed A JForm object on success, false on failure
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getForm($data = array(), $loadData = true, $options = array('control' => 'jform'))
|
||||
{
|
||||
// set load data option
|
||||
$options['load_data'] = $loadData;
|
||||
// check if xpath was set in options
|
||||
$xpath = false;
|
||||
@ -438,29 +432,29 @@ class QuestionsanswersModelQuestion_and_answer extends JModelAdmin
|
||||
$form->setValue($redirectedField, null, $redirectedValue);
|
||||
}
|
||||
}
|
||||
return $form;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the script that have to be included on the form
|
||||
*
|
||||
* @return string script files
|
||||
*/
|
||||
public function getScript()
|
||||
{
|
||||
return 'administrator/components/com_questionsanswers/models/forms/question_and_answer.js';
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to test whether a record can be deleted.
|
||||
*
|
||||
* @param object $record A record object.
|
||||
*
|
||||
* @return boolean True if allowed to delete the record. Defaults to the permission set in the component.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function canDelete($record)
|
||||
return $form;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the script that have to be included on the form
|
||||
*
|
||||
* @return string script files
|
||||
*/
|
||||
public function getScript()
|
||||
{
|
||||
return 'media/com_questionsanswers/js/question_and_answer.js';
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to test whether a record can be deleted.
|
||||
*
|
||||
* @param object $record A record object.
|
||||
*
|
||||
* @return boolean True if allowed to delete the record. Defaults to the permission set in the component.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function canDelete($record)
|
||||
{
|
||||
if (!empty($record->id))
|
||||
{
|
||||
@ -473,19 +467,19 @@ class QuestionsanswersModelQuestion_and_answer extends JModelAdmin
|
||||
// The record has been set. Check the record permissions.
|
||||
return $user->authorise('question_and_answer.delete', 'com_questionsanswers.question_and_answer.' . (int) $record->id);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to test whether a record can have its state edited.
|
||||
*
|
||||
* @param object $record A record object.
|
||||
*
|
||||
* @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function canEditState($record)
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to test whether a record can have its state edited.
|
||||
*
|
||||
* @param object $record A record object.
|
||||
*
|
||||
* @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function canEditState($record)
|
||||
{
|
||||
$user = JFactory::getUser();
|
||||
$recordId = (!empty($record->id)) ? $record->id : 0;
|
||||
@ -500,104 +494,104 @@ class QuestionsanswersModelQuestion_and_answer extends JModelAdmin
|
||||
}
|
||||
}
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
return $user->authorise('question_and_answer.edit.state', 'com_questionsanswers');
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can edit an existing record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
* @param string $key The name of the key for the primary key.
|
||||
*
|
||||
* @return boolean
|
||||
* @since 2.5
|
||||
*/
|
||||
protected function allowEdit($data = array(), $key = 'id')
|
||||
return $user->authorise('question_and_answer.edit.state', 'com_questionsanswers');
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can edit an existing record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
* @param string $key The name of the key for the primary key.
|
||||
*
|
||||
* @return boolean
|
||||
* @since 2.5
|
||||
*/
|
||||
protected function allowEdit($data = array(), $key = 'id')
|
||||
{
|
||||
// Check specific edit permission then general edit permission.
|
||||
$user = JFactory::getUser();
|
||||
|
||||
return $user->authorise('question_and_answer.edit', 'com_questionsanswers.question_and_answer.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('question_and_answer.edit', 'com_questionsanswers');
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare and sanitise the table data prior to saving.
|
||||
*
|
||||
* @param JTable $table A JTable object.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function prepareTable($table)
|
||||
{
|
||||
$date = JFactory::getDate();
|
||||
$user = JFactory::getUser();
|
||||
|
||||
if (isset($table->name))
|
||||
{
|
||||
$table->name = htmlspecialchars_decode($table->name, ENT_QUOTES);
|
||||
}
|
||||
|
||||
if (isset($table->alias) && empty($table->alias))
|
||||
{
|
||||
$table->generateAlias();
|
||||
}
|
||||
|
||||
if (empty($table->id))
|
||||
{
|
||||
$table->created = $date->toSql();
|
||||
// set the user
|
||||
if ($table->created_by == 0 || empty($table->created_by))
|
||||
{
|
||||
$table->created_by = $user->id;
|
||||
}
|
||||
// Set ordering to the last item if not set
|
||||
if (empty($table->ordering))
|
||||
{
|
||||
$db = JFactory::getDbo();
|
||||
$query = $db->getQuery(true)
|
||||
->select('MAX(ordering)')
|
||||
->from($db->quoteName('#__questionsanswers_question_and_answer'));
|
||||
$db->setQuery($query);
|
||||
$max = $db->loadResult();
|
||||
|
||||
$table->ordering = $max + 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$table->modified = $date->toSql();
|
||||
$table->modified_by = $user->id;
|
||||
}
|
||||
|
||||
if (!empty($table->id))
|
||||
{
|
||||
// Increment the items version number.
|
||||
$table->version++;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the data that should be injected in the form.
|
||||
*
|
||||
* @return mixed The data for the form.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function loadFormData()
|
||||
{
|
||||
// Check the session for previously entered form data.
|
||||
$data = JFactory::getApplication()->getUserState('com_questionsanswers.edit.question_and_answer.data', array());
|
||||
|
||||
if (empty($data))
|
||||
{
|
||||
$data = $this->getItem();
|
||||
// run the perprocess of the data
|
||||
$this->preprocessData('com_questionsanswers.question_and_answer', $data);
|
||||
}
|
||||
|
||||
return $data;
|
||||
return $user->authorise('question_and_answer.edit', 'com_questionsanswers.question_and_answer.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('question_and_answer.edit', 'com_questionsanswers');
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare and sanitise the table data prior to saving.
|
||||
*
|
||||
* @param JTable $table A JTable object.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function prepareTable($table)
|
||||
{
|
||||
$date = JFactory::getDate();
|
||||
$user = JFactory::getUser();
|
||||
|
||||
if (isset($table->name))
|
||||
{
|
||||
$table->name = htmlspecialchars_decode($table->name, ENT_QUOTES);
|
||||
}
|
||||
|
||||
if (isset($table->alias) && empty($table->alias))
|
||||
{
|
||||
$table->generateAlias();
|
||||
}
|
||||
|
||||
if (empty($table->id))
|
||||
{
|
||||
$table->created = $date->toSql();
|
||||
// set the user
|
||||
if ($table->created_by == 0 || empty($table->created_by))
|
||||
{
|
||||
$table->created_by = $user->id;
|
||||
}
|
||||
// Set ordering to the last item if not set
|
||||
if (empty($table->ordering))
|
||||
{
|
||||
$db = JFactory::getDbo();
|
||||
$query = $db->getQuery(true)
|
||||
->select('MAX(ordering)')
|
||||
->from($db->quoteName('#__questionsanswers_question_and_answer'));
|
||||
$db->setQuery($query);
|
||||
$max = $db->loadResult();
|
||||
|
||||
$table->ordering = $max + 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$table->modified = $date->toSql();
|
||||
$table->modified_by = $user->id;
|
||||
}
|
||||
|
||||
if (!empty($table->id))
|
||||
{
|
||||
// Increment the items version number.
|
||||
$table->version++;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the data that should be injected in the form.
|
||||
*
|
||||
* @return mixed The data for the form.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function loadFormData()
|
||||
{
|
||||
// Check the session for previously entered form data.
|
||||
$data = JFactory::getApplication()->getUserState('com_questionsanswers.edit.question_and_answer.data', array());
|
||||
|
||||
if (empty($data))
|
||||
{
|
||||
$data = $this->getItem();
|
||||
// run the perprocess of the data
|
||||
$this->preprocessData('com_questionsanswers.question_and_answer', $data);
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -610,141 +604,141 @@ class QuestionsanswersModelQuestion_and_answer extends JModelAdmin
|
||||
protected function getUniqueFields()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to delete one or more records.
|
||||
*
|
||||
* @param array &$pks An array of record primary keys.
|
||||
*
|
||||
* @return boolean True if successful, false if an error occurs.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function delete(&$pks)
|
||||
{
|
||||
if (!parent::delete($pks))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to change the published state of one or more records.
|
||||
*
|
||||
* @param array &$pks A list of the primary keys to change.
|
||||
* @param integer $value The value of the published state.
|
||||
*
|
||||
* @return boolean True on success.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function publish(&$pks, $value = 1)
|
||||
{
|
||||
if (!parent::publish($pks, $value))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to perform batch operations on an item or a set of items.
|
||||
*
|
||||
* @param array $commands An array of commands to perform.
|
||||
* @param array $pks An array of item ids.
|
||||
* @param array $contexts An array of item contexts.
|
||||
*
|
||||
* @return boolean Returns true on success, false on failure.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function batch($commands, $pks, $contexts)
|
||||
{
|
||||
// Sanitize ids.
|
||||
$pks = array_unique($pks);
|
||||
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(JText::_('JGLOBAL_NO_ITEM_SELECTED'));
|
||||
return false;
|
||||
}
|
||||
|
||||
$done = false;
|
||||
|
||||
// Set some needed variables.
|
||||
$this->user = JFactory::getUser();
|
||||
$this->table = $this->getTable();
|
||||
$this->tableClassName = get_class($this->table);
|
||||
$this->contentType = new JUcmType;
|
||||
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
|
||||
$this->canDo = QuestionsanswersHelper::getActions('question_and_answer');
|
||||
$this->batchSet = true;
|
||||
|
||||
if (!$this->canDo->get('core.batch'))
|
||||
{
|
||||
$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->type == false)
|
||||
{
|
||||
$type = new JUcmType;
|
||||
$this->type = $type->getTypeByAlias($this->typeAlias);
|
||||
}
|
||||
|
||||
$this->tagsObserver = $this->table->getObserverOfClass('JTableObserverTags');
|
||||
|
||||
if (!empty($commands['move_copy']))
|
||||
{
|
||||
$cmd = 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(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Clear the cache
|
||||
$this->cleanCache();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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(JText::_('JGLOBAL_NO_ITEM_SELECTED'));
|
||||
return false;
|
||||
}
|
||||
|
||||
$done = false;
|
||||
|
||||
// Set some needed variables.
|
||||
$this->user = JFactory::getUser();
|
||||
$this->table = $this->getTable();
|
||||
$this->tableClassName = get_class($this->table);
|
||||
$this->contentType = new JUcmType;
|
||||
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
|
||||
$this->canDo = QuestionsanswersHelper::getActions('question_and_answer');
|
||||
$this->batchSet = true;
|
||||
|
||||
if (!$this->canDo->get('core.batch'))
|
||||
{
|
||||
$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->type == false)
|
||||
{
|
||||
$type = new JUcmType;
|
||||
$this->type = $type->getTypeByAlias($this->typeAlias);
|
||||
}
|
||||
|
||||
$this->tagsObserver = $this->table->getObserverOfClass('JTableObserverTags');
|
||||
|
||||
if (!empty($commands['move_copy']))
|
||||
{
|
||||
$cmd = 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(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Clear the cache
|
||||
$this->cleanCache();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1021,30 +1015,30 @@ class QuestionsanswersModelQuestion_and_answer extends JModelAdmin
|
||||
$this->cleanCache();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to save the form data.
|
||||
*
|
||||
* @param array $data The form data.
|
||||
*
|
||||
* @return boolean True on success.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function save($data)
|
||||
{
|
||||
$input = JFactory::getApplication()->input;
|
||||
$filter = JFilterInput::getInstance();
|
||||
|
||||
// set the metadata to the Item Data
|
||||
if (isset($data['metadata']) && isset($data['metadata']['author']))
|
||||
{
|
||||
$data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM');
|
||||
|
||||
$metadata = new JRegistry;
|
||||
$metadata->loadArray($data['metadata']);
|
||||
$data['metadata'] = (string) $metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to save the form data.
|
||||
*
|
||||
* @param array $data The form data.
|
||||
*
|
||||
* @return boolean True on success.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function save($data)
|
||||
{
|
||||
$input = JFactory::getApplication()->input;
|
||||
$filter = JFilterInput::getInstance();
|
||||
|
||||
// set the metadata to the Item Data
|
||||
if (isset($data['metadata']) && isset($data['metadata']['author']))
|
||||
{
|
||||
$data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM');
|
||||
|
||||
$metadata = new JRegistry;
|
||||
$metadata->loadArray($data['metadata']);
|
||||
$data['metadata'] = (string) $metadata;
|
||||
}
|
||||
|
||||
// Get the basic encryption key.
|
||||
@ -1062,14 +1056,14 @@ class QuestionsanswersModelQuestion_and_answer extends JModelAdmin
|
||||
if (isset($data['main_image']) && $basickey)
|
||||
{
|
||||
$data['main_image'] = $basic->encryptString($data['main_image']);
|
||||
}
|
||||
|
||||
// Set the Params Items to data
|
||||
if (isset($data['params']) && is_array($data['params']))
|
||||
{
|
||||
$params = new JRegistry;
|
||||
$params->loadArray($data['params']);
|
||||
$data['params'] = (string) $params;
|
||||
}
|
||||
|
||||
// Set the Params Items to data
|
||||
if (isset($data['params']) && is_array($data['params']))
|
||||
{
|
||||
$params = new JRegistry;
|
||||
$params->loadArray($data['params']);
|
||||
$data['params'] = (string) $params;
|
||||
}
|
||||
|
||||
// Alter the unique field for save as copy
|
||||
@ -1084,36 +1078,36 @@ class QuestionsanswersModelQuestion_and_answer extends JModelAdmin
|
||||
$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(array($field => $value)))
|
||||
{
|
||||
$value = StringHelper::increment($value);
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (parent::save($data))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to generate a unique value.
|
||||
*
|
||||
* @param string $field name.
|
||||
* @param string $value data.
|
||||
*
|
||||
* @return string New value.
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
protected function generateUnique($field,$value)
|
||||
{
|
||||
|
||||
// set field value unique
|
||||
$table = $this->getTable();
|
||||
|
||||
while ($table->load(array($field => $value)))
|
||||
{
|
||||
$value = StringHelper::increment($value);
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
|
@ -1,43 +1,43 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage questions_and_answers.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
|
||||
/**
|
||||
* Questions_and_answers Model
|
||||
*/
|
||||
class QuestionsanswersModelQuestions_and_answers extends JModelList
|
||||
{
|
||||
public function __construct($config = array())
|
||||
{
|
||||
if (empty($config['filter_fields']))
|
||||
{
|
||||
$config['filter_fields'] = array(
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage questions_and_answers.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
|
||||
/**
|
||||
* Questions_and_answers Model
|
||||
*/
|
||||
class QuestionsanswersModelQuestions_and_answers extends JModelList
|
||||
{
|
||||
public function __construct($config = array())
|
||||
{
|
||||
if (empty($config['filter_fields']))
|
||||
{
|
||||
$config['filter_fields'] = array(
|
||||
'a.id','id',
|
||||
'a.published','published',
|
||||
'a.access','access',
|
||||
@ -48,32 +48,32 @@ class QuestionsanswersModelQuestions_and_answers extends JModelList
|
||||
'c.id', 'category_id',
|
||||
'a.catid','catid',
|
||||
'a.question','question',
|
||||
'a.answer','answer'
|
||||
);
|
||||
}
|
||||
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
protected function populateState($ordering = null, $direction = null)
|
||||
{
|
||||
$app = JFactory::getApplication();
|
||||
|
||||
// Adjust the context to support modal layouts.
|
||||
if ($layout = $app->input->get('layout'))
|
||||
{
|
||||
$this->context .= '.' . $layout;
|
||||
'a.answer','answer'
|
||||
);
|
||||
}
|
||||
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
protected function populateState($ordering = null, $direction = null)
|
||||
{
|
||||
$app = JFactory::getApplication();
|
||||
|
||||
// Adjust the context to support modal layouts.
|
||||
if ($layout = $app->input->get('layout'))
|
||||
{
|
||||
$this->context .= '.' . $layout;
|
||||
}
|
||||
|
||||
// Check if the form was submitted
|
||||
@ -126,23 +126,23 @@ class QuestionsanswersModelQuestions_and_answers extends JModelList
|
||||
{
|
||||
$answer = $app->input->post->get('answer');
|
||||
$this->setState('filter.answer', $answer);
|
||||
}
|
||||
|
||||
// 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.
|
||||
*/
|
||||
public function getItems()
|
||||
}
|
||||
|
||||
// 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.
|
||||
*/
|
||||
public function getItems()
|
||||
{
|
||||
// check in items
|
||||
// Check in items
|
||||
$this->checkInNow();
|
||||
|
||||
// load parent items
|
||||
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// Set values to display correctly.
|
||||
@ -164,19 +164,19 @@ class QuestionsanswersModelQuestions_and_answers extends JModelList
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// return items
|
||||
return $items;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to build an SQL query to load the list data.
|
||||
*
|
||||
* @return string An SQL query
|
||||
*/
|
||||
protected function getListQuery()
|
||||
{
|
||||
}
|
||||
|
||||
// return items
|
||||
return $items;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to build an SQL query to load the list data.
|
||||
*
|
||||
* @return string An SQL query
|
||||
*/
|
||||
protected function getListQuery()
|
||||
{
|
||||
// Get the user object.
|
||||
$user = JFactory::getUser();
|
||||
// Create a new query object.
|
||||
@ -270,7 +270,7 @@ class QuestionsanswersModelQuestions_and_answers extends JModelList
|
||||
$query->order($db->escape($orderCol . ' ' . $orderDirn));
|
||||
}
|
||||
|
||||
return $query;
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -408,16 +408,16 @@ class QuestionsanswersModelQuestions_and_answers extends JModelList
|
||||
return $headers;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get a store id based on model configuration state.
|
||||
*
|
||||
* @return string A store id.
|
||||
*
|
||||
*/
|
||||
protected function getStoreId($id = '')
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get a store id based on model configuration state.
|
||||
*
|
||||
* @return string A store id.
|
||||
*
|
||||
*/
|
||||
protected function getStoreId($id = '')
|
||||
{
|
||||
// Compile the store id.
|
||||
$id .= ':' . $this->getState('filter.id');
|
||||
$id .= ':' . $this->getState('filter.search');
|
||||
@ -474,9 +474,9 @@ class QuestionsanswersModelQuestions_and_answers extends JModelList
|
||||
$id .= ':' . $_catid;
|
||||
}
|
||||
$id .= ':' . $this->getState('filter.question');
|
||||
$id .= ':' . $this->getState('filter.answer');
|
||||
|
||||
return parent::getStoreId($id);
|
||||
$id .= ':' . $this->getState('filter.answer');
|
||||
|
||||
return parent::getStoreId($id);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -495,17 +495,19 @@ class QuestionsanswersModelQuestions_and_answers extends JModelList
|
||||
|
||||
// Get a db connection.
|
||||
$db = JFactory::getDbo();
|
||||
// reset query
|
||||
// Reset query.
|
||||
$query = $db->getQuery(true);
|
||||
$query->select('*');
|
||||
$query->from($db->quoteName('#__questionsanswers_question_and_answer'));
|
||||
$db->setQuery($query);
|
||||
// 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
|
||||
// Get Yesterdays date.
|
||||
$date = JFactory::getDate()->modify($time)->toSql();
|
||||
// reset query
|
||||
// Reset query.
|
||||
$query = $db->getQuery(true);
|
||||
|
||||
// Fields to update.
|
||||
@ -520,7 +522,7 @@ class QuestionsanswersModelQuestions_and_answers extends JModelList
|
||||
$db->quoteName('checked_out_time') . '<\''.$date.'\''
|
||||
);
|
||||
|
||||
// Check table
|
||||
// Check table.
|
||||
$query->update($db->quoteName('#__questionsanswers_question_and_answer'))->set($fields)->where($conditions);
|
||||
|
||||
$db->setQuery($query);
|
||||
@ -530,5 +532,5 @@ class QuestionsanswersModelQuestions_and_answers extends JModelList
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,45 +1,47 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage questionsanswers.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
/**
|
||||
* Questionsanswers Model
|
||||
*/
|
||||
class QuestionsanswersModelQuestionsanswers extends JModelList
|
||||
{
|
||||
public function getIcons()
|
||||
{
|
||||
// load user for access menus
|
||||
$user = JFactory::getUser();
|
||||
// reset icon array
|
||||
$icons = array();
|
||||
// view groups array
|
||||
$viewGroups = array(
|
||||
'main' => array('png.question_and_answer.add', 'png.questions_and_answers', 'png.questions_and_answers.catid_qpo0O0oqp_com_questionsanswers_po0O0oq_question_and_answer', 'png.help_documents')
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage questionsanswers.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Questionsanswers Model
|
||||
*/
|
||||
class QuestionsanswersModelQuestionsanswers extends JModelList
|
||||
{
|
||||
public function getIcons()
|
||||
{
|
||||
// load user for access menus
|
||||
$user = JFactory::getUser();
|
||||
// reset icon array
|
||||
$icons = array();
|
||||
// view groups array
|
||||
$viewGroups = array(
|
||||
'main' => array('png.question_and_answer.add', 'png.questions_and_answers', 'png.questions_and_answers.catid_qpo0O0oqp_com_questionsanswers_po0O0oq_question_and_answer', 'png.help_documents')
|
||||
);
|
||||
// view access array
|
||||
$viewAccess = array(
|
||||
@ -53,191 +55,191 @@ class QuestionsanswersModelQuestionsanswers extends JModelList
|
||||
'help_documents.access' => 'help_document.access',
|
||||
'help_document.access' => 'help_document.access',
|
||||
'help_documents.submenu' => 'help_document.submenu',
|
||||
'help_documents.dashboard_list' => 'help_document.dashboard_list');
|
||||
// loop over the $views
|
||||
foreach($viewGroups as $group => $views)
|
||||
{
|
||||
$i = 0;
|
||||
if (QuestionsanswersHelper::checkArray($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_QUESTIONSANSWERS_DASHBOARD_' . QuestionsanswersHelper::safeString($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_questionsanswers&view=' . $name . '&layout=edit';
|
||||
$image = $name . '_' . $action. '.' . $type;
|
||||
$alt = $name . ' ' . $action;
|
||||
$name = 'COM_QUESTIONSANSWERS_DASHBOARD_'.QuestionsanswersHelper::safeString($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_questionsanswers.' . $name;
|
||||
}
|
||||
$url = 'index.php?option=com_categories&view=categories&extension=' . $extension;
|
||||
$image = $name . '_' . $action . '.' . $type;
|
||||
$alt = $viewName . ' ' . $action;
|
||||
$name = 'COM_QUESTIONSANSWERS_DASHBOARD_' . QuestionsanswersHelper::safeString($name,'U') . '_' . QuestionsanswersHelper::safeString($action,'U');
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$viewName = $name;
|
||||
$alt = $name;
|
||||
$url = 'index.php?option=com_questionsanswers&view=' . $name;
|
||||
$image = $name . '.' . $type;
|
||||
$name = 'COM_QUESTIONSANSWERS_DASHBOARD_' . QuestionsanswersHelper::safeString($name,'U');
|
||||
$hover = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$viewName = $view;
|
||||
$alt = $view;
|
||||
$url = 'index.php?option=com_questionsanswers&view=' . $view;
|
||||
$image = $view . '.png';
|
||||
$name = ucwords($view).'<br /><br />';
|
||||
$hover = false;
|
||||
}
|
||||
// first make sure the view access is set
|
||||
if (QuestionsanswersHelper::checkArray($viewAccess))
|
||||
{
|
||||
// setup some defaults
|
||||
$dashboard_add = false;
|
||||
$dashboard_list = false;
|
||||
$accessTo = '';
|
||||
$accessAdd = '';
|
||||
// access checking start
|
||||
$accessCreate = (isset($viewAccess[$viewName.'.create'])) ? QuestionsanswersHelper::checkString($viewAccess[$viewName.'.create']):false;
|
||||
$accessAccess = (isset($viewAccess[$viewName.'.access'])) ? QuestionsanswersHelper::checkString($viewAccess[$viewName.'.access']):false;
|
||||
// set main controllers
|
||||
$accessDashboard_add = (isset($viewAccess[$viewName.'.dashboard_add'])) ? QuestionsanswersHelper::checkString($viewAccess[$viewName.'.dashboard_add']):false;
|
||||
$accessDashboard_list = (isset($viewAccess[$viewName.'.dashboard_list'])) ? QuestionsanswersHelper::checkString($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_questionsanswers');
|
||||
}
|
||||
if ($accessDashboard_list)
|
||||
{
|
||||
$dashboard_list = $user->authorise($viewAccess[$viewName.'.dashboard_list'], 'com_questionsanswers');
|
||||
}
|
||||
if (QuestionsanswersHelper::checkString($accessAdd) && QuestionsanswersHelper::checkString($accessTo))
|
||||
{
|
||||
// check access
|
||||
if($user->authorise($accessAdd, 'com_questionsanswers') && $user->authorise($accessTo, 'com_questionsanswers') && $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 (QuestionsanswersHelper::checkString($accessTo))
|
||||
{
|
||||
// check access
|
||||
if($user->authorise($accessTo, 'com_questionsanswers') && $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 (QuestionsanswersHelper::checkString($accessAdd))
|
||||
{
|
||||
// check access
|
||||
if($user->authorise($accessAdd, 'com_questionsanswers') && $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;
|
||||
'help_documents.dashboard_list' => 'help_document.dashboard_list');
|
||||
// loop over the $views
|
||||
foreach($viewGroups as $group => $views)
|
||||
{
|
||||
$i = 0;
|
||||
if (QuestionsanswersHelper::checkArray($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_QUESTIONSANSWERS_DASHBOARD_' . QuestionsanswersHelper::safeString($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_questionsanswers&view=' . $name . '&layout=edit';
|
||||
$image = $name . '_' . $action. '.' . $type;
|
||||
$alt = $name . ' ' . $action;
|
||||
$name = 'COM_QUESTIONSANSWERS_DASHBOARD_'.QuestionsanswersHelper::safeString($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_questionsanswers.' . $name;
|
||||
}
|
||||
$url = 'index.php?option=com_categories&view=categories&extension=' . $extension;
|
||||
$image = $name . '_' . $action . '.' . $type;
|
||||
$alt = $viewName . ' ' . $action;
|
||||
$name = 'COM_QUESTIONSANSWERS_DASHBOARD_' . QuestionsanswersHelper::safeString($name,'U') . '_' . QuestionsanswersHelper::safeString($action,'U');
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$viewName = $name;
|
||||
$alt = $name;
|
||||
$url = 'index.php?option=com_questionsanswers&view=' . $name;
|
||||
$image = $name . '.' . $type;
|
||||
$name = 'COM_QUESTIONSANSWERS_DASHBOARD_' . QuestionsanswersHelper::safeString($name,'U');
|
||||
$hover = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$viewName = $view;
|
||||
$alt = $view;
|
||||
$url = 'index.php?option=com_questionsanswers&view=' . $view;
|
||||
$image = $view . '.png';
|
||||
$name = ucwords($view).'<br /><br />';
|
||||
$hover = false;
|
||||
}
|
||||
// first make sure the view access is set
|
||||
if (QuestionsanswersHelper::checkArray($viewAccess))
|
||||
{
|
||||
// setup some defaults
|
||||
$dashboard_add = false;
|
||||
$dashboard_list = false;
|
||||
$accessTo = '';
|
||||
$accessAdd = '';
|
||||
// access checking start
|
||||
$accessCreate = (isset($viewAccess[$viewName.'.create'])) ? QuestionsanswersHelper::checkString($viewAccess[$viewName.'.create']):false;
|
||||
$accessAccess = (isset($viewAccess[$viewName.'.access'])) ? QuestionsanswersHelper::checkString($viewAccess[$viewName.'.access']):false;
|
||||
// set main controllers
|
||||
$accessDashboard_add = (isset($viewAccess[$viewName.'.dashboard_add'])) ? QuestionsanswersHelper::checkString($viewAccess[$viewName.'.dashboard_add']):false;
|
||||
$accessDashboard_list = (isset($viewAccess[$viewName.'.dashboard_list'])) ? QuestionsanswersHelper::checkString($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_questionsanswers');
|
||||
}
|
||||
if ($accessDashboard_list)
|
||||
{
|
||||
$dashboard_list = $user->authorise($viewAccess[$viewName.'.dashboard_list'], 'com_questionsanswers');
|
||||
}
|
||||
if (QuestionsanswersHelper::checkString($accessAdd) && QuestionsanswersHelper::checkString($accessTo))
|
||||
{
|
||||
// check access
|
||||
if($user->authorise($accessAdd, 'com_questionsanswers') && $user->authorise($accessTo, 'com_questionsanswers') && $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 (QuestionsanswersHelper::checkString($accessTo))
|
||||
{
|
||||
// check access
|
||||
if($user->authorise($accessTo, 'com_questionsanswers') && $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 (QuestionsanswersHelper::checkString($accessAdd))
|
||||
{
|
||||
// check access
|
||||
if($user->authorise($accessAdd, 'com_questionsanswers') && $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;
|
||||
}
|
||||
|
||||
|
||||
@ -253,7 +255,7 @@ class QuestionsanswersModelQuestionsanswers extends JModelList
|
||||
jQuery.get(noticeboard)
|
||||
.success(function(board) {
|
||||
if (board.length > 5) {
|
||||
jQuery("#noticeboard-md").html(marked(board));
|
||||
jQuery("#noticeboard-md").html(marked.parse(board));
|
||||
getIS(1,board).done(function(result) {
|
||||
if (result){
|
||||
jQuery("#cpanel_tabTabs a").each(function() {
|
||||
@ -288,7 +290,7 @@ class QuestionsanswersModelQuestionsanswers extends JModelList
|
||||
var getUrl = "index.php?option=com_questionsanswers&task=ajax.isRead&format=json&raw=true";
|
||||
}
|
||||
if(token.length > 0 && notice.length){
|
||||
var request = "token="+token+"¬ice="+notice;
|
||||
var request = token+"=1¬ice="+notice;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: "POST",
|
||||
@ -331,5 +333,5 @@ jQuery(document).ready( function($) {
|
||||
});');
|
||||
|
||||
return '<div id="readme-md"><small>'.JText::_('COM_QUESTIONSANSWERS_THE_README_IS_LOADING').'.<span class="loading-dots">.</span></small></div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,56 +1,56 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage questionsanswers.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
JHtml::_('behavior.tabstate');
|
||||
|
||||
// Access check.
|
||||
if (!JFactory::getUser()->authorise('core.manage', 'com_questionsanswers'))
|
||||
{
|
||||
throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403);
|
||||
};
|
||||
|
||||
// Add CSS file for all pages
|
||||
$document = JFactory::getDocument();
|
||||
$document->addStyleSheet('components/com_questionsanswers/assets/css/admin.css');
|
||||
$document->addScript('components/com_questionsanswers/assets/js/admin.js');
|
||||
|
||||
// require helper files
|
||||
JLoader::register('QuestionsanswersHelper', __DIR__ . '/helpers/questionsanswers.php');
|
||||
JLoader::register('JHtmlBatch_', __DIR__ . '/helpers/html/batch_.php');
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
// Triger the Global Admin Event
|
||||
QuestionsanswersHelper::globalEvent($document);
|
||||
|
||||
// Get an instance of the controller prefixed by Questionsanswers
|
||||
$controller = JControllerLegacy::getInstance('Questionsanswers');
|
||||
|
||||
// Perform the Request task
|
||||
$controller->execute(JFactory::getApplication()->input->get('task'));
|
||||
|
||||
// Redirect if set by the controller
|
||||
$controller->redirect();
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage questionsanswers.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
|
||||
|
||||
// Access check.
|
||||
if (!JFactory::getUser()->authorise('core.manage', 'com_questionsanswers'))
|
||||
{
|
||||
throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403);
|
||||
};
|
||||
|
||||
// Add CSS file for all pages
|
||||
$document = JFactory::getDocument();
|
||||
$document->addStyleSheet('components/com_questionsanswers/assets/css/admin.css');
|
||||
$document->addScript('components/com_questionsanswers/assets/js/admin.js');
|
||||
|
||||
// require helper files
|
||||
JLoader::register('QuestionsanswersHelper', __DIR__ . '/helpers/questionsanswers.php');
|
||||
JLoader::register('JHtmlBatch_', __DIR__ . '/helpers/html/batch_.php');
|
||||
|
||||
// Trigger the Global Admin Event
|
||||
QuestionsanswersHelper::globalEvent($document);
|
||||
|
||||
// Get an instance of the controller prefixed by Questionsanswers
|
||||
$controller = JControllerLegacy::getInstance('Questionsanswers');
|
||||
|
||||
// Perform the Request task
|
||||
$controller->execute(JFactory::getApplication()->input->get('task'));
|
||||
|
||||
// Redirect if set by the controller
|
||||
$controller->redirect();
|
||||
|
@ -6,7 +6,7 @@ CREATE TABLE IF NOT EXISTS `#__questionsanswers_question_and_answer` (
|
||||
`catid` INT(11) NOT NULL DEFAULT 0,
|
||||
`main_image` TEXT NOT NULL,
|
||||
`question` TEXT NOT NULL,
|
||||
`params` text NOT NULL,
|
||||
`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,
|
||||
@ -44,7 +44,7 @@ CREATE TABLE IF NOT EXISTS `#__questionsanswers_help_document` (
|
||||
`title` CHAR(64) NOT NULL DEFAULT '',
|
||||
`type` TINYINT(1) NOT NULL DEFAULT 0,
|
||||
`url` VARCHAR(255) NOT NULL DEFAULT '',
|
||||
`params` text NOT NULL,
|
||||
`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,
|
||||
|
@ -1,3 +1,3 @@
|
||||
ALTER TABLE `#__questionsanswers_question_and_answer` ENGINE = InnoDB;
|
||||
|
||||
ALTER TABLE `#__questionsanswers_question_and_answer` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
ALTER TABLE `#__questionsanswers_question_and_answer` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
|
@ -1,327 +1,327 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage help_document.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\Registry\Registry;
|
||||
use Joomla\String\StringHelper;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
|
||||
/**
|
||||
* Help_documents Table class
|
||||
*/
|
||||
class QuestionsanswersTableHelp_document extends JTable
|
||||
{
|
||||
/**
|
||||
* Ensure the params and metadata in json encoded in the bind method
|
||||
*
|
||||
* @var array
|
||||
* @since 3.3
|
||||
*/
|
||||
protected $_jsonEncode = array('params', 'metadata');
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param object Database connector object
|
||||
*/
|
||||
function __construct(&$db)
|
||||
{
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage help_document.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\Registry\Registry;
|
||||
use Joomla\String\StringHelper;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
|
||||
/**
|
||||
* Help_documents Table class
|
||||
*/
|
||||
class QuestionsanswersTableHelp_document extends JTable
|
||||
{
|
||||
/**
|
||||
* Ensure the params and metadata in json encoded in the bind method
|
||||
*
|
||||
* @var array
|
||||
* @since 3.3
|
||||
*/
|
||||
protected $_jsonEncode = array('params', 'metadata');
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param object Database connector object
|
||||
*/
|
||||
function __construct(&$db)
|
||||
{
|
||||
parent::__construct('#__questionsanswers_help_document', 'id', $db);
|
||||
|
||||
// Adding History Options
|
||||
JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_questionsanswers.help_document'));
|
||||
}
|
||||
|
||||
public function bind($array, $ignore = '')
|
||||
{
|
||||
|
||||
if (isset($array['params']) && is_array($array['params']))
|
||||
{
|
||||
$registry = new JRegistry;
|
||||
$registry->loadArray($array['params']);
|
||||
$array['params'] = (string) $registry;
|
||||
}
|
||||
|
||||
if (isset($array['metadata']) && is_array($array['metadata']))
|
||||
{
|
||||
$registry = new JRegistry;
|
||||
$registry->loadArray($array['metadata']);
|
||||
$array['metadata'] = (string) $registry;
|
||||
}
|
||||
|
||||
// Bind the rules.
|
||||
if (isset($array['rules']) && is_array($array['rules']))
|
||||
{
|
||||
$rules = new JAccessRules($array['rules']);
|
||||
$this->setRules($rules);
|
||||
}
|
||||
return parent::bind($array, $ignore);
|
||||
}
|
||||
|
||||
/**
|
||||
* Overload the store method for the Help_document 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 = JFactory::getDate();
|
||||
$user = JFactory::getUser();
|
||||
|
||||
if ($this->id)
|
||||
{
|
||||
// Existing item
|
||||
$this->modified = $date->toSql();
|
||||
$this->modified_by = $user->get('id');
|
||||
}
|
||||
else
|
||||
{
|
||||
// New help_document. A help_document 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->toSql();
|
||||
}
|
||||
if (empty($this->created_by))
|
||||
{
|
||||
$this->created_by = $user->get('id');
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($this->alias))
|
||||
{
|
||||
// Verify that the alias is unique
|
||||
$table = JTable::getInstance('help_document', 'QuestionsanswersTable');
|
||||
|
||||
if ($table->load(array('alias' => $this->alias)) && ($table->id != $this->id || $this->id == 0))
|
||||
{
|
||||
$this->setError(JText::_('COM_QUESTIONSANSWERS_HELP_DOCUMENT_ERROR_UNIQUE_ALIAS'));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($this->url))
|
||||
{
|
||||
// Convert IDN urls to punycode
|
||||
$this->url = JStringPunycode::urlToPunycode($this->url);
|
||||
}
|
||||
if (isset($this->website))
|
||||
{
|
||||
// Convert IDN urls to punycode
|
||||
$this->website = JStringPunycode::urlToPunycode($this->website);
|
||||
}
|
||||
|
||||
return parent::store($updateNulls);
|
||||
}
|
||||
|
||||
/**
|
||||
* Overloaded check method to ensure data integrity.
|
||||
*
|
||||
* @return boolean True on success.
|
||||
*/
|
||||
public function check()
|
||||
{
|
||||
if (isset($this->alias))
|
||||
{
|
||||
// Generate a valid alias
|
||||
$this->generateAlias();
|
||||
|
||||
$table = JTable::getInstance('help_document', 'questionsanswersTable');
|
||||
|
||||
while ($table->load(array('alias' => $this->alias)) && ($table->id != $this->id || $this->id == 0))
|
||||
{
|
||||
$this->alias = StringHelper::increment($this->alias, 'dash');
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Clean up keywords -- eliminate extra spaces between phrases
|
||||
* and cr (\r) and lf (\n) characters from string.
|
||||
* Only process if not empty.
|
||||
*/
|
||||
if (!empty($this->metakey))
|
||||
{
|
||||
// Array of characters to remove.
|
||||
$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 = array();
|
||||
|
||||
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 JAccessRules class
|
||||
if (!$this->getRules())
|
||||
{
|
||||
$rules = $this->getDefaultAssetValues('com_questionsanswers.help_document.'.$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 JAccessRules The JAccessRules object for the asset
|
||||
*/
|
||||
protected function getDefaultAssetValues($component, $try = true)
|
||||
{
|
||||
// Need to find the asset id by the name of the component.
|
||||
$db = JFactory::getDbo();
|
||||
$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 JAccess::getAssetRules($assetId); // (TODO) instead of keeping inherited Allowed it becomes Allowed.
|
||||
}
|
||||
// try again
|
||||
elseif ($try)
|
||||
{
|
||||
$try = explode('.',$component);
|
||||
$result = $this->getDefaultAssetValues($try[0], false);
|
||||
if ($result instanceof JAccessRules)
|
||||
{
|
||||
if (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 = array();
|
||||
}
|
||||
}
|
||||
// check if there are any view values remaining
|
||||
if (count( (array) $_result))
|
||||
{
|
||||
$_result = json_encode($_result);
|
||||
$_result = array($_result);
|
||||
// Instantiate and return the JAccessRules object for the asset rules.
|
||||
$rules = new JAccessRules;
|
||||
$rules->mergeCollection($_result);
|
||||
|
||||
return $rules;
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
return JAccess::getAssetRules(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 2.5
|
||||
*/
|
||||
protected function _getAssetName()
|
||||
{
|
||||
$k = $this->_tbl_key;
|
||||
return 'com_questionsanswers.help_document.'.(int) $this->$k;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to return the title to use for the asset table.
|
||||
*
|
||||
* @return string
|
||||
* @since 2.5
|
||||
*/
|
||||
protected function _getAssetTitle()
|
||||
{
|
||||
if (isset($this->title))
|
||||
{
|
||||
return $this->title;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the parent asset id for the record
|
||||
*
|
||||
* @return int
|
||||
* @since 2.5
|
||||
*/
|
||||
protected function _getAssetParentId(JTable $table = NULL, $id = NULL)
|
||||
{
|
||||
$asset = JTable::getInstance('Asset');
|
||||
$asset->loadByName('com_questionsanswers');
|
||||
|
||||
return $asset->id;
|
||||
JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_questionsanswers.help_document'));
|
||||
}
|
||||
|
||||
public function bind($array, $ignore = '')
|
||||
{
|
||||
|
||||
if (isset($array['params']) && is_array($array['params']))
|
||||
{
|
||||
$registry = new JRegistry;
|
||||
$registry->loadArray($array['params']);
|
||||
$array['params'] = (string) $registry;
|
||||
}
|
||||
|
||||
if (isset($array['metadata']) && is_array($array['metadata']))
|
||||
{
|
||||
$registry = new JRegistry;
|
||||
$registry->loadArray($array['metadata']);
|
||||
$array['metadata'] = (string) $registry;
|
||||
}
|
||||
|
||||
// Bind the rules.
|
||||
if (isset($array['rules']) && is_array($array['rules']))
|
||||
{
|
||||
$rules = new JAccessRules($array['rules']);
|
||||
$this->setRules($rules);
|
||||
}
|
||||
return parent::bind($array, $ignore);
|
||||
}
|
||||
|
||||
/**
|
||||
* Overload the store method for the Help_document 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 = JFactory::getDate();
|
||||
$user = JFactory::getUser();
|
||||
|
||||
if ($this->id)
|
||||
{
|
||||
// Existing item
|
||||
$this->modified = $date->toSql();
|
||||
$this->modified_by = $user->get('id');
|
||||
}
|
||||
else
|
||||
{
|
||||
// New help_document. A help_document 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->toSql();
|
||||
}
|
||||
if (empty($this->created_by))
|
||||
{
|
||||
$this->created_by = $user->get('id');
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($this->alias))
|
||||
{
|
||||
// Verify that the alias is unique
|
||||
$table = JTable::getInstance('help_document', 'QuestionsanswersTable');
|
||||
|
||||
if ($table->load(array('alias' => $this->alias)) && ($table->id != $this->id || $this->id == 0))
|
||||
{
|
||||
$this->setError(JText::_('COM_QUESTIONSANSWERS_HELP_DOCUMENT_ERROR_UNIQUE_ALIAS'));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($this->url))
|
||||
{
|
||||
// Convert IDN urls to punycode
|
||||
$this->url = JStringPunycode::urlToPunycode($this->url);
|
||||
}
|
||||
if (isset($this->website))
|
||||
{
|
||||
// Convert IDN urls to punycode
|
||||
$this->website = JStringPunycode::urlToPunycode($this->website);
|
||||
}
|
||||
|
||||
return parent::store($updateNulls);
|
||||
}
|
||||
|
||||
/**
|
||||
* Overloaded check method to ensure data integrity.
|
||||
*
|
||||
* @return boolean True on success.
|
||||
*/
|
||||
public function check()
|
||||
{
|
||||
if (isset($this->alias))
|
||||
{
|
||||
// Generate a valid alias
|
||||
$this->generateAlias();
|
||||
|
||||
$table = JTable::getInstance('help_document', 'questionsanswersTable');
|
||||
|
||||
while ($table->load(array('alias' => $this->alias)) && ($table->id != $this->id || $this->id == 0))
|
||||
{
|
||||
$this->alias = StringHelper::increment($this->alias, 'dash');
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Clean up keywords -- eliminate extra spaces between phrases
|
||||
* and cr (\r) and lf (\n) characters from string.
|
||||
* Only process if not empty.
|
||||
*/
|
||||
if (!empty($this->metakey))
|
||||
{
|
||||
// Array of characters to remove.
|
||||
$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 = array();
|
||||
|
||||
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 JAccessRules class
|
||||
if (!$this->getRules())
|
||||
{
|
||||
$rules = $this->getDefaultAssetValues('com_questionsanswers.help_document.'.$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 JAccessRules The JAccessRules object for the asset
|
||||
*/
|
||||
protected function getDefaultAssetValues($component, $try = true)
|
||||
{
|
||||
// Need to find the asset id by the name of the component.
|
||||
$db = JFactory::getDbo();
|
||||
$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 JAccess::getAssetRules($assetId); // (TODO) instead of keeping inherited Allowed it becomes Allowed.
|
||||
}
|
||||
// try again
|
||||
elseif ($try)
|
||||
{
|
||||
$try = explode('.',$component);
|
||||
$result = $this->getDefaultAssetValues($try[0], false);
|
||||
if ($result instanceof JAccessRules)
|
||||
{
|
||||
if (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 = array();
|
||||
}
|
||||
}
|
||||
// check if there are any view values remaining
|
||||
if (count( (array) $_result))
|
||||
{
|
||||
$_result = json_encode($_result);
|
||||
$_result = array($_result);
|
||||
// Instantiate and return the JAccessRules object for the asset rules.
|
||||
$rules = new JAccessRules;
|
||||
$rules->mergeCollection($_result);
|
||||
|
||||
return $rules;
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
return JAccess::getAssetRules(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 2.5
|
||||
*/
|
||||
protected function _getAssetName()
|
||||
{
|
||||
$k = $this->_tbl_key;
|
||||
return 'com_questionsanswers.help_document.'.(int) $this->$k;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to return the title to use for the asset table.
|
||||
*
|
||||
* @return string
|
||||
* @since 2.5
|
||||
*/
|
||||
protected function _getAssetTitle()
|
||||
{
|
||||
if (isset($this->title))
|
||||
{
|
||||
return $this->title;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the parent asset id for the record
|
||||
*
|
||||
* @return int
|
||||
* @since 2.5
|
||||
*/
|
||||
protected function _getAssetParentId(JTable $table = NULL, $id = NULL)
|
||||
{
|
||||
$asset = JTable::getInstance('Asset');
|
||||
$asset->loadByName('com_questionsanswers');
|
||||
|
||||
return $asset->id;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -337,7 +337,7 @@ class QuestionsanswersTableHelp_document extends JTable
|
||||
$this->alias = $this->title;
|
||||
}
|
||||
|
||||
$this->alias = JApplication::stringURLSafe($this->alias);
|
||||
$this->alias = JApplicationHelper::stringURLSafe($this->alias);
|
||||
|
||||
if (trim(str_replace('-', '', $this->alias)) == '')
|
||||
{
|
||||
@ -345,6 +345,6 @@ class QuestionsanswersTableHelp_document extends JTable
|
||||
}
|
||||
|
||||
return $this->alias;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,327 +1,327 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage question_and_answer.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\Registry\Registry;
|
||||
use Joomla\String\StringHelper;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
|
||||
/**
|
||||
* Questions_and_answers Table class
|
||||
*/
|
||||
class QuestionsanswersTableQuestion_and_answer extends JTable
|
||||
{
|
||||
/**
|
||||
* Ensure the params and metadata in json encoded in the bind method
|
||||
*
|
||||
* @var array
|
||||
* @since 3.3
|
||||
*/
|
||||
protected $_jsonEncode = array('params', 'metadata');
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param object Database connector object
|
||||
*/
|
||||
function __construct(&$db)
|
||||
{
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage question_and_answer.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\Registry\Registry;
|
||||
use Joomla\String\StringHelper;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
|
||||
/**
|
||||
* Questions_and_answers Table class
|
||||
*/
|
||||
class QuestionsanswersTableQuestion_and_answer extends JTable
|
||||
{
|
||||
/**
|
||||
* Ensure the params and metadata in json encoded in the bind method
|
||||
*
|
||||
* @var array
|
||||
* @since 3.3
|
||||
*/
|
||||
protected $_jsonEncode = array('params', 'metadata');
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param object Database connector object
|
||||
*/
|
||||
function __construct(&$db)
|
||||
{
|
||||
parent::__construct('#__questionsanswers_question_and_answer', 'id', $db);
|
||||
|
||||
// Adding History Options
|
||||
JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_questionsanswers.question_and_answer'));
|
||||
}
|
||||
|
||||
public function bind($array, $ignore = '')
|
||||
{
|
||||
|
||||
if (isset($array['params']) && is_array($array['params']))
|
||||
{
|
||||
$registry = new JRegistry;
|
||||
$registry->loadArray($array['params']);
|
||||
$array['params'] = (string) $registry;
|
||||
}
|
||||
|
||||
if (isset($array['metadata']) && is_array($array['metadata']))
|
||||
{
|
||||
$registry = new JRegistry;
|
||||
$registry->loadArray($array['metadata']);
|
||||
$array['metadata'] = (string) $registry;
|
||||
}
|
||||
|
||||
// Bind the rules.
|
||||
if (isset($array['rules']) && is_array($array['rules']))
|
||||
{
|
||||
$rules = new JAccessRules($array['rules']);
|
||||
$this->setRules($rules);
|
||||
}
|
||||
return parent::bind($array, $ignore);
|
||||
}
|
||||
|
||||
/**
|
||||
* Overload the store method for the Question_and_answer 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 = JFactory::getDate();
|
||||
$user = JFactory::getUser();
|
||||
|
||||
if ($this->id)
|
||||
{
|
||||
// Existing item
|
||||
$this->modified = $date->toSql();
|
||||
$this->modified_by = $user->get('id');
|
||||
}
|
||||
else
|
||||
{
|
||||
// New question_and_answer. A question_and_answer 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->toSql();
|
||||
}
|
||||
if (empty($this->created_by))
|
||||
{
|
||||
$this->created_by = $user->get('id');
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($this->alias))
|
||||
{
|
||||
// Verify that the alias is unique
|
||||
$table = JTable::getInstance('question_and_answer', 'QuestionsanswersTable');
|
||||
|
||||
if ($table->load(array('alias' => $this->alias, 'catid' => $this->catid)) && ($table->id != $this->id || $this->id == 0))
|
||||
{
|
||||
$this->setError(JText::_('COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_ERROR_UNIQUE_ALIAS'));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($this->url))
|
||||
{
|
||||
// Convert IDN urls to punycode
|
||||
$this->url = JStringPunycode::urlToPunycode($this->url);
|
||||
}
|
||||
if (isset($this->website))
|
||||
{
|
||||
// Convert IDN urls to punycode
|
||||
$this->website = JStringPunycode::urlToPunycode($this->website);
|
||||
}
|
||||
|
||||
return parent::store($updateNulls);
|
||||
}
|
||||
|
||||
/**
|
||||
* Overloaded check method to ensure data integrity.
|
||||
*
|
||||
* @return boolean True on success.
|
||||
*/
|
||||
public function check()
|
||||
{
|
||||
if (isset($this->alias))
|
||||
{
|
||||
// Generate a valid alias
|
||||
$this->generateAlias();
|
||||
|
||||
$table = JTable::getInstance('question_and_answer', 'questionsanswersTable');
|
||||
|
||||
while ($table->load(array('alias' => $this->alias)) && ($table->id != $this->id || $this->id == 0))
|
||||
{
|
||||
$this->alias = StringHelper::increment($this->alias, 'dash');
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Clean up keywords -- eliminate extra spaces between phrases
|
||||
* and cr (\r) and lf (\n) characters from string.
|
||||
* Only process if not empty.
|
||||
*/
|
||||
if (!empty($this->metakey))
|
||||
{
|
||||
// Array of characters to remove.
|
||||
$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 = array();
|
||||
|
||||
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 JAccessRules class
|
||||
if (!$this->getRules())
|
||||
{
|
||||
$rules = $this->getDefaultAssetValues('com_questionsanswers.question_and_answer.'.$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 JAccessRules The JAccessRules object for the asset
|
||||
*/
|
||||
protected function getDefaultAssetValues($component, $try = true)
|
||||
{
|
||||
// Need to find the asset id by the name of the component.
|
||||
$db = JFactory::getDbo();
|
||||
$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 JAccess::getAssetRules($assetId); // (TODO) instead of keeping inherited Allowed it becomes Allowed.
|
||||
}
|
||||
// try again
|
||||
elseif ($try)
|
||||
{
|
||||
$try = explode('.',$component);
|
||||
$result = $this->getDefaultAssetValues($try[0], false);
|
||||
if ($result instanceof JAccessRules)
|
||||
{
|
||||
if (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 = array();
|
||||
}
|
||||
}
|
||||
// check if there are any view values remaining
|
||||
if (count( (array) $_result))
|
||||
{
|
||||
$_result = json_encode($_result);
|
||||
$_result = array($_result);
|
||||
// Instantiate and return the JAccessRules object for the asset rules.
|
||||
$rules = new JAccessRules;
|
||||
$rules->mergeCollection($_result);
|
||||
|
||||
return $rules;
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
return JAccess::getAssetRules(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 2.5
|
||||
*/
|
||||
protected function _getAssetName()
|
||||
{
|
||||
$k = $this->_tbl_key;
|
||||
return 'com_questionsanswers.question_and_answer.'.(int) $this->$k;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to return the title to use for the asset table.
|
||||
*
|
||||
* @return string
|
||||
* @since 2.5
|
||||
*/
|
||||
protected function _getAssetTitle()
|
||||
{
|
||||
if (isset($this->title))
|
||||
{
|
||||
return $this->title;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the parent asset id for the record
|
||||
*
|
||||
* @return int
|
||||
* @since 2.5
|
||||
*/
|
||||
protected function _getAssetParentId(JTable $table = NULL, $id = NULL)
|
||||
{
|
||||
$asset = JTable::getInstance('Asset');
|
||||
$asset->loadByName('com_questionsanswers');
|
||||
|
||||
return $asset->id;
|
||||
JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_questionsanswers.question_and_answer'));
|
||||
}
|
||||
|
||||
public function bind($array, $ignore = '')
|
||||
{
|
||||
|
||||
if (isset($array['params']) && is_array($array['params']))
|
||||
{
|
||||
$registry = new JRegistry;
|
||||
$registry->loadArray($array['params']);
|
||||
$array['params'] = (string) $registry;
|
||||
}
|
||||
|
||||
if (isset($array['metadata']) && is_array($array['metadata']))
|
||||
{
|
||||
$registry = new JRegistry;
|
||||
$registry->loadArray($array['metadata']);
|
||||
$array['metadata'] = (string) $registry;
|
||||
}
|
||||
|
||||
// Bind the rules.
|
||||
if (isset($array['rules']) && is_array($array['rules']))
|
||||
{
|
||||
$rules = new JAccessRules($array['rules']);
|
||||
$this->setRules($rules);
|
||||
}
|
||||
return parent::bind($array, $ignore);
|
||||
}
|
||||
|
||||
/**
|
||||
* Overload the store method for the Question_and_answer 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 = JFactory::getDate();
|
||||
$user = JFactory::getUser();
|
||||
|
||||
if ($this->id)
|
||||
{
|
||||
// Existing item
|
||||
$this->modified = $date->toSql();
|
||||
$this->modified_by = $user->get('id');
|
||||
}
|
||||
else
|
||||
{
|
||||
// New question_and_answer. A question_and_answer 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->toSql();
|
||||
}
|
||||
if (empty($this->created_by))
|
||||
{
|
||||
$this->created_by = $user->get('id');
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($this->alias))
|
||||
{
|
||||
// Verify that the alias is unique
|
||||
$table = JTable::getInstance('question_and_answer', 'QuestionsanswersTable');
|
||||
|
||||
if ($table->load(array('alias' => $this->alias, 'catid' => $this->catid)) && ($table->id != $this->id || $this->id == 0))
|
||||
{
|
||||
$this->setError(JText::_('COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_ERROR_UNIQUE_ALIAS'));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($this->url))
|
||||
{
|
||||
// Convert IDN urls to punycode
|
||||
$this->url = JStringPunycode::urlToPunycode($this->url);
|
||||
}
|
||||
if (isset($this->website))
|
||||
{
|
||||
// Convert IDN urls to punycode
|
||||
$this->website = JStringPunycode::urlToPunycode($this->website);
|
||||
}
|
||||
|
||||
return parent::store($updateNulls);
|
||||
}
|
||||
|
||||
/**
|
||||
* Overloaded check method to ensure data integrity.
|
||||
*
|
||||
* @return boolean True on success.
|
||||
*/
|
||||
public function check()
|
||||
{
|
||||
if (isset($this->alias))
|
||||
{
|
||||
// Generate a valid alias
|
||||
$this->generateAlias();
|
||||
|
||||
$table = JTable::getInstance('question_and_answer', 'questionsanswersTable');
|
||||
|
||||
while ($table->load(array('alias' => $this->alias)) && ($table->id != $this->id || $this->id == 0))
|
||||
{
|
||||
$this->alias = StringHelper::increment($this->alias, 'dash');
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Clean up keywords -- eliminate extra spaces between phrases
|
||||
* and cr (\r) and lf (\n) characters from string.
|
||||
* Only process if not empty.
|
||||
*/
|
||||
if (!empty($this->metakey))
|
||||
{
|
||||
// Array of characters to remove.
|
||||
$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 = array();
|
||||
|
||||
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 JAccessRules class
|
||||
if (!$this->getRules())
|
||||
{
|
||||
$rules = $this->getDefaultAssetValues('com_questionsanswers.question_and_answer.'.$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 JAccessRules The JAccessRules object for the asset
|
||||
*/
|
||||
protected function getDefaultAssetValues($component, $try = true)
|
||||
{
|
||||
// Need to find the asset id by the name of the component.
|
||||
$db = JFactory::getDbo();
|
||||
$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 JAccess::getAssetRules($assetId); // (TODO) instead of keeping inherited Allowed it becomes Allowed.
|
||||
}
|
||||
// try again
|
||||
elseif ($try)
|
||||
{
|
||||
$try = explode('.',$component);
|
||||
$result = $this->getDefaultAssetValues($try[0], false);
|
||||
if ($result instanceof JAccessRules)
|
||||
{
|
||||
if (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 = array();
|
||||
}
|
||||
}
|
||||
// check if there are any view values remaining
|
||||
if (count( (array) $_result))
|
||||
{
|
||||
$_result = json_encode($_result);
|
||||
$_result = array($_result);
|
||||
// Instantiate and return the JAccessRules object for the asset rules.
|
||||
$rules = new JAccessRules;
|
||||
$rules->mergeCollection($_result);
|
||||
|
||||
return $rules;
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
return JAccess::getAssetRules(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 2.5
|
||||
*/
|
||||
protected function _getAssetName()
|
||||
{
|
||||
$k = $this->_tbl_key;
|
||||
return 'com_questionsanswers.question_and_answer.'.(int) $this->$k;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to return the title to use for the asset table.
|
||||
*
|
||||
* @return string
|
||||
* @since 2.5
|
||||
*/
|
||||
protected function _getAssetTitle()
|
||||
{
|
||||
if (isset($this->title))
|
||||
{
|
||||
return $this->title;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the parent asset id for the record
|
||||
*
|
||||
* @return int
|
||||
* @since 2.5
|
||||
*/
|
||||
protected function _getAssetParentId(JTable $table = NULL, $id = NULL)
|
||||
{
|
||||
$asset = JTable::getInstance('Asset');
|
||||
$asset->loadByName('com_questionsanswers');
|
||||
|
||||
return $asset->id;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -332,6 +332,6 @@ class QuestionsanswersTableQuestion_and_answer extends JTable
|
||||
public function generateAlias()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,39 +1,39 @@
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage submitbutton.js
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
Joomla.submitbutton = function(task)
|
||||
{
|
||||
if (task == ''){
|
||||
return false;
|
||||
} else {
|
||||
var action = task.split('.');
|
||||
if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){
|
||||
Joomla.submitform(task, document.getElementById("adminForm"));
|
||||
return true;
|
||||
} else {
|
||||
alert(Joomla.JText._('help_document, some values are not acceptable.','Some values are unacceptable'));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage submitbutton.js
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
Joomla.submitbutton = function(task)
|
||||
{
|
||||
if (task == ''){
|
||||
return false;
|
||||
} else {
|
||||
var action = task.split('.');
|
||||
if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){
|
||||
Joomla.submitform(task, document.getElementById("adminForm"));
|
||||
return true;
|
||||
} else {
|
||||
alert(Joomla.JText._('help_document, some values are not acceptable.','Some values are unacceptable'));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,38 +1,37 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage edit.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage edit.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
|
||||
JHtml::_('behavior.tooltip');
|
||||
JHtml::_('behavior.formvalidation');
|
||||
JHtml::_('behavior.formvalidator');
|
||||
JHtml::_('formbehavior.chosen', 'select');
|
||||
JHtml::_('behavior.keepalive');
|
||||
$componentParams = $this->params; // will be removed just use $this->params instead
|
||||
?>
|
||||
JHtml::_('behavior.keepalive');
|
||||
$componentParams = $this->params; // will be removed just use $this->params instead
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
// waiting spinner
|
||||
var outerDiv = jQuery('body');
|
||||
@ -55,8 +54,8 @@ $componentParams = $this->params; // will be removed just use $this->params inst
|
||||
jQuery('#loading').hide();
|
||||
});
|
||||
</script>
|
||||
<div id="questionsanswers_loader" style="display: none;">
|
||||
<form action="<?php echo JRoute::_('index.php?option=com_questionsanswers&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
|
||||
<div id="questionsanswers_loader" style="display: none;">
|
||||
<form action="<?php echo JRoute::_('index.php?option=com_questionsanswers&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
|
||||
|
||||
<?php echo JLayoutHelper::render('help_document.details_above', $this); ?>
|
||||
<div class="form-horizontal">
|
||||
@ -105,8 +104,8 @@ $componentParams = $this->params; // will be removed just use $this->params inst
|
||||
</div>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
<?php echo JLayoutHelper::render('help_document.details_under', $this); ?>
|
||||
</form>
|
||||
<?php echo JLayoutHelper::render('help_document.details_under', $this); ?>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
@ -201,4 +200,4 @@ jQuery('#adminForm').on('change', '#jform_target',function (e)
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</script>
|
||||
|
@ -1,97 +1,97 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage view.html.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
/**
|
||||
* Help_document View class
|
||||
*/
|
||||
class QuestionsanswersViewHelp_document extends JViewLegacy
|
||||
{
|
||||
/**
|
||||
* display method of View
|
||||
* @return void
|
||||
*/
|
||||
public function display($tpl = null)
|
||||
{
|
||||
// set params
|
||||
$this->params = JComponentHelper::getParams('com_questionsanswers');
|
||||
// Assign the variables
|
||||
$this->form = $this->get('Form');
|
||||
$this->item = $this->get('Item');
|
||||
$this->script = $this->get('Script');
|
||||
$this->state = $this->get('State');
|
||||
// get action permissions
|
||||
$this->canDo = QuestionsanswersHelper::getActions('help_document', $this->item);
|
||||
// get input
|
||||
$jinput = JFactory::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);
|
||||
}
|
||||
|
||||
// Display the template
|
||||
parent::display($tpl);
|
||||
|
||||
// Set the document
|
||||
$this->setDocument();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Setting the toolbar
|
||||
*/
|
||||
protected function addToolBar()
|
||||
{
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage view.html.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
/**
|
||||
* Help_document View class
|
||||
*/
|
||||
class QuestionsanswersViewHelp_document extends JViewLegacy
|
||||
{
|
||||
/**
|
||||
* display method of View
|
||||
* @return void
|
||||
*/
|
||||
public function display($tpl = null)
|
||||
{
|
||||
// set params
|
||||
$this->params = JComponentHelper::getParams('com_questionsanswers');
|
||||
// Assign the variables
|
||||
$this->form = $this->get('Form');
|
||||
$this->item = $this->get('Item');
|
||||
$this->script = $this->get('Script');
|
||||
$this->state = $this->get('State');
|
||||
// get action permissions
|
||||
$this->canDo = QuestionsanswersHelper::getActions('help_document', $this->item);
|
||||
// get input
|
||||
$jinput = JFactory::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);
|
||||
}
|
||||
|
||||
// Display the template
|
||||
parent::display($tpl);
|
||||
|
||||
// Set the document
|
||||
$this->setDocument();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Setting the toolbar
|
||||
*/
|
||||
protected function addToolBar()
|
||||
{
|
||||
JFactory::getApplication()->input->set('hidemainmenu', true);
|
||||
$user = JFactory::getUser();
|
||||
$userId = $user->id;
|
||||
@ -163,47 +163,47 @@ class QuestionsanswersViewHelp_document extends JViewLegacy
|
||||
}
|
||||
JToolbarHelper::divider();
|
||||
// set help url for this view if found
|
||||
$help_url = QuestionsanswersHelper::getHelpUrl('help_document');
|
||||
if (QuestionsanswersHelper::checkString($help_url))
|
||||
$this->help_url = QuestionsanswersHelper::getHelpUrl('help_document');
|
||||
if (QuestionsanswersHelper::checkString($this->help_url))
|
||||
{
|
||||
JToolbarHelper::help('COM_QUESTIONSANSWERS_HELP_MANAGER', false, $help_url);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Escapes a value for output in a view script.
|
||||
*
|
||||
* @param mixed $var The output to escape.
|
||||
*
|
||||
* @return mixed The escaped value.
|
||||
*/
|
||||
public function escape($var)
|
||||
{
|
||||
if(strlen($var) > 30)
|
||||
{
|
||||
// use the helper htmlEscape method instead and shorten the string
|
||||
return QuestionsanswersHelper::htmlEscape($var, $this->_charset, true, 30);
|
||||
}
|
||||
// use the helper htmlEscape method instead.
|
||||
return QuestionsanswersHelper::htmlEscape($var, $this->_charset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to set up the document properties
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setDocument()
|
||||
{
|
||||
$isNew = ($this->item->id < 1);
|
||||
if (!isset($this->document))
|
||||
{
|
||||
$this->document = JFactory::getDocument();
|
||||
}
|
||||
$this->document->setTitle(JText::_($isNew ? 'COM_QUESTIONSANSWERS_HELP_DOCUMENT_NEW' : 'COM_QUESTIONSANSWERS_HELP_DOCUMENT_EDIT'));
|
||||
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_questionsanswers/assets/css/help_document.css", (QuestionsanswersHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
|
||||
$this->document->addScript(JURI::root() . $this->script, (QuestionsanswersHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
|
||||
$this->document->addScript(JURI::root() . "administrator/components/com_questionsanswers/views/help_document/submitbutton.js", (QuestionsanswersHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
|
||||
JText::script('view not acceptable. Error');
|
||||
}
|
||||
}
|
||||
JToolbarHelper::help('COM_QUESTIONSANSWERS_HELP_MANAGER', false, $this->help_url);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Escapes a value for output in a view script.
|
||||
*
|
||||
* @param mixed $var The output to escape.
|
||||
*
|
||||
* @return mixed The escaped value.
|
||||
*/
|
||||
public function escape($var)
|
||||
{
|
||||
if(strlen($var) > 30)
|
||||
{
|
||||
// use the helper htmlEscape method instead and shorten the string
|
||||
return QuestionsanswersHelper::htmlEscape($var, $this->_charset, true, 30);
|
||||
}
|
||||
// use the helper htmlEscape method instead.
|
||||
return QuestionsanswersHelper::htmlEscape($var, $this->_charset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to set up the document properties
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setDocument()
|
||||
{
|
||||
$isNew = ($this->item->id < 1);
|
||||
if (!isset($this->document))
|
||||
{
|
||||
$this->document = JFactory::getDocument();
|
||||
}
|
||||
$this->document->setTitle(JText::_($isNew ? 'COM_QUESTIONSANSWERS_HELP_DOCUMENT_NEW' : 'COM_QUESTIONSANSWERS_HELP_DOCUMENT_EDIT'));
|
||||
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_questionsanswers/assets/css/help_document.css", (QuestionsanswersHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
|
||||
$this->document->addScript(JURI::root() . $this->script, (QuestionsanswersHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
|
||||
$this->document->addScript(JURI::root() . "administrator/components/com_questionsanswers/views/help_document/submitbutton.js", (QuestionsanswersHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
|
||||
JText::script('view not acceptable. Error');
|
||||
}
|
||||
}
|
||||
|
@ -1,41 +1,40 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
JHtml::_('behavior.tooltip');
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
JHtml::_('behavior.multiselect');
|
||||
JHtml::_('dropdown.init');
|
||||
JHtml::_('formbehavior.chosen', 'select');
|
||||
if ($this->saveOrder)
|
||||
{
|
||||
$saveOrderingUrl = 'index.php?option=com_questionsanswers&task=help_documents.saveOrderAjax&tmpl=component';
|
||||
JHtml::_('sortablelist.sortable', 'help_documentList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
|
||||
}
|
||||
?>
|
||||
JHtml::_('formbehavior.chosen', 'select');
|
||||
if ($this->saveOrder)
|
||||
{
|
||||
$saveOrderingUrl = 'index.php?option=com_questionsanswers&task=help_documents.saveOrderAjax&tmpl=component';
|
||||
JHtml::_('sortablelist.sortable', 'help_documentList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
|
||||
}
|
||||
?>
|
||||
<form action="<?php echo JRoute::_('index.php?option=com_questionsanswers&view=help_documents'); ?>" method="post" name="adminForm" id="adminForm">
|
||||
<?php if(!empty( $this->sidebar)): ?>
|
||||
<div id="j-sidebar-container" class="span2">
|
||||
@ -78,4 +77,4 @@ if ($this->saveOrder)
|
||||
<?php endif; ?>
|
||||
<input type="hidden" name="task" value="" />
|
||||
<?php echo JHtml::_('form.token'); ?>
|
||||
</form>
|
||||
</form>
|
||||
|
@ -1,32 +1,32 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_batch_body.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
?>
|
||||
|
||||
<p><?php echo JText::_('COM_QUESTIONSANSWERS_HELP_DOCUMENTS_BATCH_TIP'); ?></p>
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_batch_body.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
?>
|
||||
|
||||
<p><?php echo JText::_('COM_QUESTIONSANSWERS_HELP_DOCUMENTS_BATCH_TIP'); ?></p>
|
||||
<?php echo $this->batchDisplay; ?>
|
@ -1,37 +1,37 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_batch_footer.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
?>
|
||||
<!-- clear the batch values if cancel -->
|
||||
<button class="btn" type="button" onclick="" data-dismiss="modal">
|
||||
<?php echo JText::_('JCANCEL'); ?>
|
||||
</button>
|
||||
<!-- post the batch values if process -->
|
||||
<button class="btn btn-success" type="submit" onclick="Joomla.submitbutton('help_document.batch');">
|
||||
<?php echo JText::_('JGLOBAL_BATCH_PROCESS'); ?>
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_batch_footer.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
?>
|
||||
<!-- clear the batch values if cancel -->
|
||||
<button class="btn" type="button" onclick="" data-dismiss="modal">
|
||||
<?php echo JText::_('JCANCEL'); ?>
|
||||
</button>
|
||||
<!-- post the batch values if process -->
|
||||
<button class="btn btn-success" type="submit" onclick="Joomla.submitbutton('help_document.batch');">
|
||||
<?php echo JText::_('JGLOBAL_BATCH_PROCESS'); ?>
|
||||
</button>
|
@ -1,34 +1,34 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_body.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
$edit = "index.php?option=com_questionsanswers&view=help_documents&task=help_document.edit";
|
||||
|
||||
?>
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_body.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
$edit = "index.php?option=com_questionsanswers&view=help_documents&task=help_document.edit";
|
||||
|
||||
?>
|
||||
<?php foreach ($this->items as $i => $item): ?>
|
||||
<?php
|
||||
$canCheckin = $this->user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0;
|
||||
|
@ -1,32 +1,32 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_foot.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="10"><?php echo $this->pagination->getListFooter(); ?></td>
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_foot.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="10"><?php echo $this->pagination->getListFooter(); ?></td>
|
||||
</tr>
|
@ -1,32 +1,32 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_head.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
?>
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_head.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<?php if ($this->canEdit&& $this->canState): ?>
|
||||
<th width="1%" class="nowrap center hidden-phone">
|
||||
|
@ -1,59 +1,59 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_toolbar.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
?>
|
||||
<div id="filter-bar" class="btn-toolbar">
|
||||
<div class="filter-search btn-group pull-left">
|
||||
<label for="filter_search" class="element-invisible"><?php echo JText::_('Search');?></label>
|
||||
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo JText::_('JSEARCH_FILTER'); ?>" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" class="hasTooltip" title="<?php echo JHtml::tooltipText('Search Help_documents'); ?>" />
|
||||
</div>
|
||||
<div class="btn-group pull-left">
|
||||
<button type="submit" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i></button>
|
||||
<button type="button" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.id('filter_search').value='';this.form.submit();"><i class="icon-remove"></i></button>
|
||||
</div>
|
||||
<div class="btn-group pull-right hidden-phone">
|
||||
<label for="limit" class="element-invisible"><?php echo JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label>
|
||||
<?php echo $this->pagination->getLimitBox(); ?>
|
||||
</div>
|
||||
<div class="btn-group pull-right hidden-phone">
|
||||
<label for="directionTable" class="element-invisible"><?php echo JText::_('JFIELD_ORDERING_DESC');?></label>
|
||||
<select name="directionTable" id="directionTable" class="input-medium" onchange="Joomla.orderTable()">
|
||||
<option value=""><?php echo JText::_('JFIELD_ORDERING_DESC');?></option>
|
||||
<option value="asc" <?php if ($this->listDirn == 'asc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_ASCENDING');?></option>
|
||||
<option value="desc" <?php if ($this->listDirn == 'desc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_DESCENDING');?></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="btn-group pull-right">
|
||||
<label for="sortTable" class="element-invisible"><?php echo JText::_('JGLOBAL_SORT_BY');?></label>
|
||||
<select name="sortTable" id="sortTable" class="input-medium" onchange="Joomla.orderTable()">
|
||||
<option value=""><?php echo JText::_('JGLOBAL_SORT_BY');?></option>
|
||||
<?php echo JHtml::_('select.options', $this->getSortFields(), 'value', 'text', $this->listOrder);?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_toolbar.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
?>
|
||||
<div id="filter-bar" class="btn-toolbar">
|
||||
<div class="filter-search btn-group pull-left">
|
||||
<label for="filter_search" class="element-invisible"><?php echo JText::_('Search');?></label>
|
||||
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo JText::_('JSEARCH_FILTER'); ?>" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" class="hasTooltip" title="<?php echo JHtml::tooltipText('Search Help_documents'); ?>" />
|
||||
</div>
|
||||
<div class="btn-group pull-left">
|
||||
<button type="submit" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i></button>
|
||||
<button type="button" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.id('filter_search').value='';this.form.submit();"><i class="icon-remove"></i></button>
|
||||
</div>
|
||||
<div class="btn-group pull-right hidden-phone">
|
||||
<label for="limit" class="element-invisible"><?php echo JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label>
|
||||
<?php echo $this->pagination->getLimitBox(); ?>
|
||||
</div>
|
||||
<div class="btn-group pull-right hidden-phone">
|
||||
<label for="directionTable" class="element-invisible"><?php echo JText::_('JFIELD_ORDERING_DESC');?></label>
|
||||
<select name="directionTable" id="directionTable" class="input-medium" onchange="Joomla.orderTable()">
|
||||
<option value=""><?php echo JText::_('JFIELD_ORDERING_DESC');?></option>
|
||||
<option value="asc" <?php if ($this->listDirn == 'asc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_ASCENDING');?></option>
|
||||
<option value="desc" <?php if ($this->listDirn == 'desc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_DESCENDING');?></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="btn-group pull-right">
|
||||
<label for="sortTable" class="element-invisible"><?php echo JText::_('JGLOBAL_SORT_BY');?></label>
|
||||
<select name="sortTable" id="sortTable" class="input-medium" onchange="Joomla.orderTable()">
|
||||
<option value=""><?php echo JText::_('JGLOBAL_SORT_BY');?></option>
|
||||
<?php echo JHtml::_('select.options', $this->getSortFields(), 'value', 'text', $this->listOrder);?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix"> </div>
|
@ -1,52 +1,52 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage view.html.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
/**
|
||||
* Questionsanswers View class for the Help_documents
|
||||
*/
|
||||
class QuestionsanswersViewHelp_documents extends JViewLegacy
|
||||
{
|
||||
/**
|
||||
* Help_documents view display method
|
||||
* @return void
|
||||
*/
|
||||
function display($tpl = null)
|
||||
{
|
||||
if ($this->getLayout() !== 'modal')
|
||||
{
|
||||
// Include helper submenu
|
||||
QuestionsanswersHelper::addSubmenu('help_documents');
|
||||
}
|
||||
|
||||
// Assign data to the view
|
||||
$this->items = $this->get('Items');
|
||||
$this->pagination = $this->get('Pagination');
|
||||
$this->state = $this->get('State');
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage view.html.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
/**
|
||||
* Questionsanswers View class for the Help_documents
|
||||
*/
|
||||
class QuestionsanswersViewHelp_documents extends JViewLegacy
|
||||
{
|
||||
/**
|
||||
* Help_documents view display method
|
||||
* @return void
|
||||
*/
|
||||
function display($tpl = null)
|
||||
{
|
||||
if ($this->getLayout() !== 'modal')
|
||||
{
|
||||
// Include helper submenu
|
||||
QuestionsanswersHelper::addSubmenu('help_documents');
|
||||
}
|
||||
|
||||
// Assign data to the view
|
||||
$this->items = $this->get('Items');
|
||||
$this->pagination = $this->get('Pagination');
|
||||
$this->state = $this->get('State');
|
||||
$this->user = JFactory::getUser();
|
||||
// Load the filter form from xml.
|
||||
$this->filterForm = $this->get('FilterForm');
|
||||
@ -54,122 +54,122 @@ class QuestionsanswersViewHelp_documents extends JViewLegacy
|
||||
$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) JUri::getInstance()));
|
||||
// get global action permissions
|
||||
$this->listDirn = $this->escape($this->state->get('list.direction', 'DESC'));
|
||||
$this->saveOrder = $this->listOrder == 'a.ordering';
|
||||
// set the return here value
|
||||
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
|
||||
// get global action permissions
|
||||
$this->canDo = QuestionsanswersHelper::getActions('help_document');
|
||||
$this->canEdit = $this->canDo->get('help_document.edit');
|
||||
$this->canState = $this->canDo->get('help_document.edit.state');
|
||||
$this->canCreate = $this->canDo->get('help_document.create');
|
||||
$this->canDelete = $this->canDo->get('help_document.delete');
|
||||
$this->canBatch = $this->canDo->get('core.batch');
|
||||
|
||||
// We don't need toolbar in the modal window.
|
||||
if ($this->getLayout() !== 'modal')
|
||||
{
|
||||
$this->addToolbar();
|
||||
$this->sidebar = JHtmlSidebar::render();
|
||||
// load the batch html
|
||||
if ($this->canCreate && $this->canEdit && $this->canState)
|
||||
{
|
||||
$this->batchDisplay = JHtmlBatch_::render();
|
||||
}
|
||||
}
|
||||
|
||||
// Check for errors.
|
||||
if (count($errors = $this->get('Errors')))
|
||||
{
|
||||
throw new Exception(implode("\n", $errors), 500);
|
||||
}
|
||||
|
||||
// Display the template
|
||||
parent::display($tpl);
|
||||
|
||||
// Set the document
|
||||
$this->setDocument();
|
||||
}
|
||||
|
||||
/**
|
||||
* Setting the toolbar
|
||||
*/
|
||||
protected function addToolBar()
|
||||
{
|
||||
JToolBarHelper::title(JText::_('COM_QUESTIONSANSWERS_HELP_DOCUMENTS'), 'support');
|
||||
JHtmlSidebar::setAction('index.php?option=com_questionsanswers&view=help_documents');
|
||||
JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
|
||||
|
||||
if ($this->canCreate)
|
||||
{
|
||||
JToolBarHelper::addNew('help_document.add');
|
||||
}
|
||||
|
||||
// Only load if there are items
|
||||
if (QuestionsanswersHelper::checkArray($this->items))
|
||||
{
|
||||
if ($this->canEdit)
|
||||
{
|
||||
JToolBarHelper::editList('help_document.edit');
|
||||
}
|
||||
|
||||
if ($this->canState)
|
||||
{
|
||||
JToolBarHelper::publishList('help_documents.publish');
|
||||
JToolBarHelper::unpublishList('help_documents.unpublish');
|
||||
JToolBarHelper::archiveList('help_documents.archive');
|
||||
|
||||
if ($this->canDo->get('core.admin'))
|
||||
{
|
||||
JToolBarHelper::checkin('help_documents.checkin');
|
||||
}
|
||||
}
|
||||
|
||||
// Add a batch button
|
||||
if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState)
|
||||
{
|
||||
// Get the toolbar object instance
|
||||
$bar = JToolBar::getInstance('toolbar');
|
||||
// set the batch button name
|
||||
$title = JText::_('JTOOLBAR_BATCH');
|
||||
// Instantiate a new JLayoutFile instance and render the batch button
|
||||
$layout = new JLayoutFile('joomla.toolbar.batch');
|
||||
// add the button to the page
|
||||
$dhtml = $layout->render(array('title' => $title));
|
||||
$bar->appendButton('Custom', $dhtml, 'batch');
|
||||
}
|
||||
|
||||
if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete))
|
||||
{
|
||||
JToolbarHelper::deleteList('', 'help_documents.delete', 'JTOOLBAR_EMPTY_TRASH');
|
||||
}
|
||||
elseif ($this->canState && $this->canDelete)
|
||||
{
|
||||
JToolbarHelper::trash('help_documents.trash');
|
||||
$this->canBatch = $this->canDo->get('core.batch');
|
||||
|
||||
// We don't need toolbar in the modal window.
|
||||
if ($this->getLayout() !== 'modal')
|
||||
{
|
||||
$this->addToolbar();
|
||||
$this->sidebar = JHtmlSidebar::render();
|
||||
// load the batch html
|
||||
if ($this->canCreate && $this->canEdit && $this->canState)
|
||||
{
|
||||
$this->batchDisplay = JHtmlBatch_::render();
|
||||
}
|
||||
}
|
||||
|
||||
// Check for errors.
|
||||
if (count($errors = $this->get('Errors')))
|
||||
{
|
||||
throw new Exception(implode("\n", $errors), 500);
|
||||
}
|
||||
|
||||
// Display the template
|
||||
parent::display($tpl);
|
||||
|
||||
// Set the document
|
||||
$this->setDocument();
|
||||
}
|
||||
|
||||
/**
|
||||
* Setting the toolbar
|
||||
*/
|
||||
protected function addToolBar()
|
||||
{
|
||||
JToolBarHelper::title(JText::_('COM_QUESTIONSANSWERS_HELP_DOCUMENTS'), 'support');
|
||||
JHtmlSidebar::setAction('index.php?option=com_questionsanswers&view=help_documents');
|
||||
JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
|
||||
|
||||
if ($this->canCreate)
|
||||
{
|
||||
JToolBarHelper::addNew('help_document.add');
|
||||
}
|
||||
|
||||
// Only load if there are items
|
||||
if (QuestionsanswersHelper::checkArray($this->items))
|
||||
{
|
||||
if ($this->canEdit)
|
||||
{
|
||||
JToolBarHelper::editList('help_document.edit');
|
||||
}
|
||||
|
||||
if ($this->canState)
|
||||
{
|
||||
JToolBarHelper::publishList('help_documents.publish');
|
||||
JToolBarHelper::unpublishList('help_documents.unpublish');
|
||||
JToolBarHelper::archiveList('help_documents.archive');
|
||||
|
||||
if ($this->canDo->get('core.admin'))
|
||||
{
|
||||
JToolBarHelper::checkin('help_documents.checkin');
|
||||
}
|
||||
}
|
||||
|
||||
// Add a batch button
|
||||
if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState)
|
||||
{
|
||||
// Get the toolbar object instance
|
||||
$bar = JToolBar::getInstance('toolbar');
|
||||
// set the batch button name
|
||||
$title = JText::_('JTOOLBAR_BATCH');
|
||||
// Instantiate a new JLayoutFile instance and render the batch button
|
||||
$layout = new JLayoutFile('joomla.toolbar.batch');
|
||||
// add the button to the page
|
||||
$dhtml = $layout->render(array('title' => $title));
|
||||
$bar->appendButton('Custom', $dhtml, 'batch');
|
||||
}
|
||||
|
||||
if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete))
|
||||
{
|
||||
JToolbarHelper::deleteList('', 'help_documents.delete', 'JTOOLBAR_EMPTY_TRASH');
|
||||
}
|
||||
elseif ($this->canState && $this->canDelete)
|
||||
{
|
||||
JToolbarHelper::trash('help_documents.trash');
|
||||
}
|
||||
|
||||
if ($this->canDo->get('core.export') && $this->canDo->get('help_document.export'))
|
||||
{
|
||||
JToolBarHelper::custom('help_documents.exportData', 'download', '', 'COM_QUESTIONSANSWERS_EXPORT_DATA', true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->canDo->get('core.import') && $this->canDo->get('help_document.import'))
|
||||
{
|
||||
JToolBarHelper::custom('help_documents.importData', 'upload', '', 'COM_QUESTIONSANSWERS_IMPORT_DATA', false);
|
||||
}
|
||||
|
||||
// set help url for this view if found
|
||||
$help_url = QuestionsanswersHelper::getHelpUrl('help_documents');
|
||||
if (QuestionsanswersHelper::checkString($help_url))
|
||||
{
|
||||
JToolbarHelper::help('COM_QUESTIONSANSWERS_HELP_MANAGER', false, $help_url);
|
||||
}
|
||||
|
||||
// add the options comp button
|
||||
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
|
||||
{
|
||||
JToolBarHelper::preferences('com_questionsanswers');
|
||||
}
|
||||
|
||||
// set help url for this view if found
|
||||
$this->help_url = QuestionsanswersHelper::getHelpUrl('help_documents');
|
||||
if (QuestionsanswersHelper::checkString($this->help_url))
|
||||
{
|
||||
JToolbarHelper::help('COM_QUESTIONSANSWERS_HELP_MANAGER', false, $this->help_url);
|
||||
}
|
||||
|
||||
// add the options comp button
|
||||
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
|
||||
{
|
||||
JToolBarHelper::preferences('com_questionsanswers');
|
||||
}
|
||||
|
||||
// Only load published batch if state and batch is allowed
|
||||
@ -260,49 +260,49 @@ class QuestionsanswersViewHelp_documents extends JViewLegacy
|
||||
'batch[site_view]',
|
||||
JHtml::_('select.options', $this->site_viewOptions, 'value', 'text')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to set up the document properties
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setDocument()
|
||||
{
|
||||
if (!isset($this->document))
|
||||
{
|
||||
$this->document = JFactory::getDocument();
|
||||
}
|
||||
$this->document->setTitle(JText::_('COM_QUESTIONSANSWERS_HELP_DOCUMENTS'));
|
||||
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_questionsanswers/assets/css/help_documents.css", (QuestionsanswersHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
|
||||
}
|
||||
|
||||
/**
|
||||
* Escapes a value for output in a view script.
|
||||
*
|
||||
* @param mixed $var The output to escape.
|
||||
*
|
||||
* @return mixed The escaped value.
|
||||
*/
|
||||
public function escape($var)
|
||||
{
|
||||
if(strlen($var) > 50)
|
||||
{
|
||||
// use the helper htmlEscape method instead and shorten the string
|
||||
return QuestionsanswersHelper::htmlEscape($var, $this->_charset, true);
|
||||
}
|
||||
// use the helper htmlEscape method instead.
|
||||
return QuestionsanswersHelper::htmlEscape($var, $this->_charset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of fields the table can be sorted by
|
||||
*
|
||||
* @return array Array containing the field name to sort by as the key and display text as value
|
||||
*/
|
||||
protected function getSortFields()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to set up the document properties
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setDocument()
|
||||
{
|
||||
if (!isset($this->document))
|
||||
{
|
||||
$this->document = JFactory::getDocument();
|
||||
}
|
||||
$this->document->setTitle(JText::_('COM_QUESTIONSANSWERS_HELP_DOCUMENTS'));
|
||||
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_questionsanswers/assets/css/help_documents.css", (QuestionsanswersHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
|
||||
}
|
||||
|
||||
/**
|
||||
* Escapes a value for output in a view script.
|
||||
*
|
||||
* @param mixed $var The output to escape.
|
||||
*
|
||||
* @return mixed The escaped value.
|
||||
*/
|
||||
public function escape($var)
|
||||
{
|
||||
if(strlen($var) > 50)
|
||||
{
|
||||
// use the helper htmlEscape method instead and shorten the string
|
||||
return QuestionsanswersHelper::htmlEscape($var, $this->_charset, true);
|
||||
}
|
||||
// use the helper htmlEscape method instead.
|
||||
return QuestionsanswersHelper::htmlEscape($var, $this->_charset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of fields the table can be sorted by
|
||||
*
|
||||
* @return array Array containing the field name to sort by as the key and display text as value
|
||||
*/
|
||||
protected function getSortFields()
|
||||
{
|
||||
return array(
|
||||
'a.ordering' => JText::_('JGRID_HEADING_ORDERING'),
|
||||
'a.published' => JText::_('JSTATUS'),
|
||||
@ -312,6 +312,6 @@ class QuestionsanswersViewHelp_documents extends JViewLegacy
|
||||
'g.' => JText::_('COM_QUESTIONSANSWERS_HELP_DOCUMENT_ADMIN_VIEW_LABEL'),
|
||||
'h.' => JText::_('COM_QUESTIONSANSWERS_HELP_DOCUMENT_SITE_VIEW_LABEL'),
|
||||
'a.id' => JText::_('JGRID_HEADING_ID')
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -1,231 +1,231 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
JHtml::_('jquery.framework');
|
||||
JHtml::_('bootstrap.tooltip');
|
||||
JHtml::_('script', 'system/core.js', false, true);
|
||||
JHtml::_('behavior.keepalive');
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
<?php if ($this->hasPackage && QuestionsanswersHelper::checkArray($this->headerList)) : ?>
|
||||
Joomla.continueImport = function()
|
||||
{
|
||||
var form = document.getElementById('adminForm');
|
||||
var error = false;
|
||||
var therequired = [<?php $i = 0; foreach($this->headerList as $name => $title) { echo ($i != 0)? ', "vdm_'.$name.'"':'"vdm_'.$name.'"'; $i++; } ?>];
|
||||
for(i = 0; i < therequired.length; i++)
|
||||
{
|
||||
if(jQuery('#'+therequired[i]).val() == "" )
|
||||
{
|
||||
error = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// do field validation
|
||||
if (error)
|
||||
{
|
||||
alert("<?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_MSG_PLEASE_SELECT_ALL_COLUMNS', true); ?>");
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#loading').css('display', 'block');
|
||||
|
||||
form.gettype.value = 'continue';
|
||||
form.submit();
|
||||
}
|
||||
};
|
||||
<?php else: ?>
|
||||
Joomla.submitbutton = function()
|
||||
{
|
||||
var form = document.getElementById('adminForm');
|
||||
|
||||
// do field validation
|
||||
if (form.import_package.value == "")
|
||||
{
|
||||
alert("<?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_MSG_PLEASE_SELECT_A_FILE', true); ?>");
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#loading').css('display', 'block');
|
||||
|
||||
form.gettype.value = 'upload';
|
||||
form.submit();
|
||||
}
|
||||
};
|
||||
|
||||
Joomla.submitbutton3 = function()
|
||||
{
|
||||
var form = document.getElementById('adminForm');
|
||||
|
||||
// do field validation
|
||||
if (form.import_directory.value == ""){
|
||||
alert("<?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_MSG_PLEASE_SELECT_A_DIRECTORY', true); ?>");
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#loading').css('display', 'block');
|
||||
|
||||
form.gettype.value = 'folder';
|
||||
form.submit();
|
||||
}
|
||||
};
|
||||
|
||||
Joomla.submitbutton4 = function()
|
||||
{
|
||||
var form = document.getElementById('adminForm');
|
||||
|
||||
// do field validation
|
||||
if (form.import_url.value == "" || form.import_url.value == "http://")
|
||||
{
|
||||
alert("<?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_MSG_ENTER_A_URL', true); ?>");
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#loading').css('display', 'block');
|
||||
|
||||
form.gettype.value = 'url';
|
||||
form.submit();
|
||||
}
|
||||
};
|
||||
<?php endif; ?>
|
||||
|
||||
// Add spindle-wheel for importations:
|
||||
jQuery(document).ready(function($) {
|
||||
var outerDiv = $('body');
|
||||
|
||||
$('<div id="loading"></div>')
|
||||
.css("background", "rgba(255, 255, 255, .8) url('components/com_questionsanswers/assets/images/import.gif') 50% 15% no-repeat")
|
||||
.css("top", outerDiv.position().top - $(window).scrollTop())
|
||||
.css("left", outerDiv.position().left - $(window).scrollLeft())
|
||||
.css("width", outerDiv.width())
|
||||
.css("height", outerDiv.height())
|
||||
.css("position", "fixed")
|
||||
.css("opacity", "0.80")
|
||||
.css("-ms-filter", "progid:DXImageTransform.Microsoft.Alpha(Opacity = 80)")
|
||||
.css("filter", "alpha(opacity = 80)")
|
||||
.css("display", "none")
|
||||
.appendTo(outerDiv);
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<div id="installer-import" class="clearfix">
|
||||
<form enctype="multipart/form-data" action="<?php echo JRoute::_('index.php?option=com_questionsanswers&view=import');?>" method="post" name="adminForm" id="adminForm" class="form-horizontal form-validate">
|
||||
|
||||
<?php if (!empty( $this->sidebar)) : ?>
|
||||
<div id="j-sidebar-container" class="span2">
|
||||
<?php echo $this->sidebar; ?>
|
||||
</div>
|
||||
<div id="j-main-container" class="span10">
|
||||
<?php else : ?>
|
||||
<div id="j-main-container">
|
||||
<?php endif;?>
|
||||
|
||||
<?php if ($this->hasPackage && QuestionsanswersHelper::checkArray($this->headerList) && QuestionsanswersHelper::checkArray($this->headers)) : ?>
|
||||
<fieldset class="uploadform">
|
||||
<legend><?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_LINK_FILE_TO_TABLE_COLUMNS'); ?></legend>
|
||||
<div class="control-group">
|
||||
<label class="control-label" ><h4><?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_TABLE_COLUMNS'); ?></h4></label>
|
||||
<div class="controls">
|
||||
<label class="control-label" ><h4><?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_FILE_COLUMNS'); ?></h4></label>
|
||||
</div>
|
||||
</div>
|
||||
<?php foreach($this->headerList as $name => $title): ?>
|
||||
<div class="control-group">
|
||||
<label for="<?php echo $name; ?>" class="control-label" ><?php echo $title; ?></label>
|
||||
<div class="controls">
|
||||
<select name="<?php echo $name; ?>" id="vdm_<?php echo $name; ?>" required class="required input_box" >
|
||||
<option value=""><?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_PLEASE_SELECT_COLUMN'); ?></option>
|
||||
<option value="IGNORE"><?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_IGNORE_COLUMN'); ?></option>
|
||||
<?php foreach($this->headers as $value => $option): ?>
|
||||
<?php $selected = (strtolower($option) == strtolower ($title) || strtolower($option) == strtolower($name))? 'selected="selected"':''; ?>
|
||||
<option value="<?php echo QuestionsanswersHelper::htmlEscape($value); ?>" class="required" <?php echo $selected ?>><?php echo QuestionsanswersHelper::htmlEscape($option); ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<div class="form-actions">
|
||||
<input class="btn btn-primary" type="button" value="<?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_CONTINUE'); ?>" onclick="Joomla.continueImport()" />
|
||||
</div>
|
||||
</fieldset>
|
||||
<input type="hidden" name="gettype" value="continue" />
|
||||
<?php else: ?>
|
||||
<?php echo JHtml::_('bootstrap.startTabSet', 'myTab', array('active' => 'upload')); ?>
|
||||
|
||||
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'upload', JText::_('COM_QUESTIONSANSWERS_IMPORT_FROM_UPLOAD', true)); ?>
|
||||
<fieldset class="uploadform">
|
||||
<legend><?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_UPDATE_DATA'); ?></legend>
|
||||
<div class="control-group">
|
||||
<label for="import_package" class="control-label"><?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_SELECT_FILE'); ?></label>
|
||||
<div class="controls">
|
||||
<input class="input_box" id="import_package" name="import_package" type="file" size="57" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<input class="btn btn-primary" type="button" value="<?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_UPLOAD_BOTTON'); ?>" onclick="Joomla.submitbutton()" /> <small><?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_FORMATS_ACCEPTED'); ?> (.csv .xls .ods)</small>
|
||||
</div>
|
||||
</fieldset>
|
||||
<?php echo JHtml::_('bootstrap.endTab'); ?>
|
||||
|
||||
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'directory', JText::_('COM_QUESTIONSANSWERS_IMPORT_FROM_DIRECTORY', true)); ?>
|
||||
<fieldset class="uploadform">
|
||||
<legend><?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_UPDATE_DATA'); ?></legend>
|
||||
<div class="control-group">
|
||||
<label for="import_directory" class="control-label"><?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_SELECT_FILE_DIRECTORY'); ?></label>
|
||||
<div class="controls">
|
||||
<input type="text" id="import_directory" name="import_directory" class="span5 input_box" size="70" value="<?php echo $this->state->get('import.directory'); ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<input type="button" class="btn btn-primary" value="<?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_GET_BOTTON'); ?>" onclick="Joomla.submitbutton3()" /> <small><?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_FORMATS_ACCEPTED'); ?> (.csv .xls .ods)</small>
|
||||
</div>
|
||||
</fieldset>
|
||||
<?php echo JHtml::_('bootstrap.endTab'); ?>
|
||||
|
||||
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'url', JText::_('COM_QUESTIONSANSWERS_IMPORT_FROM_URL', true)); ?>
|
||||
<fieldset class="uploadform">
|
||||
<legend><?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_UPDATE_DATA'); ?></legend>
|
||||
<div class="control-group">
|
||||
<label for="import_url" class="control-label"><?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_SELECT_FILE_URL'); ?></label>
|
||||
<div class="controls">
|
||||
<input type="text" id="import_url" name="import_url" class="span5 input_box" size="70" value="http://" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<input type="button" class="btn btn-primary" value="<?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_GET_BOTTON'); ?>" onclick="Joomla.submitbutton4()" /> <small><?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_FORMATS_ACCEPTED'); ?> (.csv .xls .ods)</small>
|
||||
</div>
|
||||
</fieldset>
|
||||
<?php echo JHtml::_('bootstrap.endTab'); ?>
|
||||
<?php echo JHtml::_('bootstrap.endTabSet'); ?>
|
||||
<input type="hidden" name="gettype" value="upload" />
|
||||
<?php endif; ?>
|
||||
<input type="hidden" name="task" value="import.import" />
|
||||
<?php echo JHtml::_('form.token'); ?>
|
||||
</form>
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
JHtml::_('jquery.framework');
|
||||
JHtml::_('bootstrap.tooltip');
|
||||
JHtml::_('script', 'system/core.js', false, true);
|
||||
JHtml::_('behavior.keepalive');
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
<?php if ($this->hasPackage && QuestionsanswersHelper::checkArray($this->headerList)) : ?>
|
||||
Joomla.continueImport = function()
|
||||
{
|
||||
var form = document.getElementById('adminForm');
|
||||
var error = false;
|
||||
var therequired = [<?php $i = 0; foreach($this->headerList as $name => $title) { echo ($i != 0)? ', "vdm_'.$name.'"':'"vdm_'.$name.'"'; $i++; } ?>];
|
||||
for(i = 0; i < therequired.length; i++)
|
||||
{
|
||||
if(jQuery('#'+therequired[i]).val() == "" )
|
||||
{
|
||||
error = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// do field validation
|
||||
if (error)
|
||||
{
|
||||
alert("<?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_MSG_PLEASE_SELECT_ALL_COLUMNS', true); ?>");
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#loading').css('display', 'block');
|
||||
|
||||
form.gettype.value = 'continue';
|
||||
form.submit();
|
||||
}
|
||||
};
|
||||
<?php else: ?>
|
||||
Joomla.submitbutton = function()
|
||||
{
|
||||
var form = document.getElementById('adminForm');
|
||||
|
||||
// do field validation
|
||||
if (form.import_package.value == "")
|
||||
{
|
||||
alert("<?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_MSG_PLEASE_SELECT_A_FILE', true); ?>");
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#loading').css('display', 'block');
|
||||
|
||||
form.gettype.value = 'upload';
|
||||
form.submit();
|
||||
}
|
||||
};
|
||||
|
||||
Joomla.submitbutton3 = function()
|
||||
{
|
||||
var form = document.getElementById('adminForm');
|
||||
|
||||
// do field validation
|
||||
if (form.import_directory.value == ""){
|
||||
alert("<?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_MSG_PLEASE_SELECT_A_DIRECTORY', true); ?>");
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#loading').css('display', 'block');
|
||||
|
||||
form.gettype.value = 'folder';
|
||||
form.submit();
|
||||
}
|
||||
};
|
||||
|
||||
Joomla.submitbutton4 = function()
|
||||
{
|
||||
var form = document.getElementById('adminForm');
|
||||
|
||||
// do field validation
|
||||
if (form.import_url.value == "" || form.import_url.value == "http://")
|
||||
{
|
||||
alert("<?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_MSG_ENTER_A_URL', true); ?>");
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#loading').css('display', 'block');
|
||||
|
||||
form.gettype.value = 'url';
|
||||
form.submit();
|
||||
}
|
||||
};
|
||||
<?php endif; ?>
|
||||
|
||||
// Add spindle-wheel for importations:
|
||||
jQuery(document).ready(function($) {
|
||||
var outerDiv = $('body');
|
||||
|
||||
$('<div id="loading"></div>')
|
||||
.css("background", "rgba(255, 255, 255, .8) url('components/com_questionsanswers/assets/images/import.gif') 50% 15% no-repeat")
|
||||
.css("top", outerDiv.position().top - $(window).scrollTop())
|
||||
.css("left", outerDiv.position().left - $(window).scrollLeft())
|
||||
.css("width", outerDiv.width())
|
||||
.css("height", outerDiv.height())
|
||||
.css("position", "fixed")
|
||||
.css("opacity", "0.80")
|
||||
.css("-ms-filter", "progid:DXImageTransform.Microsoft.Alpha(Opacity = 80)")
|
||||
.css("filter", "alpha(opacity = 80)")
|
||||
.css("display", "none")
|
||||
.appendTo(outerDiv);
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<div id="installer-import" class="clearfix">
|
||||
<form enctype="multipart/form-data" action="<?php echo JRoute::_('index.php?option=com_questionsanswers&view=import');?>" method="post" name="adminForm" id="adminForm" class="form-horizontal form-validate">
|
||||
|
||||
<?php if (!empty( $this->sidebar)) : ?>
|
||||
<div id="j-sidebar-container" class="span2">
|
||||
<?php echo $this->sidebar; ?>
|
||||
</div>
|
||||
<div id="j-main-container" class="span10">
|
||||
<?php else : ?>
|
||||
<div id="j-main-container">
|
||||
<?php endif;?>
|
||||
|
||||
<?php if ($this->hasPackage && QuestionsanswersHelper::checkArray($this->headerList) && QuestionsanswersHelper::checkArray($this->headers)) : ?>
|
||||
<fieldset class="uploadform">
|
||||
<legend><?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_LINK_FILE_TO_TABLE_COLUMNS'); ?></legend>
|
||||
<div class="control-group">
|
||||
<label class="control-label" ><h4><?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_TABLE_COLUMNS'); ?></h4></label>
|
||||
<div class="controls">
|
||||
<label class="control-label" ><h4><?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_FILE_COLUMNS'); ?></h4></label>
|
||||
</div>
|
||||
</div>
|
||||
<?php foreach($this->headerList as $name => $title): ?>
|
||||
<div class="control-group">
|
||||
<label for="<?php echo $name; ?>" class="control-label" ><?php echo $title; ?></label>
|
||||
<div class="controls">
|
||||
<select name="<?php echo $name; ?>" id="vdm_<?php echo $name; ?>" required class="required input_box" >
|
||||
<option value=""><?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_PLEASE_SELECT_COLUMN'); ?></option>
|
||||
<option value="IGNORE"><?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_IGNORE_COLUMN'); ?></option>
|
||||
<?php foreach($this->headers as $value => $option): ?>
|
||||
<?php $selected = (strtolower($option) == strtolower ($title) || strtolower($option) == strtolower($name))? 'selected="selected"':''; ?>
|
||||
<option value="<?php echo QuestionsanswersHelper::htmlEscape($value); ?>" class="required" <?php echo $selected ?>><?php echo QuestionsanswersHelper::htmlEscape($option); ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<div class="form-actions">
|
||||
<input class="btn btn-primary" type="button" value="<?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_CONTINUE'); ?>" onclick="Joomla.continueImport()" />
|
||||
</div>
|
||||
</fieldset>
|
||||
<input type="hidden" name="gettype" value="continue" />
|
||||
<?php else: ?>
|
||||
<?php echo JHtml::_('bootstrap.startTabSet', 'myTab', array('active' => 'upload')); ?>
|
||||
|
||||
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'upload', JText::_('COM_QUESTIONSANSWERS_IMPORT_FROM_UPLOAD', true)); ?>
|
||||
<fieldset class="uploadform">
|
||||
<legend><?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_UPDATE_DATA'); ?></legend>
|
||||
<div class="control-group">
|
||||
<label for="import_package" class="control-label"><?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_SELECT_FILE'); ?></label>
|
||||
<div class="controls">
|
||||
<input class="input_box" id="import_package" name="import_package" type="file" size="57" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<input class="btn btn-primary" type="button" value="<?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_UPLOAD_BOTTON'); ?>" onclick="Joomla.submitbutton()" /> <small><?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_FORMATS_ACCEPTED'); ?> (.csv .xls .ods)</small>
|
||||
</div>
|
||||
</fieldset>
|
||||
<?php echo JHtml::_('bootstrap.endTab'); ?>
|
||||
|
||||
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'directory', JText::_('COM_QUESTIONSANSWERS_IMPORT_FROM_DIRECTORY', true)); ?>
|
||||
<fieldset class="uploadform">
|
||||
<legend><?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_UPDATE_DATA'); ?></legend>
|
||||
<div class="control-group">
|
||||
<label for="import_directory" class="control-label"><?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_SELECT_FILE_DIRECTORY'); ?></label>
|
||||
<div class="controls">
|
||||
<input type="text" id="import_directory" name="import_directory" class="span5 input_box" size="70" value="<?php echo $this->state->get('import.directory'); ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<input type="button" class="btn btn-primary" value="<?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_GET_BOTTON'); ?>" onclick="Joomla.submitbutton3()" /> <small><?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_FORMATS_ACCEPTED'); ?> (.csv .xls .ods)</small>
|
||||
</div>
|
||||
</fieldset>
|
||||
<?php echo JHtml::_('bootstrap.endTab'); ?>
|
||||
|
||||
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'url', JText::_('COM_QUESTIONSANSWERS_IMPORT_FROM_URL', true)); ?>
|
||||
<fieldset class="uploadform">
|
||||
<legend><?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_UPDATE_DATA'); ?></legend>
|
||||
<div class="control-group">
|
||||
<label for="import_url" class="control-label"><?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_SELECT_FILE_URL'); ?></label>
|
||||
<div class="controls">
|
||||
<input type="text" id="import_url" name="import_url" class="span5 input_box" size="70" value="http://" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<input type="button" class="btn btn-primary" value="<?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_GET_BOTTON'); ?>" onclick="Joomla.submitbutton4()" /> <small><?php echo JText::_('COM_QUESTIONSANSWERS_IMPORT_FORMATS_ACCEPTED'); ?> (.csv .xls .ods)</small>
|
||||
</div>
|
||||
</fieldset>
|
||||
<?php echo JHtml::_('bootstrap.endTab'); ?>
|
||||
<?php echo JHtml::_('bootstrap.endTabSet'); ?>
|
||||
<input type="hidden" name="gettype" value="upload" />
|
||||
<?php endif; ?>
|
||||
<input type="hidden" name="task" value="import.import" />
|
||||
<?php echo JHtml::_('form.token'); ?>
|
||||
</form>
|
||||
</div>
|
@ -1,107 +1,107 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage view.html.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
/**
|
||||
* Questionsanswers Import View
|
||||
*/
|
||||
class QuestionsanswersViewImport extends JViewLegacy
|
||||
{
|
||||
protected $headerList;
|
||||
protected $hasPackage = false;
|
||||
protected $headers;
|
||||
protected $hasHeader = 0;
|
||||
protected $dataType;
|
||||
|
||||
public function display($tpl = null)
|
||||
{
|
||||
if ($this->getLayout() !== 'modal')
|
||||
{
|
||||
// Include helper submenu
|
||||
QuestionsanswersHelper::addSubmenu('import');
|
||||
}
|
||||
|
||||
$paths = new stdClass;
|
||||
$paths->first = '';
|
||||
$state = $this->get('state');
|
||||
|
||||
$this->paths = &$paths;
|
||||
$this->state = &$state;
|
||||
// get global action permissions
|
||||
$this->canDo = QuestionsanswersHelper::getActions('import');
|
||||
|
||||
// We don't need toolbar in the modal window.
|
||||
if ($this->getLayout() !== 'modal')
|
||||
{
|
||||
$this->addToolbar();
|
||||
$this->sidebar = JHtmlSidebar::render();
|
||||
}
|
||||
|
||||
// get the session object
|
||||
$session = JFactory::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 = QuestionsanswersHelper::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);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setting the toolbar
|
||||
*/
|
||||
protected function addToolBar()
|
||||
{
|
||||
JToolBarHelper::title(JText::_('COM_QUESTIONSANSWERS_IMPORT_TITLE'), 'upload');
|
||||
JHtmlSidebar::setAction('index.php?option=com_questionsanswers&view=import');
|
||||
|
||||
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
|
||||
{
|
||||
JToolBarHelper::preferences('com_questionsanswers');
|
||||
}
|
||||
|
||||
// set help url for this view if found
|
||||
$help_url = QuestionsanswersHelper::getHelpUrl('import');
|
||||
if (QuestionsanswersHelper::checkString($help_url))
|
||||
{
|
||||
JToolbarHelper::help('COM_QUESTIONSANSWERS_HELP_MANAGER', false, $help_url);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage view.html.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
/**
|
||||
* Questionsanswers Import View
|
||||
*/
|
||||
class QuestionsanswersViewImport extends JViewLegacy
|
||||
{
|
||||
protected $headerList;
|
||||
protected $hasPackage = false;
|
||||
protected $headers;
|
||||
protected $hasHeader = 0;
|
||||
protected $dataType;
|
||||
|
||||
public function display($tpl = null)
|
||||
{
|
||||
if ($this->getLayout() !== 'modal')
|
||||
{
|
||||
// Include helper submenu
|
||||
QuestionsanswersHelper::addSubmenu('import');
|
||||
}
|
||||
|
||||
$paths = new stdClass;
|
||||
$paths->first = '';
|
||||
$state = $this->get('state');
|
||||
|
||||
$this->paths = &$paths;
|
||||
$this->state = &$state;
|
||||
// get global action permissions
|
||||
$this->canDo = QuestionsanswersHelper::getActions('import');
|
||||
|
||||
// We don't need toolbar in the modal window.
|
||||
if ($this->getLayout() !== 'modal')
|
||||
{
|
||||
$this->addToolbar();
|
||||
$this->sidebar = JHtmlSidebar::render();
|
||||
}
|
||||
|
||||
// get the session object
|
||||
$session = JFactory::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 = QuestionsanswersHelper::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);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setting the toolbar
|
||||
*/
|
||||
protected function addToolBar()
|
||||
{
|
||||
JToolBarHelper::title(JText::_('COM_QUESTIONSANSWERS_IMPORT_TITLE'), 'upload');
|
||||
JHtmlSidebar::setAction('index.php?option=com_questionsanswers&view=import');
|
||||
|
||||
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
|
||||
{
|
||||
JToolBarHelper::preferences('com_questionsanswers');
|
||||
}
|
||||
|
||||
// set help url for this view if found
|
||||
$this->help_url = QuestionsanswersHelper::getHelpUrl('import');
|
||||
if (QuestionsanswersHelper::checkString($this->help_url))
|
||||
{
|
||||
JToolbarHelper::help('COM_QUESTIONSANSWERS_HELP_MANAGER', false, $this->help_url);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,39 +1,39 @@
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage submitbutton.js
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
Joomla.submitbutton = function(task)
|
||||
{
|
||||
if (task == ''){
|
||||
return false;
|
||||
} else {
|
||||
var action = task.split('.');
|
||||
if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){
|
||||
Joomla.submitform(task, document.getElementById("adminForm"));
|
||||
return true;
|
||||
} else {
|
||||
alert(Joomla.JText._('question_and_answer, some values are not acceptable.','Some values are unacceptable'));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage submitbutton.js
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
Joomla.submitbutton = function(task)
|
||||
{
|
||||
if (task == ''){
|
||||
return false;
|
||||
} else {
|
||||
var action = task.split('.');
|
||||
if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){
|
||||
Joomla.submitform(task, document.getElementById("adminForm"));
|
||||
return true;
|
||||
} else {
|
||||
alert(Joomla.JText._('question_and_answer, some values are not acceptable.','Some values are unacceptable'));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,38 +1,37 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage edit.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage edit.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
|
||||
JHtml::_('behavior.tooltip');
|
||||
JHtml::_('behavior.formvalidation');
|
||||
JHtml::_('behavior.formvalidator');
|
||||
JHtml::_('formbehavior.chosen', 'select');
|
||||
JHtml::_('behavior.keepalive');
|
||||
$componentParams = $this->params; // will be removed just use $this->params instead
|
||||
?>
|
||||
JHtml::_('behavior.keepalive');
|
||||
$componentParams = $this->params; // will be removed just use $this->params instead
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
// waiting spinner
|
||||
var outerDiv = jQuery('body');
|
||||
@ -55,8 +54,8 @@ $componentParams = $this->params; // will be removed just use $this->params inst
|
||||
jQuery('#loading').hide();
|
||||
});
|
||||
</script>
|
||||
<div id="questionsanswers_loader" style="display: none;">
|
||||
<form action="<?php echo JRoute::_('index.php?option=com_questionsanswers&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
|
||||
<div id="questionsanswers_loader" style="display: none;">
|
||||
<form action="<?php echo JRoute::_('index.php?option=com_questionsanswers&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
|
||||
|
||||
<div class="form-horizontal">
|
||||
<div class="span9">
|
||||
@ -121,8 +120,8 @@ $componentParams = $this->params; // will be removed just use $this->params inst
|
||||
</div>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
<?php echo JLayoutHelper::render('question_and_answer.details_under', $this); ?>
|
||||
</form>
|
||||
<?php echo JLayoutHelper::render('question_and_answer.details_under', $this); ?>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
@ -527,4 +526,4 @@ function getFile(filename, fileFormat, target, type){
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</script>
|
||||
|
@ -1,97 +1,97 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage view.html.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
/**
|
||||
* Question_and_answer View class
|
||||
*/
|
||||
class QuestionsanswersViewQuestion_and_answer extends JViewLegacy
|
||||
{
|
||||
/**
|
||||
* display method of View
|
||||
* @return void
|
||||
*/
|
||||
public function display($tpl = null)
|
||||
{
|
||||
// set params
|
||||
$this->params = JComponentHelper::getParams('com_questionsanswers');
|
||||
// Assign the variables
|
||||
$this->form = $this->get('Form');
|
||||
$this->item = $this->get('Item');
|
||||
$this->script = $this->get('Script');
|
||||
$this->state = $this->get('State');
|
||||
// get action permissions
|
||||
$this->canDo = QuestionsanswersHelper::getActions('question_and_answer', $this->item);
|
||||
// get input
|
||||
$jinput = JFactory::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);
|
||||
}
|
||||
|
||||
// Display the template
|
||||
parent::display($tpl);
|
||||
|
||||
// Set the document
|
||||
$this->setDocument();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Setting the toolbar
|
||||
*/
|
||||
protected function addToolBar()
|
||||
{
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage view.html.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
/**
|
||||
* Question_and_answer View class
|
||||
*/
|
||||
class QuestionsanswersViewQuestion_and_answer extends JViewLegacy
|
||||
{
|
||||
/**
|
||||
* display method of View
|
||||
* @return void
|
||||
*/
|
||||
public function display($tpl = null)
|
||||
{
|
||||
// set params
|
||||
$this->params = JComponentHelper::getParams('com_questionsanswers');
|
||||
// Assign the variables
|
||||
$this->form = $this->get('Form');
|
||||
$this->item = $this->get('Item');
|
||||
$this->script = $this->get('Script');
|
||||
$this->state = $this->get('State');
|
||||
// get action permissions
|
||||
$this->canDo = QuestionsanswersHelper::getActions('question_and_answer', $this->item);
|
||||
// get input
|
||||
$jinput = JFactory::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);
|
||||
}
|
||||
|
||||
// Display the template
|
||||
parent::display($tpl);
|
||||
|
||||
// Set the document
|
||||
$this->setDocument();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Setting the toolbar
|
||||
*/
|
||||
protected function addToolBar()
|
||||
{
|
||||
JFactory::getApplication()->input->set('hidemainmenu', true);
|
||||
$user = JFactory::getUser();
|
||||
$userId = $user->id;
|
||||
@ -163,69 +163,70 @@ class QuestionsanswersViewQuestion_and_answer extends JViewLegacy
|
||||
}
|
||||
JToolbarHelper::divider();
|
||||
// set help url for this view if found
|
||||
$help_url = QuestionsanswersHelper::getHelpUrl('question_and_answer');
|
||||
if (QuestionsanswersHelper::checkString($help_url))
|
||||
$this->help_url = QuestionsanswersHelper::getHelpUrl('question_and_answer');
|
||||
if (QuestionsanswersHelper::checkString($this->help_url))
|
||||
{
|
||||
JToolbarHelper::help('COM_QUESTIONSANSWERS_HELP_MANAGER', false, $help_url);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Escapes a value for output in a view script.
|
||||
*
|
||||
* @param mixed $var The output to escape.
|
||||
*
|
||||
* @return mixed The escaped value.
|
||||
*/
|
||||
public function escape($var)
|
||||
{
|
||||
if(strlen($var) > 30)
|
||||
{
|
||||
// use the helper htmlEscape method instead and shorten the string
|
||||
return QuestionsanswersHelper::htmlEscape($var, $this->_charset, true, 30);
|
||||
}
|
||||
// use the helper htmlEscape method instead.
|
||||
return QuestionsanswersHelper::htmlEscape($var, $this->_charset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to set up the document properties
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setDocument()
|
||||
{
|
||||
$isNew = ($this->item->id < 1);
|
||||
if (!isset($this->document))
|
||||
{
|
||||
$this->document = JFactory::getDocument();
|
||||
}
|
||||
$this->document->setTitle(JText::_($isNew ? 'COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_NEW' : 'COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_EDIT'));
|
||||
JToolbarHelper::help('COM_QUESTIONSANSWERS_HELP_MANAGER', false, $this->help_url);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Escapes a value for output in a view script.
|
||||
*
|
||||
* @param mixed $var The output to escape.
|
||||
*
|
||||
* @return mixed The escaped value.
|
||||
*/
|
||||
public function escape($var)
|
||||
{
|
||||
if(strlen($var) > 30)
|
||||
{
|
||||
// use the helper htmlEscape method instead and shorten the string
|
||||
return QuestionsanswersHelper::htmlEscape($var, $this->_charset, true, 30);
|
||||
}
|
||||
// use the helper htmlEscape method instead.
|
||||
return QuestionsanswersHelper::htmlEscape($var, $this->_charset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to set up the document properties
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setDocument()
|
||||
{
|
||||
$isNew = ($this->item->id < 1);
|
||||
if (!isset($this->document))
|
||||
{
|
||||
$this->document = JFactory::getDocument();
|
||||
}
|
||||
$this->document->setTitle(JText::_($isNew ? 'COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_NEW' : 'COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_EDIT'));
|
||||
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_questionsanswers/assets/css/question_and_answer.css", (QuestionsanswersHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
|
||||
// Add Ajax Token
|
||||
$this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';");
|
||||
$this->document->addScript(JURI::root() . $this->script, (QuestionsanswersHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
|
||||
$this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';");
|
||||
$this->document->addScript(JURI::root() . $this->script, (QuestionsanswersHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
|
||||
$this->document->addScript(JURI::root() . "administrator/components/com_questionsanswers/views/question_and_answer/submitbutton.js", (QuestionsanswersHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
|
||||
// add JavaScripts
|
||||
$this->document->addScript( JURI::root(true) .'/media/com_questionsanswers/uikit/js/uikit.min.js' );
|
||||
$this->document->addScript( JURI::root(true) .'/media/com_questionsanswers/uikit/js/components/accordion.min.js', 'text/javascript', true);
|
||||
$this->document->addScript( JURI::root(true) .'/media/com_questionsanswers/uikit/js/components/tooltip.min.js', 'text/javascript', true);
|
||||
$this->document->addScript( JURI::root(true) .'/media/com_questionsanswers/uikit/js/components/lightbox.min.js', 'text/javascript', true);
|
||||
$this->document->addScript( JURI::root(true) .'/media/com_questionsanswers/uikit/js/components/notify.min.js', 'text/javascript', true);
|
||||
$this->document->addScript( JURI::root(true) .'/media/com_questionsanswers/uikit/js/components/upload.min.js', 'text/javascript', true);
|
||||
// add the style sheets
|
||||
$this->document->addStyleSheet( JURI::root(true) .'/media/com_questionsanswers/uikit/css/uikit.gradient.min.css' );
|
||||
$this->document->addStyleSheet( JURI::root(true) .'/media/com_questionsanswers/uikit/css/components/accordion.gradient.min.css' );
|
||||
$this->document->addStyleSheet( JURI::root(true) .'/media/com_questionsanswers/uikit/css/components/tooltip.gradient.min.css' );
|
||||
$this->document->addStyleSheet( JURI::root(true) .'/media/com_questionsanswers/uikit/css/components/notify.gradient.min.css' );
|
||||
$this->document->addStyleSheet( JURI::root(true) .'/media/com_questionsanswers/uikit/css/components/form-file.gradient.min.css' );
|
||||
$this->document->addStyleSheet( JURI::root(true) .'/media/com_questionsanswers/uikit/css/components/progress.gradient.min.css' );
|
||||
$this->document->addStyleSheet( JURI::root(true) .'/media/com_questionsanswers/uikit/css/components/placeholder.gradient.min.css' );
|
||||
$this->document->addStyleSheet( JURI::root(true) .'/media/com_questionsanswers/uikit/css/components/upload.gradient.min.css' );
|
||||
// add var key
|
||||
$this->document->addScriptDeclaration("var vastDevMod = '".$this->get('VDM')."';");
|
||||
// load the links on the page
|
||||
$this->document->addScriptDeclaration("var documentsLinks = " . json_encode($this->item->links) . ";");
|
||||
JText::script('view not acceptable. Error');
|
||||
}
|
||||
}
|
||||
$this->document->addScriptDeclaration("var documentsLinks = " . json_encode($this->item->links) . ";");
|
||||
|
||||
// add the style sheets
|
||||
$this->document->addStyleSheet( JURI::root(true) .'/media/com_questionsanswers/uikit-v2/css/uikit.gradient.min.css' , (QuestionsanswersHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
|
||||
$this->document->addStyleSheet( JURI::root(true) .'/media/com_questionsanswers/uikit-v2/css/components/accordion.gradient.min.css' , (QuestionsanswersHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
|
||||
$this->document->addStyleSheet( JURI::root(true) .'/media/com_questionsanswers/uikit-v2/css/components/tooltip.gradient.min.css' , (QuestionsanswersHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
|
||||
$this->document->addStyleSheet( JURI::root(true) .'/media/com_questionsanswers/uikit-v2/css/components/notify.gradient.min.css' , (QuestionsanswersHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
|
||||
$this->document->addStyleSheet( JURI::root(true) .'/media/com_questionsanswers/uikit-v2/css/components/form-file.gradient.min.css' , (QuestionsanswersHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
|
||||
$this->document->addStyleSheet( JURI::root(true) .'/media/com_questionsanswers/uikit-v2/css/components/progress.gradient.min.css' , (QuestionsanswersHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
|
||||
$this->document->addStyleSheet( JURI::root(true) .'/media/com_questionsanswers/uikit-v2/css/components/placeholder.gradient.min.css' , (QuestionsanswersHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
|
||||
$this->document->addStyleSheet( JURI::root(true) .'/media/com_questionsanswers/uikit-v2//css/components/upload.gradient.min.css' , (QuestionsanswersHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
|
||||
// add JavaScripts
|
||||
$this->document->addScript( JURI::root(true) .'/media/com_questionsanswers/uikit-v2/js/uikit.min.js', (QuestionsanswersHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
|
||||
$this->document->addScript( JURI::root(true) .'/media/com_questionsanswers/uikit-v2/js/components/accordion.min.js', (QuestionsanswersHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
|
||||
$this->document->addScript( JURI::root(true) .'/media/com_questionsanswers/uikit-v2/js/components/tooltip.min.js', (QuestionsanswersHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
|
||||
$this->document->addScript( JURI::root(true) .'/media/com_questionsanswers/uikit-v2/js/components/lightbox.min.js', (QuestionsanswersHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
|
||||
$this->document->addScript( JURI::root(true) .'/media/com_questionsanswers/uikit-v2/js/components/notify.min.js', (QuestionsanswersHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
|
||||
$this->document->addScript( JURI::root(true) .'/media/com_questionsanswers/uikit-v2/js/components/upload.min.js', (QuestionsanswersHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
|
||||
JText::script('view not acceptable. Error');
|
||||
}
|
||||
}
|
||||
|
@ -1,43 +1,42 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
JHtml::_('behavior.tooltip');
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
JHtml::_('behavior.multiselect');
|
||||
JHtml::_('dropdown.init');
|
||||
JHtml::_('formbehavior.chosen', '.multipleCategories', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_QUESTIONSANSWERS_FILTER_SELECT_QUESTIONS_AND_ANSWERS_CATEGORIES') . ' -'));
|
||||
JHtml::_('formbehavior.chosen', '.multipleAccessLevels', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_QUESTIONSANSWERS_FILTER_SELECT_ACCESS') . ' -'));
|
||||
JHtml::_('formbehavior.chosen', 'select');
|
||||
if ($this->saveOrder)
|
||||
{
|
||||
$saveOrderingUrl = 'index.php?option=com_questionsanswers&task=questions_and_answers.saveOrderAjax&tmpl=component';
|
||||
JHtml::_('sortablelist.sortable', 'question_and_answerList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
|
||||
}
|
||||
?>
|
||||
JHtml::_('formbehavior.chosen', 'select');
|
||||
if ($this->saveOrder)
|
||||
{
|
||||
$saveOrderingUrl = 'index.php?option=com_questionsanswers&task=questions_and_answers.saveOrderAjax&tmpl=component';
|
||||
JHtml::_('sortablelist.sortable', 'question_and_answerList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
|
||||
}
|
||||
?>
|
||||
<form action="<?php echo JRoute::_('index.php?option=com_questionsanswers&view=questions_and_answers'); ?>" method="post" name="adminForm" id="adminForm">
|
||||
<?php if(!empty( $this->sidebar)): ?>
|
||||
<div id="j-sidebar-container" class="span2">
|
||||
@ -80,4 +79,4 @@ if ($this->saveOrder)
|
||||
<?php endif; ?>
|
||||
<input type="hidden" name="task" value="" />
|
||||
<?php echo JHtml::_('form.token'); ?>
|
||||
</form>
|
||||
</form>
|
||||
|
@ -1,32 +1,32 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_batch_body.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
?>
|
||||
|
||||
<p><?php echo JText::_('COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_BATCH_TIP'); ?></p>
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_batch_body.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
?>
|
||||
|
||||
<p><?php echo JText::_('COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_BATCH_TIP'); ?></p>
|
||||
<?php echo $this->batchDisplay; ?>
|
@ -1,37 +1,37 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_batch_footer.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
?>
|
||||
<!-- clear the batch values if cancel -->
|
||||
<button class="btn" type="button" onclick="" data-dismiss="modal">
|
||||
<?php echo JText::_('JCANCEL'); ?>
|
||||
</button>
|
||||
<!-- post the batch values if process -->
|
||||
<button class="btn btn-success" type="submit" onclick="Joomla.submitbutton('question_and_answer.batch');">
|
||||
<?php echo JText::_('JGLOBAL_BATCH_PROCESS'); ?>
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_batch_footer.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
?>
|
||||
<!-- clear the batch values if cancel -->
|
||||
<button class="btn" type="button" onclick="" data-dismiss="modal">
|
||||
<?php echo JText::_('JCANCEL'); ?>
|
||||
</button>
|
||||
<!-- post the batch values if process -->
|
||||
<button class="btn btn-success" type="submit" onclick="Joomla.submitbutton('question_and_answer.batch');">
|
||||
<?php echo JText::_('JGLOBAL_BATCH_PROCESS'); ?>
|
||||
</button>
|
@ -1,34 +1,34 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_body.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
$edit = "index.php?option=com_questionsanswers&view=questions_and_answers&task=question_and_answer.edit";
|
||||
|
||||
?>
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_body.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
$edit = "index.php?option=com_questionsanswers&view=questions_and_answers&task=question_and_answer.edit";
|
||||
|
||||
?>
|
||||
<?php foreach ($this->items as $i => $item): ?>
|
||||
<?php
|
||||
$canCheckin = $this->user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0;
|
||||
|
@ -1,32 +1,32 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_foot.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="7"><?php echo $this->pagination->getListFooter(); ?></td>
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_foot.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="7"><?php echo $this->pagination->getListFooter(); ?></td>
|
||||
</tr>
|
@ -1,32 +1,32 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_head.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
?>
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_head.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<?php if ($this->canEdit&& $this->canState): ?>
|
||||
<th width="1%" class="nowrap center hidden-phone">
|
||||
|
@ -1,59 +1,59 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_toolbar.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
?>
|
||||
<div id="filter-bar" class="btn-toolbar">
|
||||
<div class="filter-search btn-group pull-left">
|
||||
<label for="filter_search" class="element-invisible"><?php echo JText::_('Search');?></label>
|
||||
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo JText::_('JSEARCH_FILTER'); ?>" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" class="hasTooltip" title="<?php echo JHtml::tooltipText('Search Questions_and_answers'); ?>" />
|
||||
</div>
|
||||
<div class="btn-group pull-left">
|
||||
<button type="submit" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i></button>
|
||||
<button type="button" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.id('filter_search').value='';this.form.submit();"><i class="icon-remove"></i></button>
|
||||
</div>
|
||||
<div class="btn-group pull-right hidden-phone">
|
||||
<label for="limit" class="element-invisible"><?php echo JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label>
|
||||
<?php echo $this->pagination->getLimitBox(); ?>
|
||||
</div>
|
||||
<div class="btn-group pull-right hidden-phone">
|
||||
<label for="directionTable" class="element-invisible"><?php echo JText::_('JFIELD_ORDERING_DESC');?></label>
|
||||
<select name="directionTable" id="directionTable" class="input-medium" onchange="Joomla.orderTable()">
|
||||
<option value=""><?php echo JText::_('JFIELD_ORDERING_DESC');?></option>
|
||||
<option value="asc" <?php if ($this->listDirn == 'asc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_ASCENDING');?></option>
|
||||
<option value="desc" <?php if ($this->listDirn == 'desc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_DESCENDING');?></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="btn-group pull-right">
|
||||
<label for="sortTable" class="element-invisible"><?php echo JText::_('JGLOBAL_SORT_BY');?></label>
|
||||
<select name="sortTable" id="sortTable" class="input-medium" onchange="Joomla.orderTable()">
|
||||
<option value=""><?php echo JText::_('JGLOBAL_SORT_BY');?></option>
|
||||
<?php echo JHtml::_('select.options', $this->getSortFields(), 'value', 'text', $this->listOrder);?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_toolbar.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
?>
|
||||
<div id="filter-bar" class="btn-toolbar">
|
||||
<div class="filter-search btn-group pull-left">
|
||||
<label for="filter_search" class="element-invisible"><?php echo JText::_('Search');?></label>
|
||||
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo JText::_('JSEARCH_FILTER'); ?>" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" class="hasTooltip" title="<?php echo JHtml::tooltipText('Search Questions_and_answers'); ?>" />
|
||||
</div>
|
||||
<div class="btn-group pull-left">
|
||||
<button type="submit" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i></button>
|
||||
<button type="button" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.id('filter_search').value='';this.form.submit();"><i class="icon-remove"></i></button>
|
||||
</div>
|
||||
<div class="btn-group pull-right hidden-phone">
|
||||
<label for="limit" class="element-invisible"><?php echo JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label>
|
||||
<?php echo $this->pagination->getLimitBox(); ?>
|
||||
</div>
|
||||
<div class="btn-group pull-right hidden-phone">
|
||||
<label for="directionTable" class="element-invisible"><?php echo JText::_('JFIELD_ORDERING_DESC');?></label>
|
||||
<select name="directionTable" id="directionTable" class="input-medium" onchange="Joomla.orderTable()">
|
||||
<option value=""><?php echo JText::_('JFIELD_ORDERING_DESC');?></option>
|
||||
<option value="asc" <?php if ($this->listDirn == 'asc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_ASCENDING');?></option>
|
||||
<option value="desc" <?php if ($this->listDirn == 'desc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_DESCENDING');?></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="btn-group pull-right">
|
||||
<label for="sortTable" class="element-invisible"><?php echo JText::_('JGLOBAL_SORT_BY');?></label>
|
||||
<select name="sortTable" id="sortTable" class="input-medium" onchange="Joomla.orderTable()">
|
||||
<option value=""><?php echo JText::_('JGLOBAL_SORT_BY');?></option>
|
||||
<?php echo JHtml::_('select.options', $this->getSortFields(), 'value', 'text', $this->listOrder);?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix"> </div>
|
@ -1,52 +1,54 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage view.html.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
/**
|
||||
* Questionsanswers View class for the Questions_and_answers
|
||||
*/
|
||||
class QuestionsanswersViewQuestions_and_answers extends JViewLegacy
|
||||
{
|
||||
/**
|
||||
* Questions_and_answers view display method
|
||||
* @return void
|
||||
*/
|
||||
function display($tpl = null)
|
||||
{
|
||||
if ($this->getLayout() !== 'modal')
|
||||
{
|
||||
// Include helper submenu
|
||||
QuestionsanswersHelper::addSubmenu('questions_and_answers');
|
||||
}
|
||||
|
||||
// Assign data to the view
|
||||
$this->items = $this->get('Items');
|
||||
$this->pagination = $this->get('Pagination');
|
||||
$this->state = $this->get('State');
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage view.html.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\CMS\Filesystem\File;
|
||||
|
||||
/**
|
||||
* Questionsanswers View class for the Questions_and_answers
|
||||
*/
|
||||
class QuestionsanswersViewQuestions_and_answers extends JViewLegacy
|
||||
{
|
||||
/**
|
||||
* Questions_and_answers view display method
|
||||
* @return void
|
||||
*/
|
||||
function display($tpl = null)
|
||||
{
|
||||
if ($this->getLayout() !== 'modal')
|
||||
{
|
||||
// Include helper submenu
|
||||
QuestionsanswersHelper::addSubmenu('questions_and_answers');
|
||||
}
|
||||
|
||||
// Assign data to the view
|
||||
$this->items = $this->get('Items');
|
||||
$this->pagination = $this->get('Pagination');
|
||||
$this->state = $this->get('State');
|
||||
$this->user = JFactory::getUser();
|
||||
// Load the filter form from xml.
|
||||
$this->filterForm = $this->get('FilterForm');
|
||||
@ -54,122 +56,122 @@ class QuestionsanswersViewQuestions_and_answers extends JViewLegacy
|
||||
$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) JUri::getInstance()));
|
||||
// get global action permissions
|
||||
$this->listDirn = $this->escape($this->state->get('list.direction', 'desc'));
|
||||
$this->saveOrder = $this->listOrder == 'a.ordering';
|
||||
// set the return here value
|
||||
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
|
||||
// get global action permissions
|
||||
$this->canDo = QuestionsanswersHelper::getActions('question_and_answer');
|
||||
$this->canEdit = $this->canDo->get('question_and_answer.edit');
|
||||
$this->canState = $this->canDo->get('question_and_answer.edit.state');
|
||||
$this->canCreate = $this->canDo->get('question_and_answer.create');
|
||||
$this->canDelete = $this->canDo->get('question_and_answer.delete');
|
||||
$this->canBatch = $this->canDo->get('core.batch');
|
||||
|
||||
// We don't need toolbar in the modal window.
|
||||
if ($this->getLayout() !== 'modal')
|
||||
{
|
||||
$this->addToolbar();
|
||||
$this->sidebar = JHtmlSidebar::render();
|
||||
// load the batch html
|
||||
if ($this->canCreate && $this->canEdit && $this->canState)
|
||||
{
|
||||
$this->batchDisplay = JHtmlBatch_::render();
|
||||
}
|
||||
}
|
||||
|
||||
// Check for errors.
|
||||
if (count($errors = $this->get('Errors')))
|
||||
{
|
||||
throw new Exception(implode("\n", $errors), 500);
|
||||
}
|
||||
|
||||
// Display the template
|
||||
parent::display($tpl);
|
||||
|
||||
// Set the document
|
||||
$this->setDocument();
|
||||
}
|
||||
|
||||
/**
|
||||
* Setting the toolbar
|
||||
*/
|
||||
protected function addToolBar()
|
||||
{
|
||||
JToolBarHelper::title(JText::_('COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS'), 'question-2');
|
||||
JHtmlSidebar::setAction('index.php?option=com_questionsanswers&view=questions_and_answers');
|
||||
JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
|
||||
|
||||
if ($this->canCreate)
|
||||
{
|
||||
JToolBarHelper::addNew('question_and_answer.add');
|
||||
}
|
||||
|
||||
// Only load if there are items
|
||||
if (QuestionsanswersHelper::checkArray($this->items))
|
||||
{
|
||||
if ($this->canEdit)
|
||||
{
|
||||
JToolBarHelper::editList('question_and_answer.edit');
|
||||
}
|
||||
|
||||
if ($this->canState)
|
||||
{
|
||||
JToolBarHelper::publishList('questions_and_answers.publish');
|
||||
JToolBarHelper::unpublishList('questions_and_answers.unpublish');
|
||||
JToolBarHelper::archiveList('questions_and_answers.archive');
|
||||
|
||||
if ($this->canDo->get('core.admin'))
|
||||
{
|
||||
JToolBarHelper::checkin('questions_and_answers.checkin');
|
||||
}
|
||||
}
|
||||
|
||||
// Add a batch button
|
||||
if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState)
|
||||
{
|
||||
// Get the toolbar object instance
|
||||
$bar = JToolBar::getInstance('toolbar');
|
||||
// set the batch button name
|
||||
$title = JText::_('JTOOLBAR_BATCH');
|
||||
// Instantiate a new JLayoutFile instance and render the batch button
|
||||
$layout = new JLayoutFile('joomla.toolbar.batch');
|
||||
// add the button to the page
|
||||
$dhtml = $layout->render(array('title' => $title));
|
||||
$bar->appendButton('Custom', $dhtml, 'batch');
|
||||
}
|
||||
|
||||
if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete))
|
||||
{
|
||||
JToolbarHelper::deleteList('', 'questions_and_answers.delete', 'JTOOLBAR_EMPTY_TRASH');
|
||||
}
|
||||
elseif ($this->canState && $this->canDelete)
|
||||
{
|
||||
JToolbarHelper::trash('questions_and_answers.trash');
|
||||
$this->canBatch = $this->canDo->get('core.batch');
|
||||
|
||||
// We don't need toolbar in the modal window.
|
||||
if ($this->getLayout() !== 'modal')
|
||||
{
|
||||
$this->addToolbar();
|
||||
$this->sidebar = JHtmlSidebar::render();
|
||||
// load the batch html
|
||||
if ($this->canCreate && $this->canEdit && $this->canState)
|
||||
{
|
||||
$this->batchDisplay = JHtmlBatch_::render();
|
||||
}
|
||||
}
|
||||
|
||||
// Check for errors.
|
||||
if (count($errors = $this->get('Errors')))
|
||||
{
|
||||
throw new Exception(implode("\n", $errors), 500);
|
||||
}
|
||||
|
||||
// Display the template
|
||||
parent::display($tpl);
|
||||
|
||||
// Set the document
|
||||
$this->setDocument();
|
||||
}
|
||||
|
||||
/**
|
||||
* Setting the toolbar
|
||||
*/
|
||||
protected function addToolBar()
|
||||
{
|
||||
JToolBarHelper::title(JText::_('COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS'), 'question-2');
|
||||
JHtmlSidebar::setAction('index.php?option=com_questionsanswers&view=questions_and_answers');
|
||||
JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
|
||||
|
||||
if ($this->canCreate)
|
||||
{
|
||||
JToolBarHelper::addNew('question_and_answer.add');
|
||||
}
|
||||
|
||||
// Only load if there are items
|
||||
if (QuestionsanswersHelper::checkArray($this->items))
|
||||
{
|
||||
if ($this->canEdit)
|
||||
{
|
||||
JToolBarHelper::editList('question_and_answer.edit');
|
||||
}
|
||||
|
||||
if ($this->canState)
|
||||
{
|
||||
JToolBarHelper::publishList('questions_and_answers.publish');
|
||||
JToolBarHelper::unpublishList('questions_and_answers.unpublish');
|
||||
JToolBarHelper::archiveList('questions_and_answers.archive');
|
||||
|
||||
if ($this->canDo->get('core.admin'))
|
||||
{
|
||||
JToolBarHelper::checkin('questions_and_answers.checkin');
|
||||
}
|
||||
}
|
||||
|
||||
// Add a batch button
|
||||
if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState)
|
||||
{
|
||||
// Get the toolbar object instance
|
||||
$bar = JToolBar::getInstance('toolbar');
|
||||
// set the batch button name
|
||||
$title = JText::_('JTOOLBAR_BATCH');
|
||||
// Instantiate a new JLayoutFile instance and render the batch button
|
||||
$layout = new JLayoutFile('joomla.toolbar.batch');
|
||||
// add the button to the page
|
||||
$dhtml = $layout->render(array('title' => $title));
|
||||
$bar->appendButton('Custom', $dhtml, 'batch');
|
||||
}
|
||||
|
||||
if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete))
|
||||
{
|
||||
JToolbarHelper::deleteList('', 'questions_and_answers.delete', 'JTOOLBAR_EMPTY_TRASH');
|
||||
}
|
||||
elseif ($this->canState && $this->canDelete)
|
||||
{
|
||||
JToolbarHelper::trash('questions_and_answers.trash');
|
||||
}
|
||||
|
||||
if ($this->canDo->get('core.export') && $this->canDo->get('question_and_answer.export'))
|
||||
{
|
||||
JToolBarHelper::custom('questions_and_answers.exportData', 'download', '', 'COM_QUESTIONSANSWERS_EXPORT_DATA', true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->canDo->get('core.import') && $this->canDo->get('question_and_answer.import'))
|
||||
{
|
||||
JToolBarHelper::custom('questions_and_answers.importData', 'upload', '', 'COM_QUESTIONSANSWERS_IMPORT_DATA', false);
|
||||
}
|
||||
|
||||
// set help url for this view if found
|
||||
$help_url = QuestionsanswersHelper::getHelpUrl('questions_and_answers');
|
||||
if (QuestionsanswersHelper::checkString($help_url))
|
||||
{
|
||||
JToolbarHelper::help('COM_QUESTIONSANSWERS_HELP_MANAGER', false, $help_url);
|
||||
}
|
||||
|
||||
// add the options comp button
|
||||
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
|
||||
{
|
||||
JToolBarHelper::preferences('com_questionsanswers');
|
||||
}
|
||||
|
||||
// set help url for this view if found
|
||||
$this->help_url = QuestionsanswersHelper::getHelpUrl('questions_and_answers');
|
||||
if (QuestionsanswersHelper::checkString($this->help_url))
|
||||
{
|
||||
JToolbarHelper::help('COM_QUESTIONSANSWERS_HELP_MANAGER', false, $this->help_url);
|
||||
}
|
||||
|
||||
// add the options comp button
|
||||
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
|
||||
{
|
||||
JToolBarHelper::preferences('com_questionsanswers');
|
||||
}
|
||||
|
||||
// Only load published batch if state and batch is allowed
|
||||
@ -200,49 +202,49 @@ class QuestionsanswersViewQuestions_and_answers extends JViewLegacy
|
||||
'batch[category]',
|
||||
JHtml::_('select.options', JHtml::_('category.options', 'com_questionsanswers.question_and_answer'), 'value', 'text')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to set up the document properties
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setDocument()
|
||||
{
|
||||
if (!isset($this->document))
|
||||
{
|
||||
$this->document = JFactory::getDocument();
|
||||
}
|
||||
$this->document->setTitle(JText::_('COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS'));
|
||||
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_questionsanswers/assets/css/questions_and_answers.css", (QuestionsanswersHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
|
||||
}
|
||||
|
||||
/**
|
||||
* Escapes a value for output in a view script.
|
||||
*
|
||||
* @param mixed $var The output to escape.
|
||||
*
|
||||
* @return mixed The escaped value.
|
||||
*/
|
||||
public function escape($var)
|
||||
{
|
||||
if(strlen($var) > 50)
|
||||
{
|
||||
// use the helper htmlEscape method instead and shorten the string
|
||||
return QuestionsanswersHelper::htmlEscape($var, $this->_charset, true);
|
||||
}
|
||||
// use the helper htmlEscape method instead.
|
||||
return QuestionsanswersHelper::htmlEscape($var, $this->_charset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of fields the table can be sorted by
|
||||
*
|
||||
* @return array Array containing the field name to sort by as the key and display text as value
|
||||
*/
|
||||
protected function getSortFields()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to set up the document properties
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setDocument()
|
||||
{
|
||||
if (!isset($this->document))
|
||||
{
|
||||
$this->document = JFactory::getDocument();
|
||||
}
|
||||
$this->document->setTitle(JText::_('COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS'));
|
||||
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_questionsanswers/assets/css/questions_and_answers.css", (QuestionsanswersHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
|
||||
}
|
||||
|
||||
/**
|
||||
* Escapes a value for output in a view script.
|
||||
*
|
||||
* @param mixed $var The output to escape.
|
||||
*
|
||||
* @return mixed The escaped value.
|
||||
*/
|
||||
public function escape($var)
|
||||
{
|
||||
if(strlen($var) > 50)
|
||||
{
|
||||
// use the helper htmlEscape method instead and shorten the string
|
||||
return QuestionsanswersHelper::htmlEscape($var, $this->_charset, true);
|
||||
}
|
||||
// use the helper htmlEscape method instead.
|
||||
return QuestionsanswersHelper::htmlEscape($var, $this->_charset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of fields the table can be sorted by
|
||||
*
|
||||
* @return array Array containing the field name to sort by as the key and display text as value
|
||||
*/
|
||||
protected function getSortFields()
|
||||
{
|
||||
return array(
|
||||
'a.ordering' => JText::_('JGRID_HEADING_ORDERING'),
|
||||
'a.published' => JText::_('JSTATUS'),
|
||||
@ -250,6 +252,6 @@ class QuestionsanswersViewQuestions_and_answers extends JViewLegacy
|
||||
'a.answer' => JText::_('COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_ANSWER_LABEL'),
|
||||
'category_title' => JText::_('COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_QUESTIONS_AND_ANSWERS_CATEGORIES'),
|
||||
'a.id' => JText::_('JGRID_HEADING_ID')
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -1,33 +1,33 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
JHtml::_('behavior.tooltip');
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
|
||||
|
||||
?>
|
||||
<div id="j-main-container">
|
||||
<div class="form-horizontal">
|
||||
|
@ -1,44 +1,44 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_main.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
?>
|
||||
<?php if(isset($this->icons['main']) && is_array($this->icons['main'])) :?>
|
||||
<?php foreach($this->icons['main'] as $icon): ?>
|
||||
<div class="dashboard-wraper">
|
||||
<div class="dashboard-content">
|
||||
<a class="icon" href="<?php echo $icon->url; ?>">
|
||||
<img alt="<?php echo $icon->alt; ?>" src="components/com_questionsanswers/assets/images/icons/<?php echo $icon->image; ?>">
|
||||
<span class="dashboard-title"><?php echo JText::_($icon->name); ?></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<div class="clearfix"></div>
|
||||
<?php else: ?>
|
||||
<div class="alert alert-error"><h4 class="alert-heading"><?php echo JText::_("Permission denied, or not correctly set"); ?></h4><div class="alert-message"><?php echo JText::_("Please notify your System Administrator if result is unexpected."); ?></div></div>
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_main.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
?>
|
||||
<?php if(isset($this->icons['main']) && is_array($this->icons['main'])) :?>
|
||||
<?php foreach($this->icons['main'] as $icon): ?>
|
||||
<div class="dashboard-wraper">
|
||||
<div class="dashboard-content">
|
||||
<a class="icon" href="<?php echo $icon->url; ?>">
|
||||
<img alt="<?php echo $icon->alt; ?>" src="components/com_questionsanswers/assets/images/icons/<?php echo $icon->image; ?>">
|
||||
<span class="dashboard-title"><?php echo JText::_($icon->name); ?></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<div class="clearfix"></div>
|
||||
<?php else: ?>
|
||||
<div class="alert alert-error"><h4 class="alert-heading"><?php echo JText::_("Permission denied, or not correctly set"); ?></h4><div class="alert-message"><?php echo JText::_("Please notify your System Administrator if result is unexpected."); ?></div></div>
|
||||
<?php endif; ?>
|
@ -1,30 +1,30 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_readme_information.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_readme_information.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
?>
|
||||
<?php echo $this->readme; ?>
|
||||
<?php echo $this->readme; ?>
|
||||
|
@ -1,30 +1,30 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_vast_development_method_notice_board.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_vast_development_method_notice_board.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
?>
|
||||
<?php echo $this->noticeboard; ?>
|
||||
<?php echo $this->noticeboard; ?>
|
||||
|
@ -1,52 +1,52 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_vdm.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
?>
|
||||
<img alt="<?php echo JText::_('COM_QUESTIONSANSWERS'); ?>" src="components/com_questionsanswers/assets/images/vdm-component.jpg">
|
||||
<ul class="list-striped">
|
||||
<li><b><?php echo JText::_('COM_QUESTIONSANSWERS_VERSION'); ?>:</b> <?php echo $this->manifest->version; ?> <span class="update-notice"></span></li>
|
||||
<li><b><?php echo JText::_('COM_QUESTIONSANSWERS_DATE'); ?>:</b> <?php echo $this->manifest->creationDate; ?></li>
|
||||
<li><b><?php echo JText::_('COM_QUESTIONSANSWERS_AUTHOR'); ?>:</b> <a href="mailto:<?php echo $this->manifest->authorEmail; ?>"><?php echo $this->manifest->author; ?></a></li>
|
||||
<li><b><?php echo JText::_('COM_QUESTIONSANSWERS_WEBSITE'); ?>:</b> <a href="<?php echo $this->manifest->authorUrl; ?>" target="_blank"><?php echo $this->manifest->authorUrl; ?></a></li>
|
||||
<li><b><?php echo JText::_('COM_QUESTIONSANSWERS_LICENSE'); ?>:</b> <?php echo $this->manifest->license; ?></li>
|
||||
<li><b><?php echo $this->manifest->copyright; ?></b></li>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
<?php if(QuestionsanswersHelper::checkArray($this->contributors)): ?>
|
||||
<?php if(count($this->contributors) > 1): ?>
|
||||
<h3><?php echo JText::_('COM_QUESTIONSANSWERS_CONTRIBUTORS'); ?></h3>
|
||||
<?php else: ?>
|
||||
<h3><?php echo JText::_('COM_QUESTIONSANSWERS_CONTRIBUTOR'); ?></h3>
|
||||
<?php endif; ?>
|
||||
<ul class="list-striped">
|
||||
<?php foreach($this->contributors as $contributor): ?>
|
||||
<li><b><?php echo $contributor['title']; ?>:</b> <?php echo $contributor['name']; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage default_vdm.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
?>
|
||||
<img alt="<?php echo JText::_('COM_QUESTIONSANSWERS'); ?>" src="components/com_questionsanswers/assets/images/vdm-component.jpg">
|
||||
<ul class="list-striped">
|
||||
<li><b><?php echo JText::_('COM_QUESTIONSANSWERS_VERSION'); ?>:</b> <?php echo $this->manifest->version; ?> <span class="update-notice"></span></li>
|
||||
<li><b><?php echo JText::_('COM_QUESTIONSANSWERS_DATE'); ?>:</b> <?php echo $this->manifest->creationDate; ?></li>
|
||||
<li><b><?php echo JText::_('COM_QUESTIONSANSWERS_AUTHOR'); ?>:</b> <a href="mailto:<?php echo $this->manifest->authorEmail; ?>"><?php echo $this->manifest->author; ?></a></li>
|
||||
<li><b><?php echo JText::_('COM_QUESTIONSANSWERS_WEBSITE'); ?>:</b> <a href="<?php echo $this->manifest->authorUrl; ?>" target="_blank"><?php echo $this->manifest->authorUrl; ?></a></li>
|
||||
<li><b><?php echo JText::_('COM_QUESTIONSANSWERS_LICENSE'); ?>:</b> <?php echo $this->manifest->license; ?></li>
|
||||
<li><b><?php echo $this->manifest->copyright; ?></b></li>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
<?php if(QuestionsanswersHelper::checkArray($this->contributors)): ?>
|
||||
<?php if(count($this->contributors) > 1): ?>
|
||||
<h3><?php echo JText::_('COM_QUESTIONSANSWERS_CONTRIBUTORS'); ?></h3>
|
||||
<?php else: ?>
|
||||
<h3><?php echo JText::_('COM_QUESTIONSANSWERS_CONTRIBUTOR'); ?></h3>
|
||||
<?php endif; ?>
|
||||
<ul class="list-striped">
|
||||
<?php foreach($this->contributors as $contributor): ?>
|
||||
<li><b><?php echo $contributor['title']; ?>:</b> <?php echo $contributor['name']; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
<?php endif; ?>
|
@ -1,104 +1,106 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage view.html.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
/**
|
||||
* Questionsanswers View class
|
||||
*/
|
||||
class QuestionsanswersViewQuestionsanswers extends JViewLegacy
|
||||
{
|
||||
/**
|
||||
* View display method
|
||||
* @return void
|
||||
*/
|
||||
function display($tpl = null)
|
||||
{
|
||||
// Assign data to the view
|
||||
$this->icons = $this->get('Icons');
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage view.html.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Questionsanswers View class
|
||||
*/
|
||||
class QuestionsanswersViewQuestionsanswers extends JViewLegacy
|
||||
{
|
||||
/**
|
||||
* View display method
|
||||
* @return void
|
||||
*/
|
||||
function display($tpl = null)
|
||||
{
|
||||
// Assign data to the view
|
||||
$this->icons = $this->get('Icons');
|
||||
$this->contributors = QuestionsanswersHelper::getContributors();
|
||||
$this->noticeboard = $this->get('Noticeboard');
|
||||
$this->readme = $this->get('Readme');
|
||||
|
||||
// get the manifest details of the component
|
||||
$this->manifest = QuestionsanswersHelper::manifest();
|
||||
|
||||
// Set the toolbar
|
||||
$this->addToolBar();
|
||||
|
||||
// Check for errors.
|
||||
if (count($errors = $this->get('Errors')))
|
||||
{
|
||||
throw new Exception(implode("\n", $errors), 500);
|
||||
}
|
||||
|
||||
// Display the template
|
||||
parent::display($tpl);
|
||||
|
||||
// Set the document
|
||||
$this->setDocument();
|
||||
}
|
||||
|
||||
/**
|
||||
* Setting the toolbar
|
||||
*/
|
||||
protected function addToolBar()
|
||||
{
|
||||
$canDo = QuestionsanswersHelper::getActions('questionsanswers');
|
||||
JToolBarHelper::title(JText::_('COM_QUESTIONSANSWERS_DASHBOARD'), 'grid-2');
|
||||
|
||||
// set help url for this view if found
|
||||
$help_url = QuestionsanswersHelper::getHelpUrl('questionsanswers');
|
||||
if (QuestionsanswersHelper::checkString($help_url))
|
||||
{
|
||||
JToolbarHelper::help('COM_QUESTIONSANSWERS_HELP_MANAGER', false, $help_url);
|
||||
}
|
||||
|
||||
if ($canDo->get('core.admin') || $canDo->get('core.options'))
|
||||
{
|
||||
JToolBarHelper::preferences('com_questionsanswers');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to set up the document properties
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setDocument()
|
||||
{
|
||||
$document = JFactory::getDocument();
|
||||
|
||||
// add dashboard style sheets
|
||||
$document->addStyleSheet(JURI::root() . "administrator/components/com_questionsanswers/assets/css/dashboard.css");
|
||||
|
||||
// set page title
|
||||
$document->setTitle(JText::_('COM_QUESTIONSANSWERS_DASHBOARD'));
|
||||
|
||||
// add manifest to page JavaScript
|
||||
$document->addScriptDeclaration("var manifest = jQuery.parseJSON('" . json_encode($this->manifest) . "');", "text/javascript");
|
||||
}
|
||||
}
|
||||
$this->readme = $this->get('Readme');
|
||||
|
||||
// get the manifest details of the component
|
||||
$this->manifest = QuestionsanswersHelper::manifest();
|
||||
|
||||
// Set the toolbar
|
||||
$this->addToolBar();
|
||||
|
||||
// Check for errors.
|
||||
if (count($errors = $this->get('Errors')))
|
||||
{
|
||||
throw new Exception(implode("\n", $errors), 500);
|
||||
}
|
||||
|
||||
// Display the template
|
||||
parent::display($tpl);
|
||||
|
||||
// Set the document
|
||||
$this->setDocument();
|
||||
}
|
||||
|
||||
/**
|
||||
* Setting the toolbar
|
||||
*/
|
||||
protected function addToolBar()
|
||||
{
|
||||
$canDo = QuestionsanswersHelper::getActions('questionsanswers');
|
||||
JToolBarHelper::title(JText::_('COM_QUESTIONSANSWERS_DASHBOARD'), 'grid-2');
|
||||
|
||||
// set help url for this view if found
|
||||
$this->help_url = QuestionsanswersHelper::getHelpUrl('questionsanswers');
|
||||
if (QuestionsanswersHelper::checkString($this->help_url))
|
||||
{
|
||||
JToolbarHelper::help('COM_QUESTIONSANSWERS_HELP_MANAGER', false, $this->help_url);
|
||||
}
|
||||
|
||||
if ($canDo->get('core.admin') || $canDo->get('core.options'))
|
||||
{
|
||||
JToolBarHelper::preferences('com_questionsanswers');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to set up the document properties
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setDocument()
|
||||
{
|
||||
$document = JFactory::getDocument();
|
||||
|
||||
// add dashboard style sheets
|
||||
$document->addStyleSheet(JURI::root() . "administrator/components/com_questionsanswers/assets/css/dashboard.css");
|
||||
|
||||
// set page title
|
||||
$document->setTitle(JText::_('COM_QUESTIONSANSWERS_DASHBOARD'));
|
||||
|
||||
// add manifest to page JavaScript
|
||||
$document->addScriptDeclaration("var manifest = jQuery.parseJSON('" . json_encode($this->manifest) . "');", "text/javascript");
|
||||
}
|
||||
}
|
||||
|
@ -1,25 +1,25 @@
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage A4.print.css
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage A4.print.css
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
body {
|
||||
|
@ -1,27 +1,27 @@
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage help_document.js
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage help_document.js
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// Some Global Values
|
||||
jform_vvvvvvvvvv_required = false;
|
||||
jform_vvvvvvwvvw_required = false;
|
||||
@ -346,4 +346,4 @@ function isSet(val)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
File diff suppressed because one or more lines are too long
@ -1,27 +1,27 @@
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 8th February, 2021
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage question_and_answer.js
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.x
|
||||
@build 2nd March, 2022
|
||||
@created 30th January, 2017
|
||||
@package Questions and Answers
|
||||
@subpackage question_and_answer.js
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Questions & Answers
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
|
||||
|
||||
@ -184,4 +184,4 @@ function isEmpty(obj) {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
2
media/uikit-v3/css/uikit-rtl.min.css
vendored
2
media/uikit-v3/css/uikit-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
2
media/uikit-v3/css/uikit.min.css
vendored
2
media/uikit-v3/css/uikit.min.css
vendored
File diff suppressed because one or more lines are too long
@ -1,10 +1,10 @@
|
||||
/*! UIkit 3.1.2 | http://www.getuikit.com | (c) 2014 - 2018 YOOtheme | MIT License */
|
||||
/*! UIkit 3.6.22 | https://www.getuikit.com | (c) 2014 - 2021 YOOtheme | MIT License */
|
||||
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||
typeof define === 'function' && define.amd ? define('uikiticons', factory) :
|
||||
(global = global || self, global.UIkitIcons = factory());
|
||||
}(this, function () { 'use strict';
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.UIkitIcons = factory());
|
||||
}(this, (function () { 'use strict';
|
||||
|
||||
function plugin(UIkit) {
|
||||
|
||||
@ -48,8 +48,10 @@
|
||||
"credit-card": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><rect fill=\"none\" stroke=\"#000\" x=\"1.5\" y=\"4.5\" width=\"17\" height=\"12\"/><rect x=\"1\" y=\"7\" width=\"18\" height=\"3\"/></svg>",
|
||||
"database": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><ellipse fill=\"none\" stroke=\"#000\" cx=\"10\" cy=\"4.64\" rx=\"7.5\" ry=\"3.14\"/><path fill=\"none\" stroke=\"#000\" d=\"M17.5,8.11 C17.5,9.85 14.14,11.25 10,11.25 C5.86,11.25 2.5,9.84 2.5,8.11\"/><path fill=\"none\" stroke=\"#000\" d=\"M17.5,11.25 C17.5,12.99 14.14,14.39 10,14.39 C5.86,14.39 2.5,12.98 2.5,11.25\"/><path fill=\"none\" stroke=\"#000\" d=\"M17.49,4.64 L17.5,14.36 C17.5,16.1 14.14,17.5 10,17.5 C5.86,17.5 2.5,16.09 2.5,14.36 L2.5,4.64\"/></svg>",
|
||||
"desktop": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><rect x=\"8\" y=\"15\" width=\"1\" height=\"2\"/><rect x=\"11\" y=\"15\" width=\"1\" height=\"2\"/><rect x=\"5\" y=\"16\" width=\"10\" height=\"1\"/><rect fill=\"none\" stroke=\"#000\" x=\"1.5\" y=\"3.5\" width=\"17\" height=\"11\"/></svg>",
|
||||
"discord": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\"><path d=\"M16.074,4.361a14.243,14.243,0,0,0-3.61-1.134,10.61,10.61,0,0,0-.463.96,13.219,13.219,0,0,0-4,0,10.138,10.138,0,0,0-.468-.96A14.206,14.206,0,0,0,3.919,4.364,15.146,15.146,0,0,0,1.324,14.5a14.435,14.435,0,0,0,4.428,2.269A10.982,10.982,0,0,0,6.7,15.21a9.294,9.294,0,0,1-1.494-.727c.125-.093.248-.19.366-.289a10.212,10.212,0,0,0,8.854,0c.119.1.242.2.366.289a9.274,9.274,0,0,1-1.5.728,10.8,10.8,0,0,0,.948,1.562,14.419,14.419,0,0,0,4.431-2.27A15.128,15.128,0,0,0,16.074,4.361Zm-8.981,8.1a1.7,1.7,0,0,1-1.573-1.79A1.689,1.689,0,0,1,7.093,8.881a1.679,1.679,0,0,1,1.573,1.791A1.687,1.687,0,0,1,7.093,12.462Zm5.814,0a1.7,1.7,0,0,1-1.573-1.79,1.689,1.689,0,0,1,1.573-1.791,1.679,1.679,0,0,1,1.573,1.791A1.688,1.688,0,0,1,12.907,12.462Z\"/></svg>",
|
||||
"download": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" points=\"14,10 9.5,14.5 5,10\"/><rect x=\"3\" y=\"17\" width=\"13\" height=\"1\"/><line fill=\"none\" stroke=\"#000\" x1=\"9.5\" y1=\"13.91\" x2=\"9.5\" y2=\"3\"/></svg>",
|
||||
"dribbble": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fill=\"none\" stroke=\"#000\" stroke-width=\"1.4\" d=\"M1.3,8.9c0,0,5,0.1,8.6-1c1.4-0.4,2.6-0.9,4-1.9 c1.4-1.1,2.5-2.5,2.5-2.5\"/><path fill=\"none\" stroke=\"#000\" stroke-width=\"1.4\" d=\"M3.9,16.6c0,0,1.7-2.8,3.5-4.2 c1.8-1.3,4-2,5.7-2.2C16,10,19,10.6,19,10.6\"/><path fill=\"none\" stroke=\"#000\" stroke-width=\"1.4\" d=\"M6.9,1.6c0,0,3.3,4.6,4.2,6.8 c0.4,0.9,1.3,3.1,1.9,5.2c0.6,2,0.9,4.4,0.9,4.4\"/><circle fill=\"none\" stroke=\"#000\" stroke-width=\"1.4\" cx=\"10\" cy=\"10\" r=\"9\"/></svg>",
|
||||
"etsy": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\"><path d=\"M8,4.26C8,4.07,8,4,8.31,4h4.46c.79,0,1.22.67,1.53,1.91l.25,1h.76c.14-2.82.26-4,.26-4S13.65,3,12.52,3H6.81L3.75,2.92v.84l1,.2c.73.11.9.27,1,1,0,0,.06,2,.06,5.17s-.06,5.14-.06,5.14c0,.59-.23.81-1,.94l-1,.2v.84l3.06-.1h5.11c1.15,0,3.82.1,3.82.1,0-.7.45-3.88.51-4.22h-.73l-.76,1.69a2.25,2.25,0,0,1-2.45,1.47H9.4c-1,0-1.44-.4-1.44-1.24V10.44s2.16,0,2.86.06c.55,0,.85.19,1.06,1l.23,1H13L12.9,9.94,13,7.41h-.85l-.28,1.13c-.16.74-.28.84-1,1-1,.1-2.89.09-2.89.09Z\"/></svg>",
|
||||
"expand": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><polygon points=\"13 2 18 2 18 7 17 7 17 3 13 3\"/><polygon points=\"2 13 3 13 3 17 7 17 7 18 2 18\"/><path fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" d=\"M11,9 L17,3\"/><path fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" d=\"M3,17 L9,11\"/></svg>",
|
||||
"facebook": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M11,10h2.6l0.4-3H11V5.3c0-0.9,0.2-1.5,1.5-1.5H14V1.1c-0.3,0-1-0.1-2.1-0.1C9.6,1,8,2.4,8,5v2H5.5v3H8v8h3V10z\"/></svg>",
|
||||
"file-edit": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fill=\"none\" stroke=\"#000\" d=\"M18.65,1.68 C18.41,1.45 18.109,1.33 17.81,1.33 C17.499,1.33 17.209,1.45 16.98,1.68 L8.92,9.76 L8,12.33 L10.55,11.41 L18.651,3.34 C19.12,2.87 19.12,2.15 18.65,1.68 L18.65,1.68 L18.65,1.68 Z\"/><polyline fill=\"none\" stroke=\"#000\" points=\"16.5 8.482 16.5 18.5 3.5 18.5 3.5 1.5 14.211 1.5\"/></svg>",
|
||||
@ -62,11 +64,10 @@
|
||||
"foursquare": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M15.23,2 C15.96,2 16.4,2.41 16.5,2.86 C16.57,3.15 16.56,3.44 16.51,3.73 C16.46,4.04 14.86,11.72 14.75,12.03 C14.56,12.56 14.16,12.82 13.61,12.83 C13.03,12.84 11.09,12.51 10.69,13 C10.38,13.38 7.79,16.39 6.81,17.53 C6.61,17.76 6.4,17.96 6.08,17.99 C5.68,18.04 5.29,17.87 5.17,17.45 C5.12,17.28 5.1,17.09 5.1,16.91 C5.1,12.4 4.86,7.81 5.11,3.31 C5.17,2.5 5.81,2.12 6.53,2 L15.23,2 L15.23,2 Z M9.76,11.42 C9.94,11.19 10.17,11.1 10.45,11.1 L12.86,11.1 C13.12,11.1 13.31,10.94 13.36,10.69 C13.37,10.64 13.62,9.41 13.74,8.83 C13.81,8.52 13.53,8.28 13.27,8.28 C12.35,8.29 11.42,8.28 10.5,8.28 C9.84,8.28 9.83,7.69 9.82,7.21 C9.8,6.85 10.13,6.55 10.5,6.55 C11.59,6.56 12.67,6.55 13.76,6.55 C14.03,6.55 14.23,6.4 14.28,6.14 C14.34,5.87 14.67,4.29 14.67,4.29 C14.67,4.29 14.82,3.74 14.19,3.74 L7.34,3.74 C7,3.75 6.84,4.02 6.84,4.33 C6.84,7.58 6.85,14.95 6.85,14.99 C6.87,15 8.89,12.51 9.76,11.42 L9.76,11.42 Z\"/></svg>",
|
||||
"future": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><polyline points=\"19 2 18 2 18 6 14 6 14 7 19 7 19 2\"/><path fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" d=\"M18,6.548 C16.709,3.29 13.354,1 9.6,1 C4.6,1 0.6,5 0.6,10 C0.6,15 4.6,19 9.6,19 C14.6,19 18.6,15 18.6,10\"/><rect x=\"9\" y=\"4\" width=\"1\" height=\"7\"/><path d=\"M13.018,14.197 L9.445,10.625\" fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\"/></svg>",
|
||||
"git-branch": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><circle fill=\"none\" stroke=\"#000\" stroke-width=\"1.2\" cx=\"7\" cy=\"3\" r=\"2\"/><circle fill=\"none\" stroke=\"#000\" stroke-width=\"1.2\" cx=\"14\" cy=\"6\" r=\"2\"/><circle fill=\"none\" stroke=\"#000\" stroke-width=\"1.2\" cx=\"7\" cy=\"17\" r=\"2\"/><path fill=\"none\" stroke=\"#000\" stroke-width=\"2\" d=\"M14,8 C14,10.41 12.43,10.87 10.56,11.25 C9.09,11.54 7,12.06 7,15 L7,5\"/></svg>",
|
||||
"git-fork": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><circle fill=\"none\" stroke=\"#000\" stroke-width=\"1.2\" cx=\"5.79\" cy=\"2.79\" r=\"1.79\"/><circle fill=\"none\" stroke=\"#000\" stroke-width=\"1.2\" cx=\"14.19\" cy=\"2.79\" r=\"1.79\"/><ellipse fill=\"none\" stroke=\"#000\" stroke-width=\"1.2\" cx=\"10.03\" cy=\"16.79\" rx=\"1.79\" ry=\"1.79\"/><path fill=\"none\" stroke=\"#000\" stroke-width=\"2\" d=\"M5.79,4.57 L5.79,6.56 C5.79,9.19 10.03,10.22 10.03,13.31 C10.03,14.86 10.04,14.55 10.04,14.55 C10.04,14.37 10.04,14.86 10.04,13.31 C10.04,10.22 14.2,9.19 14.2,6.56 L14.2,4.57\"/></svg>",
|
||||
"git-fork": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><circle fill=\"none\" stroke=\"#000\" stroke-width=\"1.2\" cx=\"5.79\" cy=\"2.79\" r=\"1.79\"/><circle fill=\"none\" stroke=\"#000\" stroke-width=\"1.2\" cx=\"14.19\" cy=\"2.79\" r=\"1.79\"/><circle fill=\"none\" stroke=\"#000\" stroke-width=\"1.2\" cx=\"10.03\" cy=\"16.79\" r=\"1.79\"/><path fill=\"none\" stroke=\"#000\" stroke-width=\"2\" d=\"M5.79,4.57 L5.79,6.56 C5.79,9.19 10.03,10.22 10.03,13.31 C10.03,14.86 10.04,14.55 10.04,14.55 C10.04,14.37 10.04,14.86 10.04,13.31 C10.04,10.22 14.2,9.19 14.2,6.56 L14.2,4.57\"/></svg>",
|
||||
"github-alt": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10,0.5 C4.75,0.5 0.5,4.76 0.5,10.01 C0.5,15.26 4.75,19.51 10,19.51 C15.24,19.51 19.5,15.26 19.5,10.01 C19.5,4.76 15.25,0.5 10,0.5 L10,0.5 Z M12.81,17.69 C12.81,17.69 12.81,17.7 12.79,17.69 C12.47,17.75 12.35,17.59 12.35,17.36 L12.35,16.17 C12.35,15.45 12.09,14.92 11.58,14.56 C12.2,14.51 12.77,14.39 13.26,14.21 C13.87,13.98 14.36,13.69 14.74,13.29 C15.42,12.59 15.76,11.55 15.76,10.17 C15.76,9.25 15.45,8.46 14.83,7.8 C15.1,7.08 15.07,6.29 14.75,5.44 L14.51,5.42 C14.34,5.4 14.06,5.46 13.67,5.61 C13.25,5.78 12.79,6.03 12.31,6.35 C11.55,6.16 10.81,6.05 10.09,6.05 C9.36,6.05 8.61,6.15 7.88,6.35 C7.28,5.96 6.75,5.68 6.26,5.54 C6.07,5.47 5.9,5.44 5.78,5.44 L5.42,5.44 C5.06,6.29 5.04,7.08 5.32,7.8 C4.7,8.46 4.4,9.25 4.4,10.17 C4.4,11.94 4.96,13.16 6.08,13.84 C6.53,14.13 7.05,14.32 7.69,14.43 C8.03,14.5 8.32,14.54 8.55,14.55 C8.07,14.89 7.82,15.42 7.82,16.16 L7.82,17.51 C7.8,17.69 7.7,17.8 7.51,17.8 C4.21,16.74 1.82,13.65 1.82,10.01 C1.82,5.5 5.49,1.83 10,1.83 C14.5,1.83 18.17,5.5 18.17,10.01 C18.18,13.53 15.94,16.54 12.81,17.69 L12.81,17.69 Z\"/></svg>",
|
||||
"github": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10,1 C5.03,1 1,5.03 1,10 C1,13.98 3.58,17.35 7.16,18.54 C7.61,18.62 7.77,18.34 7.77,18.11 C7.77,17.9 7.76,17.33 7.76,16.58 C5.26,17.12 4.73,15.37 4.73,15.37 C4.32,14.33 3.73,14.05 3.73,14.05 C2.91,13.5 3.79,13.5 3.79,13.5 C4.69,13.56 5.17,14.43 5.17,14.43 C5.97,15.8 7.28,15.41 7.79,15.18 C7.87,14.6 8.1,14.2 8.36,13.98 C6.36,13.75 4.26,12.98 4.26,9.53 C4.26,8.55 4.61,7.74 5.19,7.11 C5.1,6.88 4.79,5.97 5.28,4.73 C5.28,4.73 6.04,4.49 7.75,5.65 C8.47,5.45 9.24,5.35 10,5.35 C10.76,5.35 11.53,5.45 12.25,5.65 C13.97,4.48 14.72,4.73 14.72,4.73 C15.21,5.97 14.9,6.88 14.81,7.11 C15.39,7.74 15.73,8.54 15.73,9.53 C15.73,12.99 13.63,13.75 11.62,13.97 C11.94,14.25 12.23,14.8 12.23,15.64 C12.23,16.84 12.22,17.81 12.22,18.11 C12.22,18.35 12.38,18.63 12.84,18.54 C16.42,17.35 19,13.98 19,10 C19,5.03 14.97,1 10,1 L10,1 Z\"/></svg>",
|
||||
"gitter": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><rect x=\"3.5\" y=\"1\" width=\"1.531\" height=\"11.471\"/><rect x=\"7.324\" y=\"4.059\" width=\"1.529\" height=\"15.294\"/><rect x=\"11.148\" y=\"4.059\" width=\"1.527\" height=\"15.294\"/><rect x=\"14.971\" y=\"4.059\" width=\"1.529\" height=\"8.412\"/></svg>",
|
||||
"google-plus": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12.9,9c0,2.7-0.6,5-3.2,6.3c-3.7,1.8-8.1,0.2-9.4-3.6C-1.1,7.6,1.9,3.3,6.1,3c1.7-0.1,3.2,0.3,4.6,1.3 c0.1,0.1,0.3,0.2,0.4,0.4c-0.5,0.5-1.2,1-1.7,1.6c-1-0.8-2.1-1.1-3.5-0.9C5,5.6,4.2,6,3.6,6.7c-1.3,1.3-1.5,3.4-0.5,5 c1,1.7,2.6,2.3,4.6,1.9c1.4-0.3,2.4-1.2,2.6-2.6H6.9V9H12.9z\"/><polygon points=\"20,9 20,11 18,11 18,13 16,13 16,11 14,11 14,9 16,9 16,7 18,7 18,9\"/></svg>",
|
||||
"google": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M17.86,9.09 C18.46,12.12 17.14,16.05 13.81,17.56 C9.45,19.53 4.13,17.68 2.47,12.87 C0.68,7.68 4.22,2.42 9.5,2.03 C11.57,1.88 13.42,2.37 15.05,3.65 C15.22,3.78 15.37,3.93 15.61,4.14 C14.9,4.81 14.23,5.45 13.5,6.14 C12.27,5.08 10.84,4.72 9.28,4.98 C8.12,5.17 7.16,5.76 6.37,6.63 C4.88,8.27 4.62,10.86 5.76,12.82 C6.95,14.87 9.17,15.8 11.57,15.25 C13.27,14.87 14.76,13.33 14.89,11.75 L10.51,11.75 L10.51,9.09 L17.86,9.09 L17.86,9.09 Z\"/></svg>",
|
||||
"grid": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><rect x=\"2\" y=\"2\" width=\"3\" height=\"3\"/><rect x=\"8\" y=\"2\" width=\"3\" height=\"3\"/><rect x=\"14\" y=\"2\" width=\"3\" height=\"3\"/><rect x=\"2\" y=\"8\" width=\"3\" height=\"3\"/><rect x=\"8\" y=\"8\" width=\"3\" height=\"3\"/><rect x=\"14\" y=\"8\" width=\"3\" height=\"3\"/><rect x=\"2\" y=\"14\" width=\"3\" height=\"3\"/><rect x=\"8\" y=\"14\" width=\"3\" height=\"3\"/><rect x=\"14\" y=\"14\" width=\"3\" height=\"3\"/></svg>",
|
||||
"happy": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><circle cx=\"13\" cy=\"7\" r=\"1\"/><circle cx=\"7\" cy=\"7\" r=\"1\"/><circle fill=\"none\" stroke=\"#000\" cx=\"10\" cy=\"10\" r=\"8.5\"/><path fill=\"none\" stroke=\"#000\" d=\"M14.6,11.4 C13.9,13.3 12.1,14.5 10,14.5 C7.9,14.5 6.1,13.3 5.4,11.4\"/></svg>",
|
||||
@ -130,6 +131,7 @@
|
||||
"tablet": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fill=\"none\" stroke=\"#000\" d=\"M5,18.5 C4.2,18.5 3.5,17.8 3.5,17 L3.5,3 C3.5,2.2 4.2,1.5 5,1.5 L16,1.5 C16.8,1.5 17.5,2.2 17.5,3 L17.5,17 C17.5,17.8 16.8,18.5 16,18.5 L5,18.5 L5,18.5 L5,18.5 Z\"/><circle cx=\"10.5\" cy=\"16.3\" r=\".8\"/></svg>",
|
||||
"tag": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" d=\"M17.5,3.71 L17.5,7.72 C17.5,7.96 17.4,8.2 17.21,8.39 L8.39,17.2 C7.99,17.6 7.33,17.6 6.93,17.2 L2.8,13.07 C2.4,12.67 2.4,12.01 2.8,11.61 L11.61,2.8 C11.81,2.6 12.08,2.5 12.34,2.5 L16.19,2.5 C16.52,2.5 16.86,2.63 17.11,2.88 C17.35,3.11 17.48,3.4 17.5,3.71 L17.5,3.71 Z\"/><circle cx=\"14\" cy=\"6\" r=\"1\"/></svg>",
|
||||
"thumbnails": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><rect fill=\"none\" stroke=\"#000\" x=\"3.5\" y=\"3.5\" width=\"5\" height=\"5\"/><rect fill=\"none\" stroke=\"#000\" x=\"11.5\" y=\"3.5\" width=\"5\" height=\"5\"/><rect fill=\"none\" stroke=\"#000\" x=\"11.5\" y=\"11.5\" width=\"5\" height=\"5\"/><rect fill=\"none\" stroke=\"#000\" x=\"3.5\" y=\"11.5\" width=\"5\" height=\"5\"/></svg>",
|
||||
"tiktok": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M17.24,6V8.82a6.79,6.79,0,0,1-4-1.28v5.81A5.26,5.26,0,1,1,8,8.1a4.36,4.36,0,0,1,.72.05v2.9A2.57,2.57,0,0,0,7.64,11a2.4,2.4,0,1,0,2.77,2.38V2h2.86a4,4,0,0,0,1.84,3.38A4,4,0,0,0,17.24,6Z\"/></svg>",
|
||||
"trash": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" points=\"6.5 3 6.5 1.5 13.5 1.5 13.5 3\"/><polyline fill=\"none\" stroke=\"#000\" points=\"4.5 4 4.5 18.5 15.5 18.5 15.5 4\"/><rect x=\"8\" y=\"7\" width=\"1\" height=\"9\"/><rect x=\"11\" y=\"7\" width=\"1\" height=\"9\"/><rect x=\"2\" y=\"3\" width=\"16\" height=\"1\"/></svg>",
|
||||
"triangle-down": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><polygon points=\"5 7 15 7 10 12\"/></svg>",
|
||||
"triangle-left": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><polygon points=\"12 5 7 10 12 15\"/></svg>",
|
||||
@ -138,6 +140,7 @@
|
||||
"tripadvisor": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M19.021,7.866C19.256,6.862,20,5.854,20,5.854h-3.346C14.781,4.641,12.504,4,9.98,4C7.363,4,4.999,4.651,3.135,5.876H0\tc0,0,0.738,0.987,0.976,1.988c-0.611,0.837-0.973,1.852-0.973,2.964c0,2.763,2.249,5.009,5.011,5.009\tc1.576,0,2.976-0.737,3.901-1.879l1.063,1.599l1.075-1.615c0.475,0.611,1.1,1.111,1.838,1.451c1.213,0.547,2.574,0.612,3.825,0.15\tc2.589-0.963,3.913-3.852,2.964-6.439c-0.175-0.463-0.4-0.876-0.675-1.238H19.021z M16.38,14.594\tc-1.002,0.371-2.088,0.328-3.06-0.119c-0.688-0.317-1.252-0.817-1.657-1.438c-0.164-0.25-0.313-0.52-0.417-0.811\tc-0.124-0.328-0.186-0.668-0.217-1.014c-0.063-0.689,0.037-1.396,0.339-2.043c0.448-0.971,1.251-1.71,2.25-2.079\tc2.075-0.765,4.375,0.3,5.14,2.366c0.762,2.066-0.301,4.37-2.363,5.134L16.38,14.594L16.38,14.594z M8.322,13.066\tc-0.72,1.059-1.935,1.76-3.309,1.76c-2.207,0-4.001-1.797-4.001-3.996c0-2.203,1.795-4.002,4.001-4.002\tc2.204,0,3.999,1.8,3.999,4.002c0,0.137-0.024,0.261-0.04,0.396c-0.067,0.678-0.284,1.313-0.648,1.853v-0.013H8.322z M2.472,10.775\tc0,1.367,1.112,2.479,2.476,2.479c1.363,0,2.472-1.11,2.472-2.479c0-1.359-1.11-2.468-2.472-2.468\tC3.584,8.306,2.473,9.416,2.472,10.775L2.472,10.775z M12.514,10.775c0,1.367,1.104,2.479,2.471,2.479\tc1.363,0,2.474-1.108,2.474-2.479c0-1.359-1.11-2.468-2.474-2.468c-1.364,0-2.477,1.109-2.477,2.468H12.514z M3.324,10.775\tc0-0.893,0.726-1.618,1.614-1.618c0.889,0,1.625,0.727,1.625,1.618c0,0.898-0.725,1.627-1.625,1.627\tc-0.901,0-1.625-0.729-1.625-1.627H3.324z M13.354,10.775c0-0.893,0.726-1.618,1.627-1.618c0.886,0,1.61,0.727,1.61,1.618\tc0,0.898-0.726,1.627-1.626,1.627s-1.625-0.729-1.625-1.627H13.354z M9.977,4.875c1.798,0,3.425,0.324,4.849,0.968\tc-0.535,0.015-1.061,0.108-1.586,0.3c-1.264,0.463-2.264,1.388-2.815,2.604c-0.262,0.551-0.398,1.133-0.448,1.72\tC9.79,7.905,7.677,5.873,5.076,5.82C6.501,5.208,8.153,4.875,9.94,4.875H9.977z\"/></svg>",
|
||||
"tumblr": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6.885,8.598c0,0,0,3.393,0,4.996c0,0.282,0,0.66,0.094,0.942c0.377,1.509,1.131,2.545,2.545,3.11 c1.319,0.472,2.356,0.472,3.676,0c0.565-0.188,1.132-0.659,1.132-0.659l-0.849-2.263c0,0-1.036,0.378-1.603,0.283 c-0.565-0.094-1.226-0.66-1.226-1.508c0-1.603,0-4.902,0-4.902h2.828V5.771h-2.828V2H8.205c0,0-0.094,0.66-0.188,0.942 C7.828,3.791,7.262,4.733,6.603,5.394C5.848,6.147,5,6.43,5,6.43v2.168H6.885z\"/></svg>",
|
||||
"tv": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><rect x=\"7\" y=\"16\" width=\"6\" height=\"1\"/><rect fill=\"none\" stroke=\"#000\" x=\".5\" y=\"3.5\" width=\"19\" height=\"11\"/></svg>",
|
||||
"twitch": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M5.23,1,2,4.23V15.85H5.88v3.23L9.1,15.85h2.59L17.5,10V1Zm11,8.4L13.62,12H11L8.78,14.24V12H5.88V2.29H16.21Z\"/><rect x=\"12.98\" y=\"4.55\" width=\"1.29\" height=\"3.88\"/><rect x=\"9.43\" y=\"4.55\" width=\"1.29\" height=\"3.88\"/></svg>",
|
||||
"twitter": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M19,4.74 C18.339,5.029 17.626,5.229 16.881,5.32 C17.644,4.86 18.227,4.139 18.503,3.28 C17.79,3.7 17.001,4.009 16.159,4.17 C15.485,3.45 14.526,3 13.464,3 C11.423,3 9.771,4.66 9.771,6.7 C9.771,6.99 9.804,7.269 9.868,7.539 C6.795,7.38 4.076,5.919 2.254,3.679 C1.936,4.219 1.754,4.86 1.754,5.539 C1.754,6.82 2.405,7.95 3.397,8.61 C2.79,8.589 2.22,8.429 1.723,8.149 L1.723,8.189 C1.723,9.978 2.997,11.478 4.686,11.82 C4.376,11.899 4.049,11.939 3.713,11.939 C3.475,11.939 3.245,11.919 3.018,11.88 C3.49,13.349 4.852,14.419 6.469,14.449 C5.205,15.429 3.612,16.019 1.882,16.019 C1.583,16.019 1.29,16.009 1,15.969 C2.635,17.019 4.576,17.629 6.662,17.629 C13.454,17.629 17.17,12 17.17,7.129 C17.17,6.969 17.166,6.809 17.157,6.649 C17.879,6.129 18.504,5.478 19,4.74\"/></svg>",
|
||||
"uikit": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><polygon points=\"14.4,3.1 11.3,5.1 15,7.3 15,12.9 10,15.7 5,12.9 5,8.5 2,6.8 2,14.8 9.9,19.5 18,14.8 18,5.3\"/><polygon points=\"9.8,4.2 6.7,2.4 9.8,0.4 12.9,2.3\"/></svg>",
|
||||
"unlock": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><rect fill=\"none\" stroke=\"#000\" x=\"3.5\" y=\"8.5\" width=\"13\" height=\"10\"/><path fill=\"none\" stroke=\"#000\" d=\"M6.5,8.5 L6.5,4.9 C6.5,3 8.1,1.5 10,1.5 C11.9,1.5 13.5,3 13.5,4.9\"/></svg>",
|
||||
@ -163,4 +166,4 @@
|
||||
|
||||
return plugin;
|
||||
|
||||
}));
|
||||
})));
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user