Added ad location styling
authorMarcel Werk <burntime@woltlab.com>
Fri, 19 Sep 2014 18:07:32 +0000 (20:07 +0200)
committerMarcel Werk <burntime@woltlab.com>
Fri, 19 Sep 2014 18:07:32 +0000 (20:07 +0200)
com.woltlab.wcf/objectType.xml
com.woltlab.wcf/templates/footer.tpl
com.woltlab.wcf/templates/header.tpl
wcfsetup/install/files/lib/system/ad/AdHandler.class.php
wcfsetup/install/files/style/layout.less

index 0d875b4723fb4485a330639f711baca741f8ab26..4a9c9c370dbb528460f2d0d3728ab59e993f0c3e 100644 (file)
                        <name>com.woltlab.wcf.logo</name>
                        <definitionname>com.woltlab.wcf.adLocation</definitionname>
                        <categoryname>com.woltlab.wcf.global</categoryname>
+                       <cssclassname>wcfAdLocationLogo</cssclassname>
                </type>
                <type>
                        <name>com.woltlab.wcf.header.content</name>
                        <definitionname>com.woltlab.wcf.adLocation</definitionname>
                        <categoryname>com.woltlab.wcf.global</categoryname>
+                       <cssclassname>wcfAdLocationHeaderContent</cssclassname>
                </type>
                <type>
                        <name>com.woltlab.wcf.footer.content</name>
                        <definitionname>com.woltlab.wcf.adLocation</definitionname>
                        <categoryname>com.woltlab.wcf.global</categoryname>
+                       <cssclassname>wcfAdLocationFooterContent</cssclassname>
                </type>
                <type>
                        <name>com.woltlab.wcf.sidebar.top</name>
                        <definitionname>com.woltlab.wcf.adLocation</definitionname>
                        <categoryname>com.woltlab.wcf.global</categoryname>
+                       <cssclassname>wcfAdLocationSidebarTop</cssclassname>
                </type>
                <type>
                        <name>com.woltlab.wcf.sidebar.bottom</name>
                        <definitionname>com.woltlab.wcf.adLocation</definitionname>
                        <categoryname>com.woltlab.wcf.global</categoryname>
+                       <cssclassname>wcfAdLocationSidebarBottom</cssclassname>
                </type>
                <type>
                        <name>com.woltlab.wcf.footer.bottom</name>
                        <definitionname>com.woltlab.wcf.adLocation</definitionname>
                        <categoryname>com.woltlab.wcf.global</categoryname>
+                       <cssclassname>wcfAdLocationFooterBottom</cssclassname>
                </type>
                <!-- /ad locations -->
                
index cb662b6db9c88f52c397563a8f4e976240350966..48b0d0daac20f0b0ce5b79d84aac356df92dc477 100644 (file)
@@ -3,13 +3,7 @@
                                {if $skipBreadcrumbs|empty}{include file='breadcrumbs' __microdata=false}{/if}
                                
                                {if MODULE_WCF_AD}
-                                       {hascontent}
-                                               <div class="marginTop">
-                                                       {content}
-                                                               {@$__wcf->getAdHandler()->getAds('com.woltlab.wcf.footer.content')}
-                                                       {/content}
-                                               </div>
-                                       {/hascontent}
+                                       {@$__wcf->getAdHandler()->getAds('com.woltlab.wcf.footer.content')}
                                {/if}
                        </section>
                        
@@ -46,7 +40,9 @@
                        {event name='copyright'}
                </div>
                
-               {if MODULE_WCF_AD}{@$__wcf->getAdHandler()->getAds('com.woltlab.wcf.footer.bottom')}{/if}
+               {if MODULE_WCF_AD}
+                       {@$__wcf->getAdHandler()->getAds('com.woltlab.wcf.footer.bottom')}
+               {/if}
        </div>
 </footer>
 
index df548d93e9c21f8d04c107222338af72d55ea03e..ce405c41e883748e9f9d8f3a873f8fd91e93e9c2 100644 (file)
                </nav>
                
                <div id="logo" class="logo">
+                       {if MODULE_WCF_AD}{@$__wcf->getAdHandler()->getAds('com.woltlab.wcf.logo')}{/if}
+                       
                        <a href="{link}{/link}">
                                {if $__wcf->getStyleHandler()->getStyle()->getPageLogo()}
                                        <img src="{$__wcf->getStyleHandler()->getStyle()->getPageLogo()}" alt="" />
                                {/if}
                                {event name='headerLogo'}
                        </a>
-                       
-                       {if MODULE_WCF_AD}{@$__wcf->getAdHandler()->getAds('com.woltlab.wcf.logo')}{/if}
                </div>
                
                {event name='headerContents'}
index aea2abc70047d386745f047c4f5ed28ba66d2a2c..d8450e2bd72c06e73d55d381efbb9423bb486d24 100644 (file)
@@ -56,7 +56,11 @@ class AdHandler extends SingletonFactory {
                        $output .= $ad->ad;
                }
                
-               return $output;
+               if (!empty($output)) {
+                       return '<div class="wcfAdLocation' . ($this->objectTypes[$adLocation]->cssclassname ? (' ' . $this->objectTypes[$adLocation]->cssclassname) : '') . '"><div>' . $output . '</div></div>';
+               }
+               
+               return '';
        }
        
        /**
index 49c38bda99508a886efbc379b0c0e7d02de9a070..95ff873a23132749b2c9208d65068ac573f261b4 100644 (file)
@@ -2296,6 +2296,43 @@ ul.inlineDataList {
        }
 }
 
+/* ad locations */
+.wcfAdLocationHeaderContent,
+.wcfAdLocationFooterContent,
+.wcfAdLocationFooterBottom {
+       text-align: center;
+       
+       > div {
+               display: inline-block;
+               text-align: left;
+       }
+}
+
+.wcfAdLocationHeaderContent {
+       margin-top: @wcfGapSmall;
+}
+
+.wcfAdLocationFooterContent,
+.wcfAdLocationFooterBottom {
+       margin-top: @wcfGapMedium;
+}
+
+.wcfAdLocationSidebarTop,
+.wcfAdLocationSidebarBottom {
+       padding: 0 @wcfGapMedium @wcfGapMedium;
+       text-align: center;
+       
+       > div {
+               display: inline-block;
+               text-align: left;
+       }
+}
+
+.wcfAdLocationLogo {
+       float: right;
+       padding: @wcfGapMedium @wcfGapMedium 0 @wcfGapMedium;
+}
+
 /* print version */
 @media print {
        * {