YaWK  24.1
Yet another WebKit
YAWK\WIDGETS\SPOTIFY\EMBED\spotify Class Reference

spotify Widget (empty) for DEMO and development purpose! More...

+ Inheritance diagram for YAWK\WIDGETS\SPOTIFY\EMBED\spotify:

Public Member Functions

 __construct ($db)
 Load all widget settings from database and fill object. More...
 
 init ()
 Init spotify widget. More...
 
- Public Member Functions inherited from YAWK\widget
 getHeading ($heading, $subtext)
 Get widget heading and subtext, return headline. More...
 
 getWidgetSettingsArray ($db)
 Get widget settings and return it as array. More...
 
 printObject ()
 Print all object data. More...
 

Public Attributes

 $spotifyEmbedCode =''
 
 $spotifyHeading = ''
 
 $spotifyHeight =''
 
 $spotifySubtext = ''
 
 $spotifyWidth =''
 
 $widget = ''
 
- Public Attributes inherited from YAWK\widget
 $data
 
 $date_publish
 
 $date_unpublish
 
 $folder
 
 $id
 
 $marginBottom
 
 $marginTop
 
 $name
 
 $pageID
 
 $position
 
 $published
 
 $sort
 
 $widgetTitle
 
 $widgetType
 

Additional Inherited Members

- Static Public Member Functions inherited from YAWK\widget
static getAllSettingsIntoArray ($db, $widgetID)
 Returns an array with all widget settings data. More...
 
static getAllWidgetTypes ($db)
 Return all widget types as associative array. More...
 
static getCurrentWidgetPath ($db)
 return current widget path More...
 
static getFacebookLikeBox ()
 return the facebook likebox widget More...
 
static getLoginBox ()
 return the user login box widget More...
 
static loadWidgetsOfPage ($db, $page)
 Returns an array of all widgets that are linked with given page->id. More...
 

Detailed Description

spotify Widget (empty) for DEMO and development purpose!

Empty spotify Widget - for development and demo purpose

This widget is (nearly) empty. It can be used to understand the logic behind YaWK's widget system and/or is a great base to start and create your very own widget! Simply add the properties your application needs, add the database, build your own functions and your widget is ready to run the code as you need it.

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 spotify.php.

Constructor & Destructor Documentation

◆ __construct()

YAWK\WIDGETS\SPOTIFY\EMBED\spotify::__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 37 of file spotify.php.

39  {
40  // load this widget settings from db
41  $this->widget = new \YAWK\widget();
42  $settings = $this->widget->getWidgetSettingsArray($db);
43  foreach ($settings as $property => $value) {
44  $this->$property = $value;
45  }
if(isset($_POST['save'])) $settings
$value

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

Member Function Documentation

◆ init()

YAWK\WIDGETS\SPOTIFY\EMBED\spotify::init ( )

Init spotify widget.

spotify Widget Init

Definition at line 51 of file spotify.php.

53  { // display heading
54  echo $this->getHeading($this->spotifyHeading, $this->spotifySubtext);
55  // switch plain youtube url to correct embed url string
56  $this->spotifyEmbedCode = str_replace("width=\"300\"","width=\"$this->spotifyWidth\"",$this->spotifyEmbedCode);
57  $this->spotifyEmbedCode = str_replace("height=\"380\"","height=\"$this->spotifyHeight\"",$this->spotifyEmbedCode);
getHeading($heading, $subtext)
Get widget heading and subtext, return headline.
Definition: widget.php:669

References YAWK\WIDGETS\SPOTIFY\EMBED\spotify\$spotifyEmbedCode, and YAWK\widget\getHeading().

Member Data Documentation

◆ $spotifyEmbedCode

YAWK\WIDGETS\SPOTIFY\EMBED\spotify::$spotifyEmbedCode =''

Definition at line 26 of file spotify.php.

Referenced by YAWK\WIDGETS\SPOTIFY\EMBED\spotify\init().

◆ $spotifyHeading

YAWK\WIDGETS\SPOTIFY\EMBED\spotify::$spotifyHeading = ''
Parameters
stringTitle that will be shown above widget

Definition at line 22 of file spotify.php.

◆ $spotifyHeight

YAWK\WIDGETS\SPOTIFY\EMBED\spotify::$spotifyHeight =''

Definition at line 30 of file spotify.php.

◆ $spotifySubtext

YAWK\WIDGETS\SPOTIFY\EMBED\spotify::$spotifySubtext = ''
Parameters
stringSubtext will be displayed beside title

Definition at line 24 of file spotify.php.

◆ $spotifyWidth

YAWK\WIDGETS\SPOTIFY\EMBED\spotify::$spotifyWidth =''

Definition at line 28 of file spotify.php.

◆ $widget

YAWK\WIDGETS\SPOTIFY\EMBED\spotify::$widget = ''
Parameters
objectglobal widget object data

Definition at line 20 of file spotify.php.


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