YaWK
24.1
Yet another WebKit
custom_html.php
Go to the documentation of this file.
1
<?php
2
namespace
YAWK\WIDGETS\CUSTOM_HTML\CODE
3
{
4
/**
5
* @details<b>Embed a custom html code snippet.</b>
6
*
7
* <p>Sometimes you would like to embed (more or less) small piece of code in any position.
8
* This widget helps you to achieve this. You can enter any valid html code. Even if it is not
9
* recommended, you are able to add a piece of javascript here too. This Widget features the
10
* combination of summernote and codemirror to give you the best code editing experience.</p>
11
*
12
*
13
* @author Daniel Retzl <
[email protected]
>
14
* @copyright 2018 Daniel Retzl
15
* @version 1.0.0
16
* @brief Embed a html/javascript code snippet.
17
*/
18
class
customHtml
19
{
20
/** @param object global widget object data */
21
public
$widget
=
''
;
22
/** @param string Custom HTML Code */
23
public
$customHtmlCode
=
''
;
24
25
/**
26
* @brief Load all widget settings from database and fill object
27
* @param object $db Database Object
28
* @brief Load all widget settings on object init.
29
*/
30
public
function
__construct
(
$db
)
31
{
32
// load this widget settings from db
33
$this->
widget
= new \YAWK\widget();
34
$settings
= $this->
widget
->
getWidgetSettingsArray
(
$db
);
35
foreach
(
$settings
as $property =>
$value
) {
36
$this->$property =
$value
;
37
}
38
}
39
40
/**
41
* @brief Init and load custom html code
42
* @brief use this method to run the clock
43
*/
44
public
function
init
()
45
{
46
// check if customHtmlCode is set, not empty and a string
47
if
(isset($this->customHtmlCode) && (!empty($this->customHtmlCode)
48
&& (is_string($this->customHtmlCode))))
49
{
// output custom html code
50
echo
$this->customHtmlCode
;
51
}
52
else
53
{
// custom html code is not valid, leave empty
54
$this->customHtmlCode =
''
;
55
}
56
}
57
}
58
}
YAWK\WIDGETS\CUSTOM_HTML\CODE\customHtml
Embed a html/javascript code snippet.
Definition:
custom_html.php:18
YAWK\WIDGETS\CUSTOM_HTML\CODE\customHtml\__construct
__construct($db)
Load all widget settings from database and fill object.
Definition:
custom_html.php:29
YAWK\WIDGETS\CUSTOM_HTML\CODE\customHtml\$customHtmlCode
$customHtmlCode
Definition:
custom_html.php:22
YAWK\WIDGETS\CUSTOM_HTML\CODE\customHtml\$widget
$widget
Definition:
custom_html.php:20
YAWK\WIDGETS\CUSTOM_HTML\CODE\customHtml\init
init()
Init and load custom html code.
Definition:
custom_html.php:43
YAWK\widget
Widgets are small, useful tools that you can include everywhere in your website.
Definition:
widget.php:22
YAWK\widget\getWidgetSettingsArray
getWidgetSettingsArray($db)
Get widget settings and return it as array.
Definition:
widget.php:69
$db
$db
Definition:
dismiss-notifications.php:4
YAWK\WIDGETS\CUSTOM_HTML\CODE
Definition:
custom_html.php:2
$settings
if(isset($_POST['save'])) $settings
Definition:
settings-backend.php:46
$value
$value
Definition:
widget-edit.php:244
yawk.io
system
widgets
custom_html
classes
custom_html.php
Generated on Tue Jan 16 2024 21:59:03 for YaWK by
doxygen 1.9.1