* @author Jos Roossien * @copyright (C) 2015-2020, Giuseppe Di Terlizzi */ class syntax_plugin_bootswrapper_modal extends syntax_plugin_bootswrapper_bootstrap { public $p_type = 'normal'; public $pattern_start = '(?=.*?)'; public $pattern_end = ''; public $tag_name = 'modal'; public $tag_attributes = array( 'id' => array( 'type' => 'string', 'values' => null, 'required' => true, 'default' => null), 'size' => array( 'type' => 'string', 'values' => array('lg', 'sm'), 'required' => false, 'default' => null), 'title' => array( 'type' => 'string', 'values' => null, 'required' => false, 'default' => null), 'keyboard' => array( 'type' => 'boolean', 'values' => array(0, 1), 'required' => false, 'default' => null), 'dismiss' => array( 'type' => 'boolean', 'values' => array(0, 1), 'required' => false, 'default' => true), 'show' => array( 'type' => 'boolean', 'values' => array(0, 1), 'required' => false, 'default' => false), 'fade' => array( 'type' => 'boolean', 'values' => array(0, 1), 'required' => false, 'default' => true), 'backdrop' => array( 'type' => 'string', 'values' => array('true', 'false', 'static'), 'required' => false, 'default' => null), 'remote' => array( 'type' => 'string', 'values' => null, 'required' => false, 'default' => null), ); public function render($mode, Doku_Renderer $renderer, $data) { if (empty($data)) { return false; } if ($mode !== 'xhtml') { return false; } /** @var Doku_Renderer_xhtml $renderer */ list($state, $match, $pos, $attributes) = $data; if ($state == DOKU_LEXER_ENTER) { $id = $attributes['id']; $size = $attributes['size']; $title = $attributes['title']; $keyboard = $attributes['keyboard']; $dismiss = $attributes['dismiss']; $show = $attributes['show']; $fade = $attributes['fade'] === true ? 'fade' : ''; $backdrop = $attributes['backdrop']; $remote = $attributes['remote']; $html5_attributes = array(); if ($remote) { $html5_attributes['data-remote'] = wl($remote, array('do' => 'export_xhtmlbody'), true); } if ($title) { $html5_attributes['data-labelledby'] = $title; } if ($show) { $html5_attributes['data-show'] = $show; } if ($backdrop) { $html5_attributes['data-backdrop'] = $backdrop; } if ($keyboard) { $html5_attributes['data-keyboard'] = $keyboard; } //Modal $markup = ''; return true; } return true; } }