/** * generates a check box */ public function iCheckBox($key, $label = '') { $str = '<input type="checkbox" id="i_' . $key . '" name="' . $key . '"'; if ($this->_value($key)) { $str .= ' checked="checked"'; } $str .= ' value="1" />'; if (empty($label)) { $options = $this->obj->getPropertyOptions($key); if (!empty($options['label'])) { // -TODO- translate $label = $options['label']; } } if (!empty($label)) { $str .= '<label for="_' . $key . '" class="inline">' . VarStr::html($label) . '</label>'; } if ($err = $this->_htmlError($key)) { $str .= $err; } return $str; }
public static function html($section, $label, $field = '') { return VarStr::html(self::getTranslation($section, $label, $field)); }
/** * returns error in HTML format */ public function htmlError($key) { if ($str = $this->getError($key)) { return '<span class="error">' . VarStr::html($str) . '</span>'; } else { return false; } }
public static function log_any($mode, $head, $str) { switch ($mode) { case 1: $arr = explode("\n", trim($str)); foreach ($arr as $s) { error_log($GLOBALS['config']['log_signature'] . " {$head} : {$s}"); } break; case 2: echo VarStr::html($GLOBALS['config']['log_signature'] . " {$head} : " . nl2br($str)); break; } }