livedocs fixes
| From: | Alan Knowles | Date: | Tue, 05 Jul 2005 15:35:54 +0000 |
| Subject: | livedocs fixes | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-6451@lists.php.net to get a copy of this message | ||
I just managed to set up livedocs for pear again.. the changes required
are pretty minimal now.
- follow the instructions in the README for livedocs
- before running build.sh
-- change the toc.xsl for
http://www.akbkhome.com/svn/akpear/LiveDocs/toc.xsl
- run build.sh
- add this line to config.php in the installed target.
define('ROOT_NODE','guide');
- Make the changes below from the patch
And livedocs appears infront of your eyes.. - would be nice to pass this
back up the tree.. - anyone know whos maintaining livedocs at the
moment..
Regards
Alan
Index: livedoc_funcs.php
===================================================================
RCS file: /repository/livedocs/livedoc_funcs.php,v
retrieving revision 1.28
diff -u -b -r1.28 livedoc_funcs.php
--- livedoc_funcs.php 18 Jun 2005 02:03:19 -0000 1.28
+++ livedoc_funcs.php 5 Jul 2005 15:24:59 -0000
@@ -54,9 +55,10 @@
/* Get parent ID and child IDs */
/* - first we get the first three parts of the path */
- $last_item = 'manual';
+ $last_item = ROOT_NODE;
$head_class = 'header home';
- if (($r = sqlite_single_query($idx, "SELECT path FROM toc WHERE
docbook_id = '$current_page' LIMIT 1"))) {
+ $r = sqlite_single_query($idx, "SELECT path FROM toc WHERE
docbook_id = '$current_page' LIMIT 1");
+ if ($r && strlen($r) > 1) {
$path = explode(",", $r);
foreach ($path as $item) {
$nav .= do_nav_line($item, $head_class,
$current_page, $lang, $dummy);
@@ -64,9 +66,8 @@
$head_class = 'header up';
}
} else {
- $nav .= do_nav_line('manual', 'up', $current_page,
$lang, $dummy);
+ $nav .= do_nav_line(ROOT_NODE, 'up', $current_page,
$lang, $dummy);
}
-
$after_child_class = '';
/* With $last_item we're going to show all brothers */
$r = (array) sqlite_single_query($idx, "SELECT docbook_id FROM
toc WHERE parent_docbook_id = '$last_item' ORDER BY id");
@@ -94,7 +95,7 @@
}
function do_nav_children($idx, $parent, $lang, $current_page, &$nav, &
$children) {
- if ($current_page != 'manual' ) {
+ if ($current_page != ROOT_NODE ) {
$rsub = (array) sqlite_single_query($idx, "SELECT
docbook_id FROM toc WHERE parent_docbook_id = '$current_page' ORDER BY
id");
foreach ($rsub as $valsub) {
$nav .= do_nav_line($valsub, 'downdown',
$current_page, $lang, $title);
@@ -140,7 +141,7 @@
$hash = "";
}
- if ($firstid == 'manual') {
+ if ($firstid == ROOT_NODE) {
$firstid = $ref;
$hash = '';
}
@@ -451,7 +451,7 @@
$curr_lvl = sqlite_single_query($GLOBALS['idx'], "SELECT lvl
from toc where docbook_id='$current_page'");
- list($row) = sqlite_array_query($GLOBALS['idx'], "SELECT
idents.id, lvl from ents left join files on ents.value = files.filename
left join idents on files.fileid = idents.fileid left join toc on
ents.entid=toc.docbook_id where is_file=1 and ents.entid='$ref' limit
1");
+ @list($row) = sqlite_array_query($GLOBALS['idx'], "SELECT
idents.id, lvl from ents left join files on ents.value = files.filename
left join idents on files.fileid = idents.fileid left join toc on
ents.entid=toc.docbook_id where is_file=1 and ents.entid='$ref' limit
1");
list($id, $lvl) = $row;
$filename = sqlite_single_query($GLOBALS['idx'], "SELECT value
from ents where entid='$ref' and is_file=1");