diff options
author | Michael Hamann <michael@content-space.de> | 2012-12-02 23:58:38 +0100 |
---|---|---|
committer | Michael Hamann <michael@content-space.de> | 2012-12-02 23:58:38 +0100 |
commit | b04a190d960a260703e65e9ed4a951cb083e4e61 (patch) | |
tree | ac294559c71e3b7288e9e5e7e3176e32d1cf760b | |
parent | 52d4c9bee1bdc3e55d34f567fd91b532e773e6a1 (diff) | |
download | rpg-b04a190d960a260703e65e9ed4a951cb083e4e61.tar.gz rpg-b04a190d960a260703e65e9ed4a951cb083e4e61.tar.bz2 |
XHTML renderer: bind section id counter to the renderer instance
This changes the previously static lastsecid into an instance variable,
this leads to consistent section edit ids when the xhtml renderer is
used more than once in a request. This makes it possible for test cases
to know the exact section edit id for an instruction array.
-rw-r--r-- | inc/parser/xhtml.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php index b4e78a530..68b92ca43 100644 --- a/inc/parser/xhtml.php +++ b/inc/parser/xhtml.php @@ -30,6 +30,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer { var $toc = array(); // will contain the Table of Contents var $sectionedits = array(); // A stack of section edit data + private $lastsecid = 0; // last section edit id, used by startSectionEdit var $headers = array(); var $footnotes = array(); @@ -50,9 +51,8 @@ class Doku_Renderer_xhtml extends Doku_Renderer { * @author Adrian Lang <lang@cosmocode.de> */ public function startSectionEdit($start, $type, $title = null) { - static $lastsecid = 0; - $this->sectionedits[] = array(++$lastsecid, $start, $type, $title); - return 'sectionedit' . $lastsecid; + $this->sectionedits[] = array(++$this->lastsecid, $start, $type, $title); + return 'sectionedit' . $this->lastsecid; } /** |