Fix missing footer components

This commit is contained in:
alistair3149 2020-01-07 13:23:08 -05:00
parent 773395448d
commit 7eac848574
No known key found for this signature in database
GPG key ID: 94D081060FD3DD9C

View file

@ -791,27 +791,22 @@ class CitizenTemplate extends BaseTemplate {
'link-prefix' => 'footer', 'link-prefix' => 'footer',
'icon-style' => 'icononly', 'icon-style' => 'icononly',
]; ];
$validFooterIcons = $this->getFooterIcons( $options['icon-style'] ); $validFooterIcons = $this->getFooterIcons( $options['icon-style'] );
$validFooterLinks = $this->getFooterLinks(); $validFooterLinks = $this->getFooterLinks();
$html = ''; $html = '';
$html .= Html::openElement( 'footer', [ $html .= Html::openElement( 'footer', [
'id' => $options['id'], 'id' => $options['id'],
'role' => 'contentinfo', 'role' => 'contentinfo',
'lang' => $this->get( 'userlang' ), 'lang' => $this->get( 'userlang' ),
'dir' => $this->get( 'dir' ), 'dir' => $this->get( 'dir' ),
] ); ] );
$iconsHTML = ''; $iconsHTML = '';
if ( count( $validFooterIcons ) > 0 ) { if ( count( $validFooterIcons ) > 0 ) {
$iconsHTML .= Html::openElement( 'div', $iconsHTML .= Html::openElement( 'div',
[ 'id' => "{$options['link-prefix']}-container-icons" ] ); [ 'id' => "{$options['link-prefix']}-container-icons" ] );
$iconsHTML .= Html::openElement( 'div', [ 'id' => 'footer-bottom-container' ] ); $iconsHTML .= Html::openElement( 'div', [ 'id' => 'footer-bottom-container' ] );
// Get tagline // Get tagline
$iconsHTML .= $this->getFooterTagline(); $iconsHTML .= $this->getFooterTagline();
$iconsHTML .= Html::openElement( 'ul', [ 'id' => "{$options['link-prefix']}-icons" ] ); $iconsHTML .= Html::openElement( 'ul', [ 'id' => "{$options['link-prefix']}-icons" ] );
foreach ( $validFooterIcons as $blockName => $footerIcons ) { foreach ( $validFooterIcons as $blockName => $footerIcons ) {
$iconsHTML .= Html::openElement( 'li', [ $iconsHTML .= Html::openElement( 'li', [
@ -827,7 +822,6 @@ class CitizenTemplate extends BaseTemplate {
$iconsHTML .= Html::closeElement( 'div' ); $iconsHTML .= Html::closeElement( 'div' );
$iconsHTML .= Html::closeElement( 'div' ); $iconsHTML .= Html::closeElement( 'div' );
} }
$linksHTML = ''; $linksHTML = '';
if ( count( $validFooterLinks ) > 0 ) { if ( count( $validFooterLinks ) > 0 ) {
$linksHTML .= Html::openElement( 'div', $linksHTML .= Html::openElement( 'div',
@ -836,14 +830,12 @@ class CitizenTemplate extends BaseTemplate {
'id' => "{$options['link-prefix']}-list", 'id' => "{$options['link-prefix']}-list",
'class' => 'footer-places', 'class' => 'footer-places',
] ); ] );
// Site title // Site title
$linksHTML .= Html::rawElement( 'li', [ 'id' => 'sitetitle' ], $linksHTML .= Html::rawElement( 'li', [ 'id' => 'sitetitle' ],
$this->getSiteTitle( 'text' ) ); $this->getSiteTitle( 'text' ) );
// Site description // Site description
$linksHTML .= Html::rawElement( 'li', [ 'id' => 'sitedesc' ], $linksHTML .= Html::rawElement( 'li', [ 'id' => 'sitedesc' ],
$this->getFooterDesc() ); $this->getFooterDesc() );
foreach ( $validFooterLinks as $link ) { foreach ( $validFooterLinks as $link ) {
$linksHTML .= Html::rawElement( 'li', $linksHTML .= Html::rawElement( 'li',
[ 'id' => Sanitizer::escapeIdForAttribute( $link ) ], $this->get( $link ) ); [ 'id' => Sanitizer::escapeIdForAttribute( $link ) ], $this->get( $link ) );
@ -851,13 +843,11 @@ class CitizenTemplate extends BaseTemplate {
$linksHTML .= Html::closeElement( 'ul' ); $linksHTML .= Html::closeElement( 'ul' );
$linksHTML .= Html::closeElement( 'div' ); $linksHTML .= Html::closeElement( 'div' );
} }
if ( $options['order'] === 'iconsfirst' ) { if ( $options['order'] === 'iconsfirst' ) {
$html .= $iconsHTML . $linksHTML; $html .= $iconsHTML . $linksHTML;
} else { } else {
$html .= $linksHTML . $iconsHTML; $html .= $linksHTML . $iconsHTML;
} }
return $html . $this->getClear() . Html::closeElement( 'footer' ); return $html . $this->getClear() . Html::closeElement( 'footer' );
} }
} }