2020-02-04 17:05:27 +01:00
|
|
|
<?php
|
|
|
|
if (IN_serendipity !== true) {
|
|
|
|
die ("Don't hack!");
|
|
|
|
}
|
|
|
|
|
|
|
|
@serendipity_plugin_api::load_language(dirname(__FILE__));
|
|
|
|
|
|
|
|
class serendipity_event_static_osm extends serendipity_event
|
|
|
|
{
|
|
|
|
function introspect(&$propbag)
|
|
|
|
{
|
|
|
|
$propbag->add('name', PLUGIN_EVENT_STATIC_OSM_NAME);
|
|
|
|
$propbag->add('description', PLUGIN_EVENT_STATIC_OSM_DESCRIPTION);
|
|
|
|
$propbag->add('copyright', 'GPL');
|
|
|
|
$propbag->add('event_hooks', array('frontend_header' => true));
|
|
|
|
$propbag->add('author', 'Martin Sewelies');
|
|
|
|
$propbag->add('version', '0.1');
|
|
|
|
$propbag->add('requirements', array(
|
|
|
|
'serendipity' => '2.3'
|
|
|
|
));
|
2020-02-04 18:10:43 +01:00
|
|
|
$propbag->add('stackable', false);
|
2020-02-04 17:05:27 +01:00
|
|
|
$propbag->add('groups', array('FRONTEND_ENTRY_RELATED'));
|
|
|
|
}
|
|
|
|
|
|
|
|
function generate_content(&$title)
|
|
|
|
{
|
|
|
|
$title = PLUGIN_EVENT_STATIC_OSM_NAME;
|
|
|
|
}
|
|
|
|
|
|
|
|
function event_hook($event, &$bag, &$eventData, $addData = null)
|
|
|
|
{
|
|
|
|
global $serendipity;
|
|
|
|
if ($event == 'frontend_header') {
|
2020-02-04 18:10:43 +01:00
|
|
|
echo ' <link rel="stylesheet" href="'.$this->getFile('ol.css', 'serendipityHTTPPath').'" type="text/css" />'.PHP_EOL;
|
|
|
|
echo ' <link rel="stylesheet" href="'.$this->getFile('osm.css', 'serendipityHTTPPath').'" type="text/css" />'.PHP_EOL;
|
2020-02-04 17:05:27 +01:00
|
|
|
echo ' <script src="'.$this->getFile('ol.js', 'serendipityHTTPPath').'"></script>'.PHP_EOL;
|
|
|
|
echo ' <script src="'.$this->getFile('osm.js', 'serendipityHTTPPath').'"></script>'.PHP_EOL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function introspect_config_item($name, &$propbag)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|