</dd>
</dl>
+ <dl>
+ <dt></dt>
+ <dd><label><input type="checkbox" name="multipleSelection" id="multipleSelection" value="1"{if $multipleSelection} checked{/if}> {lang}wcf.acp.label.group.multipleSelection{/lang}</label></dd>
+ </dl>
+
<dl>
<dt></dt>
<dd><label><input type="checkbox" name="forceSelection" id="forceSelection" value="1"{if $labelForceSelection} checked{/if}> {lang}wcf.acp.label.group.forceSelection{/lang}</label></dd>
*/
public $showOrder = 0;
+ /**
+ * Allow the selection of multiple labels of the same group.
+ * @since 6.1
+ */
+ public bool $multipleSelection = false;
+
/**
* @inheritDoc
*/
if (isset($_POST['showOrder'])) {
$this->showOrder = \intval($_POST['showOrder']);
}
+ if (isset($_POST['multipleSelection'])) {
+ $this->multipleSelection = true;
+ }
}
/**
'groupName' => $this->groupName,
'groupDescription' => $this->groupDescription,
'showOrder' => $this->showOrder,
+ 'multipleSelection' => $this->multipleSelection ? 1 : 0,
]),
]);
$returnValues = $this->objectAction->executeAction();
$this->saved();
// reset values
- $this->forceSelection = false;
+ $this->forceSelection = $this->multipleSelection = false;
$this->groupName = $this->groupDescription = '';
$this->objectTypes = [];
$this->showOrder = 0;
'labelObjectTypeContainers' => $this->labelObjectTypeContainers,
'objectTypeID' => $this->objectTypeID,
'showOrder' => $this->showOrder,
+ 'multipleSelection' => $this->multipleSelection,
]);
}
'groupName' => $this->groupName,
'groupDescription' => $this->groupDescription,
'showOrder' => $this->showOrder,
+ 'multipleSelection' => $this->multipleSelection ? 1 : 0,
]),
]
);
$this->groupName = $this->group->groupName;
$this->groupDescription = $this->group->groupDescription;
$this->showOrder = $this->group->showOrder;
+ $this->multipleSelection = !!$this->multipleSelection;
}
}
* @property-read string $groupDescription description of the label group (only shown in ACP)
* @property-read int $forceSelection is `1` if a label in the label group has to be selected when creating an object for which the label group is available, otherwise `0`
* @property-read int $showOrder position of the label group in relation to the other label groups
+ * @property-read int $multipleSelection is `1` if more than one label may be selected, otherwise `0`
*/
class LabelGroup extends DatabaseObject implements IRouteController
{
id="%s"
title="%s"
labels="%s"
+ %s
data-group-id="%d"
></woltlab-core-label-picker>
EOT,
$this->getId(),
$this->labelGroup->getTitle(),
StringUtil::encodeHTML(JSON::encode($labels)),
+ $this->labelGroup->multipleSelection ? 'multiple' : '',
$this->labelGroup->groupID,
);
}
<item name="wcf.acp.label.group.edit"><![CDATA[Labelgruppe bearbeiten]]></item>
<item name="wcf.acp.label.group.error.invalid"><![CDATA[Die gewählte Labelgruppe ist ungültig.]]></item>
<item name="wcf.acp.label.group.forceSelection"><![CDATA[Label aus dieser Gruppe muss zwingend ausgewählt werden]]></item>
+ <item name="wcf.acp.label.group.multipleSelection"><![CDATA[Erlaube die Auswahl von mehr als einem Label aus dieser Gruppe]]></item>
<item name="wcf.acp.label.group.list"><![CDATA[Labelgruppen]]></item>
<item name="wcf.acp.label.group.permanentSelection"><![CDATA[Die ausgewählte Labelgruppe kann nachträglich nicht mehr verändert werden.]]></item>
<item name="wcf.acp.label.label"><![CDATA[Label]]></item>
<item name="wcf.acp.label.group.edit"><![CDATA[Edit Label Group]]></item>
<item name="wcf.acp.label.group.error.invalid"><![CDATA[The selected label group is invalid.]]></item>
<item name="wcf.acp.label.group.forceSelection"><![CDATA[Force selection of a label]]></item>
+ <item name="wcf.acp.label.group.multipleSelection"><![CDATA[Allow more than one label of this group to be selected]]></item>
<item name="wcf.acp.label.group.list"><![CDATA[Label Groups]]></item>
<item name="wcf.acp.label.group.permanentSelection"><![CDATA[The selected label group cannot be modified and is permanent for this label.]]></item>
<item name="wcf.acp.label.label"><![CDATA[Label]]></item>
groupName VARCHAR(80) NOT NULL,
groupDescription VARCHAR(255) NOT NULL DEFAULT '',
forceSelection TINYINT(1) NOT NULL DEFAULT 0,
- showOrder INT(10) NOT NULL DEFAULT 0
+ showOrder INT(10) NOT NULL DEFAULT 0,
+ multipleSelection TINYINT(1) NOT NULL DEFAULT 0
);
DROP TABLE IF EXISTS wcf1_label_group_to_object;