summaryrefslogtreecommitdiff
path: root/lib/plugins/syntax.php
diff options
context:
space:
mode:
authorAnika Henke <anika@selfthinker.org>2014-01-05 16:25:21 +0000
committerAnika Henke <anika@selfthinker.org>2014-01-05 16:25:21 +0000
commit8491e52805a9aaef90168f1417c6e0806fb7c5d7 (patch)
tree536ad50878f0ac6f6815db91f8bcb4819bc092ae /lib/plugins/syntax.php
parent6fdd11e032b654dd27de346f7e54231ee043d7ef (diff)
parentdfaf5f6c54597f81b1a8b777f55b89c93f87a345 (diff)
downloadrpg-8491e52805a9aaef90168f1417c6e0806fb7c5d7.tar.gz
rpg-8491e52805a9aaef90168f1417c6e0806fb7c5d7.tar.bz2
Merge remote-tracking branch 'origin/master' into extension_manager
Diffstat (limited to 'lib/plugins/syntax.php')
-rw-r--r--lib/plugins/syntax.php44
1 files changed, 22 insertions, 22 deletions
diff --git a/lib/plugins/syntax.php b/lib/plugins/syntax.php
index b7839b2b2..8df5abb08 100644
--- a/lib/plugins/syntax.php
+++ b/lib/plugins/syntax.php
@@ -137,7 +137,7 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode {
$idx = array_search(substr(get_class($this), 7), (array) $this->allowedModes);
if ($idx !== false) {
- unset($this->allowedModes[$idx]);
+ unset($this->allowedModes[$idx]);
}
$this->allowedModesSetup = true;
}
@@ -169,9 +169,9 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode {
* @return string string in appropriate language or english if not available
*/
function getLang($id) {
- if (!$this->localised) $this->setupLocale();
+ if (!$this->localised) $this->setupLocale();
- return (isset($this->lang[$id]) ? $this->lang[$id] : '');
+ return (isset($this->lang[$id]) ? $this->lang[$id] : '');
}
/**
@@ -184,7 +184,7 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode {
* @return string parsed contents of the wiki page in xhtml format
*/
function locale_xhtml($id) {
- return p_cached_output($this->localFN($id));
+ return p_cached_output($this->localFN($id));
}
/**
@@ -193,17 +193,17 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode {
* plugin equivalent of localFN()
*/
function localFN($id) {
- global $conf;
- $plugin = $this->getPluginName();
- $file = DOKU_CONF.'/plugin_lang/'.$plugin.'/'.$conf['lang'].'/'.$id.'.txt';
- if (!@file_exists($file)){
- $file = DOKU_PLUGIN.$plugin.'/lang/'.$conf['lang'].'/'.$id.'.txt';
- if(!@file_exists($file)){
- //fall back to english
- $file = DOKU_PLUGIN.$plugin.'/lang/en/'.$id.'.txt';
+ global $conf;
+ $plugin = $this->getPluginName();
+ $file = DOKU_CONF.'/plugin_lang/'.$plugin.'/'.$conf['lang'].'/'.$id.'.txt';
+ if (!@file_exists($file)){
+ $file = DOKU_PLUGIN.$plugin.'/lang/'.$conf['lang'].'/'.$id.'.txt';
+ if(!@file_exists($file)){
+ //fall back to english
+ $file = DOKU_PLUGIN.$plugin.'/lang/en/'.$id.'.txt';
+ }
}
- }
- return $file;
+ return $file;
}
/**
@@ -214,16 +214,16 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode {
function setupLocale() {
if ($this->localised) return;
- global $conf; // definitely don't invoke "global $lang"
- $path = DOKU_PLUGIN.$this->getPluginName().'/lang/';
+ global $conf; // 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');
+ $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');
- $this->lang = $lang;
- $this->localised = true;
+ $this->lang = $lang;
+ $this->localised = true;
}
// configuration methods