YaWK
24.1
Yet another WebKit
faq-frontend.php
Go to the documentation of this file.
1
<?php
2
namespace
YAWK\PLUGINS\FAQ
{
3
/**
4
* @details <b>Frontend FAQ Class</b>
5
* <p>This class extends \YAWK\PLUGINS\FAQ\faq.</p>
6
* <p><i>This class covers frontend functionality. See Methods Summary for Details!</i></p>
7
* @author Daniel Retzl <
[email protected]
>
8
* @version 1.0.0
9
* @brief Handles the FAQ Frontend methods.
10
*/
11
class
frontend
extends
\YAWK\PLUGINS\FAQ\faq
{
12
/** * @param int faq ID */
13
public
$id
;
14
/** * @param int category ID */
15
public
$cat
;
16
/** * @param string question */
17
public
$question
;
18
/** * @param string answer */
19
public
$answer
;
20
21
/**
22
* @brief get all data from faq database and draw (output) a html list with all FAQ's
23
* @param object $db database
24
*/
25
function
draw_faq(
$db
) {
26
/** @var $db \YAWK\db */
27
echo
"<h1><i class=\"fa fa-question-circle\"></i> F.A.Q. <small>Häufig gestellte Fragen & Antworten...</small></h1><br>"
;
28
if
(
$res
=
$db
->query(
"SELECT * FROM {plugin_faq} ORDER by sort,id"
))
29
{
// get faq as html list item in loop
30
while
($row = mysqli_fetch_assoc(
$res
))
31
{
// 1 list item per FAQ entry
32
print
"<ul class=\"list-group\">
33
<li class=\"list-group-item\"><h4>"
.$row[
'question'
].
"</h4>"
.$row[
'answer'
].
"<br><br></li>
34
</ul>"
;
35
}
36
}
37
else
38
{
// q failed
39
\YAWK\alert::draw
(
"danger"
,
"Error!"
,
"Could not get FAQ Entries. This could be a database error."
,
""
,
"2400"
);
40
}
41
}
// end function
42
43
}
// end class
44
}
// end namespace
YAWK\PLUGINS\FAQ\faq
Handles the FAQ backend methods.
Definition:
faq-backend.php:15
YAWK\PLUGINS\FAQ\frontend
Handles the FAQ Frontend methods.
Definition:
faq-frontend.php:11
YAWK\PLUGINS\FAQ\frontend\$question
$question
Definition:
faq-frontend.php:17
YAWK\PLUGINS\FAQ\frontend\$cat
$cat
Definition:
faq-frontend.php:15
YAWK\PLUGINS\FAQ\frontend\$id
$id
Definition:
faq-frontend.php:13
YAWK\PLUGINS\FAQ\frontend\$answer
$answer
Definition:
faq-frontend.php:19
YAWK\alert\draw
static draw($type, $title, $text, $redirect, $delay)
Definition:
alert.php:30
$db
$db
Definition:
dismiss-notifications.php:4
YAWK\PLUGINS\FAQ
Definition:
faq-backend.php:2
$res
$res
Definition:
settings-assets.php:149
yawk.io
system
plugins
faq
classes
faq-frontend.php
Generated on Tue Jan 16 2024 21:59:01 for YaWK by
doxygen 1.9.1