From 1da66356d0aa30ef895a2b820688d52577e711ec Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Fri, 19 Sep 2014 20:07:32 +0200 Subject: [PATCH] Added ad location styling --- com.woltlab.wcf/objectType.xml | 6 +++ com.woltlab.wcf/templates/footer.tpl | 12 ++---- com.woltlab.wcf/templates/header.tpl | 4 +- .../files/lib/system/ad/AdHandler.class.php | 6 ++- wcfsetup/install/files/style/layout.less | 37 +++++++++++++++++++ 5 files changed, 54 insertions(+), 11 deletions(-) diff --git a/com.woltlab.wcf/objectType.xml b/com.woltlab.wcf/objectType.xml index 0d875b4723..4a9c9c370d 100644 --- a/com.woltlab.wcf/objectType.xml +++ b/com.woltlab.wcf/objectType.xml @@ -785,31 +785,37 @@ com.woltlab.wcf.logo com.woltlab.wcf.adLocation com.woltlab.wcf.global + wcfAdLocationLogo com.woltlab.wcf.header.content com.woltlab.wcf.adLocation com.woltlab.wcf.global + wcfAdLocationHeaderContent com.woltlab.wcf.footer.content com.woltlab.wcf.adLocation com.woltlab.wcf.global + wcfAdLocationFooterContent com.woltlab.wcf.sidebar.top com.woltlab.wcf.adLocation com.woltlab.wcf.global + wcfAdLocationSidebarTop com.woltlab.wcf.sidebar.bottom com.woltlab.wcf.adLocation com.woltlab.wcf.global + wcfAdLocationSidebarBottom com.woltlab.wcf.footer.bottom com.woltlab.wcf.adLocation com.woltlab.wcf.global + wcfAdLocationFooterBottom diff --git a/com.woltlab.wcf/templates/footer.tpl b/com.woltlab.wcf/templates/footer.tpl index cb662b6db9..48b0d0daac 100644 --- a/com.woltlab.wcf/templates/footer.tpl +++ b/com.woltlab.wcf/templates/footer.tpl @@ -3,13 +3,7 @@ {if $skipBreadcrumbs|empty}{include file='breadcrumbs' __microdata=false}{/if} {if MODULE_WCF_AD} - {hascontent} -
- {content} - {@$__wcf->getAdHandler()->getAds('com.woltlab.wcf.footer.content')} - {/content} -
- {/hascontent} + {@$__wcf->getAdHandler()->getAds('com.woltlab.wcf.footer.content')} {/if} @@ -46,7 +40,9 @@ {event name='copyright'} - {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} diff --git a/com.woltlab.wcf/templates/header.tpl b/com.woltlab.wcf/templates/header.tpl index df548d93e9..ce405c41e8 100644 --- a/com.woltlab.wcf/templates/header.tpl +++ b/com.woltlab.wcf/templates/header.tpl @@ -18,14 +18,14 @@ {event name='headerContents'} diff --git a/wcfsetup/install/files/lib/system/ad/AdHandler.class.php b/wcfsetup/install/files/lib/system/ad/AdHandler.class.php index aea2abc700..d8450e2bd7 100644 --- a/wcfsetup/install/files/lib/system/ad/AdHandler.class.php +++ b/wcfsetup/install/files/lib/system/ad/AdHandler.class.php @@ -56,7 +56,11 @@ class AdHandler extends SingletonFactory { $output .= $ad->ad; } - return $output; + if (!empty($output)) { + return '
' . $output . '
'; + } + + return ''; } /** diff --git a/wcfsetup/install/files/style/layout.less b/wcfsetup/install/files/style/layout.less index 49c38bda99..95ff873a23 100644 --- a/wcfsetup/install/files/style/layout.less +++ b/wcfsetup/install/files/style/layout.less @@ -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 { * { -- 2.20.1