Add data attributes to body
authorMatthias Schmidt <gravatronics@live.com>
Thu, 14 Aug 2014 16:16:07 +0000 (18:16 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Thu, 14 Aug 2014 16:16:07 +0000 (18:16 +0200)
Furthermore, the body id for new templates will be `tpl_{$templateNameApplication}_{$templateName}`, the old format `tpl{$templateName|ucfirst}` is deprecated and you should not rely on it anymore.

40 files changed:
com.woltlab.wcf/templates/accountManagement.tpl
com.woltlab.wcf/templates/avatarEdit.tpl
com.woltlab.wcf/templates/cookiePolicy.tpl
com.woltlab.wcf/templates/dashboard.tpl
com.woltlab.wcf/templates/deletedContentList.tpl
com.woltlab.wcf/templates/disclaimer.tpl
com.woltlab.wcf/templates/editHistory.tpl
com.woltlab.wcf/templates/emailActivation.tpl
com.woltlab.wcf/templates/emailNewActivationCode.tpl
com.woltlab.wcf/templates/following.tpl
com.woltlab.wcf/templates/ignoredUsers.tpl
com.woltlab.wcf/templates/login.tpl
com.woltlab.wcf/templates/lostPassword.tpl
com.woltlab.wcf/templates/mail.tpl
com.woltlab.wcf/templates/membersList.tpl
com.woltlab.wcf/templates/moderationActivation.tpl
com.woltlab.wcf/templates/moderationList.tpl
com.woltlab.wcf/templates/moderationReport.tpl
com.woltlab.wcf/templates/newPassword.tpl
com.woltlab.wcf/templates/notificationList.tpl
com.woltlab.wcf/templates/notificationSettings.tpl
com.woltlab.wcf/templates/offline.tpl
com.woltlab.wcf/templates/permissionDenied.tpl
com.woltlab.wcf/templates/privacyPolicy.tpl
com.woltlab.wcf/templates/recentActivityList.tpl
com.woltlab.wcf/templates/redirect.tpl
com.woltlab.wcf/templates/register.tpl
com.woltlab.wcf/templates/registerActivation.tpl
com.woltlab.wcf/templates/registerNewActivationCode.tpl
com.woltlab.wcf/templates/search.tpl
com.woltlab.wcf/templates/searchResult.tpl
com.woltlab.wcf/templates/settings.tpl
com.woltlab.wcf/templates/signatureEdit.tpl
com.woltlab.wcf/templates/tagged.tpl
com.woltlab.wcf/templates/team.tpl
com.woltlab.wcf/templates/user.tpl
com.woltlab.wcf/templates/userSearch.tpl
com.woltlab.wcf/templates/usersOnlineList.tpl
wcfsetup/install/files/acp/templates/header.tpl
wcfsetup/install/files/lib/page/AbstractPage.class.php

index 393f617640f622a4a130b60a24dd3a7f92e3529d..3ac519e053dd9c1feec56519d5f413160a89ab1b 100644 (file)
@@ -6,7 +6,7 @@
        {include file='headInclude'}
 </head>
 
-<body id="tpl{$templateName|ucfirst}">
+<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
 
 {include file='userMenuSidebar'}
 
index 638300f9beb83912a5d40252aa7df44681cf7136..56c25c17cf073dbddc5e47aee2b39d9acb3d06e4 100644 (file)
@@ -6,7 +6,7 @@
        {include file='headInclude'}
 </head>
 
-<body id="tpl{$templateName|ucfirst}">
+<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
 
 {include file='userMenuSidebar'}
 
index 57b8c6d802f0ae531edde70f9399b14323ed1ab2..b5d3a1b9a2866f5812b6949f80bdbc8ae77a71eb 100644 (file)
@@ -6,7 +6,7 @@
        {include file='headInclude'}
 </head>
 
-<body id="tpl{$templateName|ucfirst}">
+<body id="tpl_{$templateNameApplication}_{$templateName}" data-template="{$templateName}" data-application="{$templateNameApplication}">
 
 {include file='header'}
 
index 4bef0a4e57d42b27a29ca017394c9be94c397205..a3b3daf148c7cee0c49027869a4c0404528b4825 100644 (file)
@@ -8,7 +8,7 @@
        <link rel="canonical" href="{link controller='Dashboard'}{/link}" />
 </head>
 
-<body id="tpl{$templateName|ucfirst}">
+<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
 
 {if $__boxSidebar|isset && $__boxSidebar}
        {capture assign='sidebar'}
index b9f095503a05c25d661d324aac4ff5a35694d814..23ea687f88436eb64eed48d5fe3e221f5b9fe760 100644 (file)
@@ -6,7 +6,7 @@
        {include file='headInclude'}
 </head>
 
-<body id="tpl{$templateName|ucfirst}">
+<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
 
 {capture assign='sidebar'}
        <fieldset>
index 22e25911ec7249ccd83a3aa0889ee4f42d6931ad..7fe579bbfa655ed9d8dc57e6616938cec8d8e850 100644 (file)
@@ -6,7 +6,7 @@
        {include file='headInclude'}
 </head>
 
-<body id="tpl{$templateName|ucfirst}">
+<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
 
 {include file='header'}
 
index 1fc8253ebb1425b493eae9f54526f05c17aadc2d..f24b23eb37a41113bdb5b664ad4a568b07ae5c7e 100644 (file)
@@ -6,7 +6,7 @@
        {include file='headInclude'}
 </head>
 
-<body id="tpl{$templateName|ucfirst}">
+<body id="tpl_{$templateNameApplication}_{$templateName}" data-template="{$templateName}" data-application="{$templateNameApplication}">
 
 {include file='header'}
 
index da398c23c60d1ce6388ba5d942351945d49de56d..beaf43ae083f12e99a5ebfa1ee78a41e87a78b66 100644 (file)
@@ -6,7 +6,7 @@
        {include file='headInclude'}
 </head>
 
-<body id="tpl{$templateName|ucfirst}">
+<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
 
 {include file='header'}
 
index 2958ac6c85b66eba0ec3796d634e677a110c0735..2e3c4a8ed7c4e6433b615e0b4e0d5a19e758a98b 100644 (file)
@@ -5,7 +5,7 @@
        {include file='headInclude'}
 </head>
 
-<body id="tpl{$templateName|ucfirst}">
+<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
 
 {include file='header'}
 
index 61e8afcb0c763d273388abc353b50581ae548a40..53fc307c051156950cbc10de81af9ec9e1974210 100644 (file)
@@ -13,7 +13,7 @@
        </script>
 </head>
 
-<body id="tpl{$templateName|ucfirst}">
+<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
 
 {include file='userMenuSidebar'}
 
index 112045b79ced197c270090389a4a85b7c5feb314..3da0757b9d48894ca5a4f7aac7189048bea4be5c 100644 (file)
@@ -13,7 +13,7 @@
        </script>
 </head>
 
-<body id="tpl{$templateName|ucfirst}">
+<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
 
 {include file='userMenuSidebar'}
 
index cc68f2bf82114f9bb8d7347a67260dd71799b841..8a5a2479412a63971d01d0359a4d603c293c2525 100644 (file)
@@ -14,7 +14,7 @@
        </script>
 </head>
 
-<body id="tpl{$templateName|ucfirst}">
+<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
 {include file='header' __disableLoginLink=true}
 
 <header class="boxHeadline">
index d8d4929f765ab291858246d2514e7ac16ecd96ec..66f87a290894769271735262972b2858ae89c055 100644 (file)
@@ -13,7 +13,7 @@
        </script>
 </head>
 
-<body id="tpl{$templateName|ucfirst}">
+<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
 
 {include file='header'}
 
index 71b2beecc807a336d5f05b2a2b5ec3ae1cb3d79f..9f9eeea2a0b666fb6f3ae2379db898a6153ed8ad 100644 (file)
@@ -6,7 +6,7 @@
        {include file='headInclude'}
 </head>
 
-<body id="tpl{$templateName|ucfirst}">
+<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
 {include file='header'}
 
 <header class="boxHeadline">
index f98c3d5c27ea72bc6e161143c2f3bd0ea28cb327..81524be4d7c5523d3f4c7555659ec73d9e35be2b 100644 (file)
@@ -36,7 +36,7 @@
        </script>
 </head>
 
-<body id="tpl{$templateName|ucfirst}">
+<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
 
 {capture assign='sidebar'}
        {assign var=encodedLetter value=$letter|rawurlencode}
index 0ad592644f94c547bf427748ad5fdd8288bfdb69..84eec7f9f0a43338f9f71b76bbdf74ce9a9e088f 100644 (file)
@@ -24,7 +24,7 @@
        </script>
 </head>
 
-<body id="tpl{$templateName|ucfirst}">
+<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
 
 {include file='header'}
 
index 9ac6db16a753223a7444142f717fb6fb72c615dd..228e8b9f50fc8c290bc5f5842df3510417ca0c9a 100644 (file)
@@ -6,7 +6,7 @@
        {include file='headInclude'}
 </head>
 
-<body id="tpl{$templateName|ucfirst}">
+<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
 
 {capture assign='sidebar'}
        {* moderation type *}
index b5da14e9a4c224356b7e64e4eed9780dbcff6fa9..bdb16a53d69c247446e178b709ddbfbd6bddffc3 100644 (file)
@@ -25,7 +25,7 @@
        </script>
 </head>
 
-<body id="tpl{$templateName|ucfirst}">
+<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
 
 {include file='header'}
 
index 7a54de71b2e3280b063836fc33c27ace04f81ec0..851513f7ba6a1ea496ff24025aca049c207e3b00 100644 (file)
@@ -5,7 +5,7 @@
        {include file='headInclude'}
 </head>
 
-<body id="tpl{$templateName|ucfirst}">
+<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
 
 {include file='header'}
 
index 6c4843ac00e1ea4cb5f4a73a3bbacb4641643969..8548245ea33271e3c17255d891c0ef81409b1538 100644 (file)
@@ -17,7 +17,7 @@
        </script>
 </head>
 
-<body id="tpl{$templateName|ucfirst}">
+<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
 
 {include file='userMenuSidebar'}
 
index 5129d75e96dfdfa0deed2d47d4be6d76df8d9d26..2b3b5af428f2beffb74b8e9e46cccb3cea6e1e6c 100644 (file)
@@ -23,7 +23,7 @@
        </script>
 </head>
 
-<body id="tpl{$templateName|ucfirst}">
+<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
 
 {include file='userMenuSidebar'}
 
index d67f20f393c72b47f7fbf056478f9eedbb3d6724..c5a5e02729b60ba69fd7d4fa53f4f0ded6f057a8 100644 (file)
@@ -6,7 +6,7 @@
        {include file='headInclude'}
 </head>
 
-<body id="tpl{$templateName|ucfirst}">
+<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
 
 {include file='header' skipBreadcrumbs=true}
 
index 7c56d4546ad997ad2e70a2e2e251a6a3ad1b312c..a8c5f8ad034f4ab06bf23255bd18a55817bd0166 100644 (file)
@@ -6,7 +6,7 @@
        {include file='headInclude'}
 </head>
 
-<body id="tpl{$templateName|ucfirst}">
+<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
 
 {include file='header'}
 
index 390e9e61b0f7e1f5f8b2f6b46a97c8dc5a8b279a..0432c5607c32ec0e7665fd89dc98e065fdda9703 100644 (file)
@@ -6,7 +6,7 @@
        {include file='headInclude'}
 </head>
 
-<body id="tpl{$templateName|ucfirst}">
+<body id="tpl_{$templateNameApplication}_{$templateName}" data-template="{$templateName}" data-application="{$templateNameApplication}">
 
 {include file='header'}
 
index 4ffb353541b1511d1fac3bcfd55fb07b48b0525d..4397e8bfc762ca423cbbd857583c8977d48b297e 100644 (file)
@@ -21,7 +21,7 @@
        </script>
 </head>
 
-<body id="tpl{$templateName|ucfirst}">
+<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
 
 {capture assign='sidebar'}
        {@$__boxSidebar}
index 4827f3cd58a376979b7382f12a9d55f16ab96d1c..c34cd4040182b88e58a69997e6c3487e5b5cfdfe 100644 (file)
@@ -8,7 +8,7 @@
        <meta http-equiv="refresh" content="{if $wait|isset}{@$wait}{else}10{/if};URL={$url}" />
 </head>
 
-<body id="tpl{$templateName|ucfirst}">
+<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
 
 {include file='header'}
 
index 6ebc9c6c0ab9a77c611abcbb41b1461f3237b4a4..ac83cbb709e4e837bed45c607a71e399120a0132 100644 (file)
@@ -39,7 +39,7 @@
        </style>
 </head>
 
-<body id="tpl{$templateName|ucfirst}">
+<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
 {include file='header' __disableLoginLink=true}
 
 <header class="boxHeadline">
index 98d455f5c98ee5caf7ff4c9ffc399bbbd027d7f9..408d587bb5e984be7ee55314e356942a7faa9bf7 100644 (file)
@@ -5,7 +5,7 @@
        {include file='headInclude'}
 </head>
 
-<body id="tpl{$templateName|ucfirst}">
+<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
 
 {include file='header'}
 
index 6d8ee1ca36d8987957cc85bafc076d071fd8db5c..4b71f4ff8d025c696c39fbb170e63c59d6580b5e 100644 (file)
@@ -5,7 +5,7 @@
        {include file='headInclude'}
 </head>
 
-<body id="tpl{$templateName|ucfirst}">
+<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
 
 {include file='header'}
 
index b91643c86fd049bafb754e483a018e8ae12d01f4..02e8240cc834585c916f81fe65057bfac6990aeb 100644 (file)
@@ -6,7 +6,7 @@
        {include file='headInclude'}
 </head>
 
-<body id="tpl{$templateName|ucfirst}">
+<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
 
 {include file='header'}
 
index 30308b020278e192816de95f36b315403f851e1f..20f9c3909cac1f5cd3b92aa8236214e9bf05a2de 100644 (file)
@@ -6,7 +6,7 @@
        {include file='headInclude'}
 </head>
 
-<body id="tpl{$templateName|ucfirst}">
+<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
 
 {include file='header'}
 
index 17ca02b2a157c07e1e16b4d7be27abdb3d5d71f8..cf30d23fd9ea226f119c151957e4b733847bf2f1 100644 (file)
@@ -5,7 +5,7 @@
        {include file='headInclude'}
 </head>
 
-<body id="tpl{$templateName|ucfirst}">
+<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
 
 {include file='userMenuSidebar'}
 
index c456d63203ce8b343e3b18bca3c54e381c74359f..0d61687c6704c810cba99ac835c036937b167ba2 100644 (file)
@@ -18,7 +18,7 @@
        </script>
 </head>
 
-<body id="tpl{$templateName|ucfirst}">
+<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
 
 {include file='userMenuSidebar'}
 
index 3caa1aae7441f16b263100efff47835be8d73574..82c279061baca0a2dba4e0802b48acd36cb99703 100644 (file)
@@ -14,7 +14,7 @@
        <link rel="canonical" href="{link controller='Tagged' object=$tag}objectType={@$objectType}{if $pageNo > 1}&pageNo={@$pageNo}{/if}{/link}" />
 </head>
 
-<body id="tpl{$templateName|ucfirst}">
+<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
 
 {capture assign='sidebar'}
        <fieldset>
index f43761271abdfad1f1ba2cba4e6cb0c50e2fd402..7c33e88f5d96f886c1612f855f5af173ebc3fcff 100644 (file)
@@ -24,7 +24,7 @@
        </script>
 </head>
 
-<body id="tpl{$templateName|ucfirst}">
+<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
 
 {capture assign='sidebar'}
        {@$__boxSidebar}
index ad5ffae20ef09b9d45533e97b2d7ff8e2d32c91b..e4be82e01834320535bf19a0dd900038437d3706 100644 (file)
        </noscript>
 </head>
 
-<body id="tpl{$templateName|ucfirst}">
+<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
 
 {include file='userSidebar' assign='sidebar'}
 
index ba522b247f36321937ba76c21975e31ee504a0d8..ccc48528f9ec690bb2aeb41c37948cf720f08703 100644 (file)
@@ -14,7 +14,7 @@
        </script>
 </head>
 
-<body id="tpl{$templateName|ucfirst}">
+<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
 
 {capture assign='sidebar'}
        {@$__boxSidebar}
index 90bb553f5e1cdb60f12607d5989a2f724a7ef748..dde3f8e689019b0fabd6f1e6d6f6d6befff260af 100644 (file)
@@ -28,7 +28,7 @@
        {/if}
 </head>
 
-<body id="tpl{$templateName|ucfirst}">
+<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
 
 {capture assign='sidebar'}
        <div>
index a2b21c58636928eb0ea9ec1dee1041230fcbcad6..2cfa04346dc74afeb3e08acd304bebb548f52798 100644 (file)
        </script>
 </head>
 
-<body id="tpl{$templateName|ucfirst}" class="wcfAcp">
+<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}" class="wcfAcp">
        <a id="top"></a>
        
        <header id="pageHeader" class="layoutFluid">
index 515847bbdbf5197b51019a3d354a79a3fcc22b42..7b4117a604b3b243d7f93c6949775ceb17764566 100644 (file)
@@ -73,6 +73,12 @@ abstract class AbstractPage implements IPage, ITrackablePage {
         */
        public $templateName = '';
        
+       /**
+        * abbreviation of the application the template belongs to
+        * @var string
+        */
+       public $templateNameApplication = '';
+       
        /**
         * enables template usage
         * @var string
@@ -263,10 +269,16 @@ abstract class AbstractPage implements IPage, ITrackablePage {
                        // assign guessed template name
                        WCF::getTPL()->assign('templateName', $this->templateName);
                }
+               if (empty($this->templateNameApplication)) {
+                       $this->templateNameApplication = array_shift($classParts);
+                       
+                       // assign guessed template application
+                       WCF::getTPL()->assign('templateNameApplication', $this->templateNameApplication);
+               }
                
                if ($this->useTemplate) {
                        // show template
-                       WCF::getTPL()->display($this->templateName, array_shift($classParts));
+                       WCF::getTPL()->display($this->templateName, $this->templateNameApplication);
                }
        }