Skip to content
Snippets Groups Projects
Commit e1b31a95 authored by Ben Coburn's avatar Ben Coburn
Browse files

config plugin TOC refactoring

Now uses the new toc_additem function in the Doku_Renderer_xhtml class.

darcs-hash:20070215015318-05dcb-f725b589b6ecf9b332f624f4bb9cafe7ed546172.gz
parent 265f02e3
No related branches found
No related tags found
No related merge requests found
......@@ -299,7 +299,6 @@ class admin_plugin_config extends DokuWiki_Admin_Plugin {
/**
* Generates a two-level table of contents for the config plugin.
* Uses inc/parser/xhtml.php#render_TOC to format the output.
* Relies on internal data structures in the Doku_Renderer_xhtml class.
*
* @author Ben Coburn <btcoburn@silicodon.net>
*/
......@@ -323,59 +322,34 @@ class admin_plugin_config extends DokuWiki_Admin_Plugin {
}
}
// build toc list
$xhtml_toc = array();
$xhtml_toc[] = array('hid' => 'configuration_manager',
'title' => $this->getLang('_configuration_manager'),
'type' => 'ul',
'level' => 1);
$xhtml_toc[] = array('hid' => 'dokuwiki_settings',
'title' => $this->getLang('_header_dokuwiki'),
'type' => 'ul',
'level' => 1);
// use the xhtml renderer to make the toc
require_once(DOKU_INC.'inc/parser/xhtml.php');
$r = new Doku_Renderer_xhtml;
// build toc
$r->toc_additem('configuration_manager', $this->getLang('_configuration_manager'), 1);
$r->toc_additem('dokuwiki_settings', $this->getLang('_header_dokuwiki'), 1);
foreach($toc['conf'] as $setting) {
$name = $setting->prompt($this);
$xhtml_toc[] = array('hid' => $setting->_key,
'title' => $name,
'type' => 'ul',
'level' => 2);
$r->toc_additem($setting->_key, $name, 2);
}
if (!empty($toc['plugin'])) {
$xhtml_toc[] = array('hid' => 'plugin_settings',
'title' => $this->getLang('_header_plugin'),
'type' => 'ul',
'level' => 1);
$r->toc_additem('plugin_settings', $this->getLang('_header_plugin'), 1);
}
foreach($toc['plugin'] as $setting) {
$name = $setting->prompt($this);
$xhtml_toc[] = array('hid' => $setting->_key,
'title' => $name,
'type' => 'ul',
'level' => 2);
$r->toc_additem($setting->_key, $name, 2);
}
if (isset($toc['template'])) {
$xhtml_toc[] = array('hid' => 'template_settings',
'title' => $this->getLang('_header_template'),
'type' => 'ul',
'level' => 1);
$r->toc_additem('template_settings', $this->getLang('_header_template'), 1);
$setting = $toc['template'];
$name = $setting->prompt($this);
$xhtml_toc[] = array('hid' => $setting->_key,
'title' => $name,
'type' => 'ul',
'level' => 2);
$r->toc_additem($setting->_key, $name, 2);
}
if ($has_undefined && $allow_debug) {
$xhtml_toc[] = array('hid' => 'undefined_settings',
'title' => $this->getLang('_header_undefined'),
'type' => 'ul',
'level' => 1);
$r->toc_additem('undefined_settings', $this->getLang('_header_undefined'), 1);
}
// use the xhtml renderer to make the toc
require_once(DOKU_INC.'inc/parser/xhtml.php');
$r = new Doku_Renderer_xhtml;
$r->toc = $xhtml_toc;
print $r->render_TOC();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment