1<?php
2/**
3 * DokuWiki Plugin structgeohash (Action Component)
4 *
5 * @author: Andrés Seré <andres@sere.uy>
6 */
7
8# I don't known whats this:
9#use dokuwiki\plugin\structgeohash\meta\ApplicationAspectKernel;
10
11// must be run within Dokuwiki
12if (!defined('DOKU_INC')) die();
13
14class action_plugin_structgeohash extends DokuWiki_Action_Plugin {
15    /**
16     * Registers a callback function for a given event
17     *
18     * @param Doku_Event_Handler $controller DokuWiki's event controller object
19     * @return void
20     */
21  public function register(Doku_Event_Handler $controller) {
22    $controller->register_hook('PLUGIN_STRUCT_TYPECLASS_INIT', 'BEFORE', $this, 'handle_init');
23		//$controller->register_hook('TPL_METAHEADER_OUTPUT', 'BEFORE', $this, '_hookjs');
24  }
25
26
27	/**
28	* Hook geohash js library into page headers.
29	*
30	*/
31	public function _hookjs(Doku_Event $event, $param) {
32		$event->data['script'][] = array(
33			'type'    => 'text/javascript',
34			'charset' => 'utf-8',
35			'_data'   => '',
36			'src'     => DOKU_PLUGIN.'structgeohash/geohash.js');
37  }
38
39
40  public function handle_init(Doku_Event &$event, $param) {
41    $event->data['GeoHash'] = 'dokuwiki\\plugin\\structgeohash\\types\\GeoHash';
42  }
43}
44// vim:ts=4:sw=4:et:
45