summaryrefslogtreecommitdiff
path: root/inc/html.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2006-02-19 00:07:44 +0100
committerAndreas Gohr <andi@splitbrain.org>2006-02-19 00:07:44 +0100
commitc5a8fd9606f6ad8de87e3f7563aa190872e302c0 (patch)
tree7b48fb8c45afc527870a2bc94289fb1378b95ab2 /inc/html.php
parent9fb6b269b0b72fc8009c114029588e1c08b426ba (diff)
downloadrpg-c5a8fd9606f6ad8de87e3f7563aa190872e302c0.tar.gz
rpg-c5a8fd9606f6ad8de87e3f7563aa190872e302c0.tar.bz2
create unique IDs for sections
This patch finally completes the support for unique section IDs. To achive this the mechanism how the TOC is build was changed. The TOC now is build in the renderer only. Currently the TOC will be rendered in the end_document function and is then prepended to the doc. This should ensure compatibility with the rest of the code. Adding support for separating the TOC from the page should now be a simpler task in the future. TODO: - Update base class - remove commented old TOC code - make sure no other parts of the code use any of the old TOC code darcs-hash:20060218230744-7ad00-40c5463d93f8ae1c543fb4fed747b2047b4c1302.gz
Diffstat (limited to 'inc/html.php')
-rw-r--r--inc/html.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/inc/html.php b/inc/html.php
index f9acd7325..46336b68d 100644
--- a/inc/html.php
+++ b/inc/html.php
@@ -647,6 +647,9 @@ function html_li_default($item){
* print the <li> tag. Both user function need to accept
* a single item.
*
+ * Both user functions can be given as array to point to
+ * a member of an object.
+ *
* @author Andreas Gohr <andi@splitbrain.org>
*/
function html_buildlist($data,$class,$func,$lifunc='html_li_default'){
@@ -678,9 +681,17 @@ function html_buildlist($data,$class,$func,$lifunc='html_li_default'){
$level = $item['level'];
//print item
- $ret .= $lifunc($item); //user function
+ if(is_array($lifunc)){
+ $ret .= $lifunc[0]->$lifunc[1]($item); //user object method
+ }else{
+ $ret .= $lifunc($item); //user function
+ }
$ret .= '<div class="li">';
+ if(is_array($func)){
+ $ret .= $func[0]->$func[1]($item); //user object method
+ }else{
$ret .= $func($item); //user function
+ }
$ret .= '</div>';
}