add user sitemap
authorJoshua Rüsweg <josh@bastelstu.be>
Fri, 9 Jun 2017 10:10:51 +0000 (12:10 +0200)
committerJoshua Rüsweg <josh@bastelstu.be>
Fri, 9 Jun 2017 10:10:51 +0000 (12:10 +0200)
See #2286

com.woltlab.wcf/objectType.xml
wcfsetup/install/files/acp/templates/sitemapEdit.tpl
wcfsetup/install/files/lib/system/sitemap/object/UserSitemapObject.class.php [new file with mode: 0755]
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index 9ef730f7beab297f689848fe0548d609203c0232..0f466bdca47bc63740fc3224c6e601bbc38ffd3e 100644 (file)
                </type>
                <!-- /media -->
                
+               <!-- sitemap -->
+               <type>
+                       <name>com.woltlab.wcf.sitemap.object.user</name>
+                       <definitionname>com.woltlab.wcf.sitemap.object</definitionname>
+                       <classname>wcf\system\sitemap\object\UserSitemapObject</classname>
+                       <priority>0.5</priority>
+                       <changeFreq>monthly</changeFreq>
+                       <rebuildTime>259200</rebuildTime>
+               </type>
+               <!-- /sitemap -->
+               
                <!-- deprecated -->
                <type>
                        <name>com.woltlab.wcf.page.controller</name>
index 79b4f72758f9da44aac6ab083de6caa51f4cb1c3..80e053a1f60f61c57925063278da041696658fc1 100755 (executable)
@@ -25,7 +25,7 @@
                <dl{if $errorField == 'priority'} class="formError"{/if}>
                        <dt><label for="priority">{lang}wcf.acp.sitemap.priority{/lang}</label></dt>
                        <dd>
-                               <input type="number" id="priority" name="priority" step="0.1" min="0" max="1" value="{$priority}" class="medium"/>
+                               <input type="number" id="priority" name="priority" step="0.1" min="0" max="1" value="{$priority}" class="short"/>
                                {if $errorField == 'priority'}
                                        <small class="innerError">
                                                {lang}wcf.acp.sitemap.priority.error.{$errorType}{/lang}
diff --git a/wcfsetup/install/files/lib/system/sitemap/object/UserSitemapObject.class.php b/wcfsetup/install/files/lib/system/sitemap/object/UserSitemapObject.class.php
new file mode 100755 (executable)
index 0000000..254b2a5
--- /dev/null
@@ -0,0 +1,36 @@
+<?php
+namespace wcf\system\sitemap\object;
+use wcf\data\user\User;
+use wcf\data\DatabaseObject;
+
+/**
+ * User sitemap implementation.
+ *
+ * @author     Joshua Ruesweg
+ * @copyright  2001-2017 WoltLab GmbH
+ * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package    WoltLabSuite\Core\Sitemap\Object
+ * @since      3.1
+ */
+class UserSitemapObject extends AbstractSitemapObjectObjectType {
+       /**
+        * @inheritDoc
+        */
+       public function getObjectClass() {
+               return User::class;
+       }
+       
+       /**
+        * @inheritDoc
+        */
+       public function getLastModifiedColumn() {
+               return 'lastActivityTime';
+       }
+       
+       /**
+        * @inheritDoc
+        */
+       public function canView(DatabaseObject $object) {
+               return self::getGuestUserProfile()->getPermission('user.profile.canViewUserProfile');
+       }
+}
index 2e9503537497a792ef519f10952cd13ca79ead36..329a9dc433e1d46ce38a468f8d888ee03d16f715 100644 (file)
@@ -1596,6 +1596,7 @@ GmbH=Gesellschaft mit beschränkter Haftung]]></item>
                <item name="wcf.acp.sitemap.isDisabled"><![CDATA[Sitemap deaktiviert]]></item>
                <item name="wcf.acp.sitemap.enabled"><![CDATA[Sitemap aktiviert]]></item>
                <item name="wcf.acp.sitemap.edit"><![CDATA[Sitemap bearbeiten]]></item>
+               <item name="wcf.acp.sitemap.objectType.com.woltlab.wcf.sitemap.object.user"><![CDATA[Benutzer]]></item>
        </category>
        
        <category name="wcf.acp.stat">
index 420459a321f0deb449c5eb2d996eff4bae5cccff..f3d604f3545f1bd826fe37df1143e00691e0835f 100644 (file)
                <item name="wcf.acp.sitemap.isDisabled"><![CDATA[Disable Sitemap]]></item>
                <item name="wcf.acp.sitemap.enabled"><![CDATA[Sitemap enabled]]></item>
                <item name="wcf.acp.sitemap.edit"><![CDATA[Edit Sitemap]]></item>
+               <item name="wcf.acp.sitemap.objectType.com.woltlab.wcf.sitemap.object.user"><![CDATA[User]]></item>
        </category>
        
        <category name="wcf.acp.stat">