1<?php 2/** 3 * Box Plugin 4 * 5 * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) 6 * @author i-net software <tools@inetsoftware.de> 7 * @author Gerry Weissbach <gweissbach@inetsoftware.de> 8 */ 9 10// must be run within Dokuwiki 11if(!defined('DOKU_INC')) die(); 12 13if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); 14require_once(DOKU_PLUGIN.'action.php'); 15 16class action_plugin_box2 extends DokuWiki_Action_Plugin { 17 18 function register(Doku_Event_Handler $controller) { 19 $controller->register_hook('ACTION_SHOW_REDIRECT', 'BEFORE', $this, 'act_box_redirect_execute'); 20 } 21 22 function act_box_redirect_execute( Doku_Event &$event ) { 23 global $PRE; 24 global $TEXT; 25 26 if ( !empty($event->data['fragment']) ) { return; } 27 if ( $event->data['preact'] == 'save' ) { return; } 28 29 if($PRE && preg_match('/^\s*<box.*?\|([^>\n]+)/',$TEXT,$match)){ 30 $check = false; //Byref 31 $event->data['fragment'] = sectionID($match[1], $check); 32 } 33 } 34} 35