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 ['id' => $isbn];
23    }
24
25    /** @inheritDoc */
26    protected function getResolver()
27    {
28        $class = '\\dokuwiki\\plugin\\doi\\Resolver\\Isbn'.$this->getConf('isbnresolver').'Resolver';
29        return new $class();
30    }
31
32
33}
34
35