cvs: phd(PHD_0_4) /include PhDReader.class.php PhDTheme.class.php
| From: | Christian Weiske | Date: | Fri, 07 Nov 2008 22:16:42 +0000 |
| Subject: | cvs: phd(PHD_0_4) /include PhDReader.class.php PhDTheme.class.php | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-2469@lists.php.net to get a copy of this message | ||
cweiske Fri Nov 7 22:16:42 2008 UTC
Modified files: (Branch: PHD_0_4)
/phd/include PhDTheme.class.php PhDReader.class.php
Log:
Merge from head:
- register theme in format
- phd:chunk="true" attribute for sections
http://cvs.php.net/viewvc.cgi/phd/include/PhDTheme.class.php?r1=1.1&r2=1.1.10.1&diff_format=u
Index: phd/include/PhDTheme.class.php
diff -u phd/include/PhDTheme.class.php:1.1 phd/include/PhDTheme.class.php:1.1.10.1
--- phd/include/PhDTheme.class.php:1.1 Sun Nov 25 20:29:30 2007
+++ phd/include/PhDTheme.class.php Fri Nov 7 22:16:42 2008
@@ -1,10 +1,11 @@
<?php
-/* $Id: PhDTheme.class.php,v 1.1 2007/11/25 20:29:30 bjori Exp $ */
+/* $Id: PhDTheme.class.php,v 1.1.10.1 2008/11/07 22:16:42 cweiske Exp $ */
abstract class PhDTheme extends PhDHelper implements iPhDTheme {
protected $format;
public function registerFormat($format) {
$this->format = $format;
+ $this->format->registerTheme($this);
}
}
http://cvs.php.net/viewvc.cgi/phd/include/PhDReader.class.php?r1=1.16.4.2&r2=1.16.4.3&diff_format=u
Index: phd/include/PhDReader.class.php
diff -u phd/include/PhDReader.class.php:1.16.4.2 phd/include/PhDReader.class.php:1.16.4.3
--- phd/include/PhDReader.class.php:1.16.4.2 Sun Oct 19 16:40:53 2008
+++ phd/include/PhDReader.class.php Fri Nov 7 22:16:42 2008
@@ -1,5 +1,5 @@
<?php
-/* $Id: PhDReader.class.php,v 1.16.4.2 2008/10/19 16:40:53 bjori Exp $ */
+/* $Id: PhDReader.class.php,v 1.16.4.3 2008/11/07 22:16:42 cweiske Exp $ */
//6271
class PhDReader extends XMLReader {
@@ -110,6 +110,21 @@
return "";
} /* }}} */
+ /**
+ * Check if the element wants to be chunked.
+ * Reads the element's 'phd:chunk="true"' attribute
+ *
+ * @return boolean true if the element shall be chunked
+ */
+ public function getWantsToBeChunked() { /* {{{ */
+ if ($this->hasAttributes && XMLReader::moveToAttributeNs("chunk",
self::XMLNS_PHD)) {
+ $isChunk = $this->value == 'true';
+ XMLReader::moveToElement();
+ return $isChunk;
+ }
+ return false;
+ } /* }}} */
+
public function getParentTagName() { /* {{{ */
return $this->STACK[$this->depth-1];
} /* }}} */
@@ -206,6 +221,8 @@
public function isChunk($tag, $id) { /* {{{ */
if (!$id) {
return false;
+ } else if ($this->getWantsToBeChunked()) {
+ return true;
} else if (isset($this->CHUNK_ME[$tag])) {
$isChunk = $this->CHUNK_ME[$tag];
if (is_array($isChunk)) {
@@ -219,7 +236,7 @@
return false;
} /* }}} */
public function isSectionChunk($tag) { /* {{{ */
- if ($this->PREVIOUS_SIBLING == $tag && $this->checkSectionDepth()) {
+ if ($this->checkSectionDepth()) {
return true;
}
return false;