1<?php
2/**
3 * DokuWiki Plugin pglist (Action Component)
4 *
5 * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
6 * @author     Zaher Dirkey <zaherdirkey@yahoo.com>
7 */
8
9// must be run within Dokuwiki
10if (!defined('DOKU_INC')) die();
11if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
12
13require_once(DOKU_PLUGIN.'action.php');
14
15class action_plugin_pglist extends DokuWiki_Action_Plugin {
16
17    function getInfo(){
18        return array(
19            'author' => 'Zaher Dirkey',
20            'email'  => 'zaherdirkey@yahoo.com',
21            'date'   => '2020-11-15',
22            'name'   => 'Page List Plugin',
23            'desc'   => 'List pages of namespace, based on nslist.',
24            'url'    => 'http://dokuwiki.org/plugin:pglist',
25        );
26    }
27
28    function register(Doku_Event_Handler $controller) {
29        $controller->register_hook("TOOLBAR_DEFINE", "AFTER", $this, "insert_button", array ());
30    }
31
32    /**
33    * Inserts a toolbar button
34    */
35    public function insert_button(&$event, $param) {
36        $event->data[] = array (
37            'type' => 'insert',
38            'title' => 'PGList Plugin',
39            'icon' => '../../plugins/pglist/images/pglist.png',
40            'insert' => '{{pglist>selected_namespace files dirs me nostart fsort dsort}}'
41        );
42    }
43}
44