UiScroll.element(this._container, (function() {
window.jQuery(this._textarea).redactor('WoltLabCaret.endOfEditor');
}).bind(this));
- }
+ }
}).bind(this));
// handle submit button
// insert HTML
//noinspection JSCheckFunctionSignatures
DomUtil.insertHtml(data.returnValues.template, this._container, 'after');
-
+
UiNotification.show(Language.get('wcf.global.success.add'));
DomChangeListener.trigger();
CommentHandler::enforceFloodControl();
$this->readInteger('objectID', false, 'data');
+ $this->readBoolean('requireGuestDialog', true);
- $this->validateUsername();
- $this->validateCaptcha();
+ if (!$this->parameters['requireGuestDialog']) {
+ $this->validateUsername();
+ $this->validateCaptcha();
+ }
$this->validateMessage(true);
$objectType = $this->validateObjectType();
* @return string[]
*/
public function addComment() {
- if (!empty($this->validationErrors)) {
- if (!empty($this->parameters['data']['username'])) {
- WCF::getSession()->register('username', $this->parameters['data']['username']);
+ if ($this->parameters['requireGuestDialog'] || !empty($this->validationErrors)) {
+ if (!empty($this->validationErrors)) {
+ if (!empty($this->parameters['data']['username'])) {
+ WCF::getSession()->register('username', $this->parameters['data']['username']);
+ }
+ WCF::getTPL()->assign('errorType', $this->validationErrors);
}
- WCF::getTPL()->assign('errorType', $this->validationErrors);
$guestDialog = $this->getGuestDialog();
return [