summaryrefslogtreecommitdiff
path: root/lib/plugins/config/settings/extra.class.php
diff options
context:
space:
mode:
authorChris Smith <chris.eureka@jalakai.co.uk>2008-03-13 21:45:05 +0100
committerChris Smith <chris.eureka@jalakai.co.uk>2008-03-13 21:45:05 +0100
commit0ceb549d0a022569a0e99a34e362f15d4703fb9d (patch)
treedac8b0f46b95b715278ff8325eb9ccc213b1068f /lib/plugins/config/settings/extra.class.php
parent93a34bf33e9f8f0649d38e94d18cbba2a11fd651 (diff)
downloadrpg-0ceb549d0a022569a0e99a34e362f15d4703fb9d.tar.gz
rpg-0ceb549d0a022569a0e99a34e362f15d4703fb9d.tar.bz2
Add metadata, settings class and language strings for $conf['renderer_xhtml']
darcs-hash:20080313204505-f07c6-ad0d4b9f155117f6be01925a8bfece1e35efa39f.gz
Diffstat (limited to 'lib/plugins/config/settings/extra.class.php')
-rw-r--r--lib/plugins/config/settings/extra.class.php40
1 files changed, 40 insertions, 0 deletions
diff --git a/lib/plugins/config/settings/extra.class.php b/lib/plugins/config/settings/extra.class.php
index 8e1e49acb..d85c17fcd 100644
--- a/lib/plugins/config/settings/extra.class.php
+++ b/lib/plugins/config/settings/extra.class.php
@@ -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);
+ }
+ }
+}