1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11:
12:
13: namespace ManiaLib\Gui\Cards;
14:
15: use ManiaLib\Gui\Manialink;
16: use ManiaLib\Gui\Elements\Entry;
17: use ManiaLib\Gui\Elements\Button;
18:
19: class DatePicker extends \ManiaLib\Gui\Component
20: {
21: 22: 23:
24: public $entry;
25:
26: 27: 28:
29: public $button;
30:
31: function __construct ()
32: {
33: $this->entry = new Entry();
34: $this->entry->setId('datepicker-result');
35: $this->entry->setScriptEvents();
36: $this->entry->setVAlign('center');
37: $this->entry->setPosition(0, -4);
38:
39: $this->button = new Button();
40: $this->button->setId('datepicker-button');
41: $this->button->setScriptEvents();
42: $this->button->setText('Select');
43: $this->button->setPosition(25);
44: }
45:
46: function save()
47: {
48: $this->entry->save();
49: $this->button->save();
50:
51: Manialink::appendScript('manialib_ui_datepicker_init("'.$this->entry->getId().'", "'.$this->button->getId().'");');
52: }
53: }
54: ?>