46 public function msg( $str ) {
47 echo $this->
getMsg( $str )->escaped();
54 return $this->
getSkin()->getPersonalToolsForMakeListItem( $this->
get(
'personal_urls' ) );
64 $sidebar = $this->data[
'sidebar'];
65 if ( !isset( $sidebar[
'SEARCH'] ) ) {
67 $sidebar[
'SEARCH'] =
true;
69 if ( !isset( $sidebar[
'TOOLBOX'] ) ) {
70 $sidebar[
'TOOLBOX'] =
true;
72 if ( !isset( $sidebar[
'LANGUAGES'] ) ) {
73 $sidebar[
'LANGUAGES'] =
true;
76 if ( !isset( $options[
'search'] ) || $options[
'search'] !==
true ) {
77 unset( $sidebar[
'SEARCH'] );
79 if ( isset( $options[
'toolbox'] ) && $options[
'toolbox'] ===
false ) {
80 unset( $sidebar[
'TOOLBOX'] );
82 if ( isset( $options[
'languages'] ) && $options[
'languages'] ===
false ) {
83 unset( $sidebar[
'LANGUAGES'] );
87 foreach ( $sidebar as $boxName => $content ) {
88 if ( $content ===
false ) {
96 'header' => $this->
getMsg(
'search' )->text(),
102 $msgObj = $this->
getMsg(
'toolbox' );
105 'header' => $msgObj->exists() ? $msgObj->text() :
'toolbox',
106 'generated' =>
false,
107 'content' => $content,
111 if ( $this->data[
'language_urls'] !==
false ) {
112 $msgObj = $this->
getMsg(
'otherlanguages' );
115 'header' => $msgObj->exists() ? $msgObj->text() :
'otherlanguages',
116 'generated' =>
false,
117 'content' => $this->data[
'language_urls'] ?: [],
122 $msgObj = $this->
getMsg( $boxName );
124 'id' =>
"p-$boxName",
125 'header' => $msgObj->exists() ? $msgObj->text() : $boxName,
127 'content' => $content,
133 if ( isset( $options[
'htmlOnly'] ) && $options[
'htmlOnly'] ===
true ) {
134 foreach ( $boxes as $boxName => $box ) {
135 if ( is_array( $box[
'content'] ) ) {
137 foreach ( $box[
'content'] as $key => $val ) {
138 $content .=
"\n " . $this->
getSkin()->makeListItem( $key, $val );
140 $content .=
"\n</ul>\n";
141 $boxes[$boxName][
'content'] = $content;
157 protected function makeLink( $key, $item, $options = [] ) {
158 return $this->
getSkin()->makeLink( $key, $item, $options );
170 return $this->
getSkin()->makeListItem( $key, $item, $options );
180 return $this->
getSkin()->makeSearchInput( $attrs );
191 return $this->
getSkin()->makeSearchButton( $mode, $attrs );
204 $footerlinks = $this->
get(
'footerlinks' );
207 $validFooterLinks = [];
208 foreach ( $footerlinks as $category => $links ) {
209 $validFooterLinks[$category] = [];
210 foreach ( $links as $link ) {
211 if ( isset( $this->data[$link] ) && $this->data[$link] ) {
212 $validFooterLinks[$category][] = $link;
215 if ( count( $validFooterLinks[$category] ) <= 0 ) {
216 unset( $validFooterLinks[$category] );
220 if ( $option ==
'flat' && count( $validFooterLinks ) ) {
222 $validFooterLinks = array_merge( ...array_values( $validFooterLinks ) );
225 return $validFooterLinks;
245 $footericons = $this->
get(
'footericons' );
247 if ( $option ==
'icononly' ) {
249 $this->unsetIconsWithoutImages( $footericons );
250 } elseif ( $option ==
'nocopyright' ) {
251 unset( $footericons[
'copyright'] );
263 private function unsetIconsWithoutImages( array &$icons ) {
265 foreach ( $icons as $iconsKey => &$iconsBlock ) {
266 foreach ( $iconsBlock as $iconKey => $icon ) {
267 if ( !is_string( $icon ) && !isset( $icon[
'src'] ) ) {
268 unset( $iconsBlock[$iconKey] );
271 if ( $iconsBlock === [] ) {
272 unset( $icons[$iconsKey] );
287 protected function getFooter( $iconStyle =
'icononly', $linkStyle =
'flat' ) {
288 $validFooterIcons = $this->
get(
'footericons' );
289 if ( $iconStyle ===
'icononly' ) {
290 $this->unsetIconsWithoutImages( $validFooterIcons );
299 if ( count( $validFooterIcons ) + count( $validFooterLinks ) > 0 ) {
300 $html .= Html::openElement(
'div', [
301 'id' =>
'footer-bottom',
302 'class' =>
'mw-footer',
303 'role' =>
'contentinfo',
304 'lang' => $this->
get(
'userlang' ),
305 'dir' => $this->
get(
'dir' )
307 $footerEnd = Html::closeElement(
'div' );
311 foreach ( $validFooterIcons as $blockName => $footerIcons ) {
312 $html .= Html::openElement(
'div', [
313 'id' => Sanitizer::escapeIdForAttribute(
"f-{$blockName}ico" ),
314 'class' =>
'footer-icons'
316 foreach ( $footerIcons as $icon ) {
317 $html .= $this->
getSkin()->makeFooterIcon( $icon );
319 $html .= Html::closeElement(
'div' );
321 if ( count( $validFooterLinks ) > 0 ) {
322 $html .= Html::openElement(
'ul', [
'id' =>
'f-list',
'class' =>
'footer-places' ] );
323 foreach ( $validFooterLinks as $aLink ) {
324 $html .= Html::rawElement(
326 [
'id' => Sanitizer::escapeIdForAttribute( $aLink ) ],
330 $html .= Html::closeElement(
'ul' );
333 $html .= $this->
getClear() . $footerEnd;
345 return Html::element(
'div', [
'class' =>
'visualClear' ] );
364 $out =
"<div class=\"mw-indicators\">\n";
365 foreach ( $this->data[
'indicators'] as $id => $content ) {
366 $out .= Html::rawElement(
369 'id' => Sanitizer::escapeIdForAttribute(
"mw-indicator-$id" ),
370 'class' =>
'mw-indicator',
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Logs a warning that a deprecated feature was used.
array $params
The job parameters.
Extended QuickTemplate with additional MediaWiki-specific helper methods.
getFooterLinks( $option=null)
Returns an array of footerlinks trimmed down to only those footer links that are valid.
makeSearchButton( $mode, $attrs=[])
Wrapper for Skin method.
makeLink( $key, $item, $options=[])
Wrapper for Skin method.
getFooterIcons( $option=null)
Returns an array of footer icons filtered down by options relevant to how the skin wishes to display ...
makeListItem( $key, $item, $options=[])
Wrapper for Skin method.
getMsg( $name,... $params)
Get a Message object with its context set.
getIndicators()
Get the suggested HTML for page status indicators: icons (or short text snippets) usually displayed i...
makeSearchInput( $attrs=[])
Wrapper for Skin method.
getFooter( $iconStyle='icononly', $linkStyle='flat')
Renderer for getFooterIcons and getFooterLinks.
getClear()
Get a div with the core visualClear class, for clearing floats.
PHP-based skin template that holds data.
getSkin()
Get the Skin object related to this object.