From 7eac848574adf52d5b13159f807e4aed3e421c98 Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Tue, 7 Jan 2020 13:23:08 -0500 Subject: [PATCH 1/2] Fix missing footer components --- includes/CitizenTemplate.php | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/includes/CitizenTemplate.php b/includes/CitizenTemplate.php index 02282311..142e6c40 100644 --- a/includes/CitizenTemplate.php +++ b/includes/CitizenTemplate.php @@ -791,27 +791,22 @@ class CitizenTemplate extends BaseTemplate { 'link-prefix' => 'footer', 'icon-style' => 'icononly', ]; - $validFooterIcons = $this->getFooterIcons( $options['icon-style'] ); $validFooterLinks = $this->getFooterLinks(); $html = ''; - $html .= Html::openElement( 'footer', [ 'id' => $options['id'], 'role' => 'contentinfo', 'lang' => $this->get( 'userlang' ), 'dir' => $this->get( 'dir' ), ] ); - $iconsHTML = ''; if ( count( $validFooterIcons ) > 0 ) { $iconsHTML .= Html::openElement( 'div', [ 'id' => "{$options['link-prefix']}-container-icons" ] ); $iconsHTML .= Html::openElement( 'div', [ 'id' => 'footer-bottom-container' ] ); - // Get tagline $iconsHTML .= $this->getFooterTagline(); - $iconsHTML .= Html::openElement( 'ul', [ 'id' => "{$options['link-prefix']}-icons" ] ); foreach ( $validFooterIcons as $blockName => $footerIcons ) { $iconsHTML .= Html::openElement( 'li', [ @@ -827,7 +822,6 @@ class CitizenTemplate extends BaseTemplate { $iconsHTML .= Html::closeElement( 'div' ); $iconsHTML .= Html::closeElement( 'div' ); } - $linksHTML = ''; if ( count( $validFooterLinks ) > 0 ) { $linksHTML .= Html::openElement( 'div', @@ -836,14 +830,12 @@ class CitizenTemplate extends BaseTemplate { 'id' => "{$options['link-prefix']}-list", 'class' => 'footer-places', ] ); - // Site title $linksHTML .= Html::rawElement( 'li', [ 'id' => 'sitetitle' ], $this->getSiteTitle( 'text' ) ); // Site description $linksHTML .= Html::rawElement( 'li', [ 'id' => 'sitedesc' ], $this->getFooterDesc() ); - foreach ( $validFooterLinks as $link ) { $linksHTML .= Html::rawElement( 'li', [ 'id' => Sanitizer::escapeIdForAttribute( $link ) ], $this->get( $link ) ); @@ -851,13 +843,11 @@ class CitizenTemplate extends BaseTemplate { $linksHTML .= Html::closeElement( 'ul' ); $linksHTML .= Html::closeElement( 'div' ); } - if ( $options['order'] === 'iconsfirst' ) { $html .= $iconsHTML . $linksHTML; } else { $html .= $linksHTML . $iconsHTML; } - return $html . $this->getClear() . Html::closeElement( 'footer' ); } } From ef8b84de89433c7a6043257b66a9d0a6c64af584 Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Tue, 7 Jan 2020 13:34:43 -0500 Subject: [PATCH 2/2] Reverted to the older getFooterBlock --- includes/CitizenTemplate.php | 55 ++++++++++++++++++++++++++---------- 1 file changed, 40 insertions(+), 15 deletions(-) diff --git a/includes/CitizenTemplate.php b/includes/CitizenTemplate.php index 142e6c40..149c582c 100644 --- a/includes/CitizenTemplate.php +++ b/includes/CitizenTemplate.php @@ -779,6 +779,7 @@ class CitizenTemplate extends BaseTemplate { * * 'link-prefix' to set the prefix for all link and block ids; most skins use 'f' or 'footer', * as in id='f-whatever' vs id='footer-whatever' * * 'icon-style' to pass to getFooterIcons: "icononly", "nocopyright" + * * 'link-style' to pass to getFooterLinks: "flat" to disable categorisation of links in a * nested array * * @return string html @@ -790,9 +791,10 @@ class CitizenTemplate extends BaseTemplate { 'order' => 'linksfirst', 'link-prefix' => 'footer', 'icon-style' => 'icononly', + 'link-style' => 'flat', ]; $validFooterIcons = $this->getFooterIcons( $options['icon-style'] ); - $validFooterLinks = $this->getFooterLinks(); + $validFooterLinks = $this->getFooterLinks( $options['link-style'] ); $html = ''; $html .= Html::openElement( 'footer', [ 'id' => $options['id'], @@ -826,21 +828,44 @@ class CitizenTemplate extends BaseTemplate { if ( count( $validFooterLinks ) > 0 ) { $linksHTML .= Html::openElement( 'div', [ 'id' => "{$options['link-prefix']}-container-list" ] ); - $linksHTML .= Html::openElement( 'ul', [ - 'id' => "{$options['link-prefix']}-list", - 'class' => 'footer-places', - ] ); - // Site title - $linksHTML .= Html::rawElement( 'li', [ 'id' => 'sitetitle' ], - $this->getSiteTitle( 'text' ) ); - // Site description - $linksHTML .= Html::rawElement( 'li', [ 'id' => 'sitedesc' ], - $this->getFooterDesc() ); - foreach ( $validFooterLinks as $link ) { - $linksHTML .= Html::rawElement( 'li', - [ 'id' => Sanitizer::escapeIdForAttribute( $link ) ], $this->get( $link ) ); + if ( $options['link-style'] === 'flat' ) { + $linksHTML .= Html::openElement( 'ul', [ + 'id' => "{$options['link-prefix']}-list", + 'class' => 'footer-places', + ] ); + // Site title + $linksHTML .= Html::rawElement( 'li', [ 'id' => 'sitetitle' ], + $this->getSiteTitle( 'text' ) ); + // Site description + $linksHTML .= Html::rawElement( 'li', [ 'id' => 'sitedesc' ], + $this->getFooterDesc() ); + foreach ( $validFooterLinks as $link ) { + $linksHTML .= Html::rawElement( 'li', + [ 'id' => Sanitizer::escapeIdForAttribute( $link ) ], $this->get( $link ) ); + } + $linksHTML .= Html::closeElement( 'ul' ); + } else { + $linksHTML .= Html::openElement( 'div', + [ 'id' => "{$options['link-prefix']}-list" ] ); + foreach ( $validFooterLinks as $category => $links ) { + $linksHTML .= Html::openElement( 'ul', [ + 'id' => Sanitizer::escapeIdForAttribute( "{$options['link-prefix']}-{$category}" ), + ] ); + foreach ( $links as $link ) { + $linksHTML .= Html::rawElement( 'li', [ + 'id' => Sanitizer::escapeIdForAttribute( "{$options['link-prefix']}-{$category}-{$link}" ), + ], $this->get( $link ) ); + } + $linksHTML .= Html::closeElement( 'ul' ); + } + // Site title + $linksHTML .= Html::rawElement( 'li', [ 'id' => 'footer-sitetitle' ], + $this->getSiteTitle( 'text' ) ); + // Site logo + $linksHTML .= Html::rawElement( 'li', [ 'id' => 'footer-sitelogo' ], + $this->getLogo() ); + $linksHTML .= Html::closeElement( 'div' ); } - $linksHTML .= Html::closeElement( 'ul' ); $linksHTML .= Html::closeElement( 'div' ); } if ( $options['order'] === 'iconsfirst' ) {