+ parent::__construct($action);
+
+ // When creating a notice form we don't want to collide with
+ // possibly existing HTML elements, as naming conventions are similar.
+ $this->id_suffix = mt_rand();
+
+ $this->actionName = $action->trimmed('action');
+
+ $prefill = array('content', 'inreplyto', 'lat',
+ 'lon', 'location_id', 'location_ns',
+ 'to_group', 'to_profile', 'private');
+
+ foreach ($prefill as $fieldName) {
+ if (array_key_exists($fieldName, $options)) {
+ $this->$fieldName = $options[$fieldName];
+ }
+ }