summaryrefslogtreecommitdiff
path: root/inc/parser/code.php
diff options
context:
space:
mode:
authorGerry Weißbach <gerry.w@gammaproduction.de>2014-07-16 08:02:34 +0200
committerGerry Weißbach <gerry.w@gammaproduction.de>2014-07-16 08:02:34 +0200
commit0bd5b90b4c1294b3c9abc1977060f971dc2e2744 (patch)
treeac79a7402ffef718685f16dbba6692a0c9b5f458 /inc/parser/code.php
parent1858e4d7685782550789fd8c228e55ae319bc37a (diff)
parent80679bafa1a5ed611bafc603afd0ae7b2b5954a7 (diff)
downloadrpg-0bd5b90b4c1294b3c9abc1977060f971dc2e2744.tar.gz
rpg-0bd5b90b4c1294b3c9abc1977060f971dc2e2744.tar.bz2
Merge remote-tracking branch 'splitbrain/master'
Diffstat (limited to 'inc/parser/code.php')
-rw-r--r--inc/parser/code.php13
1 files changed, 6 insertions, 7 deletions
diff --git a/inc/parser/code.php b/inc/parser/code.php
index 0b8e3ee02..00b956c27 100644
--- a/inc/parser/code.php
+++ b/inc/parser/code.php
@@ -5,28 +5,27 @@
* @author Andreas Gohr <andi@splitbrain.org>
*/
if(!defined('DOKU_INC')) die('meh.');
-require_once DOKU_INC . 'inc/parser/renderer.php';
class Doku_Renderer_code extends Doku_Renderer {
- var $_codeblock=0;
+ var $_codeblock = 0;
/**
* Send the wanted code block to the browser
*
* When the correct block was found it exits the script.
*/
- function code($text, $language = null, $filename='' ) {
+ function code($text, $language = null, $filename = '') {
global $INPUT;
if(!$language) $language = 'txt';
if(!$filename) $filename = 'snippet.'.$language;
$filename = utf8_basename($filename);
$filename = utf8_stripspecials($filename, '_');
- if($this->_codeblock == $INPUT->str('codeblock')){
+ if($this->_codeblock == $INPUT->str('codeblock')) {
header("Content-Type: text/plain; charset=utf-8");
header("Content-Disposition: attachment; filename=$filename");
header("X-Robots-Tag: noindex");
- echo trim($text,"\r\n");
+ echo trim($text, "\r\n");
exit;
}
@@ -36,7 +35,7 @@ class Doku_Renderer_code extends Doku_Renderer {
/**
* Wraps around code()
*/
- function file($text, $language = null, $filename='') {
+ function file($text, $language = null, $filename = '') {
$this->code($text, $language, $filename);
}
@@ -54,7 +53,7 @@ class Doku_Renderer_code extends Doku_Renderer {
*
* @returns string 'code'
*/
- function getFormat(){
+ function getFormat() {
return 'code';
}
}