YaWK  24.1
Yet another WebKit
YAWK\WIDGETS\GOOGLE\MAPS\googleMaps Class Reference

Embed Google Maps on your page. More...

+ Inheritance diagram for YAWK\WIDGETS\GOOGLE\MAPS\googleMaps:

Public Member Functions

 __construct ($db)
 Load all widget settings from database and fill object. More...
 
 embed ()
 
 init ()
 Init and embed Google Maps. More...
 
 printObject ()
 Print all object data. 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...
 

Public Attributes

 $googleMapsEmbedHtmlCode = ''
 
 $googleMapsHeading = ''
 
 $googleMapsSubtext = ''
 
 $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

Embed Google Maps on your page.

Google Maps Widget - Embed a Google Map on your page

This Widget serves all methods to draw any Google Map on your website. To do this: go to Google Maps, click on embed and you will get a piece of html code. Simply copy/paste the code into the textarea, click save and your google map will be displayed in your chosen widget position.

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

Constructor & Destructor Documentation

◆ __construct()

YAWK\WIDGETS\GOOGLE\MAPS\googleMaps::__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 33 of file googleMaps.php.

34  {
35  // load this widget settings from db
36  $this->widget = new \YAWK\widget();
37  $settings = $this->widget->getWidgetSettingsArray($db);
38  foreach ($settings as $property => $value) {
39  $this->$property = $value;
40  }
41  }
if(isset($_POST['save'])) $settings
$value

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

Member Function Documentation

◆ embed()

YAWK\WIDGETS\GOOGLE\MAPS\googleMaps::embed ( )

Definition at line 63 of file googleMaps.php.

64  {
65  // draw heading above google map
66  echo $this->getHeading($this->googleMapsHeading, $this->googleMapsSubtext);
67 
68  // check if embed html code is set and correct data type
69  if (isset($this->googleMapsEmbedHtmlCode)
70  && (!empty($this->googleMapsEmbedHtmlCode))
71  && (is_string($this->googleMapsEmbedHtmlCode)))
72  {
73  // embed code seems to be valid -
74  // draw Google Map...
76  }
77  else
78  {
79  echo "Here should be a Google Map, but the required embed code was not set.";
80  }
81  }
getHeading($heading, $subtext)
Get widget heading and subtext, return headline.
Definition: widget.php:669

References YAWK\WIDGETS\GOOGLE\MAPS\googleMaps\$googleMapsEmbedHtmlCode, and YAWK\widget\getHeading().

Referenced by YAWK\WIDGETS\GOOGLE\MAPS\googleMaps\init().

◆ init()

YAWK\WIDGETS\GOOGLE\MAPS\googleMaps::init ( )

Init and embed Google Maps.

Embed Google Maps

Definition at line 58 of file googleMaps.php.

59  { // embed Google Maps
60  $this->embed();
61  }

References YAWK\WIDGETS\GOOGLE\MAPS\googleMaps\embed().

◆ printObject()

YAWK\WIDGETS\GOOGLE\MAPS\googleMaps::printObject ( )

Print all object data.

(for development and testing purpose)

Reimplemented from YAWK\widget.

Definition at line 47 of file googleMaps.php.

48  { // output data to screen
49  echo "<pre>";
50  print_r($this);
51  echo "</pre>";
52  }

Member Data Documentation

◆ $googleMapsEmbedHtmlCode

YAWK\WIDGETS\GOOGLE\MAPS\googleMaps::$googleMapsEmbedHtmlCode = ''
Parameters
stringthe html code you'll get from google <iframe...>

Definition at line 22 of file googleMaps.php.

Referenced by YAWK\WIDGETS\GOOGLE\MAPS\googleMaps\embed().

◆ $googleMapsHeading

YAWK\WIDGETS\GOOGLE\MAPS\googleMaps::$googleMapsHeading = ''
Parameters
stringHeading above Google Map

Definition at line 24 of file googleMaps.php.

◆ $googleMapsSubtext

YAWK\WIDGETS\GOOGLE\MAPS\googleMaps::$googleMapsSubtext = ''
Parameters
stringSubtext beside heading

Definition at line 26 of file googleMaps.php.

◆ $widget

YAWK\WIDGETS\GOOGLE\MAPS\googleMaps::$widget = ''
Parameters
objectglobal widget object data

Definition at line 20 of file googleMaps.php.


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