model, "fields"=>["field","names"]]
*/
public function render($data) {
$match = ["row" => 1, "fields" => 1, "fields_meta" => 1];
$other = (array_diff_key($data, $match));
$this->field_options = array_diff_key($other, $this->detail_options) + $this->field_options;
$this->detail_options = array_intersect_key($other, $this->detail_options) + $this->detail_options;
$html = [];
$html[] = '
' . __('Check fields you want to erase', ONECRM_P_TEXTDOMAIN) . '
';
foreach ($data["fields"] as $field) {
// skip fields we can't render:
if (!(isset($data["fields_meta"]["fields"][$field]) && (isset($data["fields_meta"]["fields"][$field]["vname"]) ))) {
continue;
}
$fdef = $data["fields_meta"]["fields"][$field];
$cell_cls = '';
if (isset($fdef['type']))
$cell_cls .= 'cell-' . $fdef['type'];
if ($this->check_format_input($field, $data["fields_meta"])){
if (!empty($fdef['required'])) {
$cell_cls .= ' required';
}
}
$html[] = '' .
'' .
'
';
$html[] = '' .
$this->render_field($field, $data["row"], $data["fields_meta"]) .
'
';
}
$post = get_post();
return $this->create_hidden_input('ret', $post->ID).
"column_class_name[self::COLUMNS_NUM]}\">
" .
implode($html) . '
';
}
}