Create getContentBlock function to get rid of some of the ridiculous indenting

Seriously, what the crap. Break this up a bit, shall we? Also probably means we might be able to extend this better, or something. (Not that I have any idea how that works.)

Change-Id: I2576d2244091aabcc973d9d4b7a3020d34f365f8
isekai
Isarra 6 years ago
parent b3af826b7d
commit f7cf742c3c

@ -37,45 +37,7 @@ class TimelessTemplate extends BaseTemplate {
$html .= Html::rawElement( 'div', [ 'id' => 'mw-content-container', 'class' => 'ts-container' ], $html .= Html::rawElement( 'div', [ 'id' => 'mw-content-container', 'class' => 'ts-container' ],
Html::rawElement( 'div', [ 'id' => 'mw-content-block', 'class' => 'ts-inner' ], Html::rawElement( 'div', [ 'id' => 'mw-content-block', 'class' => 'ts-inner' ],
Html::rawElement( 'div', [ 'id' => 'mw-content-wrapper' ], Html::rawElement( 'div', [ 'id' => 'mw-content-wrapper' ],
Html::rawElement( 'div', [ 'id' => 'mw-content' ], $this->getContentBlock() .
Html::rawElement( 'div', [ 'id' => 'content', 'class' => 'mw-body', 'role' => 'main' ],
$this->getSiteNotices() .
$this->getIndicators() .
Html::rawElement(
'h1',
[
'id' => 'firstHeading',
'class' => 'firstHeading',
'lang' => $this->get( 'pageLanguage' )
],
$this->get( 'title' )
) .
Html::rawElement( 'div', [ 'id' => 'siteSub' ], $this->getMsg( 'tagline' )->parse() ) .
Html::rawElement( 'div', [ 'id' => 'mw-page-header-links' ],
$this->getPortlet(
'namespaces',
$this->pileOfTools['namespaces'],
'timeless-namespaces'
) .
$this->getPortlet(
'more',
$this->pileOfTools['more'],
'timeless-more'
) .
$this->getPortlet(
'views',
$this->pileOfTools['page-primary'],
'timeless-pagetools'
)
) .
$this->getClear() .
Html::rawElement( 'div', [ 'class' => 'mw-body-content', 'id' => 'bodyContent' ],
$this->getContentSub() .
$this->get( 'bodytext' ) .
$this->getClear()
)
)
) .
$this->getAfterContent() $this->getAfterContent()
) . ) .
Html::rawElement( 'div', [ 'id' => 'mw-site-navigation' ], Html::rawElement( 'div', [ 'id' => 'mw-site-navigation' ],
@ -121,6 +83,56 @@ class TimelessTemplate extends BaseTemplate {
echo $html; echo $html;
} }
/**
* Generate the page content block
* Broken out here due to the excessive indenting, or stuff.
*
* @return string html
*/
protected function getContentBlock() {
$html = Html::rawElement(
'div',
[ 'id' => 'content', 'class' => 'mw-body', 'role' => 'main' ],
$this->getSiteNotices() .
$this->getIndicators() .
Html::rawElement(
'h1',
[
'id' => 'firstHeading',
'class' => 'firstHeading',
'lang' => $this->get( 'pageLanguage' )
],
$this->get( 'title' )
) .
Html::rawElement( 'div', [ 'id' => 'siteSub' ], $this->getMsg( 'tagline' )->parse() ) .
Html::rawElement( 'div', [ 'id' => 'mw-page-header-links' ],
$this->getPortlet(
'namespaces',
$this->pileOfTools['namespaces'],
'timeless-namespaces'
) .
$this->getPortlet(
'more',
$this->pileOfTools['more'],
'timeless-more'
) .
$this->getPortlet(
'views',
$this->pileOfTools['page-primary'],
'timeless-pagetools'
)
) .
$this->getClear() .
Html::rawElement( 'div', [ 'class' => 'mw-body-content', 'id' => 'bodyContent' ],
$this->getContentSub() .
$this->get( 'bodytext' ) .
$this->getClear()
)
);
return Html::rawElement( 'div', [ 'id' => 'mw-content' ], $html );
}
/** /**
* Generates a block of navigation links with a header * Generates a block of navigation links with a header
* *

Loading…
Cancel
Save