iliaa           Wed Jul  6 12:17:32 2005 EDT

  Modified files:              
    /livedocs   config.php.in livedoc_funcs.php style_mapping.php 
  Log:
  Make root-node dependant on doc type.
  Fixed type in style mapping introduced by previous patch.
  
  
http://cvs.php.net/diff.php/livedocs/config.php.in?r1=1.11&r2=1.12&ty=u
Index: livedocs/config.php.in
diff -u livedocs/config.php.in:1.11 livedocs/config.php.in:1.12
--- livedocs/config.php.in:1.11 Wed Feb  9 17:16:00 2005
+++ livedocs/config.php.in      Wed Jul  6 12:17:31 2005
@@ -19,7 +19,7 @@
 // | the ./configure call                                                 |
 // +----------------------------------------------------------------------+
 //
-// $Id: config.php.in,v 1.11 2005/02/09 22:16:00 iliaa Exp $
+// $Id: config.php.in,v 1.12 2005/07/06 16:17:31 iliaa Exp $
 
 define('FALLBACK_LANG', 'en');
 define('PHPDOC', '@PHPDOC@');
@@ -31,3 +31,11 @@
 define('LANGUAGES', '@LANGUAGES@');
 define('THEME_NAME', '@THEMENAME@');
 define('BUILD_TYPE', '@BUILDTYPE@');
+
+switch(BUILD_TYPE) {
+       case 'peardoc':
+               define('ROOT_NODE', 'guide');
+               break;
+       default:
+               define('ROOT_NODE', 'manual');
+}
http://cvs.php.net/diff.php/livedocs/livedoc_funcs.php?r1=1.28&r2=1.29&ty=u
Index: livedocs/livedoc_funcs.php
diff -u livedocs/livedoc_funcs.php:1.28 livedocs/livedoc_funcs.php:1.29
--- livedocs/livedoc_funcs.php:1.28     Fri Jun 17 22:03:19 2005
+++ livedocs/livedoc_funcs.php  Wed Jul  6 12:17:31 2005
@@ -54,7 +54,7 @@
        
        /* 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"))) {
                $path = explode(",", $r);
@@ -64,7 +64,7 @@
                        $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 = '';
@@ -94,7 +94,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 +140,7 @@
                $hash = "";
        }
 
-       if ($firstid == 'manual') {
+       if ($firstid == ROOT_NODE) {
                $firstid = $ref;
                $hash = '';
        }
http://cvs.php.net/diff.php/livedocs/style_mapping.php?r1=1.31&r2=1.32&ty=u
Index: livedocs/style_mapping.php
diff -u livedocs/style_mapping.php:1.31 livedocs/style_mapping.php:1.32
--- livedocs/style_mapping.php:1.31     Wed Jul  6 12:07:31 2005
+++ livedocs/style_mapping.php  Wed Jul  6 12:17:31 2005
@@ -18,7 +18,7 @@
 // | Helper functions for formatting elements                             |
 // +----------------------------------------------------------------------+
 //
-// $Id: style_mapping.php,v 1.31 2005/07/06 16:07:31 iliaa Exp $
+// $Id: style_mapping.php,v 1.32 2005/07/06 16:17:31 iliaa Exp $
 
 // almost XPATH.. ;-)
 $map = array(
@@ -565,7 +565,7 @@
                        if (count($param->children) > 1) {
                                $param = $param->children[1];
                                $optional = true;
-                       } else if (BUILD_TYPE == 'peardoc' 
isset($param->children[0]->tagname) && $param->children[0]->tagname == 
'optional') {
+                       } else if (BUILD_TYPE == 'peardoc' && 
isset($param->children[0]->tagname) && $param->children[0]->tagname == 
'optional') {
                                $param = $param->children[0];
                                $optional = true;
                        } else {

Reply via email to