… for modification log handlers not supporting showing modification logs in the global ACP log list.
See #2597
protected function initObjectTypes() {
foreach (ObjectTypeCache::getInstance()->getObjectTypes('com.woltlab.wcf.modifiableContent') as $objectType) {
- /** @noinspection PhpUndefinedFieldInspection */
- if ($objectType->excludeFromLogList) {
- continue;
- }
-
$this->objectTypes[$objectType->objectTypeID] = $objectType;
/** @var IExtendedModificationLogHandler $processor */
if ($processor === null) {
$this->unsupportedObjectTypes[] = $objectType;
}
- else {
+ else if ($processor->includeInLogList()) {
$this->availableObjectTypeIDs[] = $objectType->objectTypeID;
if (!isset($this->packages[$objectType->packageID])) {
$this->actions[$objectType->packageID] = [];
* @since 3.2
*/
abstract class AbstractExtendedModificationLogHandler extends AbstractModificationLogHandler implements IExtendedModificationLogHandler {
+ /**
+ * @inheritDoc
+ */
+ public function includeInLogList() {
+ return true;
+ }
}
*/
public function getAvailableActions();
+ /**
+ * Returns `true` if logs handled by this handler may be included in the
+ * global ACP log list and returns `false` otherwise.
+ *
+ * @return bool
+ */
+ public function includeInLogList();
+
/**
* Processes a list of items by converting them into IViewableModificationLog
* instances and pre-loading their data.
*
- * @param ModificationLog[] $items
- * @return IViewableModificationLog[]
+ * @param ModificationLog[] $items
+ * @return IViewableModificationLog[]
*/
public function processItems(array $items);
}
--- /dev/null
+<?php
+namespace wcf\system\log\modification;
+
+/**
+ * Extended modification log handler implementation for modification log handlers
+ * that do not support their logs being shown in the global ACP modification log.
+ *
+ * @author Matthias Schmidt
+ * @copyright 2001-2018 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package WoltLabSuite\Core\System\Log\Modification
+ * @since 3.2
+ */
+class VoidExtendedModificationLogHandler extends AbstractExtendedModificationLogHandler {
+ /**
+ * @inheritDoc
+ */
+ public function getAvailableActions() {
+ return [];
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function includeInLogList() {
+ return false;
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function processItems(array $items) {
+ throw new \BadMethodCallException("Cannot process items.");
+ }
+}