function formData() { $this->out->elementStart('fieldset', array('id' => 'new_video_data')); $this->out->elementStart('ul', 'form_data'); $this->li(); $this->out->input('url', _('URL'), null, _('URL of the video')); $this->unli(); $this->out->elementEnd('ul'); $toWidget = new ToSelector($this->out, common_current_user(), null); $toWidget->show(); $this->out->elementEnd('fieldset'); }
function formData() { $this->out->elementStart('fieldset', array('id' => 'new_photo_data')); $this->out->elementStart('ul', 'form_data'); $this->li(); $this->out->input('title', _('Title'), null, _('Photo title (optional).')); $this->unli(); $this->li(); $this->out->element('input', array('name' => 'photo_upload', 'type' => 'file', 'id' => 'photo_upload')); $this->unli(); $this->li(); $this->textarea('description', _('Description'), null, _('Description of the photo (optional).')); $this->unli(); $this->out->elementEnd('ul'); $toWidget = new ToSelector($this->out, common_current_user(), null); $toWidget->show(); $this->out->elementEnd('fieldset'); }
/** * Data elements of the form * * @return void */ function formData() { $this->out->elementStart('fieldset', array('id' => 'newpoll-data')); $this->out->elementStart('ul', 'form_data'); $this->li(); $this->out->input('question', _m('Question'), $this->question, _m('What question are people answering?'), 'question', true); // HTML5 "required" attribute $this->unli(); $max = 5; if (count($this->options) + 1 > $max) { $max = count($this->options) + 2; } for ($i = 0; $i < $max; $i++) { // @fixme make extensible if (isset($this->options[$i])) { $default = $this->options[$i]; } else { $default = ''; } $this->li(); $this->out->input('poll-option' . ($i + 1), sprintf(_m('Option %d'), $i + 1), $default, null, 'option' . ($i + 1), $i < 2); // HTML5 "required" attribute for 2 options $this->unli(); } $this->out->elementEnd('ul'); $toWidget = new ToSelector($this->out, common_current_user(), null); $toWidget->show(); $this->out->elementEnd('fieldset'); }
/** * Data elements of the form * * @return void */ function formData() { $this->out->elementStart('fieldset', array('id' => 'new_bookmark_data')); $this->out->elementStart('ul', 'form_data'); $this->li(); $this->out->input('bookmark-url', _m('LABEL', 'URL'), $this->_url, null, 'url', true); // HTML5 "required" attribute $this->unli(); if (!empty($this->_thumbnail)) { list($width, $height) = $this->scaleImage($this->_thumbnail->width, $this->_thumbnail->height); $this->out->element('img', array('src' => $this->_thumbnail->getUrl(), 'class' => 'bookmarkform-thumbnail', 'width' => $width, 'height' => $height)); } $this->li(); $this->out->input('bookmark-title', _m('LABEL', 'Title'), $this->_title, null, 'title', true); // HTML5 "required" attribute $this->unli(); $this->li(); $this->out->textarea('bookmark-description', _m('LABEL', 'Notes'), $this->_description, null, 'description'); $this->unli(); $this->li(); $this->out->input('bookmark-tags', _m('LABEL', 'Tags'), $this->_tags, _m('Comma- or space-separated list of tags.'), 'tags'); $this->unli(); $this->out->elementEnd('ul'); $toWidget = new ToSelector($this->out, common_current_user(), null); $toWidget->show(); $this->out->elementEnd('fieldset'); }
/** * Data elements of the form * * @return void */ function formData() { $this->out->elementStart('fieldset', array('id' => 'new_event_data')); $this->out->elementStart('ul', 'form_data'); $this->li(); $this->out->input('event-title', _m('LABEL', 'Title'), null, _m('Title of the event.'), 'title'); $this->unli(); $this->li(); $this->out->input('event-startdate', _m('LABEL', 'Start date'), null, _m('Date the event starts.'), 'startdate'); $this->unli(); $this->li(); $this->out->input('event-starttime', _m('LABEL', 'Start time'), null, _m('Time the event starts.'), 'starttime'); $this->unli(); $this->li(); $this->out->input('event-enddate', _m('LABEL', 'End date'), null, _m('Date the event ends.'), 'enddate'); $this->unli(); $this->li(); $this->out->input('event-endtime', _m('LABEL', 'End time'), null, _m('Time the event ends.'), 'endtime'); $this->unli(); $this->li(); $this->out->input('event-location', _m('LABEL', 'Location'), 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'); $this->unli(); $this->out->elementEnd('ul'); $toWidget = new ToSelector($this->out, common_current_user(), null); $toWidget->show(); $this->out->elementEnd('fieldset'); }
/** * Data elements of the form * * @return void */ function formData() { $this->out->elementStart('fieldset', array('id' => 'new_event_data')); // Passing in the URL of the Ajax action that the .js for this form hits // when selecting event start and end times. JavaScript will try to // use a relative path, unless explicitely told where an action is, // and that's a bit difficult to calculate since the event form is on // so many pages with different paths. It might be worth solving this // globally by putting the base site path in the Identifier-URL meta tag // or something similar, so it would be easy to calculate the exact path // for actions and other things in JavaScripts. -z $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); // HTML5 "required" attribute $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')); // Need to keep JavaScript TZ in sync with PHP TZ $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); // HTML5 "required" attribute $this->unli(); $this->out->elementEnd('ul'); $toWidget = new ToSelector($this->out, common_current_user(), null); $toWidget->show(); $this->out->elementEnd('fieldset'); }
/** * Data elements of the form * * @return void */ function formData() { $this->out->elementStart('fieldset', array('id' => 'new_blog_entry_data')); $this->out->elementStart('ul', 'form_data'); $this->li(); $this->out->input('blog-entry-title', _m('LABEL', 'Title'), null, _m('Title of the blog entry.'), 'title'); $this->unli(); $this->li(); $this->out->textarea('blog-entry-content', _m('LABEL', 'Text'), null, _m('Text of the blog entry.'), 'content'); $this->unli(); $this->out->elementEnd('ul'); $toWidget = new ToSelector($this->out, common_current_user(), null); $toWidget->show(); $this->out->elementEnd('fieldset'); }
/** * Data elements of the form * * @return void */ function formData() { $this->out->elementStart('fieldset', array('id' => 'newquestion-data')); $this->out->elementStart('ul', 'form_data'); $this->li(); $this->out->input('qna-question-title', _m('LABEL', 'Title'), $this->title, _m('The title of your question.'), 'title'); $this->unli(); $this->li(); $this->out->textarea('qna-question-description', _m('LABEL', 'Description'), $this->description, _m('Your question in detail.'), 'description'); $this->unli(); $this->out->elementEnd('ul'); $toWidget = new ToSelector($this->out, common_current_user(), null); $toWidget->show(); $this->out->elementEnd('fieldset'); }
/** * Data elements * * @return void */ function formData() { if (Event::handle('StartShowNoticeFormData', array($this))) { $this->out->element('label', array('for' => 'notice_data-text', 'id' => 'notice_data-text-label'), sprintf(_('What\'s up, %s?'), $this->user->nickname)); // XXX: vary by defined max size $this->out->element('textarea', array('class' => 'notice_data-text', 'required' => 'required', 'placeholder' => $this->placeholderText(), 'cols' => 35, 'rows' => 4, 'name' => 'status_textarea'), $this->content ? $this->content : ''); $contentLimit = Notice::maxContent(); if ($contentLimit > 0) { $this->out->element('span', array('class' => 'count'), $contentLimit); } if (common_config('attachments', 'uploads')) { $this->out->hidden('MAX_FILE_SIZE', common_config('attachments', 'file_quota')); $this->out->element('label', array('class' => 'notice_data-attach', 'for' => $this->id() . '-notice_data-attach'), _('Attach')); // The actual input element tends to be hidden with CSS. $this->out->element('input', array('class' => 'notice_data-attach', 'type' => 'file', 'name' => 'attach', 'id' => $this->id() . '-notice_data-attach', 'title' => _('Attach a file.'))); } if (!empty($this->actionName)) { $this->out->hidden('notice_return-to', $this->actionName, 'returnto'); } $this->out->hidden('notice_in-reply-to', $this->inreplyto, 'inreplyto'); $this->out->elementStart('div', 'to-selector'); $toWidget = new ToSelector($this->out, $this->user, !empty($this->to_group) ? $this->to_group : $this->to_profile); $toWidget->show(); $this->out->elementEnd('div'); if ($this->profile->shareLocation()) { $this->out->hidden('notice_data-lat', empty($this->lat) ? empty($this->profile->lat) ? null : $this->profile->lat : $this->lat, 'lat'); $this->out->hidden('notice_data-lon', empty($this->lon) ? empty($this->profile->lon) ? null : $this->profile->lon : $this->lon, 'lon'); $this->out->hidden('notice_data-location_id', empty($this->location_id) ? empty($this->profile->location_id) ? null : $this->profile->location_id : $this->location_id, 'location_id'); $this->out->hidden('notice_data-location_ns', empty($this->location_ns) ? empty($this->profile->location_ns) ? null : $this->profile->location_ns : $this->location_ns, 'location_ns'); $this->out->elementStart('div', array('class' => 'notice_data-geo_wrap', 'data-api' => common_local_url('geocode'))); // @fixme checkbox method allows no way to change the id without changing the name //$this->out->checkbox('notice_data-geo', _('Share my location'), true); $this->out->element('input', array('name' => 'notice_data-geo', 'type' => 'checkbox', 'class' => 'checkbox', 'id' => $this->id() . '-notice_data-geo', 'checked' => true)); $this->out->element('label', array('class' => 'notice_data-geo', 'for' => $this->id() . '-notice_data-geo'), _('Share my location')); $this->out->elementEnd('div'); // TRANS: Text to not share location for a notice in notice form. $share_disable_text = _('Do not share my location'); // TRANS: Timeout error text for location retrieval in notice form. $error_timeout_text = _('Sorry, retrieving your geo location is taking longer than expected, please try again later'); $this->out->inlineScript(' var NoticeDataGeo_text = {' . 'ShareDisable: ' . json_encode($share_disable_text) . ',' . 'ErrorTimeout: ' . json_encode($error_timeout_text) . '}'); } Event::handle('EndShowNoticeFormData', array($this)); } }