]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - plugins/Event/eventform.php
Many i18n and L10n updates.
[quix0rs-gnu-social.git] / plugins / Event / eventform.php
1 <?php
2 /**
3  * StatusNet - the distributed open-source microblogging tool
4  * Copyright (C) 2011, StatusNet, Inc.
5  *
6  * Form for entering an event
7  * 
8  * PHP version 5
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU Affero General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Affero General Public License for more details.
19  *
20  * You should have received a copy of the GNU Affero General Public License
21  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
22  *
23  * @category  Event
24  * @package   StatusNet
25  * @author    Evan Prodromou <evan@status.net>
26  * @copyright 2011 StatusNet, Inc.
27  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
28  * @link      http://status.net/
29  */
30
31 if (!defined('STATUSNET')) {
32     // This check helps protect against security problems;
33     // your code file can't be executed directly from the web.
34     exit(1);
35 }
36
37 /**
38  * Form for adding an event
39  *
40  * @category  Event
41  * @package   StatusNet
42  * @author    Evan Prodromou <evan@status.net>
43  * @copyright 2011 StatusNet, Inc.
44  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
45  * @link      http://status.net/
46  */
47
48 class EventForm extends Form
49 {
50     /**
51      * ID of the form
52      *
53      * @return int ID of the form
54      */
55
56     function id()
57     {
58         return 'form_new_event';
59     }
60
61     /**
62      * class of the form
63      *
64      * @return string class of the form
65      */
66
67     function formClass()
68     {
69         return 'form_settings ajax-notice';
70     }
71
72     /**
73      * Action of the form
74      *
75      * @return string URL of the action
76      */
77
78     function action()
79     {
80         return common_local_url('newevent');
81     }
82
83     /**
84      * Data elements of the form
85      *
86      * @return void
87      */
88
89     function formData()
90     {
91         $this->out->elementStart('fieldset', array('id' => 'new_bookmark_data'));
92         $this->out->elementStart('ul', 'form_data');
93
94         $this->li();
95         $this->out->input('title',
96                           _m('LABEL','Title'),
97                           null,
98                           _m('Title of the event.'));
99         $this->unli();
100
101         $this->li();
102         $this->out->input('startdate',
103                           _m('LABEL','Start date'),
104                           null,
105                           _m('Date the event starts.'));
106         $this->unli();
107
108         $this->li();
109         $this->out->input('starttime',
110                           _m('LABEL','Start time'),
111                           null,
112                           _m('Time the event starts.'));
113         $this->unli();
114
115         $this->li();
116         $this->out->input('enddate',
117                           _m('LABEL','End date'),
118                           null,   
119                           _m('Date the event ends.'));
120         $this->unli();
121
122         $this->li();
123         $this->out->input('endtime',
124                           _m('LABEL','End time'),
125                           null,
126                           _m('Time the event ends.'));
127         $this->unli();
128
129         $this->li();
130         $this->out->input('location',
131                           _m('LABEL','Location'),
132                           null,
133                           _m('Event location.'));
134         $this->unli();
135
136         $this->li();
137         $this->out->input('url',
138                           _m('LABEL','URL'),
139                           null,
140                           _m('URL for more information.'));
141         $this->unli();
142
143         $this->li();
144         $this->out->input('description',
145                           _m('LABEL','Description'),
146                           null,
147                           _m('Description of the event.'));
148         $this->unli();
149
150         $this->out->elementEnd('ul');
151         $this->out->elementEnd('fieldset');
152     }
153
154     /**
155      * Action elements
156      *
157      * @return void
158      */
159
160     function formActions()
161     {
162         $this->out->submit('submit', _m('BUTTON', 'Save'));
163     }
164 }