aboutsummaryrefslogtreecommitdiff
path: root/views/installation/input/form.php
blob: d48d5fed87ed4eedd8b0689d4093529037a10026 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
/**
 * Create a form for data submission.
 *
 * @uses $vars['body']   The body of the form (made up of other input/xxx views and html
 * @uses $vars['action'] URL of the action being called
 * @uses $vars['method'] Method (default POST)
 * @uses $vars['id']     Form id
 * @uses $vars['name']   Form name
 */

if (isset($vars['id'])) {
	$id = "id = \"{$vars['id']}\"";
} else {
	$id = '';
}
if (isset($vars['name'])) {
	$name = "name = \"{$vars['name']}\"";
} else {
	$name = '';
}
$body = $vars['body'];
$action = $vars['action'];
if (isset($vars['method'])) {
	$method = $vars['method'];
} else {
	$method = 'POST';
}

$method = strtolower($method);

?>
<form <?php echo "$id $name"; ?> action="<?php echo $action; ?>" method="<?php echo $method; ?>">
<?php echo $body; ?>
</form>