</type>
<!-- /article list box condition -->
+ <!-- recent activity list box condition -->
+ <type>
+ <name>com.woltlab.wcf.excludedObjectType</name>
+ <definitionname>com.woltlab.wcf.box.recentActivityList.condition</definitionname>
+ <classname>wcf\system\condition\user\activity\event\UserActivityEventExcludedObjectTypeCondition</classname>
+ </type>
+ <!-- /recent activity box condition -->
+
<!-- deprecated -->
<type>
<name>com.woltlab.wcf.page.controller</name>
<name>com.woltlab.wcf.box.articleList.condition</name>
<interfacename>wcf\system\condition\IObjectListCondition</interfacename>
</definition>
+ <definition>
+ <name>com.woltlab.wcf.box.recentActivityList.condition</name>
+ <interfacename>wcf\system\condition\IObjectListCondition</interfacename>
+ </definition>
<!-- /box conditions -->
<!-- deprecated -->
* @package WoltLabSuite\Core\System\Box
* @since 3.0
*
- * @property ViewableUserActivityEventList $objectList
+ * @property ViewableUserActivityEventList $objectList
*/
class RecentActivityListBoxController extends AbstractDatabaseObjectListBoxController {
/**
*/
public $canFilterByFollowedUsers = false;
+ /**
+ * @inheritDoc
+ */
+ public $conditionDefinition = 'com.woltlab.wcf.box.recentActivityList.condition';
+
/**
* is true if the list of recent activity is filtered to only include
* activities by followed users
--- /dev/null
+<?php
+namespace wcf\system\condition\user\activity\event;
+use wcf\data\DatabaseObjectList;
+use wcf\data\object\type\ObjectTypeCache;
+use wcf\data\user\activity\event\UserActivityEventList;
+use wcf\system\condition\AbstractMultiSelectCondition;
+use wcf\system\condition\IObjectListCondition;
+use wcf\system\WCF;
+
+/**
+ * Condition implementation for the excluded object types of user activity events.
+ *
+ * @author Matthias Schmidt
+ * @copyright 2001-2016 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package WoltLabSuite\Core\System\Condition\User\Activity\Event
+ * @since 3.0
+ */
+class UserActivityEventExcludedObjectTypeCondition extends AbstractMultiSelectCondition implements IObjectListCondition {
+ /**
+ * @inheritDoc
+ */
+ protected $description = 'wcf.global.multiSelect';
+
+ /**
+ * @inheritDoc
+ */
+ protected $fieldName = 'userActivityEventExcludedObjectTypeID';
+
+ /**
+ * @inheritDoc
+ */
+ protected $label = 'wcf.user.recentActivity.condition.excludedObjectType';
+
+ /**
+ * @inheritDoc
+ */
+ public function addObjectListCondition(DatabaseObjectList $objectList, array $conditionData) {
+ if (!($objectList instanceof UserActivityEventList)) {
+ throw new \InvalidArgumentException("Object list is no instance of '".UserActivityEventList::class."', instance of '".get_class($objectList)."' given.");
+ }
+
+ $objectList->getConditionBuilder()->add('user_activity_event.objectTypeID NOT IN (?)', [$conditionData[$this->fieldName]]);
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function getOptions() {
+ $objectTypes = ObjectTypeCache::getInstance()->getObjectTypes('com.woltlab.wcf.user.recentActivityEvent');
+
+ $options = [];
+ foreach ($objectTypes as $objectType) {
+ $options[$objectType->objectTypeID] = WCF::getLanguage()->get('wcf.user.recentActivity.' . $objectType->objectType);
+ }
+
+ return $options;
+ }
+}
<item name="wcf.user.recentActivity.com.woltlab.wcf.likeableArticle.recentActivityEvent"><![CDATA[Like (Artikel)]]></item>
<item name="wcf.user.recentActivity.com.woltlab.wcf.articleComment.recentActivityEvent"><![CDATA[Kommentar (Artikel)]]></item>
<item name="wcf.user.recentActivity.com.woltlab.wcf.articleComment.response.recentActivityEvent"><![CDATA[Antwort (Artikel)]]></item>
+ <item name="wcf.user.recentActivity.condition.excludedObjectType"><![CDATA[Ausgeschlossene Aktivitäten]]></item>
<item name="wcf.user.recentActivity.scope.all"><![CDATA[Aktivitäten aller Benutzer]]></item>
<item name="wcf.user.recentActivity.scope.followedUsers"><![CDATA[Aktivitäten von Benutzern, denen {if LANGUAGE_USE_INFORMAL_VARIANT}du folgst{else}Sie folgen{/if}]]></item>
</category>
<item name="wcf.user.recentActivity.com.woltlab.wcf.likeableArticle.recentActivityEvent"><![CDATA[Like (Article)]]></item>
<item name="wcf.user.recentActivity.com.woltlab.wcf.articleComment.recentActivityEvent"><![CDATA[Comment (Article)]]></item>
<item name="wcf.user.recentActivity.com.woltlab.wcf.articleComment.response.recentActivityEvent"><![CDATA[Reply (Article)]]></item>
+ <item name="wcf.user.recentActivity.condition.excludedObjectType"><![CDATA[Excluded Activities]]></item>
<item name="wcf.user.recentActivity.scope.all"><![CDATA[All Activities]]></item>
<item name="wcf.user.recentActivity.scope.followedUsers"><![CDATA[Filter by Followed Users]]></item>
</category>