4 # These are the INTERNAL names, which get mapped
5 # directly to class names. For display purposes, the
6 # Language class has internationalized names
8 /* private */ $wgValidSkinNames = array(
9 "Standard", "Nostalgia", "CologneBlue"
12 # For some odd PHP bug, this function can't be part of a class
13 function getCategories ()
15 global $wgOut , $wgTitle , $wgUseCategoryMagic , $wgUser ;
16 if ( !isset ( $wgUseCategoryMagic ) ||
!$wgUseCategoryMagic ) return "" ;
17 if ( count ( $wgOut->mCategoryLinks
) == 0 ) return "" ;
18 if ( !$wgOut->isArticle() ) return "" ;
19 $sk = $wgUser->getSkin() ;
22 $s .= $sk->makeKnownLink ( "Special:Categories" , "Categories" , "article=".$wgTitle->getDBkey() ) ;
23 $t = implode ( " | " , $wgOut->mCategoryLinks
) ;
24 if ( $t != "" ) $s .= " : " ;
30 class RecentChangesClass
{
31 var $secureName , $displayName , $link , $namespace ;
32 var $oldid , $diffid , $timestamp , $curlink , $lastlink , $usertalklink , $versionlink ;
33 var $usercomment , $userlink ;
34 var $isminor , $isnew , $watched , $islog ;
39 /* private */ var $lastdate, $lastline;
41 var $rc_cache ; # Cache for Enhanced Recent Changes
42 var $rccc ; # Recent Changes Cache Counter for visibility toggle
49 function getSkinNames()
51 global $wgValidSkinNames;
52 return $wgValidSkinNames;
55 function getStylesheet()
57 return "wikistandard.css";
62 global $wgOut, $wgUser;
64 if ( $wgOut->isQuickbarSupressed() ) { return 0; }
65 $q = $wgUser->getOption( "quickbar" );
66 if ( "" == $q ) { $q = 0; }
72 global $wgOut, $wgStyleSheetPath;
73 wfProfileIn( "Skin::initPage" );
75 $wgOut->addLink( "shortcut icon", "", "/favicon.ico" );
76 if ( $wgOut->isPrintable() ) { $ss = "wikiprintable.css"; }
77 else { $ss = $this->getStylesheet(); }
78 $wgOut->addLink( "stylesheet", "", "{$wgStyleSheetPath}/{$ss}" );
82 function getHeadScripts() {
83 global $wgStyleSheetPath;
84 $r = "<script type=\"text/javascript\" src=\"{$wgStyleSheetPath}/wikibits.js\"></script>\n";
88 function getUserStyles()
90 $s = "<style type='text/css'><!--\n";
91 $s .= $this->doGetUserStyles();
92 $s .= "//--></style>\n";
96 function doGetUserStyles()
101 if ( 1 == $wgUser->getOption( "underline" ) ) {
102 # Don't override browser settings
105 $s .= "a.stub, a.new, a.internal, a.external { " .
106 "text-decoration: none; }\n";
108 if ( 1 == $wgUser->getOption( "highlightbroken" ) ) {
109 $s .= "a.new, #quickbar a.new { color: #CC2200; }\n";
111 if ( 1 == $wgUser->getOption( "justify" ) ) {
112 $s .= "#article { text-align: justify; }\n";
117 function getBodyOptions()
119 global $wgUser, $wgTitle, $wgNamespaceBackgrounds, $wgOut, $oldid, $redirect, $diff,$action;
121 if ( 0 != $wgTitle->getNamespace() ) {
122 $a = array( "bgcolor" => "#ffffec" );
124 else $a = array( "bgcolor" => "#FFFFFF" );
125 if($wgOut->isArticle() && $wgUser->getOption("editondblclick")
127 (!$wgTitle->isProtected() ||
$wgUser->isSysop())
130 $n = $wgTitle->getPrefixedURL();
131 $t = wfMsg( "editthispage" );
133 if ( $redirect ) { $red = "&redirect={$redirect}"; }
134 if ( $oldid && ! isset( $diff ) ) {
135 $oid = "&oldid={$oldid}";
137 $s = wfLocalUrlE($n,"action=edit{$oid}{$red}");
138 $s = "document.location = \"" .$s ."\";";
139 $a +
= array ("ondblclick" => $s);
142 if($action=="edit") { # set focus in edit box
143 $foc = "document.editform.wpTextbox1.focus()";
145 $a['onload'] .= ";$foc";
153 function getExternalLinkAttributes( $link, $text )
155 global $wgUser, $wgOut, $wgLang;
157 $link = urldecode( $link );
158 $link = $wgLang->checkTitleEncoding( $link );
159 $link = str_replace( "_", " ", $link );
160 $link = wfEscapeHTML( $link );
162 if ( $wgOut->isPrintable() ) { $r = " class='printable'"; }
163 else { $r = " class='external'"; }
165 if ( 1 == $wgUser->getOption( "hover" ) ) {
166 $r .= " title=\"{$link}\"";
171 function getInternalLinkAttributes( $link, $text, $broken = false )
173 global $wgUser, $wgOut;
175 $link = urldecode( $link );
176 $link = str_replace( "_", " ", $link );
177 $link = wfEscapeHTML( $link );
179 if ( $wgOut->isPrintable() ) { $r = " class='printable'"; }
180 else if ( $broken == "stub" ) { $r = " class='stub'"; }
181 else if ( $broken == "yes" ) { $r = " class='new'"; }
182 else { $r = " class='internal'"; }
184 if ( 1 == $wgUser->getOption( "hover" ) ) {
185 $r .= " title=\"{$link}\"";
196 # This will be called immediately after the <body> tag. Split into
197 # two functions to make it easier to subclass.
199 function beforeContent()
201 global $wgUser, $wgOut;
203 if ( $wgOut->isPrintable() ) {
204 $s = $this->pageTitle() . $this->pageSubtitle() . "\n";
205 $s .= "\n<div class='bodytext'>";
208 return $this->doBeforeContent();
211 function doBeforeContent()
213 global $wgUser, $wgOut, $wgTitle, $wgLang;
214 wfProfileIn( "Skin::doBeforeContent" );
217 $qb = $this->qbSetting();
219 if( $langlinks = $this->otherLanguages() ) {
225 $borderhack = "class='top'";
228 $s .= "\n<div id='content'>\n<div id='topbar'>" .
229 "<table width='98%' border=0 cellspacing=0><tr>";
232 $left = ($qb == 1 ||
$qb == 3);
233 if($wgLang->isRTL()) $left = !$left;
236 $s .= "<td class='top' align=left valign=top rowspan='{$rows}'>" .
237 $this->logoText() . "</td>";
239 $s .= $this->getQuickbarCompensator( $rows );
241 $l = $wgLang->isRTL() ?
"right" : "left";
242 $s .= "<td {$borderhack} align='$l' valign='top'>";
244 $s .= $this->topLinks() ;
245 $s .= "<p class='subtitle'>" . $this->pageTitleLinks();
247 $r = $wgLang->isRTL() ?
"left" : "right";
248 $s .= "</td>\n<td {$borderhack} valign='top' align='$r' nowrap>";
249 $s .= $this->nameAndLogin();
250 $s .= "\n<br>" . $this->searchForm() . "</td>";
253 $s .= "</tr>\n<tr><td class='top' colspan=\"2\">$langlinks</td>";
256 if ( $shove && !$left ) { # Right
257 $s .= $this->getQuickbarCompensator( $rows );
259 $s .= "</tr></table>\n</div>\n";
260 $s .= "\n<div id='article'>";
262 $s .= $this->pageTitle();
263 $s .= $this->pageSubtitle() ;
264 $s .= getCategories(); // For some odd reason, zhis can't be a function of the object
270 function getQuickbarCompensator( $rows = 1 )
272 return "<td width='152' rowspan='{$rows}'> </td>";
275 # This gets called immediately before the </body> tag.
277 function afterContent()
279 global $wgUser, $wgOut, $wgServer, $HTTP_SERVER_VARS;
281 if ( $wgOut->isPrintable() ) {
284 $u = $wgServer . $HTTP_SERVER_VARS['REQUEST_URI'];
285 $u = preg_replace( "/[?&]printable=yes/", "", $u );
286 $rf = str_replace( "$1", $u, wfMsg( "retrievedfrom" ) );
288 if ( $wgOut->isArticle() ) {
289 $lm = "<br>" . $this->lastModified();
292 $s .= "<p><em>{$rf}{$lm}</em>\n";
295 return $this->doAfterContent();
298 function doAfterContent()
300 global $wgUser, $wgOut, $wgLang;
301 wfProfileIn( "Skin::doAfterContent" );
303 $s = "\n</div><br clear=all>\n";
305 $s .= "\n<div id='footer'>";
306 $s .= "<table width='98%' border=0 cellspacing=0><tr>";
308 $qb = $this->qbSetting();
310 $left = ($qb == 1 ||
$qb == 3);
311 if($wgLang->isRTL()) $left = !$left;
313 if ( $shove && $left ) { # Left
314 $s .= $this->getQuickbarCompensator();
316 $l = $wgLang->isRTL() ?
"right" : "left";
317 $s .= "<td class='bottom' align='$l' valign='top'>";
319 $s .= $this->bottomLinks();
320 $s .= "\n<br>" . $this->mainPageLink()
321 . " | " . $this->aboutLink()
322 . " | " . $this->specialLink( "recentchanges" )
323 . " | " . $this->searchForm()
324 . "<br>" . $this->pageStats();
327 if ( $shove && !$left ) { # Right
328 $s .= $this->getQuickbarCompensator();
330 $s .= "</tr></table>\n</div>\n</div>\n";
332 if ( 0 != $qb ) { $s .= $this->quickBar(); }
337 function pageTitleLinks()
339 global $wgOut, $wgTitle, $oldid, $action, $diff, $wgUser, $wgLang;
341 $s = $this->printableLink();
343 if ( $wgOut->isArticle() ) {
344 if ( $wgTitle->getNamespace() == Namespace::getImage() ) {
345 $name = $wgTitle->getDBkey();
346 $link = wfEscapeHTML( wfImageUrl( $name ) );
347 $style = $this->getInternalLinkAttributes( $link, $name );
348 $s .= " | <a href=\"{$link}\"{$style}>{$name}</a>";
351 if ( "history" == $action ||
isset( $diff ) ||
isset( $oldid ) ) {
352 $s .= " | " . $this->makeKnownLink( $wgTitle->getPrefixedText(),
353 wfMsg( "currentrev" ) );
356 if ( $wgUser->getNewtalk() ) {
357 # do not show "You have new messages" text when we are viewing our
360 if(!(strcmp($wgTitle->getText(),$wgUser->getName()) == 0 &&
361 $wgTitle->getNamespace()==Namespace::getTalk(Namespace::getUser()))) {
362 $n =$wgUser->getName();
363 $tl = $this->makeKnownLink( $wgLang->getNsText(
364 Namespace::getTalk( Namespace::getUser() ) ) . ":{$n}",
365 wfMsg("newmessageslink") );
366 $s.=" | <strong>". str_replace( "$1", $tl, wfMsg("newmessages") ) . "</strong>";
372 function printableLink()
374 global $wgOut, $wgTitle, $oldid, $action;
376 if ( "history" == $action ) { $q = "action=history&"; }
379 $s = $this->makeKnownLink( $wgTitle->getPrefixedText(),
380 WfMsg( "printableversion" ), "{$q}printable=yes" );
386 global $wgOut, $wgTitle, $wgUser;
388 $s = "<h1 class='pagetitle'>" . $wgOut->getPageTitle() . "</h1>";
389 if($wgUser->getOption("editsectiononrightclick") && $wgTitle->userCanEdit()) { $s=$this->editSectionScript(0,$s);}
393 function pageSubtitle()
395 global $wgOut,$wgTitle,$wgNamespacesWithSubpages;
397 $sub = $wgOut->getSubtitle();
398 if ( "" == $sub ) { $sub = wfMsg( "fromwikipedia" ); }
399 if($wgOut->isArticle() && $wgNamespacesWithSubpages[$wgTitle->getNamespace()]) {
400 $ptext=$wgTitle->getPrefixedText();
401 if(preg_match("/\//",$ptext)) {
402 $sub.="</p><p class='subpages'>";
403 $links=explode("/",$ptext);
406 foreach($links as $link) {
408 if ($c<count($links)) {
410 $getlink=$this->makeLink($growinglink,$link);
411 if(preg_match("/class='new'/i",$getlink)) { break; } # this is a hack, but it saves time
424 $s = "<p class='subtitle'>{$sub}\n";
428 function nameAndLogin()
430 global $wgUser, $wgTitle, $wgLang, $wgShowIPinHeader;
432 $li = $wgLang->specialPage( "Userlogin" );
433 $lo = $wgLang->specialPage( "Userlogout" );
436 if ( 0 == $wgUser->getID() ) {
437 if( $wgShowIPinHeader ) {
438 $n = getenv( "REMOTE_ADDR" );
440 $tl = $this->makeKnownLink( $wgLang->getNsText(
441 Namespace::getTalk( Namespace::getUser() ) ) . ":{$n}",
442 $wgLang->getNsText( Namespace::getTalk( 0 ) ) );
444 $s .= $n . " (".$tl.")";
446 $s .= wfMsg("notloggedin");
449 $rt = $wgTitle->getPrefixedURL();
450 if ( 0 == strcasecmp( urlencode( $lo ), $rt ) ) {
452 } else { $q = "returnto={$rt}"; }
454 $s .= "\n<br>" . $this->makeKnownLink( $li,
455 wfMsg( "login" ), $q );
457 $n = $wgUser->getName();
458 $rt = $wgTitle->getPrefixedURL();
459 $tl = $this->makeKnownLink( $wgLang->getNsText(
460 Namespace::getTalk( Namespace::getUser() ) ) . ":{$n}",
461 $wgLang->getNsText( Namespace::getTalk( 0 ) ) );
465 $s .= $this->makeKnownLink( $wgLang->getNsText(
466 Namespace::getUser() ) . ":{$n}", $n ) . "{$tl}<br>" .
467 $this->makeKnownLink( $lo, wfMsg( "logout" ),
468 "returnto={$rt}" ) . " | " .
469 $this->specialLink( "preferences" );
471 $s .= " | " . $this->makeKnownLink( wfMsg( "helppage" ),
477 function searchForm()
481 $s = "<form name='search' class='inline' method=get action=\""
482 . wfLocalUrl( "" ) . "\">"
483 . "<input type=text name=\"search\" size=19 value=\""
484 . htmlspecialchars(substr($search,0,256)) . "\">\n"
485 . "<input type=submit name=\"go\" value=\"" . wfMsg ("go") . "\"> "
486 . "<input type=submit value=\"" . wfMsg ("search") . "\"></form>";
496 $s = $this->mainPageLink() . $sep
497 . $this->specialLink( "recentchanges" );
499 if ( $wgOut->isArticle() ) {
500 $s .= $sep . $this->editThisPage()
501 . $sep . $this->historyLink();
503 # Many people don't like this dropdown box
504 #$s .= $sep . $this->specialPagesList();
509 function bottomLinks()
511 global $wgOut, $wgUser, $wgTitle;
515 if ( $wgOut->isArticle() ) {
516 $s .= "<strong>" . $this->editThisPage() . "</strong>";
517 if ( 0 != $wgUser->getID() ) {
518 $s .= $sep . $this->watchThisPage();
520 $s .= $sep . $this->talkLink()
521 . $sep . $this->historyLink()
522 . $sep . $this->whatLinksHere()
523 . $sep . $this->watchPageLinksLink();
525 if ( $wgTitle->getNamespace() == Namespace::getUser()
526 ||
$wgTitle->getNamespace() == Namespace::getTalk(Namespace::getUser()) )
529 $id=User
::idFromName($wgTitle->getText());
530 $ip=User
::isIP($wgTitle->getText());
532 if($id ||
$ip) { # both anons and non-anons have contri list
533 $s .= $sep . $this->userContribsLink();
535 if ( 0 != $wgUser->getID() ) { # show only to signed in users
536 if($id) { # can only email non-anons
537 $s .= $sep . $this->emailUserLink();
541 if ( $wgUser->isSysop() && $wgTitle->getArticleId() ) {
542 $s .= "\n<br>" . $this->deleteThisPage() .
543 $sep . $this->protectThisPage() .
544 $sep . $this->moveThisPage();
546 $s .= "<br>\n" . $this->otherLanguages();
553 global $wgOut, $wgLang, $wgArticle;
554 global $oldid, $diff, $wgDisableCounters;
556 if ( ! $wgOut->isArticle() ) { return ""; }
557 if ( isset( $oldid ) ||
isset( $diff ) ) { return ""; }
558 if ( 0 == $wgArticle->getID() ) { return ""; }
560 if ( $wgDisableCounters ) {
563 $count = $wgArticle->getCount();
564 $s = str_replace( "$1", $count, wfMsg( "viewcount" ) );
566 $s .= $this->lastModified();
567 $s .= " " . wfMsg( "gnunote" );
568 return "<span id='pagestats'>{$s}</span>";
571 function lastModified()
573 global $wgLang, $wgArticle;
575 $d = $wgLang->timeanddate( $wgArticle->getTimestamp(), true );
576 $s = " " . str_replace( "$1", $d, wfMsg( "lastmodified" ) );
580 function logoText( $align = "" )
582 if ( "" != $align ) { $a = " align='{$align}'"; }
585 $mp = wfMsg( "mainpage" );
586 $s = "<a href=\"" . wfLocalUrlE( $mp ) . "\"><img{$a} border=0 src=\""
587 . $this->getLogo() . "\" alt=\"" . "[{$mp}]\"></a>";
593 global $wgOut, $wgTitle, $wgUser, $action, $wgLang;
595 wfProfileIn( "Skin::quickBar" );
596 $tns=$wgTitle->getNamespace();
598 $s = "\n<div id='quickbar'>";
599 $s .= "\n" . $this->logoText() . "\n<hr class='sep'>";
602 $s .= $this->mainPageLink()
603 . $sep . $this->specialLink( "recentchanges" )
604 . $sep . $this->specialLink( "randompage" );
605 if ($wgUser->getID()) {
606 $s.= $sep . $this->specialLink( "watchlist" ) ;
607 $s .= $sep .$this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
608 wfMsg( "mycontris" ), "target=" . wfUrlencode($wgUser->getName() ) );
611 // only show watchlist link if logged in
612 if ( wfMsg ( "currentevents" ) != "-" ) $s .= $sep . $this->makeKnownLink( wfMsg( "currentevents" ), "" ) ;
613 $s .= "\n<br><hr class='sep'>";
614 $articleExists = $wgTitle->getArticleId();
615 if ( $wgOut->isArticle() ||
$action =="edit" ||
$action =="history" ||
$wpPreview) {
617 if($wgOut->isArticle()) {
618 $s .= "<strong>" . $this->editThisPage() . "</strong>";
619 } else { # backlink to the article in edit or history mode
620 if($articleExists){ # no backlink if no article
623 $text = wfMsg("articlepage");
626 $text = wfMsg("viewtalkpage");
629 $text = wfMsg("userpage");
632 $text = wfMsg("viewtalkpage");
635 $text = wfMsg("wikipediapage");
638 $text = wfMsg("viewtalkpage");
641 $text = wfMsg("imagepage");
644 $text = wfMsg("viewtalkpage");
647 $text= wfMsg("articlepage");
650 $link = $wgTitle->getText();
651 if ($nstext = $wgLang->getNsText($tns) ) { # add namespace if necessary
652 $link = $nstext . ":" . $link ;
654 $s .= $this->makeLink($link, $text );
655 } elseif( $wgTitle->getNamespace() != Namespace::getSpecial() ) {
656 # we just throw in a "New page" text to tell the user that he's in edit mode,
657 # and to avoid messing with the separator that is prepended to the next item
658 $s .= "<strong>" . wfMsg("newpage") . "</strong>";
664 if( $tns%2
&& $action!="edit" && !$wpPreview) {
665 $s.="<br>".$this->makeKnownLink($wgTitle->getPrefixedText(),wfMsg("postcomment"),"action=edit§ion=new");
669 watching could cause problems in edit mode:
670 if user edits article, then loads "watch this article" in background and then saves
671 article with "Watch this article" checkbox disabled, the article is transparently
672 unwatched. Therefore we do not show the "Watch this page" link in edit mode
674 if ( 0 != $wgUser->getID() && $articleExists) {
675 if($action!="edit" && $action!="history" &&
676 $action != "submit" )
677 {$s .= $sep . $this->watchThisPage(); }
678 if ( $wgTitle->userCanEdit() ) $s .= $sep . $this->moveThisPage();
680 if ( $wgUser->isSysop() and $articleExists ) {
681 $s .= $sep . $this->deleteThisPage() .
682 $sep . $this->protectThisPage();
684 $s .= $sep . $this->talkLink();
685 if ($articleExists && $action !="history") { $s .= $sep . $this->historyLink();}
686 $s.=$sep . $this->whatLinksHere();
688 if($wgOut->isArticle()) {
689 $s .= $sep . $this->watchPageLinksLink();
692 if ( Namespace::getUser() == $wgTitle->getNamespace()
693 ||
$wgTitle->getNamespace() == Namespace::getTalk(Namespace::getUser())
696 $id=User
::idFromName($wgTitle->getText());
697 $ip=User
::isIP($wgTitle->getText());
700 $s .= $sep . $this->userContribsLink();
702 if ( 0 != $wgUser->getID() ) {
703 if($id) { # can only email real users
704 $s .= $sep . $this->emailUserLink();
708 $s .= "\n<br><hr class='sep'>";
711 if ( 0 != $wgUser->getID() ) {
712 $s .= $this->specialLink( "upload" ) . $sep;
714 $s .= $this->specialLink( "specialpages" )
715 . $sep . $this->bugReportsLink();
717 $s .= "\n<br></div>\n";
722 function specialPagesList()
724 global $wgUser, $wgOut, $wgLang, $wgServer, $wgRedirectScript;
727 $validSP = $wgLang->getValidSpecialPages();
729 foreach ( $validSP as $name => $desc ) {
730 if ( "" == $desc ) { continue; }
733 if ( $wgUser->isSysop() )
735 $sysopSP = $wgLang->getSysopSpecialPages();
737 foreach ( $sysopSP as $name => $desc ) {
738 if ( "" == $desc ) { continue; }
742 if ( $wgUser->isDeveloper() )
744 $devSP = $wgLang->getDeveloperSpecialPages();
746 foreach ( $devSP as $name => $desc ) {
747 if ( "" == $desc ) { continue; }
752 $sp = wfMsg( "specialpages" );
753 $spp = $wgLang->specialPage( "Specialpages" );
755 $s = "<form id=\"specialpages\" method=\"get\" class=\"inline\" " .
756 "action=\"{$wgServer}{$wgRedirectScript}\">\n";
757 $s .= "<select name=\"wpDropdown\">\n";
758 $s .= "<option value=\"{$spp}\">{$sp}</option>\n";
760 foreach ( $a as $name => $desc ) {
761 $p = $wgLang->specialPage( $name );
762 $s .= "<option value=\"{$p}\">{$desc}</option>\n";
765 $s .= "<input type=submit value=\"{$go}\" name=redirect>\n";
770 function mainPageLink()
772 $mp = wfMsg( "mainpage" );
773 $s = $this->makeKnownLink( $mp, $mp );
777 function copyrightLink()
779 $s = $this->makeKnownLink( wfMsg( "copyrightpage" ),
780 wfMsg( "copyrightpagename" ) );
786 $s = $this->makeKnownLink( wfMsg( "aboutpage" ),
787 wfMsg( "aboutwikipedia" ) );
791 function editThisPage()
793 global $wgOut, $wgTitle, $oldid, $redirect, $diff;
795 if ( ! $wgOut->isArticle() ||
$diff ) {
796 $s = wfMsg( "protectedpage" );
797 } else if ( $wgTitle->userCanEdit() ) {
798 $n = $wgTitle->getPrefixedText();
799 $t = wfMsg( "editthispage" );
802 if ( $redirect ) { $red = "&redirect={$redirect}"; }
803 if ( $oldid && ! isset( $diff ) ) {
804 $oid = "&oldid={$oldid}";
806 $s = $this->makeKnownLink( $n, $t, "action=edit{$oid}{$red}" );
808 $s = wfMsg( "protectedpage" );
813 function deleteThisPage()
815 global $wgUser, $wgOut, $wgTitle, $diff;
817 if ( $wgTitle->getArticleId() && ( ! $diff ) && $wgUser->isSysop() ) {
818 $n = $wgTitle->getPrefixedText();
819 $t = wfMsg( "deletethispage" );
821 $s = $this->makeKnownLink( $n, $t, "action=delete" );
823 $s = wfMsg( "error" );
828 function protectThisPage()
830 global $wgUser, $wgOut, $wgTitle, $diff;
832 if ( $wgTitle->getArticleId() && ( ! $diff ) && $wgUser->isSysop() ) {
833 $n = $wgTitle->getPrefixedText();
835 if ( $wgTitle->isProtected() ) {
836 $t = wfMsg( "unprotectthispage" );
837 $q = "action=unprotect";
839 $t = wfMsg( "protectthispage" );
840 $q = "action=protect";
842 $s = $this->makeKnownLink( $n, $t, $q );
844 $s = wfMsg( "error" );
849 function watchThisPage()
851 global $wgUser, $wgOut, $wgTitle, $diff;
853 if ( $wgOut->isArticle() && ( ! $diff ) ) {
854 $n = $wgTitle->getPrefixedText();
856 if ( $wgTitle->userIsWatching() ) {
857 $t = wfMsg( "unwatchthispage" );
858 $q = "action=unwatch";
860 $t = wfMsg( "watchthispage" );
863 $s = $this->makeKnownLink( $n, $t, $q );
865 $s = wfMsg( "notanarticle" );
870 function moveThisPage()
872 global $wgTitle, $wgLang;
874 if ( $wgTitle->userCanEdit() ) {
875 $s = $this->makeKnownLink( $wgLang->specialPage( "Movepage" ),
876 wfMsg( "movethispage" ), "target=" . $wgTitle->getPrefixedURL() );
877 } // no message if page is protected - would be redundant
881 function historyLink()
885 $s = $this->makeKnownLink( $wgTitle->getPrefixedText(),
886 wfMsg( "history" ), "action=history" );
890 function whatLinksHere()
892 global $wgTitle, $wgLang;
894 $s = $this->makeKnownLink( $wgLang->specialPage( "Whatlinkshere" ),
895 wfMsg( "whatlinkshere" ), "target=" . $wgTitle->getPrefixedURL() );
899 function userContribsLink()
901 global $wgTitle, $wgLang;
903 $s = $this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
904 wfMsg( "contributions" ), "target=" . $wgTitle->getURL() );
908 function emailUserLink()
910 global $wgTitle, $wgLang;
912 $s = $this->makeKnownLink( $wgLang->specialPage( "Emailuser" ),
913 wfMsg( "emailuser" ), "target=" . $wgTitle->getURL() );
917 function watchPageLinksLink()
919 global $wgOut, $wgTitle, $wgLang;
921 if ( ! $wgOut->isArticle() ) {
922 $s = "(" . wfMsg( "notanarticle" ) . ")";
924 $s = $this->makeKnownLink( $wgLang->specialPage(
925 "Recentchangeslinked" ), wfMsg( "recentchangeslinked" ),
926 "target=" . $wgTitle->getPrefixedURL() );
931 function otherLanguages()
933 global $wgOut, $wgLang, $wgTitle , $wgUseNewInterlanguage ;
935 $a = $wgOut->getLanguageLinks();
936 if ( 0 == count( $a ) ) {
937 if ( !$wgUseNewInterlanguage ) return "";
938 $ns = $wgLang->getNsIndex ( $wgTitle->getNamespace () ) ;
939 if ( $ns != 0 AND $ns != 1 ) return "" ;
941 $x = "mode=addlink&xt=".$wgTitle->getDBkey() ;
942 return $this->makeKnownLink( $wgLang->specialPage( $pn ),
943 wfMsg( "intl" ) , $x );
946 if ( !$wgUseNewInterlanguage ) {
947 $s = wfMsg( "otherlanguages" ) . ": ";
949 global $wgLanguageCode ;
950 $x = "mode=zoom&xt=".$wgTitle->getDBkey() ;
951 $x .= "&xl=".$wgLanguageCode ;
952 $s = $this->makeKnownLink( $wgLang->specialPage( "Intl" ),
953 wfMsg( "otherlanguages" ) , $x ) . ": " ;
957 if($wgLang->isRTL()) $s .= "<span dir='LTR'>";
958 foreach( $a as $l ) {
959 if ( ! $first ) { $s .= " | "; }
962 $nt = Title
::newFromText( $l );
963 $url = $nt->getFullURL();
964 $text = $wgLang->getLanguageName( $nt->getInterwiki() );
966 if ( "" == $text ) { $text = $l; }
967 $style = $this->getExternalLinkAttributes( $l, $text );
968 $s .= "<a href=\"{$url}\"{$style}>{$text}</a>";
970 if($wgLang->isRTL()) $s .= "</span>";
974 function bugReportsLink()
976 $s = $this->makeKnownLink( wfMsg( "bugreportspage" ),
977 wfMsg( "bugreports" ) );
984 $t1 = Title
::newFromText( gmdate( "F j" ) );
985 $t2 = Title
::newFromText( gmdate( "Y" ) );
987 $wgLinkCache->suspend();
988 $id = $t1->getArticleID();
989 $wgLinkCache->resume();
992 $s = $this->makeBrokenLink( $t1->getText() );
994 $s = $this->makeKnownLink( $t1->getText() );
998 $wgLinkCache->suspend();
999 $id = $t2->getArticleID();
1000 $wgLinkCache->resume();
1003 $s .= $this->makeBrokenLink( $t2->getText() );
1005 $s .= $this->makeKnownLink( $t2->getText() );
1012 global $wgLang, $wgTitle, $wgLinkCache;
1014 $tns = $wgTitle->getNamespace();
1015 if ( -1 == $tns ) { return ""; }
1017 $pn = $wgTitle->getText();
1018 $tp = wfMsg( "talkpage" );
1019 if ( Namespace::isTalk( $tns ) ) {
1020 $lns = Namespace::getSubject( $tns );
1023 $text = wfMsg("articlepage");
1026 $text = wfMsg("userpage");
1029 $text = wfMsg("wikipediapage");
1032 $text = wfMsg("imagepage");
1035 $text= wfMsg("articlepage");
1039 $lns = Namespace::getTalk( $tns );
1042 $n = $wgLang->getNsText( $lns );
1043 if ( "" == $n ) { $link = $pn; }
1044 else { $link = "{$n}:{$pn}"; }
1046 $wgLinkCache->suspend();
1047 $s = $this->makeLink( $link, $text );
1048 $wgLinkCache->resume();
1053 # After all the page content is transformed into HTML, it makes
1054 # a final pass through here for things like table backgrounds.
1056 function transformContent( $text )
1061 # Note: This function MUST call getArticleID() on the link,
1062 # otherwise the cache won't get updated properly. See LINKCACHE.DOC.
1064 function makeLink( $title, $text= "", $query = "", $trail = "" )
1066 global $wgOut, $wgUser;
1068 $nt = Title
::newFromText( $title );
1070 if ( $nt->isExternal() ) {
1071 $u = $nt->getFullURL();
1072 if ( "" == $text ) { $text = $nt->getPrefixedText(); }
1073 $style = $this->getExternalLinkAttributes( $link, $text );
1076 if ( "" != $trail ) {
1077 if ( preg_match( "/^([a-z]+)(.*)$$/sD", $trail, $m ) ) {
1082 return "<a href=\"{$u}\"{$style}>{$text}{$inside}</a>{$trail}";
1084 if ( 0 == $nt->getNamespace() && "" == $nt->getText() ) {
1085 return $this->makeKnownLink( $title, $text, $query, $trail );
1087 if ( ( -1 == $nt->getNamespace() ) ||
1088 ( Namespace::getImage() == $nt->getNamespace() ) ) {
1089 return $this->makeKnownLink( $title, $text, $query, $trail );
1091 $aid = $nt->getArticleID() ;
1093 return $this->makeBrokenLink( $title, $text, $query, $trail );
1095 $threshold = $wgUser->getOption("stubthreshold") ;
1096 if ( $threshold > 0 ) {
1097 $res = wfQuery ( "SELECT HIGH_PRIORITY length(cur_text) AS x, cur_namespace, cur_is_redirect FROM cur WHERE cur_id='{$aid}'" ) ;
1099 if ( wfNumRows( $res ) > 0 ) {
1100 $s = wfFetchObject( $res );
1102 if ( $s->cur_is_redirect
OR $s->cur_namespace
!= 0 )
1103 $size = $threshold*2 ; # Really big
1104 wfFreeResult( $res );
1105 } else $size = $threshold*2 ; # Really big
1108 if ( $size < $threshold )
1109 return $this->makeStubLink( $title, $text, $query, $trail );
1110 return $this->makeKnownLink( $title, $text, $query, $trail );
1114 function makeKnownLink( $title, $text = "", $query = "", $trail = "" )
1116 global $wgOut, $wgTitle;
1118 $nt = Title
::newFromText( $title );
1119 $link = $nt->getPrefixedURL();
1121 if ( "" == $link ) {
1123 if ( "" == $text ) { $text = $nt->getFragment(); }
1125 $u = wfLocalUrlE( $link, $query );
1127 if ( "" != $nt->getFragment() ) {
1128 $u .= "#" . wfEscapeHTML( $nt->getFragment() );
1130 if ( "" == $text ) { $text = $nt->getPrefixedText(); }
1131 $style = $this->getInternalLinkAttributes( $link, $text );
1134 if ( "" != $trail ) {
1135 if ( preg_match( wfMsg("linktrail"), $trail, $m ) ) {
1140 $r = "<a href=\"{$u}\"{$style}>{$text}{$inside}</a>{$trail}";
1144 function makeBrokenLink( $title, $text = "", $query = "", $trail = "" )
1146 global $wgOut, $wgUser;
1148 $nt = Title
::newFromText( $title );
1149 $link = $nt->getPrefixedURL();
1151 if ( "" == $query ) { $q = "action=edit"; }
1152 else { $q = "action=edit&{$query}"; }
1153 $u = wfLocalUrlE( $link, $q );
1155 if ( "" == $text ) { $text = $nt->getPrefixedText(); }
1156 $style = $this->getInternalLinkAttributes( $link, $text, "yes" );
1159 if ( "" != $trail ) {
1160 if ( preg_match( wfMsg("linktrail"), $trail, $m ) ) {
1165 if ( $wgOut->isPrintable() ||
1166 ( 1 == $wgUser->getOption( "highlightbroken" ) ) ) {
1167 $s = "<a href=\"{$u}\"{$style}>{$text}{$inside}</a>{$trail}";
1169 $s = "{$text}{$inside}<a href=\"{$u}\"{$style}>?</a>{$trail}";
1174 function makeStubLink( $title, $text = "", $query = "", $trail = "" )
1176 global $wgOut, $wgUser;
1178 $nt = Title
::newFromText( $title );
1179 $link = $nt->getPrefixedURL();
1181 $u = wfLocalUrlE( $link, $query );
1183 if ( "" == $text ) { $text = $nt->getPrefixedText(); }
1184 $style = $this->getInternalLinkAttributes( $link, $text, "stub" );
1187 if ( "" != $trail ) {
1188 if ( preg_match( wfMsg("linktrail"), $trail, $m ) ) {
1193 if ( $wgOut->isPrintable() ||
1194 ( 1 == $wgUser->getOption( "highlightbroken" ) ) ) {
1195 $s = "<a href=\"{$u}\"{$style}>{$text}{$inside}</a>{$trail}";
1197 $s = "{$text}{$inside}<a href=\"{$u}\"{$style}>!</a>{$trail}";
1202 function fnamePart( $url )
1204 $basename = strrchr( $url, "/" );
1205 if ( false === $basename ) { $basename = $url; }
1206 else { $basename = substr( $basename, 1 ); }
1207 return wfEscapeHTML( $basename );
1210 function makeImage( $url, $alt = "" )
1214 if ( "" == $alt ) { $alt = $this->fnamePart( $url ); }
1215 $s = "<img src=\"{$url}\" alt=\"{$alt}\">";
1219 function makeImageLink( $name, $url, $alt = "" )
1221 global $wgOut, $wgTitle, $wgLang;
1223 $nt = Title
::newFromText( $wgLang->getNsText(
1224 Namespace::getImage() ) . ":{$name}" );
1225 $link = $nt->getPrefixedURL();
1226 if ( "" == $alt ) { $alt = $name; }
1228 $u = wfLocalUrlE( $link );
1229 $s = "<a href=\"{$u}\" class='image' title=\"{$alt}\">" .
1230 "<img border=0 src=\"{$url}\" alt=\"{$alt}\"></a>";
1234 function makeMediaLink( $name, $url, $alt = "" )
1236 global $wgOut, $wgTitle;
1238 if ( "" == $alt ) { $alt = $name; }
1239 $u = wfEscapeHTML( $url );
1240 $s = "<a href=\"{$u}\" class='internal' title=\"{$alt}\">{$alt}</a>";
1244 function specialLink( $name, $key = "" )
1248 if ( "" == $key ) { $key = strtolower( $name ); }
1249 $pn = $wgLang->ucfirst( $name );
1250 return $this->makeKnownLink( $wgLang->specialPage( $pn ),
1254 # Called by history lists and recent changes
1257 function beginRecentChangesList()
1259 $rc_cache = array() ;
1261 $this->lastdate
= "";
1265 function beginHistoryList()
1267 $this->lastdate
= $this->lastline
= "";
1268 $s = "\n<p>" . wfMsg( "histlegend" ) . "\n<ul>";
1272 function beginImageHistoryList()
1274 $s = "\n<h2>" . wfMsg( "imghistory" ) . "</h2>\n" .
1275 "<p>" . wfMsg( "imghistlegend" ) . "\n<ul>";
1279 function endRecentChangesList()
1281 $s = $this->recentChangesBlock() ;
1286 function endHistoryList()
1288 $last = wfMsg( "last" );
1290 $s = preg_replace( "/!OLDID![0-9]+!/", $last, $this->lastline
);
1295 function endImageHistoryList()
1301 function historyLine( $ts, $u, $ut, $ns, $ttl, $oid, $c, $isminor )
1305 $artname = Title
::makeName( $ns, $ttl );
1306 $last = wfMsg( "last" );
1307 $cur = wfMsg( "cur" );
1308 $cr = wfMsg( "currentrev" );
1310 if ( $oid && $this->lastline
) {
1311 $ret = preg_replace( "/!OLDID!([0-9]+)!/", $this->makeKnownLink(
1312 $artname, $last, "diff=\\1&oldid={$oid}" ), $this->lastline
);
1316 $dt = $wgLang->timeanddate( $ts, true );
1318 if ( $oid ) { $q = "oldid={$oid}"; }
1320 $link = $this->makeKnownLink( $artname, $dt, $q );
1323 $ul = $this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
1324 $ut, "target=" . $ut );
1325 } else { $ul = $this->makeLink( $wgLang->getNsText(
1326 Namespace::getUser() ) . ":{$ut}", $ut ); }
1330 $curlink = $this->makeKnownLink( $artname, $cur,
1331 "diff=0&oldid={$oid}" );
1335 $s .= "({$curlink}) (!OLDID!{$oid}!) . .";
1337 $M = wfMsg( "minoreditletter" );
1338 if ( $isminor ) { $s .= " <strong>{$M}</strong>"; }
1339 $s .= " {$link} . . {$ul}";
1341 if ( "" != $c && "*" != $c ) { $s .= " <em>(" . wfEscapeHTML($c) . ")</em>"; }
1344 $this->lastline
= $s;
1348 function recentChangesBlockLine ( $y ) {
1349 global $wgUploadPath ;
1351 $M = wfMsg( "minoreditletter" );
1352 $N = wfMsg( "newpageletter" );
1354 $r .= "<img src='{$wgUploadPath}/Arr_.png' width=12 height=12 border=0>" ;
1356 if ( $y->isnew
) $r .= $N ;
1357 else $r .= " " ;
1358 if ( $y->isminor
) $r .= $M ;
1359 else $r .= " " ;
1360 $r .= " ".$y->timestamp
." " ;
1363 if ( $y->watched
) $link = "<strong>{$link}</strong>" ;
1369 $r .= $this->makeKnownLink( $y->secureName
, wfMsg( "hist" ), "action=history" );
1371 $r .= ") . . ".$y->userlink
;
1372 $r .= $y->usertalklink
;
1373 if ( $y->usercomment
!= "" )
1374 $r .= " <em>(".wfEscapeHTML($y->usercomment
).")</em>" ;
1379 function recentChangesBlockGroup ( $y ) {
1380 global $wgUploadPath ;
1383 $M = wfMsg( "minoreditletter" );
1384 $N = wfMsg( "newpageletter" );
1386 $userlinks = array () ;
1387 foreach ( $y AS $x ) {
1388 $oldid = $x->diffid
;
1389 if ( $x->isnew
) $isnew = true ;
1391 if ( !isset ( $userlinks[$u] ) ) $userlinks[$u] = 0 ;
1395 krsort ( $userlinks ) ;
1396 asort ( $userlinks ) ;
1398 $u = array_keys ( $userlinks ) ;
1399 foreach ( $u as $x ) {
1401 if ( $userlinks[$x] > 1 ) $z .= " ({$userlinks[$x]}×)" ;
1402 array_push ( $users , $z ) ;
1404 $users = " <font size='-1'>[".implode("; ",$users)."]</font>" ;
1407 $e = array_shift ( $e ) ;
1410 $rci = "RCI{$this->rccc}" ;
1411 $rcl = "RCL{$this->rccc}" ;
1412 $rcm = "RCM{$this->rccc}" ;
1413 $tl = "<a href='javascript:toggleVisibility(\"{$rci}\",\"{$rcm}\",\"{$rcl}\")'>" ;
1414 $tl .= "<span id='{$rcm}'><img src='{$wgUploadPath}/Arr_r.png' width=12 height=12 border=0></span>" ;
1415 $tl .= "<span id='{$rcl}' style='display:none'><img src='{$wgUploadPath}/Arr_d.png' width=12 height=12 border=0></span>" ;
1421 if ( $isnew ) $r .= $N ;
1422 else $r .= " " ;
1423 $r .= " " ; # Minor
1424 $r .= " ".$e->timestamp
." " ;
1428 if ( $e->watched
) $link = "<strong>{$link}</strong>" ;
1432 $r .= " (".count($y)." " ;
1433 if ( $isnew ) $r .= wfMsg("changes");
1434 else $r .= $this->makeKnownLink( $e->secureName
, wfMsg("changes") , "diff=0&oldid=".$oldid ) ;
1436 $r .= $this->makeKnownLink( $e->secureName
, wfMsg( "history" ), "action=history" );
1444 $r .= "<div id='{$rci}' style='display:none'>" ;
1445 foreach ( $y AS $x )
1447 $r .= "<img src='{$wgUploadPath}/Arr_.png' width=12 height=12 border=0>";
1448 $r .= "<tt> " ;
1449 if ( $x->isnew
) $r .= $N ;
1450 else $r .= " " ;
1451 if ( $x->isminor
) $r .= $M ;
1452 else $r .= " " ;
1456 if ( $x->oldid
!= 0 ) $o = "oldid=".$x->oldid
;
1457 if ( $x->islog
) $link = $x->timestamp
;
1458 else $link = $this->makeKnownLink( $x->secureName
, $x->timestamp
, $o ) ;
1459 $link = "<tt>{$link}</tt>" ;
1466 $r .= $x->lastlink
;
1467 $r .= ") . . ".$x->userlink
;
1468 $r .= $x->usertalklink
;
1469 if ( $x->usercomment
!= "" )
1470 $r .= " <em>(".wfEscapeHTML($x->usercomment
).")</em>" ;
1479 function recentChangesBlock ()
1481 global $wgUploadPath ;
1482 if ( count ( $this->rc_cache
) == 0 ) return "" ;
1483 $k = array_keys ( $this->rc_cache
) ;
1484 foreach ( $k AS $x )
1486 $y = $this->rc_cache
[$x] ;
1487 if ( count ( $y ) < 2 ) {
1488 $r .= $this->recentChangesBlockLine ( array_shift ( $y ) ) ;
1490 $r .= $this->recentChangesBlockGroup ( $y ) ;
1494 return "<div align=left>{$r}</div>" ;
1497 function recentChangesLine( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched = false, $oldid = 0 , $diffid = 0 )
1500 $usenew = $wgUser->getOption( "usenewrc" );
1502 $r = $this->recentChangesLineNew ( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched , $oldid , $diffid ) ;
1504 $r = $this->recentChangesLineOld ( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched , $oldid , $diffid ) ;
1508 function recentChangesLineOld( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched = false, $oldid = 0, $diffid = 0 )
1510 global $wgTitle, $wgLang, $wgUser;
1512 $d = $wgLang->date( $ts, true);
1514 if ( $d != $this->lastdate
) {
1515 if ( "" != $this->lastdate
) { $s .= "</ul>\n"; }
1516 $s .= "<h4>{$d}</h4>\n<ul>";
1517 $this->lastdate
= $d;
1519 $h = $wgLang->time( $ts, true );
1520 $t = Title
::makeName( $ns, $ttl );
1521 $clink = $this->makeKnownLink( $t , "" );
1522 $nt = Title
::newFromText( $t );
1525 $clink = "<strong>{$clink}</strong>";
1527 $hlink = $this->makeKnownLink( $t, wfMsg( "hist" ), "action=history" );
1528 if ( $isnew ||
$nt->isLog() ) {
1529 $dlink = wfMsg( "diff" );
1531 $dlink = $this->makeKnownLink( $t, wfMsg( "diff" ),
1532 "diff={$oldid}&oldid={$diffid}" ); # Finagle's law
1535 $ul = $this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
1536 $ut, "target=" . $ut );
1537 } else { $ul = $this->makeLink( $wgLang->getNsText(
1538 Namespace::getUser() ) . ":{$ut}", $ut ); }
1540 $utns=$wgLang->getNsText(Namespace::getTalk(Namespace::getUser()));
1541 $talkname=$wgLang->getNsText(Namespace::getTalk(0)); # use the shorter name
1542 $utl= $this->makeLink($utns . ":{$ut}", $talkname );
1543 $cr = wfMsg( "currentrev" );
1545 $s .= "<li> ({$dlink}) ({$hlink}) . .";
1546 $M = wfMsg( "minoreditletter" );
1547 $N = wfMsg( "newpageletter" );
1548 if ( $isminor ) { $s .= " <strong>{$M}</strong>"; }
1549 if ( $isnew ) { $s .= "<strong>{$N}</strong>"; }
1550 $s .= " {$clink}; {$h} . . {$ul}";
1553 if ( ( 0 == $u ) && $wgUser->isSysop() ) {
1554 $blink = $this->makeKnownLink( $wgLang->specialPage(
1555 "Blockip" ), wfMsg( "blocklink" ), "ip={$ut}" );
1561 $utl = "({$utl} | {$blink})";
1565 if ( "" != $c && "*" != $c ) {
1566 $s .= " <em>(" . wfEscapeHTML( $c ) . ")</em>";
1573 function recentChangesLineNew( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched = false, $oldid = 0 , $diffid = 0 )
1575 global $wgTitle, $wgLang, $wgUser;
1577 $rc = new RecentChangesClass
;
1579 $d = $wgLang->date( $ts, true);
1582 if ( $d != $this->lastdate
) {
1583 $ret = $this->recentChangesBlock () ;
1584 $this->rc_cache
= array() ;
1585 $ret .= "<h4>{$d}</h4>\n";
1586 $this->lastdate
= $d;
1588 $h = $wgLang->time( $ts, true );
1589 $t = Title
::makeName( $ns, $ttl );
1590 $clink = $this->makeKnownLink( $t, "" ) ;
1591 if ( $oldid == 0 ) $c2link = $clink ;
1592 else $c2link = $this->makeKnownLink( $t, "" , "oldid={$oldid}" );
1593 $nt = Title
::newFromText( $t );
1595 $rc->timestamp
= $h ;
1596 $rc->oldid
= $oldid ;
1597 $rc->diffid
= $diffid ;
1598 $rc->watched
= $watched ;
1599 $rc->isnew
= $isnew ;
1600 $rc->isminor
= $isminor ;
1601 $rc->secureName
= $t ;
1602 $rc->displayName
= $nt ;
1603 $rc->link
= $clink ;
1604 $rc->usercomment
= $c ;
1605 $rc->islog
= $nt->isLog() ;
1607 if ( ( $isnew && $oldid == 0 ) ||
$nt->isLog() ) {
1608 $dlink = wfMsg( "cur" );
1610 $dlink = $this->makeKnownLink( $t, wfMsg( "cur" ),
1611 "diff=0&oldid={$oldid}" );
1614 if ( $diffid == 0 ||
$nt->isLog() ) {
1615 $plink = wfMsg( "last" );
1617 $plink = $this->makeKnownLink( $t, wfMsg( "last" ),
1618 "diff={$oldid}&oldid={$diffid}" );
1622 $ul = $this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
1623 $ut, "target=" . $ut );
1624 } else { $ul = $this->makeLink( $wgLang->getNsText(
1625 Namespace::getUser() ) . ":{$ut}", $ut ); }
1627 $rc->userlink
= $ul ;
1628 $rc->lastlink
= $plink ;
1629 $rc->curlink
= $dlink ;
1631 $utns=$wgLang->getNsText(Namespace::getTalk(Namespace::getUser()));
1632 $talkname=$wgLang->getNsText(Namespace::getTalk(0)); # use the shorter name
1633 $utl= $this->makeLink($utns . ":{$ut}", $talkname );
1635 if ( ( 0 == $u ) && $wgUser->isSysop() ) {
1636 $blink = $this->makeKnownLink( $wgLang->specialPage(
1637 "Blockip" ), wfMsg( "blocklink" ), "ip={$ut}" );
1638 $rc->usertalklink
= " ({$utl} | {$blink})";
1640 $rc->usertalklink
=" ({$utl})";
1643 if ( !isset ( $this->rc_cache
[$t] ) ) $this->rc_cache
[$t] = array() ;
1644 array_push ( $this->rc_cache
[$t] , $rc ) ;
1649 function imageHistoryLine( $iscur, $ts, $img, $u, $ut, $size, $c )
1651 global $wgUser, $wgLang, $wgTitle;
1653 $dt = $wgLang->timeanddate( $ts, true );
1654 $del = wfMsg( "deleteimg" );
1655 $cur = wfMsg( "cur" );
1658 $url = wfImageUrl( $img );
1660 if ( $wgUser->isSysop() ) {
1661 $link = wfLocalUrlE( "", "image=" . $wgTitle->getURL() .
1663 $style = $this->getInternalLinkAttributes( $link, $del );
1665 $dlink = "<a href=\"{$link}\"{$style}>{$del}</a>";
1670 $url = wfEscapeHTML( wfImageArchiveUrl( $img ) );
1671 if( $wgUser->getID() != 0 ) {
1672 $rlink = $this->makeKnownLink( $wgTitle->getPrefixedText(),
1673 wfMsg( "revertimg" ), "action=revert&oldimage=" .
1674 urlencode( $img ) );
1675 $dlink = $this->makeKnownLink( $wgTitle->getPrefixedText(),
1676 $del, "action=delete&oldimage=" . urlencode( $img ) );
1678 # Having live active links for non-logged in users
1679 # means that bots and spiders crawling our site can
1680 # inadvertently change content. Baaaad idea.
1681 $rlink = wfMsg( "revertimg" );
1685 if ( 0 == $u ) { $ul = $ut; }
1686 else { $ul = $this->makeLink( $wgLang->getNsText(
1687 Namespace::getUser() ) . ":{$ut}", $ut ); }
1689 $nb = str_replace( "$1", $size, wfMsg( "nbytes" ) );
1690 $style = $this->getInternalLinkAttributes( $url, $dt );
1692 $s = "<li> ({$dlink}) ({$rlink}) <a href=\"{$url}\"{$style}>{$dt}</a>"
1693 . " . . {$ul} ({$nb})";
1695 if ( "" != $c && "*" != $c ) {
1696 $s .= " <em>(" . wfEscapeHTML( $c ) . ")</em>";
1702 function tocIndent($level) {
1704 while($level-->0) $rv.="<div style=\"margin-left:2em;\">\n";
1709 function tocUnindent($level) {
1710 while($level-->0) $rv.="</div>\n";
1714 // parameter level defines if we are on an indentation level
1715 function tocLine($anchor,$tocline,$level) {
1719 return "<A CLASS=\"internal\" HREF=\"#".$anchor."\">".$tocline."</A><BR>\n";
1722 return "<div style=\"margin-bottom:0px;\">\n".
1723 "<A CLASS=\"internal\" HREF=\"#".$anchor."\">".$tocline."</A><BR>\n".
1729 function tocTable($toc) {
1730 // note to CSS fanatics: putting this in a div does not work -- div won't auto-expand
1734 $hideline = " <script type='text/javascript'>showTocToggle(\"" . wfMsg("showtoc") . "\",\"" . wfMsg("hidetoc") . "\")</script>";
1737 "<p><table border=\"0\" id=\"toc\"><tr><td align=\"center\">\n".
1738 "<b>".wfMsg("toc")."</b>" .
1740 "</td></tr><tr id='tocinside'><td align=\"left\">\n".
1741 $toc."</td></tr></table><P>\n";
1744 # These two do not check for permissions: check $wgTitle->userCanEdit before calling them
1745 function editSectionScript($section,$head) {
1747 global $wgTitle,$wgUser,$oldid;
1748 if($oldid) return $head;
1749 $url = wfLocalUrlE(urlencode($wgTitle->getPrefixedText()),"action=edit§ion=$section");
1750 return "<span onContextMenu='document.location=\"".$url."\";return false;'>{$head}</span>";
1753 function editSectionLink($section) {
1756 global $wgTitle,$wgUser,$oldid;
1757 if($oldid) return "";
1758 if ($printable) return "";
1759 $editurl="§ion={$section}";
1760 $url=$this->makeKnownLink($wgTitle->getPrefixedText(),wfMsg("editsection"),"action=edit".$editurl);
1761 return "<div style=\"float:right;margin-left:5px;\"><small>[".$url."]</small></div>";
1766 include_once( "SkinStandard.php" );
1767 include_once( "SkinNostalgia.php" );
1768 include_once( "SkinCologneBlue.php" );