cvs: phd(PHD_0_4) /include PhDFormat.class.php

From: Date: Fri, 02 Jan 2009 00:39:59 +0000
Subject: cvs: phd(PHD_0_4) /include PhDFormat.class.php
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-2913@lists.php.net to get a copy of this message
bjori Fri Jan 2 00:39:59 2009 UTC Modified files: (Branch: PHD_0_4) /phd/include PhDFormat.class.php Log: Fixed bug#45570 (PhD doesn't use the <colspec> "align" attribute in xhtml output) http://cvs.php.net/viewvc.cgi/phd/include/PhDFormat.class.php?r1=1.10.8.1&r2=1.10.8.2&diff_format=u Index: phd/include/PhDFormat.class.php diff -u phd/include/PhDFormat.class.php:1.10.8.1 phd/include/PhDFormat.class.php:1.10.8.2 --- phd/include/PhDFormat.class.php:1.10.8.1 Fri Nov 7 22:13:17 2008 +++ phd/include/PhDFormat.class.php Fri Jan 2 00:39:59 2009 @@ -1,5 +1,5 @@ <?php -/* $Id: PhDFormat.class.php,v 1.10.8.1 2008/11/07 22:13:17 cweiske Exp $ */ +/* $Id: PhDFormat.class.php,v 1.10.8.2 2009/01/02 00:39:59 bjori Exp $ */ abstract class PhDFormat extends PhDHelper { private $TABLE = array(); @@ -31,17 +31,28 @@ $this->TABLE["colspec"] = array(); } public function colspec(array $attrs) { - $colspec = self::getColSpec($attrs); + $colspec = self::getColspec($attrs, false); $this->TABLE["colspec"][$colspec["colnum"]] = $colspec; return $colspec; } - public function getColspec(array $attrs) { + public function getColspec(array $attrs, $forRow = true) { /* defaults */ - $defaults["colname"] = count($this->TABLE["colspec"])+1; - $defaults["colnum"] = count($this->TABLE["colspec"])+1; - $defaults["align"] = "left"; - - return array_merge($defaults, $this->TABLE["defaults"], $attrs); + $defaults = array( + "colname" => count($this->TABLE["colspec"])+1, + "colnum" => count($this->TABLE["colspec"])+1, + "align" => "left", + ); + + $retval = array_merge($defaults, $this->TABLE["defaults"], $attrs); + if ($forRow) { + foreach($this->TABLE["colspec"] as $colspec) { + if ($colspec["colname"] == $retval["colname"]) { + $retval = array_merge($retval, $colspec); + break; + } + } + } + return $retval; } public function getColCount() { return $this->TABLE["cols"];

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