PHP Classes

File: engine/modules/core/map/map.qtags.inc

Recommend this page to a friend!
  Classes of Aldo Tripiciano  >  Quanta CMS  >  engine/modules/core/map/map.qtags.inc  >  Download  
File: engine/modules/core/map/map.qtags.inc
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Quanta CMS
Manage content that works without a database
Author: By
Last change:
Date: 3 years ago
Size: 648 bytes
 

Contents

Class file image Download
<?php
/**
 * Implement MAP qtag.
 *
 * Renders a google map.
 *
 * @param Environment $env
 *   The Environment.
 *
 * @param string $target
 *   The qtag's target.
 *
 * @param array $attributes
 *   The qtag's attributes.
 *
 * @return string
 *   The rendered qtag.
 */
function qtag_MAP($env, $target, $attributes) {
  // TODO: remove Aldo's key and setup an attribute :-)
 
	if (!isset($attributes['key'])) {
		return 'invalid key.';
	}
  return '<iframe width="100%" height="100%" frameborder="0" style="border:0" src="https://www.google.com/maps/embed/v1/place?key=' . $attributes['key'] . '&q=' . $target . '" allowfullscreen></iframe>';
}
For more information send a message to info at phpclasses dot org.