From cd7573a96cb2b2cfbc442de789e953fe42e5e33a Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 31 Dec 2005 08:58:39 +0000 Subject: [PATCH] Allow check_isso_fields() to be called for fun --- kernel.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/kernel.php b/kernel.php index 32aad22..4452bc4 100644 --- a/kernel.php +++ b/kernel.php @@ -345,9 +345,11 @@ class Shared_Object_Framework * any action is done. This will throw an error block describing * the fields that need to be set if any are missing. * - * @access protected + * @access public + * + * @param bool Is this a non-error environment that should display all fields? */ - function check_isso_fields() + function check_isso_fields($called = false) { $missing = array(); foreach ($this->fields AS $name => $field) @@ -356,11 +358,16 @@ class Shared_Object_Framework { $missing[] = $name; } + else if ($called == true AND $field[2] == false) + { + $missing[] = $name . ($field[0] == REQ_YES ? ' (REQUIRED)' : ''); + } } if (count($missing) > 0) { - $error = 'You are missing required ISSO fields. Please make sure you have set:' . "\n"; + $error = ($called ? 'The following fields are not set:' : 'You are missing required ISSO fields. Please make sure you have set:'); + $error .= "\n"; $error .= ''; - $this->message('Missing Fields', $error, 3); + $this->message(($called ? '' : 'Missing ') . 'Fields', $error, ($called ? 1 : 3)); exit; } } -- 2.22.5