Merge "VectorTemplate: Some consistency in mixed PHP/HTML formatting"

This commit is contained in:
jenkins-bot 2017-11-13 07:35:49 +00:00 committed by Gerrit Code Review
commit 068a68bffa
1 changed files with 59 additions and 65 deletions

View File

@ -59,7 +59,6 @@ class VectorTemplate extends BaseTemplate {
<div id="mw-head-base" class="noprint"></div> <div id="mw-head-base" class="noprint"></div>
<div id="content" class="mw-body" role="main"> <div id="content" class="mw-body" role="main">
<a id="top"></a> <a id="top"></a>
<?php <?php
if ( $this->data['sitenotice'] ) { if ( $this->data['sitenotice'] ) {
?> ?>
@ -137,7 +136,6 @@ class VectorTemplate extends BaseTemplate {
</div> </div>
<div id="mw-navigation"> <div id="mw-navigation">
<h2><?php $this->msg( 'navigation-heading' ) ?></h2> <h2><?php $this->msg( 'navigation-heading' ) ?></h2>
<div id="mw-head"> <div id="mw-head">
<?php $this->renderNavigation( 'PERSONAL' ); ?> <?php $this->renderNavigation( 'PERSONAL' ); ?>
<div id="left-navigation"> <div id="left-navigation">
@ -159,16 +157,16 @@ class VectorTemplate extends BaseTemplate {
<div id="footer" role="contentinfo"<?php $this->html( 'userlangattributes' ) ?>> <div id="footer" role="contentinfo"<?php $this->html( 'userlangattributes' ) ?>>
<?php <?php
foreach ( $this->getFooterLinks() as $category => $links ) { foreach ( $this->getFooterLinks() as $category => $links ) {
?>
<ul id="footer-<?php echo $category ?>">
<?php
foreach ( $links as $link ) {
?> ?>
<ul id="footer-<?php echo $category ?>"> <li id="footer-<?php echo $category ?>-<?php echo $link ?>"><?php $this->html( $link ) ?></li>
<?php <?php
foreach ( $links as $link ) { }
?> ?>
<li id="footer-<?php echo $category ?>-<?php echo $link ?>"><?php $this->html( $link ) ?></li> </ul>
<?php
}
?>
</ul>
<?php <?php
} }
?> ?>
@ -178,14 +176,14 @@ class VectorTemplate extends BaseTemplate {
<ul id="footer-icons" class="noprint"> <ul id="footer-icons" class="noprint">
<?php <?php
foreach ( $footericons as $blockName => $footerIcons ) { foreach ( $footericons as $blockName => $footerIcons ) {
?>
<li id="footer-<?php echo htmlspecialchars( $blockName ); ?>ico">
<?php
foreach ( $footerIcons as $icon ) {
echo $this->getSkin()->makeFooterIcon( $icon );
}
?> ?>
<li id="footer-<?php echo htmlspecialchars( $blockName ); ?>ico"> </li>
<?php
foreach ( $footerIcons as $icon ) {
echo $this->getSkin()->makeFooterIcon( $icon );
}
?>
</li>
<?php <?php
} }
?> ?>
@ -193,7 +191,7 @@ class VectorTemplate extends BaseTemplate {
<?php <?php
} }
?> ?>
<div style="clear:both"></div> <div style="clear: both;"></div>
</div> </div>
<?php $this->printTrail(); ?> <?php $this->printTrail(); ?>
@ -266,23 +264,22 @@ class VectorTemplate extends BaseTemplate {
<h3<?php $this->html( 'userlangattributes' ) ?> id='<?php echo $labelId ?>'><?php <h3<?php $this->html( 'userlangattributes' ) ?> id='<?php echo $labelId ?>'><?php
echo htmlspecialchars( $msgObj->exists() ? $msgObj->text() : $msg ); echo htmlspecialchars( $msgObj->exists() ? $msgObj->text() : $msg );
?></h3> ?></h3>
<div class="body"> <div class="body">
<?php <?php
if ( is_array( $content ) ) { if ( is_array( $content ) ) {
?>
<ul>
<?php
foreach ( $content as $key => $val ) {
echo $this->makeListItem( $key, $val );
}
if ( $hook !== null ) {
// Avoid PHP 7.1 warning
$skin = $this;
Hooks::run( $hook, [ &$skin, true ] );
}
?> ?>
<ul> </ul>
<?php
foreach ( $content as $key => $val ) {
echo $this->makeListItem( $key, $val );
}
if ( $hook !== null ) {
// Avoid PHP 7.1 warning
$skin = $this;
Hooks::run( $hook, [ &$skin, true ] );
}
?>
</ul>
<?php <?php
} else { } else {
// Allow raw HTML block to be defined by extensions // Allow raw HTML block to be defined by extensions
@ -322,9 +319,9 @@ class VectorTemplate extends BaseTemplate {
<ul<?php $this->html( 'userlangattributes' ) ?>> <ul<?php $this->html( 'userlangattributes' ) ?>>
<?php <?php
foreach ( $this->data['namespace_urls'] as $key => $item ) { foreach ( $this->data['namespace_urls'] as $key => $item ) {
echo "\t\t\t\t\t\t\t" . $this->makeListItem( $key, $item, [ echo $this->makeListItem( $key, $item, [
'vector-wrap' => true, 'vector-wrap' => true,
] ) . "\n"; ] );
} }
?> ?>
</ul> </ul>
@ -351,12 +348,11 @@ class VectorTemplate extends BaseTemplate {
<h3 id="p-variants-label"> <h3 id="p-variants-label">
<span><?php echo htmlspecialchars( $variantLabel ) ?></span> <span><?php echo htmlspecialchars( $variantLabel ) ?></span>
</h3> </h3>
<div class="menu"> <div class="menu">
<ul> <ul>
<?php <?php
foreach ( $this->data['variant_urls'] as $key => $item ) { foreach ( $this->data['variant_urls'] as $key => $item ) {
echo "\t\t\t\t\t\t\t\t" . $this->makeListItem( $key, $item ) . "\n"; echo $this->makeListItem( $key, $item );
} }
?> ?>
</ul> </ul>
@ -375,10 +371,10 @@ class VectorTemplate extends BaseTemplate {
<ul<?php $this->html( 'userlangattributes' ) ?>> <ul<?php $this->html( 'userlangattributes' ) ?>>
<?php <?php
foreach ( $this->data['view_urls'] as $key => $item ) { foreach ( $this->data['view_urls'] as $key => $item ) {
echo "\t\t\t\t\t\t\t" . $this->makeListItem( $key, $item, [ echo $this->makeListItem( $key, $item, [
'vector-wrap' => true, 'vector-wrap' => true,
'vector-collapsible' => true, 'vector-collapsible' => true,
] ) . "\n"; ] );
} }
?> ?>
</ul> </ul>
@ -395,12 +391,11 @@ class VectorTemplate extends BaseTemplate {
<h3 id="p-cactions-label"><span><?php <h3 id="p-cactions-label"><span><?php
$this->msg( 'vector-more-actions' ) $this->msg( 'vector-more-actions' )
?></span></h3> ?></span></h3>
<div class="menu"> <div class="menu">
<ul<?php $this->html( 'userlangattributes' ) ?>> <ul<?php $this->html( 'userlangattributes' ) ?>>
<?php <?php
foreach ( $this->data['action_urls'] as $key => $item ) { foreach ( $this->data['action_urls'] as $key => $item ) {
echo "\t\t\t\t\t\t\t\t" . $this->makeListItem( $key, $item ) . "\n"; echo $this->makeListItem( $key, $item );
} }
?> ?>
</ul> </ul>
@ -454,33 +449,32 @@ class VectorTemplate extends BaseTemplate {
<h3<?php $this->html( 'userlangattributes' ) ?>> <h3<?php $this->html( 'userlangattributes' ) ?>>
<label for="searchInput"><?php $this->msg( 'search' ) ?></label> <label for="searchInput"><?php $this->msg( 'search' ) ?></label>
</h3> </h3>
<form action="<?php $this->text( 'wgScript' ) ?>" id="searchform"> <form action="<?php $this->text( 'wgScript' ) ?>" id="searchform">
<div<?php echo $this->config->get( 'VectorUseSimpleSearch' ) ? ' id="simpleSearch"' : '' ?>> <div<?php echo $this->config->get( 'VectorUseSimpleSearch' ) ? ' id="simpleSearch"' : '' ?>>
<?php <?php
echo $this->makeSearchInput( [ 'id' => 'searchInput' ] ); echo $this->makeSearchInput( [ 'id' => 'searchInput' ] );
echo Html::hidden( 'title', $this->get( 'searchtitle' ) ); echo Html::hidden( 'title', $this->get( 'searchtitle' ) );
/* We construct two buttons (for 'go' and 'fulltext' search modes), /* We construct two buttons (for 'go' and 'fulltext' search modes),
* but only one will be visible and actionable at a time (they are * but only one will be visible and actionable at a time (they are
* overlaid on top of each other in CSS). * overlaid on top of each other in CSS).
* * Browsers will use the 'fulltext' one by default (as it's the * * Browsers will use the 'fulltext' one by default (as it's the
* first in tree-order), which is desirable when they are unable * first in tree-order), which is desirable when they are unable
* to show search suggestions (either due to being broken or * to show search suggestions (either due to being broken or
* having JavaScript turned off). * having JavaScript turned off).
* * The mediawiki.searchSuggest module, after doing tests for the * * The mediawiki.searchSuggest module, after doing tests for the
* broken browsers, removes the 'fulltext' button and handles * broken browsers, removes the 'fulltext' button and handles
* 'fulltext' search itself; this will reveal the 'go' button and * 'fulltext' search itself; this will reveal the 'go' button and
* cause it to be used. * cause it to be used.
*/ */
echo $this->makeSearchButton( echo $this->makeSearchButton(
'fulltext', 'fulltext',
[ 'id' => 'mw-searchButton', 'class' => 'searchButton mw-fallbackSearchButton' ] [ 'id' => 'mw-searchButton', 'class' => 'searchButton mw-fallbackSearchButton' ]
); );
echo $this->makeSearchButton( echo $this->makeSearchButton(
'go', 'go',
[ 'id' => 'searchButton', 'class' => 'searchButton' ] [ 'id' => 'searchButton', 'class' => 'searchButton' ]
); );
?> ?>
</div> </div>
</form> </form>
</div> </div>