diff options
Diffstat (limited to 'includes/pear/Text/Wiki/Render/Xhtml/Toc.php')
| -rwxr-xr-x[-rw-r--r--] | includes/pear/Text/Wiki/Render/Xhtml/Toc.php | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/includes/pear/Text/Wiki/Render/Xhtml/Toc.php b/includes/pear/Text/Wiki/Render/Xhtml/Toc.php index 2b68b68..7048f09 100644..100755 --- a/includes/pear/Text/Wiki/Render/Xhtml/Toc.php +++ b/includes/pear/Text/Wiki/Render/Xhtml/Toc.php @@ -9,7 +9,7 @@ * @package Text_Wiki * @author Paul M. Jones <pmjones@php.net> * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 - * @version CVS: $Id: Toc.php 191862 2005-07-30 08:03:29Z toggg $ + * @version CVS: $Id$ * @link http://pear.php.net/package/Text_Wiki */ @@ -26,11 +26,12 @@ class Text_Wiki_Render_Xhtml_Toc extends Text_Wiki_Render { var $conf = array( - 'css_list' => null, - 'css_item' => null, - 'title' => '<strong>Table of Contents</strong>', - 'div_id' => 'toc', - 'collapse' => true + "css_list" => null, + "css_item" => null, + "title" => "<strong>Table of Contents</strong>", + "div_id" => "toc", + "base_url" => "", + "collapse" => true ); var $min = 2; @@ -55,46 +56,46 @@ class Text_Wiki_Render_Xhtml_Toc extends Text_Wiki_Render { switch ($type) { - case 'list_start': + case "list_start": - $css = $this->getConf('css_list'); - $html = ''; + $css = $this->getConf("css_list"); + $html = ""; // collapse div within a table? - if ($this->getConf('collapse')) { + if ($this->getConf("collapse")) { $html .= '<table border="0" cellspacing="0" cellpadding="0">'; $html .= "<tr><td>\n"; } // add the div, class, and id - $html .= '<div'; + $html .= "<div"; if ($css) { $html .= " class=\"$css\""; } - $div_id = $this->getConf('div_id'); + $div_id = $this->getConf("div_id"); if ($div_id) { $html .= " id=\"$div_id\""; } // add the title, and done - $html .= '>'; - $html .= $this->getConf('title'); + $html .= ">"; + $html .= $this->getConf("title"); return $html; break; - case 'list_end': - if ($this->getConf('collapse')) { + case "list_end": + if ($this->getConf("collapse")) { return "\n</div>\n</td></tr></table>\n\n"; } else { return "\n</div>\n\n"; } break; - case 'item_start': + case "item_start": $html = "\n\t<div"; - $css = $this->getConf('css_item'); + $css = $this->getConf("css_item"); if ($css) { $html .= " class=\"$css\""; } @@ -102,11 +103,11 @@ class Text_Wiki_Render_Xhtml_Toc extends Text_Wiki_Render { $pad = ($level - $this->min); $html .= " style=\"margin-left: {$pad}em;\">"; - $html .= "<a href=\"#$id\">"; + $html .= '<a href="' . $this->getConf("base_url") . "#" . $id . '">'; return $html; break; - case 'item_end': + case "item_end": return "</a></div>"; break; } |
