Form Navigation and Current Operation
PHP Form Generator is configured for use with text or graphic (icon) links. Using buttons for navigation appears to be impractical because it requires extra clicks to select records.
Knowing the current page mode (operation) before including the page header is useful in terms of setting or displaying the $operation above the form data and/or in the HTML TITLE tag. It can also facilitate applying different stylesheets to different page modes. Review the provided header files to see how an attempt is made to define the $operation variable.
Certain modes of operation are well defined.
$_REQUEST['PME_sys_operation'] => PME_op_Add
$_REQUEST['PME_sys_operation'] => PME_op_Change
$_REQUEST['PME_sys_operation'] => PME_op_Copy
$_REQUEST['PME_sys_operation'] => PME_op_Delete
$_REQUEST['PME_sys_operation'] => PME_op_View
Others are more subtle.
$_REQUEST['PME_sys_moreadd'] => More
$_REQUEST['PME_sys_morechange'] => Apply
Others are comparatively inconsequential.
$_REQUEST['PME_sys_canceladd'] => Cancel
$_REQUEST['PME_sys_cancelchange'] => Cancel
$_REQUEST['PME_sys_cancelcopy'] => Cancel
$_REQUEST['PME_sys_canceldelete'] => Cancel
$_REQUEST['PME_sys_cancelview'] => Cancel
$_REQUEST['PME_sys_saveadd'] => Save
$_REQUEST['PME_sys_savechange'] => Save
$_REQUEST['PME_sys_savecopy'] => Copy
$_REQUEST['PME_sys_savedelete'] => Delete
In the form footer, a link to a debug include file can be uncommented to reveal populated variables.
$opts['navigation'] = 'GUD';
if(stristr(strtolower($opts['navigation']), 'b')){
// Button navigation
$opts['buttons']['A']['up'] = array('save', 'more', 'cancel');
$opts['buttons']['A']['down'] = $opts['buttons']['A']['up'];
$opts['buttons']['C']['up'] = array('save', 'more', 'cancel');
$opts['buttons']['C']['down'] = $opts['buttons']['C']['up'];
$opts['buttons']['P']['up'] = array('save', 'cancel');
$opts['buttons']['P']['down'] = $opts['buttons']['P']['up'];
$opts['buttons']['D']['up'] = array('save', 'cancel');
$opts['buttons']['D']['down'] = $opts['buttons']['D']['up'];
$opts['buttons']['V']['up'] = array('change', 'cancel');
$opts['buttons']['V']['down'] = $opts['buttons']['V']['up'];
$opts['buttons']['L']['up'] = array('<<', '<', 'add', 'view', 'change', 'copy', 'delete', '>', '>>');
$opts['buttons']['L']['down'] = $opts['buttons']['L']['up'];
$opts['buttons']['F']['up'] = array('<<', '<', 'add', 'view', 'change', 'copy', 'delete', '>', '>>');
$opts['buttons']['F']['down'] = $opts['buttons']['F']['up'];
}else{
// Text or Graphic navigation
$opts['buttons']['L']['up'] = array('<<', '<', 'add', '>', '>>');
$opts['buttons']['L']['down'] = $opts['buttons']['L']['up'];
$opts['buttons']['F']['up'] = array('<<', '<', 'add', '>', '>>');
$opts['buttons']['F']['down'] = $opts['buttons']['F']['up'];
$opts['buttons']['V']['up'] = array('change', 'cancel');
$opts['buttons']['V']['down'] = $opts['buttons']['V']['up'];
}
PHP Form Generator Home
| PHP Form Generator Demo
|