cvs: phd /phpdotnet/phd Index.php
| From: | Moacir de Oliveira Miranda Júnior | Date: | Mon, 29 Jun 2009 11:31:12 +0000 |
| Subject: | cvs: phd /phpdotnet/phd Index.php | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-4274@lists.php.net to get a copy of this message | ||
moacir Mon Jun 29 11:31:12 2009 UTC
Modified files:
/phd/phpdotnet/phd Index.php
Log:
working with phd:chunk
http://cvs.php.net/viewvc.cgi/phd/phpdotnet/phd/Index.php?r1=1.5&r2=1.6&diff_format=u
Index: phd/phpdotnet/phd/Index.php
diff -u phd/phpdotnet/phd/Index.php:1.5 phd/phpdotnet/phd/Index.php:1.6
--- phd/phpdotnet/phd/Index.php:1.5 Sat Jun 20 06:55:41 2009
+++ phd/phpdotnet/phd/Index.php Mon Jun 29 11:31:12 2009
@@ -63,10 +63,12 @@
'refpurpose' => 'format_ldesc',
'refname' => 'format_sdesc',
'titleabbrev' => 'format_sdesc',
+
);
private $mytextmap = array(
);
private $chunks = array();
+ private $isChunk = array();
private $previousId = "";
public function transformFromMap($open, $tag, $name, $attrs, $props) {
@@ -195,8 +197,12 @@
$lastChunkId = array_pop($this->ids);
$parentid = end($this->ids);
-
$this->currentid = $parentid;
+
+ if (!$isChunk) {
+ return false;
+ }
+
$lastChunk = $this->nfo[$lastChunkId];
if (is_array($lastChunk["sdesc"])) {
$array = true;
@@ -205,6 +211,7 @@
$array = false;
$sdesc = $lastChunk["sdesc"];
}
+
$this->commit .= sprintf(
"INSERT INTO ids (docbook_id, filename, parent_id, sdesc, ldesc, element,
previous, next) VALUES('%s', '%s', '%s', '%s',
'%s', '%s', '%s', '');\n",
$this->db->escapeString($lastChunkId),
@@ -229,6 +236,7 @@
);
}
}
+
}
public function format_section_chunk($open, $name, $attrs, $props) {
@@ -265,20 +273,24 @@
} else {
$id = uniqid("phd");
}
- $this->chunks[] = $id;
- $this->currentchunk = $id;
- $this->storeInfo($name, $id, $id);
-
- $this->notify(Render::CHUNK, Render::OPEN);
+ $this->isChunk[] = isset($attrs[Reader::XMLNS_PHD]['chunk'])
+ ? $attrs[Reader::XMLNS_PHD]['chunk'] == "true" : true;
+ if (end($this->isChunk)) {
+ $this->chunks[] = $id;
+ $this->currentchunk = $id;
+ $this->storeInfo($name, $id, $id);
+ $this->notify(Render::CHUNK, Render::OPEN);
+ }
return false;
}
- array_pop($this->chunks);
- $this->currentchunk = end($this->chunks);
-
- $this->notify(Render::CHUNK, Render::CLOSE);
-
- $this->appendID();
+ if (array_pop($this->isChunk)) {
+ array_pop($this->chunks);
+ $this->currentchunk = end($this->chunks);
+ $this->appendID();
+ $this->notify(Render::CHUNK, Render::CLOSE);
+ }
+
return false;
}
public function format_legalnotice_chunk($open, $name, $attrs, $props) {