From 38fb1fc7a9bbb1e70f0f24352891601b2e0856d6 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Tue, 13 May 2014 21:57:50 +0200 Subject: extend lang file cascade, so users can override some lang strings Fixes #692 --- inc/init.php | 8 ++++++++ inc/plugin.php | 1 + inc/template.php | 5 +++-- 3 files changed, 12 insertions(+), 2 deletions(-) (limited to 'inc') diff --git a/inc/init.php b/inc/init.php index 4ff239787..c7f9a406d 100644 --- a/inc/init.php +++ b/inc/init.php @@ -259,6 +259,11 @@ function init_paths(){ $conf['media_changelog'] = $conf['metadir'].'/_media.changes'; } +/** + * Load the language strings + * + * @param string $langCode language code, as passed by event handler + */ function init_lang($langCode) { //prepare language array global $lang; @@ -271,6 +276,9 @@ function init_lang($langCode) { require(DOKU_INC."inc/lang/$langCode/lang.php"); } } + if (file_exists(DOKU_CONF."lang/$langCode/lang.php")) { + require(DOKU_CONF."lang/$langCode/lang.php"); + } } /** diff --git a/inc/plugin.php b/inc/plugin.php index 7de4fbd74..dd374a4a4 100644 --- a/inc/plugin.php +++ b/inc/plugin.php @@ -124,6 +124,7 @@ class DokuWiki_Plugin { // don't include once, in case several plugin components require the same language file @include($path.'en/lang.php'); if ($conf['lang'] != 'en') @include($path.$conf['lang'].'/lang.php'); + @include(DOKU_CONF.'plugin_lang/'.$this->getPluginName().'/'.$conf['lang'].'/lang.php'); $this->lang = $lang; $this->localised = true; diff --git a/inc/template.php b/inc/template.php index 35b54b4c3..f8ec637b3 100644 --- a/inc/template.php +++ b/inc/template.php @@ -1285,8 +1285,8 @@ function tpl_getLang($id) { // don't include once @include($path.'en/lang.php'); if($conf['lang'] != 'en') @include($path.$conf['lang'].'/lang.php'); + @include(DOKU_CONF.'template_lang/'.$conf['template'].'/'.$conf['lang'].'/lang.php'); } - return $lang[$id]; } @@ -1307,7 +1307,7 @@ function tpl_locale_xhtml($id) { function tpl_localeFN($id) { $path = tpl_incdir().'lang/'; global $conf; - $file = DOKU_CONF.'/template_lang/'.$conf['template'].'/'.$conf['lang'].'/'.$id.'.txt'; + $file = DOKU_CONF.'template_lang/'.$conf['template'].'/'.$conf['lang'].'/'.$id.'.txt'; if (!@file_exists($file)){ $file = $path.$conf['lang'].'/'.$id.'.txt'; if(!@file_exists($file)){ @@ -1329,6 +1329,7 @@ function tpl_localeFN($id) { * * @triggers MEDIAMANAGER_CONTENT_OUTPUT * @param bool $fromajax - set true when calling this function via ajax + * @param string $sort * @author Andreas Gohr */ function tpl_mediaContent($fromajax = false, $sort='natural') { -- cgit v1.2.3 From 64d489db2842cfab445492e8fa262e74b090e773 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Sat, 27 Sep 2014 23:35:44 +0200 Subject: add lang files to cascading --- inc/config_cascade.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'inc') diff --git a/inc/config_cascade.php b/inc/config_cascade.php index 2c4f1612b..d93431c8c 100644 --- a/inc/config_cascade.php +++ b/inc/config_cascade.php @@ -72,6 +72,11 @@ $config_cascade = array_merge( DOKU_CONF.'plugins.protected.php', ), ), + 'lang' => array( + 'core' => array(DOKU_CONF . 'lang/'), + 'template' => array(DOKU_CONF . 'plugin_lang/'), + 'plugin' => array(DOKU_CONF . 'template_lang/') + ) ), $config_cascade ); -- cgit v1.2.3 From 89417bb7bf90154b2a5c17e0717028f7a7d9797f Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Sat, 27 Sep 2014 23:41:56 +0200 Subject: reformatting config cascade --- inc/config_cascade.php | 113 ++++++++++++++++++++++++------------------------- 1 file changed, 56 insertions(+), 57 deletions(-) (limited to 'inc') diff --git a/inc/config_cascade.php b/inc/config_cascade.php index d93431c8c..72b4493cf 100644 --- a/inc/config_cascade.php +++ b/inc/config_cascade.php @@ -8,76 +8,75 @@ $config_cascade = array_merge( array( 'main' => array( - 'default' => array(DOKU_CONF.'dokuwiki.php'), - 'local' => array(DOKU_CONF.'local.php'), - 'protected' => array(DOKU_CONF.'local.protected.php'), - ), - 'acronyms' => array( - 'default' => array(DOKU_CONF.'acronyms.conf'), - 'local' => array(DOKU_CONF.'acronyms.local.conf'), - ), - 'entities' => array( - 'default' => array(DOKU_CONF.'entities.conf'), - 'local' => array(DOKU_CONF.'entities.local.conf'), - ), + 'default' => array(DOKU_CONF . 'dokuwiki.php'), + 'local' => array(DOKU_CONF . 'local.php'), + 'protected' => array(DOKU_CONF . 'local.protected.php'), + ), + 'acronyms' => array( + 'default' => array(DOKU_CONF . 'acronyms.conf'), + 'local' => array(DOKU_CONF . 'acronyms.local.conf'), + ), + 'entities' => array( + 'default' => array(DOKU_CONF . 'entities.conf'), + 'local' => array(DOKU_CONF . 'entities.local.conf'), + ), 'interwiki' => array( - 'default' => array(DOKU_CONF.'interwiki.conf'), - 'local' => array(DOKU_CONF.'interwiki.local.conf'), - ), + 'default' => array(DOKU_CONF . 'interwiki.conf'), + 'local' => array(DOKU_CONF . 'interwiki.local.conf'), + ), 'license' => array( - 'default' => array(DOKU_CONF.'license.php'), - 'local' => array(DOKU_CONF.'license.local.php'), - ), + 'default' => array(DOKU_CONF . 'license.php'), + 'local' => array(DOKU_CONF . 'license.local.php'), + ), 'mediameta' => array( - 'default' => array(DOKU_CONF.'mediameta.php'), - 'local' => array(DOKU_CONF.'mediameta.local.php'), - ), - 'mime' => array( - 'default' => array(DOKU_CONF.'mime.conf'), - 'local' => array(DOKU_CONF.'mime.local.conf'), - ), - 'scheme' => array( - 'default' => array(DOKU_CONF.'scheme.conf'), - 'local' => array(DOKU_CONF.'scheme.local.conf'), - ), - 'smileys' => array( - 'default' => array(DOKU_CONF.'smileys.conf'), - 'local' => array(DOKU_CONF.'smileys.local.conf'), - ), + 'default' => array(DOKU_CONF . 'mediameta.php'), + 'local' => array(DOKU_CONF . 'mediameta.local.php'), + ), + 'mime' => array( + 'default' => array(DOKU_CONF . 'mime.conf'), + 'local' => array(DOKU_CONF . 'mime.local.conf'), + ), + 'scheme' => array( + 'default' => array(DOKU_CONF . 'scheme.conf'), + 'local' => array(DOKU_CONF . 'scheme.local.conf'), + ), + 'smileys' => array( + 'default' => array(DOKU_CONF . 'smileys.conf'), + 'local' => array(DOKU_CONF . 'smileys.local.conf'), + ), 'wordblock' => array( - 'default' => array(DOKU_CONF.'wordblock.conf'), - 'local' => array(DOKU_CONF.'wordblock.local.conf'), - ), + 'default' => array(DOKU_CONF . 'wordblock.conf'), + 'local' => array(DOKU_CONF . 'wordblock.local.conf'), + ), 'userstyle' => array( - 'screen' => DOKU_CONF.'userstyle.css', - 'print' => DOKU_CONF.'userprint.css', - 'feed' => DOKU_CONF.'userfeed.css', - 'all' => DOKU_CONF.'userall.css', - ), + 'screen' => DOKU_CONF . 'userstyle.css', + 'print' => DOKU_CONF . 'userprint.css', + 'feed' => DOKU_CONF . 'userfeed.css', + 'all' => DOKU_CONF . 'userall.css', + ), 'userscript' => array( - 'default' => DOKU_CONF.'userscript.js' - ), - 'acl' => array( - 'default' => DOKU_CONF.'acl.auth.php', - ), + 'default' => DOKU_CONF . 'userscript.js' + ), + 'acl' => array( + 'default' => DOKU_CONF . 'acl.auth.php', + ), 'plainauth.users' => array( - 'default' => DOKU_CONF.'users.auth.php', - ), - + 'default' => DOKU_CONF . 'users.auth.php', + ), 'plugins' => array( - 'default' => array(DOKU_CONF.'plugins.php'), - 'local' => array(DOKU_CONF.'plugins.local.php'), + 'default' => array(DOKU_CONF . 'plugins.php'), + 'local' => array(DOKU_CONF . 'plugins.local.php'), 'protected' => array( - DOKU_CONF.'plugins.required.php', - DOKU_CONF.'plugins.protected.php', - ), + DOKU_CONF . 'plugins.required.php', + DOKU_CONF . 'plugins.protected.php', ), + ), 'lang' => array( 'core' => array(DOKU_CONF . 'lang/'), 'template' => array(DOKU_CONF . 'plugin_lang/'), 'plugin' => array(DOKU_CONF . 'template_lang/') - ) - ), - $config_cascade + ) + ), + $config_cascade ); -- cgit v1.2.3 From dd7a6159c4224a6a3dda22a1f35f5fb13b06ec2e Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Sun, 28 Sep 2014 13:27:05 +0200 Subject: use config cascade for loading of localizations --- inc/config_cascade.php | 4 ++-- inc/init.php | 16 ++++++++++++---- inc/plugin.php | 24 ++++++++++++++++++------ inc/template.php | 23 ++++++++++++++++++----- 4 files changed, 50 insertions(+), 17 deletions(-) (limited to 'inc') diff --git a/inc/config_cascade.php b/inc/config_cascade.php index 72b4493cf..1d9f67edb 100644 --- a/inc/config_cascade.php +++ b/inc/config_cascade.php @@ -73,8 +73,8 @@ $config_cascade = array_merge( ), 'lang' => array( 'core' => array(DOKU_CONF . 'lang/'), - 'template' => array(DOKU_CONF . 'plugin_lang/'), - 'plugin' => array(DOKU_CONF . 'template_lang/') + 'plugin' => array(DOKU_CONF . 'plugin_lang/'), + 'template' => array(DOKU_CONF . 'template_lang/') ) ), $config_cascade diff --git a/inc/init.php b/inc/init.php index c7f9a406d..be81ec844 100644 --- a/inc/init.php +++ b/inc/init.php @@ -266,18 +266,26 @@ function init_paths(){ */ function init_lang($langCode) { //prepare language array - global $lang; + global $lang, $config_cascade; $lang = array(); //load the language files require(DOKU_INC.'inc/lang/en/lang.php'); + foreach ($config_cascade['lang']['core'] as $config_file) { + if (@file_exists($config_file . 'en/lang.php')) { + include($config_file . 'en/lang.php'); + } + } + if ($langCode && $langCode != 'en') { if (file_exists(DOKU_INC."inc/lang/$langCode/lang.php")) { require(DOKU_INC."inc/lang/$langCode/lang.php"); } - } - if (file_exists(DOKU_CONF."lang/$langCode/lang.php")) { - require(DOKU_CONF."lang/$langCode/lang.php"); + foreach ($config_cascade['lang']['core'] as $config_file) { + if (@file_exists($config_file . "$langCode/lang.php")) { + include($config_file . "$langCode/lang.php"); + } + } } } diff --git a/inc/plugin.php b/inc/plugin.php index dd374a4a4..f632e3dd0 100644 --- a/inc/plugin.php +++ b/inc/plugin.php @@ -114,17 +114,29 @@ class DokuWiki_Plugin { * this function is automatically called by getLang() */ function setupLocale() { - if ($this->localised) return; + if($this->localised) return; - global $conf; // definitely don't invoke "global $lang" - $path = DOKU_PLUGIN.$this->getPluginName().'/lang/'; + global $conf, $config_cascade; // definitely don't invoke "global $lang" + $path = DOKU_PLUGIN . $this->getPluginName() . '/lang/'; $lang = array(); // don't include once, in case several plugin components require the same language file - @include($path.'en/lang.php'); - if ($conf['lang'] != 'en') @include($path.$conf['lang'].'/lang.php'); - @include(DOKU_CONF.'plugin_lang/'.$this->getPluginName().'/'.$conf['lang'].'/lang.php'); + @include($path . 'en/lang.php'); + foreach($config_cascade['lang']['plugin'] as $config_file) { + if(@file_exists($config_file . $this->getPluginName() . '/en/lang.php')) { + include($config_file . $this->getPluginName() . '/en/lang.php'); + } + } + + if($conf['lang'] != 'en') { + @include($path . $conf['lang'] . '/lang.php'); + foreach($config_cascade['lang']['plugin'] as $config_file) { + if(@file_exists($config_file . $this->getPluginName() . '/' . $conf['lang'] . '/lang.php')) { + include($config_file . $this->getPluginName() . '/' . $conf['lang'] . '/lang.php'); + } + } + } $this->lang = $lang; $this->localised = true; diff --git a/inc/template.php b/inc/template.php index f8ec637b3..15854282e 100644 --- a/inc/template.php +++ b/inc/template.php @@ -1277,15 +1277,28 @@ function tpl_getLang($id) { static $lang = array(); if(count($lang) === 0) { - $path = tpl_incdir().'lang/'; + global $conf, $config_cascade; // definitely don't invoke "global $lang" + + $path = tpl_incdir() . 'lang/'; $lang = array(); - global $conf; // definitely don't invoke "global $lang" // don't include once - @include($path.'en/lang.php'); - if($conf['lang'] != 'en') @include($path.$conf['lang'].'/lang.php'); - @include(DOKU_CONF.'template_lang/'.$conf['template'].'/'.$conf['lang'].'/lang.php'); + @include($path . 'en/lang.php'); + foreach($config_cascade['lang']['template'] as $config_file) { + if(@file_exists($config_file . $conf['template'] . '/en/lang.php')) { + include($config_file . $conf['template'] . '/en/lang.php'); + } + } + + if($conf['lang'] != 'en') { + @include($path . $conf['lang'] . '/lang.php'); + foreach($config_cascade['lang']['template'] as $config_file) { + if(@file_exists($config_file . $conf['template'] . '/' . $conf['lang'] . '/lang.php')) { + include($config_file . $conf['template'] . '/' . $conf['lang'] . '/lang.php'); + } + } + } } return $lang[$id]; } -- cgit v1.2.3 From 73411587cb6d2c54aefebe90c87799c4aa1d31ec Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Sun, 28 Sep 2014 13:40:54 +0200 Subject: visibility plugin methods --- inc/plugin.php | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'inc') diff --git a/inc/plugin.php b/inc/plugin.php index f632e3dd0..1ec92e2d7 100644 --- a/inc/plugin.php +++ b/inc/plugin.php @@ -30,7 +30,7 @@ class DokuWiki_Plugin { * desc - Short description of the plugin (Text only) * url - Website with more information on the plugin (eg. syntax description) */ - function getInfo(){ + public function getInfo(){ $parts = explode('_',get_class($this)); $info = DOKU_PLUGIN.'/'.$parts[2].'/plugin.info.txt'; if(@file_exists($info)) return confToHash($info); @@ -47,15 +47,15 @@ class DokuWiki_Plugin { // plugin introspection methods // extract from class name, format = _plugin_[_] - function getPluginType() { + public function getPluginType() { list($t) = explode('_', get_class($this), 2); return $t; } - function getPluginName() { + public function getPluginName() { list($t, $p, $n) = explode('_', get_class($this), 4); return $n; } - function getPluginComponent() { + public function getPluginComponent() { list($t, $p, $n, $c) = explode('_', get_class($this), 4); return (isset($c)?$c:''); } @@ -70,7 +70,7 @@ class DokuWiki_Plugin { * @param string $id id of the string to be retrieved * @return string string in appropriate language or english if not available */ - function getLang($id) { + public function getLang($id) { if (!$this->localised) $this->setupLocale(); return (isset($this->lang[$id]) ? $this->lang[$id] : ''); @@ -85,7 +85,7 @@ class DokuWiki_Plugin { * @param string $id id of language dependent wiki page * @return string parsed contents of the wiki page in xhtml format */ - function locale_xhtml($id) { + public function locale_xhtml($id) { return p_cached_output($this->localFN($id)); } @@ -94,7 +94,7 @@ class DokuWiki_Plugin { * prepends appropriate path for a language dependent filename * plugin equivalent of localFN() */ - function localFN($id) { + public function localFN($id) { global $conf; $plugin = $this->getPluginName(); $file = DOKU_CONF.'plugin_lang/'.$plugin.'/'.$conf['lang'].'/'.$id.'.txt'; @@ -152,7 +152,7 @@ class DokuWiki_Plugin { * @param mixed $notset what to return if the setting is not available * @return mixed */ - function getConf($setting, $notset=false){ + public function getConf($setting, $notset=false){ if (!$this->configloaded){ $this->loadConfig(); } @@ -189,7 +189,7 @@ class DokuWiki_Plugin { * * @return array setting => value */ - function readDefaultSettings() { + protected function readDefaultSettings() { $path = DOKU_PLUGIN.$this->getPluginName().'/conf/'; $conf = array(); @@ -211,7 +211,7 @@ class DokuWiki_Plugin { * * @return object helper plugin object */ - function loadHelper($name, $msg = true){ + public function loadHelper($name, $msg = true){ $obj = plugin_load('helper',$name); if (is_null($obj) && $msg) msg("Helper plugin $name is not available or invalid.",-1); return $obj; @@ -224,7 +224,7 @@ class DokuWiki_Plugin { * email * standardised function to generate an email link according to obfuscation settings */ - function email($email, $name='', $class='', $more='') { + public function email($email, $name='', $class='', $more='') { if (!$email) return $name; $email = obfuscate($email); if (!$name) $name = $email; @@ -236,7 +236,7 @@ class DokuWiki_Plugin { * external_link * standardised function to generate an external link according to conf settings */ - function external_link($link, $title='', $class='', $target='', $more='') { + public function external_link($link, $title='', $class='', $target='', $more='') { global $conf; $link = htmlentities($link); @@ -263,7 +263,7 @@ class DokuWiki_Plugin { * @param $arguments * @return null|string */ - function __call($name, $arguments) { + public function __call($name, $arguments) { if($name == 'render'){ if(!isset($arguments[1])) $arguments[1] = 'xhtml'; return $this->render_text($arguments[0], $arguments[1]); @@ -280,7 +280,7 @@ class DokuWiki_Plugin { * @param string $format output format * @return null|string */ - function render_text($text, $format='xhtml') { + public function render_text($text, $format='xhtml') { return p_render($format, p_get_instructions($text),$info); } @@ -289,7 +289,7 @@ class DokuWiki_Plugin { * * @return bool false if the plugin has to be instantiated */ - function isSingleton() { + public function isSingleton() { return true; } } -- cgit v1.2.3 From 21d806cd5466991b4790c5e6b37a40ae35f1eecb Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Sun, 28 Sep 2014 14:44:17 +0200 Subject: improve some scrutinizer issues different types unused vars PHPDocs --- inc/media.php | 6 ++++++ inc/plugin.php | 4 ++-- inc/template.php | 26 +++++++++++++++++++++----- 3 files changed, 29 insertions(+), 7 deletions(-) (limited to 'inc') diff --git a/inc/media.php b/inc/media.php index 9022858e1..5190862d7 100644 --- a/inc/media.php +++ b/inc/media.php @@ -582,6 +582,12 @@ function media_notify($id,$file,$mime,$old_rev=false){ /** * List all files in a given Media namespace + * + * @param string $ns namespace + * @param null|int $auth permission level + * @param string $jump + * @param bool $fullscreenview + * @param bool|string $sort sorting, false skips sorting */ function media_filelist($ns,$auth=null,$jump='',$fullscreenview=false,$sort=false){ global $conf; diff --git a/inc/plugin.php b/inc/plugin.php index 92a8efd62..80689e389 100644 --- a/inc/plugin.php +++ b/inc/plugin.php @@ -53,11 +53,11 @@ class DokuWiki_Plugin { return $t; } public function getPluginName() { - list($t, $p, $n) = explode('_', get_class($this), 4); + list(/* $t */, /* $p */, $n) = explode('_', get_class($this), 4); return $n; } public function getPluginComponent() { - list($t, $p, $n, $c) = explode('_', get_class($this), 4); + list(/* $t */, /* $p */, /* $n */, $c) = explode('_', get_class($this), 4); return (isset($c)?$c:''); } diff --git a/inc/template.php b/inc/template.php index d4357cf0e..3730495c8 100644 --- a/inc/template.php +++ b/inc/template.php @@ -456,6 +456,12 @@ function _tpl_metaheaders_action($data) { * Just builds a link. * * @author Andreas Gohr + * + * @param string $url + * @param string $name + * @param string $more + * @param bool $return if true return the link html, otherwise print + * @return bool|string html of the link, or true if printed */ function tpl_link($url, $name, $more = '', $return = false) { $out = ' + * + * @param string $id page id + * @param string|null $name link name + * @return bool true */ function tpl_pagelink($id, $name = null) { print ''.html_wikilink($id, $name).''; @@ -534,6 +544,13 @@ function tpl_button($type, $return = false) { * * @author Adrian Lang * @see tpl_get_action + * + * @param string $type action name + * @param string $pre prefix of link + * @param string $suf suffix of link + * @param string $inner inner HTML for link + * @param bool $return if true it returns html, otherwise prints + * @return bool|string html of action link or false if nothing, or true if printed */ function tpl_actionlink($type, $pre = '', $suf = '', $inner = '', $return = false) { global $lang; @@ -571,7 +588,7 @@ function tpl_actionlink($type, $pre = '', $suf = '', $inner = '', $return = fals $linktarget, $pre.(($inner) ? $inner : $caption).$suf, 'class="action '.$type.'" '. $akey.$rel. - 'title="'.hsc($caption).$addTitle.'"', 1 + 'title="'.hsc($caption).$addTitle.'"', true ); } if($return) return $out; @@ -747,7 +764,6 @@ function tpl_get_action($type) { break; default: return '[unknown %s type]'; - break; } return compact('accesskey', 'type', 'id', 'method', 'params', 'nofollow', 'replacement'); } @@ -768,9 +784,9 @@ function tpl_get_action($type) { function tpl_action($type, $link = false, $wrapper = false, $return = false, $pre = '', $suf = '', $inner = '') { $out = ''; if($link) { - $out .= tpl_actionlink($type, $pre, $suf, $inner, 1); + $out .= tpl_actionlink($type, $pre, $suf, $inner, true); } else { - $out .= tpl_button($type, 1); + $out .= tpl_button($type, true); } if($out && $wrapper) $out = "<$wrapper>$out"; @@ -1027,7 +1043,7 @@ function tpl_pagetitle($id = null, $ret = false) { * Only allowed in: detail.php * * @author Andreas Gohr - * @param array $tags tags to try + * @param array|string $tags tag or array of tags to try * @param string $alt alternative output if no data was found * @param null $src the image src, uses global $SRC if not given * @return string -- cgit v1.2.3 From 0440ca46b69be8a0fd706825f9d319299db892db Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Sun, 28 Sep 2014 15:07:17 +0200 Subject: phpdocs parserutils --- inc/parserutils.php | 1 + 1 file changed, 1 insertion(+) (limited to 'inc') diff --git a/inc/parserutils.php b/inc/parserutils.php index 9c2a0b570..eab3455a6 100644 --- a/inc/parserutils.php +++ b/inc/parserutils.php @@ -636,6 +636,7 @@ function p_get_renderer($mode) { } // not bundled, see if its an enabled renderer plugin & when $mode is 'xhtml', the renderer can supply that format. + /** @var Doku_Renderer $Renderer */ $Renderer = $plugin_controller->load('renderer',$rname); if ($Renderer && is_a($Renderer, 'Doku_Renderer') && ($mode != 'xhtml' || $mode == $Renderer->getFormat())) { return $Renderer; -- cgit v1.2.3