YaWK  24.1
Yet another WebKit
YAWK\WIDGETS\CUSTOM_HTML\CODE\customHtml Class Reference

Embed a html/javascript code snippet. More...

Public Member Functions

 __construct ($db)
 Load all widget settings from database and fill object. More...
 
 init ()
 Init and load custom html code. More...
 

Public Attributes

 $customHtmlCode = ''
 
 $widget = ''
 

Detailed Description

Embed a html/javascript code snippet.

Embed a custom html code snippet.

Sometimes you would like to embed (more or less) small piece of code in any position. This widget helps you to achieve this. You can enter any valid html code. Even if it is not recommended, you are able to add a piece of javascript here too. This Widget features the combination of summernote and codemirror to give you the best code editing experience.

Author
Daniel Retzl danie.nosp@m.lret.nosp@m.zl@gm.nosp@m.ail..nosp@m.com
Version
1.0.0

Definition at line 17 of file custom_html.php.

Constructor & Destructor Documentation

◆ __construct()

YAWK\WIDGETS\CUSTOM_HTML\CODE\customHtml::__construct (   $db)

Load all widget settings from database and fill object.

Parameters
object$dbDatabase Object

Load all widget settings on object init.

Definition at line 29 of file custom_html.php.

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  }
if(isset($_POST['save'])) $settings
$value

References $db, $settings, $value, and YAWK\widget\getWidgetSettingsArray().

Member Function Documentation

◆ init()

YAWK\WIDGETS\CUSTOM_HTML\CODE\customHtml::init ( )

Init and load custom html code.

use this method to run the clock

Definition at line 43 of file custom_html.php.

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
51  }
52  else
53  { // custom html code is not valid, leave empty
54  $this->customHtmlCode = '';
55  }

References YAWK\WIDGETS\CUSTOM_HTML\CODE\customHtml\$customHtmlCode.

Member Data Documentation

◆ $customHtmlCode

YAWK\WIDGETS\CUSTOM_HTML\CODE\customHtml::$customHtmlCode = ''
Parameters
stringCustom HTML Code

Definition at line 22 of file custom_html.php.

Referenced by YAWK\WIDGETS\CUSTOM_HTML\CODE\customHtml\init().

◆ $widget

YAWK\WIDGETS\CUSTOM_HTML\CODE\customHtml::$widget = ''
Parameters
objectglobal widget object data

Definition at line 20 of file custom_html.php.


The documentation for this class was generated from the following file: