1<?php
2
3/**
4 * DokuWiki Plugin doi (Syntax Component)
5 *
6 * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
7 * @author  Andreas Gohr <gohr@cosmocode.de>
8 */
9class syntax_plugin_doi_isbn extends syntax_plugin_doi_doi
10{
11
12    /** @inheritDoc */
13    public function connectTo($mode)
14    {
15        $this->Lexer->addSpecialPattern('\[\[isbn>[^\]]+\]\]', $mode, 'plugin_doi_isbn');
16    }
17
18    /** @inheritDoc */
19    public function handle($match, $state, $pos, Doku_Handler $handler)
20    {
21        $isbn = substr($match, 7, -2);
22        return [
23            'id' => $isbn,
24        ];
25    }
26
27    /** @inheritDoc */
28    protected function getResolver()
29    {
30        $class = '\\dokuwiki\\plugin\\doi\\Resolver\\Isbn'.$this->getConf('isbnresolver').'Resolver';
31        return new $class();
32    }
33
34
35}
36
37