Add stat handler categories
authorMatthias Schmidt <gravatronics@live.com>
Tue, 8 Jul 2014 17:46:00 +0000 (19:46 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Tue, 8 Jul 2014 17:46:00 +0000 (19:46 +0200)
com.woltlab.wcf/objectType.xml
wcfsetup/install/files/acp/templates/stat.tpl
wcfsetup/install/files/lib/acp/page/StatPage.class.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index 30c024b26d2cfb61a0df49e7d4b5c3fa397c02a5..be8a7221f054f2a977eb1c546aac28097eeeb5ca 100644 (file)
                        <definitionname>com.woltlab.wcf.statDailyHandler</definitionname>
                        <classname><![CDATA[wcf\system\stat\UserStatDailyHandler]]></classname>
                        <default>1</default>
+                       <categoryname>com.woltlab.wcf.general</categoryname>
                </type>
                <type>
                        <name>com.woltlab.wcf.attachment</name>
                        <definitionname>com.woltlab.wcf.statDailyHandler</definitionname>
                        <classname><![CDATA[wcf\system\stat\AttachmentStatDailyHandler]]></classname>
+                       <categoryname>com.woltlab.wcf.general</categoryname>
                </type>
                <type>
                        <name>com.woltlab.wcf.attachment.diskUsage</name>
                        <definitionname>com.woltlab.wcf.statDailyHandler</definitionname>
                        <classname><![CDATA[wcf\system\stat\AttachmentDiskUsageStatDailyHandler]]></classname>
+                       <categoryname>com.woltlab.wcf.general</categoryname>
                </type>
                <type>
                        <name>com.woltlab.wcf.like</name>
                        <definitionname>com.woltlab.wcf.statDailyHandler</definitionname>
                        <classname><![CDATA[wcf\system\stat\LikeStatDailyHandler]]></classname>
+                       <categoryname>com.woltlab.wcf.general</categoryname>
                </type>
                <type>
                        <name>com.woltlab.wcf.dislike</name>
                        <definitionname>com.woltlab.wcf.statDailyHandler</definitionname>
                        <classname><![CDATA[wcf\system\stat\DislikeStatDailyHandler]]></classname>
+                       <categoryname>com.woltlab.wcf.general</categoryname>
                </type>
                <!-- /stat handlers -->
                
index f74ae45e5253a50acad77945c0fc377956dbbd45..71ba2ea6d912fdfa09b90c25d4747b96446a0e89 100644 (file)
@@ -15,7 +15,7 @@
                new WCF.ACP.Stat.Chart();
        });
 </script>
-       
+
 <header class="boxHeadline">
        <h1>{lang}wcf.acp.stat{/lang}</h1>
 </header>
                                <label><input type="radio" name="value" value="total" /> {lang}wcf.acp.stat.value.total{/lang}</label>
                        </dd>
                </dl>
+       </fieldset>
+       
+       <fieldset>
+               <legend>{lang}wcf.acp.stat.types{/lang}</legend>
                
-               <dl>
-                       <dt><label>{lang}wcf.acp.stat.types{/lang}</label></dt>
-                       <dd>
-                               {foreach from=$availableObjectTypes item=objectType}
-                                       <label><input type="checkbox" name="objectTypeID" value="{@$objectType->objectTypeID}" {if $objectType->default}checked="checked" {/if}/> {lang}wcf.acp.stat.{@$objectType->objectType}{/lang}</label>
-                               {/foreach}
-                       </dd>
-               </dl>
+               {foreach from=$availableObjectTypes key=categoryName item=objectTypes}
+                       <dl>
+                               <dt><label>{lang}wcf.acp.stat.category.{@$categoryName}{/lang}</label></dt>
+                               <dd>
+                                       {foreach from=$objectTypes item=objectType}
+                                               <label><input type="checkbox" name="objectTypeID" value="{@$objectType->objectTypeID}" {if $objectType->default}checked="checked" {/if}/> {lang}wcf.acp.stat.{@$objectType->objectType}{/lang}</label>
+                                       {/foreach}
+                               </dd>
+                       </dl>
+               {/foreach}
        </fieldset>
 </div>
 
index 6c80448aaa68f4d917aa2610288ae9f9a472ab9b..82ec3c4bdb9e65e6aa3b2c71bab8314c81d5d63e 100644 (file)
@@ -58,7 +58,14 @@ class StatPage extends AbstractPage {
                $this->startDate = $d->format('Y-m-d');
                
                // get object types
-               $this->availableObjectTypes = ObjectTypeCache::getInstance()->getObjectTypes('com.woltlab.wcf.statDailyHandler');
+               $objectTypes = ObjectTypeCache::getInstance()->getObjectTypes('com.woltlab.wcf.statDailyHandler');
+               foreach ($objectTypes as $objectType) {
+                       if (!isset($this->availableObjectTypes[$objectType->categoryname])) {
+                               $this->availableObjectTypes[$objectType->categoryname] = array();
+                       }
+                       
+                       $this->availableObjectTypes[$objectType->categoryname][] = $objectType;
+               }
        }
        
        /**
index c7e491c3dc29c87fc41f3e076b19e34344f6c7dd..52954158722d9a07e778f120e359f732a3eb6732 100644 (file)
@@ -1234,6 +1234,7 @@ GmbH=Gesellschaft mit beschränkter Haftung]]></item>
                <item name="wcf.acp.stat.dateGrouping.weekly"><![CDATA[Woche]]></item>
                <item name="wcf.acp.stat.dateGrouping.monthly"><![CDATA[Monat]]></item>
                <item name="wcf.acp.stat.dateGrouping.yearly"><![CDATA[Jahr]]></item>
+               <item name="wcf.acp.stat.category.com.woltlab.wcf.general"><![CDATA[Allgemeine Daten]]></item>
        </category>
        
        <category name="wcf.acp.updateServer">
index 170636d033f5c85dd4438b08a1d63a4ad4600cc4..1585a523bcce059f924416561c6833347f905459 100644 (file)
@@ -1182,27 +1182,28 @@ GmbH=Gesellschaft mit beschränkter Haftung]]></item>
        </category>
        
        <category name="wcf.acp.stat">
-               <item name="wcf.acp.stat"><![CDATA[TODO: Statistiken]]></item>
-               <item name="wcf.acp.stat.settings"><![CDATA[TODO: Einstellungen]]></item>
-               <item name="wcf.acp.stat.period"><![CDATA[TODO: Zeitraum]]></item>
-               <item name="wcf.acp.stat.value"><![CDATA[TODO: Werte]]></item>
+               <item name="wcf.acp.stat"><![CDATA[Statistics]]></item>
+               <item name="wcf.acp.stat.settings"><![CDATA[Settings]]></item>
+               <item name="wcf.acp.stat.period"><![CDATA[Period]]></item>
+               <item name="wcf.acp.stat.value"><![CDATA[Values]]></item>
                <item name="wcf.acp.stat.value.counter"><![CDATA[TODO: Veränderung]]></item>
                <item name="wcf.acp.stat.value.total"><![CDATA[TODO: Gesamtanzahl]]></item>
-               <item name="wcf.acp.stat.types"><![CDATA[TODO: Daten]]></item>
+               <item name="wcf.acp.stat.types"><![CDATA[Data]]></item>
                <item name="wcf.acp.stat.timeFormat.daily"><![CDATA[TODO: %d.%m.%y]]></item>
                <item name="wcf.acp.stat.timeFormat.weekly"><![CDATA[TODO: %d.%m.%y]]></item>
                <item name="wcf.acp.stat.timeFormat.monthly"><![CDATA[TODO: %b %Y]]></item>
                <item name="wcf.acp.stat.timeFormat.yearly"><![CDATA[TODO: %Y]]></item>
-               <item name="wcf.acp.stat.com.woltlab.wcf.user"><![CDATA[TODO: Benutzer]]></item>
-               <item name="wcf.acp.stat.com.woltlab.wcf.attachment"><![CDATA[TODO: Dateianhänge]]></item>
+               <item name="wcf.acp.stat.com.woltlab.wcf.user"><![CDATA[Users]]></item>
+               <item name="wcf.acp.stat.com.woltlab.wcf.attachment"><![CDATA[Attachments]]></item>
                <item name="wcf.acp.stat.com.woltlab.wcf.attachment.diskUsage"><![CDATA[TODO: Dateianhänge-Speicherbedarf (MB)]]></item>
                <item name="wcf.acp.stat.com.woltlab.wcf.like"><![CDATA[Likes]]></item>
                <item name="wcf.acp.stat.com.woltlab.wcf.dislike"><![CDATA[Dislikes]]></item>
-               <item name="wcf.acp.stat.dateGrouping"><![CDATA[TODO: Zeiteinheit]]></item>
-               <item name="wcf.acp.stat.dateGrouping.daily"><![CDATA[TODO: Tag]]></item>
-               <item name="wcf.acp.stat.dateGrouping.weekly"><![CDATA[TODO: Woche]]></item>
-               <item name="wcf.acp.stat.dateGrouping.monthly"><![CDATA[TODO: Monat]]></item>
-               <item name="wcf.acp.stat.dateGrouping.yearly"><![CDATA[TODO: Jahr]]></item>
+               <item name="wcf.acp.stat.dateGrouping"><![CDATA[Time Unit]]></item>
+               <item name="wcf.acp.stat.dateGrouping.daily"><![CDATA[Day]]></item>
+               <item name="wcf.acp.stat.dateGrouping.weekly"><![CDATA[Week]]></item>
+               <item name="wcf.acp.stat.dateGrouping.monthly"><![CDATA[Month]]></item>
+               <item name="wcf.acp.stat.dateGrouping.yearly"><![CDATA[Year]]></item>
+               <item name="wcf.acp.stat.category.com.woltlab.wcf.general"><![CDATA[General Data]]></item>
        </category>
        
        <category name="wcf.acp.updateServer">