summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorGerrit Uitslag <klapinklapin@gmail.com>2014-02-15 11:17:09 +0100
committerGerrit Uitslag <klapinklapin@gmail.com>2014-02-15 11:17:09 +0100
commit5a9ce44695f44ecc76f356c1fc26f0a1846231b7 (patch)
tree1a403df862bb1ba35dd43c97d1130f59284d6ea6 /inc
parent2345e871e407dbece52f3181cd8b077f07cbb0c1 (diff)
downloadrpg-5a9ce44695f44ecc76f356c1fc26f0a1846231b7.tar.gz
rpg-5a9ce44695f44ecc76f356c1fc26f0a1846231b7.tar.bz2
code reformatting
Diffstat (limited to 'inc')
-rw-r--r--inc/common.php30
-rw-r--r--inc/parser/renderer.php42
-rw-r--r--inc/parser/xhtml.php10
3 files changed, 41 insertions, 41 deletions
diff --git a/inc/common.php b/inc/common.php
index e991375f5..cd3c053a3 100644
--- a/inc/common.php
+++ b/inc/common.php
@@ -1438,21 +1438,21 @@ function userinfo($username = null) {
$data = array(
'username' => $username, // the unique user name
'name' => '',
- 'link' => array( //setting 'link' to false disables linking
- 'target' => '',
- 'pre' => '',
- 'suf' => '',
- 'style' => '',
- 'more' => '',
- 'url' => '',
- 'title' => '',
- 'class' => ''
+ 'link' => array( //setting 'link' to false disables linking
+ 'target' => '',
+ 'pre' => '',
+ 'suf' => '',
+ 'style' => '',
+ 'more' => '',
+ 'url' => '',
+ 'title' => '',
+ 'class' => ''
),
'userinfo' => ''
);
if($username === null) {
$data['username'] = $username = $_SERVER['REMOTE_USER'];
- $data['name'] = '<bdi>'.hsc($INFO['userinfo']['name']).'</bdi> (<bdi>'.hsc($_SERVER['REMOTE_USER']).'</bdi>)';
+ $data['name'] = '<bdi>' . hsc($INFO['userinfo']['name']) . '</bdi> (<bdi>' . hsc($_SERVER['REMOTE_USER']) . '</bdi>)';
}
$evt = new Doku_Event('COMMON_USER_LINK', $data);
@@ -1480,7 +1480,7 @@ function userinfo($username = null) {
/** @var Doku_Renderer_xhtml $xhtml_renderer */
static $xhtml_renderer = null;
- if($data['link'] !== false && empty($data['link']['url'])){
+ if($data['link'] !== false && empty($data['link']['url'])) {
if(in_array($conf['showuseras'], array('email_link', 'username_link'))) {
if(!isset($info)) {
@@ -1488,9 +1488,9 @@ function userinfo($username = null) {
}
if(isset($info) && $info) {
if($conf['showuseras'] == 'email_link') {
- $data['link']['url'] = 'mailto:'.obfuscate($info['mail']);
+ $data['link']['url'] = 'mailto:' . obfuscate($info['mail']);
} else {
- if(is_null($xhtml_renderer)){
+ if(is_null($xhtml_renderer)) {
$xhtml_renderer = p_get_renderer('xhtml');
}
if(empty($xhtml_renderer->interwiki)) {
@@ -1510,9 +1510,9 @@ function userinfo($username = null) {
if($data['link'] === false) {
$data['userinfo'] = $data['name'];
- } else{
+ } else {
$data['link']['name'] = $data['name'];
- if(is_null($xhtml_renderer)){
+ if(is_null($xhtml_renderer)) {
$xhtml_renderer = p_get_renderer('xhtml');
}
$data['userinfo'] = $xhtml_renderer->_formatLink($data['link']);
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'];
}