goba            Thu Sep  2 15:26:02 2004 EDT

  Modified files:              
    /livedocs   livedoc_funcs.php 
  Log:
  do not go into listing functions on refgroup pages (yes, I am nesting two ifs, since 
I think it is readble this way) - feel free to optimize
  
http://cvs.php.net/diff.php/livedocs/livedoc_funcs.php?r1=1.14&r2=1.15&ty=u
Index: livedocs/livedoc_funcs.php
diff -u livedocs/livedoc_funcs.php:1.14 livedocs/livedoc_funcs.php:1.15
--- livedocs/livedoc_funcs.php:1.14     Thu Sep  2 15:03:14 2004
+++ livedocs/livedoc_funcs.php  Thu Sep  2 15:26:01 2004
@@ -346,7 +346,7 @@
 
 function do_contents($id, $level) 
 {
-       global $lang;
+       global $lang, $current_page;
 
        $parent_selector = (is_numeric($id)) ? $parent_selector = 'parent_id =' . $id 
: 'parent_docbook_id = "' . sqlite_escape_string($id) . '"';
        
@@ -361,8 +361,12 @@
                                $ret .= "<a href='".generate_url_for_id($lang, 
$row[1])."'>".$title."</a>";
                        }
 
-                       if (strncmp($row[1], 'refs.', 5) == 0 || ($level < 2 && 
strncmp($row[1], 'ref', 3)) ||  $level < 1) {
-                               $ret .= do_contents($row[0], $level + 1);
+                       // Do not go into listing functions on refgroup pages
+                       if (!(strncmp($current_page, 'refs.', 5) == 0 && 
strncmp($row[1], 'function.', 3) != 0)) {
+                               // Go very deep on refgroup pages
+                               if (strncmp($row[1], 'refs.', 5) == 0 || ($level < 2 
&& strncmp($row[1], 'ref', 3)) ||  $level < 1) {
+                                       $ret .= do_contents($row[0], $level + 1);
+                               }
                        }
                        $ret .= "</li>\n";
                }

Reply via email to