1<?php
2/**
3 * DokuWiki Plugin aichatlocal (Action Component)
4 *
5 * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
6 * @author  Your Name <your@email.com>
7 */
8
9// must be run within Dokuwiki
10if (!defined('DOKU_INC')) {
11    die();
12}
13
14class action_plugin_aichatlocal extends \DokuWiki\Extension\ActionPlugin
15{
16    /** @inheritDoc */
17    public function register(Doku_Event_Handler $controller)
18    {
19        $controller->register_hook('PLUGIN_AICHAT_MODEL_REGISTER', 'BEFORE', $this, 'handleModelRegister');
20    }
21
22    /**
23     * Register our local model provider
24     *
25     * @param Doku_Event $event
26     * @return void
27     */
28    public function handleModelRegister(Doku_Event $event)
29    {
30        $modelDir = __DIR__ . '/Model';
31        if (is_dir($modelDir)) {
32            $event->data[] = $modelDir;
33        }
34    }
35}
36