123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224 |
- <?php
- if (!defined('STATUSNET')) {
-
-
- exit(1);
- }
- class EventForm extends Form
- {
-
- function id()
- {
- return 'form_new_event';
- }
-
- function formClass()
- {
- return 'form_settings ajax-notice';
- }
-
- function action()
- {
- return common_local_url('newevent');
- }
-
- function formData()
- {
- $this->out->elementStart('fieldset', array('id' => 'new_event_data'));
-
-
-
-
-
-
-
-
- $this->out->hidden('timelist_action_url', common_local_url('timelist'));
- $this->out->elementStart('ul', 'form_data');
- $this->li();
- $this->out->input('event-title',
-
- _m('LABEL','Title'),
- null,
-
- _m('Title of the event.'),
- 'title',
- true);
- $this->unli();
- $this->li();
- $today = new DateTime('now');
- $today->setTimezone(new DateTimeZone(common_timezone()));
- $this->out->input('event-startdate',
-
- _m('LABEL','Start date'),
- $today->format('m/d/Y'),
-
- _m('Date the event starts.'),
- 'startdate');
- $this->unli();
- $this->li();
- $times = EventTimeList::getTimes($today->format('m/d/Y 12:00') . ' am ' . $today->format('T'));
- $start = EventTimeList::nearestHalfHour($today->format('c'));
- $start->setTimezone(new DateTimeZone(common_timezone()));
- $this->out->dropdown(
- 'event-starttime',
-
- _m('LABEL','Start time'),
- $times,
-
- sprintf(_m("Time the event starts (%s)."), $today->format('T')),
- false,
- $start->format('g:ia')
- );
-
- $this->out->hidden('tz', $today->format('T'));
- $this->out->hidden('now', $today->format('F d, Y H:i:s T'));
- $this->unli();
- $this->li();
- $this->out->input('event-enddate',
-
- _m('LABEL','End date'),
- $today->format('m/d/Y'),
-
- _m('Date the event ends.'),
- 'enddate');
- $this->unli();
- $this->li();
- $this->out->dropdown(
- 'event-endtime',
-
- _m('LABEL','End time'),
- EventTimeList::getTimes($start->format('c'), true),
-
- _m('Time the event ends.'),
- false,
- null
- );
- $this->unli();
- $this->li();
- $this->out->input('event-location',
-
- _m('LABEL','Where?'),
- null,
-
- _m('Event location.'),
- 'location');
- $this->unli();
- $this->li();
- $this->out->input('event-url',
-
- _m('LABEL','URL'),
- null,
-
- _m('URL for more information.'),
- 'url');
- $this->unli();
- $this->li();
- $this->out->input('event-description',
-
- _m('LABEL','Description'),
- null,
-
- _m('Description of the event.'),
- 'description',
- true);
- $this->unli();
- $this->out->elementEnd('ul');
- $toWidget = new ToSelector($this->out,
- common_current_user(),
- null);
- $toWidget->show();
- $this->out->elementEnd('fieldset');
- }
-
- function formActions()
- {
-
- $this->out->submit('event-submit', _m('BUTTON', 'Save'), 'submit', 'submit');
- }
- }
|