xref: /dokuwiki/inc/Action/Plugin.php (revision 8c7c53b0321a3cd3116b8d3b2ad27863a38dece7)
1a3f6fae6SAndreas Gohr<?php
2a3f6fae6SAndreas Gohr
3a3f6fae6SAndreas Gohrnamespace dokuwiki\Action;
4a3f6fae6SAndreas Gohr
579a2d784SGerrit Uitslaguse dokuwiki\Extension\Event;
679a2d784SGerrit 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 */
14*8c7c53b0SAndreas Gohrclass Plugin extends AbstractAction
15*8c7c53b0SAndreas Gohr{
16a3f6fae6SAndreas Gohr
17a3f6fae6SAndreas Gohr    /** @inheritdoc */
18ec701221SAndreas Gohr    public function minimumPermission() {
19a3f6fae6SAndreas Gohr        return AUTH_NONE;
20a3f6fae6SAndreas Gohr    }
21a3f6fae6SAndreas Gohr
22a3f6fae6SAndreas Gohr    /**
23a3f6fae6SAndreas Gohr     * Outputs nothing but a warning unless an action plugin overwrites it
24a3f6fae6SAndreas Gohr     *
25a3f6fae6SAndreas Gohr     * @inheritdoc
26a3f6fae6SAndreas Gohr     * @triggers TPL_ACT_UNKNOWN
27a3f6fae6SAndreas Gohr     */
28a3f6fae6SAndreas Gohr    public function tplContent() {
2979a2d784SGerrit Uitslag        $evt = new Event('TPL_ACT_UNKNOWN', $this->actionname);
30a3f6fae6SAndreas Gohr        if($evt->advise_before()) {
31a3f6fae6SAndreas Gohr            msg('Failed to handle action: ' . hsc($this->actionname), -1);
32a3f6fae6SAndreas Gohr        }
33a3f6fae6SAndreas Gohr        $evt->advise_after();
34a3f6fae6SAndreas Gohr    }
35a3f6fae6SAndreas Gohr}
36