[PHPLIB-DEV] cvs commit From: kk (phplib-dev <email protected>)
Date: 10/28/99

From: kk
Date: Fri Oct 29 00:13:47 1999
Added files:
      php-lib/doc/sgml/05-menu.sgml

Modified files:
      php-lib/CHANGES
      php-lib/doc/sgml/documentation.sgml
      php-lib/php/menu.inc

Log message:
And now we even have docs for the Menu class. Have fun.

Index: php-lib/CHANGES
diff -u php-lib/CHANGES:1.121 php-lib/CHANGES:1.122
--- php-lib/CHANGES:1.121 Thu Oct 28 22:12:28 1999
+++ php-lib/CHANGES Fri Oct 29 00:13:15 1999
@@ -1,12 +1,12 @@
-$Id: CHANGES,v 1.121 1999/10/28 20:12:28 kk Exp $
+$Id: CHANGES,v 1.122 1999/10/28 22:13:15 kk Exp $
 
 28-Oct-1999 kk
   - reg mode example to local.inc.
- - menu code revised and added example.
+ - menu code revised and added example. Added docs.
 
 28-Oct-1999 cg
   - Bug correction on ct_dba
-
+
 27-Oct-1999 kk
   - Killed all references to shonline.de, I hope.
   - Andrzej Piasecki <robin <email protected>> requested a default
Index: php-lib/doc/sgml/documentation.sgml
diff -u php-lib/doc/sgml/documentation.sgml:1.8 php-lib/doc/sgml/documentation.sgml:1.9
--- php-lib/doc/sgml/documentation.sgml:1.8 Wed Oct 27 08:38:31 1999
+++ php-lib/doc/sgml/documentation.sgml Fri Oct 29 00:13:15 1999
@@ -35,6 +35,7 @@
   <!ENTITY f05widget SYSTEM "05-widget.sgml">
   <!ENTITY f05sqlquery SYSTEM "05-sql_query.sgml">
   <!ENTITY f05table SYSTEM "05-table.sgml">
+ <!ENTITY f05menu SYSTEM "05-menu.sgml">
   <!ENTITY f05form SYSTEM "05-form.sgml">
   <!ENTITY f05tplform SYSTEM "05-tpl_form.sgml">
   <!ENTITY f05tree SYSTEM "05-tree.sgml">
@@ -42,7 +43,7 @@
 
   <!ENTITY f06ack SYSTEM "06-ack.sgml">
 ]>
-<!-- $Id: documentation.sgml,v 1.8 1999/10/27 06:38:31 kk Exp $ -->
+<!-- $Id: documentation.sgml,v 1.9 1999/10/28 22:13:15 kk Exp $ -->
 
 <article>
 <title>PHP Base Library Documentation, Release phplib_7_2
@@ -50,7 +51,7 @@
 <author>Boris Erdmann, boris <email protected>,
         Kristian Köhntopp, kk <email protected>
     and Sascha Schumann, sascha <email protected>
-<date>$Id: documentation.sgml,v 1.8 1999/10/27 06:38:31 kk Exp $
+<date>$Id: documentation.sgml,v 1.9 1999/10/28 22:13:15 kk Exp $
 
 <toc>
 
@@ -89,6 +90,7 @@
 &f05widget;
 &f05sqlquery;
 &f05table;
+&f05menu;
 &f05form;
 &f05tplform;
 &f05tree;
Index: php-lib/php/menu.inc
diff -u php-lib/php/menu.inc:1.3 php-lib/php/menu.inc:1.4
--- php-lib/php/menu.inc:1.3 Thu Oct 28 22:12:32 1999
+++ php-lib/php/menu.inc Fri Oct 29 00:13:16 1999
@@ -5,7 +5,7 @@
  * Copyright (c) 1999 NetUSE GmbH
  * Kristian Koehntopp
  *
- * $Id: menu.inc,v 1.3 1999/10/28 20:12:32 kk Exp $
+ * $Id: menu.inc,v 1.4 1999/10/28 22:13:16 kk Exp $
  *
  */
 class Menu {
@@ -24,6 +24,9 @@
   # $visible[1] = "/1";
   var $visible = array();
 
+ # Set true if you do not want to see the main menu
+ var $nomain = false;
+
   /***************************************************************************/
   /* public: constructor
    */
@@ -53,16 +56,17 @@
     # create them
     $str = "";
     
+ $start = $this->nomain?1:0;
     $len = count($this->visible);
     $oldlevel = 0;
     $str .= $this->start_menu();
- for($i=0; $i<$len; $i++) {
+ for($i=$start; $i<$len; $i++) {
       $level = count(explode("/", $this->visible[$i]));
 
       if ($level > $oldlevel)
- $str .= $this->shift_in();
+ $str .= $this->shift_in($oldlevel, $level);
       if ($level < $oldlevel)
- $str .= $this->shift_out();
+ $str .= $this->shift_out($oldlevel, $level);
       $oldlevel = $level;
 
       $str .= $this->get_cell($i, $level);
@@ -90,9 +94,9 @@
     return $str;
   }
   
- function shift_in() { ; }
+ function shift_in($oldlevel, $level) { ; }
   
- function shift_out() { ; }
+ function shift_out($oldlevel, $level) { ; }
 
   function start_menu() { ; }
 

-
PHPLIB Developers Mailing List. Send messages to <phplib-dev <email protected>>.
To unsubscribe, send "unsubscribe" to <phplib-dev-request <email protected>> in
the body, not the subject, of your message.