1<?php 2/** 3 * DokuWiki Plugin nosecedit (Action Component) 4 * 5 * 6 * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) 7 * @author lisps 8 */ 9 10if(!defined('DOKU_INC')) die(); 11if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); 12require_once DOKU_PLUGIN.'action.php'; 13//require_once DOKU_PLUGIN.'edittable/common.php'; 14 15class action_plugin_nosecedit extends DokuWiki_Action_Plugin 16 { 17 var $helper = FALSE; 18 19 /** 20 * set a databuffer :-) 21 */ 22 function action_plugin_nosecedit() 23 { 24 } 25 26 /** 27 * Register its handlers with the DokuWiki's event controller 28 */ 29 function register(&$controller) 30 { 31 $controller->register_hook('HTML_SECEDIT_BUTTON', 'BEFORE', $this, 'html_secedit_button'); 32 } 33 34 function html_secedit_button(&$event) 35 { 36 global $ID; 37 38 //Section event? 39 if ($event->data['target'] !== 'section') 40 { 41 return; 42 } 43 44 //disable requested? 45 if (p_get_metadata($ID,"sectionedit",FALSE) == "off") 46 { 47 $event->data['name'] = ""; 48 } 49 } 50 } 51