xref: /dokuwiki/inc/Action/Plugin.php (revision 79a2d7845d5e5e48fe3be8f192717de9294aaba5)
1a3f6fae6SAndreas Gohr<?php
2a3f6fae6SAndreas Gohr
3a3f6fae6SAndreas Gohrnamespace dokuwiki\Action;
4a3f6fae6SAndreas Gohr
5*79a2d784SGerrit Uitslaguse dokuwiki\Extension\Event;
6*79a2d784SGerrit Uitslag
7a3f6fae6SAndreas Gohr/**
8a3f6fae6SAndreas Gohr * Class Plugin
9a3f6fae6SAndreas Gohr *
10a3f6fae6SAndreas Gohr * Used to run action plugins
11a3f6fae6SAndreas Gohr *
12a3f6fae6SAndreas Gohr * @package dokuwiki\Action
13a3f6fae6SAndreas Gohr */
14a3f6fae6SAndreas Gohrclass Plugin extends AbstractAction {
15a3f6fae6SAndreas Gohr
16a3f6fae6SAndreas Gohr    /** @inheritdoc */
17ec701221SAndreas Gohr    public function minimumPermission() {
18a3f6fae6SAndreas Gohr        return AUTH_NONE;
19a3f6fae6SAndreas Gohr    }
20a3f6fae6SAndreas Gohr
21a3f6fae6SAndreas Gohr    /**
22a3f6fae6SAndreas Gohr     * Outputs nothing but a warning unless an action plugin overwrites it
23a3f6fae6SAndreas Gohr     *
24a3f6fae6SAndreas Gohr     * @inheritdoc
25a3f6fae6SAndreas Gohr     * @triggers TPL_ACT_UNKNOWN
26a3f6fae6SAndreas Gohr     */
27a3f6fae6SAndreas Gohr    public function tplContent() {
28*79a2d784SGerrit Uitslag        $evt = new Event('TPL_ACT_UNKNOWN', $this->actionname);
29a3f6fae6SAndreas Gohr        if($evt->advise_before()) {
30a3f6fae6SAndreas Gohr            msg('Failed to handle action: ' . hsc($this->actionname), -1);
31a3f6fae6SAndreas Gohr        }
32a3f6fae6SAndreas Gohr        $evt->advise_after();
33a3f6fae6SAndreas Gohr    }
34a3f6fae6SAndreas Gohr}
35