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 $cr = wfMsg( "gnunote" );
293 $s .= "<p><em>{$rf}{$lm} {$cr}</em>\n";
296 return $this->doAfterContent();
299 function doAfterContent()
301 global $wgUser, $wgOut, $wgLang;
302 wfProfileIn( "Skin::doAfterContent" );
304 $s = "\n</div><br clear=all>\n";
306 $s .= "\n<div id='footer'>";
307 $s .= "<table width='98%' border=0 cellspacing=0><tr>";
309 $qb = $this->qbSetting();
311 $left = ($qb == 1 ||
$qb == 3);
312 if($wgLang->isRTL()) $left = !$left;
314 if ( $shove && $left ) { # Left
315 $s .= $this->getQuickbarCompensator();
317 $l = $wgLang->isRTL() ?
"right" : "left";
318 $s .= "<td class='bottom' align='$l' valign='top'>";
320 $s .= $this->bottomLinks();
321 $s .= "\n<br>" . $this->mainPageLink()
322 . " | " . $this->aboutLink()
323 . " | " . $this->specialLink( "recentchanges" )
324 . " | " . $this->searchForm()
325 . "<br>" . $this->pageStats();
328 if ( $shove && !$left ) { # Right
329 $s .= $this->getQuickbarCompensator();
331 $s .= "</tr></table>\n</div>\n</div>\n";
333 if ( 0 != $qb ) { $s .= $this->quickBar(); }
338 function pageTitleLinks()
340 global $wgOut, $wgTitle, $oldid, $action, $diff, $wgUser, $wgLang;
342 $s = $this->printableLink();
344 if ( $wgOut->isArticle() ) {
345 if ( $wgTitle->getNamespace() == Namespace::getImage() ) {
346 $name = $wgTitle->getDBkey();
347 $link = wfEscapeHTML( wfImageUrl( $name ) );
348 $style = $this->getInternalLinkAttributes( $link, $name );
349 $s .= " | <a href=\"{$link}\"{$style}>{$name}</a>";
352 if ( "history" == $action ||
isset( $diff ) ||
isset( $oldid ) ) {
353 $s .= " | " . $this->makeKnownLink( $wgTitle->getPrefixedText(),
354 wfMsg( "currentrev" ) );
357 if ( $wgUser->getNewtalk() ) {
358 # do not show "You have new messages" text when we are viewing our
361 if(!(strcmp($wgTitle->getText(),$wgUser->getName()) == 0 &&
362 $wgTitle->getNamespace()==Namespace::getTalk(Namespace::getUser()))) {
363 $n =$wgUser->getName();
364 $tl = $this->makeKnownLink( $wgLang->getNsText(
365 Namespace::getTalk( Namespace::getUser() ) ) . ":{$n}",
366 wfMsg("newmessageslink") );
367 $s.=" | <strong>". str_replace( "$1", $tl, wfMsg("newmessages") ) . "</strong>";
373 function printableLink()
375 global $wgOut, $wgTitle, $oldid, $action;
377 if ( "history" == $action ) { $q = "action=history&"; }
380 $s = $this->makeKnownLink( $wgTitle->getPrefixedText(),
381 WfMsg( "printableversion" ), "{$q}printable=yes" );
387 global $wgOut, $wgTitle, $wgUser;
389 $s = "<h1 class='pagetitle'>" . $wgOut->getPageTitle() . "</h1>";
390 if($wgUser->getOption("editsectiononrightclick") && $wgTitle->userCanEdit()) { $s=$this->editSectionScript(0,$s);}
394 function pageSubtitle()
396 global $wgOut,$wgTitle,$wgNamespacesWithSubpages;
398 $sub = $wgOut->getSubtitle();
399 if ( "" == $sub ) { $sub = wfMsg( "fromwikipedia" ); }
400 if($wgOut->isArticle() && $wgNamespacesWithSubpages[$wgTitle->getNamespace()]) {
401 $ptext=$wgTitle->getPrefixedText();
402 if(preg_match("/\//",$ptext)) {
403 $sub.="</p><p class='subpages'>";
404 $links=explode("/",$ptext);
407 foreach($links as $link) {
409 if ($c<count($links)) {
411 $getlink=$this->makeLink($growinglink,$link);
412 if(preg_match("/class='new'/i",$getlink)) { break; } # this is a hack, but it saves time
425 $s = "<p class='subtitle'>{$sub}\n";
429 function nameAndLogin()
431 global $wgUser, $wgTitle, $wgLang, $wgShowIPinHeader;
433 $li = $wgLang->specialPage( "Userlogin" );
434 $lo = $wgLang->specialPage( "Userlogout" );
437 if ( 0 == $wgUser->getID() ) {
438 if( $wgShowIPinHeader ) {
439 $n = getenv( "REMOTE_ADDR" );
441 $tl = $this->makeKnownLink( $wgLang->getNsText(
442 Namespace::getTalk( Namespace::getUser() ) ) . ":{$n}",
443 $wgLang->getNsText( Namespace::getTalk( 0 ) ) );
445 $s .= $n . " (".$tl.")";
447 $s .= wfMsg("notloggedin");
450 $rt = $wgTitle->getPrefixedURL();
451 if ( 0 == strcasecmp( urlencode( $lo ), $rt ) ) {
453 } else { $q = "returnto={$rt}"; }
455 $s .= "\n<br>" . $this->makeKnownLink( $li,
456 wfMsg( "login" ), $q );
458 $n = $wgUser->getName();
459 $rt = $wgTitle->getPrefixedURL();
460 $tl = $this->makeKnownLink( $wgLang->getNsText(
461 Namespace::getTalk( Namespace::getUser() ) ) . ":{$n}",
462 $wgLang->getNsText( Namespace::getTalk( 0 ) ) );
466 $s .= $this->makeKnownLink( $wgLang->getNsText(
467 Namespace::getUser() ) . ":{$n}", $n ) . "{$tl}<br>" .
468 $this->makeKnownLink( $lo, wfMsg( "logout" ),
469 "returnto={$rt}" ) . " | " .
470 $this->specialLink( "preferences" );
472 $s .= " | " . $this->makeKnownLink( wfMsg( "helppage" ),
478 function searchForm()
482 $s = "<form name='search' class='inline' method=get action=\""
483 . wfLocalUrl( "" ) . "\">"
484 . "<input type=text name=\"search\" size=19 value=\""
485 . htmlspecialchars(substr($search,0,256)) . "\">\n"
486 . "<input type=submit name=\"go\" value=\"" . wfMsg ("go") . "\"> "
487 . "<input type=submit value=\"" . wfMsg ("search") . "\"></form>";
497 $s = $this->mainPageLink() . $sep
498 . $this->specialLink( "recentchanges" );
500 if ( $wgOut->isArticle() ) {
501 $s .= $sep . $this->editThisPage()
502 . $sep . $this->historyLink();
504 # Many people don't like this dropdown box
505 #$s .= $sep . $this->specialPagesList();
510 function bottomLinks()
512 global $wgOut, $wgUser, $wgTitle;
516 if ( $wgOut->isArticle() ) {
517 $s .= "<strong>" . $this->editThisPage() . "</strong>";
518 if ( 0 != $wgUser->getID() ) {
519 $s .= $sep . $this->watchThisPage();
521 $s .= $sep . $this->talkLink()
522 . $sep . $this->historyLink()
523 . $sep . $this->whatLinksHere()
524 . $sep . $this->watchPageLinksLink();
526 if ( $wgTitle->getNamespace() == Namespace::getUser()
527 ||
$wgTitle->getNamespace() == Namespace::getTalk(Namespace::getUser()) )
530 $id=User
::idFromName($wgTitle->getText());
531 $ip=User
::isIP($wgTitle->getText());
533 if($id ||
$ip) { # both anons and non-anons have contri list
534 $s .= $sep . $this->userContribsLink();
536 if ( 0 != $wgUser->getID() ) { # show only to signed in users
537 if($id) { # can only email non-anons
538 $s .= $sep . $this->emailUserLink();
542 if ( $wgUser->isSysop() && $wgTitle->getArticleId() ) {
543 $s .= "\n<br>" . $this->deleteThisPage() .
544 $sep . $this->protectThisPage() .
545 $sep . $this->moveThisPage();
547 $s .= "<br>\n" . $this->otherLanguages();
554 global $wgOut, $wgLang, $wgArticle;
555 global $oldid, $diff, $wgDisableCounters;
557 if ( ! $wgOut->isArticle() ) { return ""; }
558 if ( isset( $oldid ) ||
isset( $diff ) ) { return ""; }
559 if ( 0 == $wgArticle->getID() ) { return ""; }
561 if ( $wgDisableCounters ) {
564 $count = $wgArticle->getCount();
565 $s = str_replace( "$1", $count, wfMsg( "viewcount" ) );
567 $s .= $this->lastModified();
568 $s .= " " . wfMsg( "gnunote" );
569 return "<span id='pagestats'>{$s}</span>";
572 function lastModified()
574 global $wgLang, $wgArticle;
576 $d = $wgLang->timeanddate( $wgArticle->getTimestamp(), true );
577 $s = " " . str_replace( "$1", $d, wfMsg( "lastmodified" ) );
581 function logoText( $align = "" )
583 if ( "" != $align ) { $a = " align='{$align}'"; }
586 $mp = wfMsg( "mainpage" );
587 $s = "<a href=\"" . wfLocalUrlE( $mp ) . "\"><img{$a} border=0 src=\""
588 . $this->getLogo() . "\" alt=\"" . "[{$mp}]\"></a>";
594 global $wgOut, $wgTitle, $wgUser, $action, $wgLang;
596 wfProfileIn( "Skin::quickBar" );
597 $tns=$wgTitle->getNamespace();
599 $s = "\n<div id='quickbar'>";
600 $s .= "\n" . $this->logoText() . "\n<hr class='sep'>";
603 $s .= $this->mainPageLink()
604 . $sep . $this->specialLink( "recentchanges" )
605 . $sep . $this->specialLink( "randompage" );
606 if ($wgUser->getID()) {
607 $s.= $sep . $this->specialLink( "watchlist" ) ;
608 $s .= $sep .$this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
609 wfMsg( "mycontris" ), "target=" . wfUrlencode($wgUser->getName() ) );
612 // only show watchlist link if logged in
613 if ( wfMsg ( "currentevents" ) != "-" ) $s .= $sep . $this->makeKnownLink( wfMsg( "currentevents" ), "" ) ;
614 $s .= "\n<br><hr class='sep'>";
615 $articleExists = $wgTitle->getArticleId();
616 if ( $wgOut->isArticle() ||
$action =="edit" ||
$action =="history" ||
$wpPreview) {
618 if($wgOut->isArticle()) {
619 $s .= "<strong>" . $this->editThisPage() . "</strong>";
620 } else { # backlink to the article in edit or history mode
621 if($articleExists){ # no backlink if no article
624 $text = wfMsg("articlepage");
627 $text = wfMsg("viewtalkpage");
630 $text = wfMsg("userpage");
633 $text = wfMsg("viewtalkpage");
636 $text = wfMsg("wikipediapage");
639 $text = wfMsg("viewtalkpage");
642 $text = wfMsg("imagepage");
645 $text = wfMsg("viewtalkpage");
648 $text= wfMsg("articlepage");
651 $link = $wgTitle->getText();
652 if ($nstext = $wgLang->getNsText($tns) ) { # add namespace if necessary
653 $link = $nstext . ":" . $link ;
655 $s .= $this->makeLink($link, $text );
656 } elseif( $wgTitle->getNamespace() != Namespace::getSpecial() ) {
657 # we just throw in a "New page" text to tell the user that he's in edit mode,
658 # and to avoid messing with the separator that is prepended to the next item
659 $s .= "<strong>" . wfMsg("newpage") . "</strong>";
665 if( $tns%2
&& $action!="edit" && !$wpPreview) {
666 $s.="<br>".$this->makeKnownLink($wgTitle->getPrefixedText(),wfMsg("postcomment"),"action=edit§ion=new");
670 watching could cause problems in edit mode:
671 if user edits article, then loads "watch this article" in background and then saves
672 article with "Watch this article" checkbox disabled, the article is transparently
673 unwatched. Therefore we do not show the "Watch this page" link in edit mode
675 if ( 0 != $wgUser->getID() && $articleExists) {
676 if($action!="edit" && $action!="history" &&
677 $action != "submit" )
678 {$s .= $sep . $this->watchThisPage(); }
679 if ( $wgTitle->userCanEdit() ) $s .= $sep . $this->moveThisPage();
681 if ( $wgUser->isSysop() and $articleExists ) {
682 $s .= $sep . $this->deleteThisPage() .
683 $sep . $this->protectThisPage();
685 $s .= $sep . $this->talkLink();
686 if ($articleExists && $action !="history") { $s .= $sep . $this->historyLink();}
687 $s.=$sep . $this->whatLinksHere();
689 if($wgOut->isArticle()) {
690 $s .= $sep . $this->watchPageLinksLink();
693 if ( Namespace::getUser() == $wgTitle->getNamespace()
694 ||
$wgTitle->getNamespace() == Namespace::getTalk(Namespace::getUser())
697 $id=User
::idFromName($wgTitle->getText());
698 $ip=User
::isIP($wgTitle->getText());
701 $s .= $sep . $this->userContribsLink();
703 if ( 0 != $wgUser->getID() ) {
704 if($id) { # can only email real users
705 $s .= $sep . $this->emailUserLink();
709 $s .= "\n<br><hr class='sep'>";
712 if ( 0 != $wgUser->getID() ) {
713 $s .= $this->specialLink( "upload" ) . $sep;
715 $s .= $this->specialLink( "specialpages" )
716 . $sep . $this->bugReportsLink();
718 $s .= "\n<br></div>\n";
723 function specialPagesList()
725 global $wgUser, $wgOut, $wgLang, $wgServer, $wgRedirectScript;
728 $validSP = $wgLang->getValidSpecialPages();
730 foreach ( $validSP as $name => $desc ) {
731 if ( "" == $desc ) { continue; }
734 if ( $wgUser->isSysop() )
736 $sysopSP = $wgLang->getSysopSpecialPages();
738 foreach ( $sysopSP as $name => $desc ) {
739 if ( "" == $desc ) { continue; }
743 if ( $wgUser->isDeveloper() )
745 $devSP = $wgLang->getDeveloperSpecialPages();
747 foreach ( $devSP as $name => $desc ) {
748 if ( "" == $desc ) { continue; }
753 $sp = wfMsg( "specialpages" );
754 $spp = $wgLang->specialPage( "Specialpages" );
756 $s = "<form id=\"specialpages\" method=\"get\" class=\"inline\" " .
757 "action=\"{$wgServer}{$wgRedirectScript}\">\n";
758 $s .= "<select name=\"wpDropdown\">\n";
759 $s .= "<option value=\"{$spp}\">{$sp}</option>\n";
761 foreach ( $a as $name => $desc ) {
762 $p = $wgLang->specialPage( $name );
763 $s .= "<option value=\"{$p}\">{$desc}</option>\n";
766 $s .= "<input type=submit value=\"{$go}\" name=redirect>\n";
771 function mainPageLink()
773 $mp = wfMsg( "mainpage" );
774 $s = $this->makeKnownLink( $mp, $mp );
778 function copyrightLink()
780 $s = $this->makeKnownLink( wfMsg( "copyrightpage" ),
781 wfMsg( "copyrightpagename" ) );
787 $s = $this->makeKnownLink( wfMsg( "aboutpage" ),
788 wfMsg( "aboutwikipedia" ) );
792 function editThisPage()
794 global $wgOut, $wgTitle, $oldid, $redirect, $diff;
796 if ( ! $wgOut->isArticle() ||
$diff ) {
797 $s = wfMsg( "protectedpage" );
798 } else if ( $wgTitle->userCanEdit() ) {
799 $n = $wgTitle->getPrefixedText();
800 $t = wfMsg( "editthispage" );
803 if ( $redirect ) { $red = "&redirect={$redirect}"; }
804 if ( $oldid && ! isset( $diff ) ) {
805 $oid = "&oldid={$oldid}";
807 $s = $this->makeKnownLink( $n, $t, "action=edit{$oid}{$red}" );
809 $s = wfMsg( "protectedpage" );
814 function deleteThisPage()
816 global $wgUser, $wgOut, $wgTitle, $diff;
818 if ( $wgTitle->getArticleId() && ( ! $diff ) && $wgUser->isSysop() ) {
819 $n = $wgTitle->getPrefixedText();
820 $t = wfMsg( "deletethispage" );
822 $s = $this->makeKnownLink( $n, $t, "action=delete" );
824 $s = wfMsg( "error" );
829 function protectThisPage()
831 global $wgUser, $wgOut, $wgTitle, $diff;
833 if ( $wgTitle->getArticleId() && ( ! $diff ) && $wgUser->isSysop() ) {
834 $n = $wgTitle->getPrefixedText();
836 if ( $wgTitle->isProtected() ) {
837 $t = wfMsg( "unprotectthispage" );
838 $q = "action=unprotect";
840 $t = wfMsg( "protectthispage" );
841 $q = "action=protect";
843 $s = $this->makeKnownLink( $n, $t, $q );
845 $s = wfMsg( "error" );
850 function watchThisPage()
852 global $wgUser, $wgOut, $wgTitle, $diff;
854 if ( $wgOut->isArticle() && ( ! $diff ) ) {
855 $n = $wgTitle->getPrefixedText();
857 if ( $wgTitle->userIsWatching() ) {
858 $t = wfMsg( "unwatchthispage" );
859 $q = "action=unwatch";
861 $t = wfMsg( "watchthispage" );
864 $s = $this->makeKnownLink( $n, $t, $q );
866 $s = wfMsg( "notanarticle" );
871 function moveThisPage()
873 global $wgTitle, $wgLang;
875 if ( $wgTitle->userCanEdit() ) {
876 $s = $this->makeKnownLink( $wgLang->specialPage( "Movepage" ),
877 wfMsg( "movethispage" ), "target=" . $wgTitle->getPrefixedURL() );
878 } // no message if page is protected - would be redundant
882 function historyLink()
886 $s = $this->makeKnownLink( $wgTitle->getPrefixedText(),
887 wfMsg( "history" ), "action=history" );
891 function whatLinksHere()
893 global $wgTitle, $wgLang;
895 $s = $this->makeKnownLink( $wgLang->specialPage( "Whatlinkshere" ),
896 wfMsg( "whatlinkshere" ), "target=" . $wgTitle->getPrefixedURL() );
900 function userContribsLink()
902 global $wgTitle, $wgLang;
904 $s = $this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
905 wfMsg( "contributions" ), "target=" . $wgTitle->getURL() );
909 function emailUserLink()
911 global $wgTitle, $wgLang;
913 $s = $this->makeKnownLink( $wgLang->specialPage( "Emailuser" ),
914 wfMsg( "emailuser" ), "target=" . $wgTitle->getURL() );
918 function watchPageLinksLink()
920 global $wgOut, $wgTitle, $wgLang;
922 if ( ! $wgOut->isArticle() ) {
923 $s = "(" . wfMsg( "notanarticle" ) . ")";
925 $s = $this->makeKnownLink( $wgLang->specialPage(
926 "Recentchangeslinked" ), wfMsg( "recentchangeslinked" ),
927 "target=" . $wgTitle->getPrefixedURL() );
932 function otherLanguages()
934 global $wgOut, $wgLang, $wgTitle , $wgUseNewInterlanguage ;
936 $a = $wgOut->getLanguageLinks();
937 if ( 0 == count( $a ) ) {
938 if ( !$wgUseNewInterlanguage ) return "";
939 $ns = $wgLang->getNsIndex ( $wgTitle->getNamespace () ) ;
940 if ( $ns != 0 AND $ns != 1 ) return "" ;
942 $x = "mode=addlink&xt=".$wgTitle->getDBkey() ;
943 return $this->makeKnownLink( $wgLang->specialPage( $pn ),
944 wfMsg( "intl" ) , $x );
947 if ( !$wgUseNewInterlanguage ) {
948 $s = wfMsg( "otherlanguages" ) . ": ";
950 global $wgLanguageCode ;
951 $x = "mode=zoom&xt=".$wgTitle->getDBkey() ;
952 $x .= "&xl=".$wgLanguageCode ;
953 $s = $this->makeKnownLink( $wgLang->specialPage( "Intl" ),
954 wfMsg( "otherlanguages" ) , $x ) . ": " ;
958 if($wgLang->isRTL()) $s .= "<span dir='LTR'>";
959 foreach( $a as $l ) {
960 if ( ! $first ) { $s .= " | "; }
963 $nt = Title
::newFromText( $l );
964 $url = $nt->getFullURL();
965 $text = $wgLang->getLanguageName( $nt->getInterwiki() );
967 if ( "" == $text ) { $text = $l; }
968 $style = $this->getExternalLinkAttributes( $l, $text );
969 $s .= "<a href=\"{$url}\"{$style}>{$text}</a>";
971 if($wgLang->isRTL()) $s .= "</span>";
975 function bugReportsLink()
977 $s = $this->makeKnownLink( wfMsg( "bugreportspage" ),
978 wfMsg( "bugreports" ) );
985 $t1 = Title
::newFromText( gmdate( "F j" ) );
986 $t2 = Title
::newFromText( gmdate( "Y" ) );
988 $wgLinkCache->suspend();
989 $id = $t1->getArticleID();
990 $wgLinkCache->resume();
993 $s = $this->makeBrokenLink( $t1->getText() );
995 $s = $this->makeKnownLink( $t1->getText() );
999 $wgLinkCache->suspend();
1000 $id = $t2->getArticleID();
1001 $wgLinkCache->resume();
1004 $s .= $this->makeBrokenLink( $t2->getText() );
1006 $s .= $this->makeKnownLink( $t2->getText() );
1013 global $wgLang, $wgTitle, $wgLinkCache;
1015 $tns = $wgTitle->getNamespace();
1016 if ( -1 == $tns ) { return ""; }
1018 $pn = $wgTitle->getText();
1019 $tp = wfMsg( "talkpage" );
1020 if ( Namespace::isTalk( $tns ) ) {
1021 $lns = Namespace::getSubject( $tns );
1024 $text = wfMsg("articlepage");
1027 $text = wfMsg("userpage");
1030 $text = wfMsg("wikipediapage");
1033 $text = wfMsg("imagepage");
1036 $text= wfMsg("articlepage");
1040 $lns = Namespace::getTalk( $tns );
1043 $n = $wgLang->getNsText( $lns );
1044 if ( "" == $n ) { $link = $pn; }
1045 else { $link = "{$n}:{$pn}"; }
1047 $wgLinkCache->suspend();
1048 $s = $this->makeLink( $link, $text );
1049 $wgLinkCache->resume();
1054 # After all the page content is transformed into HTML, it makes
1055 # a final pass through here for things like table backgrounds.
1057 function transformContent( $text )
1062 # Note: This function MUST call getArticleID() on the link,
1063 # otherwise the cache won't get updated properly. See LINKCACHE.DOC.
1065 function makeLink( $title, $text= "", $query = "", $trail = "" )
1067 global $wgOut, $wgUser;
1069 $nt = Title
::newFromText( $title );
1071 if ( $nt->isExternal() ) {
1072 $u = $nt->getFullURL();
1073 if ( "" == $text ) { $text = $nt->getPrefixedText(); }
1074 $style = $this->getExternalLinkAttributes( $link, $text );
1077 if ( "" != $trail ) {
1078 if ( preg_match( "/^([a-z]+)(.*)$$/sD", $trail, $m ) ) {
1083 return "<a href=\"{$u}\"{$style}>{$text}{$inside}</a>{$trail}";
1085 if ( 0 == $nt->getNamespace() && "" == $nt->getText() ) {
1086 return $this->makeKnownLink( $title, $text, $query, $trail );
1088 if ( ( -1 == $nt->getNamespace() ) ||
1089 ( Namespace::getImage() == $nt->getNamespace() ) ) {
1090 return $this->makeKnownLink( $title, $text, $query, $trail );
1092 $aid = $nt->getArticleID() ;
1094 return $this->makeBrokenLink( $title, $text, $query, $trail );
1096 $threshold = $wgUser->getOption("stubthreshold") ;
1097 if ( $threshold > 0 ) {
1098 $res = wfQuery ( "SELECT HIGH_PRIORITY length(cur_text) AS x, cur_namespace, cur_is_redirect FROM cur WHERE cur_id='{$aid}'" ) ;
1100 if ( wfNumRows( $res ) > 0 ) {
1101 $s = wfFetchObject( $res );
1103 if ( $s->cur_is_redirect
OR $s->cur_namespace
!= 0 )
1104 $size = $threshold*2 ; # Really big
1105 wfFreeResult( $res );
1106 } else $size = $threshold*2 ; # Really big
1109 if ( $size < $threshold )
1110 return $this->makeStubLink( $title, $text, $query, $trail );
1111 return $this->makeKnownLink( $title, $text, $query, $trail );
1115 function makeKnownLink( $title, $text = "", $query = "", $trail = "" )
1117 global $wgOut, $wgTitle;
1119 $nt = Title
::newFromText( $title );
1120 $link = $nt->getPrefixedURL();
1122 if ( "" == $link ) {
1124 if ( "" == $text ) { $text = $nt->getFragment(); }
1126 $u = wfLocalUrlE( $link, $query );
1128 if ( "" != $nt->getFragment() ) {
1129 $u .= "#" . wfEscapeHTML( $nt->getFragment() );
1131 if ( "" == $text ) { $text = $nt->getPrefixedText(); }
1132 $style = $this->getInternalLinkAttributes( $link, $text );
1135 if ( "" != $trail ) {
1136 if ( preg_match( wfMsg("linktrail"), $trail, $m ) ) {
1141 $r = "<a href=\"{$u}\"{$style}>{$text}{$inside}</a>{$trail}";
1145 function makeBrokenLink( $title, $text = "", $query = "", $trail = "" )
1147 global $wgOut, $wgUser;
1149 $nt = Title
::newFromText( $title );
1150 $link = $nt->getPrefixedURL();
1152 if ( "" == $query ) { $q = "action=edit"; }
1153 else { $q = "action=edit&{$query}"; }
1154 $u = wfLocalUrlE( $link, $q );
1156 if ( "" == $text ) { $text = $nt->getPrefixedText(); }
1157 $style = $this->getInternalLinkAttributes( $link, $text, "yes" );
1160 if ( "" != $trail ) {
1161 if ( preg_match( wfMsg("linktrail"), $trail, $m ) ) {
1166 if ( $wgOut->isPrintable() ||
1167 ( 1 == $wgUser->getOption( "highlightbroken" ) ) ) {
1168 $s = "<a href=\"{$u}\"{$style}>{$text}{$inside}</a>{$trail}";
1170 $s = "{$text}{$inside}<a href=\"{$u}\"{$style}>?</a>{$trail}";
1175 function makeStubLink( $title, $text = "", $query = "", $trail = "" )
1177 global $wgOut, $wgUser;
1179 $nt = Title
::newFromText( $title );
1180 $link = $nt->getPrefixedURL();
1182 $u = wfLocalUrlE( $link, $query );
1184 if ( "" == $text ) { $text = $nt->getPrefixedText(); }
1185 $style = $this->getInternalLinkAttributes( $link, $text, "stub" );
1188 if ( "" != $trail ) {
1189 if ( preg_match( wfMsg("linktrail"), $trail, $m ) ) {
1194 if ( $wgOut->isPrintable() ||
1195 ( 1 == $wgUser->getOption( "highlightbroken" ) ) ) {
1196 $s = "<a href=\"{$u}\"{$style}>{$text}{$inside}</a>{$trail}";
1198 $s = "{$text}{$inside}<a href=\"{$u}\"{$style}>!</a>{$trail}";
1203 function fnamePart( $url )
1205 $basename = strrchr( $url, "/" );
1206 if ( false === $basename ) { $basename = $url; }
1207 else { $basename = substr( $basename, 1 ); }
1208 return wfEscapeHTML( $basename );
1211 function makeImage( $url, $alt = "" )
1215 if ( "" == $alt ) { $alt = $this->fnamePart( $url ); }
1216 $s = "<img src=\"{$url}\" alt=\"{$alt}\">";
1220 function makeImageLink( $name, $url, $alt = "" )
1222 global $wgOut, $wgTitle, $wgLang;
1224 $nt = Title
::newFromText( $wgLang->getNsText(
1225 Namespace::getImage() ) . ":{$name}" );
1226 $link = $nt->getPrefixedURL();
1227 if ( "" == $alt ) { $alt = $name; }
1229 $u = wfLocalUrlE( $link );
1230 $s = "<a href=\"{$u}\" class='image' title=\"{$alt}\">" .
1231 "<img border=0 src=\"{$url}\" alt=\"{$alt}\"></a>";
1235 function makeMediaLink( $name, $url, $alt = "" )
1237 global $wgOut, $wgTitle;
1239 if ( "" == $alt ) { $alt = $name; }
1240 $u = wfEscapeHTML( $url );
1241 $s = "<a href=\"{$u}\" class='internal' title=\"{$alt}\">{$alt}</a>";
1245 function specialLink( $name, $key = "" )
1249 if ( "" == $key ) { $key = strtolower( $name ); }
1250 $pn = $wgLang->ucfirst( $name );
1251 return $this->makeKnownLink( $wgLang->specialPage( $pn ),
1255 # Called by history lists and recent changes
1258 function beginRecentChangesList()
1260 $rc_cache = array() ;
1262 $this->lastdate
= "";
1266 function beginHistoryList()
1268 $this->lastdate
= $this->lastline
= "";
1269 $s = "\n<p>" . wfMsg( "histlegend" ) . "\n<ul>";
1273 function beginImageHistoryList()
1275 $s = "\n<h2>" . wfMsg( "imghistory" ) . "</h2>\n" .
1276 "<p>" . wfMsg( "imghistlegend" ) . "\n<ul>";
1280 function endRecentChangesList()
1282 $s = $this->recentChangesBlock() ;
1287 function endHistoryList()
1289 $last = wfMsg( "last" );
1291 $s = preg_replace( "/!OLDID![0-9]+!/", $last, $this->lastline
);
1296 function endImageHistoryList()
1302 function historyLine( $ts, $u, $ut, $ns, $ttl, $oid, $c, $isminor )
1306 $artname = Title
::makeName( $ns, $ttl );
1307 $last = wfMsg( "last" );
1308 $cur = wfMsg( "cur" );
1309 $cr = wfMsg( "currentrev" );
1311 if ( $oid && $this->lastline
) {
1312 $ret = preg_replace( "/!OLDID!([0-9]+)!/", $this->makeKnownLink(
1313 $artname, $last, "diff=\\1&oldid={$oid}" ), $this->lastline
);
1317 $dt = $wgLang->timeanddate( $ts, true );
1319 if ( $oid ) { $q = "oldid={$oid}"; }
1321 $link = $this->makeKnownLink( $artname, $dt, $q );
1324 $ul = $this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
1325 $ut, "target=" . $ut );
1326 } else { $ul = $this->makeLink( $wgLang->getNsText(
1327 Namespace::getUser() ) . ":{$ut}", $ut ); }
1331 $curlink = $this->makeKnownLink( $artname, $cur,
1332 "diff=0&oldid={$oid}" );
1336 $s .= "({$curlink}) (!OLDID!{$oid}!) . .";
1338 $M = wfMsg( "minoreditletter" );
1339 if ( $isminor ) { $s .= " <strong>{$M}</strong>"; }
1340 $s .= " {$link} . . {$ul}";
1342 if ( "" != $c && "*" != $c ) { $s .= " <em>(" . wfEscapeHTML($c) . ")</em>"; }
1345 $this->lastline
= $s;
1349 function recentChangesBlockLine ( $y ) {
1350 global $wgUploadPath ;
1352 $M = wfMsg( "minoreditletter" );
1353 $N = wfMsg( "newpageletter" );
1355 $r .= "<img src='{$wgUploadPath}/Arr_.png' width=12 height=12 border=0>" ;
1357 if ( $y->isnew
) $r .= $N ;
1358 else $r .= " " ;
1359 if ( $y->isminor
) $r .= $M ;
1360 else $r .= " " ;
1361 $r .= " ".$y->timestamp
." " ;
1364 if ( $y->watched
) $link = "<strong>{$link}</strong>" ;
1370 $r .= $this->makeKnownLink( $y->secureName
, wfMsg( "hist" ), "action=history" );
1372 $r .= ") . . ".$y->userlink
;
1373 $r .= $y->usertalklink
;
1374 if ( $y->usercomment
!= "" )
1375 $r .= " <em>(".wfEscapeHTML($y->usercomment
).")</em>" ;
1380 function recentChangesBlockGroup ( $y ) {
1381 global $wgUploadPath ;
1384 $M = wfMsg( "minoreditletter" );
1385 $N = wfMsg( "newpageletter" );
1387 $userlinks = array () ;
1388 foreach ( $y AS $x ) {
1389 $oldid = $x->diffid
;
1390 if ( $x->isnew
) $isnew = true ;
1392 if ( !isset ( $userlinks[$u] ) ) $userlinks[$u] = 0 ;
1396 krsort ( $userlinks ) ;
1397 asort ( $userlinks ) ;
1399 $u = array_keys ( $userlinks ) ;
1400 foreach ( $u as $x ) {
1402 if ( $userlinks[$x] > 1 ) $z .= " ({$userlinks[$x]}×)" ;
1403 array_push ( $users , $z ) ;
1405 $users = " <font size='-1'>[".implode("; ",$users)."]</font>" ;
1408 $e = array_shift ( $e ) ;
1411 $rci = "RCI{$this->rccc}" ;
1412 $rcl = "RCL{$this->rccc}" ;
1413 $rcm = "RCM{$this->rccc}" ;
1414 $tl = "<a href='javascript:toggleVisibility(\"{$rci}\",\"{$rcm}\",\"{$rcl}\")'>" ;
1415 $tl .= "<span id='{$rcm}'><img src='{$wgUploadPath}/Arr_r.png' width=12 height=12 border=0></span>" ;
1416 $tl .= "<span id='{$rcl}' style='display:none'><img src='{$wgUploadPath}/Arr_d.png' width=12 height=12 border=0></span>" ;
1422 if ( $isnew ) $r .= $N ;
1423 else $r .= " " ;
1424 $r .= " " ; # Minor
1425 $r .= " ".$e->timestamp
." " ;
1429 if ( $e->watched
) $link = "<strong>{$link}</strong>" ;
1433 $r .= " (".count($y)." " ;
1434 if ( $isnew ) $r .= wfMsg("changes");
1435 else $r .= $this->makeKnownLink( $e->secureName
, wfMsg("changes") , "diff=0&oldid=".$oldid ) ;
1437 $r .= $this->makeKnownLink( $e->secureName
, wfMsg( "history" ), "action=history" );
1445 $r .= "<div id='{$rci}' style='display:none'>" ;
1446 foreach ( $y AS $x )
1448 $r .= "<img src='{$wgUploadPath}/Arr_.png' width=12 height=12 border=0>";
1449 $r .= "<tt> " ;
1450 if ( $x->isnew
) $r .= $N ;
1451 else $r .= " " ;
1452 if ( $x->isminor
) $r .= $M ;
1453 else $r .= " " ;
1457 if ( $x->oldid
!= 0 ) $o = "oldid=".$x->oldid
;
1458 if ( $x->islog
) $link = $x->timestamp
;
1459 else $link = $this->makeKnownLink( $x->secureName
, $x->timestamp
, $o ) ;
1460 $link = "<tt>{$link}</tt>" ;
1467 $r .= $x->lastlink
;
1468 $r .= ") . . ".$x->userlink
;
1469 $r .= $x->usertalklink
;
1470 if ( $x->usercomment
!= "" )
1471 $r .= " <em>(".wfEscapeHTML($x->usercomment
).")</em>" ;
1480 function recentChangesBlock ()
1482 global $wgUploadPath ;
1483 if ( count ( $this->rc_cache
) == 0 ) return "" ;
1484 $k = array_keys ( $this->rc_cache
) ;
1485 foreach ( $k AS $x )
1487 $y = $this->rc_cache
[$x] ;
1488 if ( count ( $y ) < 2 ) {
1489 $r .= $this->recentChangesBlockLine ( array_shift ( $y ) ) ;
1491 $r .= $this->recentChangesBlockGroup ( $y ) ;
1495 return "<div align=left>{$r}</div>" ;
1498 function recentChangesLine( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched = false, $oldid = 0 , $diffid = 0 )
1501 $usenew = $wgUser->getOption( "usenewrc" );
1503 $r = $this->recentChangesLineNew ( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched , $oldid , $diffid ) ;
1505 $r = $this->recentChangesLineOld ( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched , $oldid , $diffid ) ;
1509 function recentChangesLineOld( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched = false, $oldid = 0, $diffid = 0 )
1511 global $wgTitle, $wgLang, $wgUser;
1513 $d = $wgLang->date( $ts, true);
1515 if ( $d != $this->lastdate
) {
1516 if ( "" != $this->lastdate
) { $s .= "</ul>\n"; }
1517 $s .= "<h4>{$d}</h4>\n<ul>";
1518 $this->lastdate
= $d;
1520 $h = $wgLang->time( $ts, true );
1521 $t = Title
::makeName( $ns, $ttl );
1522 $clink = $this->makeKnownLink( $t , "" );
1523 $nt = Title
::newFromText( $t );
1526 $clink = "<strong>{$clink}</strong>";
1528 $hlink = $this->makeKnownLink( $t, wfMsg( "hist" ), "action=history" );
1529 if ( $isnew ||
$nt->isLog() ) {
1530 $dlink = wfMsg( "diff" );
1532 $dlink = $this->makeKnownLink( $t, wfMsg( "diff" ),
1533 "diff={$oldid}&oldid={$diffid}" ); # Finagle's law
1536 $ul = $this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
1537 $ut, "target=" . $ut );
1538 } else { $ul = $this->makeLink( $wgLang->getNsText(
1539 Namespace::getUser() ) . ":{$ut}", $ut ); }
1541 $utns=$wgLang->getNsText(Namespace::getTalk(Namespace::getUser()));
1542 $talkname=$wgLang->getNsText(Namespace::getTalk(0)); # use the shorter name
1543 $utl= $this->makeLink($utns . ":{$ut}", $talkname );
1544 $cr = wfMsg( "currentrev" );
1546 $s .= "<li> ({$dlink}) ({$hlink}) . .";
1547 $M = wfMsg( "minoreditletter" );
1548 $N = wfMsg( "newpageletter" );
1549 if ( $isminor ) { $s .= " <strong>{$M}</strong>"; }
1550 if ( $isnew ) { $s .= "<strong>{$N}</strong>"; }
1551 $s .= " {$clink}; {$h} . . {$ul}";
1554 if ( ( 0 == $u ) && $wgUser->isSysop() ) {
1555 $blink = $this->makeKnownLink( $wgLang->specialPage(
1556 "Blockip" ), wfMsg( "blocklink" ), "ip={$ut}" );
1562 $utl = "({$utl} | {$blink})";
1566 if ( "" != $c && "*" != $c ) {
1567 $s .= " <em>(" . wfEscapeHTML( $c ) . ")</em>";
1574 function recentChangesLineNew( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched = false, $oldid = 0 , $diffid = 0 )
1576 global $wgTitle, $wgLang, $wgUser;
1578 $rc = new RecentChangesClass
;
1580 $d = $wgLang->date( $ts, true);
1583 if ( $d != $this->lastdate
) {
1584 $ret = $this->recentChangesBlock () ;
1585 $this->rc_cache
= array() ;
1586 $ret .= "<h4>{$d}</h4>\n";
1587 $this->lastdate
= $d;
1589 $h = $wgLang->time( $ts, true );
1590 $t = Title
::makeName( $ns, $ttl );
1591 $clink = $this->makeKnownLink( $t, "" ) ;
1592 if ( $oldid == 0 ) $c2link = $clink ;
1593 else $c2link = $this->makeKnownLink( $t, "" , "oldid={$oldid}" );
1594 $nt = Title
::newFromText( $t );
1596 $rc->timestamp
= $h ;
1597 $rc->oldid
= $oldid ;
1598 $rc->diffid
= $diffid ;
1599 $rc->watched
= $watched ;
1600 $rc->isnew
= $isnew ;
1601 $rc->isminor
= $isminor ;
1602 $rc->secureName
= $t ;
1603 $rc->displayName
= $nt ;
1604 $rc->link
= $clink ;
1605 $rc->usercomment
= $c ;
1606 $rc->islog
= $nt->isLog() ;
1608 if ( ( $isnew && $oldid == 0 ) ||
$nt->isLog() ) {
1609 $dlink = wfMsg( "cur" );
1611 $dlink = $this->makeKnownLink( $t, wfMsg( "cur" ),
1612 "diff=0&oldid={$oldid}" );
1615 if ( $diffid == 0 ||
$nt->isLog() ) {
1616 $plink = wfMsg( "last" );
1618 $plink = $this->makeKnownLink( $t, wfMsg( "last" ),
1619 "diff={$oldid}&oldid={$diffid}" );
1623 $ul = $this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
1624 $ut, "target=" . $ut );
1625 } else { $ul = $this->makeLink( $wgLang->getNsText(
1626 Namespace::getUser() ) . ":{$ut}", $ut ); }
1628 $rc->userlink
= $ul ;
1629 $rc->lastlink
= $plink ;
1630 $rc->curlink
= $dlink ;
1632 $utns=$wgLang->getNsText(Namespace::getTalk(Namespace::getUser()));
1633 $talkname=$wgLang->getNsText(Namespace::getTalk(0)); # use the shorter name
1634 $utl= $this->makeLink($utns . ":{$ut}", $talkname );
1636 if ( ( 0 == $u ) && $wgUser->isSysop() ) {
1637 $blink = $this->makeKnownLink( $wgLang->specialPage(
1638 "Blockip" ), wfMsg( "blocklink" ), "ip={$ut}" );
1639 $rc->usertalklink
= " ({$utl} | {$blink})";
1641 $rc->usertalklink
=" ({$utl})";
1644 if ( !isset ( $this->rc_cache
[$t] ) ) $this->rc_cache
[$t] = array() ;
1645 array_push ( $this->rc_cache
[$t] , $rc ) ;
1650 function imageHistoryLine( $iscur, $ts, $img, $u, $ut, $size, $c )
1652 global $wgUser, $wgLang, $wgTitle;
1654 $dt = $wgLang->timeanddate( $ts, true );
1655 $del = wfMsg( "deleteimg" );
1656 $cur = wfMsg( "cur" );
1659 $url = wfImageUrl( $img );
1661 if ( $wgUser->isSysop() ) {
1662 $link = wfLocalUrlE( "", "image=" . $wgTitle->getURL() .
1664 $style = $this->getInternalLinkAttributes( $link, $del );
1666 $dlink = "<a href=\"{$link}\"{$style}>{$del}</a>";
1671 $url = wfEscapeHTML( wfImageArchiveUrl( $img ) );
1672 if( $wgUser->getID() != 0 ) {
1673 $rlink = $this->makeKnownLink( $wgTitle->getPrefixedText(),
1674 wfMsg( "revertimg" ), "action=revert&oldimage=" .
1675 urlencode( $img ) );
1676 $dlink = $this->makeKnownLink( $wgTitle->getPrefixedText(),
1677 $del, "action=delete&oldimage=" . urlencode( $img ) );
1679 # Having live active links for non-logged in users
1680 # means that bots and spiders crawling our site can
1681 # inadvertently change content. Baaaad idea.
1682 $rlink = wfMsg( "revertimg" );
1686 if ( 0 == $u ) { $ul = $ut; }
1687 else { $ul = $this->makeLink( $wgLang->getNsText(
1688 Namespace::getUser() ) . ":{$ut}", $ut ); }
1690 $nb = str_replace( "$1", $size, wfMsg( "nbytes" ) );
1691 $style = $this->getInternalLinkAttributes( $url, $dt );
1693 $s = "<li> ({$dlink}) ({$rlink}) <a href=\"{$url}\"{$style}>{$dt}</a>"
1694 . " . . {$ul} ({$nb})";
1696 if ( "" != $c && "*" != $c ) {
1697 $s .= " <em>(" . wfEscapeHTML( $c ) . ")</em>";
1703 function tocIndent($level) {
1705 while($level-->0) $rv.="<div style=\"margin-left:2em;\">\n";
1710 function tocUnindent($level) {
1711 while($level-->0) $rv.="</div>\n";
1715 // parameter level defines if we are on an indentation level
1716 function tocLine($anchor,$tocline,$level) {
1720 return "<A CLASS=\"internal\" HREF=\"#".$anchor."\">".$tocline."</A><BR>\n";
1723 return "<div style=\"margin-bottom:0px;\">\n".
1724 "<A CLASS=\"internal\" HREF=\"#".$anchor."\">".$tocline."</A><BR>\n".
1730 function tocTable($toc) {
1731 // note to CSS fanatics: putting this in a div does not work -- div won't auto-expand
1735 $hideline = " <script type='text/javascript'>showTocToggle(\"" . wfMsg("showtoc") . "\",\"" . wfMsg("hidetoc") . "\")</script>";
1738 "<p><table border=\"0\" id=\"toc\"><tr><td align=\"center\">\n".
1739 "<b>".wfMsg("toc")."</b>" .
1741 "</td></tr><tr id='tocinside'><td align=\"left\">\n".
1742 $toc."</td></tr></table><P>\n";
1745 # These two do not check for permissions: check $wgTitle->userCanEdit before calling them
1746 function editSectionScript($section,$head) {
1748 global $wgTitle,$wgUser,$oldid;
1749 if($oldid) return $head;
1750 $url = wfLocalUrlE(urlencode($wgTitle->getPrefixedText()),"action=edit§ion=$section");
1751 return "<span onContextMenu='document.location=\"".$url."\";return false;'>{$head}</span>";
1754 function editSectionLink($section) {
1757 global $wgTitle,$wgUser,$oldid;
1758 if($oldid) return "";
1759 if ($printable) return "";
1760 $editurl="§ion={$section}";
1761 $url=$this->makeKnownLink($wgTitle->getPrefixedText(),wfMsg("editsection"),"action=edit".$editurl);
1762 return "<div style=\"float:right;margin-left:5px;\"><small>[".$url."]</small></div>";
1767 include_once( "SkinStandard.php" );
1768 include_once( "SkinNostalgia.php" );
1769 include_once( "SkinCologneBlue.php" );