ed971e4417885d8a062e839e76ef6e99bb96fd14
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;
282 if ( $wgOut->isPrintable() ) {
285 $u = $wgServer . $wgTitle->getFullURL();
286 $rf = wfMsg( "retrievedfrom", $u );
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>";
370 if( $wgUser->isSysop() &&
371 ($n = $wgTitle->isDeleted() ) ) {
372 $s .= " | " . wfMsg( "thisisdeleted",
373 $this->makeKnownLink(
374 $wgLang->SpecialPage( "Undelete/" . $wgTitle->getPrefixedDBkey() ),
375 wfMsg( "restorelink", $n ) ) );
380 function printableLink()
382 global $wgOut, $wgTitle, $oldid, $action;
384 if ( "history" == $action ) { $q = "action=history&"; }
387 $s = $this->makeKnownLink( $wgTitle->getPrefixedText(),
388 WfMsg( "printableversion" ), "{$q}printable=yes" );
394 global $wgOut, $wgTitle, $wgUser;
396 $s = "<h1 class='pagetitle'>" . $wgOut->getPageTitle() . "</h1>";
397 if($wgUser->getOption("editsectiononrightclick") && $wgTitle->userCanEdit()) { $s=$this->editSectionScript(0,$s);}
401 function pageSubtitle()
403 global $wgOut,$wgTitle,$wgNamespacesWithSubpages;
405 $sub = $wgOut->getSubtitle();
406 if ( "" == $sub ) { $sub = wfMsg( "fromwikipedia" ); }
407 if($wgOut->isArticle() && $wgNamespacesWithSubpages[$wgTitle->getNamespace()]) {
408 $ptext=$wgTitle->getPrefixedText();
409 if(preg_match("/\//",$ptext)) {
410 $sub.="</p><p class='subpages'>";
411 $links=explode("/",$ptext);
414 foreach($links as $link) {
416 if ($c<count($links)) {
418 $getlink=$this->makeLink($growinglink,$link);
419 if(preg_match("/class='new'/i",$getlink)) { break; } # this is a hack, but it saves time
432 $s = "<p class='subtitle'>{$sub}\n";
436 function nameAndLogin()
438 global $wgUser, $wgTitle, $wgLang, $wgShowIPinHeader;
440 $li = $wgLang->specialPage( "Userlogin" );
441 $lo = $wgLang->specialPage( "Userlogout" );
444 if ( 0 == $wgUser->getID() ) {
445 if( $wgShowIPinHeader ) {
446 $n = getenv( "REMOTE_ADDR" );
448 $tl = $this->makeKnownLink( $wgLang->getNsText(
449 Namespace::getTalk( Namespace::getUser() ) ) . ":{$n}",
450 $wgLang->getNsText( Namespace::getTalk( 0 ) ) );
452 $s .= $n . " (".$tl.")";
454 $s .= wfMsg("notloggedin");
457 $rt = $wgTitle->getPrefixedURL();
458 if ( 0 == strcasecmp( urlencode( $lo ), $rt ) ) {
460 } else { $q = "returnto={$rt}"; }
462 $s .= "\n<br>" . $this->makeKnownLink( $li,
463 wfMsg( "login" ), $q );
465 $n = $wgUser->getName();
466 $rt = $wgTitle->getPrefixedURL();
467 $tl = $this->makeKnownLink( $wgLang->getNsText(
468 Namespace::getTalk( Namespace::getUser() ) ) . ":{$n}",
469 $wgLang->getNsText( Namespace::getTalk( 0 ) ) );
473 $s .= $this->makeKnownLink( $wgLang->getNsText(
474 Namespace::getUser() ) . ":{$n}", $n ) . "{$tl}<br>" .
475 $this->makeKnownLink( $lo, wfMsg( "logout" ),
476 "returnto={$rt}" ) . " | " .
477 $this->specialLink( "preferences" );
479 $s .= " | " . $this->makeKnownLink( wfMsg( "helppage" ),
485 function searchForm()
489 $s = "<form name='search' class='inline' method=get action=\""
490 . wfLocalUrl( "" ) . "\">"
491 . "<input type=text name=\"search\" size=19 value=\""
492 . htmlspecialchars(substr($search,0,256)) . "\">\n"
493 . "<input type=submit name=\"go\" value=\"" . wfMsg ("go") . "\"> "
494 . "<input type=submit value=\"" . wfMsg ("search") . "\"></form>";
504 $s = $this->mainPageLink() . $sep
505 . $this->specialLink( "recentchanges" );
507 if ( $wgOut->isArticle() ) {
508 $s .= $sep . $this->editThisPage()
509 . $sep . $this->historyLink();
511 # Many people don't like this dropdown box
512 #$s .= $sep . $this->specialPagesList();
517 function bottomLinks()
519 global $wgOut, $wgUser, $wgTitle;
523 if ( $wgOut->isArticle() ) {
524 $s .= "<strong>" . $this->editThisPage() . "</strong>";
525 if ( 0 != $wgUser->getID() ) {
526 $s .= $sep . $this->watchThisPage();
528 $s .= $sep . $this->talkLink()
529 . $sep . $this->historyLink()
530 . $sep . $this->whatLinksHere()
531 . $sep . $this->watchPageLinksLink();
533 if ( $wgTitle->getNamespace() == Namespace::getUser()
534 ||
$wgTitle->getNamespace() == Namespace::getTalk(Namespace::getUser()) )
537 $id=User
::idFromName($wgTitle->getText());
538 $ip=User
::isIP($wgTitle->getText());
540 if($id ||
$ip) { # both anons and non-anons have contri list
541 $s .= $sep . $this->userContribsLink();
543 if ( 0 != $wgUser->getID() ) { # show only to signed in users
544 if($id) { # can only email non-anons
545 $s .= $sep . $this->emailUserLink();
549 if ( $wgUser->isSysop() && $wgTitle->getArticleId() ) {
550 $s .= "\n<br>" . $this->deleteThisPage() .
551 $sep . $this->protectThisPage() .
552 $sep . $this->moveThisPage();
554 $s .= "<br>\n" . $this->otherLanguages();
561 global $wgOut, $wgLang, $wgArticle;
562 global $oldid, $diff, $wgDisableCounters;
564 if ( ! $wgOut->isArticle() ) { return ""; }
565 if ( isset( $oldid ) ||
isset( $diff ) ) { return ""; }
566 if ( 0 == $wgArticle->getID() ) { return ""; }
568 if ( $wgDisableCounters ) {
571 $count = $wgArticle->getCount();
572 $s = str_replace( "$1", $count, wfMsg( "viewcount" ) );
574 $s .= $this->lastModified();
575 $s .= " " . wfMsg( "gnunote" );
576 return "<span id='pagestats'>{$s}</span>";
579 function lastModified()
581 global $wgLang, $wgArticle;
583 $d = $wgLang->timeanddate( $wgArticle->getTimestamp(), true );
584 $s = " " . str_replace( "$1", $d, wfMsg( "lastmodified" ) );
588 function logoText( $align = "" )
590 if ( "" != $align ) { $a = " align='{$align}'"; }
593 $mp = wfMsg( "mainpage" );
594 $s = "<a href=\"" . wfLocalUrlE( $mp ) . "\"><img{$a} border=0 src=\""
595 . $this->getLogo() . "\" alt=\"" . "[{$mp}]\"></a>";
601 global $wgOut, $wgTitle, $wgUser, $action, $wgLang;
603 wfProfileIn( "Skin::quickBar" );
604 $tns=$wgTitle->getNamespace();
606 $s = "\n<div id='quickbar'>";
607 $s .= "\n" . $this->logoText() . "\n<hr class='sep'>";
610 $s .= $this->mainPageLink()
611 . $sep . $this->specialLink( "recentchanges" )
612 . $sep . $this->specialLink( "randompage" );
613 if ($wgUser->getID()) {
614 $s.= $sep . $this->specialLink( "watchlist" ) ;
615 $s .= $sep .$this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
616 wfMsg( "mycontris" ), "target=" . wfUrlencode($wgUser->getName() ) );
619 // only show watchlist link if logged in
620 if ( wfMsg ( "currentevents" ) != "-" ) $s .= $sep . $this->makeKnownLink( wfMsg( "currentevents" ), "" ) ;
621 $s .= "\n<br><hr class='sep'>";
622 $articleExists = $wgTitle->getArticleId();
623 if ( $wgOut->isArticle() ||
$action =="edit" ||
$action =="history" ||
$wpPreview) {
625 if($wgOut->isArticle()) {
626 $s .= "<strong>" . $this->editThisPage() . "</strong>";
627 } else { # backlink to the article in edit or history mode
628 if($articleExists){ # no backlink if no article
631 $text = wfMsg("articlepage");
634 $text = wfMsg("viewtalkpage");
637 $text = wfMsg("userpage");
640 $text = wfMsg("viewtalkpage");
643 $text = wfMsg("wikipediapage");
646 $text = wfMsg("viewtalkpage");
649 $text = wfMsg("imagepage");
652 $text = wfMsg("viewtalkpage");
655 $text= wfMsg("articlepage");
658 $link = $wgTitle->getText();
659 if ($nstext = $wgLang->getNsText($tns) ) { # add namespace if necessary
660 $link = $nstext . ":" . $link ;
662 $s .= $this->makeLink($link, $text );
663 } elseif( $wgTitle->getNamespace() != Namespace::getSpecial() ) {
664 # we just throw in a "New page" text to tell the user that he's in edit mode,
665 # and to avoid messing with the separator that is prepended to the next item
666 $s .= "<strong>" . wfMsg("newpage") . "</strong>";
672 if( $tns%2
&& $action!="edit" && !$wpPreview) {
673 $s.="<br>".$this->makeKnownLink($wgTitle->getPrefixedText(),wfMsg("postcomment"),"action=edit§ion=new");
677 watching could cause problems in edit mode:
678 if user edits article, then loads "watch this article" in background and then saves
679 article with "Watch this article" checkbox disabled, the article is transparently
680 unwatched. Therefore we do not show the "Watch this page" link in edit mode
682 if ( 0 != $wgUser->getID() && $articleExists) {
683 if($action!="edit" && $action!="history" &&
684 $action != "submit" )
685 {$s .= $sep . $this->watchThisPage(); }
686 if ( $wgTitle->userCanEdit() ) $s .= $sep . $this->moveThisPage();
688 if ( $wgUser->isSysop() and $articleExists ) {
689 $s .= $sep . $this->deleteThisPage() .
690 $sep . $this->protectThisPage();
692 $s .= $sep . $this->talkLink();
693 if ($articleExists && $action !="history") { $s .= $sep . $this->historyLink();}
694 $s.=$sep . $this->whatLinksHere();
696 if($wgOut->isArticle()) {
697 $s .= $sep . $this->watchPageLinksLink();
700 if ( Namespace::getUser() == $wgTitle->getNamespace()
701 ||
$wgTitle->getNamespace() == Namespace::getTalk(Namespace::getUser())
704 $id=User
::idFromName($wgTitle->getText());
705 $ip=User
::isIP($wgTitle->getText());
708 $s .= $sep . $this->userContribsLink();
710 if ( 0 != $wgUser->getID() ) {
711 if($id) { # can only email real users
712 $s .= $sep . $this->emailUserLink();
716 $s .= "\n<br><hr class='sep'>";
719 if ( 0 != $wgUser->getID() ) {
720 $s .= $this->specialLink( "upload" ) . $sep;
722 $s .= $this->specialLink( "specialpages" )
723 . $sep . $this->bugReportsLink();
725 $s .= "\n<br></div>\n";
730 function specialPagesList()
732 global $wgUser, $wgOut, $wgLang, $wgServer, $wgRedirectScript;
735 $validSP = $wgLang->getValidSpecialPages();
737 foreach ( $validSP as $name => $desc ) {
738 if ( "" == $desc ) { continue; }
741 if ( $wgUser->isSysop() )
743 $sysopSP = $wgLang->getSysopSpecialPages();
745 foreach ( $sysopSP as $name => $desc ) {
746 if ( "" == $desc ) { continue; }
750 if ( $wgUser->isDeveloper() )
752 $devSP = $wgLang->getDeveloperSpecialPages();
754 foreach ( $devSP as $name => $desc ) {
755 if ( "" == $desc ) { continue; }
760 $sp = wfMsg( "specialpages" );
761 $spp = $wgLang->specialPage( "Specialpages" );
763 $s = "<form id=\"specialpages\" method=\"get\" class=\"inline\" " .
764 "action=\"{$wgServer}{$wgRedirectScript}\">\n";
765 $s .= "<select name=\"wpDropdown\">\n";
766 $s .= "<option value=\"{$spp}\">{$sp}</option>\n";
768 foreach ( $a as $name => $desc ) {
769 $p = $wgLang->specialPage( $name );
770 $s .= "<option value=\"{$p}\">{$desc}</option>\n";
773 $s .= "<input type=submit value=\"{$go}\" name=redirect>\n";
778 function mainPageLink()
780 $mp = wfMsg( "mainpage" );
781 $s = $this->makeKnownLink( $mp, $mp );
785 function copyrightLink()
787 $s = $this->makeKnownLink( wfMsg( "copyrightpage" ),
788 wfMsg( "copyrightpagename" ) );
794 $s = $this->makeKnownLink( wfMsg( "aboutpage" ),
795 wfMsg( "aboutwikipedia" ) );
799 function editThisPage()
801 global $wgOut, $wgTitle, $oldid, $redirect, $diff;
803 if ( ! $wgOut->isArticle() ||
$diff ) {
804 $s = wfMsg( "protectedpage" );
805 } else if ( $wgTitle->userCanEdit() ) {
806 $n = $wgTitle->getPrefixedText();
807 $t = wfMsg( "editthispage" );
810 if ( $redirect ) { $red = "&redirect={$redirect}"; }
811 if ( $oldid && ! isset( $diff ) ) {
812 $oid = "&oldid={$oldid}";
814 $s = $this->makeKnownLink( $n, $t, "action=edit{$oid}{$red}" );
816 $s = wfMsg( "protectedpage" );
821 function deleteThisPage()
823 global $wgUser, $wgOut, $wgTitle, $diff;
825 if ( $wgTitle->getArticleId() && ( ! $diff ) && $wgUser->isSysop() ) {
826 $n = $wgTitle->getPrefixedText();
827 $t = wfMsg( "deletethispage" );
829 $s = $this->makeKnownLink( $n, $t, "action=delete" );
831 $s = wfMsg( "error" );
836 function protectThisPage()
838 global $wgUser, $wgOut, $wgTitle, $diff;
840 if ( $wgTitle->getArticleId() && ( ! $diff ) && $wgUser->isSysop() ) {
841 $n = $wgTitle->getPrefixedText();
843 if ( $wgTitle->isProtected() ) {
844 $t = wfMsg( "unprotectthispage" );
845 $q = "action=unprotect";
847 $t = wfMsg( "protectthispage" );
848 $q = "action=protect";
850 $s = $this->makeKnownLink( $n, $t, $q );
852 $s = wfMsg( "error" );
857 function watchThisPage()
859 global $wgUser, $wgOut, $wgTitle, $diff;
861 if ( $wgOut->isArticle() && ( ! $diff ) ) {
862 $n = $wgTitle->getPrefixedText();
864 if ( $wgTitle->userIsWatching() ) {
865 $t = wfMsg( "unwatchthispage" );
866 $q = "action=unwatch";
868 $t = wfMsg( "watchthispage" );
871 $s = $this->makeKnownLink( $n, $t, $q );
873 $s = wfMsg( "notanarticle" );
878 function moveThisPage()
880 global $wgTitle, $wgLang;
882 if ( $wgTitle->userCanEdit() ) {
883 $s = $this->makeKnownLink( $wgLang->specialPage( "Movepage" ),
884 wfMsg( "movethispage" ), "target=" . $wgTitle->getPrefixedURL() );
885 } // no message if page is protected - would be redundant
889 function historyLink()
893 $s = $this->makeKnownLink( $wgTitle->getPrefixedText(),
894 wfMsg( "history" ), "action=history" );
898 function whatLinksHere()
900 global $wgTitle, $wgLang;
902 $s = $this->makeKnownLink( $wgLang->specialPage( "Whatlinkshere" ),
903 wfMsg( "whatlinkshere" ), "target=" . $wgTitle->getPrefixedURL() );
907 function userContribsLink()
909 global $wgTitle, $wgLang;
911 $s = $this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
912 wfMsg( "contributions" ), "target=" . $wgTitle->getURL() );
916 function emailUserLink()
918 global $wgTitle, $wgLang;
920 $s = $this->makeKnownLink( $wgLang->specialPage( "Emailuser" ),
921 wfMsg( "emailuser" ), "target=" . $wgTitle->getURL() );
925 function watchPageLinksLink()
927 global $wgOut, $wgTitle, $wgLang;
929 if ( ! $wgOut->isArticle() ) {
930 $s = "(" . wfMsg( "notanarticle" ) . ")";
932 $s = $this->makeKnownLink( $wgLang->specialPage(
933 "Recentchangeslinked" ), wfMsg( "recentchangeslinked" ),
934 "target=" . $wgTitle->getPrefixedURL() );
939 function otherLanguages()
941 global $wgOut, $wgLang, $wgTitle , $wgUseNewInterlanguage ;
943 $a = $wgOut->getLanguageLinks();
944 if ( 0 == count( $a ) ) {
945 if ( !$wgUseNewInterlanguage ) return "";
946 $ns = $wgLang->getNsIndex ( $wgTitle->getNamespace () ) ;
947 if ( $ns != 0 AND $ns != 1 ) return "" ;
949 $x = "mode=addlink&xt=".$wgTitle->getDBkey() ;
950 return $this->makeKnownLink( $wgLang->specialPage( $pn ),
951 wfMsg( "intl" ) , $x );
954 if ( !$wgUseNewInterlanguage ) {
955 $s = wfMsg( "otherlanguages" ) . ": ";
957 global $wgLanguageCode ;
958 $x = "mode=zoom&xt=".$wgTitle->getDBkey() ;
959 $x .= "&xl=".$wgLanguageCode ;
960 $s = $this->makeKnownLink( $wgLang->specialPage( "Intl" ),
961 wfMsg( "otherlanguages" ) , $x ) . ": " ;
965 if($wgLang->isRTL()) $s .= "<span dir='LTR'>";
966 foreach( $a as $l ) {
967 if ( ! $first ) { $s .= " | "; }
970 $nt = Title
::newFromText( $l );
971 $url = $nt->getFullURL();
972 $text = $wgLang->getLanguageName( $nt->getInterwiki() );
974 if ( "" == $text ) { $text = $l; }
975 $style = $this->getExternalLinkAttributes( $l, $text );
976 $s .= "<a href=\"{$url}\"{$style}>{$text}</a>";
978 if($wgLang->isRTL()) $s .= "</span>";
982 function bugReportsLink()
984 $s = $this->makeKnownLink( wfMsg( "bugreportspage" ),
985 wfMsg( "bugreports" ) );
992 $t1 = Title
::newFromText( gmdate( "F j" ) );
993 $t2 = Title
::newFromText( gmdate( "Y" ) );
995 $wgLinkCache->suspend();
996 $id = $t1->getArticleID();
997 $wgLinkCache->resume();
1000 $s = $this->makeBrokenLink( $t1->getText() );
1002 $s = $this->makeKnownLink( $t1->getText() );
1006 $wgLinkCache->suspend();
1007 $id = $t2->getArticleID();
1008 $wgLinkCache->resume();
1011 $s .= $this->makeBrokenLink( $t2->getText() );
1013 $s .= $this->makeKnownLink( $t2->getText() );
1020 global $wgLang, $wgTitle, $wgLinkCache;
1022 $tns = $wgTitle->getNamespace();
1023 if ( -1 == $tns ) { return ""; }
1025 $pn = $wgTitle->getText();
1026 $tp = wfMsg( "talkpage" );
1027 if ( Namespace::isTalk( $tns ) ) {
1028 $lns = Namespace::getSubject( $tns );
1031 $text = wfMsg("articlepage");
1034 $text = wfMsg("userpage");
1037 $text = wfMsg("wikipediapage");
1040 $text = wfMsg("imagepage");
1043 $text= wfMsg("articlepage");
1047 $lns = Namespace::getTalk( $tns );
1050 $n = $wgLang->getNsText( $lns );
1051 if ( "" == $n ) { $link = $pn; }
1052 else { $link = "{$n}:{$pn}"; }
1054 $wgLinkCache->suspend();
1055 $s = $this->makeLink( $link, $text );
1056 $wgLinkCache->resume();
1061 # After all the page content is transformed into HTML, it makes
1062 # a final pass through here for things like table backgrounds.
1064 function transformContent( $text )
1069 # Note: This function MUST call getArticleID() on the link,
1070 # otherwise the cache won't get updated properly. See LINKCACHE.DOC.
1072 function makeLink( $title, $text= "", $query = "", $trail = "" )
1074 global $wgOut, $wgUser;
1076 $nt = Title
::newFromText( $title );
1078 if ( $nt->isExternal() ) {
1079 $u = $nt->getFullURL();
1080 if ( "" == $text ) { $text = $nt->getPrefixedText(); }
1081 $style = $this->getExternalLinkAttributes( $link, $text );
1084 if ( "" != $trail ) {
1085 if ( preg_match( "/^([a-z]+)(.*)$$/sD", $trail, $m ) ) {
1090 return "<a href=\"{$u}\"{$style}>{$text}{$inside}</a>{$trail}";
1092 if ( 0 == $nt->getNamespace() && "" == $nt->getText() ) {
1093 return $this->makeKnownLink( $title, $text, $query, $trail );
1095 if ( ( -1 == $nt->getNamespace() ) ||
1096 ( Namespace::getImage() == $nt->getNamespace() ) ) {
1097 return $this->makeKnownLink( $title, $text, $query, $trail );
1099 $aid = $nt->getArticleID() ;
1101 return $this->makeBrokenLink( $title, $text, $query, $trail );
1103 $threshold = $wgUser->getOption("stubthreshold") ;
1104 if ( $threshold > 0 ) {
1105 $res = wfQuery ( "SELECT HIGH_PRIORITY length(cur_text) AS x, cur_namespace, cur_is_redirect FROM cur WHERE cur_id='{$aid}'" ) ;
1107 if ( wfNumRows( $res ) > 0 ) {
1108 $s = wfFetchObject( $res );
1110 if ( $s->cur_is_redirect
OR $s->cur_namespace
!= 0 )
1111 $size = $threshold*2 ; # Really big
1112 wfFreeResult( $res );
1113 } else $size = $threshold*2 ; # Really big
1116 if ( $size < $threshold )
1117 return $this->makeStubLink( $title, $text, $query, $trail );
1118 return $this->makeKnownLink( $title, $text, $query, $trail );
1122 function makeKnownLink( $title, $text = "", $query = "", $trail = "" )
1124 global $wgOut, $wgTitle;
1126 $nt = Title
::newFromText( $title );
1127 $link = $nt->getPrefixedURL();
1129 if ( "" == $link ) {
1131 if ( "" == $text ) { $text = $nt->getFragment(); }
1133 $u = wfLocalUrlE( $link, $query );
1135 if ( "" != $nt->getFragment() ) {
1136 $u .= "#" . wfEscapeHTML( $nt->getFragment() );
1138 if ( "" == $text ) { $text = $nt->getPrefixedText(); }
1139 $style = $this->getInternalLinkAttributes( $link, $text );
1142 if ( "" != $trail ) {
1143 if ( preg_match( wfMsg("linktrail"), $trail, $m ) ) {
1148 $r = "<a href=\"{$u}\"{$style}>{$text}{$inside}</a>{$trail}";
1152 function makeBrokenLink( $title, $text = "", $query = "", $trail = "" )
1154 global $wgOut, $wgUser;
1156 $nt = Title
::newFromText( $title );
1157 $link = $nt->getPrefixedURL();
1159 if ( "" == $query ) { $q = "action=edit"; }
1160 else { $q = "action=edit&{$query}"; }
1161 $u = wfLocalUrlE( $link, $q );
1163 if ( "" == $text ) { $text = $nt->getPrefixedText(); }
1164 $style = $this->getInternalLinkAttributes( $link, $text, "yes" );
1167 if ( "" != $trail ) {
1168 if ( preg_match( wfMsg("linktrail"), $trail, $m ) ) {
1173 if ( $wgOut->isPrintable() ||
1174 ( 1 == $wgUser->getOption( "highlightbroken" ) ) ) {
1175 $s = "<a href=\"{$u}\"{$style}>{$text}{$inside}</a>{$trail}";
1177 $s = "{$text}{$inside}<a href=\"{$u}\"{$style}>?</a>{$trail}";
1182 function makeStubLink( $title, $text = "", $query = "", $trail = "" )
1184 global $wgOut, $wgUser;
1186 $nt = Title
::newFromText( $title );
1187 $link = $nt->getPrefixedURL();
1189 $u = wfLocalUrlE( $link, $query );
1191 if ( "" == $text ) { $text = $nt->getPrefixedText(); }
1192 $style = $this->getInternalLinkAttributes( $link, $text, "stub" );
1195 if ( "" != $trail ) {
1196 if ( preg_match( wfMsg("linktrail"), $trail, $m ) ) {
1201 if ( $wgOut->isPrintable() ||
1202 ( 1 == $wgUser->getOption( "highlightbroken" ) ) ) {
1203 $s = "<a href=\"{$u}\"{$style}>{$text}{$inside}</a>{$trail}";
1205 $s = "{$text}{$inside}<a href=\"{$u}\"{$style}>!</a>{$trail}";
1210 function fnamePart( $url )
1212 $basename = strrchr( $url, "/" );
1213 if ( false === $basename ) { $basename = $url; }
1214 else { $basename = substr( $basename, 1 ); }
1215 return wfEscapeHTML( $basename );
1218 function makeImage( $url, $alt = "" )
1222 if ( "" == $alt ) { $alt = $this->fnamePart( $url ); }
1223 $s = "<img src=\"{$url}\" alt=\"{$alt}\">";
1227 function makeImageLink( $name, $url, $alt = "" )
1229 global $wgOut, $wgTitle, $wgLang;
1231 $nt = Title
::newFromText( $wgLang->getNsText(
1232 Namespace::getImage() ) . ":{$name}" );
1233 $link = $nt->getPrefixedURL();
1234 if ( "" == $alt ) { $alt = $name; }
1236 $u = wfLocalUrlE( $link );
1237 $s = "<a href=\"{$u}\" class='image' title=\"{$alt}\">" .
1238 "<img border=0 src=\"{$url}\" alt=\"{$alt}\"></a>";
1242 function makeMediaLink( $name, $url, $alt = "" )
1244 global $wgOut, $wgTitle;
1246 if ( "" == $alt ) { $alt = $name; }
1247 $u = wfEscapeHTML( $url );
1248 $s = "<a href=\"{$u}\" class='internal' title=\"{$alt}\">{$alt}</a>";
1252 function specialLink( $name, $key = "" )
1256 if ( "" == $key ) { $key = strtolower( $name ); }
1257 $pn = $wgLang->ucfirst( $name );
1258 return $this->makeKnownLink( $wgLang->specialPage( $pn ),
1262 # Called by history lists and recent changes
1265 function beginRecentChangesList()
1267 $rc_cache = array() ;
1269 $this->lastdate
= "";
1273 function beginHistoryList()
1275 $this->lastdate
= $this->lastline
= "";
1276 $s = "\n<p>" . wfMsg( "histlegend" ) . "\n<ul>";
1280 function beginImageHistoryList()
1282 $s = "\n<h2>" . wfMsg( "imghistory" ) . "</h2>\n" .
1283 "<p>" . wfMsg( "imghistlegend" ) . "\n<ul>";
1287 function endRecentChangesList()
1289 $s = $this->recentChangesBlock() ;
1294 function endHistoryList()
1296 $last = wfMsg( "last" );
1298 $s = preg_replace( "/!OLDID![0-9]+!/", $last, $this->lastline
);
1303 function endImageHistoryList()
1309 function historyLine( $ts, $u, $ut, $ns, $ttl, $oid, $c, $isminor )
1313 $artname = Title
::makeName( $ns, $ttl );
1314 $last = wfMsg( "last" );
1315 $cur = wfMsg( "cur" );
1316 $cr = wfMsg( "currentrev" );
1318 if ( $oid && $this->lastline
) {
1319 $ret = preg_replace( "/!OLDID!([0-9]+)!/", $this->makeKnownLink(
1320 $artname, $last, "diff=\\1&oldid={$oid}" ), $this->lastline
);
1324 $dt = $wgLang->timeanddate( $ts, true );
1326 if ( $oid ) { $q = "oldid={$oid}"; }
1328 $link = $this->makeKnownLink( $artname, $dt, $q );
1331 $ul = $this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
1332 $ut, "target=" . $ut );
1333 } else { $ul = $this->makeLink( $wgLang->getNsText(
1334 Namespace::getUser() ) . ":{$ut}", $ut ); }
1338 $curlink = $this->makeKnownLink( $artname, $cur,
1339 "diff=0&oldid={$oid}" );
1343 $s .= "({$curlink}) (!OLDID!{$oid}!) . .";
1345 $M = wfMsg( "minoreditletter" );
1346 if ( $isminor ) { $s .= " <strong>{$M}</strong>"; }
1347 $s .= " {$link} . . {$ul}";
1349 if ( "" != $c && "*" != $c ) { $s .= " <em>(" . wfEscapeHTML($c) . ")</em>"; }
1352 $this->lastline
= $s;
1356 function recentChangesBlockLine ( $y ) {
1357 global $wgUploadPath ;
1359 $M = wfMsg( "minoreditletter" );
1360 $N = wfMsg( "newpageletter" );
1362 $r .= "<img src='{$wgUploadPath}/Arr_.png' width=12 height=12 border=0>" ;
1364 if ( $y->isnew
) $r .= $N ;
1365 else $r .= " " ;
1366 if ( $y->isminor
) $r .= $M ;
1367 else $r .= " " ;
1368 $r .= " ".$y->timestamp
." " ;
1371 if ( $y->watched
) $link = "<strong>{$link}</strong>" ;
1377 $r .= $this->makeKnownLink( $y->secureName
, wfMsg( "hist" ), "action=history" );
1379 $r .= ") . . ".$y->userlink
;
1380 $r .= $y->usertalklink
;
1381 if ( $y->usercomment
!= "" )
1382 $r .= " <em>(".wfEscapeHTML($y->usercomment
).")</em>" ;
1387 function recentChangesBlockGroup ( $y ) {
1388 global $wgUploadPath ;
1391 $M = wfMsg( "minoreditletter" );
1392 $N = wfMsg( "newpageletter" );
1394 $userlinks = array () ;
1395 foreach ( $y AS $x ) {
1396 $oldid = $x->diffid
;
1397 if ( $x->isnew
) $isnew = true ;
1399 if ( !isset ( $userlinks[$u] ) ) $userlinks[$u] = 0 ;
1403 krsort ( $userlinks ) ;
1404 asort ( $userlinks ) ;
1406 $u = array_keys ( $userlinks ) ;
1407 foreach ( $u as $x ) {
1409 if ( $userlinks[$x] > 1 ) $z .= " ({$userlinks[$x]}×)" ;
1410 array_push ( $users , $z ) ;
1412 $users = " <font size='-1'>[".implode("; ",$users)."]</font>" ;
1415 $e = array_shift ( $e ) ;
1418 $rci = "RCI{$this->rccc}" ;
1419 $rcl = "RCL{$this->rccc}" ;
1420 $rcm = "RCM{$this->rccc}" ;
1421 $tl = "<a href='javascript:toggleVisibility(\"{$rci}\",\"{$rcm}\",\"{$rcl}\")'>" ;
1422 $tl .= "<span id='{$rcm}'><img src='{$wgUploadPath}/Arr_r.png' width=12 height=12 border=0></span>" ;
1423 $tl .= "<span id='{$rcl}' style='display:none'><img src='{$wgUploadPath}/Arr_d.png' width=12 height=12 border=0></span>" ;
1429 if ( $isnew ) $r .= $N ;
1430 else $r .= " " ;
1431 $r .= " " ; # Minor
1432 $r .= " ".$e->timestamp
." " ;
1436 if ( $e->watched
) $link = "<strong>{$link}</strong>" ;
1440 $r .= " (".count($y)." " ;
1441 if ( $isnew ) $r .= wfMsg("changes");
1442 else $r .= $this->makeKnownLink( $e->secureName
, wfMsg("changes") , "diff=0&oldid=".$oldid ) ;
1444 $r .= $this->makeKnownLink( $e->secureName
, wfMsg( "history" ), "action=history" );
1452 $r .= "<div id='{$rci}' style='display:none'>" ;
1453 foreach ( $y AS $x )
1455 $r .= "<img src='{$wgUploadPath}/Arr_.png' width=12 height=12 border=0>";
1456 $r .= "<tt> " ;
1457 if ( $x->isnew
) $r .= $N ;
1458 else $r .= " " ;
1459 if ( $x->isminor
) $r .= $M ;
1460 else $r .= " " ;
1464 if ( $x->oldid
!= 0 ) $o = "oldid=".$x->oldid
;
1465 if ( $x->islog
) $link = $x->timestamp
;
1466 else $link = $this->makeKnownLink( $x->secureName
, $x->timestamp
, $o ) ;
1467 $link = "<tt>{$link}</tt>" ;
1474 $r .= $x->lastlink
;
1475 $r .= ") . . ".$x->userlink
;
1476 $r .= $x->usertalklink
;
1477 if ( $x->usercomment
!= "" )
1478 $r .= " <em>(".wfEscapeHTML($x->usercomment
).")</em>" ;
1487 function recentChangesBlock ()
1489 global $wgUploadPath ;
1490 if ( count ( $this->rc_cache
) == 0 ) return "" ;
1491 $k = array_keys ( $this->rc_cache
) ;
1492 foreach ( $k AS $x )
1494 $y = $this->rc_cache
[$x] ;
1495 if ( count ( $y ) < 2 ) {
1496 $r .= $this->recentChangesBlockLine ( array_shift ( $y ) ) ;
1498 $r .= $this->recentChangesBlockGroup ( $y ) ;
1502 return "<div align=left>{$r}</div>" ;
1505 function recentChangesLine( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched = false, $oldid = 0 , $diffid = 0 )
1508 $usenew = $wgUser->getOption( "usenewrc" );
1510 $r = $this->recentChangesLineNew ( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched , $oldid , $diffid ) ;
1512 $r = $this->recentChangesLineOld ( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched , $oldid , $diffid ) ;
1516 function recentChangesLineOld( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched = false, $oldid = 0, $diffid = 0 )
1518 global $wgTitle, $wgLang, $wgUser;
1520 $d = $wgLang->date( $ts, true);
1522 if ( $d != $this->lastdate
) {
1523 if ( "" != $this->lastdate
) { $s .= "</ul>\n"; }
1524 $s .= "<h4>{$d}</h4>\n<ul>";
1525 $this->lastdate
= $d;
1527 $h = $wgLang->time( $ts, true );
1528 $t = Title
::makeName( $ns, $ttl );
1529 $clink = $this->makeKnownLink( $t , "" );
1530 $nt = Title
::newFromText( $t );
1533 $clink = "<strong>{$clink}</strong>";
1535 $hlink = $this->makeKnownLink( $t, wfMsg( "hist" ), "action=history" );
1536 if ( $isnew ||
$nt->isLog() ) {
1537 $dlink = wfMsg( "diff" );
1539 $dlink = $this->makeKnownLink( $t, wfMsg( "diff" ),
1540 "diff={$oldid}&oldid={$diffid}" ); # Finagle's law
1543 $ul = $this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
1544 $ut, "target=" . $ut );
1545 } else { $ul = $this->makeLink( $wgLang->getNsText(
1546 Namespace::getUser() ) . ":{$ut}", $ut ); }
1548 $utns=$wgLang->getNsText(Namespace::getTalk(Namespace::getUser()));
1549 $talkname=$wgLang->getNsText(Namespace::getTalk(0)); # use the shorter name
1550 $utl= $this->makeLink($utns . ":{$ut}", $talkname );
1551 $cr = wfMsg( "currentrev" );
1553 $s .= "<li> ({$dlink}) ({$hlink}) . .";
1554 $M = wfMsg( "minoreditletter" );
1555 $N = wfMsg( "newpageletter" );
1556 if ( $isminor ) { $s .= " <strong>{$M}</strong>"; }
1557 if ( $isnew ) { $s .= "<strong>{$N}</strong>"; }
1558 $s .= " {$clink}; {$h} . . {$ul}";
1561 if ( ( 0 == $u ) && $wgUser->isSysop() ) {
1562 $blink = $this->makeKnownLink( $wgLang->specialPage(
1563 "Blockip" ), wfMsg( "blocklink" ), "ip={$ut}" );
1569 $utl = "({$utl} | {$blink})";
1573 if ( "" != $c && "*" != $c ) {
1574 $s .= " <em>(" . wfEscapeHTML( $c ) . ")</em>";
1581 function recentChangesLineNew( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched = false, $oldid = 0 , $diffid = 0 )
1583 global $wgTitle, $wgLang, $wgUser;
1585 $rc = new RecentChangesClass
;
1587 $d = $wgLang->date( $ts, true);
1590 if ( $d != $this->lastdate
) {
1591 $ret = $this->recentChangesBlock () ;
1592 $this->rc_cache
= array() ;
1593 $ret .= "<h4>{$d}</h4>\n";
1594 $this->lastdate
= $d;
1596 $h = $wgLang->time( $ts, true );
1597 $t = Title
::makeName( $ns, $ttl );
1598 $clink = $this->makeKnownLink( $t, "" ) ;
1599 if ( $oldid == 0 ) $c2link = $clink ;
1600 else $c2link = $this->makeKnownLink( $t, "" , "oldid={$oldid}" );
1601 $nt = Title
::newFromText( $t );
1603 $rc->timestamp
= $h ;
1604 $rc->oldid
= $oldid ;
1605 $rc->diffid
= $diffid ;
1606 $rc->watched
= $watched ;
1607 $rc->isnew
= $isnew ;
1608 $rc->isminor
= $isminor ;
1609 $rc->secureName
= $t ;
1610 $rc->displayName
= $nt ;
1611 $rc->link
= $clink ;
1612 $rc->usercomment
= $c ;
1613 $rc->islog
= $nt->isLog() ;
1615 if ( ( $isnew && $oldid == 0 ) ||
$nt->isLog() ) {
1616 $dlink = wfMsg( "cur" );
1618 $dlink = $this->makeKnownLink( $t, wfMsg( "cur" ),
1619 "diff=0&oldid={$oldid}" );
1622 if ( $diffid == 0 ||
$nt->isLog() ) {
1623 $plink = wfMsg( "last" );
1625 $plink = $this->makeKnownLink( $t, wfMsg( "last" ),
1626 "diff={$oldid}&oldid={$diffid}" );
1630 $ul = $this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
1631 $ut, "target=" . $ut );
1632 } else { $ul = $this->makeLink( $wgLang->getNsText(
1633 Namespace::getUser() ) . ":{$ut}", $ut ); }
1635 $rc->userlink
= $ul ;
1636 $rc->lastlink
= $plink ;
1637 $rc->curlink
= $dlink ;
1639 $utns=$wgLang->getNsText(Namespace::getTalk(Namespace::getUser()));
1640 $talkname=$wgLang->getNsText(Namespace::getTalk(0)); # use the shorter name
1641 $utl= $this->makeLink($utns . ":{$ut}", $talkname );
1643 if ( ( 0 == $u ) && $wgUser->isSysop() ) {
1644 $blink = $this->makeKnownLink( $wgLang->specialPage(
1645 "Blockip" ), wfMsg( "blocklink" ), "ip={$ut}" );
1646 $rc->usertalklink
= " ({$utl} | {$blink})";
1648 $rc->usertalklink
=" ({$utl})";
1651 if ( !isset ( $this->rc_cache
[$t] ) ) $this->rc_cache
[$t] = array() ;
1652 array_push ( $this->rc_cache
[$t] , $rc ) ;
1657 function imageHistoryLine( $iscur, $ts, $img, $u, $ut, $size, $c )
1659 global $wgUser, $wgLang, $wgTitle;
1661 $dt = $wgLang->timeanddate( $ts, true );
1662 $del = wfMsg( "deleteimg" );
1663 $cur = wfMsg( "cur" );
1666 $url = wfImageUrl( $img );
1668 if ( $wgUser->isSysop() ) {
1669 $link = wfLocalUrlE( "", "image=" . $wgTitle->getURL() .
1671 $style = $this->getInternalLinkAttributes( $link, $del );
1673 $dlink = "<a href=\"{$link}\"{$style}>{$del}</a>";
1678 $url = wfEscapeHTML( wfImageArchiveUrl( $img ) );
1679 if( $wgUser->getID() != 0 ) {
1680 $rlink = $this->makeKnownLink( $wgTitle->getPrefixedText(),
1681 wfMsg( "revertimg" ), "action=revert&oldimage=" .
1682 urlencode( $img ) );
1683 $dlink = $this->makeKnownLink( $wgTitle->getPrefixedText(),
1684 $del, "action=delete&oldimage=" . urlencode( $img ) );
1686 # Having live active links for non-logged in users
1687 # means that bots and spiders crawling our site can
1688 # inadvertently change content. Baaaad idea.
1689 $rlink = wfMsg( "revertimg" );
1693 if ( 0 == $u ) { $ul = $ut; }
1694 else { $ul = $this->makeLink( $wgLang->getNsText(
1695 Namespace::getUser() ) . ":{$ut}", $ut ); }
1697 $nb = str_replace( "$1", $size, wfMsg( "nbytes" ) );
1698 $style = $this->getInternalLinkAttributes( $url, $dt );
1700 $s = "<li> ({$dlink}) ({$rlink}) <a href=\"{$url}\"{$style}>{$dt}</a>"
1701 . " . . {$ul} ({$nb})";
1703 if ( "" != $c && "*" != $c ) {
1704 $s .= " <em>(" . wfEscapeHTML( $c ) . ")</em>";
1710 function tocIndent($level) {
1712 while($level-->0) $rv.="<div style=\"margin-left:2em;\">\n";
1717 function tocUnindent($level) {
1718 while($level-->0) $rv.="</div>\n";
1722 // parameter level defines if we are on an indentation level
1723 function tocLine($anchor,$tocline,$level) {
1727 return "<A CLASS=\"internal\" HREF=\"#".$anchor."\">".$tocline."</A><BR>\n";
1730 return "<div style=\"margin-bottom:0px;\">\n".
1731 "<A CLASS=\"internal\" HREF=\"#".$anchor."\">".$tocline."</A><BR>\n".
1737 function tocTable($toc) {
1738 // note to CSS fanatics: putting this in a div does not work -- div won't auto-expand
1742 $hideline = " <script type='text/javascript'>showTocToggle(\"" . wfMsg("showtoc") . "\",\"" . wfMsg("hidetoc") . "\")</script>";
1745 "<p><table border=\"0\" id=\"toc\"><tr><td align=\"center\">\n".
1746 "<b>".wfMsg("toc")."</b>" .
1748 "</td></tr><tr id='tocinside'><td align=\"left\">\n".
1749 $toc."</td></tr></table><P>\n";
1752 # These two do not check for permissions: check $wgTitle->userCanEdit before calling them
1753 function editSectionScript($section,$head) {
1755 global $wgTitle,$wgUser,$oldid;
1756 if($oldid) return $head;
1757 $url = wfLocalUrlE(urlencode($wgTitle->getPrefixedText()),"action=edit§ion=$section");
1758 return "<span onContextMenu='document.location=\"".$url."\";return false;'>{$head}</span>";
1761 function editSectionLink($section) {
1764 global $wgTitle,$wgUser,$oldid;
1765 if($oldid) return "";
1766 if ($printable) return "";
1767 $editurl="§ion={$section}";
1768 $url=$this->makeKnownLink($wgTitle->getPrefixedText(),wfMsg("editsection"),"action=edit".$editurl);
1769 return "<div style=\"float:right;margin-left:5px;\"><small>[".$url."]</small></div>";
1774 include_once( "SkinStandard.php" );
1775 include_once( "SkinNostalgia.php" );
1776 include_once( "SkinCologneBlue.php" );