1: <?php
2: /**
3: * ManiaLib - Lightweight PHP framework for Manialinks
4: *
5: * @see http://code.google.com/p/manialib/
6: * @copyright Copyright (c) 2009-2011 NADEO (http://www.nadeo.com)
7: * @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
8: * @version $Revision: 590 $:
9: * @author $Author: maximeraoust $:
10: * @date $Date: 2011-12-27 19:40:38 +0100 (mar., 27 déc. 2011) $:
11: */
12:
13: namespace ManiaLib\Gui\Elements;
14:
15: class Entry extends \ManiaLib\Gui\Elements\Label
16: {
17:
18: protected $xmlTagName = 'entry';
19: protected $style = '';
20: protected $name;
21: protected $defaultValue;
22:
23: /**
24: * Sets the name of the entry. Will be used as the parameter name in the URL
25: * when submitting the page
26: * @param string
27: */
28: function setName($name)
29: {
30: $this->name = $name;
31: }
32:
33: /**
34: * Sets the default value of the entry
35: * @param mixed
36: */
37: function setDefault($value)
38: {
39: $this->defaultValue = $value;
40: }
41:
42: /**
43: * Returns the name of the entry
44: * @return string
45: */
46: function getName()
47: {
48: return $this->name;
49: }
50:
51: /**
52: * Returns the default value of the entry
53: * @return mixed
54: */
55: function getDefault()
56: {
57: return $this->defaultValue;
58: }
59:
60: protected function postFilter()
61: {
62: parent::postFilter();
63: if($this->name !== null)
64: $this->xml->setAttribute('name', $this->name);
65: if($this->defaultValue !== null)
66: $this->xml->setAttribute('default', $this->defaultValue);
67: }
68:
69: }
70:
71: ?>