<interfacename>wcf\system\condition\IObjectListCondition</interfacename>
</definition>
<!-- /box conditions -->
+
+ <definition>
+ <name>com.woltlab.wcf.sitemap.object</name>
+ <interfacename><![CDATA[wcf\system\sitemap\object\ISitemapObjectObjectType]]></interfacename>
+ </definition>
</import>
<delete>
--- /dev/null
+<?php
+namespace wcf\system\sitemap\object;
+use wcf\data\user\User;
+use wcf\data\user\UserProfile;
+use wcf\data\DatabaseObject;
+
+/**
+ * Abstract implementation of a sitemap object.
+ *
+ * @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\Sitemap\Object
+ * @since 3.1
+ */
+abstract class AbstractSitemapObjectObjectType implements ISitemapObjectObjectType {
+ /**
+ * A guest user profile.
+ *
+ * @var UserProfile
+ */
+ protected static $userProfile = null;
+
+ /**
+ * @inheritDoc
+ */
+ public function getObjectListClass() {
+ return $this->getObjectClass() . 'List';
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function getObjectList() {
+ $className = $this->getObjectListClass();
+ return new $className;
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function getLastModifiedColumn() {
+ return false;
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function canView(DatabaseObject $object) {
+ return true;
+ }
+
+ /**
+ * Returns a guest user profile.
+ *
+ * @return UserProfile
+ */
+ public static function getGuestUserProfile() {
+ if (self::$userProfile === null) {
+ $user = new User(null, []);
+ self::$userProfile = new UserProfile($user);
+ }
+
+ return self::$userProfile;
+ }
+}
--- /dev/null
+<?php
+namespace wcf\system\sitemap\object;
+use wcf\data\DatabaseObject;
+
+/**
+ * Interface for sitemap objects.
+ *
+ * @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\Sitemap\Object
+ * @since 3.1
+ */
+interface ISitemapObjectObjectType {
+ /**
+ * Returns the DatabaseObject class name for the sitemap object.
+ *
+ * @return string
+ */
+ public function getObjectClass();
+
+ /**
+ * Returns the DatabaseObjectList class name for the sitemap object.
+ *
+ * @return string
+ */
+ public function getObjectListClass();
+
+ /**
+ * Returns the DatabaseObjectList for the sitemap object.
+ *
+ * @return string
+ */
+ public function getObjectList();
+
+ /**
+ * Returns the database column, which represents the last modified date.
+ * If there isn't any column, this method should return false.
+ *
+ * @return string|null
+ */
+ public function getLastModifiedColumn();
+
+ /**
+ * Returns the permission for a guest to view a certain object for this object type.
+ *
+ * @param DatabaseObject $object
+ * @return boolean
+ */
+ public function canView(DatabaseObject $object);
+}