private $table;
public $name;
public $type = 'text';
+ # NB 07.09.24 public $mime = 'text/plain';
public $null = true;
public $key = 0;
public $uniq = 0;
if ($opt['is_html'] and !$opt['use_out']) {
foreach ($row as $k=>$v) {
if (!isset($this->extras[$k])) $row[$k] = $this->db()->out->format($v);
+ # NB 07.09.24 $field=$this->field($k);
+ # NB 07.09.24 if (!$field) continue;
+ # NB 07.09.24 $row[$k] = $field->htmlValue($row[$k]);
}
-
}
//
# Function name should be format
$this->db()->out->type($format);
-# NB 20.06.18 Why ?????
-# NB 20.06.18 self::$params += array_values($this->db()->out->types());
if (empty($out_conf['enclose'])) $out_conf['enclose'] = ['',''];
debug('Using out module!',3);
#return $str .= '|'.$mime;
if ($default === null) $default = $str;
+ # NB 07.09.24 if (preg_match('/<\/\w+/',$default)) return $default; # already html
if (strpos($mime,'text/')===0) $default = htmlentities($default);
return $default;
}
.$hidden
.'</form>'
);
+ # NB 07.09.24 $this->table->add_fields([ 'view' ]);
+ # NB 07.09.24 $this->table->fields('view')->type = 'html';
if ($this->perm < self::DELETE) return;
static $delete = 1;
return $rm;
}
- public static function form_hidden($r) {
+ # NB 07.09.24 public static function form_hidden($r) {
+ public function form_hidden($r) {
$h = '';
#debug($r);
foreach ($r as $k => $values) {
$values = (array)$values;
+
+ # NB 07.09.24: Now html content field
+ $field = $this->table->field($k);
+ if ($field and $field->type == 'html') continue;
+
$suff = count($values)>1 ? '[]' : '';
foreach ($values as $v) {
$h .= '<input type="hidden" name="'.htmlentities($k).$suff.'" value="'.htmlentities($v).'"/>';