cvs: phd(PHD_0_4) / build.php /formats xhtml.php /include PhDFormat.class.php PhDTheme.class.php /themes/pear pearbightml.php peartheme.php
pearweb.php /themes/php bightml.php phpdotnet.php phpfunctions.php
| From: | Christian Weiske | Date: | Tue, 17 Feb 2009 19:04:48 +0000 |
| Subject: | cvs: phd(PHD_0_4) / build.php /formats xhtml.php /include PhDFormat.class.php PhDTheme.class.php /themes/pear pearbightml.php peartheme.php pearweb.php /themes/php bightml.php phpdotnet.php phpfunctions.php |
||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-3299@lists.php.net to get a copy of this message | ||
cweiske Tue Feb 17 19:04:48 2009 UTC
Modified files: (Branch: PHD_0_4)
/phd build.php
/phd/formats xhtml.php
/phd/include PhDFormat.class.php PhDTheme.class.php
/phd/themes/pear pearbightml.php peartheme.php pearweb.php
/phd/themes/php bightml.php phpdotnet.php phpfunctions.php
Log:
Finally fix big bad bug #47413: pear themes don't work when rendered
together at once.
That also fixes bug #47408: Same image directory used for each theme.
http://cvs.php.net/viewvc.cgi/phd/build.php?r1=1.54.2.3.2.3&r2=1.54.2.3.2.4&diff_format=u Index: phd/build.php diff -u phd/build.php:1.54.2.3.2.3 phd/build.php:1.54.2.3.2.4 --- phd/build.php:1.54.2.3.2.3 Mon Feb 16 17:49:36 2009 +++ phd/build.php Tue Feb 17 19:04:47 2009 @@ -1,6 +1,6 @@ #!@php_bin@ <?php -/* $Id: build.php,v 1.54.2.3.2.3 2009/02/16 17:49:36 cweiske Exp $ */ +/* $Id: build.php,v 1.54.2.3.2.4 2009/02/17 19:04:47 cweiske Exp $ */ /* {{{ Find the $ROOT directory of PhD @php_dir@ will be replaced by the pear package manager @@ -24,6 +24,7 @@ require $ROOT. "/include/PhDHelper.class.php"; require $ROOT. "/include/PhDFormat.class.php"; require $ROOT. "/include/PhDTheme.class.php"; +require $ROOT. "/include/PhDThemeXhtml.class.php"; /* {{{ Build the .ser file names to allow multiple sources for PHD. */ $OPTIONS['index_location'] = $OPTIONS['xml_root'] . DIRECTORY_SEPARATOR . '.index_' . basename($OPTIONS['xml_file'], '.xml') . '.ser'; http://cvs.php.net/viewvc.cgi/phd/formats/xhtml.php?r1=1.67.2.2.2.23&r2=1.67.2.2.2.24&diff_format=u Index: phd/formats/xhtml.php diff -u phd/formats/xhtml.php:1.67.2.2.2.23 phd/formats/xhtml.php:1.67.2.2.2.24 --- phd/formats/xhtml.php:1.67.2.2.2.23 Mon Feb 16 17:49:36 2009 +++ phd/formats/xhtml.php Tue Feb 17 19:04:47 2009 @@ -1,5 +1,5 @@ <?php -/* $Id: xhtml.php,v 1.67.2.2.2.23 2009/02/16 17:49:36 cweiske Exp $ */ +/* $Id: xhtml.php,v 1.67.2.2.2.24 2009/02/17 19:04:47 cweiske Exp $ */ class XHTMLPhDFormat extends PhDFormat { protected $elementmap = array( /* {{{ */ @@ -111,7 +111,6 @@ 'glossterm' => 'span', 'holder' => 'span', 'imageobject' => 'format_div', - 'imagedata' => 'format_imagedata', 'important' => 'format_admonition', 'index' => array( /* DEFAULT */ 'format_div', @@ -174,7 +173,6 @@ 'partintro' => 'format_div', 'personname' => 'format_personname', 'personblurb' => 'format_div', - 'phd:toc' => 'format_phd_toc', 'phrase' => 'span', 'preface' => 'format_chunk', 'primaryie' => 'format_suppressed_tags', @@ -371,7 +369,7 @@ public $role = false; /* Current Chunk variables */ - protected $cchunk = array(); + public $cchunk = array(); /* Default Chunk variables */ protected $dchunk = array( "classsynopsis" => array( @@ -445,56 +443,6 @@ } /** - * Creates a table of contents for the given id. - * Also creates nested TOCs if that's wanted ($depth) - * - * @param string $id ID of section for which to generate TOC - * @param string $name Tag name (for ul class) - * @param array $props Build properties (?? FIXME) - * @param integer $depth Depth of TOC - * @param boolean $header If the header shall be shown ("Table of contents") - * - * @return string HTML code for TOC - */ - public function createToc($id, $name, $props, $depth = 1, $header = true) - { - $chunks = PhDHelper::getChildren($id); - if ($depth == 0 || !count($chunks)) { - return ''; - } - - $content = ''; - if ($header) { - $content .= " <strong>" . $this->autogen("toc", $props["lang"]) . "</strong>\n"; - } - $content .= " <ul class=\"chunklist chunklist_$name\">\n"; - foreach ($chunks as $chunkid => $junk) { - $long = $this->TEXT(PhDHelper::getDescription($chunkid, true)); - $short = $this->TEXT(PhDHelper::getDescription($chunkid, false)); - if ($long && $short && $long != $short) { - $desc = $short . '</a> -- ' . $long; - } else { - $desc = ($long ? $long : $short) . '</a>'; - } - //FIXME - if ($this->theme->chunked) { - $content .= " <li><a href=\"{$chunkid}.{$this->theme->ext}\">" . $desc; - } else { - $content .= " <li><a href=\"#{$chunkid}\">" . $this->TEXT(PhDHelper::getDescription($chunkid, false)) . "</a>"; - } - if ($depth > 1) { - $content .= $this->createToc($chunkid, $name, $props, $depth - 1, false); - } - - $content .= "</li>\n";; - } - - $content .= " </ul>\n"; - - return $content; - } - - /** * Closes a para tag when we are already in a paragraph. * * @return string HTML code @@ -1004,20 +952,6 @@ return '</p>'; } - public function format_phd_toc($open, $name, $attrs, $props) { - if ($open) { - return '<div class="phd-toc">'; - } - return $this->createToc( - $attrs[PhDReader::XMLNS_PHD]['element'], - 'phd-toc', - $props, - isset($attrs[PhDReader::XMLNS_PHD]['toc-depth']) - ? (int)$attrs[PhDReader::XMLNS_PHD]['toc-depth'] : 1, - false - ) . "</div>\n"; - } - public function format_segmentedlist($open, $name, $attrs) { $this->cchunk["segmentedlist"] = $this->dchunk["segmentedlist"]; if ($open) { @@ -1235,15 +1169,6 @@ public function format_alt_text($value, $tag) { $this->cchunk["mediaobject"]["alt"] = $value; } - public function format_imagedata($open, $name, $attrs) { - $file = $attrs[PhDReader::XMLNS_DOCBOOK]["fileref"]; - $newpath = $this->theme->mediamanager->handleFile($file); - - if ($this->cchunk["mediaobject"]["alt"] !== false) { - return '<img src="' . $newpath . '" alt="' .$this->cchunk["mediaobject"]["alt"]. '" />'; - } - return '<img src="' . $newpath . '" />'; - } public function format_dl($open, $name, $attrs, $props) { http://cvs.php.net/viewvc.cgi/phd/include/PhDFormat.class.php?r1=1.10.8.2&r2=1.10.8.3&diff_format=u Index: phd/include/PhDFormat.class.php diff -u phd/include/PhDFormat.class.php:1.10.8.2 phd/include/PhDFormat.class.php:1.10.8.3 --- phd/include/PhDFormat.class.php:1.10.8.2 Fri Jan 2 00:39:59 2009 +++ phd/include/PhDFormat.class.php Tue Feb 17 19:04:47 2009 @@ -1,25 +1,15 @@ <?php -/* $Id: PhDFormat.class.php,v 1.10.8.2 2009/01/02 00:39:59 bjori Exp $ */ +/* $Id: PhDFormat.class.php,v 1.10.8.3 2009/02/17 19:04:47 cweiske Exp $ */ abstract class PhDFormat extends PhDHelper { private $TABLE = array(); - /** - * @var PhDTheme - */ - protected $theme = null; - /* abstract functions */ abstract public function transformFromMap($open, $tag, $name, $attrs, $props); abstract public function CDATA($data); abstract public function TEXT($data); abstract public function __call($func, $args); - public function registerTheme(PhDTheme $theme) - { - $this->theme = $theme; - } - /* Table helper functions */ public function tgroup($attrs) { if (isset($attrs["cols"])) { http://cvs.php.net/viewvc.cgi/phd/include/PhDTheme.class.php?r1=1.1.10.2&r2=1.1.10.3&diff_format=u Index: phd/include/PhDTheme.class.php diff -u phd/include/PhDTheme.class.php:1.1.10.2 phd/include/PhDTheme.class.php:1.1.10.3 --- phd/include/PhDTheme.class.php:1.1.10.2 Mon Feb 16 17:49:36 2009 +++ phd/include/PhDTheme.class.php Tue Feb 17 19:04:47 2009 @@ -1,17 +1,10 @@ <?php -/* $Id: PhDTheme.class.php,v 1.1.10.2 2009/02/16 17:49:36 cweiske Exp $ */ +/* $Id: PhDTheme.class.php,v 1.1.10.3 2009/02/17 19:04:47 cweiske Exp $ */ require $ROOT. "/include/PhDMediaManager.class.php"; abstract class PhDTheme extends PhDHelper implements iPhDTheme { protected $format; - /** - * Media manager object - * - * @var PhDMediaManager - */ - public $mediamanager = null; - /** @@ -27,34 +20,16 @@ /** - * Called after the constructor finished. - * This is needed since themes set their outputdir and outputfile - * in the constructor. That file/dir is used for mediamanager. - * That means we cannot instantiate and complete the manager in our - * constructor centrally. + * Overwritten in xhtml themes only. * - * Each theme needs its own media manager, since the manager contains - * the output path. - * - * @return void + * @see PhDThemeXhtml::postConstruct() */ - public function postConstruct() - { - $this->mediamanager = new PhDMediaManager(); - - if (isset($this->outputdir)) { - $this->mediamanager->output_dir = $this->outputdir; - } else { - $this->mediamanager->output_dir = $this->outputfile . '-data/'; - $this->mediamanager->relative_path = basename($this->mediamanager->output_dir) . '/'; - } - }//public function postConstruct() + public function postConstruct() {} public function registerFormat($format) { $this->format = $format; - $this->format->registerTheme($this); } } http://cvs.php.net/viewvc.cgi/phd/themes/pear/pearbightml.php?r1=1.1.6.2.2.2&r2=1.1.6.2.2.3&diff_format=u Index: phd/themes/pear/pearbightml.php diff -u phd/themes/pear/pearbightml.php:1.1.6.2.2.2 phd/themes/pear/pearbightml.php:1.1.6.2.2.3 --- phd/themes/pear/pearbightml.php:1.1.6.2.2.2 Wed Feb 11 20:30:24 2009 +++ phd/themes/pear/pearbightml.php Tue Feb 17 19:04:47 2009 @@ -9,6 +9,13 @@ */ public $outputfile = null; + /** + * We do not generate multiple chunks + * + * @var boolean + */ + public $chunked = false; + public function __construct(array $IDs, $ext = "html") { parent::__construct($IDs, $ext, false); $this->outputfile = $GLOBALS['OPTIONS']['output_dir'] . "pear_manual_{$this->lang}.html"; http://cvs.php.net/viewvc.cgi/phd/themes/pear/peartheme.php?r1=1.8.2.2.2.10&r2=1.8.2.2.2.11&diff_format=u Index: phd/themes/pear/peartheme.php diff -u phd/themes/pear/peartheme.php:1.8.2.2.2.10 phd/themes/pear/peartheme.php:1.8.2.2.2.11 --- phd/themes/pear/peartheme.php:1.8.2.2.2.10 Wed Feb 11 21:33:32 2009 +++ phd/themes/pear/peartheme.php Tue Feb 17 19:04:47 2009 @@ -1,6 +1,6 @@ <?php -abstract class peartheme extends PhDTheme { +abstract class peartheme extends PhDThemeXhtml { protected $elementmap = array( 'acronym' => 'span', 'article' => 'format_container_chunk', @@ -52,6 +52,7 @@ 'glossterm' => 'format_glossterm', 'guimenu' => 'format_guimenu', 'holder' => 'format_holder', + 'imagedata' => 'format_imagedata', 'important' => 'format_admonition', 'info' => array( /* DEFAULT */ false, @@ -106,6 +107,7 @@ 'replaceable' => 'format_replaceable', 'refentry' => 'format_chunk', 'reference' => 'format_container_chunk', + 'phd:toc' => 'format_phd_toc', 'phpdoc:exception' => 'format_exception_chunk', 'refname' => 'h1', 'refnamediv' => 'format_suppressed_tags', @@ -214,7 +216,8 @@ ); /** - * Programlisting role. Necessary to highlight the code properly. + * Programlisting role/type (php, xml, ..). + * Necessary to highlight the code properly. * String when role is set, false if not. * * @var string @@ -224,8 +227,6 @@ */ public $role = false; - public $chunked = true; - /** * File extension string * e.g. ".php" or ".htm" @@ -234,8 +235,6 @@ */ public $ext = null; - protected $lang = 'en'; - /** * If whitespace should be trimmed. * Helpful for programlistings that are encapsulated in <pre> tags @@ -348,7 +347,7 @@ $this->cchunk = $this->dchunk; } - $toc = $this->format->createToc( + $toc = $this->createToc( $id, $name, $props, isset($attrs[PhDReader::XMLNS_PHD]['toc-depth']) ? (int)$attrs[PhDReader::XMLNS_PHD]['toc-depth'] : 1 @@ -388,7 +387,7 @@ return "<div class=\"{$name}\">"; } - $content = $this->format->createToc( + $content = $this->createToc( $id, $name, $props, isset($attrs[PhDReader::XMLNS_PHD]['toc-depth']) ? (int)$attrs[PhDReader::XMLNS_PHD]['toc-depth'] : 1 @@ -472,7 +471,7 @@ return $props["empty"] ? '' : '<h1>'; } $ret = ''; - if ($this->cchunk['container_chunk']) { + if (isset($this->cchunk['container_chunk']) && $this->cchunk['container_chunk']) { $ret = $this->cchunk['container_chunk']; $this->cchunk['container_chunk'] = null; } http://cvs.php.net/viewvc.cgi/phd/themes/pear/pearweb.php?r1=1.1.6.2.2.6&r2=1.1.6.2.2.7&diff_format=u Index: phd/themes/pear/pearweb.php diff -u phd/themes/pear/pearweb.php:1.1.6.2.2.6 phd/themes/pear/pearweb.php:1.1.6.2.2.7 --- phd/themes/pear/pearweb.php:1.1.6.2.2.6 Sun Feb 15 09:54:08 2009 +++ phd/themes/pear/pearweb.php Tue Feb 17 19:04:47 2009 @@ -5,10 +5,15 @@ * PEAR theme for the many php files used for pearweb * * @package PhD -* @version CVS: $Id: pearweb.php,v 1.1.6.2.2.6 2009/02/15 09:54:08 cweiske Exp $ +* @version CVS: $Id: pearweb.php,v 1.1.6.2.2.7 2009/02/17 19:04:47 cweiske Exp $ */ class pearweb extends peartheme { + /** + * Array of file resources + * + * @var array + */ protected $streams = array(); protected $writeit = false; http://cvs.php.net/viewvc.cgi/phd/themes/php/bightml.php?r1=1.11.4.2&r2=1.11.4.3&diff_format=u Index: phd/themes/php/bightml.php diff -u phd/themes/php/bightml.php:1.11.4.2 phd/themes/php/bightml.php:1.11.4.3 --- phd/themes/php/bightml.php:1.11.4.2 Wed Feb 11 20:30:24 2009 +++ phd/themes/php/bightml.php Tue Feb 17 19:04:47 2009 @@ -1,5 +1,5 @@ <?php -/* $Id: bightml.php,v 1.11.4.2 2009/02/11 20:30:24 cweiske Exp $ */ +/* $Id: bightml.php,v 1.11.4.3 2009/02/17 19:04:47 cweiske Exp $ */ require_once $ROOT . '/themes/php/phpdotnet.php'; class bightml extends phpdotnet { @@ -10,6 +10,13 @@ */ public $outputfile = null; + /** + * We do not generate multiple chunks + * + * @var boolean + */ + protected $chunked = false; + public function __construct(array $IDs, $filename, $ext = "html") { parent::__construct($IDs, $filename, $ext, false); $this->outputfile = $GLOBALS['OPTIONS']['output_dir'] . 'bightml.html'; http://cvs.php.net/viewvc.cgi/phd/themes/php/phpdotnet.php?r1=1.53.2.4.2.13&r2=1.53.2.4.2.14&diff_format=u Index: phd/themes/php/phpdotnet.php diff -u phd/themes/php/phpdotnet.php:1.53.2.4.2.13 phd/themes/php/phpdotnet.php:1.53.2.4.2.14 --- phd/themes/php/phpdotnet.php:1.53.2.4.2.13 Sun Feb 15 21:20:37 2009 +++ phd/themes/php/phpdotnet.php Tue Feb 17 19:04:47 2009 @@ -1,7 +1,7 @@ <?php -/* $Id: phpdotnet.php,v 1.53.2.4.2.13 2009/02/15 21:20:37 bjori Exp $ */ +/* $Id: phpdotnet.php,v 1.53.2.4.2.14 2009/02/17 19:04:47 cweiske Exp $ */ -abstract class phpdotnet extends PhDTheme { +abstract class phpdotnet extends PhDThemeXhtml { protected $elementmap = array( 'acronym' => 'format_suppressed_tags', 'function' => 'format_suppressed_tags', @@ -60,6 +60,7 @@ 'book' => 'format_chunk', 'part' => 'format_chunk', ), + 'imagedata' => 'format_imagedata', 'index' => array( /* DEFAULT */ false, 'article' => 'format_chunk', @@ -72,6 +73,7 @@ 'refentry' => 'format_chunk', 'phpdoc:varentry' => 'format_varentry_chunk', 'reference' => 'format_container_chunk', + 'phd:toc' => 'format_phd_toc', 'phpdoc:exceptionref' => 'format_exception_chunk', 'phpdoc:classref' => 'format_class_chunk', 'sect1' => 'format_chunk', @@ -141,8 +143,6 @@ ); private $versions = array(); private $acronyms = array(); - protected $chunked = true; - protected $lang = "en"; /** * Name of the ID currently being processed http://cvs.php.net/viewvc.cgi/phd/themes/php/phpfunctions.php?r1=1.1.2.4.2.2&r2=1.1.2.4.2.3&diff_format=u Index: phd/themes/php/phpfunctions.php diff -u phd/themes/php/phpfunctions.php:1.1.2.4.2.2 phd/themes/php/phpfunctions.php:1.1.2.4.2.3 --- phd/themes/php/phpfunctions.php:1.1.2.4.2.2 Wed Feb 11 05:07:46 2009 +++ phd/themes/php/phpfunctions.php Tue Feb 17 19:04:47 2009 @@ -24,6 +24,12 @@ ); public $role = false; + + /** + * We do generate multiple chunks + * + * @var boolean + */ protected $chunked = true; protected $CURRENT_ID = "";
http://cvs.php.net/viewvc.cgi/phd/build.php?r1=1.54.2.3.2.3&r2=1.54.2.3.2.4&diff_format=u Index: phd/build.php diff -u phd/build.php:1.54.2.3.2.3 phd/build.php:1.54.2.3.2.4 --- phd/build.php:1.54.2.3.2.3 Mon Feb 16 17:49:36 2009 +++ phd/build.php Tue Feb 17 19:04:47 2009 @@ -1,6 +1,6 @@ #!@php_bin@ <?php -/* $Id: build.php,v 1.54.2.3.2.3 2009/02/16 17:49:36 cweiske Exp $ */ +/* $Id: build.php,v 1.54.2.3.2.4 2009/02/17 19:04:47 cweiske Exp $ */ /* {{{ Find the $ROOT directory of PhD @php_dir@ will be replaced by the pear package manager @@ -24,6 +24,7 @@ require $ROOT. "/include/PhDHelper.class.php"; require $ROOT. "/include/PhDFormat.class.php"; require $ROOT. "/include/PhDTheme.class.php"; +require $ROOT. "/include/PhDThemeXhtml.class.php"; /* {{{ Build the .ser file names to allow multiple sources for PHD. */ $OPTIONS['index_location'] = $OPTIONS['xml_root'] . DIRECTORY_SEPARATOR . '.index_' . basename($OPTIONS['xml_file'], '.xml') . '.ser'; http://cvs.php.net/viewvc.cgi/phd/formats/xhtml.php?r1=1.67.2.2.2.23&r2=1.67.2.2.2.24&diff_format=u Index: phd/formats/xhtml.php diff -u phd/formats/xhtml.php:1.67.2.2.2.23 phd/formats/xhtml.php:1.67.2.2.2.24 --- phd/formats/xhtml.php:1.67.2.2.2.23 Mon Feb 16 17:49:36 2009 +++ phd/formats/xhtml.php Tue Feb 17 19:04:47 2009 @@ -1,5 +1,5 @@ <?php -/* $Id: xhtml.php,v 1.67.2.2.2.23 2009/02/16 17:49:36 cweiske Exp $ */ +/* $Id: xhtml.php,v 1.67.2.2.2.24 2009/02/17 19:04:47 cweiske Exp $ */ class XHTMLPhDFormat extends PhDFormat { protected $elementmap = array( /* {{{ */ @@ -111,7 +111,6 @@ 'glossterm' => 'span', 'holder' => 'span', 'imageobject' => 'format_div', - 'imagedata' => 'format_imagedata', 'important' => 'format_admonition', 'index' => array( /* DEFAULT */ 'format_div', @@ -174,7 +173,6 @@ 'partintro' => 'format_div', 'personname' => 'format_personname', 'personblurb' => 'format_div', - 'phd:toc' => 'format_phd_toc', 'phrase' => 'span', 'preface' => 'format_chunk', 'primaryie' => 'format_suppressed_tags', @@ -371,7 +369,7 @@ public $role = false; /* Current Chunk variables */ - protected $cchunk = array(); + public $cchunk = array(); /* Default Chunk variables */ protected $dchunk = array( "classsynopsis" => array( @@ -445,56 +443,6 @@ } /** - * Creates a table of contents for the given id. - * Also creates nested TOCs if that's wanted ($depth) - * - * @param string $id ID of section for which to generate TOC - * @param string $name Tag name (for ul class) - * @param array $props Build properties (?? FIXME) - * @param integer $depth Depth of TOC - * @param boolean $header If the header shall be shown ("Table of contents") - * - * @return string HTML code for TOC - */ - public function createToc($id, $name, $props, $depth = 1, $header = true) - { - $chunks = PhDHelper::getChildren($id); - if ($depth == 0 || !count($chunks)) { - return ''; - } - - $content = ''; - if ($header) { - $content .= " <strong>" . $this->autogen("toc", $props["lang"]) . "</strong>\n"; - } - $content .= " <ul class=\"chunklist chunklist_$name\">\n"; - foreach ($chunks as $chunkid => $junk) { - $long = $this->TEXT(PhDHelper::getDescription($chunkid, true)); - $short = $this->TEXT(PhDHelper::getDescription($chunkid, false)); - if ($long && $short && $long != $short) { - $desc = $short . '</a> -- ' . $long; - } else { - $desc = ($long ? $long : $short) . '</a>'; - } - //FIXME - if ($this->theme->chunked) { - $content .= " <li><a href=\"{$chunkid}.{$this->theme->ext}\">" . $desc; - } else { - $content .= " <li><a href=\"#{$chunkid}\">" . $this->TEXT(PhDHelper::getDescription($chunkid, false)) . "</a>"; - } - if ($depth > 1) { - $content .= $this->createToc($chunkid, $name, $props, $depth - 1, false); - } - - $content .= "</li>\n";; - } - - $content .= " </ul>\n"; - - return $content; - } - - /** * Closes a para tag when we are already in a paragraph. * * @return string HTML code @@ -1004,20 +952,6 @@ return '</p>'; } - public function format_phd_toc($open, $name, $attrs, $props) { - if ($open) { - return '<div class="phd-toc">'; - } - return $this->createToc( - $attrs[PhDReader::XMLNS_PHD]['element'], - 'phd-toc', - $props, - isset($attrs[PhDReader::XMLNS_PHD]['toc-depth']) - ? (int)$attrs[PhDReader::XMLNS_PHD]['toc-depth'] : 1, - false - ) . "</div>\n"; - } - public function format_segmentedlist($open, $name, $attrs) { $this->cchunk["segmentedlist"] = $this->dchunk["segmentedlist"]; if ($open) { @@ -1235,15 +1169,6 @@ public function format_alt_text($value, $tag) { $this->cchunk["mediaobject"]["alt"] = $value; } - public function format_imagedata($open, $name, $attrs) { - $file = $attrs[PhDReader::XMLNS_DOCBOOK]["fileref"]; - $newpath = $this->theme->mediamanager->handleFile($file); - - if ($this->cchunk["mediaobject"]["alt"] !== false) { - return '<img src="' . $newpath . '" alt="' .$this->cchunk["mediaobject"]["alt"]. '" />'; - } - return '<img src="' . $newpath . '" />'; - } public function format_dl($open, $name, $attrs, $props) { http://cvs.php.net/viewvc.cgi/phd/include/PhDFormat.class.php?r1=1.10.8.2&r2=1.10.8.3&diff_format=u Index: phd/include/PhDFormat.class.php diff -u phd/include/PhDFormat.class.php:1.10.8.2 phd/include/PhDFormat.class.php:1.10.8.3 --- phd/include/PhDFormat.class.php:1.10.8.2 Fri Jan 2 00:39:59 2009 +++ phd/include/PhDFormat.class.php Tue Feb 17 19:04:47 2009 @@ -1,25 +1,15 @@ <?php -/* $Id: PhDFormat.class.php,v 1.10.8.2 2009/01/02 00:39:59 bjori Exp $ */ +/* $Id: PhDFormat.class.php,v 1.10.8.3 2009/02/17 19:04:47 cweiske Exp $ */ abstract class PhDFormat extends PhDHelper { private $TABLE = array(); - /** - * @var PhDTheme - */ - protected $theme = null; - /* abstract functions */ abstract public function transformFromMap($open, $tag, $name, $attrs, $props); abstract public function CDATA($data); abstract public function TEXT($data); abstract public function __call($func, $args); - public function registerTheme(PhDTheme $theme) - { - $this->theme = $theme; - } - /* Table helper functions */ public function tgroup($attrs) { if (isset($attrs["cols"])) { http://cvs.php.net/viewvc.cgi/phd/include/PhDTheme.class.php?r1=1.1.10.2&r2=1.1.10.3&diff_format=u Index: phd/include/PhDTheme.class.php diff -u phd/include/PhDTheme.class.php:1.1.10.2 phd/include/PhDTheme.class.php:1.1.10.3 --- phd/include/PhDTheme.class.php:1.1.10.2 Mon Feb 16 17:49:36 2009 +++ phd/include/PhDTheme.class.php Tue Feb 17 19:04:47 2009 @@ -1,17 +1,10 @@ <?php -/* $Id: PhDTheme.class.php,v 1.1.10.2 2009/02/16 17:49:36 cweiske Exp $ */ +/* $Id: PhDTheme.class.php,v 1.1.10.3 2009/02/17 19:04:47 cweiske Exp $ */ require $ROOT. "/include/PhDMediaManager.class.php"; abstract class PhDTheme extends PhDHelper implements iPhDTheme { protected $format; - /** - * Media manager object - * - * @var PhDMediaManager - */ - public $mediamanager = null; - /** @@ -27,34 +20,16 @@ /** - * Called after the constructor finished. - * This is needed since themes set their outputdir and outputfile - * in the constructor. That file/dir is used for mediamanager. - * That means we cannot instantiate and complete the manager in our - * constructor centrally. + * Overwritten in xhtml themes only. * - * Each theme needs its own media manager, since the manager contains - * the output path. - * - * @return void + * @see PhDThemeXhtml::postConstruct() */ - public function postConstruct() - { - $this->mediamanager = new PhDMediaManager(); - - if (isset($this->outputdir)) { - $this->mediamanager->output_dir = $this->outputdir; - } else { - $this->mediamanager->output_dir = $this->outputfile . '-data/'; - $this->mediamanager->relative_path = basename($this->mediamanager->output_dir) . '/'; - } - }//public function postConstruct() + public function postConstruct() {} public function registerFormat($format) { $this->format = $format; - $this->format->registerTheme($this); } } http://cvs.php.net/viewvc.cgi/phd/themes/pear/pearbightml.php?r1=1.1.6.2.2.2&r2=1.1.6.2.2.3&diff_format=u Index: phd/themes/pear/pearbightml.php diff -u phd/themes/pear/pearbightml.php:1.1.6.2.2.2 phd/themes/pear/pearbightml.php:1.1.6.2.2.3 --- phd/themes/pear/pearbightml.php:1.1.6.2.2.2 Wed Feb 11 20:30:24 2009 +++ phd/themes/pear/pearbightml.php Tue Feb 17 19:04:47 2009 @@ -9,6 +9,13 @@ */ public $outputfile = null; + /** + * We do not generate multiple chunks + * + * @var boolean + */ + public $chunked = false; + public function __construct(array $IDs, $ext = "html") { parent::__construct($IDs, $ext, false); $this->outputfile = $GLOBALS['OPTIONS']['output_dir'] . "pear_manual_{$this->lang}.html"; http://cvs.php.net/viewvc.cgi/phd/themes/pear/peartheme.php?r1=1.8.2.2.2.10&r2=1.8.2.2.2.11&diff_format=u Index: phd/themes/pear/peartheme.php diff -u phd/themes/pear/peartheme.php:1.8.2.2.2.10 phd/themes/pear/peartheme.php:1.8.2.2.2.11 --- phd/themes/pear/peartheme.php:1.8.2.2.2.10 Wed Feb 11 21:33:32 2009 +++ phd/themes/pear/peartheme.php Tue Feb 17 19:04:47 2009 @@ -1,6 +1,6 @@ <?php -abstract class peartheme extends PhDTheme { +abstract class peartheme extends PhDThemeXhtml { protected $elementmap = array( 'acronym' => 'span', 'article' => 'format_container_chunk', @@ -52,6 +52,7 @@ 'glossterm' => 'format_glossterm', 'guimenu' => 'format_guimenu', 'holder' => 'format_holder', + 'imagedata' => 'format_imagedata', 'important' => 'format_admonition', 'info' => array( /* DEFAULT */ false, @@ -106,6 +107,7 @@ 'replaceable' => 'format_replaceable', 'refentry' => 'format_chunk', 'reference' => 'format_container_chunk', + 'phd:toc' => 'format_phd_toc', 'phpdoc:exception' => 'format_exception_chunk', 'refname' => 'h1', 'refnamediv' => 'format_suppressed_tags', @@ -214,7 +216,8 @@ ); /** - * Programlisting role. Necessary to highlight the code properly. + * Programlisting role/type (php, xml, ..). + * Necessary to highlight the code properly. * String when role is set, false if not. * * @var string @@ -224,8 +227,6 @@ */ public $role = false; - public $chunked = true; - /** * File extension string * e.g. ".php" or ".htm" @@ -234,8 +235,6 @@ */ public $ext = null; - protected $lang = 'en'; - /** * If whitespace should be trimmed. * Helpful for programlistings that are encapsulated in <pre> tags @@ -348,7 +347,7 @@ $this->cchunk = $this->dchunk; } - $toc = $this->format->createToc( + $toc = $this->createToc( $id, $name, $props, isset($attrs[PhDReader::XMLNS_PHD]['toc-depth']) ? (int)$attrs[PhDReader::XMLNS_PHD]['toc-depth'] : 1 @@ -388,7 +387,7 @@ return "<div class=\"{$name}\">"; } - $content = $this->format->createToc( + $content = $this->createToc( $id, $name, $props, isset($attrs[PhDReader::XMLNS_PHD]['toc-depth']) ? (int)$attrs[PhDReader::XMLNS_PHD]['toc-depth'] : 1 @@ -472,7 +471,7 @@ return $props["empty"] ? '' : '<h1>'; } $ret = ''; - if ($this->cchunk['container_chunk']) { + if (isset($this->cchunk['container_chunk']) && $this->cchunk['container_chunk']) { $ret = $this->cchunk['container_chunk']; $this->cchunk['container_chunk'] = null; } http://cvs.php.net/viewvc.cgi/phd/themes/pear/pearweb.php?r1=1.1.6.2.2.6&r2=1.1.6.2.2.7&diff_format=u Index: phd/themes/pear/pearweb.php diff -u phd/themes/pear/pearweb.php:1.1.6.2.2.6 phd/themes/pear/pearweb.php:1.1.6.2.2.7 --- phd/themes/pear/pearweb.php:1.1.6.2.2.6 Sun Feb 15 09:54:08 2009 +++ phd/themes/pear/pearweb.php Tue Feb 17 19:04:47 2009 @@ -5,10 +5,15 @@ * PEAR theme for the many php files used for pearweb * * @package PhD -* @version CVS: $Id: pearweb.php,v 1.1.6.2.2.6 2009/02/15 09:54:08 cweiske Exp $ +* @version CVS: $Id: pearweb.php,v 1.1.6.2.2.7 2009/02/17 19:04:47 cweiske Exp $ */ class pearweb extends peartheme { + /** + * Array of file resources + * + * @var array + */ protected $streams = array(); protected $writeit = false; http://cvs.php.net/viewvc.cgi/phd/themes/php/bightml.php?r1=1.11.4.2&r2=1.11.4.3&diff_format=u Index: phd/themes/php/bightml.php diff -u phd/themes/php/bightml.php:1.11.4.2 phd/themes/php/bightml.php:1.11.4.3 --- phd/themes/php/bightml.php:1.11.4.2 Wed Feb 11 20:30:24 2009 +++ phd/themes/php/bightml.php Tue Feb 17 19:04:47 2009 @@ -1,5 +1,5 @@ <?php -/* $Id: bightml.php,v 1.11.4.2 2009/02/11 20:30:24 cweiske Exp $ */ +/* $Id: bightml.php,v 1.11.4.3 2009/02/17 19:04:47 cweiske Exp $ */ require_once $ROOT . '/themes/php/phpdotnet.php'; class bightml extends phpdotnet { @@ -10,6 +10,13 @@ */ public $outputfile = null; + /** + * We do not generate multiple chunks + * + * @var boolean + */ + protected $chunked = false; + public function __construct(array $IDs, $filename, $ext = "html") { parent::__construct($IDs, $filename, $ext, false); $this->outputfile = $GLOBALS['OPTIONS']['output_dir'] . 'bightml.html'; http://cvs.php.net/viewvc.cgi/phd/themes/php/phpdotnet.php?r1=1.53.2.4.2.13&r2=1.53.2.4.2.14&diff_format=u Index: phd/themes/php/phpdotnet.php diff -u phd/themes/php/phpdotnet.php:1.53.2.4.2.13 phd/themes/php/phpdotnet.php:1.53.2.4.2.14 --- phd/themes/php/phpdotnet.php:1.53.2.4.2.13 Sun Feb 15 21:20:37 2009 +++ phd/themes/php/phpdotnet.php Tue Feb 17 19:04:47 2009 @@ -1,7 +1,7 @@ <?php -/* $Id: phpdotnet.php,v 1.53.2.4.2.13 2009/02/15 21:20:37 bjori Exp $ */ +/* $Id: phpdotnet.php,v 1.53.2.4.2.14 2009/02/17 19:04:47 cweiske Exp $ */ -abstract class phpdotnet extends PhDTheme { +abstract class phpdotnet extends PhDThemeXhtml { protected $elementmap = array( 'acronym' => 'format_suppressed_tags', 'function' => 'format_suppressed_tags', @@ -60,6 +60,7 @@ 'book' => 'format_chunk', 'part' => 'format_chunk', ), + 'imagedata' => 'format_imagedata', 'index' => array( /* DEFAULT */ false, 'article' => 'format_chunk', @@ -72,6 +73,7 @@ 'refentry' => 'format_chunk', 'phpdoc:varentry' => 'format_varentry_chunk', 'reference' => 'format_container_chunk', + 'phd:toc' => 'format_phd_toc', 'phpdoc:exceptionref' => 'format_exception_chunk', 'phpdoc:classref' => 'format_class_chunk', 'sect1' => 'format_chunk', @@ -141,8 +143,6 @@ ); private $versions = array(); private $acronyms = array(); - protected $chunked = true; - protected $lang = "en"; /** * Name of the ID currently being processed http://cvs.php.net/viewvc.cgi/phd/themes/php/phpfunctions.php?r1=1.1.2.4.2.2&r2=1.1.2.4.2.3&diff_format=u Index: phd/themes/php/phpfunctions.php diff -u phd/themes/php/phpfunctions.php:1.1.2.4.2.2 phd/themes/php/phpfunctions.php:1.1.2.4.2.3 --- phd/themes/php/phpfunctions.php:1.1.2.4.2.2 Wed Feb 11 05:07:46 2009 +++ phd/themes/php/phpfunctions.php Tue Feb 17 19:04:47 2009 @@ -24,6 +24,12 @@ ); public $role = false; + + /** + * We do generate multiple chunks + * + * @var boolean + */ protected $chunked = true; protected $CURRENT_ID = "";