}
form.addEventListener('submit', (function() {
+ if (this._acceptsNewItems(elementId)) {
+ var value = _data.get(elementId).element.value.trim();
+ if (value.length) {
+ this._addItem(elementId, { objectId: 0, value: value });
+ }
+ }
+
var values = this.getValues(elementId);
if (options.submitFieldName.length) {
var input;
}
}).bind(this));
}
+ else {
+ form.addEventListener('submit', function() {
+ if (this._acceptsNewItems(elementId)) {
+ var value = _data.get(elementId).element.value.trim();
+ if (value.length) {
+ this._addItem(elementId, {objectId: 0, value: value});
+ }
+ }
+ }.bind(this));
+ }
}
this._setup();
if (!empty($this->tagNames)) {
$this->tags = TagEngine::getInstance()->getTagsByName($this->tagNames, $this->languageID);
- if (empty($this->tags)) {
+ if (count($this->tagNames) !== count($this->tags)) {
+ WCF::getTPL()->assign('unknownTags', array_diff($this->tagNames, array_map(function(Tag $tag) {
+ return $tag->getTitle();
+ }, $this->tags)));
+ throw new UserInputException('tags', 'unknownTags');
+ }
+ else if (empty($this->tags)) {
throw new UserInputException('tags');
}
}
<item name="wcf.tagging.taggedObjects.noResults"><![CDATA[Es wurden keine Einträge mit diesem Tag gefunden.]]></item>
<item name="wcf.tagging.objectType.com.woltlab.wcf.article"><![CDATA[Artikel]]></item>
<item name="wcf.tagging.taggedObjects.com.woltlab.wcf.article"><![CDATA[Artikel mit dem Tag „{$tag->name}“]]></item>
+ <item name="wcf.tagging.tags.error.unknownTags"><![CDATA[Die folgenden Tags existieren nicht: {implode from=$unknownTags item=unknownTag}{$unknownTag}{/implode}.]]></item>
</category>
<category name="wcf.user">
<item name="wcf.user.confirmEmail"><![CDATA[E-Mail-Adresse wiederholen]]></item>
<item name="wcf.tagging.taggedObjects.noResults"><![CDATA[No items matched this tag.]]></item>
<item name="wcf.tagging.objectType.com.woltlab.wcf.article"><![CDATA[Articles]]></item>
<item name="wcf.tagging.taggedObjects.com.woltlab.wcf.article"><![CDATA[Articles Tagged with “{$tag->name}”]]></item>
+ <item name="wcf.tagging.tags.error.unknownTags"><![CDATA[The following tags do no exist: {implode from=$unknownTags item=unknownTag}{$unknownTag}{/implode}.]]></item>
</category>
<category name="wcf.user">
<item name="wcf.user.confirmEmail"><![CDATA[Confirm Email]]></item>