1<?php
2/**
3 * Jenkins Action Plugin: Inserts a button into the toolbar
4 *
5 * @author Algorys
6 */
7
8if (!defined('DOKU_INC')) die();
9
10class action_plugin_jenkins extends DokuWiki_Action_Plugin {
11
12    function register(Doku_Event_Handler $controller) {
13        $controller->register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'insert_button', array ());
14    }
15
16    /**
17   * Inserts a toolbar button
18   */
19    function insert_button(&$event, $param) {
20        $event->data[] = array (
21            'type' => 'format',
22            'title' => $this->getLang('button'),
23            'icon' => '../../plugins/jenkins/images/button.png',
24            'open' => '<jenkins job="JOB_NAME"',
25            'close' => ' />',
26        );
27  }
28
29}
30