40 $html = $this->
get(
'headelement' );
41 $html .= Html::openElement(
'div', [
'id' =>
'globalWrapper' ] );
43 $html .= Html::openElement(
'div', [
'id' =>
'column-content' ] );
44 $html .= Html::rawElement(
'div', [
'id' =>
'content',
'class' =>
'mw-body',
'role' =>
'main' ],
45 Html::element(
'a', [
'id' =>
'top' ] ) .
48 'parameters' => [
'id' =>
'siteNotice',
'class' =>
'mw-body-content' ]
55 'id' =>
'firstHeading',
56 'class' =>
'firstHeading',
57 'lang' => $this->
getSkin()->getTitle()->getPageViewLanguage()->getHtmlCode()
60 Html::rawElement(
'div', [
'id' =>
'bodyContent',
'class' =>
'mw-body-content' ],
61 Html::rawElement(
'div', [
'id' =>
'siteSub' ], $this->
getMsg(
'tagline' )->parse() ) .
64 [
'id' =>
'contentSub',
'lang' => $this->
get(
'userlang' ),
'dir' => $this->
get(
'dir' ) ],
65 $this->
get(
'subtitle' )
67 $this->
getIfExists(
'undelete', [
'wrapper' =>
'div',
'parameters' => [
70 $this->
getIfExists(
'newtalk', [
'wrapper' =>
'div',
'parameters' => [
71 'class' =>
'usermessage'
73 Html::rawElement(
'div', [
'id' =>
'jump-to-nav',
'class' =>
'mw-jump' ],
74 $this->
getMsg(
'jumpto' )->escaped() .
75 Html::element(
'a', [
'href' =>
'#column-one' ],
78 $this->
getMsg(
'comma-separator' )->escaped() .
79 Html::element(
'a', [
'href' =>
'#searchInput' ],
83 '<!-- start content -->' .
85 $this->
get(
'bodytext' ) .
88 '<!-- end content -->' .
94 $html .= Html::closeElement(
'div' );
96 $html .= Html::rawElement(
'div',
99 'lang' => $this->
get(
'userlang' ),
100 'dir' => $this->
get(
'dir' )
102 Html::element(
'h2', [], $this->
getMsg(
'navigation-heading' )->
text() ) .
103 $this->
getBox(
'cactions', $this->data[
'content_actions'],
'views' ) .
105 Html::rawElement(
'div', [
'class' =>
'portlet',
'id' =>
'p-logo',
'role' =>
'banner' ],
108 'href' => $this->data[
'nav_urls'][
'mainpage'][
'href'],
109 'class' =>
'mw-wiki-logo',
116 $html .=
'<!-- end of the left (by default at least) column -->';
120 $html .= Html::closeElement(
'div' );
124 $html .= Html::closeElement(
'body' );
125 $html .= Html::closeElement(
'html' );
137 $sidebar = $this->data[
'sidebar'];
140 if ( !isset( $sidebar[
'SEARCH'] ) ) {
141 $sidebar[
'SEARCH'] =
true;
143 if ( !isset( $sidebar[
'TOOLBOX'] ) ) {
144 $sidebar[
'TOOLBOX'] =
true;
146 if ( !isset( $sidebar[
'LANGUAGES'] ) ) {
147 $sidebar[
'LANGUAGES'] =
true;
150 foreach ( $sidebar as $boxName => $content ) {
151 if ( $content ===
false ) {
156 $boxName = (
string)$boxName;
158 if ( $boxName ==
'SEARCH' ) {
160 } elseif ( $boxName ==
'TOOLBOX' ) {
162 } elseif ( $boxName ==
'LANGUAGES' ) {
169 [
'extra-classes' =>
'generated-sidebar' ]
185 if ( $this->config->get(
'UseTwoButtonsSearchForm' ) ) {
188 [
'id' =>
'mw-searchButton',
'class' =>
'searchButton' ]
191 $optionButtons = Html::rawElement(
'div', [],
192 Html::rawElement(
'a', [
'href' => $this->
get(
'searchaction' ),
'rel' =>
'search' ],
193 $this->
getMsg(
'powersearch-legend' )->escaped()
197 $searchInputId =
'searchInput';
198 $searchForm = Html::rawElement(
'form', [
199 'action' => $this->
get(
'wgScript' ),
202 Html::hidden(
'title', $this->
get(
'searchtitle' ) ) .
204 $this->
makeSearchButton(
'go', [
'id' =>
'searchGoButton',
'class' =>
'searchButton' ] ) .
208 $html .= $this->
getBox(
'search', $searchForm,
null, [
209 'search-input-id' => $searchInputId,
211 'body-id' =>
'searchBody'
228 'MonoBookTemplateToolboxEnd' => [ &$skin ],
229 'SkinTemplateToolboxEnd' => [ &$skin,
true ]
245 if ( $this->data[
'language_urls'] !==
false ) {
246 $html .= $this->
getBox(
'lang', $this->data[
'language_urls'],
'otherlanguages' );
262 protected function getBox( $name, $contents, $msg =
null, $setOptions = [] ) {
264 'class' =>
'portlet',
265 'body-class' =>
'pBody',
268 foreach ( $setOptions as $key =>
$value ) {
273 if ( $name ==
'personal' ) {
277 if ( array_key_exists(
'uls', $contents ) ) {
278 $prependiture .= $this->
makeListItem(
'uls', $contents[
'uls'] );
279 unset( $contents[
'uls'] );
281 if ( !$this->
getSkin()->getUser()->isLoggedIn() &&
284 $prependiture .= Html::rawElement(
286 [
'id' =>
'pt-anonuserpage' ],
287 $this->
getMsg(
'notloggedin' )->escaped()
290 $options[
'list-prepend'] = $prependiture;
306 protected function getPortlet( $name, $content, $msg =
null, $setOptions = [] ) {
310 'role' =>
'navigation',
311 'search-input-id' =>
'searchInput',
313 'id' =>
'p-' .
$name,
314 'class' =>
'mw-portlet',
315 'extra-classes' =>
'',
317 'body-class' =>
'mw-portlet-body',
318 'body-extra-classes' =>
'',
320 'text-wrapper' => [
'tag' =>
'span' ],
327 foreach ( $setOptions as $key =>
$value ) {
332 if ( $msg ===
null ) {
335 } elseif ( is_array( $msg ) ) {
336 $msgString = array_shift( $msg );
342 $msgObj = $this->
getMsg( $msg, $msgParams );
343 if ( $msgObj->exists() ) {
344 $msgString = $msgObj->parse();
346 $msgString = htmlspecialchars( $msg );
349 $labelId = Sanitizer::escapeIdForAttribute(
"p-$name-label" );
351 if ( is_array( $content ) ) {
352 $contentText = Html::openElement(
'ul',
353 [
'lang' => $this->
get(
'userlang' ),
'dir' => $this->
get(
'dir' ) ]
355 $contentText .=
$options[
'list-prepend'];
356 foreach ( $content as $key => $item ) {
357 if ( is_array(
$options[
'text-wrapper'] ) ) {
361 [
'text-wrapper' =>
$options[
'text-wrapper'] ]
371 if ( is_array(
$options[
'hooks'] ) ) {
372 foreach (
$options[
'hooks'] as $hook => $hookOptions ) {
377 $contentText .= Html::closeElement(
'ul' );
379 $contentText = $content;
386 'id' => Sanitizer::escapeIdForAttribute(
$options[
'id'] ),
389 if (
$options[
'role'] !==
'search' ) {
390 $divOptions[
'aria-labelledby'] = $labelId;
394 'lang' => $this->
get(
'userlang' ),
395 'dir' => $this->
get(
'dir' )
397 if (
$options[
'role'] ==
'search' ) {
398 $msgString = Html::rawElement(
'label', [
'for' =>
$options[
'search-input-id'] ], $msgString );
404 if ( is_string(
$options[
'body-id'] ) ) {
405 $bodyDivOptions[
'id'] =
$options[
'body-id'];
408 $html = Html::rawElement(
'div', $divOptions,
409 Html::rawElement(
'h3', $labelOptions, $msgString ) .
410 Html::rawElement(
'div', $bodyDivOptions,
431 if ( !is_array( $class ) ) {
434 if ( !is_array( $extraClasses ) ) {
435 $extraClasses = [ $extraClasses ];
438 return array_merge( $class, $extraClasses );
453 Hooks::run( $hook, $hookOptions );
454 $hookContents = ob_get_contents();
456 if ( !trim( $hookContents ) ) {
460 return $hookContents;
477 foreach ( $setOptions as $key =>
$value ) {
483 if ( (
$options[
'loose'] && $this->data[$object] !=
'' ) ||
484 ( !
$options[
'loose'] && $this->data[$object] ) ) {
485 if (
$options[
'wrapper'] ==
'none' ) {
486 $html .= $this->
get( $object );
488 $html .= Html::rawElement(
491 $this->
get( $object )
510 $html .= Html::openElement(
'div', [
512 'role' =>
'contentinfo',
513 'lang' => $this->
get(
'userlang' ),
514 'dir' => $this->
get(
'dir' )
517 foreach ( $validFooterIcons as $blockName => $footerIcons ) {
518 $html .= Html::openElement(
'div', [
519 'id' => Sanitizer::escapeIdForAttribute(
"f-{$blockName}ico" ),
520 'class' =>
'footer-icons'
522 foreach ( $footerIcons as $icon ) {
525 $html .= Html::closeElement(
'div' );
527 if ( count( $validFooterLinks ) > 0 ) {
528 $html .= Html::openElement(
'ul', [
'id' =>
'f-list' ] );
529 foreach ( $validFooterLinks as $aLink ) {
530 $html .= Html::rawElement(
532 [
'id' => Sanitizer::escapeIdForAttribute( $aLink ) ],
536 $html .= Html::closeElement(
'ul' );
538 $html .= Html::closeElement(
'div' );
New base template for a skin's template extended from QuickTemplate this class features helper method...
getFooterLinks( $option=null)
Returns an array of footerlinks trimmed down to only those footer links that are valid.
makeSearchButton( $mode, $attrs=[])
getToolbox()
Create an array of common toolbox items from the data in the quicktemplate stored by SkinTemplate.
getTrail()
Get the basic end-page trail including bottomscripts, reporttime, and debug stuff.
getPersonalTools()
Create an array of personal tools items from the data in the quicktemplate stored by SkinTemplate.
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=[])
Generates a list item for a navigation, portlet, portal, sidebar... list.
getMsg( $name)
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=[])
getClear()
Get a div with the core visualClear class, for clearing floats.
getAfterPortlet( $name)
Allows extensions to hook into known portlets and add stuff to them.
static titleAttrib( $name, $options=null, array $msgParams=[])
Given the id of an interface element, constructs the appropriate title attribute from the system mess...
static tooltipAndAccesskeyAttribs( $name, array $msgParams=[], $options=null)
Returns the attributes for the tooltip and access key.
execute()
Template filter callback for MonoBook skin.
getBox( $name, $contents, $msg=null, $setOptions=[])
Generate a sidebar box using getPortlet(); prefill some common stuff.
getSimpleFooter()
Renderer for getFooterIcons and getFooterLinks as a generic footer block.
getSearchBox()
Generate the search, using config options for buttons (?)
getPortlet( $name, $content, $msg=null, $setOptions=[])
Generates a block of navigation links with a header.
getRenderedSidebar()
Generate the full sidebar.
getLanguageBox()
Generate the languages box.
getIfExists( $object, $setOptions=[])
Simple wrapper for random if-statement-wrapped $this->data things.
mergeClasses( $class, $extraClasses)
Helper function for getPortlet.
getToolboxBox()
Generate the toolbox, complete with all three old hooks.
deprecatedHookHack( $hook, $hookOptions=[])
Wrapper to catch output of old hooks expecting to write directly to page We no longer do things that ...
getSkin()
Get the Skin object related to this object.
static groupHasPermission( $group, $role)
Check, if the given group has the given permission.
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
This code would result in ircNotify being run twice when an article is and once for brion Hooks can return three possible true was required This is the default since MediaWiki *some string
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses & $html
Allows to change the fields on the form that will be generated $name