summaryrefslogtreecommitdiff
path: root/lib/plugins/config/admin.php
diff options
context:
space:
mode:
authorBen Coburn <btcoburn@silicodon.net>2007-02-15 02:53:18 +0100
committerBen Coburn <btcoburn@silicodon.net>2007-02-15 02:53:18 +0100
commite1b31a95036c9d14ff4b1baa752f46a228dd56e2 (patch)
treecc1b0cefa9e6939c97db64f6661253d9b219d64f /lib/plugins/config/admin.php
parent265f02e38151badf5d9f910799ff9df58f2f50d3 (diff)
downloadrpg-e1b31a95036c9d14ff4b1baa752f46a228dd56e2.tar.gz
rpg-e1b31a95036c9d14ff4b1baa752f46a228dd56e2.tar.bz2
config plugin TOC refactoring
Now uses the new toc_additem function in the Doku_Renderer_xhtml class. darcs-hash:20070215015318-05dcb-f725b589b6ecf9b332f624f4bb9cafe7ed546172.gz
Diffstat (limited to 'lib/plugins/config/admin.php')
-rw-r--r--lib/plugins/config/admin.php52
1 files changed, 13 insertions, 39 deletions
diff --git a/lib/plugins/config/admin.php b/lib/plugins/config/admin.php
index b4c7681cf..4cf3ea9b1 100644
--- a/lib/plugins/config/admin.php
+++ b/lib/plugins/config/admin.php
@@ -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();
}