Re: [phplib] menu class From: nathan r. hruby (nhruby <email protected>)
Date: 04/18/01

on 4/18/01 4:18 PM, Faine, Mark at Mark.Faine <email protected> wrote:

> Has any one ever used the menu class, I'm having a terrible time getting it
> to work, pages keep timing out after a very long time.
>

It's broken under php4.. Search the archives for the patch (there are 2,
either should work)

> I even found what must be errors in the docs.
>
> <?php
> $m = new Example_Menu;
> ?><html>
> <head>
> <title><?php $m->get_menu() ?></title>
> </head>
>
> There is no method get_menu(), not as far as I can see in the source anyway.
>

phplib <email protected> /home/www/servers/phplib.netuse.de/php $ ls
DEADJOE db_mysql.inc oohforms.inc
auth.inc db_oci8.inc page.inc
be_null.inc db_odbc.inc perm.inc
be_sql.inc db_oracle.inc perminvalid.ihtml
cart.inc db_pgsql.inc prepend.php3
crcloginform.ihtml db_sybase.inc query_sql.inc
crloginform.ihtml db_usql.inc registerform.ihtml
csv_table.inc layout.inc session.inc
ct_dba.inc layout_html.inc setup.inc
ct_dbm.inc local.inc sqlquery-eric.inc
ct_file.inc loginform.ihtml sqlquery.inc
ct_informix.inc menu.inc strings2.inc
ct_ldap.inc menu_button.inc table.inc
ct_null.inc migrate_to_md5.php3 table_select_js.php3
ct_shm.inc of_checkbox.inc template.inc
ct_split_sql.inc of_file.inc tmpl_table.inc
ct_sql.inc of_radio.inc tpl_form.inc
ct_sql_compat.inc of_select.inc tree.inc
db_msql.inc of_text.inc user.inc
db_mssql.inc of_textarea.inc
phplib <email protected> /home/www/servers/phplib.netuse.de/php $ grep get_menu *

Try $m->show();

> Also, should the new menu object be created before or after the page
> management function page_open
>

No, any place is cool, but if your menu contains and calls to session stuff
(like $sess->url()) you'll need to call page_open() before calling menu
stuff. Generally, call page_open() as soon as you get to the point of
processing page info but after defining page specific functions

<?php

  function foo($thing) {
    return nothing($thing);
  }

  page_open(array("sess" => "MySess"));

   // This won't work if page_open hasn't been called
   // because the variable doesn't exist yet

  print(foo($someSessionRegisteredVarible));

?>

> This is one screwed up class but it if I could get it to work it could
> still be useful.
>

It's kinda handy... (be nice if it were template based :)

-n

-- 
......
nathan hruby - nhruby <email protected>
computer support specialist
department of drama and theatre
http://www.drama.uga.edu/
......

--------------------------------------------------------------------- To unsubscribe, e-mail: phplib-unsubscribe <email protected> For additional commands, e-mail: phplib-help <email protected>