summaryrefslogtreecommitdiff
path: root/inc/parser
diff options
context:
space:
mode:
authorandi <andi@splitbrain.org>2005-04-22 12:12:53 +0200
committerandi <andi@splitbrain.org>2005-04-22 12:12:53 +0200
commit433bef32d237280f4b789c93c0b33f863533e8b4 (patch)
tree5d17c5372d93b46c3bf38259e7ade51449f2a94c /inc/parser
parentcf81b04aec397fc5abc6ec1078d5f77df2b72770 (diff)
downloadrpg-433bef32d237280f4b789c93c0b33f863533e8b4.tar.gz
rpg-433bef32d237280f4b789c93c0b33f863533e8b4.tar.bz2
removed magical __
The PHP manual states "PHP reserves all function names starting with __ as magical. It is recommended that you do not use function names with __ in PHP unless you want some documented magic functionality." (http://www.php.net/manual/en/language.oop.php) I renamed all functions starting with __ to _ darcs-hash:20050422101253-9977f-79b7cb3ac3b5b8287073ab0bc7d9e78f115b4a58.gz
Diffstat (limited to 'inc/parser')
-rw-r--r--inc/parser/handler.php142
-rw-r--r--inc/parser/parser.php2
-rw-r--r--inc/parser/spamcheck.php30
-rw-r--r--inc/parser/xhtml.php152
4 files changed, 163 insertions, 163 deletions
diff --git a/inc/parser/handler.php b/inc/parser/handler.php
index fbe10d431..9f8dc3076 100644
--- a/inc/parser/handler.php
+++ b/inc/parser/handler.php
@@ -20,12 +20,12 @@ class Doku_Handler {
$this->CallWriter = & new Doku_Handler_CallWriter($this);
}
- function __addCall($handler, $args, $pos) {
+ function _addCall($handler, $args, $pos) {
$call = array($handler,$args, $pos);
$this->CallWriter->writeCall($call);
}
- function __finalize(){
+ function _finalize(){
if ( $this->meta['section'] ) {
$S = & new Doku_Handler_Section();
$this->calls = $S->process($this->calls);
@@ -57,7 +57,7 @@ class Doku_Handler {
function base($match, $state, $pos) {
switch ( $state ) {
case DOKU_LEXER_UNMATCHED:
- $this->__addCall('cdata',array($match), $pos);
+ $this->_addCall('cdata',array($match), $pos);
return TRUE;
break;
@@ -88,7 +88,7 @@ class Doku_Handler {
$markerLen = strlen($iLevels[$level]);
$title = substr($match, $markerLen, strlen($match)-($markerLen*2));
- $this->__addCall('header',array($title,$level,$pos), $pos);
+ $this->_addCall('header',array($title,$level,$pos), $pos);
$this->meta['section'] = TRUE;
return TRUE;
}
@@ -99,72 +99,72 @@ class Doku_Handler {
}
function linebreak($match, $state, $pos) {
- $this->__addCall('linebreak',array(),$pos);
+ $this->_addCall('linebreak',array(),$pos);
return TRUE;
}
function eol($match, $state, $pos) {
- $this->__addCall('eol',array(),$pos);
+ $this->_addCall('eol',array(),$pos);
return TRUE;
}
function hr($match, $state, $pos) {
- $this->__addCall('hr',array(),$pos);
+ $this->_addCall('hr',array(),$pos);
return TRUE;
}
- function __nestingTag($match, $state, $pos, $name) {
+ function _nestingTag($match, $state, $pos, $name) {
switch ( $state ) {
case DOKU_LEXER_ENTER:
- $this->__addCall($name.'_open', array(), $pos);
+ $this->_addCall($name.'_open', array(), $pos);
break;
case DOKU_LEXER_EXIT:
- $this->__addCall($name.'_close', array(), $pos);
+ $this->_addCall($name.'_close', array(), $pos);
break;
case DOKU_LEXER_UNMATCHED:
- $this->__addCall('cdata',array($match), $pos);
+ $this->_addCall('cdata',array($match), $pos);
break;
}
}
function strong($match, $state, $pos) {
- $this->__nestingTag($match, $state, $pos, 'strong');
+ $this->_nestingTag($match, $state, $pos, 'strong');
return TRUE;
}
function emphasis($match, $state, $pos) {
- $this->__nestingTag($match, $state, $pos, 'emphasis');
+ $this->_nestingTag($match, $state, $pos, 'emphasis');
return TRUE;
}
function underline($match, $state, $pos) {
- $this->__nestingTag($match, $state, $pos, 'underline');
+ $this->_nestingTag($match, $state, $pos, 'underline');
return TRUE;
}
function monospace($match, $state, $pos) {
- $this->__nestingTag($match, $state, $pos, 'monospace');
+ $this->_nestingTag($match, $state, $pos, 'monospace');
return TRUE;
}
function subscript($match, $state, $pos) {
- $this->__nestingTag($match, $state, $pos, 'subscript');
+ $this->_nestingTag($match, $state, $pos, 'subscript');
return TRUE;
}
function superscript($match, $state, $pos) {
- $this->__nestingTag($match, $state, $pos, 'superscript');
+ $this->_nestingTag($match, $state, $pos, 'superscript');
return TRUE;
}
function deleted($match, $state, $pos) {
- $this->__nestingTag($match, $state, $pos, 'deleted');
+ $this->_nestingTag($match, $state, $pos, 'deleted');
return TRUE;
}
function footnote($match, $state, $pos) {
- $this->__nestingTag($match, $state, $pos, 'footnote');
+ $this->_nestingTag($match, $state, $pos, 'footnote');
return TRUE;
}
@@ -173,19 +173,19 @@ class Doku_Handler {
case DOKU_LEXER_ENTER:
$ReWriter = & new Doku_Handler_List($this->CallWriter);
$this->CallWriter = & $ReWriter;
- $this->__addCall('list_open', array($match), $pos);
+ $this->_addCall('list_open', array($match), $pos);
break;
case DOKU_LEXER_EXIT:
- $this->__addCall('list_close', array(), $pos);
+ $this->_addCall('list_close', array(), $pos);
$this->CallWriter->process();
$ReWriter = & $this->CallWriter;
$this->CallWriter = & $ReWriter->CallWriter;
break;
case DOKU_LEXER_MATCHED:
- $this->__addCall('list_item', array($match), $pos);
+ $this->_addCall('list_item', array($match), $pos);
break;
case DOKU_LEXER_UNMATCHED:
- $this->__addCall('cdata', array($match), $pos);
+ $this->_addCall('cdata', array($match), $pos);
break;
}
return TRUE;
@@ -193,21 +193,21 @@ class Doku_Handler {
function unformatted($match, $state, $pos) {
if ( $state == DOKU_LEXER_UNMATCHED ) {
- $this->__addCall('unformatted',array($match), $pos);
+ $this->_addCall('unformatted',array($match), $pos);
}
return TRUE;
}
function php($match, $state, $pos) {
if ( $state == DOKU_LEXER_UNMATCHED ) {
- $this->__addCall('php',array($match), $pos);
+ $this->_addCall('php',array($match), $pos);
}
return TRUE;
}
function html($match, $state, $pos) {
if ( $state == DOKU_LEXER_UNMATCHED ) {
- $this->__addCall('html',array($match), $pos);
+ $this->_addCall('html',array($match), $pos);
}
return TRUE;
}
@@ -217,19 +217,19 @@ class Doku_Handler {
case DOKU_LEXER_ENTER:
$ReWriter = & new Doku_Handler_Preformatted($this->CallWriter);
$this->CallWriter = & $ReWriter;
- $this->__addCall('preformatted_start',array(), $pos);
+ $this->_addCall('preformatted_start',array(), $pos);
break;
case DOKU_LEXER_EXIT:
- $this->__addCall('preformatted_end',array(), $pos);
+ $this->_addCall('preformatted_end',array(), $pos);
$this->CallWriter->process();
$ReWriter = & $this->CallWriter;
$this->CallWriter = & $ReWriter->CallWriter;
break;
case DOKU_LEXER_MATCHED:
- $this->__addCall('preformatted_newline',array(), $pos);
+ $this->_addCall('preformatted_newline',array(), $pos);
break;
case DOKU_LEXER_UNMATCHED:
- $this->__addCall('preformatted_content',array($match), $pos);
+ $this->_addCall('preformatted_content',array($match), $pos);
break;
}
@@ -238,7 +238,7 @@ class Doku_Handler {
function file($match, $state, $pos) {
if ( $state == DOKU_LEXER_UNMATCHED ) {
- $this->__addCall('file',array($match), $pos);
+ $this->_addCall('file',array($match), $pos);
}
return TRUE;
}
@@ -250,22 +250,22 @@ class Doku_Handler {
case DOKU_LEXER_ENTER:
$ReWriter = & new Doku_Handler_Quote($this->CallWriter);
$this->CallWriter = & $ReWriter;
- $this->__addCall('quote_start',array($match), $pos);
+ $this->_addCall('quote_start',array($match), $pos);
break;
case DOKU_LEXER_EXIT:
- $this->__addCall('quote_end',array(), $pos);
+ $this->_addCall('quote_end',array(), $pos);
$this->CallWriter->process();
$ReWriter = & $this->CallWriter;
$this->CallWriter = & $ReWriter->CallWriter;
break;
case DOKU_LEXER_MATCHED:
- $this->__addCall('quote_newline',array($match), $pos);
+ $this->_addCall('quote_newline',array($match), $pos);
break;
case DOKU_LEXER_UNMATCHED:
- $this->__addCall('cdata',array($match), $pos);
+ $this->_addCall('cdata',array($match), $pos);
break;
}
@@ -283,7 +283,7 @@ class Doku_Handler {
}
# $matches[0] contains name of programming language
# if available
- $this->__addCall(
+ $this->_addCall(
'code',
array($matches[1],$matches[0]),
$pos
@@ -294,53 +294,53 @@ class Doku_Handler {
}
function acronym($match, $state, $pos) {
- $this->__addCall('acronym',array($match), $pos);
+ $this->_addCall('acronym',array($match), $pos);
return TRUE;
}
function smiley($match, $state, $pos) {
- $this->__addCall('smiley',array($match), $pos);
+ $this->_addCall('smiley',array($match), $pos);
return TRUE;
}
function wordblock($match, $state, $pos) {
- $this->__addCall('wordblock',array($match), $pos);
+ $this->_addCall('wordblock',array($match), $pos);
return TRUE;
}
function entity($match, $state, $pos) {
- $this->__addCall('entity',array($match), $pos);
+ $this->_addCall('entity',array($match), $pos);
return TRUE;
}
function multiplyentity($match, $state, $pos) {
preg_match_all('/\d+/',$match,$matches);
- $this->__addCall('multiplyentity',array($matches[0][0],$matches[0][1]), $pos);
+ $this->_addCall('multiplyentity',array($matches[0][0],$matches[0][1]), $pos);
return TRUE;
}
function singlequoteopening($match, $state, $pos) {
- $this->__addCall('singlequoteopening',array(), $pos);
+ $this->_addCall('singlequoteopening',array(), $pos);
return TRUE;
}
function singlequoteclosing($match, $state, $pos) {
- $this->__addCall('singlequoteclosing',array(), $pos);
+ $this->_addCall('singlequoteclosing',array(), $pos);
return TRUE;
}
function doublequoteopening($match, $state, $pos) {
- $this->__addCall('doublequoteopening',array(), $pos);
+ $this->_addCall('doublequoteopening',array(), $pos);
return TRUE;
}
function doublequoteclosing($match, $state, $pos) {
- $this->__addCall('doublequoteclosing',array(), $pos);
+ $this->_addCall('doublequoteclosing',array(), $pos);
return TRUE;
}
function camelcaselink($match, $state, $pos) {
- $this->__addCall('camelcaselink',array($match), $pos);
+ $this->_addCall('camelcaselink',array($match), $pos);
return TRUE;
}
@@ -365,35 +365,35 @@ class Doku_Handler {
if ( preg_match('/^[a-zA-Z]+>{1}[\w()\/\\#~:.?+=&%@!\-;,]+$/u',$link[0]) ) {
// Interwiki
$interwiki = preg_split('/>/u',$link[0]);
- $this->__addCall(
+ $this->_addCall(
'interwikilink',
array($link[0],$link[1],strtolower($interwiki[0]),$interwiki[1]),
$pos
);
}elseif ( preg_match('/\\\\\\\\[\w.:?\-;,]+?\\\\/u',$link[0]) ) {
// Windows Share
- $this->__addCall(
+ $this->_addCall(
'windowssharelink',
array($link[0],$link[1]),
$pos
);
}elseif ( preg_match('#([a-z0-9\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i',$link[0]) ) {
// E-Mail
- $this->__addCall(
+ $this->_addCall(
'emaillink',
array($link[0],$link[1]),
$pos
);
}elseif ( preg_match('#^([a-z0-9]+?)://#i',$link[0]) ) {
// external link (accepts all protocols)
- $this->__addCall(
+ $this->_addCall(
'externallink',
array($link[0],$link[1]),
$pos
);
}else{
// internal link
- $this->__addCall(
+ $this->_addCall(
'internallink',
array($link[0],$link[1]),
$pos
@@ -404,19 +404,19 @@ class Doku_Handler {
}
function filelink($match, $state, $pos) {
- $this->__addCall('filelink',array($match, NULL), $pos);
+ $this->_addCall('filelink',array($match, NULL), $pos);
return TRUE;
}
function windowssharelink($match, $state, $pos) {
- $this->__addCall('windowssharelink',array($match, NULL), $pos);
+ $this->_addCall('windowssharelink',array($match, NULL), $pos);
return TRUE;
}
function media($match, $state, $pos) {
$p = Doku_Handler_Parse_Media($match);
- $this->__addCall(
+ $this->_addCall(
$p['type'],
array($p['src'], $p['title'], $p['align'], $p['width'], $p['height'], $p['cache']),
$pos
@@ -426,7 +426,7 @@ class Doku_Handler {
function rss($match, $state, $pos) {
$link = preg_replace(array('/^\{\{rss>/','/\}\}$/'),'',$match);
- $this->__addCall('rss',array($link),$pos);
+ $this->_addCall('rss',array($link),$pos);
}
function externallink($match, $state, $pos) {
@@ -434,17 +434,17 @@ class Doku_Handler {
// See: http://www.boingboing.net/2005/02/06/shmoo_group_exploit_.html
// Not worried about other charsets so long as page is output as UTF-8
/*if ( strlen($match) != utf8_strlen($match) ) {
- $this->__addCall('cdata',array($match), $pos);
+ $this->_addCall('cdata',array($match), $pos);
} else {*/
- $this->__addCall('externallink',array($match, NULL), $pos);
+ $this->_addCall('externallink',array($match, NULL), $pos);
//}
return TRUE;
}
function emaillink($match, $state, $pos) {
$email = preg_replace(array('/^</','/>$/'),'',$match);
- $this->__addCall('emaillink',array($email, NULL), $pos);
+ $this->_addCall('emaillink',array($email, NULL), $pos);
return TRUE;
}
@@ -456,17 +456,17 @@ class Doku_Handler {
$ReWriter = & new Doku_Handler_Table($this->CallWriter);
$this->CallWriter = & $ReWriter;
- $this->__addCall('table_start', array(), $pos);
- //$this->__addCall('table_row', array(), $pos);
+ $this->_addCall('table_start', array(), $pos);
+ //$this->_addCall('table_row', array(), $pos);
if ( trim($match) == '^' ) {
- $this->__addCall('tableheader', array(), $pos);
+ $this->_addCall('tableheader', array(), $pos);
} else {
- $this->__addCall('tablecell', array(), $pos);
+ $this->_addCall('tablecell', array(), $pos);
}
break;
case DOKU_LEXER_EXIT:
- $this->__addCall('table_end', array(), $pos);
+ $this->_addCall('table_end', array(), $pos);
$this->CallWriter->process();
$ReWriter = & $this->CallWriter;
$this->CallWriter = & $ReWriter->CallWriter;
@@ -474,23 +474,23 @@ class Doku_Handler {
case DOKU_LEXER_UNMATCHED:
if ( trim($match) != '' ) {
- $this->__addCall('cdata',array($match), $pos);
+ $this->_addCall('cdata',array($match), $pos);
}
break;
case DOKU_LEXER_MATCHED:
if ( preg_match('/.{2}/',$match) ) {
- $this->__addCall('table_align', array($match), $pos);
+ $this->_addCall('table_align', array($match), $pos);
} else if ( $match == "\n|" ) {
- $this->__addCall('table_row', array(), $pos);
- $this->__addCall('tablecell', array(), $pos);
+ $this->_addCall('table_row', array(), $pos);
+ $this->_addCall('tablecell', array(), $pos);
} else if ( $match == "\n^" ) {
- $this->__addCall('table_row', array(), $pos);
- $this->__addCall('tableheader', array(), $pos);
+ $this->_addCall('table_row', array(), $pos);
+ $this->_addCall('tableheader', array(), $pos);
} else if ( $match == '|' ) {
- $this->__addCall('tablecell', array(), $pos);
+ $this->_addCall('tablecell', array(), $pos);
} else if ( $match == '^' ) {
- $this->__addCall('tableheader', array(), $pos);
+ $this->_addCall('tableheader', array(), $pos);
}
break;
}
diff --git a/inc/parser/parser.php b/inc/parser/parser.php
index 687ae5170..23f2c13d7 100644
--- a/inc/parser/parser.php
+++ b/inc/parser/parser.php
@@ -76,7 +76,7 @@ class Doku_Parser {
// Normalize CRs and pad doc
$doc = "\n".str_replace("\r\n","\n",$doc)."\n";
$this->Lexer->parse($doc);
- $this->Handler->__finalize();
+ $this->Handler->_finalize();
return $this->Handler->calls;
} else {
return FALSE;
diff --git a/inc/parser/spamcheck.php b/inc/parser/spamcheck.php
index 65a1ba060..b1f473d8c 100644
--- a/inc/parser/spamcheck.php
+++ b/inc/parser/spamcheck.php
@@ -15,44 +15,44 @@ class Doku_Renderer_SpamCheck extends Doku_Renderer {
var $spamPattern = '#^$#';
function internallink($link, $title = NULL) {
- $this->__checkTitle($title);
+ $this->_checkTitle($title);
}
function externallink($link, $title = NULL) {
- $this->__checkLinkForSpam($link);
- $this->__checkTitle($title);
+ $this->_checkLinkForSpam($link);
+ $this->_checkTitle($title);
}
function interwikilink($link, $title = NULL) {
- $this->__checkTitle($title);
+ $this->_checkTitle($title);
}
function filelink($link, $title = NULL) {
- $this->__checkLinkForSpam($link);
- $this->__checkTitle($title);
+ $this->_checkLinkForSpam($link);
+ $this->_checkTitle($title);
}
function windowssharelink($link, $title = NULL) {
- $this->__checkLinkForSpam($link);
- $this->__checkTitle($title);
+ $this->_checkLinkForSpam($link);
+ $this->_checkTitle($title);
}
function email($address, $title = NULL) {
- $this->__checkLinkForSpam($address);
- $this->__checkTitle($title);
+ $this->_checkLinkForSpam($address);
+ $this->_checkTitle($title);
}
function internalmedialink ($src) {
- $this->__checkLinkForSpam($src);
+ $this->_checkLinkForSpam($src);
}
function externalmedialink($src) {
- $this->__checkLinkForSpam($src);
+ $this->_checkLinkForSpam($src);
}
- function __checkTitle($title) {
+ function _checkTitle($title) {
if ( is_array($title) && isset($title['src'])) {
- $this->__checkLinkForSpam($title['src']);
+ $this->_checkLinkForSpam($title['src']);
}
}
@@ -60,7 +60,7 @@ class Doku_Renderer_SpamCheck extends Doku_Renderer {
/**
* @TODO What about links like www.google.com - no http://
*/
- function __checkLinkForSpam($link) {
+ function _checkLinkForSpam($link) {
if( preg_match($this->spamPattern,$link) ) {
$spam = $this->currentCall;
$spam[3] = $link;
diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php
index e17d83a35..52efa9f72 100644
--- a/inc/parser/xhtml.php
+++ b/inc/parser/xhtml.php
@@ -47,7 +47,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
function document_end() {
// add button for last section if any and more than one
- if($this->lastsec > 1) $this->__secedit($this->lastsec,'');
+ if($this->lastsec > 1) $this->_secedit($this->lastsec,'');
if ( count ($this->footnotes) > 0 ) {
echo '<div class="footnotes">'.DOKU_LF;
@@ -81,8 +81,8 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
}
function tocelement($level, $title) {
- echo '<span class="li"><a href="#'.$this->__headerToLink($title).'" class="toc">';
- echo $this->__xmlEntities($title);
+ echo '<span class="li"><a href="#'.$this->_headerToLink($title).'" class="toc">';
+ echo $this->_xmlEntities($title);
echo '</a></span>';
}
@@ -103,13 +103,13 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
//handle section editing
if($level <= $conf['maxseclevel']){
// add button for last section if any
- if($this->lastsec) $this->__secedit($this->lastsec,$pos-1);
+ if($this->lastsec) $this->_secedit($this->lastsec,$pos-1);
// remember current position
$this->lastsec = $pos;
}
- echo DOKU_LF.'<a name="'.$this->__headerToLink($text).'"></a><h'.$level.'>';
- echo $this->__xmlEntities($text);
+ echo DOKU_LF.'<a name="'.$this->_headerToLink($text).'"></a><h'.$level.'>';
+ echo $this->_xmlEntities($text);
echo "</h$level>".DOKU_LF;
}
@@ -122,7 +122,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
}
function cdata($text) {
- echo $this->__xmlEntities($text);
+ echo $this->_xmlEntities($text);
}
function p_open() {
@@ -198,7 +198,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
}
function footnote_open() {
- $id = $this->__newFootnoteId();
+ $id = $this->_newFootnoteId();
echo '<a href="#fn'.$id.'" name="fnt'.$id.'" class="fn_top">'.$id.')</a>';
$this->footnoteIdStack[] = $id;
ob_start();
@@ -248,7 +248,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
}
function unformatted($text) {
- echo $this->__xmlEntities($text);
+ echo $this->_xmlEntities($text);
}
/**
@@ -274,11 +274,11 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
}
function preformatted($text) {
- echo '<pre class="code">' . $this->__xmlEntities($text) . '</pre>'. DOKU_LF;
+ echo '<pre class="code">' . $this->_xmlEntities($text) . '</pre>'. DOKU_LF;
}
function file($text) {
- echo '<pre class="file">' . $this->__xmlEntities($text). '</pre>'. DOKU_LF;
+ echo '<pre class="file">' . $this->_xmlEntities($text). '</pre>'. DOKU_LF;
}
/**
@@ -320,13 +320,13 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
if ( array_key_exists($acronym, $this->acronyms) ) {
- $title = $this->__xmlEntities($this->acronyms[$acronym]);
+ $title = $this->_xmlEntities($this->acronyms[$acronym]);
echo '<acronym title="'.$title
- .'">'.$this->__xmlEntities($acronym).'</acronym>';
+ .'">'.$this->_xmlEntities($acronym).'</acronym>';
} else {
- echo $this->__xmlEntities($acronym);
+ echo $this->_xmlEntities($acronym);
}
}
@@ -334,12 +334,12 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
*/
function smiley($smiley) {
if ( array_key_exists($smiley, $this->smileys) ) {
- $title = $this->__xmlEntities($this->smileys[$smiley]);
+ $title = $this->_xmlEntities($this->smileys[$smiley]);
echo '<img src="'.DOKU_BASE.'smileys/'.$this->smileys[$smiley].
'" align="middle" alt="'.
- $this->__xmlEntities($smiley).'" />';
+ $this->_xmlEntities($smiley).'" />';
} else {
- echo $this->__xmlEntities($smiley);
+ echo $this->_xmlEntities($smiley);
}
}
@@ -349,7 +349,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
if ( array_key_exists($word, $this->badwords) ) {
echo '** BLEEP **';
} else {
- echo $this->__xmlEntities($word);
+ echo $this->_xmlEntities($word);
}
}
*/
@@ -358,7 +358,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
if ( array_key_exists($entity, $this->entities) ) {
echo $this->entities[$entity];
} else {
- echo $this->__xmlEntities($entity);
+ echo $this->_xmlEntities($entity);
}
}
@@ -391,7 +391,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
function internallink($id, $name = NULL) {
global $conf;
- $name = $this->__getLinkTitle($name, $this->__simpleTitle($id), $isImage, $id);
+ $name = $this->_getLinkTitle($name, $this->_simpleTitle($id), $isImage, $id);
resolve_pageid($id,$exists);
if ( !$isImage ) {
@@ -416,13 +416,13 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$link['title'] = $id;
//output formatted
- echo $this->__formatLink($link);
+ echo $this->_formatLink($link);
}
function externallink($url, $name = NULL) {
global $conf;
- $name = $this->__getLinkTitle($name, $url, $isImage);
+ $name = $this->_getLinkTitle($name, $url, $isImage);
if ( !$isImage ) {
$class='urlextern';
@@ -439,11 +439,11 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$link['class'] = $class;
$link['url'] = $url;
$link['name'] = $name;
- $link['title'] = $this->__xmlEntities($url);
+ $link['title'] = $this->_xmlEntities($url);
if($conf['relnofollow']) $link['more'] .= ' rel="nofollow"';
//output formatted
- echo $this->__formatLink($link);
+ echo $this->_formatLink($link);
}
/**
@@ -456,7 +456,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$link['pre'] = '';
$link['suf'] = '';
$link['more'] = 'onclick="return svchk()" onkeypress="return svchk()"';
- $link['name'] = $this->__getLinkTitle($name, $wikiUri, $isImage);
+ $link['name'] = $this->_getLinkTitle($name, $wikiUri, $isImage);
if ( !$isImage ) {
$link['class'] = 'interwiki';
@@ -508,7 +508,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$link['title'] = htmlspecialchars($link['url']);
//output formatted
- echo $this->__formatLink($link);
+ echo $this->_formatLink($link);
}
/*
@@ -518,7 +518,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
function filelink($link, $title = NULL) {
echo '<a';
- $title = $this->__getLinkTitle($title, $link, $isImage);
+ $title = $this->_getLinkTitle($title, $link, $isImage);
if ( !$isImage ) {
echo ' class="windows"';
@@ -526,7 +526,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
echo ' class="media"';
}
- echo ' href="'.$this->__xmlEntities($link).'"';
+ echo ' href="'.$this->_xmlEntities($link).'"';
echo ' style="background: transparent url(http://wiki.splitbrain.org/images/windows.gif) 0px 1px no-repeat;"';
@@ -550,11 +550,11 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$link['style'] = '';
//Display error on browsers other than IE
$link['more'] = 'onclick="if(document.all == null){alert(\''.
- $this->__xmlEntities($lang['nosmblinks'],ENT_QUOTES).
+ $this->_xmlEntities($lang['nosmblinks'],ENT_QUOTES).
'\');}" onkeypress="if(document.all == null){alert(\''.
- $this->__xmlEntities($lang['nosmblinks'],ENT_QUOTES).'\');}"';
+ $this->_xmlEntities($lang['nosmblinks'],ENT_QUOTES).'\');}"';
- $link['name'] = $this->__getLinkTitle($name, $url, $isImage);
+ $link['name'] = $this->_getLinkTitle($name, $url, $isImage);
if ( !$isImage ) {
$link['class'] = 'windows';
} else {
@@ -562,13 +562,13 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
}
- $link['title'] = $this->__xmlEntities($url);
+ $link['title'] = $this->_xmlEntities($url);
$url = str_replace('\\','/',$url);
$url = 'file:///'.$url;
$link['url'] = $url;
//output formatted
- echo $this->__formatLink($link);
+ echo $this->_formatLink($link);
}
function emaillink($address, $name = NULL) {
@@ -582,7 +582,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$link['more'] = '';
//we just test for image here - we need to encode the title our self
- $this->__getLinkTitle($name, $address, $isImage);
+ $this->_getLinkTitle($name, $address, $isImage);
if ( !$isImage ) {
$link['class']='mail';
} else {
@@ -596,11 +596,11 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$address = str_replace('.',' [dot] ',$address);
$address = str_replace('-',' [dash] ',$address);
- $title = $this->__xmlEntities($address);
+ $title = $this->_xmlEntities($address);
if(empty($name)){
- $name = $this->__xmlEntities($address);
+ $name = $this->_xmlEntities($address);
}else{
- $name = $this->__xmlEntities($name);
+ $name = $this->_xmlEntities($name);
}
}elseif($conf['mailguard']=='hex'){
//encode every char to a hex entity
@@ -612,15 +612,15 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
if(empty($name)){
$name = $encode;
}else{
- $name = $this->__xmlEntities($name);
+ $name = $this->_xmlEntities($name);
}
}else{
//keep address as is
- $title = $this->__xmlEntities($address);
+ $title = $this->_xmlEntities($address);
if(empty($name)){
- $name = $this->__xmlEntities($address);
+ $name = $this->_xmlEntities($address);
}else{
- $name = $this->__xmlEntities($name);
+ $name = $this->_xmlEntities($name);
}
}
@@ -629,7 +629,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$link['title'] = $title;
//output formatted
- echo $this->__formatLink($link);
+ echo $this->_formatLink($link);
}
/**
@@ -648,13 +648,13 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$link['more'] = 'onclick="return svchk()" onkeypress="return svchk()"';
$link['target'] = $conf['target']['media'];
- $link['title'] = $this->__xmlEntities($src);
+ $link['title'] = $this->_xmlEntities($src);
$link['url'] = DOKU_BASE.'fetch.php?cache='.$cache.'&amp;media='.urlencode($src);
- $link['name'] = $this->__media ($src, $title, $align, $width, $height, $cache);
+ $link['name'] = $this->_media ($src, $title, $align, $width, $height, $cache);
//output formatted
- echo $this->__formatLink($link);
+ echo $this->_formatLink($link);
}
/**
@@ -672,13 +672,13 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$link['more'] = 'onclick="return svchk()" onkeypress="return svchk()"';
$link['target'] = $conf['target']['media'];
- $link['title'] = $this->__xmlEntities($src);
+ $link['title'] = $this->_xmlEntities($src);
$link['url'] = DOKU_BASE.'fetch.php?cache='.$cache.'&amp;media='.urlencode($src);
- $link['name'] = $this->__media ($src, $title, $align, $width, $height, $cache);
+ $link['name'] = $this->_media ($src, $title, $align, $width, $height, $cache);
//output formatted
- echo $this->__formatLink($link);
+ echo $this->_formatLink($link);
}
/**
@@ -721,7 +721,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
* @todo handle center align
* @todo move to bottom
*/
- function __media ($src, $title=NULL, $align=NULL, $width=NULL,
+ function _media ($src, $title=NULL, $align=NULL, $width=NULL,
$height=NULL, $cache=NULL) {
$ret = '';
@@ -735,13 +735,13 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$ret .= ' class="media'.$align.'"';
if (!is_null($title))
- $ret .= ' title="'.$this->__xmlEntities($title).'"';
+ $ret .= ' title="'.$this->_xmlEntities($title).'"';
if ( !is_null($width) )
- $ret .= ' width="'.$this->__xmlEntities($width).'"';
+ $ret .= ' width="'.$this->_xmlEntities($width).'"';
if ( !is_null($height) )
- $ret .= ' height="'.$this->__xmlEntities($height).'"';
+ $ret .= ' height="'.$this->_xmlEntities($height).'"';
$ret .= ' />';
@@ -750,15 +750,15 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$ret .= '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'.
' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"';
- if ( !is_null($width) ) $ret .= ' width="'.$this->__xmlEntities($width).'"';
- if ( !is_null($height) ) $ret .= ' height="'.$this->__xmlEntities($height).'"';
+ if ( !is_null($width) ) $ret .= ' width="'.$this->_xmlEntities($width).'"';
+ if ( !is_null($height) ) $ret .= ' height="'.$this->_xmlEntities($height).'"';
$ret .= '>'.DOKU_LF;
$ret .= '<param name="movie" value="'.DOKU_BASE.'fetch.php?media='.urlencode($src).'" />'.DOKU_LF;
$ret .= '<param name="quality" value="high" />'.DOKU_LF;
$ret .= '<embed src="'.DOKU_BASE.'fetch.php?media='.urlencode($src).'"'.
' quality="high" bgcolor="#000000"';
- if ( !is_null($width) ) $ret .= ' width="'.$this->__xmlEntities($width).'"';
- if ( !is_null($height) ) $ret .= ' height="'.$this->__xmlEntities($height).'"';
+ if ( !is_null($width) ) $ret .= ' width="'.$this->_xmlEntities($width).'"';
+ if ( !is_null($height) ) $ret .= ' height="'.$this->_xmlEntities($height).'"';
$ret .= ' type="application/x-shockwave-flash"'.
' pluginspage="http://www.macromedia.com/shockwave/download/index.cgi'.
'?P1_Prod_Version=ShockwaveFlash"></embed>'.DOKU_LF;
@@ -766,10 +766,10 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
}elseif(!is_null($title)){
// well at least we have a title to display
- $ret .= $this->__xmlEntities($title);
+ $ret .= $this->_xmlEntities($title);
}else{
// just show the source
- $ret .= $this->__xmlEntities($src);
+ $ret .= $this->_xmlEntities($src);
}
return $ret;
@@ -831,7 +831,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
- function __formatLink($link){
+ function _formatLink($link){
//make sure the url is XHTML compliant (skip mailto)
if(substr($link['url'],0,7) != 'mailto:'){
$link['url'] = str_replace('&','&amp;',$link['url']);
@@ -861,7 +861,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
- function __simpleTitle($name){
+ function _simpleTitle($name){
global $conf;
if($conf['useslash']){
$nssep = '[:;/]';
@@ -872,30 +872,30 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
}
- function __newFootnoteId() {
+ function _newFootnoteId() {
static $id = 1;
return $id++;
}
- function __xmlEntities($string) {
+ function _xmlEntities($string) {
return htmlspecialchars($string);
}
/**
* @TODO Tuning needed - e.g. utf8 strtolower ?
*/
- function __headerToLink($title) {
+ function _headerToLink($title) {
return preg_replace('/\W/','_',trim($title));
}
/**
* Adds code for section editing button
*/
- function __secedit($f, $t){
+ function _secedit($f, $t){
print '<!-- SECTION ['.$f.'-'.$t.'] -->';
}
- function __getLinkTitle($title, $default, & $isImage, $id=NULL) {
+ function _getLinkTitle($title, $default, & $isImage, $id=NULL) {
global $conf;
$isImage = FALSE;
@@ -904,19 +904,19 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
if ($conf['useheading'] && $id) {
$heading = p_get_first_heading($id);
if ($heading) {
- return $this->__xmlEntities($heading);
+ return $this->_xmlEntities($heading);
}
}
- return $this->__xmlEntities($default);
+ return $this->_xmlEntities($default);
} else if ( is_string($title) ) {
- return $this->__xmlEntities($title);
+ return $this->_xmlEntities($title);
} else if ( is_array($title) ) {
$isImage = TRUE;
- return $this->__imageTitle($title);
+ return $this->_imageTitle($title);
}
}
@@ -924,11 +924,11 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
/**
* @TODO Resolve namespace on internal images
*/
- function __imageTitle($img) {
+ function _imageTitle($img) {
//FIXME resolve internal links
- return $this->__media($img['src'],
+ return $this->_media($img['src'],
$img['title'],
$img['align'],
$img['width'],
@@ -946,16 +946,16 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$src = $img['src'];
}
- $imgStr = '<img class="media" src="http://wiki.splitbrain.org/media/wiki/'.$this->__xmlEntities($src).'"';
+ $imgStr = '<img class="media" src="http://wiki.splitbrain.org/media/wiki/'.$this->_xmlEntities($src).'"';
} else {
- $imgStr = '<img class="media" src="'.$this->__xmlEntities($img['src']).'"';
+ $imgStr = '<img class="media" src="'.$this->_xmlEntities($img['src']).'"';
}
if ( !is_null($img['title']) ) {
- $imgStr .= ' alt="'.$this->__xmlEntities($img['title']).'"';
+ $imgStr .= ' alt="'.$this->_xmlEntities($img['title']).'"';
} else {
$imgStr .= ' alt=""';
}
@@ -965,11 +965,11 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
}
if ( !is_null($img['width']) ) {
- $imgStr .= ' width="'.$this->__xmlEntities($img['width']).'"';
+ $imgStr .= ' width="'.$this->_xmlEntities($img['width']).'"';
}
if ( !is_null($img['height']) ) {
- $imgStr .= ' height="'.$this->__xmlEntities($img['height']).'"';
+ $imgStr .= ' height="'.$this->_xmlEntities($img['height']).'"';
}
$imgStr .= '/>';