@@ -25,49 +25,49 @@ |
||
| 25 | 25 | class action_plugin_openlayersmap extends DokuWiki_Action_Plugin |
| 26 | 26 | { |
| 27 | 27 | |
| 28 | - /** |
|
| 29 | - * plugin should use this method to register its handlers with the DokuWiki's event controller |
|
| 30 | - * |
|
| 31 | - * @param $controller DokuWiki's event controller object. Also available as global $EVENT_HANDLER |
|
| 32 | - */ |
|
| 33 | - public function register(Doku_Event_Handler $controller) |
|
| 34 | - { |
|
| 35 | - $controller->register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'insertButton', array()); |
|
| 36 | - $controller->register_hook('TPL_METAHEADER_OUTPUT', 'BEFORE', $this, 'insertCSSSniffer'); |
|
| 37 | - } |
|
| 28 | + /** |
|
| 29 | + * plugin should use this method to register its handlers with the DokuWiki's event controller |
|
| 30 | + * |
|
| 31 | + * @param $controller DokuWiki's event controller object. Also available as global $EVENT_HANDLER |
|
| 32 | + */ |
|
| 33 | + public function register(Doku_Event_Handler $controller) |
|
| 34 | + { |
|
| 35 | + $controller->register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'insertButton', array()); |
|
| 36 | + $controller->register_hook('TPL_METAHEADER_OUTPUT', 'BEFORE', $this, 'insertCSSSniffer'); |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * Inserts the toolbar button. |
|
| 41 | - * @param Doku_Event $event the DokuWiki event |
|
| 42 | - */ |
|
| 43 | - public function insertButton(Doku_Event $event, $param) |
|
| 44 | - { |
|
| 45 | - $strOpen = '<olmap id="olMapOne" width="550px" height="450px" lat="50.0" '; |
|
| 46 | - $strOpen .= 'lon="5.1" zoom="12" controls="1" '; |
|
| 47 | - $strOpen .= 'baselyr="OpenStreetMap" gpxfile="" kmlfile="" geojsonfile="" summary="" >\n'; |
|
| 48 | - $strOpen .= '~~ Plugin olmap help.\n'; |
|
| 49 | - $strOpen .= '~~ Required in the above tag are values for: id (unique on this page), width, heigth.\n'; |
|
| 50 | - $strOpen .= '~~ Also you will want to enter zoomlevel and lat, lon values that make sense for where you'; |
|
| 51 | - $strOpen .= '~~ want the map to start.\n\n'; |
|
| 52 | - $strOpen .= '~~ Below is an example of a POI, you can add as many as you want. '; |
|
| 53 | - $strOpen .= '~~ More examples: https://dokuwiki.org/plugin:openlayersmap \n'; |
|
| 54 | - $event->data[] = array( |
|
| 55 | - 'type' => 'format', |
|
| 56 | - 'title' => $this->getLang('openlayersmap'), |
|
| 57 | - 'icon' => '../../plugins/openlayersmap/toolbar/map.png', |
|
| 58 | - 'open' => $strOpen, |
|
| 59 | - 'sample' => '50.0117,5.1287,-90,.8,marker-green.png,Pont de Barbouillons; Daverdisse \\\\ external link: |
|
| 39 | + /** |
|
| 40 | + * Inserts the toolbar button. |
|
| 41 | + * @param Doku_Event $event the DokuWiki event |
|
| 42 | + */ |
|
| 43 | + public function insertButton(Doku_Event $event, $param) |
|
| 44 | + { |
|
| 45 | + $strOpen = '<olmap id="olMapOne" width="550px" height="450px" lat="50.0" '; |
|
| 46 | + $strOpen .= 'lon="5.1" zoom="12" controls="1" '; |
|
| 47 | + $strOpen .= 'baselyr="OpenStreetMap" gpxfile="" kmlfile="" geojsonfile="" summary="" >\n'; |
|
| 48 | + $strOpen .= '~~ Plugin olmap help.\n'; |
|
| 49 | + $strOpen .= '~~ Required in the above tag are values for: id (unique on this page), width, heigth.\n'; |
|
| 50 | + $strOpen .= '~~ Also you will want to enter zoomlevel and lat, lon values that make sense for where you'; |
|
| 51 | + $strOpen .= '~~ want the map to start.\n\n'; |
|
| 52 | + $strOpen .= '~~ Below is an example of a POI, you can add as many as you want. '; |
|
| 53 | + $strOpen .= '~~ More examples: https://dokuwiki.org/plugin:openlayersmap \n'; |
|
| 54 | + $event->data[] = array( |
|
| 55 | + 'type' => 'format', |
|
| 56 | + 'title' => $this->getLang('openlayersmap'), |
|
| 57 | + 'icon' => '../../plugins/openlayersmap/toolbar/map.png', |
|
| 58 | + 'open' => $strOpen, |
|
| 59 | + 'sample' => '50.0117,5.1287,-90,.8,marker-green.png,Pont de Barbouillons; Daverdisse \\\\ external link: |
|
| 60 | 60 | [[https://test.com|test.com]] \\\\ internal link: [[::start]]\\\\ **DW Formatting** \n', |
| 61 | - 'close' => '</olmap>\n', |
|
| 62 | - ); |
|
| 63 | - } |
|
| 61 | + 'close' => '</olmap>\n', |
|
| 62 | + ); |
|
| 63 | + } |
|
| 64 | 64 | |
| 65 | - /** add a snippet of javascript into the head to do a css operation we can check for later on.*/ |
|
| 66 | - public function insertCSSSniffer(Doku_Event $event, $param) |
|
| 67 | - { |
|
| 68 | - $event->data["script"][] = array( |
|
| 69 | - "type" => "text/javascript", |
|
| 70 | - "_data" => "document.documentElement.className += ' olCSSsupported';", |
|
| 71 | - ); |
|
| 72 | - } |
|
| 65 | + /** add a snippet of javascript into the head to do a css operation we can check for later on.*/ |
|
| 66 | + public function insertCSSSniffer(Doku_Event $event, $param) |
|
| 67 | + { |
|
| 68 | + $event->data["script"][] = array( |
|
| 69 | + "type" => "text/javascript", |
|
| 70 | + "_data" => "document.documentElement.className += ' olCSSsupported';", |
|
| 71 | + ); |
|
| 72 | + } |
|
| 73 | 73 | } |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | */ |
| 43 | 43 | public function insertButton(Doku_Event $event, $param) |
| 44 | 44 | { |
| 45 | - $strOpen = '<olmap id="olMapOne" width="550px" height="450px" lat="50.0" '; |
|
| 45 | + $strOpen = '<olmap id="olMapOne" width="550px" height="450px" lat="50.0" '; |
|
| 46 | 46 | $strOpen .= 'lon="5.1" zoom="12" controls="1" '; |
| 47 | 47 | $strOpen .= 'baselyr="OpenStreetMap" gpxfile="" kmlfile="" geojsonfile="" summary="" >\n'; |
| 48 | 48 | $strOpen .= '~~ Plugin olmap help.\n'; |