forked from GoteoFoundation/goteo-legacy
/
edit.html.php
56 lines (53 loc) · 3.06 KB
/
edit.html.php
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
/*
* Copyright (C) 2012 Platoniq y Fundación Goteo (see README for details)
* This file is part of Goteo.
*
* Goteo is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Goteo is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Goteo. If not, see <http://www.gnu.org/licenses/agpl.txt>.
*
*/
use Goteo\Library\Text;
?>
<div class="widget board">
<!-- superform -->
<form action="<?php echo $this['form']['action']; ?>" method="post" enctype="multipart/form-data">
<dl>
<?php foreach ($this['form']['fields'] as $Id=>$field) : ?>
<dt><label for="<?php echo $Id; ?>"><?php echo $field['label']; ?></label></dt>
<dd><?php switch ($field['type']) {
case 'text': ?>
<input type="text" id="<?php echo $Id; ?>" name="<?php echo $field['name']; ?>" <?php echo $field['properties']; ?> value="<?php $name = $field['name']; echo $this['data']->$name; ?>" />
<?php break;
case 'hidden': ?>
<input type="hidden" name="<?php echo $field['name']; ?>" <?php echo $field['properties']; ?> value="<?php $name = $field['name']; echo $this['data']->$name; ?>" />
<?php break;
case 'textarea': ?>
<textarea id="<?php echo $Id; ?>" name="<?php echo $field['name']; ?>" <?php echo $field['properties']; ?>><?php $name = $field['name']; echo $this['data']->$name; ?></textarea>
<?php break;
case 'image':
$name = $field['name'];
?>
<input type="file" id="<?php echo $Id; ?>" name="<?php echo $field['name']; ?>" <?php echo $field['properties']; ?> value="<?php $name = $field['name']; echo $this['data']->$name; ?>" /> <br />
<?php if (!empty($this['data']->$name)) : ?>
<img src="<?php echo SRC_URL ?>/image/<?php echo $this['data']->$name; ?>/110/110" alt="<?php echo $field['name']; ?>" /><br />
<input type="hidden" name="<?php echo $field['name']; ?>" value="<?php echo $this['data']->$name; ?>" />
<input type="submit" name="image-<?php echo $this['data']->$name; ?>-remove" value="Quitar" />
<?php endif; ?>
<?php break;
} ?></dd>
<?php endforeach; ?>
</dl>
<input type="submit" name="<?php echo $this['form']['submit']['name']; ?>" value="<?php echo $this['form']['submit']['label']; ?>" />
</form>
</div>