Add metadata, settings class and language strings for $conf['renderer_xhtml']

darcs-hash:20080313204505-f07c6-ad0d4b9f155117f6be01925a8bfece1e35efa39f.gz
This commit is contained in:
Chris Smith 2008-03-13 21:45:05 +01:00
parent 93a34bf33e
commit 0ceb549d0a
3 changed files with 44 additions and 0 deletions

View File

@ -127,6 +127,9 @@ $lang['sitemap'] = 'Generate Google sitemap (days)';
$lang['broken_iua'] = 'Is the ignore_user_abort function broken on your system? This could cause a non working search index. IIS+PHP/CGI is known to be broken. See <a href="http://bugs.splitbrain.org/?do=details&amp;task_id=852">Bug 852</a> for more info.';
$lang['xsendfile'] = 'Use the X-Sendfile header to let the webserver deliver static files? Your webserver needs to support this.';
$lang['xmlrpc'] = 'Enable/disable XML-RPC interface.';
$lang['renderer_xhtml'] = 'Renderer to use for main (xhtml) wiki output';
$lang['renderer__core'] = '%s (dokuwiki core)';
$lang['renderer__plugin'] = '%s (plugin)';
$lang['rss_type'] = 'XML feed type';
$lang['rss_linkto'] = 'XML feed links to';

View File

@ -173,6 +173,7 @@ $meta['rss_show_summary'] = array('onoff');
$meta['broken_iua'] = array('onoff');
$meta['xsendfile'] = array('multichoice','_choices' => array(0,1,2));
$meta['xmlrpc'] = array('onoff');
$meta['renderer_xhtml'] = array('renderer','_format' => 'xhtml','_choices' => array('xhtml'));
$meta['_network'] = array('fieldset');
$meta['proxy____host'] = array('string','_pattern' => '#^(|[a-z0-9\-\.+]+)$#i');

View File

@ -114,3 +114,43 @@ if (!class_exists('setting_compression')) {
}
}
}
if (!class_exists('setting_renderer')) {
class setting_renderer extends setting_multichoice {
var $_prompts = array();
function initialize($default,$local,$protected) {
$format = $this->_format;
foreach (plugin_list('renderer') as $plugin) {
$renderer =& plugin_load('renderer',$plugin);
if (method_exists($renderer,'canRender') && $renderer->canRender($format)) {
$this->_choices[] = $plugin;
$info = $renderer->getInfo();
$this->_prompts[$plugin] = $info['name'];
}
}
parent::initialize($default,$local,$protected);
}
function html(&$plugin, $echo=false) {
// make some language adjustments (there must be a better way)
// transfer some plugin names to the config plugin
if (!$plugin->localised) $this->setupLocale();
foreach ($this->_choices as $choice) {
if (!isset($plugin->lang[$this->_key.'_o_'.$choice])) {
if (!isset($this->_prompts[$choice])) {
$plugin->lang[$this->_key.'_o_'.$choice] = sprintf($plugin->lang['renderer__core'],$choice);
} else {
$plugin->lang[$this->_key.'_o_'.$choice] = sprintf($plugin->lang['renderer__plugin'],$this->_prompts[$choice]);
}
}
}
return parent::html($plugin, $echo);
}
}
}