1<?php 2 3/** 4 * Originally action_plugin_docsearch_confmanager 5 * 6 * @author Dominik Eckelmann 7 */ 8class action_plugin_elasticsearch_confmanager extends DokuWiki_Action_Plugin { 9 10 public function register(Doku_Event_Handler $controller) { 11 $controller->register_hook('CONFMANAGER_CONFIGFILES_REGISTER', 'BEFORE', $this, 'addConfigFile', array()); 12 } 13 14 public function addConfigFile(Doku_Event $event, $params) { 15 if(class_exists('ConfigManagerTwoLine')) { 16 $config = new ConfigManagerTwoLine( 17 $this->getLang('confmanager title'), 18 $this->getDescription(), 19 DOKU_CONF . 'docparsers.php'); 20 $event->data[] = $config; 21 } 22 } 23 24 private function getDescription() { 25 $fn = $this->localFN('confmanager_description'); 26 if(!@file_exists($fn)) { 27 return ''; 28 } 29 $content = file_get_contents($fn); 30 return $content; 31 } 32 33} 34