|
Previous: Where to Put Application Files
Next: Public Pages
Pages, Classes and TablesAndromeda builds a menu systems based on the module and table definitions in your database definition. There is one drop-down menu for each module, and one menu entry for each table. The modules and tables appear in the order in which they are defined, unless you specify the "uisort" property for them, which will override the default ordering. Keeping a Table Off the MenuIf you set the "nomenu" property of a table to "Y", then the table will not appear on the menu. You can also set the "nomenu" property for a certain group in a table. You can also set the "nomenu" property for a certain group in a certain module by using the module.group definition or the group.module definition. # This group by default does not see the "sales"
# module at all on the menu
group ar:
module sales:
nomenu: "Y"
# This particular table is not on the menu
# for anybody
table order_lines:
module: sales
nomenu: "Y"
# ...except the admin group sees it on the menu
group sales_admin:
nomenu: "N"
Adding A Program To The MenuYou can add programs directly to the menu in the database specification. Strictly speaking these are not database specifications because they do not put anything into the database, but we allow them here because this is where the menu is being built. The downside to this approach is that it can be a hassle to run a build just to put one item on the menu, but this is not so bad because it just does not happen that often. If you want to control where the entry appears, you can specify the "uisort" property for the tables and the menu entry. table orders:
module: sales
# this property provides explicit control
# of the ordering of the menu
uisort: 100
#
# ...rest of this table definition goes here
#
# This creates a menu entry only. The
# programmer must create packing.php that
# contains the class "packing" that
# extends class "x_table2".
#
menu packing:
description: Print Packing Slips
module: sales
uisort: 105
Adding Pages Only By LinksSometimes you will have a page or program that is accessible by links, but is not on the menu. For these pages just follow the instructions below for the PHP Class File. The PHP Class FileAndromeda provides standard editing pages for all tables. There is no actual code for these screens anywhere, they are built on the fly by reading the data dictionary. To modify a default editing page you must create an empty class file and add code to it. If you add a program to the menu, you create a class file that has the same name as the menu entry. In all cases, the class file has the same name as the page or the menu entry, the class has the same name as the file, and the class extends "x_table2". <?php
# This is file example.php
class example extends x_table2 {
#
# method code
# will go in here
#
}
?>
Previous: Where to Put Application Files
Next: Public Pages
|
