From 59869a4bb559845b792e0a57bb7c2e808a4d86e2 Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Mon, 25 May 2009 21:44:35 +0200 Subject: removed purple numbers darcs-hash:20090525194435-f7d6d-2def694a053f7e661f88f1636903283bad7c1fa8.gz --- inc/parser/xhtml.php | 81 ++++++---------------------------------------------- 1 file changed, 9 insertions(+), 72 deletions(-) (limited to 'inc/parser') diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php index de7893061..d9e3e784e 100644 --- a/inc/parser/xhtml.php +++ b/inc/parser/xhtml.php @@ -32,7 +32,6 @@ class Doku_Renderer_xhtml extends Doku_Renderer { var $headers = array(); var $footnotes = array(); - var $pnid = 0; var $lastlevel = 0; var $node = array(0,0,0,0,0); var $store = ''; @@ -94,10 +93,6 @@ class Doku_Renderer_xhtml extends Doku_Renderer { // make sure there are no empty paragraphs $this->doc = preg_replace('#

\s*

#','',$this->doc); - if ($conf['purplenumbers']) { - $this->doc = preg_replace('#]*>\s*.*?(?:

)#','',$this->doc); - $this->doc = preg_replace('//','',$this->doc); - } } function toc_additem($id, $text, $level) { @@ -110,8 +105,6 @@ class Doku_Renderer_xhtml extends Doku_Renderer { } function header($text, $level, $pos) { - global $conf; - global $lang; if(!$text) return; //skip empty headlines $hid = $this->_headerToLink($text,true); @@ -126,15 +119,12 @@ class Doku_Renderer_xhtml extends Doku_Renderer { $this->node[$this->lastlevel-$i-1] = 0; } } - $this->pnid = 0; $this->lastlevel = $level; // write the header $this->doc .= DOKU_LF.''; $this->doc .= $this->_xmlEntities($text); - $this->doc .= ""; - if ($conf['purplenumbers']) $this->doc .= " §"; - $this->doc .= "".DOKU_LF; + $this->doc .= "".DOKU_LF; } /** @@ -166,11 +156,11 @@ class Doku_Renderer_xhtml extends Doku_Renderer { } function p_open() { - $this->doc .= DOKU_LF.'_getPurpleNumberID().'>'.DOKU_LF; + $this->doc .= DOKU_LF.'

'.DOKU_LF; } function p_close() { - $this->doc .= DOKU_LF.$this->_getPurpleNumberLink().'

'.DOKU_LF; + $this->doc .= DOKU_LF.'

'.DOKU_LF; } function linebreak() { @@ -303,7 +293,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer { } function listitem_open($level) { - $this->doc .= '
  • _getPurpleNumberID().'>'; + $this->doc .= '
  • '; } function listitem_close() { @@ -315,7 +305,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer { } function listcontent_close() { - $this->doc .= $this->_getPurpleNumberLink().''.DOKU_LF; + $this->doc .= ''.DOKU_LF; } function unformatted($text) { @@ -368,11 +358,11 @@ class Doku_Renderer_xhtml extends Doku_Renderer { } function preformatted($text) { - $this->doc .= '
    _getPurpleNumberID().'>' . trim($this->_xmlEntities($text)) . $this->_getPurpleNumberLink(). '
    '. DOKU_LF; + $this->doc .= '
    ' . trim($this->_xmlEntities($text)) . '
    '. DOKU_LF; } function file($text) { - $this->doc .= '
    _getPurpleNumberID().'>' . trim($this->_xmlEntities($text)). $this->_getPurpleNumberLink(). '
    '. DOKU_LF; + $this->doc .= '
    ' . trim($this->_xmlEntities($text)). '
    '. DOKU_LF; } function quote_open() { @@ -832,11 +822,11 @@ class Doku_Renderer_xhtml extends Doku_Renderer { function table_open($maxcols = NULL, $numrows = NULL){ // initialize the row counter used for classes $this->_counter['row_counter'] = 0; - $this->doc .= '_getPurpleNumberID().'>'.DOKU_LF; + $this->doc .= '
    '.DOKU_LF; } function table_close(){ - $this->doc .= '
    '.$this->_getPurpleNumberLink(1).DOKU_LF; + $this->doc .= ''.DOKU_LF; } function tablerow_open(){ @@ -1105,59 +1095,6 @@ class Doku_Renderer_xhtml extends Doku_Renderer { return $link; } - /** - * Builds unique Hierarchical ID: - * If $conf['purplenumbers'] is 2, it is unique per site, - * otherwise it is unique per page. - * - * @author Anika Henke - */ - function _getHID($noprefix=0) { - global $conf; - if ($noprefix) { - $prefix = ''; - } else if ($conf['purplenumbers']==2) { - global $ID; - $prefix = $ID.'.'; - } else { - $prefix = 'HID'; - } - return $prefix.preg_replace('/(\.0)*$/','',join('.',$this->node)).str_replace(':0','',':'.$this->pnid); - } - - /** - * Equips each designated element with a Purple Number (Hierarchical ID). - * - * @author Anika Henke - */ - function _getPurpleNumberID() { - global $conf; - $this->pnid++; - if ($conf['purplenumbers']) { - return ' id="'.$this->_getHID().'"'; - } - return ''; - } - - /** - * Creates a link to the current Purple Number (Hierarchical ID). - * If the link cannot be inside its corresponding element (e.g. tables), - * $outside is set and p.pnlink is added around the link. - * - * @author Anika Henke - */ - function _getPurpleNumberLink($outside=0) { - global $conf; - if ($conf['purplenumbers']) { - global $lang; - $pnlink = ''; - if ($outside) { - return ''; - } - return ' '.$pnlink; - } - return ''; - } } -- cgit v1.2.3