diff options
author | Gerrit Uitslag <klapinklapin@gmail.com> | 2014-02-15 11:17:09 +0100 |
---|---|---|
committer | Gerrit Uitslag <klapinklapin@gmail.com> | 2014-02-15 11:17:09 +0100 |
commit | 5a9ce44695f44ecc76f356c1fc26f0a1846231b7 (patch) | |
tree | 1a403df862bb1ba35dd43c97d1130f59284d6ea6 /inc/parser | |
parent | 2345e871e407dbece52f3181cd8b077f07cbb0c1 (diff) | |
download | rpg-5a9ce44695f44ecc76f356c1fc26f0a1846231b7.tar.gz rpg-5a9ce44695f44ecc76f356c1fc26f0a1846231b7.tar.bz2 |
code reformatting
Diffstat (limited to 'inc/parser')
-rw-r--r-- | inc/parser/renderer.php | 42 | ||||
-rw-r--r-- | inc/parser/xhtml.php | 10 |
2 files changed, 26 insertions, 26 deletions
diff --git a/inc/parser/renderer.php b/inc/parser/renderer.php index 66a106b11..d01fc3899 100644 --- a/inc/parser/renderer.php +++ b/inc/parser/renderer.php @@ -273,17 +273,17 @@ class Doku_Renderer extends DokuWiki_Plugin { * * @author Andreas Gohr <andi@splitbrain.org> */ - function _simpleTitle($name){ + function _simpleTitle($name) { global $conf; //if there is a hash we use the ancor name only - list($name,$hash) = explode('#',$name,2); + list($name, $hash) = explode('#', $name, 2); if($hash) return $hash; - if($conf['useslash']){ - $name = strtr($name,';/',';:'); - }else{ - $name = strtr($name,';',':'); + if($conf['useslash']) { + $name = strtr($name, ';/', ';:'); + } else { + $name = strtr($name, ';', ':'); } return noNSorNS($name); @@ -292,9 +292,9 @@ class Doku_Renderer extends DokuWiki_Plugin { /** * Resolve an interwikilink */ - function _resolveInterWiki(&$shortcut,$reference){ + function _resolveInterWiki(&$shortcut, $reference) { //get interwiki URL - if ( isset($this->interwiki[$shortcut]) ) { + if(isset($this->interwiki[$shortcut])) { $url = $this->interwiki[$shortcut]; } else { // Default to Google I'm feeling lucky @@ -303,30 +303,30 @@ class Doku_Renderer extends DokuWiki_Plugin { } //split into hash and url part - list($reference,$hash) = explode('#',$reference,2); + list($reference, $hash) = explode('#', $reference, 2); //replace placeholder - if(preg_match('#\{(URL|NAME|SCHEME|HOST|PORT|PATH|QUERY)\}#',$url)){ + if(preg_match('#\{(URL|NAME|SCHEME|HOST|PORT|PATH|QUERY)\}#', $url)) { //use placeholders - $url = str_replace('{URL}',rawurlencode($reference),$url); - $url = str_replace('{NAME}',$reference,$url); + $url = str_replace('{URL}', rawurlencode($reference), $url); + $url = str_replace('{NAME}', $reference, $url); $parsed = parse_url($reference); if(!$parsed['port']) $parsed['port'] = 80; - $url = str_replace('{SCHEME}',$parsed['scheme'],$url); - $url = str_replace('{HOST}',$parsed['host'],$url); - $url = str_replace('{PORT}',$parsed['port'],$url); - $url = str_replace('{PATH}',$parsed['path'],$url); - $url = str_replace('{QUERY}',$parsed['query'],$url); - }else{ + $url = str_replace('{SCHEME}', $parsed['scheme'], $url); + $url = str_replace('{HOST}', $parsed['host'], $url); + $url = str_replace('{PORT}', $parsed['port'], $url); + $url = str_replace('{PATH}', $parsed['path'], $url); + $url = str_replace('{QUERY}', $parsed['query'], $url); + } else { //default - $url = $url.rawurlencode($reference); + $url = $url . rawurlencode($reference); } //url without slashes is handled as a pageid - if(strpos($url,'/') === false) { + if(strpos($url, '/') === false) { list($url, $urlparam) = explode('?', $url, 2); $url = wl($url, $urlparam); } - if($hash) $url .= '#'.rawurlencode($hash); + if($hash) $url .= '#' . rawurlencode($hash); return $url; } diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php index f0a507721..20cd8e9d6 100644 --- a/inc/parser/xhtml.php +++ b/inc/parser/xhtml.php @@ -685,7 +685,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer { } /** - */ + */ function interwikilink($match, $name = null, $wikiName, $wikiUri) { global $conf; @@ -697,17 +697,17 @@ class Doku_Renderer_xhtml extends Doku_Renderer { $link['name'] = $this->_getLinkTitle($name, $wikiUri, $isImage); //get interwiki URL - $url = $this->_resolveInterWiki($wikiName,$wikiUri); + $url = $this->_resolveInterWiki($wikiName, $wikiUri); - if ( !$isImage ) { - $class = preg_replace('/[^_\-a-z0-9]+/i','_',$wikiName); + if(!$isImage) { + $class = preg_replace('/[^_\-a-z0-9]+/i', '_', $wikiName); $link['class'] = "interwiki iw_$class"; } else { $link['class'] = 'media'; } //do we stay at the same server? Use local target - if( strpos($url,DOKU_URL) === 0 OR strpos($url,DOKU_BASE) === 0){ + if(strpos($url, DOKU_URL) === 0 OR strpos($url, DOKU_BASE) === 0) { $link['target'] = $conf['target']['wiki']; } |