1<?php
2/**
3 * dwinsect Plugin: Inserts a button with dwinsect-syntax into the toolbar
4 *
5 * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
6 * @author     Dietrich Wittenberg <info.wittenberg@online.de>
7 */
8// must be run within Dokuwiki
9if(!defined('DOKU_INC')) die();
10if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
11require_once(DOKU_PLUGIN.'action.php');
12
13/**
14 * All DokuWiki plugins to extend the admin function
15 * need to inherit from this class
16*/
17class action_plugin_dwinsect extends DokuWiki_Action_Plugin {
18
19/* not longer needed for DokuWiki 2009-12-25 “Lemming” and later
20	function getInfo(){
21    return array(
22      'author' => 'Dietrich Wittenberg',
23      'email'  => 'info.wittenberg@online.de',
24      'date'   => '2012-07-01',
25      'name'   => 'plugin dwinsect',
26      'desc'   => 'Includes a button with syntax of dwinsect',
27      'url'    => 'http://dokuwiki.org/plugin:dwinsect',
28    );
29  }
30 */
31
32  /*
33   * Register the eventhandlers
34   * @see DokuWiki_Action_Plugin::register()
35   */
36  function register(&$controller) {
37  	$controller->register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'insert_button', array());
38  }
39
40  /**
41   * Insert the toolbar button
42   * @param unknown_type $event
43   * @param unknown_type $param
44   */
45  function insert_button(& $event, $param) {
46  	$event->data[] = array(
47  			'type'	=>	'insert',
48  			'title'	=>	'Seitenabschnitt oder enthaltenen Link hinzufügen',
49  			'icon'	=>	'../../plugins/dwinsect/images/dwinsect.png',
50  			'insert'=>	'[*(ns:page#anchor?aparams|lparams)]',
51  			);
52  }
53
54}
55?>