+ $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->user->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
+ //// TRANS: Checkbox label to allow sharing geo location in notices.
+ //$this->out->checkbox('notice_data-geo', _('Share my location'), true);
+ $this->out->elementStart('label', 'notice_data-geo');
+ $this->out->element('input', array(
+ 'name' => 'notice_data-geo',
+ 'type' => 'checkbox',
+ 'class' => 'checkbox',
+ 'id' => $this->id() . '-notice_data-geo',
+ 'checked' => true, // ?
+ ));
+ $this->out->text(' ');
+ // TRANS: Field label to add location to a notice.
+ $this->out->text(_('Share my location'));
+ $this->out->elementEnd('label');
+
+ $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));