1<?php
2/**
3 * DokuWiki Plugin widearea (Action Component)
4 *
5 *  @license      GPL 2 (http://www.gnu.org/licenses/gpl.html)
6 *  @author       Matthias Schulte <dokuwiki@lupo49.de>
7 *  @version      2013-07-10
8 */
9
10// must be run within Dokuwiki
11if(!defined('DOKU_INC')) die();
12
13class action_plugin_widearea extends DokuWiki_Action_Plugin {
14
15    function register(Doku_Event_Handler $controller) {
16        $controller->register_hook('TPL_METAHEADER_OUTPUT', 'BEFORE', $this, 'handle_tpl_metaheader', array());
17    }
18
19    function handle_tpl_metaheader(&$event, $param) {
20        if(empty($event->data) || empty($event->data['meta'])) return;
21        $key = count($event->data['link']);
22
23        $css = array(
24            "rel"  => "stylesheet",
25            "type" => "text/css",
26            "href" => DOKU_BASE."lib/plugins/widearea/widearea/widearea.css"
27        );
28
29        $event->data['link'][$key] = $css;
30    }
31}