Go to the documentation of this file.
34 $this->_context[$varName] =
$value;
46 while ( preg_match(
'/\$([0-9]*?)/sm',
$value, $m ) ) {
47 list( $src, $var ) = $m;
49 $varValue = $this->_context[$var];
108 'mediawiki.legacy.shared',
109 'mediawiki.legacy.commonPrint',
110 'mediawiki.ui.button'
125 function setupTemplate( $classname, $repository =
false, $cache_dir =
false ) {
126 return new $classname();
136 global $wgHideInterlanguageLinks;
137 if ( $wgHideInterlanguageLinks ) {
142 $languageLinks =
array();
144 foreach ( $this->
getOutput()->getLanguageLinks()
as $languageLinkText ) {
145 $languageLinkParts = explode(
':', $languageLinkText, 2 );
146 $class =
'interlanguage-link interwiki-' . $languageLinkParts[0];
147 unset( $languageLinkParts );
150 if ( $languageLinkTitle ) {
151 $ilInterwikiCode = $languageLinkTitle->getInterwiki();
154 if ( strval( $ilLangName ) ===
'' ) {
155 $ilLangName = $languageLinkText;
167 $languageLinkTitleText = $languageLinkTitle->getText();
168 if ( $languageLinkTitleText ===
'' ) {
170 'interlanguage-link-title-langonly',
175 'interlanguage-link-title',
176 $languageLinkTitleText,
181 $ilInterwikiCodeBCP47 =
wfBCP47( $ilInterwikiCode );
182 $languageLink =
array(
183 'href' => $languageLinkTitle->getFullURL(),
184 'text' => $ilLangName,
187 'lang' => $ilInterwikiCodeBCP47,
188 'hreflang' => $ilInterwikiCodeBCP47,
191 $languageLinks[] = $languageLink;
195 return $languageLinks;
210 $this->thispage =
$title->getPrefixedDBkey();
211 $this->titletxt =
$title->getPrefixedText();
212 $this->userpage =
$user->getUserPage()->getPrefixedText();
214 if ( !$request->wasPosted() ) {
215 $query = $request->getValues();
217 unset(
$query[
'returnto'] );
218 unset(
$query[
'returntoquery'] );
221 $this->loggedin =
$user->isLoggedIn();
222 $this->username =
$user->getName();
227 # This won't be used in the standard skins, but we define it to preserve the interface
228 # To save time, we check for existence
249 if (
$out !==
null ) {
263 $res = $tpl->execute();
284 $wgMimeType,
$wgJsMimeType, $wgXhtmlNamespaces, $wgHtml5Version,
285 $wgDisableCounters, $wgSitename, $wgLogo, $wgMaxCredits,
287 $wgScriptPath, $wgServer;
297 if ( !$this->useHeadElement ) {
298 $tpl->set(
'pagecss',
false );
299 $tpl->set(
'usercss',
false );
301 $tpl->set(
'userjs',
false );
302 $tpl->set(
'userjsprev',
false );
304 $tpl->set(
'jsvarurl',
false );
306 $tpl->set(
'xhtmldefaultnamespace',
'http://www.w3.org/1999/xhtml' );
307 $tpl->set(
'xhtmlnamespaces', $wgXhtmlNamespaces );
308 $tpl->set(
'html5version', $wgHtml5Version );
309 $tpl->set(
'headlinks',
$out->getHeadLinks() );
310 $tpl->set(
'csslinks',
$out->buildCssLinks() );
317 $tpl->set(
'title',
$out->getPageTitle() );
318 $tpl->set(
'pagetitle',
$out->getHTMLTitle() );
319 $tpl->set(
'displaytitle',
$out->mPageLinkTitle );
321 $tpl->setRef(
'thispage', $this->thispage );
322 $tpl->setRef(
'titleprefixeddbkey', $this->thispage );
323 $tpl->set(
'titletext',
$title->getText() );
324 $tpl->set(
'articleid',
$title->getArticleID() );
326 $tpl->set(
'isarticle',
$out->isArticle() );
329 if ( $subpagestr !==
'' ) {
330 $subpagestr =
'<span class="subpages">' . $subpagestr .
'</span>';
332 $tpl->set(
'subtitle', $subpagestr .
$out->getSubtitle() );
335 if ( $undelete ===
'' ) {
336 $tpl->set(
'undelete',
'' );
338 $tpl->set(
'undelete',
'<span class="subpages">' . $undelete .
'</span>' );
342 if (
$out->isSyndicated() ) {
344 foreach (
$out->getSyndicationLinks()
as $format =>
$link ) {
345 $feeds[$format] =
array(
347 'text' => $this->
msg(
"feed-$format" )->
text(),
351 $tpl->setRef(
'feeds', $feeds );
353 $tpl->set(
'feeds',
false );
356 $tpl->setRef(
'mimetype', $wgMimeType );
358 $tpl->set(
'charset',
'UTF-8' );
359 $tpl->setRef(
'wgScript', $wgScript );
360 $tpl->setRef(
'skinname', $this->skinname );
361 $tpl->set(
'skinclass', get_class( $this ) );
362 $tpl->setRef(
'skin', $this );
363 $tpl->setRef(
'stylename', $this->stylename );
364 $tpl->set(
'printable',
$out->isPrintable() );
365 $tpl->set(
'handheld', $request->getBool(
'handheld' ) );
366 $tpl->setRef(
'loggedin', $this->loggedin );
367 $tpl->set(
'notspecialpage', !
$title->isSpecialPage() );
377 $tpl->set(
'search', trim( $request->getVal(
'search' ) ) );
378 $tpl->setRef(
'stylepath', $wgStylePath );
380 $tpl->setRef(
'scriptpath', $wgScriptPath );
381 $tpl->setRef(
'serverurl', $wgServer );
382 $tpl->setRef(
'logopath', $wgLogo );
383 $tpl->setRef(
'sitename', $wgSitename );
386 $userLangCode = $userLang->getHtmlCode();
387 $userLangDir = $userLang->getDir();
389 $tpl->set(
'lang', $userLangCode );
390 $tpl->set(
'dir', $userLangDir );
391 $tpl->set(
'rtl', $userLang->isRTL() );
393 $tpl->set(
'capitalizeallnouns', $userLang->capitalizeAllNouns() ?
' capitalize-all-nouns' :
'' );
394 $tpl->set(
'showjumplinks',
true );
395 $tpl->set(
'username', $this->loggedin ? $this->username :
null );
396 $tpl->setRef(
'userpage', $this->userpage );
397 $tpl->setRef(
'userpageurl', $this->userpageUrlDetails[
'href'] );
398 $tpl->set(
'userlang', $userLangCode );
403 $tpl->set(
'userlangattributes',
'' );
404 $tpl->set(
'specialpageattributes',
'' ); # obsolete
406 $tpl->set(
'prebodyhtml',
'' );
409 $escUserlang = htmlspecialchars( $userLangCode );
410 $escUserdir = htmlspecialchars( $userLangDir );
413 $attrs =
" lang=\"$escUserlang\" dir=\"$escUserdir\"";
414 $tpl->set(
'userlangattributes', $attrs );
421 $tpl->set(
'logo', $this->
logoText() );
423 $tpl->set(
'copyright',
false );
424 $tpl->set(
'viewcount',
false );
425 $tpl->set(
'lastmod',
false );
426 $tpl->set(
'credits',
false );
427 $tpl->set(
'numberofwatchingusers',
false );
428 if (
$out->isArticle() &&
$title->exists() ) {
430 if ( !$wgDisableCounters ) {
433 $tpl->set(
'viewcount', $this->
msg(
'viewcount' )->numParams( $viewcount )->parse() );
437 if ( $wgPageShowWatchingUsers ) {
439 $num =
$dbr->selectField(
'watchlist',
'COUNT(*)',
440 array(
'wl_title' =>
$title->getDBkey(),
'wl_namespace' =>
$title->getNamespace() ),
444 $tpl->set(
'numberofwatchingusers',
445 $this->
msg(
'number_of_watching_users_pageview' )->numParams( $num )->parse()
450 if ( $wgMaxCredits != 0 ) {
452 $this->
getContext() )->getCredits( $wgMaxCredits, $wgShowCreditsIfMax ) );
466 $tpl->set(
'about', $this->
aboutLink() );
468 $tpl->set(
'footerlinks',
array(
472 'numberofwatchingusers',
484 $tpl->set(
'footericons', $wgFooterIcons );
485 foreach ( $tpl->data[
'footericons']
as $footerIconsKey => &$footerIconsBlock ) {
486 if ( count( $footerIconsBlock ) > 0 ) {
487 foreach ( $footerIconsBlock
as &$footerIcon ) {
488 if ( isset( $footerIcon[
'src'] ) ) {
489 if ( !isset( $footerIcon[
'width'] ) ) {
490 $footerIcon[
'width'] = 88;
492 if ( !isset( $footerIcon[
'height'] ) ) {
493 $footerIcon[
'height'] = 31;
498 unset( $tpl->data[
'footericons'][$footerIconsKey] );
506 # An ID that includes the actual body text; without categories, contentSub, ...
507 $realBodyAttribs =
array(
'id' =>
'mw-content-text' );
509 # Add a mw-content-ltr/rtl class to be able to style based on text direction
510 # when the content is different from the UI language, i.e.:
511 # not for special pages or file pages AND only when viewing AND if the page exists
512 # (or is in MW namespace, because that has default content)
516 $pageLang =
$title->getPageViewLanguage();
517 $realBodyAttribs[
'lang'] = $pageLang->getHtmlCode();
518 $realBodyAttribs[
'dir'] = $pageLang->getDir();
519 $realBodyAttribs[
'class'] =
'mw-content-' . $pageLang->getDir();
523 $tpl->setRef(
'bodytext',
$out->mBodytext );
526 if ( count( $language_urls ) ) {
527 $tpl->setRef(
'language_urls', $language_urls );
529 $tpl->set(
'language_urls',
false );
538 $tpl->setRef(
'content_navigation', $content_navigation );
539 $tpl->setRef(
'content_actions', $content_actions );
545 if ( $this->useHeadElement ) {
546 $tpl->set(
'headelement',
$out->headElement( $this ) );
548 $tpl->set(
'headscripts',
$out->getHeadScripts() .
$out->getHeadItems() );
551 $tpl->set(
'debug',
'' );
556 if ( !
wfRunHooks(
'SkinTemplateOutputPageBeforeExec',
array( &$this, &$tpl ) ) ) {
557 wfDebug( __METHOD__ .
": Hook SkinTemplateOutputPageBeforeExec broke outputPage execution!\n" );
562 $tpl->set(
'bodycontent', $tpl->data[
'bodytext'] );
566 $tpl->data[
'bodytext'] .=
Html::rawElement(
'div',
array(
'class' =>
'printfooter' ),
"\n{$tpl->data['printfooter']}" ) .
"\n";
567 $tpl->data[
'bodytext'] .= $tpl->data[
'debughtml'];
586 foreach ( $tpl->getPersonalTools()
as $key => $item ) {
587 $html .= $tpl->makeListItem( $key, $item );
626 global $wgUseCombinedLoginLink;
627 return $wgUseCombinedLoginLink;
637 $pageurl =
$title->getLocalURL();
643 # Due to bug 32276, if a user does not have read permissions,
644 # $this->getTitle() will just give Special:Badtitle, which is
645 # not especially useful as a returnto parameter. Use the title
646 # from the request instead, if there was one.
647 if ( $this->
getUser()->isAllowed(
'read' ) ) {
652 $page = $request->getVal(
'returnto', $page );
654 if ( strval( $page ) !==
'' ) {
655 $a[
'returnto'] = $page;
656 $query = $request->getVal(
'returntoquery', $this->thisquery );
658 $a[
'returntoquery'] =
$query;
663 if ( $this->loggedin ) {
665 'text' => $this->username,
666 'href' => &$this->userpageUrlDetails[
'href'],
667 'class' => $this->userpageUrlDetails[
'exists'] ?
false :
'new',
668 'active' => ( $this->userpageUrlDetails[
'href'] == $pageurl ),
673 'text' => $this->
msg(
'mytalk' )->
text(),
674 'href' => &$usertalkUrlDetails[
'href'],
675 'class' => $usertalkUrlDetails[
'exists'] ?
false :
'new',
676 'active' => ( $usertalkUrlDetails[
'href'] == $pageurl )
680 'text' => $this->
msg(
'mypreferences' )->
text(),
682 'active' => ( $href == $pageurl )
685 if ( $this->
getUser()->isAllowed(
'viewmywatchlist' ) ) {
688 'text' => $this->
msg(
'mywatchlist' )->
text(),
690 'active' => ( $href == $pageurl )
694 # We need to do an explicit check for Special:Contributions, as we
695 # have to match both the title, and the target, which could come
696 # from request values (Special:Contributions?target=Jimbo_Wales)
697 # or be specified in "sub page" form
698 # (Special:Contributions/Jimbo_Wales). The plot
699 # thickens, because the Title object is altered for special pages,
700 # so it doesn't contain the original alias-with-subpage.
704 $active = $spName ==
'Contributions'
705 && ( ( $spPar && $spPar == $this->username )
706 || $request->getText(
'target' ) == $this->username );
713 'text' => $this->
msg(
'mycontris' )->
text(),
718 'text' => $this->
msg(
'pt-userlogout' )->
text(),
719 'href' => self::makeSpecialUrl(
'Userlogout',
722 $title->isSpecial(
'Preferences' ) ?
'noreturnto' : $returnto
728 $loginlink = $this->
getUser()->isAllowed(
'createaccount' ) && $useCombinedLoginLink
729 ?
'nav-login-createaccount'
731 $is_signup = $request->getText(
'type' ) ==
'signup';
734 'text' => $this->
msg( $loginlink )->
text(),
735 'href' => self::makeSpecialUrl(
'Userlogin', $returnto ),
736 'active' =>
$title->isSpecial(
'Userlogin' ) && ( $loginlink ==
'nav-login-createaccount' || !$is_signup ),
738 $createaccount_url =
array(
739 'text' => $this->
msg(
'pt-createaccount' )->
text(),
740 'href' => self::makeSpecialUrl(
'Userlogin',
"$returnto&type=signup" ),
741 'active' =>
$title->isSpecial(
'Userlogin' ) && $is_signup,
745 $href = &$this->userpageUrlDetails[
'href'];
747 'text' => $this->username,
749 'class' => $this->userpageUrlDetails[
'exists'] ?
false :
'new',
750 'active' => ( $pageurl == $href )
753 $href = &$usertalkUrlDetails[
'href'];
755 'text' => $this->
msg(
'anontalk' )->
text(),
757 'class' => $usertalkUrlDetails[
'exists'] ?
false :
'new',
758 'active' => ( $pageurl == $href )
762 if ( $this->
getUser()->isAllowed(
'createaccount' ) && !$useCombinedLoginLink ) {
788 $classes[] =
'selected';
790 if ( $checkEdit && !
$title->isKnown() ) {
795 $query =
'action=edit&redlink=1';
802 if ( is_array( $message ) ) {
804 $message = end( $message );
806 if ( $msg->exists() ) {
807 $text = $msg->text();
816 $title, $message, $selected, $checkEdit,
822 'class' => implode(
' ', $classes ),
830 if ( !is_object(
$title ) ) {
831 throw new MWException( __METHOD__ .
" given invalid pagename $name" );
836 'href' =>
$title->getLocalURL( $urlaction ),
837 'exists' =>
$title->getArticleID() != 0,
846 'href' =>
$title->getLocalURL( $urlaction ),
847 'exists' =>
$title->getArticleID() != 0,
885 global $wgDisableLangConversion;
897 $content_navigation =
array(
898 'namespaces' =>
array(),
900 'actions' =>
array(),
901 'variants' =>
array()
905 $action = $request->getVal(
'action',
'view' );
907 $userCanRead =
$title->quickUserCan(
'read',
$user );
909 $preventActiveTabs =
false;
910 wfRunHooks(
'SkinTemplatePreventOtherActiveTabs',
array( &$this, &$preventActiveTabs ) );
913 if (
$title->canExist() ) {
915 $subjectPage =
$title->getSubjectPage();
916 $talkPage =
$title->getTalkPage();
919 $isTalk =
$title->isTalkPage();
922 $subjectId =
$title->getNamespaceKey(
'' );
924 if ( $subjectId ==
'main' ) {
927 $talkId =
"{$subjectId}_talk";
933 $subjectMsg =
array(
"nstab-$subjectId" );
934 if ( $subjectPage->isMainPage() ) {
935 array_unshift( $subjectMsg,
'mainpage-nstab' );
937 $content_navigation[
'namespaces'][$subjectId] = $this->
tabAction(
938 $subjectPage, $subjectMsg, !$isTalk && !$preventActiveTabs,
'', $userCanRead
940 $content_navigation[
'namespaces'][$subjectId][
'context'] =
'subject';
941 $content_navigation[
'namespaces'][$talkId] = $this->
tabAction(
942 $talkPage,
array(
"nstab-$talkId",
'talk' ), $isTalk && !$preventActiveTabs,
'', $userCanRead
944 $content_navigation[
'namespaces'][$talkId][
'context'] =
'talk';
946 if ( $userCanRead ) {
951 if (
$title->exists() || $isForeignFile ) {
952 $content_navigation[
'views'][
'view'] = $this->
tabAction(
953 $isTalk ? $talkPage : $subjectPage,
954 array(
"$skname-view-view",
'view' ),
955 ( $onPage && ( $action ==
'view' || $action ==
'purge' ) ),
'',
true
958 $content_navigation[
'views'][
'view'][
'redundant'] =
true;
962 if ( $isForeignFile ) {
964 $content_navigation[
'views'][
'view-foreign'] =
array(
968 params(
$file->getRepo()->getDisplayName() )->
text(),
969 'href' =>
$file->getDescriptionUrl(),
979 $isTalkClass = $isTalk ?
' istalk' :
'';
981 $isEditing = $onPage && ( $action ==
'edit' || $action ==
'submit' );
984 $showNewSection = !
$out->forceHideNewSectionLink()
986 $section = $request->getVal(
'section' );
989 $msgKey = $isForeignFile ?
'edit-local' :
'edit';
991 $msgKey = $isForeignFile ?
'create-local' :
'create';
993 $content_navigation[
'views'][
'edit'] =
array(
994 'class' => ( $isEditing && (
$section !==
'new' || !$showNewSection ) ?
'selected' :
'' ) . $isTalkClass,
996 'href' =>
$title->getLocalURL( $this->editUrlOptions() ),
997 'primary' => !$isForeignFile,
1001 if ( $showNewSection ) {
1004 $content_navigation[
'views'][
'addsection'] =
array(
1005 'class' => ( $isEditing &&
$section ==
'new' ) ?
'selected' :
false,
1007 'href' =>
$title->getLocalURL(
'action=edit§ion=new' )
1011 } elseif (
$title->hasSourceText() ) {
1013 $content_navigation[
'views'][
'viewsource'] =
array(
1014 'class' => ( $onPage && $action ==
'edit' ) ?
'selected' :
false,
1016 'href' =>
$title->getLocalURL( $this->editUrlOptions() ),
1024 if (
$title->exists() ) {
1026 $content_navigation[
'views'][
'history'] =
array(
1027 'class' => ( $onPage && $action ==
'history' ) ?
'selected' :
false,
1029 'href' =>
$title->getLocalURL(
'action=history' ),
1030 'rel' =>
'archives',
1034 $content_navigation[
'actions'][
'delete'] =
array(
1035 'class' => ( $onPage && $action ==
'delete' ) ?
'selected' :
false,
1037 'href' =>
$title->getLocalURL(
'action=delete' )
1043 $content_navigation[
'actions'][
'move'] =
array(
1044 'class' => $this->
getTitle()->isSpecial(
'Movepage' ) ?
'selected' :
false,
1046 'href' => $moveTitle->getLocalURL()
1051 if (
$user->isAllowed(
'deletedhistory' ) ) {
1056 $msgKey =
$user->isAllowed(
'undelete' ) ?
'undelete' :
'viewdeleted';
1057 $content_navigation[
'actions'][
'undelete'] =
array(
1058 'class' => $this->
getTitle()->isSpecial(
'Undelete' ) ?
'selected' :
false,
1061 'href' => $undelTitle->getLocalURL(
array(
'target' =>
$title->getPrefixedDBkey() ) )
1067 if (
$title->quickUserCan(
'protect',
$user ) &&
$title->getRestrictionTypes() &&
1070 $mode =
$title->isProtected() ?
'unprotect' :
'protect';
1071 $content_navigation[
'actions'][$mode] =
array(
1072 'class' => ( $onPage && $action == $mode ) ?
'selected' :
false,
1074 'href' =>
$title->getLocalURL(
"action=$mode" )
1081 if ( $this->loggedin &&
$user->isAllowedAll(
'viewmywatchlist',
'editmywatchlist' ) ) {
1091 $mode =
$user->isWatched(
$title ) ?
'unwatch' :
'watch';
1093 $content_navigation[
'actions'][$mode] =
array(
1094 'class' => $onPage && ( $action ==
'watch' || $action ==
'unwatch' ) ?
'selected' :
false,
1096 'text' => $this->
msg( $mode )->
text(),
1097 'href' =>
$title->getLocalURL(
array(
'action' => $mode,
'token' => $token ) )
1102 wfRunHooks(
'SkinTemplateNavigation',
array( &$this, &$content_navigation ) );
1104 if ( $userCanRead && !$wgDisableLangConversion ) {
1105 $pageLang =
$title->getPageLanguage();
1107 $variants = $pageLang->getVariants();
1110 if ( count( $variants ) > 1 ) {
1113 $preferred = $pageLang->getPreferredVariant();
1115 $params = $request->getQueryValues();
1121 foreach ( $variants
as $code ) {
1123 $varname = $pageLang->getVariantname( $code );
1125 $content_navigation[
'variants'][] =
array(
1126 'class' => ( $code == $preferred ) ?
'selected' :
false,
1130 'hreflang' =>
wfBCP47( $code ),
1137 $content_navigation[
'namespaces'][
'special'] =
array(
1138 'class' =>
'selected',
1139 'text' => $this->
msg(
'nstab-special' )->
text(),
1140 'href' => $request->getRequestURL(),
1141 'context' =>
'subject'
1144 wfRunHooks(
'SkinTemplateNavigation::SpecialPage',
1145 array( &$this, &$content_navigation ) );
1149 wfRunHooks(
'SkinTemplateNavigation::Universal',
array( &$this, &$content_navigation ) );
1152 foreach ( $content_navigation
as $section => &$links ) {
1153 foreach ( $links
as $key => &
$link ) {
1155 if ( isset(
$link[
'context'] ) &&
$link[
'context'] ==
'subject' ) {
1156 $xmlID =
'ca-nstab-' . $xmlID;
1157 } elseif ( isset(
$link[
'context'] ) &&
$link[
'context'] ==
'talk' ) {
1159 } elseif (
$section ==
'variants' ) {
1160 $xmlID =
'ca-varlang-' . $xmlID;
1162 $xmlID =
'ca-' . $xmlID;
1164 $link[
'id'] = $xmlID;
1168 # We don't want to give the watch tab an accesskey if the
1169 # page is being edited, because that conflicts with the
1170 # accesskey on the watch checkbox. We also don't want to
1171 # give the edit tab an accesskey, because that's fairly
1172 # superfluous and conflicts with an accesskey (Ctrl-E) often
1173 # used for editing in Safari.
1174 if ( in_array( $action,
array(
'edit',
'submit' ) ) ) {
1175 if ( isset( $content_navigation[
'views'][
'edit'] ) ) {
1176 $content_navigation[
'views'][
'edit'][
'tooltiponly'] =
true;
1178 if ( isset( $content_navigation[
'actions'][
'watch'] ) ) {
1179 $content_navigation[
'actions'][
'watch'][
'tooltiponly'] =
true;
1181 if ( isset( $content_navigation[
'actions'][
'unwatch'] ) ) {
1182 $content_navigation[
'actions'][
'unwatch'][
'tooltiponly'] =
true;
1188 return $content_navigation;
1204 $content_actions =
array();
1206 foreach ( $content_navigation
as $links ) {
1208 foreach ( $links
as $key =>
$value ) {
1210 if ( isset(
$value[
'redundant'] ) &&
$value[
'redundant'] ) {
1219 if ( isset(
$value[
'id'] ) && substr(
$value[
'id'], 0, 3 ) ==
'ca-' ) {
1220 $key = substr(
$value[
'id'], 3 );
1223 if ( isset( $content_actions[$key] ) ) {
1224 wfDebug( __METHOD__ .
": Found a duplicate key for $key while flattening " .
1225 "content_navigation into content_actions.\n" );
1229 $content_actions[$key] =
$value;
1237 return $content_actions;
1246 global $wgUploadNavigationUrl;
1253 $nav_urls =
array();
1254 $nav_urls[
'mainpage'] =
array(
'href' => self::makeMainPageUrl() );
1255 if ( $wgUploadNavigationUrl ) {
1256 $nav_urls[
'upload'] =
array(
'href' => $wgUploadNavigationUrl );
1258 $nav_urls[
'upload'] =
array(
'href' => self::makeSpecialUrl(
'Upload' ) );
1260 $nav_urls[
'upload'] =
false;
1262 $nav_urls[
'specialpages'] =
array(
'href' => self::makeSpecialUrl(
'Specialpages' ) );
1264 $nav_urls[
'print'] =
false;
1265 $nav_urls[
'permalink'] =
false;
1266 $nav_urls[
'info'] =
false;
1267 $nav_urls[
'whatlinkshere'] =
false;
1268 $nav_urls[
'recentchangeslinked'] =
false;
1269 $nav_urls[
'contributions'] =
false;
1270 $nav_urls[
'log'] =
false;
1271 $nav_urls[
'blockip'] =
false;
1272 $nav_urls[
'emailuser'] =
false;
1273 $nav_urls[
'userrights'] =
false;
1277 if ( !
$out->isPrintable() && (
$out->isArticle() || $this->
getTitle()->isSpecialPage() ) ) {
1278 $nav_urls[
'print'] =
array(
1279 'text' => $this->
msg(
'printableversion' )->
text(),
1280 'href' => $this->
getTitle()->getLocalURL(
1281 $request->appendQueryValue(
'printable',
'yes',
true ) )
1285 if (
$out->isArticle() ) {
1289 $nav_urls[
'permalink'] =
array(
1290 'text' => $this->
msg(
'permalink' )->
text(),
1291 'href' => $this->
getTitle()->getLocalURL(
"oldid=$revid" )
1296 wfRunHooks(
'SkinTemplateBuildNavUrlsNav_urlsAfterPermalink',
1297 array( &$this, &$nav_urls, &$revid, &$revid ) );
1300 if (
$out->isArticleRelated() ) {
1301 $nav_urls[
'whatlinkshere'] =
array(
1305 $nav_urls[
'info'] =
array(
1306 'text' => $this->
msg(
'pageinfo-toolboxlink' )->
text(),
1307 'href' => $this->
getTitle()->getLocalURL(
"action=info" )
1310 if ( $this->
getTitle()->getArticleID() ) {
1311 $nav_urls[
'recentchangeslinked'] =
array(
1319 $rootUser =
$user->getName();
1321 $nav_urls[
'contributions'] =
array(
1322 'text' => $this->
msg(
'contributions', $rootUser )->
text(),
1323 'href' => self::makeSpecialUrlSubpage(
'Contributions', $rootUser )
1326 $nav_urls[
'log'] =
array(
1327 'href' => self::makeSpecialUrlSubpage(
'Log', $rootUser )
1330 if ( $this->
getUser()->isAllowed(
'block' ) ) {
1331 $nav_urls[
'blockip'] =
array(
1332 'href' => self::makeSpecialUrlSubpage(
'Block', $rootUser )
1337 $nav_urls[
'emailuser'] =
array(
1338 'href' => self::makeSpecialUrlSubpage(
'Emailuser', $rootUser )
1342 if ( !
$user->isAnon() ) {
1345 if ( $sur->userCanExecute( $this->getUser() ) ) {
1346 $nav_urls[
'userrights'] =
array(
1347 'href' => self::makeSpecialUrlSubpage(
'Userrights', $rootUser )
1363 return $this->
getTitle()->getNamespaceKey();
1397 public function get(
$name, $default = null ) {
1417 $this->translator = &
$t;
1424 abstract public function execute();
1430 echo htmlspecialchars( $this->
data[$str] );
1437 echo $this->
data[$str];
1444 echo htmlspecialchars( $this->translator->translate( $str ) );
1451 echo $this->translator->translate( $str );
1461 $text = $this->translator->translate( $str );
1462 echo
$wgOut->parse( $text );
1470 return isset( $this->
data[$str] );
1479 $msg = $this->translator->translate( $str );
1480 return ( $msg !=
'-' ) && ( $msg !=
'' ); # ????
1489 return $this->
data[
'skin'];
1501 $html = ob_get_contents();
1525 echo $this->
getMsg( $str )->escaped();
1529 echo $this->
getMsg( $str )->text();
1533 echo $this->
getMsg( $str )->parseAsBlock();
1547 if ( isset( $this->
data[
'nav_urls'][
'whatlinkshere'] ) && $this->
data[
'nav_urls'][
'whatlinkshere'] ) {
1548 $toolbox[
'whatlinkshere'] = $this->
data[
'nav_urls'][
'whatlinkshere'];
1549 $toolbox[
'whatlinkshere'][
'id'] =
't-whatlinkshere';
1551 if ( isset( $this->
data[
'nav_urls'][
'recentchangeslinked'] ) && $this->
data[
'nav_urls'][
'recentchangeslinked'] ) {
1552 $toolbox[
'recentchangeslinked'] = $this->
data[
'nav_urls'][
'recentchangeslinked'];
1553 $toolbox[
'recentchangeslinked'][
'msg'] =
'recentchangeslinked-toolbox';
1554 $toolbox[
'recentchangeslinked'][
'id'] =
't-recentchangeslinked';
1556 if ( isset( $this->
data[
'feeds'] ) && $this->
data[
'feeds'] ) {
1557 $toolbox[
'feeds'][
'id'] =
'feedlinks';
1558 $toolbox[
'feeds'][
'links'] =
array();
1559 foreach ( $this->
data[
'feeds']
as $key => $feed ) {
1560 $toolbox[
'feeds'][
'links'][$key] = $feed;
1561 $toolbox[
'feeds'][
'links'][$key][
'id'] =
"feed-$key";
1562 $toolbox[
'feeds'][
'links'][$key][
'rel'] =
'alternate';
1563 $toolbox[
'feeds'][
'links'][$key][
'type'] =
"application/{$key}+xml";
1564 $toolbox[
'feeds'][
'links'][$key][
'class'] =
'feedlink';
1567 foreach (
array(
'contributions',
'log',
'blockip',
'emailuser',
'userrights',
'upload',
'specialpages' )
as $special ) {
1568 if ( isset( $this->
data[
'nav_urls'][$special] ) && $this->
data[
'nav_urls'][$special] ) {
1570 $toolbox[
$special][
'id'] =
"t-$special";
1573 if ( isset( $this->
data[
'nav_urls'][
'print'] ) && $this->
data[
'nav_urls'][
'print'] ) {
1574 $toolbox[
'print'] = $this->
data[
'nav_urls'][
'print'];
1575 $toolbox[
'print'][
'id'] =
't-print';
1576 $toolbox[
'print'][
'rel'] =
'alternate';
1577 $toolbox[
'print'][
'msg'] =
'printableversion';
1579 if ( isset( $this->
data[
'nav_urls'][
'permalink'] ) && $this->
data[
'nav_urls'][
'permalink'] ) {
1580 $toolbox[
'permalink'] = $this->
data[
'nav_urls'][
'permalink'];
1581 if ( $toolbox[
'permalink'][
'href'] ===
'' ) {
1582 unset( $toolbox[
'permalink'][
'href'] );
1583 $toolbox[
'ispermalink'][
'tooltiponly'] =
true;
1584 $toolbox[
'ispermalink'][
'id'] =
't-ispermalink';
1585 $toolbox[
'ispermalink'][
'msg'] =
'permalink';
1587 $toolbox[
'permalink'][
'id'] =
't-permalink';
1590 if ( isset( $this->
data[
'nav_urls'][
'info'] ) && $this->
data[
'nav_urls'][
'info'] ) {
1591 $toolbox[
'info'] = $this->
data[
'nav_urls'][
'info'];
1592 $toolbox[
'info'][
'id'] =
't-info';
1611 $personal_tools =
array();
1612 foreach ( $this->
get(
'personal_urls' )
as $key => $plink ) {
1613 # The class on a personal_urls item is meant to go on the <a> instead
1614 # of the <li> so we have to use a single item "links" array instead
1615 # of using most of the personal_url's keys directly.
1618 array(
'single-id' =>
"pt-$key" ),
1622 if ( isset( $plink[
'active'] ) ) {
1623 $ptool[
'active'] = $plink[
'active'];
1625 foreach (
array(
'href',
'class',
'text',
'dir' )
as $k ) {
1626 if ( isset( $plink[$k] ) ) {
1627 $ptool[
'links'][0][$k] = $plink[$k];
1630 $personal_tools[$key] = $ptool;
1632 return $personal_tools;
1637 $sidebar = $this->
data[
'sidebar'];
1638 if ( !isset( $sidebar[
'SEARCH'] ) ) {
1639 $sidebar[
'SEARCH'] =
true;
1641 if ( !isset( $sidebar[
'TOOLBOX'] ) ) {
1642 $sidebar[
'TOOLBOX'] =
true;
1644 if ( !isset( $sidebar[
'LANGUAGES'] ) ) {
1645 $sidebar[
'LANGUAGES'] =
true;
1649 unset( $sidebar[
'SEARCH'] );
1652 unset( $sidebar[
'TOOLBOX'] );
1655 unset( $sidebar[
'LANGUAGES'] );
1659 foreach ( $sidebar
as $boxName => $content ) {
1660 if ( $content ===
false ) {
1663 switch ( $boxName ) {
1666 $boxes[$boxName] =
array(
1668 'header' => $this->
getMsg(
'search' )->
text(),
1669 'generated' =>
false,
1674 $msgObj = $this->
getMsg(
'toolbox' );
1675 $boxes[$boxName] =
array(
1677 'header' => $msgObj->exists() ? $msgObj->text() :
'toolbox',
1678 'generated' =>
false,
1683 if ( $this->
data[
'language_urls'] ) {
1684 $msgObj = $this->
getMsg(
'otherlanguages' );
1685 $boxes[$boxName] =
array(
1687 'header' => $msgObj->exists() ? $msgObj->text() :
'otherlanguages',
1688 'generated' =>
false,
1689 'content' => $this->
data[
'language_urls'],
1694 $msgObj = $this->
getMsg( $boxName );
1695 $boxes[$boxName] =
array(
1696 'id' =>
"p-$boxName",
1697 'header' => $msgObj->exists() ? $msgObj->text() : $boxName,
1698 'generated' =>
true,
1699 'content' => $content,
1706 $hookContents =
null;
1707 if ( isset( $boxes[
'TOOLBOX'] ) ) {
1712 $hookContents = ob_get_contents();
1714 if ( !trim( $hookContents ) ) {
1715 $hookContents =
null;
1721 foreach ( $boxes
as $boxName => $box ) {
1722 if ( is_array( $box[
'content'] ) ) {
1724 foreach ( $box[
'content']
as $key => $val ) {
1728 if ( $hookContents ) {
1729 $content .=
"\n $hookContents";
1732 $content .=
"\n</ul>\n";
1733 $boxes[$boxName][
'content'] = $content;
1737 if ( $hookContents ) {
1738 $boxes[
'TOOLBOXEND'] =
array(
1739 'id' =>
'p-toolboxend',
1740 'header' => $boxes[
'TOOLBOX'][
'header'],
1741 'generated' =>
false,
1742 'content' =>
"<ul>{$hookContents}</ul>",
1746 foreach ( $boxes
as $key => $box ) {
1747 if ( $key ===
'TOOLBOXEND' ) {
1750 $boxes2[$key] = $box;
1751 if ( $key ===
'TOOLBOX' ) {
1752 $boxes2[
'TOOLBOXEND'] = $boxes[
'TOOLBOXEND'];
1770 if ( $content !==
'' ) {
1771 echo
"<div class='after-portlet after-portlet-$name'>$content</div>";
1820 if ( isset( $item[
'text'] ) ) {
1821 $text = $item[
'text'];
1823 $text = $this->translator->translate( isset( $item[
'msg'] ) ? $item[
'msg'] : $key );
1826 $html = htmlspecialchars( $text );
1828 if ( isset(
$options[
'text-wrapper'] ) ) {
1829 $wrapper =
$options[
'text-wrapper'];
1830 if ( isset( $wrapper[
'tag'] ) ) {
1831 $wrapper =
array( $wrapper );
1833 while ( count( $wrapper ) > 0 ) {
1834 $element = array_pop( $wrapper );
1839 if ( isset( $item[
'href'] ) || isset(
$options[
'link-fallback'] ) ) {
1841 foreach (
array(
'single-id',
'text',
'msg',
'tooltiponly',
'context',
'primary' )
as $k ) {
1842 unset( $attrs[$k] );
1845 if ( isset( $item[
'id'] ) && !isset( $item[
'single-id'] ) ) {
1846 $item[
'single-id'] = $item[
'id'];
1848 if ( isset( $item[
'single-id'] ) ) {
1849 if ( isset( $item[
'tooltiponly'] ) && $item[
'tooltiponly'] ) {
1851 if (
$title !==
false ) {
1852 $attrs[
'title'] =
$title;
1856 if ( isset( $tip[
'title'] ) && $tip[
'title'] !==
false ) {
1857 $attrs[
'title'] = $tip[
'title'];
1859 if ( isset( $tip[
'accesskey'] ) && $tip[
'accesskey'] !==
false ) {
1860 $attrs[
'accesskey'] = $tip[
'accesskey'];
1864 if ( isset(
$options[
'link-class'] ) ) {
1865 if ( isset( $attrs[
'class'] ) ) {
1866 $attrs[
'class'] .=
" {$options['link-class']}";
1868 $attrs[
'class'] =
$options[
'link-class'];
1906 if ( isset( $item[
'links'] ) ) {
1908 foreach ( $item[
'links']
as $linkKey =>
$link ) {
1911 $html = implode(
' ', $links );
1915 foreach (
array(
'id',
'class',
'active',
'tag',
'itemtitle' )
as $k ) {
1918 if ( isset( $item[
'id'] ) && !isset( $item[
'single-id'] ) ) {
1922 $link[
'single-id'] = $item[
'id'];
1928 foreach (
array(
'id',
'class' )
as $attr ) {
1929 if ( isset( $item[$attr] ) ) {
1930 $attrs[$attr] = $item[$attr];
1933 if ( isset( $item[
'active'] ) && $item[
'active'] ) {
1934 if ( !isset( $attrs[
'class'] ) ) {
1935 $attrs[
'class'] =
'';
1937 $attrs[
'class'] .=
' active';
1938 $attrs[
'class'] = trim( $attrs[
'class'] );
1940 if ( isset( $item[
'itemtitle'] ) ) {
1941 $attrs[
'title'] = $item[
'itemtitle'];
1950 'placeholder' =>
wfMessage(
'searchsuggest-search' )->
text(),
1951 'value' => $this->
get(
'search',
'' ),
1964 'value' => $this->translator->translate(
1965 $mode ==
'go' ?
'searcharticle' :
'searchbutton' ),
1967 $realAttrs = array_merge(
1974 $buttonAttrs =
array(
1978 $buttonAttrs = array_merge(
1983 unset( $buttonAttrs[
'src'] );
1984 unset( $buttonAttrs[
'alt'] );
1985 unset( $buttonAttrs[
'width'] );
1986 unset( $buttonAttrs[
'height'] );
1988 'src' => $attrs[
'src'],
1989 'alt' => isset( $attrs[
'alt'] )
1991 : $this->translator->translate(
'searchbutton' ),
1992 'width' => isset( $attrs[
'width'] ) ? $attrs[
'width'] :
null,
1993 'height' => isset( $attrs[
'height'] ) ? $attrs[
'height'] :
null,
1997 throw new MWException(
'Unknown mode passed to BaseTemplate::makeSearchButton' );
2010 $footerlinks = $this->
get(
'footerlinks' );
2013 $validFooterLinks =
array();
2014 foreach ( $footerlinks
as $category => $links ) {
2015 $validFooterLinks[$category] =
array();
2017 if ( isset( $this->
data[$link] ) && $this->
data[$link] ) {
2018 $validFooterLinks[$category][] =
$link;
2021 if ( count( $validFooterLinks[$category] ) <= 0 ) {
2022 unset( $validFooterLinks[$category] );
2026 if ( $option ==
'flat' ) {
2028 $validFooterLinks = call_user_func_array(
2030 array_values( $validFooterLinks )
2034 return $validFooterLinks;
2050 $footericons = $this->
get(
'footericons' );
2052 if ( $option ==
'icononly' ) {
2054 foreach ( $footericons
as &$footerIconsBlock ) {
2055 foreach ( $footerIconsBlock
as $footerIconKey => $footerIcon ) {
2056 if ( !is_string( $footerIcon ) && !isset( $footerIcon[
'src'] ) ) {
2057 unset( $footerIconsBlock[$footerIconKey] );
2062 foreach ( $footericons
as $footerIconsKey => &$footerIconsBlock ) {
2063 if ( count( $footerIconsBlock ) <= 0 ) {
2064 unset( $footericons[$footerIconsKey] );
2067 } elseif ( $option ==
'nocopyright' ) {
2068 unset( $footericons[
'copyright'][
'copyright'] );
2069 if ( count( $footericons[
'copyright'] ) <= 0 ) {
2070 unset( $footericons[
'copyright'] );
2074 return $footericons;
2084 <?
php $this->
html(
'bottomscripts' ); ?>
2085 <?
php $this->
html(
'reporttime' ) ?>
static getActionName(IContextSource $context)
Get the action that will be executed, not necessarily the one passed passed through the "action" requ...
getPersonalTools()
Create an array of personal tools items from the data in the quicktemplate stored by SkinTemplate.
getFooterLinks( $option=null)
Returns an array of footerlinks trimmed down to only those footer links that are valid.
makeSearchInput( $attrs=array())
msgWiki( $str)
An ugly, ugly hack.
useCombinedLoginLink()
Output a boolean indicating if buildPersonalUrls should output separate login and create account link...
The index of the header message $result[1]=The index of the body text message $result[2 through n]=Parameters passed to body text message. Please note the header message cannot receive/use parameters. 'ImportHandleLogItemXMLTag':When parsing a XML tag in a log item. $reader:XMLReader object $logInfo:Array of information Return false to stop further processing of the tag 'ImportHandlePageXMLTag':When parsing a XML tag in a page. $reader:XMLReader object $pageInfo:Array of information Return false to stop further processing of the tag 'ImportHandleRevisionXMLTag':When parsing a XML tag in a page revision. $reader:XMLReader object $pageInfo:Array of page information $revisionInfo:Array of revision information Return false to stop further processing of the tag 'ImportHandleToplevelXMLTag':When parsing a top level XML tag. $reader:XMLReader object Return false to stop further processing of the tag 'ImportHandleUploadXMLTag':When parsing a XML tag in a file upload. $reader:XMLReader object $revisionInfo:Array of information Return false to stop further processing of the tag 'InfoAction':When building information to display on the action=info page. $context:IContextSource object & $pageInfo:Array of information 'InitializeArticleMaybeRedirect':MediaWiki check to see if title is a redirect. $title:Title object for the current page $request:WebRequest $ignoreRedirect:boolean to skip redirect check $target:Title/string of redirect target $article:Article object 'InterwikiLoadPrefix':When resolving if a given prefix is an interwiki or not. Return true without providing an interwiki to continue interwiki search. $prefix:interwiki prefix we are looking for. & $iwData:output array describing the interwiki with keys iw_url, iw_local, iw_trans and optionally iw_api and iw_wikiid. 'InternalParseBeforeSanitize':during Parser 's internalParse method just before the parser removes unwanted/dangerous HTML tags and after nowiki/noinclude/includeonly/onlyinclude and other processings. Ideal for syntax-extensions after template/parser function execution which respect nowiki and HTML-comments. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InternalParseBeforeLinks':during Parser 's internalParse method before links but after nowiki/noinclude/includeonly/onlyinclude and other processings. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InvalidateEmailComplete':Called after a user 's email has been invalidated successfully. $user:user(object) whose email is being invalidated 'IRCLineURL':When constructing the URL to use in an IRC notification. Callee may modify $url and $query, URL will be constructed as $url . $query & $url:URL to index.php & $query:Query string $rc:RecentChange object that triggered url generation 'IsFileCacheable':Override the result of Article::isFileCacheable()(if true) $article:article(object) being checked 'IsTrustedProxy':Override the result of wfIsTrustedProxy() $ip:IP being check $result:Change this value to override the result of wfIsTrustedProxy() 'IsUploadAllowedFromUrl':Override the result of UploadFromUrl::isAllowedUrl() $url:URL used to upload from & $allowed:Boolean indicating if uploading is allowed for given URL 'isValidEmailAddr':Override the result of User::isValidEmailAddr(), for instance to return false if the domain name doesn 't match your organization. $addr:The e-mail address entered by the user & $result:Set this and return false to override the internal checks 'isValidPassword':Override the result of User::isValidPassword() $password:The password entered by the user & $result:Set this and return false to override the internal checks $user:User the password is being validated for 'Language::getMessagesFileName':$code:The language code or the language we 're looking for a messages file for & $file:The messages file path, you can override this to change the location. 'LanguageGetNamespaces':Provide custom ordering for namespaces or remove namespaces. Do not use this hook to add namespaces. Use CanonicalNamespaces for that. & $namespaces:Array of namespaces indexed by their numbers 'LanguageGetMagic':DEPRECATED, use $magicWords in a file listed in $wgExtensionMessagesFiles instead. Use this to define synonyms of magic words depending of the language $magicExtensions:associative array of magic words synonyms $lang:language code(string) 'LanguageGetSpecialPageAliases':DEPRECATED, use $specialPageAliases in a file listed in $wgExtensionMessagesFiles instead. Use to define aliases of special pages names depending of the language $specialPageAliases:associative array of magic words synonyms $lang:language code(string) 'LanguageGetTranslatedLanguageNames':Provide translated language names. & $names:array of language code=> language name $code language of the preferred translations 'LanguageLinks':Manipulate a page 's language links. This is called in various places to allow extensions to define the effective language links for a page. $title:The page 's Title. & $links:Associative array mapping language codes to prefixed links of the form "language:title". & $linkFlags:Associative array mapping prefixed links to arrays of flags. Currently unused, but planned to provide support for marking individual language links in the UI, e.g. for featured articles. 'LinkBegin':Used when generating internal and interwiki links in Linker::link(), before processing starts. Return false to skip default processing and return $ret. See documentation for Linker::link() for details on the expected meanings of parameters. $skin:the Skin object $target:the Title that the link is pointing to & $html:the contents that the< a > tag should have(raw HTML) $result
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
static makeUrlDetails( $name, $urlaction='')
these return an array with the 'href' and boolean 'exists'
getContext()
Get the RequestContext object.
getSiteNotice()
Get the site notice.
static getDebugHTML(IContextSource $context)
Returns the HTML to add to the page for the toolbar.
and how to run hooks for an and one after Each event has a preferably in CamelCase For ArticleDelete hook A clump of code and data that should be run when an event happens This can be either a function and a chunk of data
wfBCP47( $code)
Get the normalised IETF language tag See unit test for examples.
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
makeListItem( $key, $item, $options=array())
Generates a list item for a navigation, portlet, portal, sidebar...
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
msg()
Get a Message object with context set Parameters are the same as wfMessage()
buildContentNavigationUrls()
a structured array of links usually used for the tabs in a skin
getPoweredBy()
Gets the powered by MediaWiki icon.
static instance()
Singleton.
$stylename
Stylesheets set to use.
$template
For QuickTemplate, the name of the subclass which will actually fill the template.
& wfGetDB( $db, $groups=array(), $wiki=false)
Get a Database object.
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
lastModified()
Get the timestamp of the latest revision, formatted in user language.
static isEnabled()
Returns true if uploads are enabled.
wfProfileIn( $functionname)
Begin profiling of a function.
static checkTitle(&$title, $name)
make sure we have some title to operate on
makeLink( $key, $item, $options=array())
Makes a link, usually used by makeListItem to generate a link for an item in a list used in navigatio...
wfSuppressWarnings( $end=false)
Reference-counted warning suppression.
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values my talk my contributions etc & $personal_urls
static makeSpecialUrl( $name, $urlaction='', $proto=null)
Make a URL for a Special Page using the given query and protocol.
aboutLink()
Gets the link to the wiki's about page.
static makeSpecialUrlSubpage( $name, $subpage, $urlaction='')
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name.
static escapeClass( $class)
Given a value, escape it so that it can be used as a CSS class and return it.
canUseWikiPage()
Check whether a WikiPage object can be get with getWikiPage().
getRequest()
Get the WebRequest object.
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the content language as $wgContLang
setupSkinUserCss(OutputPage $out)
#-
getUser()
Get the User object.
set to $title object and return false for a match for latest after cache objects are set use the ContentHandler facility to handle CSS and JavaScript for highlighting & $link
getTitle()
Get the Title object.
wfMessageFallback()
This function accepts multiple message keys and returns a message instance for the first message whic...
getSkin()
Get the Skin object related to this object.
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 true
bottomScripts()
This gets called shortly before the "</body>" tag.
afterContentHook()
This runs a hook to allow extensions placing their stuff after content and article metadata (e....
getLanguage()
Get the Language object.
getHTML()
Fetch the output of a QuickTemplate and return it.
static tooltipAndAccesskeyAttribs( $name)
Returns the attributes for the tooltip and access key.
Special page to allow managing user group membership.
getPersonalToolsList()
Get the HTML for the p-personal list.
buildSidebar()
Build an array that represents the sidebar(s), the navigation bar among them.
msgWiki( $str)
An ugly, ugly hack.
privacyLink()
Gets the link to the wiki's privacy policy page.
buildNavUrls()
build array of common navigation links
wfRestoreWarnings()
Restore error level to previous value.
generateDebugHTML()
Generate debug data HTML for displaying at the bottom of the main content area.
tabAction( $title, $message, $selected, $query='', $checkEdit=false)
Builds an array with tab definition.
formatLanguageName( $name)
Format language name for use in sidebar interlanguage links list.
static element( $element, $attribs=array(), $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
buildContentActionUrls( $content_navigation)
an array of edit links by default used for the tabs
getOutput()
Get the OutputPage object.
getWikiPage()
Get the WikiPage object.
wfProfileOut( $functionname='missing')
Stop profiling of a function.
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 after processing after in associative array form externallinks including delete and has completed for all link tables default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "<
printTrail()
Output the basic end-page trail including bottomscripts, reporttime, and debug stuff.
wfRunHooks( $event, array $args=array(), $deprecatedVersion=null)
Call hook functions defined in $wgHooks.
isRevisionCurrent()
Whether the revision displayed is the latest revision of the page.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
when a variable name is used in a it is silently declared as a new masking the global
disclaimerLink()
Gets the link to the wiki's general disclaimers page.
static getRestrictionLevels( $index, User $user=null)
Determine which restriction levels it makes sense to use in a namespace, optionally filtered by a use...
setContext(IContextSource $context)
Set the IContextSource object.
This class should be covered by a general architecture document which does not exist as of January 20...
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
processing should stop and the error should be shown to the user * false
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
execute()
Main function, used by classes that subclass QuickTemplate to show the actual HTML output.
prepareQuickTemplate()
initialize various variables and generate the template
wfDebug( $text, $dest='all')
Sends a line to the debug log if enabled or, optionally, to a comment in output.
getRelevantTitle()
Return the "relevant" title.
presenting them properly to the user as errors is done by the caller $title
getPageClasses( $title)
TODO: document.
renderAfterPortlet( $name)
showIPinHeader()
Returns true if the IP should be shown in the header.
Allows to change the fields on the form that will be generated $name
getMsg( $name)
Get a Message object with its context set.
static isAllowed( $user)
Returns true if the user can use this upload module or else a string identifying the missing permissi...
__construct()
Constructor.
printSource()
Text with the permalink to the source page, usually shown on the footer of a printed page.
makeArticleUrlDetails( $name, $urlaction='')
static resolveAlias( $alias)
Given a special page name with a possible subpage, return an array where the first element is the spe...
makeSearchButton( $mode, $attrs=array())
static fetchLanguageName( $code, $inLanguage=null, $include='all')
makeTalkUrlDetails( $name, $urlaction='')
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
wfReportTime()
Returns a script tag that stores the amount of time it took MediaWiki to handle the request in millis...
Generic wrapper for template functions, with interface compatible with what we use of PHPTAL 0....
if(PHP_SAPI !='cli') $file
getLanguages()
Generates array of language links for the current page.
getNewtalks()
Gets new talk page messages for the current user and returns an appropriate alert message (or an empt...
getNameSpaceKey()
Generate strings used for xml 'id' names.
Represents a title within MediaWiki.
getToolbox()
Create an array of common toolbox items from the data in the quicktemplate stored by SkinTemplate.
$useHeadElement
Whether this skin use OutputPage::headElement() to generate the "<head>" tag.
isSpecialPage()
Returns true if this is a special page.
static titleAttrib( $name, $options=null)
Given the id of an interface element, constructs the appropriate title attribute from the system mess...
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
getCopyright( $type='detect')
outputPage(OutputPage $out=null)
initialize various variables and generate the template
setContext( $context)
Sets the context this SpecialPage is executed in.
getRelevantUser()
Return the "relevant" user.
static makeKnownUrlDetails( $name, $urlaction='')
Make URL details where the article exists (or at least it's convenient to think so)
static getWatchToken(Title $title, User $user, $action='watch')
Get token to watch (or unwatch) a page for a user.
Special handling for file pages.
getSidebar( $options=array())
The main skin class which provides methods and properties for all other skins.
static rawElement( $element, $attribs=array(), $contents='')
Returns an HTML element in a string.
return true to allow those checks to and false if checking is done use this to change the tables headers temp or archived zone change it to an object instance and return false override the list derivative used the name of the old file when set the default code will be skipped add a value to it if you want to add a cookie that have to vary cache options can modify $query
static getSubject( $index)
Get the subject namespace index for a given namespace Special namespaces (NS_MEDIA,...
getFooterIcons( $option=null)
Returns an array of footer icons filtered down by options relevant to how the skin wishes to display ...
initPage(OutputPage $out)
getRevisionId()
Get the current revision ID.
New base template for a skin's template extended from QuickTemplate this class features helper method...
Template-filler skin base class Formerly generic PHPTal (http://phptal.sourceforge....
static factory( $action, Page $page, IContextSource $context=null)
Get an appropriate Action subclass for the given action.
namespace and then decline to actually register it RecentChangesLinked and Watchlist $special
printOrError( $str)
Output the string, or print error message if it's an error object of the appropriate type.
setupTemplate( $classname, $repository=false, $cache_dir=false)
Create the template engine object; we feed it a bunch of data and eventually it spits out some HTML.
wfArrayToCgi( $array1, $array2=null, $prefix='')
This function takes two arrays as input, and returns a CGI-style string, e.g.
buildPersonalUrls()
build array of urls for personal toolbar