cvs: phd(PHD_0_4) /formats xhtml.php

From: Date: Thu, 01 Jan 2009 21:22:44 +0000
Subject: cvs: phd(PHD_0_4) /formats xhtml.php
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-2903@lists.php.net to get a copy of this message
bjori Thu Jan 1 21:22:44 2009 UTC Modified files: (Branch: PHD_0_4) /phd/formats xhtml.php Log: Fix variablelist/varlistentry/listitem validation issues http://cvs.php.net/viewvc.cgi/phd/formats/xhtml.php?r1=1.67.2.2.2.8&r2=1.67.2.2.2.9&diff_format=u Index: phd/formats/xhtml.php diff -u phd/formats/xhtml.php:1.67.2.2.2.8 phd/formats/xhtml.php:1.67.2.2.2.9 --- phd/formats/xhtml.php:1.67.2.2.2.8 Sun Dec 28 16:20:18 2008 +++ phd/formats/xhtml.php Thu Jan 1 21:22:43 2009 @@ -1,5 +1,5 @@ <?php -/* $Id: xhtml.php,v 1.67.2.2.2.8 2008/12/28 16:20:18 bjori Exp $ */ +/* $Id: xhtml.php,v 1.67.2.2.2.9 2009/01/01 21:22:43 bjori Exp $ */ class XHTMLPhDFormat extends PhDFormat { protected $elementmap = array( /* {{{ */ @@ -398,6 +398,9 @@ "tablefootnotes" => array( ), "chunk_id" => null, + "varlistentry" => array( + "listitems" => array(), + ), ); public function __construct(array $IDs) { @@ -662,14 +665,17 @@ case "methodsynopsis": case "constructorsynopsis": case "destructorsynopsis": + ++$this->openPara; return '<p class="'.$name.' rdfs-comment">'; break; default: + ++$this->openPara; return '<p class="'.$name.'">'; } } + --$this->openPara; return '</p>'; } public function format_refsect($open, $name, $attrs) { @@ -986,6 +992,7 @@ ++$this->openPara; return '<p class="' . $name . '">'; } + --$this->openPara; return '</p>'; } @@ -1055,13 +1062,19 @@ } public function format_varlistentry($open, $name, $attrs) { if ($open) { - return isset($attrs[PhDReader::XMLNS_XML]["id"]) ? '<dt id="'.$attrs[PhDReader::XMLNS_XML]["id"]. '">' : "<dt>\n"; + return isset($attrs[PhDReader::XMLNS_XML]["id"]) ? '<dt id="'.$attrs[PhDReader::XMLNS_XML]["id"]. '" class="varlistentry">' : "<dt class=\"varlistentry\">\n"; + } + + // Listitems close the the dt themselfs + if ($this->cchunk["varlistentry"]["listitems"] && array_pop($this->cchunk["varlistentry"]["listitems"])) { + return ""; } return "</dt>\n"; } public function format_varlistentry_listitem($open, $name, $attrs) { if ($open) { - return "<dd>\n"; + $this->cchunk["varlistentry"]["listitems"][] = 1; + return "</dt><dd class=\"listitem\">\n"; } return "</dd>\n"; }

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