Trying to clean this up a bit

No functional changes are intended.

Change-Id: Icec2df9744d13a4bdea632cad00422e3105ef43b
This commit is contained in:
Jack Phoenix 2015-06-09 00:12:40 +03:00
parent 06e75b43e0
commit 9bd09ce773

View file

@ -87,6 +87,10 @@ class VectorTemplate extends BaseTemplate {
$this->data['personal_urls'] = $this->data['personal_urls'] =
array_reverse( $this->data['personal_urls'] ); array_reverse( $this->data['personal_urls'] );
} }
$this->data['pageLanguage'] =
$this->getSkin()->getTitle()->getPageViewLanguage()->getHtmlCode();
// Output HTML Page // Output HTML Page
$this->html( 'headelement' ); $this->html( 'headelement' );
?> ?>
@ -108,11 +112,7 @@ class VectorTemplate extends BaseTemplate {
} }
if ( !empty( $this->data['title'] ) ) { if ( !empty( $this->data['title'] ) ) {
?> ?>
<h1 id="firstHeading" class="firstHeading" lang="<?php <h1 id="firstHeading" class="firstHeading" lang="<?php $this->text( 'pageLanguage' ); ?>"><?php $this->html( 'title' ) ?></h1>
$this->data['pageLanguage'] =
$this->getSkin()->getTitle()->getPageViewLanguage()->getHtmlCode();
$this->text( 'pageLanguage' );
?>"><?php $this->html( 'title' ) ?></h1>
<?php } ?> <?php } ?>
<?php $this->html( 'prebodyhtml' ) ?> <?php $this->html( 'prebodyhtml' ) ?>
<div id="bodyContent" class="mw-body-content"> <div id="bodyContent" class="mw-body-content">
@ -123,9 +123,7 @@ class VectorTemplate extends BaseTemplate {
<?php <?php
} }
?> ?>
<div id="contentSub"<?php <div id="contentSub"<?php $this->html( 'userlangattributes' ) ?>><?php $this->html( 'subtitle' ) ?></div>
$this->html( 'userlangattributes' )
?>><?php $this->html( 'subtitle' ) ?></div>
<?php <?php
if ( $this->data['undelete'] ) { if ( $this->data['undelete'] ) {
?> ?>
@ -142,15 +140,12 @@ class VectorTemplate extends BaseTemplate {
?> ?>
<div id="jump-to-nav" class="mw-jump"> <div id="jump-to-nav" class="mw-jump">
<?php $this->msg( 'jumpto' ) ?> <?php $this->msg( 'jumpto' ) ?>
<a href="#mw-head"><?php <a href="#mw-head"><?php $this->msg( 'jumptonavigation' ) ?></a><?php $this->msg( 'comma-separator' ) ?>
$this->msg( 'jumptonavigation' )
?></a><?php
$this->msg( 'comma-separator' )
?>
<a href="#p-search"><?php $this->msg( 'jumptosearch' ) ?></a> <a href="#p-search"><?php $this->msg( 'jumptosearch' ) ?></a>
</div> </div>
<?php $this->html( 'bodycontent' ) ?>
<?php <?php
$this->html( 'bodycontent' );
if ( $this->data['printfooter'] ) { if ( $this->data['printfooter'] ) {
?> ?>
<div class="printfooter"> <div class="printfooter">
@ -158,23 +153,13 @@ class VectorTemplate extends BaseTemplate {
</div> </div>
<?php <?php
} }
?>
<?php
if ( $this->data['catlinks'] ) { if ( $this->data['catlinks'] ) {
?>
<?php
$this->html( 'catlinks' ); $this->html( 'catlinks' );
?>
<?php
} }
?>
<?php
if ( $this->data['dataAfterContent'] ) { if ( $this->data['dataAfterContent'] ) {
?>
<?php
$this->html( 'dataAfterContent' ); $this->html( 'dataAfterContent' );
?>
<?php
} }
?> ?>
<div class="visualClear"></div> <div class="visualClear"></div>
@ -206,19 +191,9 @@ class VectorTemplate extends BaseTemplate {
<?php <?php
foreach ( $this->getFooterLinks() as $category => $links ) { foreach ( $this->getFooterLinks() as $category => $links ) {
?> ?>
<ul id="footer-<?php <ul id="footer-<?php echo $category ?>">
echo $category <?php foreach ( $links as $link ) { ?>
?>"> <li id="footer-<?php echo $category ?>-<?php echo $link ?>"><?php $this->html( $link ) ?></li>
<?php
foreach ( $links as $link ) {
?>
<li id="footer-<?php
echo $category
?>-<?php
echo $link
?>"><?php
$this->html( $link )
?></li>
<?php <?php
} }
?> ?>
@ -233,16 +208,10 @@ class VectorTemplate extends BaseTemplate {
<?php <?php
foreach ( $footericons as $blockName => $footerIcons ) { foreach ( $footericons as $blockName => $footerIcons ) {
?> ?>
<li id="footer-<?php <li id="footer-<?php echo htmlspecialchars( $blockName ); ?>ico">
echo htmlspecialchars( $blockName ); ?>ico">
<?php <?php
foreach ( $footerIcons as $icon ) { foreach ( $footerIcons as $icon ) {
?>
<?php
echo $this->getSkin()->makeFooterIcon( $icon ); echo $this->getSkin()->makeFooterIcon( $icon );
?>
<?php
} }
?> ?>
</li> </li>
@ -316,17 +285,14 @@ class VectorTemplate extends BaseTemplate {
$msg = $name; $msg = $name;
} }
$msgObj = wfMessage( $msg ); $msgObj = wfMessage( $msg );
$labelId = Sanitizer::escapeId( "p-$name-label" );
?> ?>
<div class="portal" role="navigation" id='<?php <div class="portal" role="navigation" id='<?php
echo Sanitizer::escapeId( "p-$name" ) echo Sanitizer::escapeId( "p-$name" )
?>'<?php ?>'<?php
echo Linker::tooltip( 'p-' . $name ) echo Linker::tooltip( 'p-' . $name )
?> aria-labelledby='<?php echo Sanitizer::escapeId( "p-$name-label" ) ?>'> ?> aria-labelledby='<?php echo $labelId ?>'>
<h3<?php <h3<?php $this->html( 'userlangattributes' ) ?> id='<?php echo $labelId ?>'><?php
$this->html( 'userlangattributes' )
?> id='<?php
echo Sanitizer::escapeId( "p-$name-label" )
?>'><?php
echo htmlspecialchars( $msgObj->exists() ? $msgObj->text() : $msg ); echo htmlspecialchars( $msgObj->exists() ? $msgObj->text() : $msg );
?></h3> ?></h3>
@ -337,10 +303,7 @@ class VectorTemplate extends BaseTemplate {
<ul> <ul>
<?php <?php
foreach ( $content as $key => $val ) { foreach ( $content as $key => $val ) {
?> echo $this->makeListItem( $key, $val );
<?php echo $this->makeListItem( $key, $val ); ?>
<?php
} }
if ( $hook !== null ) { if ( $hook !== null ) {
Hooks::run( $hook, array( &$this, true ) ); Hooks::run( $hook, array( &$this, true ) );
@ -349,8 +312,6 @@ class VectorTemplate extends BaseTemplate {
</ul> </ul>
<?php <?php
} else { } else {
?>
<?php
echo $content; /* Allow raw HTML block to be defined by extensions */ echo $content; /* Allow raw HTML block to be defined by extensions */
} }
@ -391,9 +352,7 @@ class VectorTemplate extends BaseTemplate {
<?php <?php
foreach ( $this->data['namespace_urls'] as $link ) { foreach ( $this->data['namespace_urls'] as $link ) {
?> ?>
<li <?php <li <?php echo $link['attributes'] ?>><span><a href="<?php
echo $link['attributes']
?>><span><a href="<?php
echo htmlspecialchars( $link['href'] ) echo htmlspecialchars( $link['href'] )
?>" <?php ?>" <?php
echo $link['key'] echo $link['key']
@ -431,9 +390,7 @@ class VectorTemplate extends BaseTemplate {
<?php <?php
foreach ( $this->data['variant_urls'] as $link ) { foreach ( $this->data['variant_urls'] as $link ) {
?> ?>
<li<?php <li<?php echo $link['attributes'] ?>><a href="<?php
echo $link['attributes']
?>><a href="<?php
echo htmlspecialchars( $link['href'] ) echo htmlspecialchars( $link['href'] )
?>" lang="<?php ?>" lang="<?php
echo htmlspecialchars( $link['lang'] ) echo htmlspecialchars( $link['lang'] )
@ -460,15 +417,11 @@ class VectorTemplate extends BaseTemplate {
} }
?>" aria-labelledby="p-views-label"> ?>" aria-labelledby="p-views-label">
<h3 id="p-views-label"><?php $this->msg( 'views' ) ?></h3> <h3 id="p-views-label"><?php $this->msg( 'views' ) ?></h3>
<ul<?php <ul<?php $this->html( 'userlangattributes' ) ?>>
$this->html( 'userlangattributes' )
?>>
<?php <?php
foreach ( $this->data['view_urls'] as $link ) { foreach ( $this->data['view_urls'] as $link ) {
?> ?>
<li<?php <li<?php echo $link['attributes'] ?>><span><a href="<?php
echo $link['attributes']
?>><span><a href="<?php
echo htmlspecialchars( $link['href'] ) echo htmlspecialchars( $link['href'] )
?>" <?php ?>" <?php
echo $link['key']; echo $link['key'];
@ -506,9 +459,7 @@ class VectorTemplate extends BaseTemplate {
<?php <?php
foreach ( $this->data['action_urls'] as $link ) { foreach ( $this->data['action_urls'] as $link ) {
?> ?>
<li<?php <li<?php echo $link['attributes'] ?>>
echo $link['attributes']
?>>
<a href="<?php <a href="<?php
echo htmlspecialchars( $link['href'] ) echo htmlspecialchars( $link['href'] )
?>" <?php ?>" <?php
@ -550,17 +501,7 @@ class VectorTemplate extends BaseTemplate {
</h3> </h3>
<form action="<?php $this->text( 'wgScript' ) ?>" id="searchform"> <form action="<?php $this->text( 'wgScript' ) ?>" id="searchform">
<?php <div<?php echo $this->config->get( 'VectorUseSimpleSearch' ) ? ' id="simpleSearch"' : '' ?>>
if ( $this->config->get( 'VectorUseSimpleSearch' ) ) {
?>
<div id="simpleSearch">
<?php
} else {
?>
<div>
<?php
}
?>
<?php <?php
echo $this->makeSearchInput( array( 'id' => 'searchInput' ) ); echo $this->makeSearchInput( array( 'id' => 'searchInput' ) );
echo Html::hidden( 'title', $this->get( 'searchtitle' ) ); echo Html::hidden( 'title', $this->get( 'searchtitle' ) );
@ -584,7 +525,7 @@ class VectorTemplate extends BaseTemplate {
array( 'id' => 'searchButton', 'class' => 'searchButton' ) array( 'id' => 'searchButton', 'class' => 'searchButton' )
); );
?> ?>
</div> </div>
</form> </form>
</div> </div>
<?php <?php