- fix two TODO's where a second field has to be stuck next to the previous

This commit is contained in:
Michael Kaufmann (d00p)
2011-02-24 10:07:38 +01:00
parent 6837852f52
commit ca9128bdbf
3 changed files with 39 additions and 15 deletions

View File

@@ -49,6 +49,7 @@ class htmlform
eval("self::\$_form .= \"" . getTemplate("misc/form/table_section", "1") . "\";");
$nexto = false;
foreach($section['fields'] as $fieldname => $fielddata)
{
if(isset($fielddata['visible']) && $fielddata['visible'] === false)
@@ -56,6 +57,7 @@ class htmlform
continue;
}
if ($nexto === false || (isset($fielddata['next_to']) && $nexto['field'] != $fielddata['next_to'])) {
$label = $fielddata['label'];
$desc = (isset($fielddata['desc']) ? $fielddata['desc'] : '');
$style = (isset($fielddata['style']) ? ' style="'.$fielddata['style'].'"' : '');
@@ -63,7 +65,25 @@ class htmlform
$data_field = self::_parseDataField($fieldname, $fielddata);
$data_field = str_replace("\n", "", $data_field);
$data_field = str_replace("\t", "", $data_field);
if (isset($fielddata['has_nextto'])) {
$nexto = array('field' => $fieldname);
$data_field.='{NEXTTOFIELD_'.$fieldname.'}';
} else {
$nexto = false;
}
eval("self::\$_form .= \"" . getTemplate("misc/form/table_row", "1") . "\";");
} else {
$data_field = self::_parseDataField($fieldname, $fielddata);
$data_field = str_replace("\n", "", $data_field);
$data_field = str_replace("\t", "", $data_field);
$data_field = $fielddata['next_to_prefix'].$data_field;
self::$_form = str_replace(
'{NEXTTOFIELD_'.$fielddata['next_to'].'}',
$data_field,
self::$_form
);
$nexto = false;
}
}
}
}

View File

@@ -26,10 +26,12 @@ return array(
'fields' => array(
'subdomain' => array(
'label' => $lng['domains']['domainname'],
'type' => 'text'
'type' => 'text',
'has_nextto' => true
),
'domain' => array(
'label' => '@TODO up to subdomain-part',
'next_to' => 'subdomain',
'next_to_prefix' => ' . ',
'type' => 'select',
'select_var' => $domains
),
@@ -54,7 +56,7 @@ return array(
'label' => $lng['domains']['redirectifpathisurl'],
'desc' => $lng['domains']['redirectifpathisurlinfo'],
'type' => 'select',
'select_var' => $redirectcode
'select_var' => isset($redirectcode) ? $redirectcode : null
),
'ssl_redirect' => array(
'visible' => ($settings['system']['use_ssl'] == '1' ? true : false),

View File

@@ -26,10 +26,12 @@ return array(
'fields' => array(
'email_part' => array(
'label' => $lng['emails']['emailaddress'],
'type' => 'text'
'type' => 'text',
'has_nextto' => true
),
'domain' => array(
'label' => '@TODO up to email-part',
'next_to' => 'email_part',
'next_to_prefix' => ' @ ',
'type' => 'select',
'select_var' => $domains
),