updated as of: April 1, 2015
last author: Andy Theuninck
The classes in gui-class-lib provide a structured way to draw screen output.
All subclasses follow a nearly identical path; the variations on BasicPage
just automatically fill in some common variations.
The latest documentation can be found on the Project Wiki
The information below may be out of date.
How a page is generated
- The preprocess() method is called. If the return is False, nothing is
drawn. Preprocess is typically used to deal with session and/or form data,
and to redirect to other pages when applicable. Setting headers to redirect
is really the only reason I can think of to return false.
- Doctype, html and head tags, the default css, and jquery are all
output automatically, then head_content() is called. If a store.css file is
present, it will also be included after the default pos.css.
- A closing head tag and opening body tag are output, then body_content()
is called. Print the main contents here.
add_onload_commands() method are called. These stack; you can call
add_onload_commands() multiple times to execute multiple actions on page-load.
- InputPage - this variant includes an input box at the top of the screen, similar to
input.php in the framed version of IS4C, and includes the totals footer. The input form's action
is PHP_SELF. If you need a different action, use BasicPage and call the input_header() method
manually. It accepts an optional "action" argument.
- NoInputPage - this variant omits the input box but still has time and standalone
status, similar to noinput.php in the framed version of IS4C. It also includes the totals
are useful for submitting paycard requests via AJAX calls.