Show number of styles referencing a template group
authorMatthias Schmidt <gravatronics@live.com>
Wed, 23 Dec 2020 15:22:22 +0000 (16:22 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Wed, 23 Dec 2020 15:22:22 +0000 (16:22 +0100)
Close #3747

wcfsetup/install/files/acp/templates/templateGroupList.tpl
wcfsetup/install/files/lib/acp/page/TemplateGroupListPage.class.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index 3b43cd9e8223457a826e2bc5795b5dfbca4691c7..fa2516850cafaae36345f96ddfb0f2d36f6eefd1 100644 (file)
@@ -47,6 +47,7 @@
                                        <th class="columnTitle columnTemplateGroupName{if $sortField == 'templateGroupName'} active {@$sortOrder}{/if}"><a href="{link controller='TemplateGroupList'}pageNo={@$pageNo}&sortField=templateGroupName&sortOrder={if $sortField == 'templateGroupName' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.global.name{/lang}</a></th>
                                        <th class="columnText columnTemplateGroupFolderName{if $sortField == 'templateGroupFolderName'} active {@$sortOrder}{/if}"><a href="{link controller='TemplateGroupList'}pageNo={@$pageNo}&sortField=templateGroupFolderName&sortOrder={if $sortField == 'templateGroupFolderName' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.acp.template.group.folderName{/lang}</a></th>
                                        <th class="columnDigits columnTemplates{if $sortField == 'templates'} active {@$sortOrder}{/if}"><a href="{link controller='TemplateGroupList'}pageNo={@$pageNo}&sortField=templates&sortOrder={if $sortField == 'templates' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.acp.template.group.templates{/lang}</a></th>
+                                       <th class="columnDigits columnStyles{if $sortField == 'styles'} active {@$sortOrder}{/if}"><a href="{link controller='TemplateGroupList'}pageNo={@$pageNo}&sortField=styles&sortOrder={if $sortField == 'styles' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.acp.template.group.styles{/lang}</a></th>
                                        
                                        {event name='columnHeads'}
                                </tr>
@@ -84,6 +85,7 @@
                                                </td>
                                                <td class="columnText columnTemplateGroupFolderName">{$templateGroup->templateGroupFolderName}</td>
                                                <td class="columnDigits columnTemplates">{#$templateGroup->templates}</td>
+                                               <td class="columnDigits columnStyles">{#$templateGroup->styles}</td>
                                                
                                                {event name='columns'}
                                        </tr>
index 328022f9576e575d42312596ba43a06e6de78693..9387369ba0d46cd5625acbf533075edcc49a66e5 100644 (file)
@@ -37,7 +37,7 @@ class TemplateGroupListPage extends SortablePage {
        /**
         * @inheritDoc
         */
-       public $validSortFields = ['templateGroupID', 'templateGroupName', 'templateGroupFolderName', 'templates'];
+       public $validSortFields = ['templateGroupID', 'templateGroupName', 'templateGroupFolderName', 'templates', 'styles'];
        
        /**
         * @inheritDoc
@@ -45,6 +45,7 @@ class TemplateGroupListPage extends SortablePage {
        protected function initObjectList() {
                parent::initObjectList();
                
-               $this->objectList->sqlSelects = "(SELECT COUNT(*) FROM wcf".WCF_N."_template WHERE templateGroupID = template_group.templateGroupID) AS templates";
+               $this->objectList->sqlSelects = "(SELECT COUNT(*) FROM wcf".WCF_N."_template WHERE templateGroupID = template_group.templateGroupID) AS templates,
+                                                (SELECT COUNT(*) FROM wcf".WCF_N."_style WHERE templateGroupID = template_group.templateGroupID) AS styles";
        }
 }
index 03938864165f266707697644616c5a0401e9dad2..30d6425de4212e7b114f6f450e6a50fe35662419 100644 (file)
@@ -2997,6 +2997,7 @@ Kein Abschnitt darf leer sein und alle Abschnitten dürfen nur folgende Zeichen
                <item name="wcf.acp.template.group.copy"><![CDATA[Templategruppe kopieren]]></item>
                <item name="wcf.acp.template.group.edit"><![CDATA[Templategruppe bearbeiten]]></item>
                <item name="wcf.acp.template.group.templates"><![CDATA[Templates]]></item>
+               <item name="wcf.acp.template.group.styles"><![CDATA[Stile]]></item>
                <item name="wcf.acp.template.error.noGroups"><![CDATA[Bevor {if LANGUAGE_USE_INFORMAL_VARIANT}du{else}Sie{/if} ein eigenes Template erstellen {if LANGUAGE_USE_INFORMAL_VARIANT}kannst{else}können{/if}, {if LANGUAGE_USE_INFORMAL_VARIANT}musst du{else}müssen Sie{/if} eine <a href="{link controller='TemplateGroupAdd'}{/link}">Templategruppe hinzufügen</a>.]]></item>
                <item name="wcf.acp.template.group.folderName"><![CDATA[Verzeichnis]]></item>
                <item name="wcf.acp.template.group.parentTemplateGroup"><![CDATA[Übergeordnete Templategruppe]]></item>
index 3585fb9a30a74aed089ec2ce8cb871f351d6d79a..4ca3a662839eeda93f475776d5346de01bca24f7 100644 (file)
@@ -2925,6 +2925,7 @@ If you have <strong>already bought the licenses for the listed apps</strong>, th
                <item name="wcf.acp.template.group.copy"><![CDATA[Copy Template Group]]></item>
                <item name="wcf.acp.template.group.edit"><![CDATA[Edit Template Group]]></item>
                <item name="wcf.acp.template.group.templates"><![CDATA[Templates]]></item>
+               <item name="wcf.acp.template.group.styles"><![CDATA[Styles]]></item>
                <item name="wcf.acp.template.error.noGroups"><![CDATA[You must create a <a href="{link controller='TemplateGroupAdd'}{/link}">template group</a> first.]]></item>
                <item name="wcf.acp.template.group.folderName"><![CDATA[Directory]]></item>
                <item name="wcf.acp.template.group.parentTemplateGroup"><![CDATA[Parent Template Group]]></item>