cvs: phd /themes/php chunkedhtml.php howto.php phpdotnet.php phpfunctions.php phpkdevelop.php phppdf.php

From: Date: Sun, 19 Oct 2008 14:25:39 +0000
Subject: cvs: phd /themes/php chunkedhtml.php howto.php phpdotnet.php phpfunctions.php phpkdevelop.php phppdf.php
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-2261@lists.php.net to get a copy of this message
bjori Sun Oct 19 14:25:39 2008 UTC Modified files: /phd/themes/php howto.php chunkedhtml.php phpdotnet.php phpfunctions.php phpkdevelop.php phppdf.php Log: MFB0.4: Sync all sorts of stuff

http://cvs.php.net/viewvc.cgi/phd/themes/php/howto.php?r1=1.1&r2=1.2&diff_format=u Index: phd/themes/php/howto.php diff -u /dev/null phd/themes/php/howto.php:1.2 --- /dev/null Sun Oct 19 14:25:39 2008 +++ phd/themes/php/howto.php Sun Oct 19 14:25:39 2008 @@ -0,0 +1,44 @@ +<?php +/* $Id: howto.php,v 1.2 2008/10/19 14:25:39 bjori Exp $ */ + +require_once $ROOT . '/themes/php/phpweb.php'; +class howto extends phpweb { + private $tmp = ""; + public function __construct(array $IDs, $filename, $ext = "php") { + phpdotnet::__construct($IDs, array(), $ext, true); + $this->outputdir = PhDConfig::output_dir() . 'howto' . DIRECTORY_SEPARATOR; + if(!file_exists($this->outputdir) || is_file($this->outputdir)) { + mkdir($this->outputdir) or die("Can't create the cache directory"); + } + } + + public function header($id) { + $title = PhDHelper::getDescription($id, true); + $parent = PhDHelper::getParent($id); + $next = $prev = $up = array(null, null); + if ($parent && $parent != "ROOT") { + $siblings = PhDHelper::getChildren($parent); + $prev = phpweb::createPrev($id, $parent, $siblings); + $next = phpweb::createNext($id, $parent, $siblings); + $up = array($parent.".php", PhDHelper::getDescription($parent, false)); + } + + $this->tmp = <<< NAV +<div style="text-align: center;"> + <div class="prev" style="text-align: left; float: left;"><a href="{$prev[0]}">{$prev[1]}</a></div> + <div class="next" style="text-align: right; float: right;"><a href="{$next[0]}">{$next[1]}</a></div> + <div class="up"><a href="{$up[0]}">{$up[1]}</a></div> +</div> +NAV; + return "<?php include_once '../include/init.inc.php'; echo site_header('$title');?>\n" . $this->tmp . "<hr />\n"; + } + public function footer($id) { + return "<hr />\n" . $this->tmp . "<br />\n<?php echo site_footer(); ?>\n"; + } +} + +/* +* vim600: sw=4 ts=4 fdm=syntax syntax=php et +* vim<600: sw=4 ts=4 +*/ + http://cvs.php.net/viewvc.cgi/phd/themes/php/chunkedhtml.php?r1=1.14&r2=1.15&diff_format=u Index: phd/themes/php/chunkedhtml.php diff -u phd/themes/php/chunkedhtml.php:1.14 phd/themes/php/chunkedhtml.php:1.15 --- phd/themes/php/chunkedhtml.php:1.14 Fri Aug 29 11:20:00 2008 +++ phd/themes/php/chunkedhtml.php Sun Oct 19 14:25:39 2008 @@ -1,5 +1,5 @@ <?php -/* $Id: chunkedhtml.php,v 1.14 2008/08/29 11:20:00 bjori Exp $ */ +/* $Id: chunkedhtml.php,v 1.15 2008/10/19 14:25:39 bjori Exp $ */ require_once $ROOT . '/themes/php/phpweb.php'; class chunkedhtml extends phpweb { @@ -33,8 +33,8 @@ $nav = <<<NAV <div class="manualnavbar" style="text-align: center;"> - <div class="prev" style="float: left;"><a href="{$prev[0]}">{$prev[1]}</a></div> - <div class="next" style="float: right;"><a href="{$next[0]}">{$next[1]}</a></div> + <div class="prev" style="text-align: left; float: left;"><a href="{$prev[0]}">{$prev[1]}</a></div> + <div class="next" style="text-align: right; float: right;"><a href="{$next[0]}">{$next[1]}</a></div> <div class="up"><a href="{$up[0]}">{$up[1]}</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div> http://cvs.php.net/viewvc.cgi/phd/themes/php/phpdotnet.php?r1=1.54&r2=1.55&diff_format=u Index: phd/themes/php/phpdotnet.php diff -u phd/themes/php/phpdotnet.php:1.54 phd/themes/php/phpdotnet.php:1.55 --- phd/themes/php/phpdotnet.php:1.54 Wed Jul 23 19:21:31 2008 +++ phd/themes/php/phpdotnet.php Sun Oct 19 14:25:39 2008 @@ -1,10 +1,11 @@ <?php -/* $Id: phpdotnet.php,v 1.54 2008/07/23 19:21:31 bjori Exp $ */ +/* $Id: phpdotnet.php,v 1.55 2008/10/19 14:25:39 bjori Exp $ */ abstract class phpdotnet extends PhDTheme { protected $elementmap = array( 'acronym' => 'format_suppressed_tags', 'function' => 'format_suppressed_tags', + 'classname' => 'format_suppressed_tags', 'link' => 'format_link', 'refpurpose' => 'format_refpurpose', 'title' => array( @@ -33,7 +34,7 @@ 'methodsynopsis' => false, ), 'varname' => array( - /* DEFAULT */ false, + /* DEFAULT */ 'format_suppressed_tags', 'fieldsynopsis' => 'format_fieldsynopsis_varname', ), 'xref' => 'format_link', @@ -67,8 +68,10 @@ 'part' => 'format_container_chunk', 'preface' => 'format_chunk', 'refentry' => 'format_chunk', + 'phpdoc:varentry' => 'format_varentry_chunk', 'reference' => 'format_container_chunk', - 'phpdoc:exception' => 'format_exception_chunk', + 'phpdoc:exceptionref' => 'format_exception_chunk', + 'phpdoc:classref' => 'format_class_chunk', 'sect1' => 'format_chunk', 'sect2' => 'format_chunk', 'sect3' => 'format_chunk', @@ -85,6 +88,11 @@ protected $textmap = array( 'acronym' => 'format_acronym_text', 'function' => 'format_function_text', + 'classname' => 'format_classname_text', + 'varname' => array( + /* DEFAULT */ 'format_varname_text', + 'fieldsynopsis' => false, + ), 'methodname' => array( /* DEFAULT */ 'format_function_text', 'constructorsynopsis' => array( @@ -112,7 +120,11 @@ ), 'refname' => 'format_refname_text', - 'titleabbrev' => 'format_suppressed_tags', + 'titleabbrev' => array( + /* DEFAULT */ 'format_suppressed_tags', + 'phpdoc:classref' => 'format_grep_classname_text', + 'phpdoc:exceptionref' => 'format_grep_classname_text', + ), ); private $versions = array(); private $acronyms = array(); @@ -125,6 +137,7 @@ protected $cchunk = array(); /* Default Chunk settings */ protected $dchunk = array( + "phpdoc:classref" => null, "fieldsynopsis" => array( "modifier" => "public", ), @@ -363,6 +376,23 @@ } return false; } + public function format_varentry_chunk($open, $name, $attrs, $props) { + return $this->format_chunk($open, "refentry", $attrs, $props); + } + public function format_varname_text($value, $tag) { + $var = $value; + if (($pos = strpos($value, "[")) !== false) { + $var = substr($value, 0, $pos); + } + if (($filename = $this->getVarnameLink($var)) !== null && !in_array($var, $this->cchunk["refname"])) { + if ($this->chunked) { + return '<var class="varname"><a href="'.$filename. '.' .$this->ext. '" class="classname">' .$value. '</a></var>'; + } + return '<var><a href="#'.$filename. '" class="classname">'.$value.'</a></var>'; + } + return '<var class="varname">' .$value. '</var>'; + + } public function format_container_chunk($open, $name, $attrs, $props) { $this->CURRENT_ID = $id = $attrs[PhDReader::XMLNS_XML]["id"]; if ($open) { @@ -410,6 +440,9 @@ public function format_exception_chunk($open, $name, $attrs, $props) { return $this->format_container_chunk($open, "reference", $attrs, $props); } + public function format_class_chunk($open, $name, $attrs, $props) { + return $this->format_container_chunk($open, "reference", $attrs, $props); + } public function format_container_chunk_title($open, $name, $attrs) { if ($open) { @@ -456,7 +489,7 @@ } $content .= "</li>"; } - $content .= "</ul>"; + $content .= "</ul></div>"; return $content; } @@ -489,6 +522,20 @@ } return '<b>' .$display_value.($tag == "function" ? "()" : ""). '</b>'; } + + public function format_grep_classname_text($value, $tag) { + $this->cchunk["phpdoc:classref"] = strtolower($value); + } + public function format_classname_text($value, $tag) { + if (($filename = $this->getClassnameLink(strtolower($value))) !== null && $this->cchunk["phpdoc:classref"] !== strtolower($value)) { + if ($this->chunked) { + return '<a href="'.$filename. '.' .$this->ext. '" class="classname">' .$value. '</a>'; + } + return '<a href="#'.$filename. '" class="classname">'.$value.'</a>'; + } + return '<b class="classname">' .$value. '</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"))) { return false; http://cvs.php.net/viewvc.cgi/phd/themes/php/phpfunctions.php?r1=1.2&r2=1.3&diff_format=u Index: phd/themes/php/phpfunctions.php diff -u phd/themes/php/phpfunctions.php:1.2 phd/themes/php/phpfunctions.php:1.3 --- phd/themes/php/phpfunctions.php:1.2 Fri Jul 25 14:04:50 2008 +++ phd/themes/php/phpfunctions.php Sun Oct 19 14:25:39 2008 @@ -81,6 +81,7 @@ gzwrite($gzfile, $this->header($index)); gzwrite($gzfile, $content); gzclose($gzfile); + v("Wrote %s", $this->outputdir . $filename, VERBOSE_CHUNK_WRITING); } } http://cvs.php.net/viewvc.cgi/phd/themes/php/phpkdevelop.php?r1=1.2&r2=1.3&diff_format=u Index: phd/themes/php/phpkdevelop.php diff -u phd/themes/php/phpkdevelop.php:1.2 phd/themes/php/phpkdevelop.php:1.3 --- phd/themes/php/phpkdevelop.php:1.2 Wed Jul 23 19:21:31 2008 +++ phd/themes/php/phpkdevelop.php Sun Oct 19 14:25:39 2008 @@ -47,10 +47,6 @@ /* DEFAULT */ false, 'book' => 'format_tocsect2', ), - 'phpdoc:exception' => array( - /* DEFAULT */ false, - 'book' => 'format_tocsect2', - ), 'refentry' => 'format_refentry', 'refname' => 'format_suppressed_tags', 'refpurpose' => 'format_suppressed_tags', http://cvs.php.net/viewvc.cgi/phd/themes/php/phppdf.php?r1=1.7&r2=1.8&diff_format=u Index: phd/themes/php/phppdf.php diff -u phd/themes/php/phppdf.php:1.7 phd/themes/php/phppdf.php:1.8 --- phd/themes/php/phppdf.php:1.7 Sat Jul 26 16:35:14 2008 +++ phd/themes/php/phppdf.php Sun Oct 19 14:25:39 2008 @@ -1,4 +1,5 @@ <?php +/* $Id: phppdf.php,v 1.8 2008/10/19 14:25:39 bjori Exp $ */ class phppdf extends PhDTheme { @@ -31,10 +32,12 @@ ), 'legalnotice' => 'format_tocnode_newpage', 'part' => 'format_tocnode_newpage', - 'phpdoc:exception' => 'format_tocnode_exception', + 'phpdoc:exceptionref' => 'format_tocnode_exception', + 'phpdoc:classref' => 'format_tocnode_class', 'preface' => 'format_tocnode_newpage', 'refentry' => 'format_tocnode_newpage', 'reference' => 'format_tocnode_newpage', + 'phpdoc:varentry' => 'format_tocnode_newpage', 'sect1' => 'format_tocnode', 'sect2' => 'format_tocnode', 'sect3' => 'format_tocnode', @@ -68,6 +71,12 @@ 'classsynopsis' => false, ), ), + 'titleabbrev' => array( + /* DEFAULT */ 'format_suppressed_tags', + 'phpdoc:classref' => 'format_grep_classname_text', + 'phpdoc:exceptionref' => 'format_grep_classname_text', + ), + ); @@ -82,6 +91,7 @@ protected $cchunk = array(); /* Default Chunk settings */ protected $dchunk = array( + "phpdoc:classref" => null, "bookname" => null, "setname" => null, "toc-root" => null, @@ -180,6 +190,14 @@ public function format_tocnode_exception($open, $name, $attrs, $props) { return $this->format_tocnode($open, "reference", $attrs, $props, true); } + + public function format_tocnode_class($open, $name, $attrs, $props) { + return $this->format_tocnode($open, "reference", $attrs, $props, true); + } + + public function format_grep_classname_text($value, $tag) { + $this->cchunk["phpdoc:classref"] = strtolower($value); + } // Convert the book name to a Unix valid filename protected function toValidName($functionName) { @@ -268,4 +286,9 @@ } return false; } + + public function format_suppressed_tags($open, $name) { + /* Ignore it */ + return ""; + } }
« previous php.doc.cvs (#2261) next »