-function display_messages(&$tem = NULL) {
- if(!$GLOBALS['wfpl_messages']) return;
- foreach($GLOBALS['wfpl_messages'] as $msg) {
- $sub = array('text' => $msg);
- $GLOBALS['wfpl_template']['message'][] = $sub;
- $GLOBALS['wfpl_template']['messages'] = TRUE;
+# destructive
+function get_messages() {
+ if(!isset($GLOBALS['wfpl_messages'])) {
+ $messages = array();
+ } else {
+ $messages = $GLOBALS['wfpl_messages'];
+ unset($GLOBALS['wfpl_messages']);
+ }
+
+ if(function_exists('session_restore_messages')) {
+ $messages = array_merge(session_restore_messages(), $messages);
+ }
+
+ return $messages;
+}
+
+# called automatically by run.php
+function display_messages(&$tem = NULL, $key = '$messages') {
+ if(!$tem) {
+ $tem = &$GLOBALS['wfpl_template'];