Add support for content(Top|Bottom) to RegisterButton box
authorTim Düsterhus <duesterhus@woltlab.com>
Tue, 28 Aug 2018 16:01:11 +0000 (18:01 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Tue, 28 Aug 2018 16:02:21 +0000 (18:02 +0200)
see WoltLab/com.woltlab.wbb#281

com.woltlab.wcf/box.xml
com.woltlab.wcf/templates/boxRegisterButton.tpl
wcfsetup/install/files/lib/system/box/RegisterButtonBoxController.class.php

index 0c67a873ccbe183d8899ccbbe8a3fa8bf97090dd..cb9a507fd082fb51c3fdae6e7b675238d5cf42e9 100644 (file)
@@ -23,8 +23,8 @@
                </box>
                
                <box identifier="com.woltlab.wcf.RegisterButton">
-                       <name language="de">Registrierungs-Button</name>
-                       <name language="en">Register Button</name>
+                       <name language="de">Registrierungs-Button (Seitenleiste)</name>
+                       <name language="en">Register Button (Sidebar)</name>
                        <boxType>system</boxType>
                        <objectType>com.woltlab.wcf.registerButton</objectType>
                        <position>sidebarRight</position>
                        </content>
                </box>
                
+               <box identifier="com.woltlab.wcf.RegisterButton.content">
+                       <name language="de">Registrierungs-Button (Inhaltsbereich)</name>
+                       <name language="en">Register Button (Content)</name>
+                       <boxType>system</boxType>
+                       <objectType>com.woltlab.wcf.registerButton</objectType>
+                       <position>contentBottom</position>
+                       <showHeader>1</showHeader>
+                       <visibleEverywhere>0</visibleEverywhere>
+                       
+                       <content language="de">
+                               <title>Jetzt mitmachen!</title>
+                       </content>
+                       <content language="en">
+                               <title>Participate now!</title>
+                       </content>
+               </box>
+               
                <box identifier="com.woltlab.wcf.SignedInAs">
                        <name language="de">Angemeldet als</name>
                        <name language="en">Signed In As</name>
index 7a0f5f512f929ed6c898c1c7918b429d1158ab57..d5d60839d9eec1a2e2e7abec9c7b7cddcda7aabe 100644 (file)
@@ -1,3 +1,14 @@
+{if $box->position == 'sidebarLeft' || $box->position == 'sidebarRight'}
 <p>{lang}wcf.user.login.register.teaser{/lang}</p>
 
 <div class="formSubmit"><a href="{link controller='Register'}{/link}" class="button buttonPrimary">{lang}wcf.user.login.register.registerNow{/lang}</a></div>
+{elseif $box->position == 'contentTop' || $box->position == 'contentBottom'}
+<div class="info">
+       <p>{lang}wcf.user.login.register.teaser{/lang}</p>
+
+       <div class="formSubmit">
+               <a href="{link controller='Register'}{/link}" class="button buttonPrimary">{lang}wcf.user.login.register.registerNow{/lang}</a>
+               <a href="{link controller='Login'}{/link}" class="button buttonPrimary">{lang}wcf.user.button.login{/lang}</a>
+       </div>
+</div>
+{/if}
index fca38ea5b3c194ebd8d27dad70f8cb7f2d5fb89a..06c1b3200c624a883720da0f40a88155f6823918 100644 (file)
@@ -15,14 +15,14 @@ class RegisterButtonBoxController extends AbstractBoxController {
        /**
         * @inheritDoc
         */
-       protected static $supportedPositions = ['sidebarLeft', 'sidebarRight'];
+       protected static $supportedPositions = ['contentTop', 'contentBottom', 'sidebarLeft', 'sidebarRight'];
        
        /**
         * @inheritDoc
         */
        protected function loadContent() {
                if (!WCF::getUser()->userID && !REGISTER_DISABLED) {
-                       $this->content = WCF::getTPL()->fetch('boxRegisterButton', 'wcf', [], true);
+                       $this->content = WCF::getTPL()->fetch('boxRegisterButton', 'wcf', ['box' => $this->box], true);
                }
        }
 }