</type>
<!-- /user group assignment conditions -->
+ <!-- trophy conditions -->
+ <type>
+ <name>com.woltlab.wcf.username</name>
+ <definitionname>com.woltlab.wcf.condition.trophy</definitionname>
+ <classname>wcf\system\condition\UserUsernameCondition</classname>
+ <conditiongroup>general</conditiongroup>
+ </type>
+ <type>
+ <name>com.woltlab.wcf.email</name>
+ <definitionname>com.woltlab.wcf.condition.trophy</definitionname>
+ <classname>wcf\system\condition\UserEmailCondition</classname>
+ <conditiongroup>general</conditiongroup>
+ </type>
+ <type>
+ <name>com.woltlab.wcf.userGroup</name>
+ <definitionname>com.woltlab.wcf.condition.trophy</definitionname>
+ <classname>wcf\system\condition\UserGroupCondition</classname>
+ <conditiongroup>general</conditiongroup>
+ </type>
+ <type>
+ <name>com.woltlab.wcf.languages</name>
+ <definitionname>com.woltlab.wcf.condition.trophy</definitionname>
+ <classname>wcf\system\condition\UserLanguageCondition</classname>
+ <conditiongroup>general</conditiongroup>
+ </type>
+ <type>
+ <name>com.woltlab.wcf.registrationDate</name>
+ <definitionname>com.woltlab.wcf.condition.trophy</definitionname>
+ <classname>wcf\system\condition\UserRegistrationDateCondition</classname>
+ <conditiongroup>general</conditiongroup>
+ </type>
+ <type>
+ <name>com.woltlab.wcf.registrationDateInterval</name>
+ <definitionname>com.woltlab.wcf.condition.trophy</definitionname>
+ <classname>wcf\system\condition\UserRegistrationDateIntervalCondition</classname>
+ <conditiongroup>general</conditiongroup>
+ </type>
+ <type>
+ <name>com.woltlab.wcf.avatar</name>
+ <definitionname>com.woltlab.wcf.condition.trophy</definitionname>
+ <classname>wcf\system\condition\UserAvatarCondition</classname>
+ <conditiongroup>general</conditiongroup>
+ </type>
+ <type>
+ <name>com.woltlab.wcf.state</name>
+ <definitionname>com.woltlab.wcf.condition.trophy</definitionname>
+ <classname>wcf\system\condition\UserStateCondition</classname>
+ <conditiongroup>general</conditiongroup>
+ </type>
+ <type>
+ <name>com.woltlab.wcf.activityPoints</name>
+ <definitionname>com.woltlab.wcf.condition.trophy</definitionname>
+ <classname>wcf\system\condition\UserIntegerPropertyCondition</classname>
+ <conditiongroup>contents</conditiongroup>
+ <propertyname>activityPoints</propertyname>
+ <minvalue>0</minvalue>
+ </type>
+ <type>
+ <name>com.woltlab.wcf.likesReceived</name>
+ <definitionname>com.woltlab.wcf.condition.trophy</definitionname>
+ <classname>wcf\system\condition\UserIntegerPropertyCondition</classname>
+ <conditiongroup>contents</conditiongroup>
+ <propertyname>likesReceived</propertyname>
+ <minvalue>0</minvalue>
+ </type>
+ <type>
+ <name>com.woltlab.wcf.userOptions</name>
+ <definitionname>com.woltlab.wcf.condition.trophy</definitionname>
+ <classname>wcf\system\condition\UserOptionsCondition</classname>
+ <conditiongroup>userOptions</conditiongroup>
+ </type>
+ <!-- /trophy conditions -->
+
<!-- notice conditions -->
<type>
<name>com.woltlab.wcf.page</name>
--- /dev/null
+<?php
+namespace wcf\system\trophy\condition;
+use wcf\data\object\type\ObjectType;
+use wcf\data\object\type\ObjectTypeCache;
+use wcf\system\SingletonFactory;
+
+/**
+ * Handles trophy conditions.
+ *
+ * @author Joshua Ruesweg
+ * @copyright 2001-2017 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package WoltLabSuite\Core\System\Trophy\Condition
+ * @since 3.1
+ */
+class TrophyConditionHandler extends SingletonFactory {
+ /**
+ * definition name for trophy conditions
+ * @var string
+ */
+ const CONDITION_DEFINITION_NAME = 'com.woltlab.wcf.condition.trophy';
+
+ /**
+ * list of grouped trophy condition object types
+ * @var ObjectType[][]
+ */
+ protected $groupedObjectTypes = [];
+
+ /**
+ * @inheritDoc
+ */
+ protected function init() {
+ $objectTypes = ObjectTypeCache::getInstance()->getObjectTypes(self::CONDITION_DEFINITION_NAME);
+
+ foreach ($objectTypes as $objectType) {
+ if (!$objectType->conditiongroup) continue;
+
+ if (!isset($this->groupedObjectTypes[$objectType->conditiongroup])) {
+ $this->groupedObjectTypes[$objectType->conditiongroup] = [];
+ }
+
+ $this->groupedObjectTypes[$objectType->conditiongroup][$objectType->objectTypeID] = $objectType;
+ }
+ }
+
+ /**
+ * Returns the list of grouped trophy condition object types.
+ *
+ * @return ObjectType[][]
+ */
+ public function getGroupedObjectTypes() {
+ return $this->groupedObjectTypes;
+ }
+}