1<?php
2
3/**
4 * Include Component of mediasyntax plugin: displays a wiki page within another
5 *
6 * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
7 * @author     Esther Brunner <wikidesign@gmail.com>
8 * @author     Christopher Smith <chris@jalakai.co.uk>
9 * @author     Gina Häußge, Michael Klier <dokuwiki@chimeric.de>
10 * @author     Thorsten Staerk <dev@staerk.de>
11 */
12class syntax_plugin_mediasyntax_include extends DokuWiki_Syntax_Plugin
13{
14
15    function getType()
16    {
17        return 'substition';
18    }
19    function getSort()
20    {
21        return 303;
22    }
23    function getPType()
24    {
25        return 'block';
26    }
27
28    function connectTo($mode)
29    {
30        $this->Lexer->addSpecialPattern("{{.+?}}", $mode, 'plugin_mediasyntax_include');
31    }
32
33    function handle($match, $state, $pos, Doku_Handler $handler)
34    {
35
36        $match = substr($match, 2, -2); // strip markup
37        list($match, $flags) = explode('&', $match, 2);
38        // break the pattern up into its parts
39        list($page, $sect) = preg_split('/#/u', $match, 2);
40        $mode = "page";
41        return array($mode, $page, cleanID($sect), explode('&', $flags));
42    }
43
44    function render($format, Doku_Renderer $renderer, $data)
45    {
46        return false;
47    }
48}
49// vim:ts=4:sw=4:et:enc=utf-8:
50