Skip to content
Andy Theuninck edited this page Apr 1, 2015 · 1 revision

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. How a page is generated

  • The preprocess() method is called. If the return is boolean 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. If a store.css file is present, it will also be included after the default pos.css.
  • The head_content() function provides any additional content that should go between the head tags. Typically this would be javascript or CSS. It can also simply be empty.
  • The body_content() provides the main content of the page. This should probably never be empty.
  • Javascript commands can be queued up to execute when the page loads using the add_onload_command() method. This method can be called multiple times to enqueue multiple commands.

The following child classes are provided for common scenarios.

  • 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 footer.
  • PaycardProcessPage - this variant includes some extra javascript functions that are useful for submitting paycard requests via AJAX calls.
Clone this wiki locally