title = $title;
$this->request_url = $form->request_url;
$this->request_method = $form->request_method;
$this->fields = $form->getFields();
$this->missing = $form->getMissing();
$this->data = $form->getData();
$this->content_above = $form->content_above;
$this->content_below = $form->content_below;
}
protected function html_content($exclude = [], $include = [])
{
if (!empty($this->title))
echo '
', $this->title, '
';
foreach ($this->_subtemplates as $template)
$template->html_main();
echo '
';
if (!empty($this->title))
echo '
';
}
protected function renderField($field_id, $field)
{
if (isset($field['before_html']))
echo '
', $field['before_html'], '
';
if ($field['type'] != 'checkbox' && isset($field['label']))
echo '
- missing) ? ' style="color: red"' : '', '>', $field['label'], '
';
elseif ($field['type'] == 'checkbox' && isset($field['header']))
echo '
- missing) ? ' style="color: red"' : '', '>', $field['header'], '
';
echo '
- ';
if (isset($field['before']))
echo $field['before'];
switch ($field['type'])
{
case 'select':
echo '
';
break;
case 'radio':
foreach ($field['options'] as $value => $option)
echo '
data[$field_id] == $value ? ' checked' : '', !empty($field['disabled']) ? ' disabled' : '', '> ', htmlentities($option);
break;
case 'checkbox':
echo '
';
break;
case 'textarea':
echo '
';
break;
case 'color':
echo '
';
break;
case 'numeric':
echo '
';
break;
case 'file':
if (!empty($this->data[$field_id]))
echo '
';
echo '
';
break;
case 'text':
case 'password':
default:
echo '
';
}
if (isset($field['after']))
echo ' ', $field['after'];
echo '
';
}
}