cvs: phd /themes/php phpdotnet.php

From: Date: Thu, 11 Oct 2007 08:07:51 +0000
Subject: cvs: phd /themes/php phpdotnet.php
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-184@lists.php.net to get a copy of this message
bjori Thu Oct 11 08:07:51 2007 UTC Modified files: /phd/themes/php phpdotnet.php Log: Fixed bug#42906 (docs.php.net bold instead of links) http://cvs.php.net/viewvc.cgi/phd/themes/php/phpdotnet.php?r1=1.25&r2=1.26&diff_format=u Index: phd/themes/php/phpdotnet.php diff -u phd/themes/php/phpdotnet.php:1.25 phd/themes/php/phpdotnet.php:1.26 --- phd/themes/php/phpdotnet.php:1.25 Thu Oct 4 20:06:56 2007 +++ phd/themes/php/phpdotnet.php Thu Oct 11 08:07:51 2007 @@ -1,5 +1,5 @@ <?php -/* $Id: phpdotnet.php,v 1.25 2007/10/04 20:06:56 bjori Exp $ */ +/* $Id: phpdotnet.php,v 1.26 2007/10/11 08:07:51 bjori Exp $ */ class phpdotnet extends PhDHelper { protected $elementmap = array( @@ -98,6 +98,7 @@ protected $lang = "en"; protected $CURRENT_ID = ""; + protected $CURRENT_FUNCTION = null; protected $refname; public function __construct(array $IDs, array $filenames, $ext = "php", $chunked = true) { @@ -226,7 +227,15 @@ } public function format_chunk($open, $name, $attrs, $props) { if (isset($attrs[PhDReader::XMLNS_XML]["id"])) { - $this->CURRENT_ID = $attrs[PhDReader::XMLNS_XML]["id"]; + $this->CURRENT_ID = $id = $attrs[PhDReader::XMLNS_XML]["id"]; + if ($name == "refentry") { + if(strpos($id, "function.") !== false) { + $id = substr($id, 9); + } + $this->CURRENT_FUNCTION = $id; + } else { + $this->CURRENT_FUNCTION = null; + } } if ($props["isChunk"]) { $this->tmp["chunk"] = array("examples" => 0); @@ -238,6 +247,7 @@ } public function format_container_chunk($open, $name, $attrs, $props) { $this->CURRENT_ID = $id = $attrs[PhDReader::XMLNS_XML]["id"]; + $this->CURRENT_FUNCTION = null; if ($open) { if ($props["isChunk"]) { $this->tmp["chunk"] = array("examples" => 0); @@ -285,6 +295,7 @@ } public function format_root_chunk($open, $name, $attrs) { $this->CURRENT_ID = $id = $attrs[PhDReader::XMLNS_XML]["id"]; + $this->CURRENT_FUNCTION = null; if ($open) { return "<div>"; } @@ -329,7 +340,7 @@ public function format_function_text($value, $tag) { $link = strtolower(str_replace(array("__", "_", "::", "->"), array("", "-", "-", "-"), $value)); - if (!substr_compare($this->CURRENT_ID, $link, -strlen($link)) || !($filename = PhDHelper::getFilename("function.$link"))) { + if ($this->CURRENT_FUNCTION === $link || !($filename = PhDHelper::getFilename("function.$link"))) { return sprintf("<b>%s%s</b>", $value, $tag == "function" ? "()" : ""); }

« previous php.doc.cvs (#184) next »