1<?php
2/**
3 * GitlabProject Action Plugin: Inserts a button into the toolbar
4 *
5 * @author Algorys
6 */
7
8if (!defined('DOKU_INC')) die();
9
10class action_plugin_gitlabproject 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/gitlabproject/images/gitlab.png',
24            'open' => '<gitlab project="<NAMESPACE>/<PROJECT_NAME>"',
25            'close' => ' />',
26        );
27  }
28
29}
30