check[$name] = array( 'test' => (($test === NULL) ? NULL : (boolean) $test), 'on' => $on, 'off' => $off ); } function checkAll() { foreach ($this->check as $v) { if ($v['test'] === false) { return false; } } return true; } function checkItem($name) { if (!empty($this->check[$name])) { return $this->check[$name]['test']; } else { return false; } } function checkWarnings() { foreach ($this->check as $v) { if ($v['test'] === NULL) { return true; } } return false; } function getHTML($img_on='',$img_off='',$img_wrn='') { $img_on = 'ok'; $img_off = 'error'; $img_wrn = 'warning'; $res = ''; foreach ($this->check as $k => $v) { $ok = $v['test']; if ($ok === NULL) { $img = $img_wrn; $str = $v['off']; } elseif ($ok == false) { $img = $img_off; $str = $v['off']; } elseif ($ok) { $img = $img_on; $str = $v['on']; } $res .= ''. ''. ''. ''; } $res .= '
'.$img.''.$str.'
'; return $res; } } ?>