X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fnoticeform.php;h=ec8624597ece15890a161ee099db49120301fd2c;hb=69ac99ff949ab0118ff25a62471980ad0ec7a52b;hp=9864d15eb084dfb18fe4df869dddf25ef8ad2cc9;hpb=b4b992bca77d34b8643910e8d590b5be7fede94b;p=quix0rs-gnu-social.git diff --git a/lib/noticeform.php b/lib/noticeform.php index 9864d15eb0..ec8624597e 100644 --- a/lib/noticeform.php +++ b/lib/noticeform.php @@ -75,6 +75,15 @@ class NoticeForm extends Form var $inreplyto = null; + /** + * Pre-filled location content of the form + */ + + var $lat; + var $lon; + var $location_id; + var $location_ns; + /** * Constructor * @@ -83,13 +92,17 @@ class NoticeForm extends Form * @param string $content content to pre-fill */ - function __construct($out=null, $action=null, $content=null, $user=null, $inreplyto=null) + function __construct($out=null, $action=null, $content=null, $user=null, $inreplyto=null, $lat=null, $lon=null, $location_id=null, $location_ns=null) { parent::__construct($out); $this->action = $action; $this->content = $content; $this->inreplyto = $inreplyto; + $this->lat = $lat; + $this->lon = $lon; + $this->location_id = $location_id; + $this->location_ns = $location_ns; if ($user) { $this->user = $user; @@ -105,7 +118,7 @@ class NoticeForm extends Form /** * ID of the form * - * @return int ID of the form + * @return string ID of the form */ function id() @@ -113,6 +126,17 @@ class NoticeForm extends Form return 'form_notice'; } + /** + * Class of the form + * + * @return string class of the form + */ + + function formClass() + { + return 'form_notice'; + } + /** * Action of the form * @@ -177,6 +201,10 @@ class NoticeForm extends Form $this->out->hidden('notice_return-to', $this->action, 'returnto'); } $this->out->hidden('notice_in-reply-to', $this->inreplyto, 'inreplyto'); + $this->out->hidden('notice_data-lat', empty($this->lat) ? null : $this->lat, 'lat'); + $this->out->hidden('notice_data-lon', empty($this->lon) ? null : $this->lon, 'lon'); + $this->out->hidden('notice_data-location_id', empty($this->location_id) ? null : $this->location_id, 'location_id'); + $this->out->hidden('notice_data-location_ns', empty($this->location_ns) ? null : $this->location_ns, 'location_ns'); Event::handle('StartShowNoticeFormData', array($this)); }