2.02 Actions - andperry256/my-base-theme-and-dbadmin GitHub Wiki

Actions

Every screen on the DB Admin application has an associated action. This can be explicitly defined by a URL parameter of the form -action=<action>, otherwise a default action is assumed (the action selected being dependent on whether a table is being processed).

There are a number of built-in actions within the system. These include all the standard actions associated with table manipulation, e.g. list, edit, view,new, delete, update, copy. If a page is loaded with a table parameter and no action parameter then the list action is assumed by default.

If no table is specified, then apart from a few other built-in actions, the action must have a corresponding script in the file <action>.php within the actions directory. This directory contains all the custom actions associated within the given application. If no action parameter is found in the URL, then the application will first look for the action script home.php and if this is not found will then look for main.php. The main.php script is mandatory as there is always a built-in link to it at the top of the sidebar. It typically contains a home page for the application with links to the various actions and tables. The home.php script allows for the selection of a page other than the normal "home" if the URL is loaded without any parameters. A typical example of this would be the loading of a calendar page within a diary application.

The coding within an action script is generally free format, but it is important to note that any global variables (typically defined in path_defs.php) must be locally defined with the PHP global directive, as the action script is activated from within a function call in the DB Admin package.