cvs: phd / build.php mktoc.php package.xml /include PhDHelper.class.php /themes/php phpdotnet.php
| From: | Hannes Magnusson | Date: | Sun, 27 Jan 2008 14:32:33 +0000 |
| Subject: | cvs: phd / build.php mktoc.php package.xml /include PhDHelper.class.php /themes/php phpdotnet.php | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-1085@lists.php.net to get a copy of this message | ||
bjori Sun Jan 27 14:32:33 2008 UTC
Modified files:
/phd package.xml build.php mktoc.php
/phd/include PhDHelper.class.php
/phd/themes/php phpdotnet.php
Log:
Fixed bug#43416 (Function links do not render as links)
http://cvs.php.net/viewvc.cgi/phd/package.xml?r1=1.29&r2=1.30&diff_format=u
Index: phd/package.xml
diff -u phd/package.xml:1.29 phd/package.xml:1.30
--- phd/package.xml:1.29 Sat Jan 26 13:04:56 2008
+++ phd/package.xml Sun Jan 27 14:32:33 2008
@@ -31,6 +31,7 @@
- Fixed bug#43440 (Wrong encoding on some parts of the page)
- Fixed bug#43428 (Empty TOC)
- Fixed bug#43421 (All intra-document hyperlinks broken in the Single HTML file form of manual)
+ - Fixed bug#43416 (Function links do not render as links)
- Added index chaching (Edward Z.)
- Added option (-l/--list) to list the supported formats/themes
</notes>
http://cvs.php.net/viewvc.cgi/phd/build.php?r1=1.41&r2=1.42&diff_format=u
Index: phd/build.php
diff -u phd/build.php:1.41 phd/build.php:1.42
--- phd/build.php:1.41 Thu Jan 10 17:39:38 2008
+++ phd/build.php Sun Jan 27 14:32:33 2008
@@ -1,6 +1,6 @@
#!@php_bin@
<?php
-/* $Id: build.php,v 1.41 2008/01/10 17:39:38 bjori Exp $ */
+/* $Id: build.php,v 1.42 2008/01/27 14:32:33 bjori Exp $ */
$ROOT = "@php_dir@/phd";
if ($ROOT == "@php_dir"."@/phd") {
@@ -58,7 +58,7 @@
}
require $ROOT. "/formats/$output_format.php";
- $format = new $classname($IDs);
+ $format = new $classname(array($IDs, $REFS));
$formatmap = $format->getElementMap();
$formattextmap = $format->getTextMap();
@@ -74,7 +74,7 @@
require_once $ROOT. "/themes/$theme/$themename.php";
switch($theme) {
case "php":
- $themes[$themename] = new $themename($IDs,
+ $themes[$themename] = new $themename(array($IDs, $REFS),
array(
"version" => $OPTIONS["version_info"],
"acronym" => $OPTIONS["acronyms_file"],
@@ -82,7 +82,7 @@
);
break;
default:
- $themes[$themename] = new $themename($IDs);
+ $themes[$themename] = new $themename(array($IDs, $REFS));
}
// WARNING: this needs to go away when we add support for
http://cvs.php.net/viewvc.cgi/phd/mktoc.php?r1=1.7&r2=1.8&diff_format=u
Index: phd/mktoc.php
diff -u phd/mktoc.php:1.7 phd/mktoc.php:1.8
--- phd/mktoc.php:1.7 Mon Oct 22 14:10:35 2007
+++ phd/mktoc.php Sun Jan 27 14:32:33 2008
@@ -1,7 +1,7 @@
<?php
-/* $Id: mktoc.php,v 1.7 2007/10/22 14:10:35 bjori Exp $ */
+/* $Id: mktoc.php,v 1.8 2008/01/27 14:32:33 bjori Exp $ */
$r = new PhDReader($OPTIONS);
-$FILENAMES = array();
+$REFS = $FILENAMES = array();
$CURRENT_FILENAME = $LAST_CHUNK = "";
#FIXME: This is a workaround for the <legalnotice> element in the PHP manual
@@ -12,14 +12,22 @@
if (!($id = $r->getID())) {
$name = $r->name;
if (empty($IDs[$lastid]["sdesc"])) {
- $name = $r->name;
- if ($name == "refname" || $name == "titleabbrev") {
+ if ($name == "refname") {
+ $IDs[$lastid]["sdesc"] = $refname = trim($r->readContent($name));
+ $ref = strtolower(str_replace(array("_", "::",
"->"), array("-", "-", "-"), $refname));
+ $REFS[$ref] = $lastid;
+ continue;
+ }
+ elseif($name == "titleabbrev") {
$IDs[$lastid]["sdesc"] = trim($r->readContent($name));
continue;
}
+ } elseif($name == "refname") {
+ $refname = trim($r->readContent($name));
+ $ref = strtolower(str_replace(array("_", "::", "->"),
array("-", "-", "-"), $refname));
+ $REFS[$ref] = $lastid;
}
if (empty($IDs[$lastid]["ldesc"])) {
- $name = $r->name;
if ($name == "title" || $name == "refpurpose") {
$IDs[$lastid]["ldesc"] = trim($r->readContent($name));
}
http://cvs.php.net/viewvc.cgi/phd/include/PhDHelper.class.php?r1=1.8&r2=1.9&diff_format=u
Index: phd/include/PhDHelper.class.php
diff -u phd/include/PhDHelper.class.php:1.8 phd/include/PhDHelper.class.php:1.9
--- phd/include/PhDHelper.class.php:1.8 Sun Nov 25 13:14:48 2007
+++ phd/include/PhDHelper.class.php Sun Jan 27 14:32:33 2008
@@ -1,14 +1,16 @@
<?php
-/* $Id: PhDHelper.class.php,v 1.8 2007/11/25 13:14:48 bjori Exp $ */
+/* $Id: PhDHelper.class.php,v 1.9 2008/01/27 14:32:33 bjori Exp $ */
class PhDHelper {
private $IDs = array();
+ private $refs = array();
/* abstract */ protected $elementmap = array();
/* abstract */ protected $textmap = array();
private static $autogen = array();
- public function __construct(array $IDs) {
- $this->IDs = $IDs;
+ public function __construct(array $a) {
+ $this->IDs = $a[0];
+ $this->refs = $a[1];
}
final public function getFilename($id) {
return isset($this->IDs[$id]) ? $this->IDs[$id]["filename"] : false;
@@ -24,6 +26,9 @@
final public function getParent($id) {
return $this->IDs[$id]["parent"];
}
+ public function getRefnameLink($ref) {
+ return isset($this->refs[$ref]) ? $this->refs[$ref] : null;
+ }
final public function getElementMap() {
return $this->elementmap;
}
http://cvs.php.net/viewvc.cgi/phd/themes/php/phpdotnet.php?r1=1.37&r2=1.38&diff_format=u
Index: phd/themes/php/phpdotnet.php
diff -u phd/themes/php/phpdotnet.php:1.37 phd/themes/php/phpdotnet.php:1.38
--- phd/themes/php/phpdotnet.php:1.37 Fri Jan 11 19:55:01 2008
+++ phd/themes/php/phpdotnet.php Sun Jan 27 14:32:33 2008
@@ -1,5 +1,5 @@
<?php
-/* $Id: phpdotnet.php,v 1.37 2008/01/11 19:55:01 bjori Exp $ */
+/* $Id: phpdotnet.php,v 1.38 2008/01/27 14:32:33 bjori Exp $ */
abstract class phpdotnet extends PhDTheme {
protected $elementmap = array(
@@ -399,27 +399,14 @@
$display_value = $value;
}
- $link = strtolower(str_replace(array("__", "_", "::",
"->"), array("", "-", "-", "-"), $value));
- $oop_link = strtolower(str_replace(array("_", "::", "->"),
array("", ".", "."), $value));
-
- if (
- (
- $this->CURRENT_FUNCTION === $link ||
- !($filename = PhDHelper::getFilename("function.$link"))
- ) &&
- (
- $this->CURRENT_ID === $oop_link ||
- !($filename = PhDHelper::getFilename($oop_link))
- )
- ) {
- return '<b>' .$display_value.($tag == "function" ?
"()" : ""). '</b>';
- }
-
- if ($this->chunked) {
- return '<a href="'.$filename. '.' .$this->ext.
'" class="function">' .$display_value.($tag == "function" ?
"()" : ""). '</a>';
+ $ref = strtolower(str_replace(array("_", "::", "->"),
array("-", "-", "-"), $value));
+ if (($filename = $this->getRefnameLink($ref)) !== null && $this->CURRENT_ID
!== $filename) {
+ if ($this->chunked) {
+ return '<a href="'.$filename. '.' .$this->ext.
'" class="function">' .$display_value.($tag == "function" ?
"()" : ""). '</a>';
+ }
+ return '<a href="#'.$filename. '"
class="function">' .$display_value.($tag == "function" ? "()"
: ""). '</a>';
}
- return '<a href="#'.$filename. '"
class="function">' .$display_value.($tag == "function" ? "()"
: ""). '</a>';
-
+ return '<b>' .$display_value.($tag == "function" ? "()"
: ""). '</b>';
}
public function format_type_if_object_or_pseudo_text($type, $tagname) {
if (in_array(strtolower($type), array("bool", "int",
"double", "boolean", "integer", "float", "string",
"array", "object", "resource", "null"))) {