-
Notifications
You must be signed in to change notification settings - Fork 21
/
plugin_googlemaps.css.php
88 lines (68 loc) · 2.42 KB
/
plugin_googlemaps.css.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
/*------------------------------------------------------------------------
# plugin_googlemaps.css.php - Google Maps plugin
# ------------------------------------------------------------------------
# author Mike Reumer
# copyright Copyright (C) 2012 tech.reumer.net. All Rights Reserved.
# @license - http://www.gnu.org/copyleft/gpl.html GNU/GPL
# Websites: http://tech.reumer.net
# Technical Support: http://tech.reumer.net/Contact-Us/Mike-Reumer.html
# Documentation: http://tech.reumer.net/Google-Maps/Documentation-of-plugin-Googlemap/
--------------------------------------------------------------------------*/
/* Googlemaps CSS
To solve known css problems that break the design of a map
*/
@define('_JEXEC', 1);
if (!defined('DS'))
@define( 'DS', DIRECTORY_SEPARATOR );
@ob_start();
// Fix magic quotes.
@ini_set('magic_quotes_runtime', 0);
// Maximise error reporting.
//@ini_set('zend.ze1_compatibility_mode', '0');
//error_reporting(E_ALL);
//@ini_set('display_errors', 1);
/*
* Ensure that required path constants are defined.
*/
if (!defined('JPATH_BASE'))
{
$path = dirname(__FILE__);
$path = str_replace('/media/plugin_googlemap3/site/googlemaps', '', $path);
$path = str_replace('\media\plugin_googlemap3\site\googlemaps', '', $path);
define('JPATH_BASE', $path);
}
require_once ( JPATH_BASE.'/includes/defines.php' );
require_once ( JPATH_BASE.'/includes/framework.php' );
/* To use Joomla's Database Class */
require_once ( JPATH_BASE.'/libraries/joomla/factory.php' );
$mainframe = JFactory::getApplication('site');
$mainframe->initialise();
$user = JFactory::getUser();
$session = JFactory::getSession();
class plugin_googlemap3_css {
function doExecute(){
// Get config
$plugin = JPluginHelper::getPlugin('system', 'plugin_googlemap3');
$jversion = JVERSION;
// In Joomla 1.5 get the parameters in Joomla 1.6 and higher the plugin already has them, but need to be rendered with JRegistry
if (substr($jversion,0,3)=="1.5")
$params = new JParameter($plugin->params);
else {
$params = new JRegistry();
$params->loadString($plugin->params);
}
// Plugin code
$mapcss = $params->get('mapcss', '');
// Clean already send output
//while (@ob_end_clean());
// Set correct header
header('Content-type: text/css; charset=utf-8');
echo $mapcss;
}
}
// Instantiate the application.
$web = new plugin_googlemap3_css;
// Run the application
$web->doExecute();
?>