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 class RecentChangesClass
{
13 var $secureName , $displayName , $link , $namespace ;
14 var $oldid , $diffid , $timestamp , $curlink , $lastlink , $usertalklink , $versionlink ;
15 var $usercomment , $userlink ;
16 var $isminor , $isnew , $watched , $islog ;
21 /* private */ var $lastdate, $lastline;
23 var $rc_cache ; # Cache for Enhanced Recent Changes
24 var $rccc ; # Recent Changes Cache Counter for visibility toggle
31 function getSkinNames()
33 global $wgValidSkinNames;
34 return $wgValidSkinNames;
37 function getStylesheet()
39 return "wikistandard.css";
44 global $wgOut, $wgUser;
46 if ( $wgOut->isQuickbarSupressed() ) { return 0; }
47 $q = $wgUser->getOption( "quickbar" );
48 if ( "" == $q ) { $q = 0; }
54 global $wgOut, $wgStyleSheetPath;
55 wfProfileIn( "Skin::initPage" );
57 $wgOut->addLink( "shortcut icon", "", "/favicon.ico" );
58 if ( $wgOut->isPrintable() ) { $ss = "wikiprintable.css"; }
59 else { $ss = $this->getStylesheet(); }
60 $wgOut->addLink( "stylesheet", "", "{$wgStyleSheetPath}/{$ss}" );
64 function getHeadScripts() {
65 global $wgStyleSheetPath;
66 $r = "<script type=\"text/javascript\" src=\"{$wgStyleSheetPath}/wikibits.js\"></script>\n";
70 function getUserStyles()
72 $s = "<style type='text/css' media='screen'><!--\n";
73 $s .= $this->doGetUserStyles();
74 $s .= "//--></style>\n";
78 function doGetUserStyles()
83 if ( 1 == $wgUser->getOption( "underline" ) ) {
84 # Don't override browser settings
87 $s .= "a.stub, a.new, a.internal, a.external { " .
88 "text-decoration: none; }\n";
90 if ( 1 == $wgUser->getOption( "highlightbroken" ) ) {
91 $s .= "a.new, #quickbar a.new { color: #CC2200; }\n";
93 if ( 1 == $wgUser->getOption( "justify" ) ) {
94 $s .= "#article { text-align: justify; }\n";
99 function getBodyOptions()
101 global $wgUser, $wgTitle, $wgNamespaceBackgrounds, $wgOut, $oldid, $redirect, $diff,$action;
103 if ( 0 != $wgTitle->getNamespace() ) {
104 $a = array( "bgcolor" => "#FFFFDD" );
106 else $a = array( "bgcolor" => "#FFFFFF" );
107 if($wgOut->isArticle() && $wgUser->getOption("editondblclick")
109 (!$wgTitle->isProtected() ||
$wgUser->isSysop())
112 $n = $wgTitle->getPrefixedURL();
113 $t = wfMsg( "editthispage" );
115 if ( $redirect ) { $red = "&redirect={$redirect}"; }
116 if ( $oldid && ! isset( $diff ) ) {
117 $oid = "&oldid={$oldid}";
119 $s = wfLocalUrlE($n,"action=edit{$oid}{$red}");
120 $s = "document.location = \"" .$s ."\";";
121 $a +
= array ("ondblclick" => $s);
124 if($action=="edit") { # set focus in edit box
125 $a +
= array("onLoad"=>"document.editform.wpTextbox1.focus()");
130 function getExternalLinkAttributes( $link, $text )
132 global $wgUser, $wgOut, $wgLang;
134 $link = urldecode( $link );
135 $link = $wgLang->checkTitleEncoding( $link );
136 $link = str_replace( "_", " ", $link );
137 $link = wfEscapeHTML( $link );
139 if ( $wgOut->isPrintable() ) { $r = " class='printable'"; }
140 else { $r = " class='external'"; }
142 if ( 1 == $wgUser->getOption( "hover" ) ) {
143 $r .= " title=\"{$link}\"";
148 function getInternalLinkAttributes( $link, $text, $broken = false )
150 global $wgUser, $wgOut;
152 $link = urldecode( $link );
153 $link = str_replace( "_", " ", $link );
154 $link = wfEscapeHTML( $link );
156 if ( $wgOut->isPrintable() ) { $r = " class='printable'"; }
157 else if ( $broken == "stub" ) { $r = " class='stub'"; }
158 else if ( $broken == "yes" ) { $r = " class='new'"; }
159 else { $r = " class='internal'"; }
161 if ( 1 == $wgUser->getOption( "hover" ) ) {
162 $r .= " title=\"{$link}\"";
173 # This will be called immediately after the <body> tag. Split into
174 # two functions to make it easier to subclass.
176 function beforeContent()
178 global $wgUser, $wgOut;
180 if ( $wgOut->isPrintable() ) {
181 $s = $this->pageTitle() . $this->pageSubtitle() . "\n";
182 $s .= "\n<div class='bodytext'>";
185 return $this->doBeforeContent();
188 function doBeforeContent()
190 global $wgUser, $wgOut, $wgTitle;
191 wfProfileIn( "Skin::doBeforeContent" );
194 $qb = $this->qbSetting();
196 if( $langlinks = $this->otherLanguages() ) {
202 $borderhack = "class='top'";
205 $s .= "\n<div id='content'>\n<div id='topbar'>" .
206 "<table width='98%' border=0 cellspacing=0><tr>";
209 $s .= "<td class='top' align=left valign=top rowspan='{$rows}'>" .
210 $this->logoText() . "</td>";
211 } else if ( 1 == $qb ||
3 == $qb ) { # Left
212 $s .= $this->getQuickbarCompensator( $rows );
214 $s .= "<td {$borderhack} align=left valign=top>";
216 $s .= $this->topLinks() ;
217 $s .= "<p class='subtitle'>" . $this->pageTitleLinks();
219 $s .= "</td>\n<td {$borderhack} valign=top align=right nowrap>";
220 $s .= $this->nameAndLogin();
221 $s .= "\n<br>" . $this->searchForm() . "</td>";
224 $s .= "</tr>\n<tr><td class='top' colspan=\"2\">$langlinks</td>";
227 if ( 2 == $qb ) { # Right
228 $s .= $this->getQuickbarCompensator( $rows );
230 $s .= "</tr></table>\n</div>\n";
231 $s .= "\n<div id='article'>";
233 $s .= $this->pageTitle();
234 $s .= $this->pageSubtitle() . "\n<p>";
239 function getQuickbarCompensator( $rows = 1 )
241 return "<td width='152' rowspan='{$rows}'> </td>";
244 # This gets called immediately before the </body> tag.
246 function afterContent()
248 global $wgUser, $wgOut, $wgServer, $HTTP_SERVER_VARS;
250 if ( $wgOut->isPrintable() ) {
253 $u = $wgServer . $HTTP_SERVER_VARS['REQUEST_URI'];
254 $u = preg_replace( "/[?&]printable=yes/", "", $u );
255 $rf = str_replace( "$1", $u, wfMsg( "retrievedfrom" ) );
257 if ( $wgOut->isArticle() ) {
258 $lm = "<br>" . $this->lastModified();
261 $s .= "<p><em>{$rf}{$lm}</em>\n";
264 return $this->doAfterContent();
267 function doAfterContent()
269 global $wgUser, $wgOut;
270 wfProfileIn( "Skin::doAfterContent" );
272 $s = "\n</div><br clear=all>\n";
274 $s .= "\n<div id='footer'>";
275 $s .= "<table width='98%' border=0 cellspacing=0><tr>";
277 $qb = $this->qbSetting();
278 if ( 1 == $qb ||
3 == $qb ) { # Left
279 $s .= $this->getQuickbarCompensator();
281 $s .= "<td class='bottom' align=left valign=top>";
283 $s .= $this->bottomLinks();
284 $s .= "\n<br>" . $this->mainPageLink()
285 . " | " . $this->aboutLink()
286 . " | " . $this->specialLink( "recentchanges" )
287 . " | " . $this->searchForm()
288 . "<br>" . $this->pageStats();
291 if ( 2 == $qb ) { # Right
292 $s .= $this->getQuickbarCompensator();
294 $s .= "</tr></table>\n</div>\n</div>\n";
296 if ( 0 != $qb ) { $s .= $this->quickBar(); }
301 function pageTitleLinks()
303 global $wgOut, $wgTitle, $oldid, $action, $diff, $wgUser, $wgLang;
305 $s = $this->printableLink();
307 if ( $wgOut->isArticle() ) {
308 if ( $wgTitle->getNamespace() == Namespace::getImage() ) {
309 $name = $wgTitle->getDBkey();
310 $link = wfEscapeHTML( wfImageUrl( $name ) );
311 $style = $this->getInternalLinkAttributes( $link, $name );
312 $s .= " | <a href=\"{$link}\"{$style}>{$name}</a>";
315 if ( "history" == $action ||
isset( $diff ) ||
isset( $oldid ) ) {
316 $s .= " | " . $this->makeKnownLink( $wgTitle->getPrefixedText(),
317 wfMsg( "currentrev" ) );
320 if ( $wgUser->getNewtalk() ) {
321 # do not show "You have new messages" text when we are viewing our
324 if(!(strcmp($wgTitle->getText(),$wgUser->getName()) == 0 &&
325 $wgTitle->getNamespace()==Namespace::getTalk(Namespace::getUser()))) {
326 $n =$wgUser->getName();
327 $tl = $this->makeKnownLink( $wgLang->getNsText(
328 Namespace::getTalk( Namespace::getUser() ) ) . ":{$n}",
329 wfMsg("newmessageslink") );
330 $s.=" | <strong>". str_replace( "$1", $tl, wfMsg("newmessages") ) . "</strong>";
336 function printableLink()
338 global $wgOut, $wgTitle, $oldid, $action;
340 if ( "history" == $action ) { $q = "action=history&"; }
343 $s = $this->makeKnownLink( $wgTitle->getPrefixedText(),
344 WfMsg( "printableversion" ), "{$q}printable=yes" );
350 global $wgOut, $wgTitle;
352 $s = "<h1 class='pagetitle'>" . $wgOut->getPageTitle() . "</h1>";
356 function pageSubtitle()
358 global $wgOut,$wgTitle,$wgNamespacesWithSubpages;
360 $sub = $wgOut->getSubtitle();
361 if ( "" == $sub ) { $sub = wfMsg( "fromwikipedia" ); }
362 if($wgOut->isArticle() && $wgNamespacesWithSubpages[$wgTitle->getNamespace()]) {
363 $ptext=$wgTitle->getPrefixedText();
364 if(preg_match("/\//",$ptext)) {
365 $sub.="</p><p class='subpages'>";
366 $links=explode("/",$ptext);
369 foreach($links as $link) {
371 if ($c<count($links)) {
373 $getlink=$this->makeLink($growinglink,$link);
374 if(preg_match("/class='new'/i",$getlink)) { break; } # this is a hack, but it saves time
387 $s = "<p class='subtitle'>{$sub}\n";
391 function nameAndLogin()
393 global $wgUser, $wgTitle, $wgLang, $wgShowIPinHeader;
395 $li = $wgLang->specialPage( "Userlogin" );
396 $lo = $wgLang->specialPage( "Userlogout" );
399 if ( 0 == $wgUser->getID() ) {
400 if( $wgShowIPinHeader ) {
401 $n = getenv( "REMOTE_ADDR" );
403 $tl = $this->makeKnownLink( $wgLang->getNsText(
404 Namespace::getTalk( Namespace::getUser() ) ) . ":{$n}",
405 $wgLang->getNsText( Namespace::getTalk( 0 ) ) );
407 $s .= $n . " (".$tl.")";
409 $s .= wfMsg("notloggedin");
412 $rt = $wgTitle->getPrefixedURL();
413 if ( 0 == strcasecmp( urlencode( $lo ), $rt ) ) {
415 } else { $q = "returnto={$rt}"; }
417 $s .= "\n<br>" . $this->makeKnownLink( $li,
418 wfMsg( "login" ), $q );
420 $n = $wgUser->getName();
421 $rt = $wgTitle->getPrefixedURL();
422 $tl = $this->makeKnownLink( $wgLang->getNsText(
423 Namespace::getTalk( Namespace::getUser() ) ) . ":{$n}",
424 $wgLang->getNsText( Namespace::getTalk( 0 ) ) );
428 $s .= $this->makeKnownLink( $wgLang->getNsText(
429 Namespace::getUser() ) . ":{$n}", $n ) . "{$tl}<br>" .
430 $this->makeKnownLink( $lo, wfMsg( "logout" ),
431 "returnto={$rt}" ) . " | " .
432 $this->specialLink( "preferences" );
434 $s .= " | " . $this->makeKnownLink( wfMsg( "helppage" ),
440 function searchForm()
444 $s = "<form name='search' class='inline' method=get action=\""
445 . wfLocalUrl( "" ) . "\">"
446 . "<input type=text name=\"search\" size=19 value=\""
447 . htmlspecialchars(substr($search,0,256)) . "\">\n"
448 . "<input type=submit name=\"go\" value=\"" . wfMsg ("go") . "\"> "
449 . "<input type=submit value=\"" . wfMsg ("search") . "\"></form>";
459 $s = $this->mainPageLink() . $sep
460 . $this->specialLink( "recentchanges" );
462 if ( $wgOut->isArticle() ) {
463 $s .= $sep . $this->editThisPage()
464 . $sep . $this->historyLink();
466 $s .= $sep . $this->specialPagesList();
471 function bottomLinks()
473 global $wgOut, $wgUser, $wgTitle;
477 if ( $wgOut->isArticle() ) {
478 $s .= "<strong>" . $this->editThisPage() . "</strong>";
479 if ( 0 != $wgUser->getID() ) {
480 $s .= $sep . $this->watchThisPage();
482 $s .= $sep . $this->talkLink()
483 . $sep . $this->historyLink()
484 . $sep . $this->whatLinksHere()
485 . $sep . $this->watchPageLinksLink();
487 if ( $wgTitle->getNamespace() == Namespace::getUser()
488 ||
$wgTitle->getNamespace() == Namespace::getTalk(Namespace::getUser()) )
491 $id=User
::idFromName($wgTitle->getText());
492 $ip=User
::isIP($wgTitle->getText());
494 if($id ||
$ip) { # both anons and non-anons have contri list
495 $s .= $sep . $this->userContribsLink();
497 if ( 0 != $wgUser->getID() ) { # show only to signed in users
498 if($id) { # can only email non-anons
499 $s .= $sep . $this->emailUserLink();
503 if ( $wgUser->isSysop() && $wgTitle->getArticleId() ) {
504 $s .= "\n<br>" . $this->deleteThisPage() .
505 $sep . $this->protectThisPage() .
506 $sep . $this->moveThisPage();
508 $s .= "<br>\n" . $this->otherLanguages();
515 global $wgOut, $wgLang, $wgArticle;
516 global $oldid, $diff, $wgDisableCounters;
518 if ( ! $wgOut->isArticle() ) { return ""; }
519 if ( isset( $oldid ) ||
isset( $diff ) ) { return ""; }
520 if ( 0 == $wgArticle->getID() ) { return ""; }
522 if ( $wgDisableCounters ) {
525 $count = $wgArticle->getCount();
526 $s = str_replace( "$1", $count, wfMsg( "viewcount" ) );
528 $s .= $this->lastModified();
529 $s .= " " . wfMsg( "gnunote" );
530 return "<span id='pagestats'>{$s}</span>";
533 function lastModified()
535 global $wgLang, $wgArticle;
537 $d = $wgLang->timeanddate( $wgArticle->getTimestamp(), true );
538 $s = " " . str_replace( "$1", $d, wfMsg( "lastmodified" ) );
542 function logoText( $align = "" )
544 if ( "" != $align ) { $a = " align='{$align}'"; }
547 $mp = wfMsg( "mainpage" );
548 $s = "<a href=\"" . wfLocalUrlE( $mp ) . "\"><img{$a} border=0 src=\""
549 . $this->getLogo() . "\" alt=\"" . "[{$mp}]\"></a>";
555 global $wgOut, $wgTitle, $wgUser, $action, $wgLang;
557 wfProfileIn( "Skin::quickBar" );
559 $s = "\n<div id='quickbar'>";
560 $s .= "\n" . $this->logoText() . "\n<hr>";
563 $s .= $this->mainPageLink()
564 . $sep . $this->specialLink( "recentchanges" )
565 . $sep . $this->specialLink( "randompage" );
566 if ($wgUser->getID()) {
567 $s.= $sep . $this->specialLink( "watchlist" ) ;
568 $s .= $sep .$this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
569 wfMsg( "mycontris" ), "target=" . wfUrlencode($wgUser->getName() ) );
572 // only show watchlist link if logged in
573 if ( wfMsg ( "currentevents" ) != "-" ) $s .= $sep . $this->makeKnownLink( wfMsg( "currentevents" ), "" ) ;
575 $articleExists = $wgTitle->getArticleId();
576 if ( $wgOut->isArticle() ||
$action =="edit" ||
$action =="history" ||
$wpPreview) {
578 if($wgOut->isArticle()) {
579 $s .= "<strong>" . $this->editThisPage() . "</strong>";
580 } else { # backlink to the article in edit or history mode
582 if($articleExists){ # no backlink if no article
583 $tns=$wgTitle->getNamespace();
586 $text = wfMsg("articlepage");
589 $text = wfMsg("viewtalkpage");
592 $text = wfMsg("userpage");
595 $text = wfMsg("viewtalkpage");
598 $text = wfMsg("wikipediapage");
601 $text = wfMsg("viewtalkpage");
604 $text = wfMsg("imagepage");
607 $text = wfMsg("viewtalkpage");
610 $text= wfMsg("articlepage");
613 $link = $wgTitle->getText();
614 if ($nstext = $wgLang->getNsText($tns) ) { # add namespace if necessary
615 $link = $nstext . ":" . $link ;
617 $s .= $this->makeLink($link, $text );
618 } elseif( $wgTitle->getNamespace() != Namespace::getSpecial() ) {
619 # we just throw in a "New page" text to tell the user that he's in edit mode,
620 # and to avoid messing with the separator that is prepended to the next item
621 $s .= "<strong>" . wfMsg("newpage") . "</strong>";
627 watching could cause problems in edit mode:
628 if user edits article, then loads "watch this article" in background and then saves
629 article with "Watch this article" checkbox disabled, the article is transparently
630 unwatched. Therefore we do not show the "Watch this page" link in edit mode
632 if ( 0 != $wgUser->getID() && $articleExists) {
633 if($action!="edit" && $action!="history" &&
634 $action != "submit" )
635 {$s .= $sep . $this->watchThisPage(); }
636 if ( $wgTitle->userCanEdit() ) $s .= $sep . $this->moveThisPage();
638 if ( $wgUser->isSysop() and $articleExists ) {
639 $s .= $sep . $this->deleteThisPage() .
640 $sep . $this->protectThisPage();
642 $s .= $sep . $this->talkLink();
643 if ($articleExists && $action !="history") { $s .= $sep . $this->historyLink();}
644 $s.=$sep . $this->whatLinksHere();
646 if($wgOut->isArticle()) {
647 $s .= $sep . $this->watchPageLinksLink();
650 if ( Namespace::getUser() == $wgTitle->getNamespace()
651 ||
$wgTitle->getNamespace() == Namespace::getTalk(Namespace::getUser())
654 $id=User
::idFromName($wgTitle->getText());
655 $ip=User
::isIP($wgTitle->getText());
658 $s .= $sep . $this->userContribsLink();
660 if ( 0 != $wgUser->getID() ) {
661 if($id) { # can only email real users
662 $s .= $sep . $this->emailUserLink();
669 if ( 0 != $wgUser->getID() ) {
670 $s .= $this->specialLink( "upload" ) . $sep;
672 $s .= $this->specialLink( "specialpages" )
673 . $sep . $this->bugReportsLink();
680 function specialPagesList()
682 global $wgUser, $wgOut, $wgLang, $wgServer, $wgRedirectScript;
685 $validSP = $wgLang->getValidSpecialPages();
687 foreach ( $validSP as $name => $desc ) {
688 if ( "" == $desc ) { continue; }
691 if ( $wgUser->isSysop() )
693 $sysopSP = $wgLang->getSysopSpecialPages();
695 foreach ( $sysopSP as $name => $desc ) {
696 if ( "" == $desc ) { continue; }
700 if ( $wgUser->isDeveloper() )
702 $devSP = $wgLang->getDeveloperSpecialPages();
704 foreach ( $devSP as $name => $desc ) {
705 if ( "" == $desc ) { continue; }
710 $sp = wfMsg( "specialpages" );
711 $spp = $wgLang->specialPage( "Specialpages" );
713 $s = "<form id=\"specialpages\" method=\"get\" class=\"inline\" " .
714 "action=\"{$wgServer}{$wgRedirectScript}\">\n";
715 $s .= "<select name=\"wpDropdown\">\n";
716 $s .= "<option value=\"{$spp}\">{$sp}</option>\n";
718 foreach ( $a as $name => $desc ) {
719 $p = $wgLang->specialPage( $name );
720 $s .= "<option value=\"{$p}\">{$desc}</option>\n";
723 $s .= "<input type=submit value=\"{$go}\" name=redirect>\n";
728 function mainPageLink()
730 $mp = wfMsg( "mainpage" );
731 $s = $this->makeKnownLink( $mp, $mp );
735 function copyrightLink()
737 $s = $this->makeKnownLink( wfMsg( "copyrightpage" ),
738 wfMsg( "copyrightpagename" ) );
744 $s = $this->makeKnownLink( wfMsg( "aboutpage" ),
745 wfMsg( "aboutwikipedia" ) );
749 function editThisPage()
751 global $wgOut, $wgTitle, $oldid, $redirect, $diff;
753 if ( ! $wgOut->isArticle() ||
$diff ) {
754 $s = wfMsg( "protectedpage" );
755 } else if ( $wgTitle->userCanEdit() ) {
756 $n = $wgTitle->getPrefixedText();
757 $t = wfMsg( "editthispage" );
760 if ( $redirect ) { $red = "&redirect={$redirect}"; }
761 if ( $oldid && ! isset( $diff ) ) {
762 $oid = "&oldid={$oldid}";
764 $s = $this->makeKnownLink( $n, $t, "action=edit{$oid}{$red}" );
766 $s = wfMsg( "protectedpage" );
771 function deleteThisPage()
773 global $wgUser, $wgOut, $wgTitle, $diff;
775 if ( $wgTitle->getArticleId() && ( ! $diff ) && $wgUser->isSysop() ) {
776 $n = $wgTitle->getPrefixedText();
777 $t = wfMsg( "deletethispage" );
779 $s = $this->makeKnownLink( $n, $t, "action=delete" );
781 $s = wfMsg( "error" );
786 function protectThisPage()
788 global $wgUser, $wgOut, $wgTitle, $diff;
790 if ( $wgTitle->getArticleId() && ( ! $diff ) && $wgUser->isSysop() ) {
791 $n = $wgTitle->getPrefixedText();
793 if ( $wgTitle->isProtected() ) {
794 $t = wfMsg( "unprotectthispage" );
795 $q = "action=unprotect";
797 $t = wfMsg( "protectthispage" );
798 $q = "action=protect";
800 $s = $this->makeKnownLink( $n, $t, $q );
802 $s = wfMsg( "error" );
807 function watchThisPage()
809 global $wgUser, $wgOut, $wgTitle, $diff;
811 if ( $wgOut->isArticle() && ( ! $diff ) ) {
812 $n = $wgTitle->getPrefixedText();
814 if ( $wgTitle->userIsWatching() ) {
815 $t = wfMsg( "unwatchthispage" );
816 $q = "action=unwatch";
818 $t = wfMsg( "watchthispage" );
821 $s = $this->makeKnownLink( $n, $t, $q );
823 $s = wfMsg( "notanarticle" );
828 function moveThisPage()
830 global $wgTitle, $wgLang;
832 if ( $wgTitle->userCanEdit() ) {
833 $s = $this->makeKnownLink( $wgLang->specialPage( "Movepage" ),
834 wfMsg( "movethispage" ), "target=" . $wgTitle->getPrefixedURL() );
835 } // no message if page is protected - would be redundant
839 function historyLink()
843 $s = $this->makeKnownLink( $wgTitle->getPrefixedText(),
844 wfMsg( "history" ), "action=history" );
848 function whatLinksHere()
850 global $wgTitle, $wgLang;
852 $s = $this->makeKnownLink( $wgLang->specialPage( "Whatlinkshere" ),
853 wfMsg( "whatlinkshere" ), "target=" . $wgTitle->getPrefixedURL() );
857 function userContribsLink()
859 global $wgTitle, $wgLang;
861 $s = $this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
862 wfMsg( "contributions" ), "target=" . $wgTitle->getURL() );
866 function emailUserLink()
868 global $wgTitle, $wgLang;
870 $s = $this->makeKnownLink( $wgLang->specialPage( "Emailuser" ),
871 wfMsg( "emailuser" ), "target=" . $wgTitle->getURL() );
875 function watchPageLinksLink()
877 global $wgOut, $wgTitle, $wgLang;
879 if ( ! $wgOut->isArticle() ) {
880 $s = "(" . wfMsg( "notanarticle" ) . ")";
882 $s = $this->makeKnownLink( $wgLang->specialPage(
883 "Recentchangeslinked" ), wfMsg( "recentchangeslinked" ),
884 "target=" . $wgTitle->getPrefixedURL() );
889 function otherLanguages()
891 global $wgOut, $wgLang, $wgTitle , $wgUseNewInterlanguage ;
893 $a = $wgOut->getLanguageLinks();
894 if ( 0 == count( $a ) ) {
895 if ( !$wgUseNewInterlanguage ) return "";
896 $ns = $wgLang->getNsIndex ( $wgTitle->getNamespace () ) ;
897 if ( $ns != 0 AND $ns != 1 ) return "" ;
899 $x = "mode=addlink&xt=".$wgTitle->getDBkey() ;
900 return $this->makeKnownLink( $wgLang->specialPage( $pn ),
901 wfMsg( "intl" ) , $x );
904 if ( !$wgUseNewInterlanguage ) {
905 $s = wfMsg( "otherlanguages" ) . ": ";
907 global $wgLanguageCode ;
908 $x = "mode=zoom&xt=".$wgTitle->getDBkey() ;
909 $x .= "&xl=".$wgLanguageCode ;
910 $s = $this->makeKnownLink( $wgLang->specialPage( "Intl" ),
911 wfMsg( "otherlanguages" ) , $x ) . ": " ;
915 foreach( $a as $l ) {
916 if ( ! $first ) { $s .= " | "; }
919 $nt = Title
::newFromText( $l );
920 $url = $nt->getFullURL();
921 $text = $wgLang->getLanguageName( $nt->getInterwiki() );
923 if ( "" == $text ) { $text = $l; }
924 $style = $this->getExternalLinkAttributes( $l, $text );
925 $s .= "<a href=\"{$url}\"{$style}>{$text}</a>";
930 function bugReportsLink()
932 $s = $this->makeKnownLink( wfMsg( "bugreportspage" ),
933 wfMsg( "bugreports" ) );
940 $t1 = Title
::newFromText( gmdate( "F j" ) );
941 $t2 = Title
::newFromText( gmdate( "Y" ) );
943 $wgLinkCache->suspend();
944 $id = $t1->getArticleID();
945 $wgLinkCache->resume();
948 $s = $this->makeBrokenLink( $t1->getText() );
950 $s = $this->makeKnownLink( $t1->getText() );
954 $wgLinkCache->suspend();
955 $id = $t2->getArticleID();
956 $wgLinkCache->resume();
959 $s .= $this->makeBrokenLink( $t2->getText() );
961 $s .= $this->makeKnownLink( $t2->getText() );
968 global $wgLang, $wgTitle, $wgLinkCache;
970 $tns = $wgTitle->getNamespace();
971 if ( -1 == $tns ) { return ""; }
973 $pn = $wgTitle->getText();
974 $tp = wfMsg( "talkpage" );
975 if ( Namespace::isTalk( $tns ) ) {
976 $lns = Namespace::getSubject( $tns );
979 $text = wfMsg("articlepage");
982 $text = wfMsg("userpage");
985 $text = wfMsg("wikipediapage");
988 $text = wfMsg("imagepage");
991 $text= wfMsg("articlepage");
995 $lns = Namespace::getTalk( $tns );
998 $n = $wgLang->getNsText( $lns );
999 if ( "" == $n ) { $link = $pn; }
1000 else { $link = "{$n}:{$pn}"; }
1002 $wgLinkCache->suspend();
1003 $s = $this->makeLink( $link, $text );
1004 $wgLinkCache->resume();
1009 # After all the page content is transformed into HTML, it makes
1010 # a final pass through here for things like table backgrounds.
1012 function transformContent( $text )
1017 # Note: This function MUST call getArticleID() on the link,
1018 # otherwise the cache won't get updated properly. See LINKCACHE.DOC.
1020 function makeLink( $title, $text= "", $query = "", $trail = "" )
1022 global $wgOut, $wgUser;
1024 $nt = Title
::newFromText( $title );
1026 if ( $nt->isExternal() ) {
1027 $u = $nt->getFullURL();
1028 if ( "" == $text ) { $text = $nt->getPrefixedText(); }
1029 $style = $this->getExternalLinkAttributes( $link, $text );
1032 if ( "" != $trail ) {
1033 if ( preg_match( "/^([a-z]+)(.*)$$/sD", $trail, $m ) ) {
1038 return "<a href=\"{$u}\"{$style}>{$text}{$inside}</a>{$trail}";
1040 if ( 0 == $nt->getNamespace() && "" == $nt->getText() ) {
1041 return $this->makeKnownLink( $title, $text, $query, $trail );
1043 if ( ( -1 == $nt->getNamespace() ) ||
1044 ( Namespace::getImage() == $nt->getNamespace() ) ) {
1045 return $this->makeKnownLink( $title, $text, $query, $trail );
1047 $aid = $nt->getArticleID() ;
1049 return $this->makeBrokenLink( $title, $text, $query, $trail );
1051 $threshold = $wgUser->getOption("stubthreshold") ;
1052 if ( $threshold > 0 ) {
1053 $res = wfQuery ( "SELECT HIGH_PRIORITY length(cur_text) AS x, cur_namespace, cur_is_redirect FROM cur WHERE cur_id='{$aid}'" ) ;
1055 if ( wfNumRows( $res ) > 0 ) {
1056 $s = wfFetchObject( $res );
1058 if ( $s->cur_is_redirect
OR $s->cur_namespace
!= 0 )
1059 $size = $threshold*2 ; # Really big
1060 wfFreeResult( $res );
1061 } else $size = $threshold*2 ; # Really big
1064 if ( $size < $threshold )
1065 return $this->makeStubLink( $title, $text, $query, $trail );
1066 return $this->makeKnownLink( $title, $text, $query, $trail );
1070 function makeKnownLink( $title, $text = "", $query = "", $trail = "" )
1072 global $wgOut, $wgTitle;
1074 $nt = Title
::newFromText( $title );
1075 $link = $nt->getPrefixedURL();
1077 if ( "" == $link ) {
1079 if ( "" == $text ) { $text = $nt->getFragment(); }
1081 $u = wfLocalUrlE( $link, $query );
1083 if ( "" != $nt->getFragment() ) {
1084 $u .= "#" . wfEscapeHTML( $nt->getFragment() );
1086 if ( "" == $text ) { $text = $nt->getPrefixedText(); }
1087 $style = $this->getInternalLinkAttributes( $link, $text );
1090 if ( "" != $trail ) {
1091 if ( preg_match( wfMsg("linktrail"), $trail, $m ) ) {
1096 $r = "<a href=\"{$u}\"{$style}>{$text}{$inside}</a>{$trail}";
1100 function makeBrokenLink( $title, $text = "", $query = "", $trail = "" )
1102 global $wgOut, $wgUser;
1104 $nt = Title
::newFromText( $title );
1105 $link = $nt->getPrefixedURL();
1107 if ( "" == $query ) { $q = "action=edit"; }
1108 else { $q = "action=edit&{$query}"; }
1109 $u = wfLocalUrlE( $link, $q );
1111 if ( "" == $text ) { $text = $nt->getPrefixedText(); }
1112 $style = $this->getInternalLinkAttributes( $link, $text, "yes" );
1115 if ( "" != $trail ) {
1116 if ( preg_match( wfMsg("linktrail"), $trail, $m ) ) {
1121 if ( $wgOut->isPrintable() ||
1122 ( 1 == $wgUser->getOption( "highlightbroken" ) ) ) {
1123 $s = "<a href=\"{$u}\"{$style}>{$text}{$inside}</a>{$trail}";
1125 $s = "{$text}{$inside}<a href=\"{$u}\"{$style}>?</a>{$trail}";
1130 function makeStubLink( $title, $text = "", $query = "", $trail = "" )
1132 global $wgOut, $wgUser;
1134 $nt = Title
::newFromText( $title );
1135 $link = $nt->getPrefixedURL();
1137 $u = wfLocalUrlE( $link, $query );
1139 if ( "" == $text ) { $text = $nt->getPrefixedText(); }
1140 $style = $this->getInternalLinkAttributes( $link, $text, "stub" );
1143 if ( "" != $trail ) {
1144 if ( preg_match( wfMsg("linktrail"), $trail, $m ) ) {
1149 if ( $wgOut->isPrintable() ||
1150 ( 1 == $wgUser->getOption( "highlightbroken" ) ) ) {
1151 $s = "<a href=\"{$u}\"{$style}>{$text}{$inside}</a>{$trail}";
1153 $s = "{$text}{$inside}<a href=\"{$u}\"{$style}>!</a>{$trail}";
1158 function fnamePart( $url )
1160 $basename = strrchr( $url, "/" );
1161 if ( false === $basename ) { $basename = $url; }
1162 else { $basename = substr( $basename, 1 ); }
1163 return wfEscapeHTML( $basename );
1166 function makeImage( $url, $alt = "" )
1170 if ( "" == $alt ) { $alt = $this->fnamePart( $url ); }
1171 $s = "<img src=\"{$url}\" alt=\"{$alt}\">";
1175 function makeImageLink( $name, $url, $alt = "" )
1177 global $wgOut, $wgTitle, $wgLang;
1179 $nt = Title
::newFromText( $wgLang->getNsText(
1180 Namespace::getImage() ) . ":{$name}" );
1181 $link = $nt->getPrefixedURL();
1182 if ( "" == $alt ) { $alt = $name; }
1184 $u = wfLocalUrlE( $link );
1185 $s = "<a href=\"{$u}\" class='image' title=\"{$alt}\">" .
1186 "<img border=0 src=\"{$url}\" alt=\"{$alt}\"></a>";
1190 function makeMediaLink( $name, $url, $alt = "" )
1192 global $wgOut, $wgTitle;
1194 if ( "" == $alt ) { $alt = $name; }
1195 $u = wfEscapeHTML( $url );
1196 $s = "<a href=\"{$u}\" class='internal' title=\"{$alt}\">{$alt}</a>";
1200 function specialLink( $name, $key = "" )
1204 if ( "" == $key ) { $key = strtolower( $name ); }
1205 $pn = $wgLang->ucfirst( $name );
1206 return $this->makeKnownLink( $wgLang->specialPage( $pn ),
1210 # Called by history lists and recent changes
1213 function beginRecentChangesList()
1215 $rc_cache = array() ;
1217 $this->lastdate
= "";
1221 function beginHistoryList()
1223 $this->lastdate
= $this->lastline
= "";
1224 $s = "\n<p>" . wfMsg( "histlegend" ) . "\n<ul>";
1228 function beginImageHistoryList()
1230 $s = "\n<h2>" . wfMsg( "imghistory" ) . "</h2>\n" .
1231 "<p>" . wfMsg( "imghistlegend" ) . "\n<ul>";
1235 function endRecentChangesList()
1237 $s = $this->recentChangesBlock() ;
1242 function endHistoryList()
1244 $last = wfMsg( "last" );
1246 $s = preg_replace( "/!OLDID![0-9]+!/", $last, $this->lastline
);
1251 function endImageHistoryList()
1257 function historyLine( $ts, $u, $ut, $ns, $ttl, $oid, $c, $isminor )
1261 $artname = Title
::makeName( $ns, $ttl );
1262 $last = wfMsg( "last" );
1263 $cur = wfMsg( "cur" );
1264 $cr = wfMsg( "currentrev" );
1266 if ( $oid && $this->lastline
) {
1267 $ret = preg_replace( "/!OLDID!([0-9]+)!/", $this->makeKnownLink(
1268 $artname, $last, "diff=\\1&oldid={$oid}" ), $this->lastline
);
1272 $dt = $wgLang->timeanddate( $ts, true );
1274 if ( $oid ) { $q = "oldid={$oid}"; }
1276 $link = $this->makeKnownLink( $artname, $dt, $q );
1279 $ul = $this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
1280 $ut, "target=" . $ut );
1281 } else { $ul = $this->makeLink( $wgLang->getNsText(
1282 Namespace::getUser() ) . ":{$ut}", $ut ); }
1286 $curlink = $this->makeKnownLink( $artname, $cur,
1287 "diff=0&oldid={$oid}" );
1291 $s .= "({$curlink}) (!OLDID!{$oid}!) . .";
1293 $M = wfMsg( "minoreditletter" );
1294 if ( $isminor ) { $s .= " <strong>{$M}</strong>"; }
1295 $s .= " {$link} . . {$ul}";
1297 if ( "" != $c && "*" != $c ) { $s .= " <em>(" . wfEscapeHTML($c) . ")</em>"; }
1300 $this->lastline
= $s;
1304 function recentChangesBlockLine ( $y ) {
1305 global $wgUploadPath ;
1307 $M = wfMsg( "minoreditletter" );
1308 $N = wfMsg( "newpageletter" );
1310 $r .= "<img src='{$wgUploadPath}/Arr_.png' width=12 height=12 border=0>" ;
1312 if ( $y->isnew
) $r .= $N ;
1313 else $r .= " " ;
1314 if ( $y->isminor
) $r .= $M ;
1315 else $r .= " " ;
1316 $r .= " ".$y->timestamp
." " ;
1319 if ( $y->watched
) $link = "<strong>{$link}</strong>" ;
1325 $r .= $this->makeKnownLink( $y->secureName
, wfMsg( "hist" ), "action=history" );
1327 $r .= ") . . ".$y->userlink
;
1328 $r .= $y->usertalklink
;
1329 if ( $y->usercomment
!= "" )
1330 $r .= " <em>(".wfEscapeHTML($y->usercomment
).")</em>" ;
1335 function recentChangesBlockGroup ( $y ) {
1336 global $wgUploadPath ;
1339 $M = wfMsg( "minoreditletter" );
1340 $N = wfMsg( "newpageletter" );
1342 $userlinks = array () ;
1343 foreach ( $y AS $x ) {
1344 $oldid = $x->diffid
;
1345 if ( $x->isnew
) $isnew = true ;
1347 if ( !isset ( $userlinks[$u] ) ) $userlinks[$u] = 0 ;
1351 krsort ( $userlinks ) ;
1352 asort ( $userlinks ) ;
1354 $u = array_keys ( $userlinks ) ;
1355 foreach ( $u as $x ) {
1357 if ( $userlinks[$x] > 1 ) $z .= " ({$userlinks[$x]}×)" ;
1358 array_push ( $users , $z ) ;
1360 $users = " <font size='-1'>[".implode("; ",$users)."]</font>" ;
1363 $e = array_shift ( $e ) ;
1366 $rci = "RCI{$this->rccc}" ;
1367 $rcl = "RCL{$this->rccc}" ;
1368 $rcm = "RCM{$this->rccc}" ;
1369 $tl = "<a href='javascript:toggleVisibility(\"{$rci}\",\"{$rcm}\",\"{$rcl}\")'>" ;
1370 $tl .= "<span id='{$rcm}'><img src='{$wgUploadPath}/Arr_r.png' width=12 height=12 border=0></span>" ;
1371 $tl .= "<span id='{$rcl}' style='display:none'><img src='{$wgUploadPath}/Arr_d.png' width=12 height=12 border=0></span>" ;
1377 if ( $isnew ) $r .= $N ;
1378 else $r .= " " ;
1379 $r .= " " ; # Minor
1380 $r .= " ".$e->timestamp
." " ;
1384 if ( $e->watched
) $link = "<strong>{$link}</strong>" ;
1388 $r .= " (".count($y)." " ;
1389 if ( $isnew ) $r .= wfMsg("changes");
1390 else $r .= $this->makeKnownLink( $e->secureName
, wfMsg("changes") , "diff=0&oldid=".$oldid ) ;
1392 $r .= $this->makeKnownLink( $e->secureName
, wfMsg( "history" ), "action=history" );
1400 $r .= "<div id='{$rci}' style='display:none'>" ;
1401 foreach ( $y AS $x )
1403 $r .= "<img src='{$wgUploadPath}/Arr_.png' width=12 height=12 border=0>";
1404 $r .= "<tt> " ;
1405 if ( $x->isnew
) $r .= $N ;
1406 else $r .= " " ;
1407 if ( $x->isminor
) $r .= $M ;
1408 else $r .= " " ;
1412 if ( $x->oldid
!= 0 ) $o = "oldid=".$x->oldid
;
1413 if ( $x->islog
) $link = $x->timestamp
;
1414 else $link = $this->makeKnownLink( $x->secureName
, $x->timestamp
, $o ) ;
1415 $link = "<tt>{$link}</tt>" ;
1422 $r .= $x->lastlink
;
1423 $r .= ") . . ".$x->userlink
;
1424 $r .= $x->usertalklink
;
1425 if ( $x->usercomment
!= "" )
1426 $r .= " <em>(".wfEscapeHTML($x->usercomment
).")</em>" ;
1435 function recentChangesBlock ()
1437 global $wgUploadPath ;
1438 if ( count ( $this->rc_cache
) == 0 ) return "" ;
1439 $k = array_keys ( $this->rc_cache
) ;
1440 foreach ( $k AS $x )
1442 $y = $this->rc_cache
[$x] ;
1443 if ( count ( $y ) < 2 ) {
1444 $r .= $this->recentChangesBlockLine ( array_shift ( $y ) ) ;
1446 $r .= $this->recentChangesBlockGroup ( $y ) ;
1450 return "<div align=left>{$r}</div>" ;
1453 function recentChangesLine( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched = false, $oldid = 0 , $diffid = 0 )
1456 $usenew = $wgUser->getOption( "usenewrc" );
1458 $r = $this->recentChangesLineNew ( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched , $oldid , $diffid ) ;
1460 $r = $this->recentChangesLineOld ( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched , $oldid , $diffid ) ;
1464 function recentChangesLineOld( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched = false, $oldid = 0, $diffid = 0 )
1466 global $wgTitle, $wgLang, $wgUser;
1468 $d = $wgLang->date( $ts, true);
1470 if ( $d != $this->lastdate
) {
1471 if ( "" != $this->lastdate
) { $s .= "</ul>\n"; }
1472 $s .= "<h4>{$d}</h4>\n<ul>";
1473 $this->lastdate
= $d;
1475 $h = $wgLang->time( $ts, true );
1476 $t = Title
::makeName( $ns, $ttl );
1477 $clink = $this->makeKnownLink( $t , "" );
1478 $nt = Title
::newFromText( $t );
1481 $clink = "<strong>{$clink}</strong>";
1483 $hlink = $this->makeKnownLink( $t, wfMsg( "hist" ), "action=history" );
1484 if ( $isnew ||
$nt->isLog() ) {
1485 $dlink = wfMsg( "diff" );
1487 $dlink = $this->makeKnownLink( $t, wfMsg( "diff" ),
1488 "diff={$oldid}&oldid={$diffid}" ); # Finagle's law
1491 $ul = $this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
1492 $ut, "target=" . $ut );
1493 } else { $ul = $this->makeLink( $wgLang->getNsText(
1494 Namespace::getUser() ) . ":{$ut}", $ut ); }
1496 $utns=$wgLang->getNsText(Namespace::getTalk(Namespace::getUser()));
1497 $talkname=$wgLang->getNsText(Namespace::getTalk(0)); # use the shorter name
1498 $utl= $this->makeLink($utns . ":{$ut}", $talkname );
1499 $cr = wfMsg( "currentrev" );
1501 $s .= "<li> ({$dlink}) ({$hlink}) . .";
1502 $M = wfMsg( "minoreditletter" );
1503 $N = wfMsg( "newpageletter" );
1504 if ( $isminor ) { $s .= " <strong>{$M}</strong>"; }
1505 if ( $isnew ) { $s .= "<strong>{$N}</strong>"; }
1506 $s .= " {$clink}; {$h} . . {$ul}";
1509 if ( ( 0 == $u ) && $wgUser->isSysop() ) {
1510 $blink = $this->makeKnownLink( $wgLang->specialPage(
1511 "Blockip" ), wfMsg( "blocklink" ), "ip={$ut}" );
1517 $utl = "({$utl} | {$blink})";
1521 if ( "" != $c && "*" != $c ) {
1522 $s .= " <em>(" . wfEscapeHTML( $c ) . ")</em>";
1529 function recentChangesLineNew( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched = false, $oldid = 0 , $diffid = 0 )
1531 global $wgTitle, $wgLang, $wgUser;
1533 $rc = new RecentChangesClass
;
1535 $d = $wgLang->date( $ts, true);
1538 if ( $d != $this->lastdate
) {
1539 $ret = $this->recentChangesBlock () ;
1540 $this->rc_cache
= array() ;
1541 $ret .= "<h4>{$d}</h4>\n";
1542 $this->lastdate
= $d;
1544 $h = $wgLang->time( $ts, true );
1545 $t = Title
::makeName( $ns, $ttl );
1546 $clink = $this->makeKnownLink( $t, "" ) ;
1547 if ( $oldid == 0 ) $c2link = $clink ;
1548 else $c2link = $this->makeKnownLink( $t, "" , "oldid={$oldid}" );
1549 $nt = Title
::newFromText( $t );
1551 $rc->timestamp
= $h ;
1552 $rc->oldid
= $oldid ;
1553 $rc->diffid
= $diffid ;
1554 $rc->watched
= $watched ;
1555 $rc->isnew
= $isnew ;
1556 $rc->isminor
= $isminor ;
1557 $rc->secureName
= $t ;
1558 $rc->displayName
= $nt ;
1559 $rc->link
= $clink ;
1560 $rc->usercomment
= $c ;
1561 $rc->islog
= $nt->isLog() ;
1563 if ( ( $isnew && $oldid == 0 ) ||
$nt->isLog() ) {
1564 $dlink = wfMsg( "cur" );
1566 $dlink = $this->makeKnownLink( $t, wfMsg( "cur" ),
1567 "diff=0&oldid={$oldid}" );
1570 if ( $diffid == 0 ||
$nt->isLog() ) {
1571 $plink = wfMsg( "last" );
1573 $plink = $this->makeKnownLink( $t, wfMsg( "last" ),
1574 "diff={$oldid}&oldid={$diffid}" );
1578 $ul = $this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
1579 $ut, "target=" . $ut );
1580 } else { $ul = $this->makeLink( $wgLang->getNsText(
1581 Namespace::getUser() ) . ":{$ut}", $ut ); }
1583 $rc->userlink
= $ul ;
1584 $rc->lastlink
= $plink ;
1585 $rc->curlink
= $dlink ;
1587 $utns=$wgLang->getNsText(Namespace::getTalk(Namespace::getUser()));
1588 $talkname=$wgLang->getNsText(Namespace::getTalk(0)); # use the shorter name
1589 $utl= $this->makeLink($utns . ":{$ut}", $talkname );
1591 if ( ( 0 == $u ) && $wgUser->isSysop() ) {
1592 $blink = $this->makeKnownLink( $wgLang->specialPage(
1593 "Blockip" ), wfMsg( "blocklink" ), "ip={$ut}" );
1594 $rc->usertalklink
= " ({$utl} | {$blink})";
1596 $rc->usertalklink
=" ({$utl})";
1599 if ( !isset ( $this->rc_cache
[$t] ) ) $this->rc_cache
[$t] = array() ;
1600 array_push ( $this->rc_cache
[$t] , $rc ) ;
1605 function imageHistoryLine( $iscur, $ts, $img, $u, $ut, $size, $c )
1607 global $wgUser, $wgLang, $wgTitle;
1609 $dt = $wgLang->timeanddate( $ts, true );
1610 $del = wfMsg( "deleteimg" );
1611 $cur = wfMsg( "cur" );
1614 $url = wfImageUrl( $img );
1616 if ( $wgUser->isSysop() ) {
1617 $link = wfLocalUrlE( "", "image=" . $wgTitle->getURL() .
1619 $style = $this->getInternalLinkAttributes( $link, $del );
1621 $dlink = "<a href=\"{$link}\"{$style}>{$del}</a>";
1626 $url = wfEscapeHTML( wfImageArchiveUrl( $img ) );
1627 if( $wgUser->getID() != 0 ) {
1628 $rlink = $this->makeKnownLink( $wgTitle->getPrefixedText(),
1629 wfMsg( "revertimg" ), "action=revert&oldimage=" .
1630 urlencode( $img ) );
1631 $dlink = $this->makeKnownLink( $wgTitle->getPrefixedText(),
1632 $del, "action=delete&oldimage=" . urlencode( $img ) );
1634 # Having live active links for non-logged in users
1635 # means that bots and spiders crawling our site can
1636 # inadvertently change content. Baaaad idea.
1637 $rlink = wfMsg( "revertimg" );
1641 if ( 0 == $u ) { $ul = $ut; }
1642 else { $ul = $this->makeLink( $wgLang->getNsText(
1643 Namespace::getUser() ) . ":{$ut}", $ut ); }
1645 $nb = str_replace( "$1", $size, wfMsg( "nbytes" ) );
1646 $style = $this->getInternalLinkAttributes( $url, $dt );
1648 $s = "<li> ({$dlink}) ({$rlink}) <a href=\"{$url}\"{$style}>{$dt}</a>"
1649 . " . . {$ul} ({$nb})";
1651 if ( "" != $c && "*" != $c ) {
1652 $s .= " <em>(" . wfEscapeHTML( $c ) . ")</em>";
1658 function tocIndent($level) {
1660 while($level-->0) $rv.="<div style=\"margin-left:2em;\">\n";
1665 function tocUnindent($level) {
1666 while($level-->0) $rv.="</div>\n";
1670 // parameter level defines if we are on an indentation level
1671 function tocLine($anchor,$tocline,$level) {
1675 return "<A CLASS=\"internal\" HREF=\"#".$anchor."\">".$tocline."</A><BR>\n";
1678 return "<div style=\"margin-bottom:0px;\">\n".
1679 "<A CLASS=\"internal\" HREF=\"#".$anchor."\">".$tocline."</A><BR>\n".
1685 function tocTable($toc) {
1687 /* does not auto-expand, use table for now
1689 <div><div style=\"border-width:1px;background-color:#f3f3ff;border-color:#8888aa;border-style:solid;padding:1em;padding-bottom:1em;\">
1690 <b>".wfMsg("toc")."</b><P>
1694 "<table border=\"0\" bgcolor=\"#8888aa\" cellpadding=\"0\" cellspacing=\"1\"><tr><td>\n" .
1695 "<table border=\"0\" bgcolor=\"#f3f3ff\" CELLPADDING=5><tr><td>\n".
1696 "<b>".wfMsg("toc")."</b>" .
1697 " <script type='text/javascript'>showTocToggle(\"" . wfMsg("showtoc") . "\",\"" . wfMsg("hidetoc") . "\")</script>" .
1698 "</td></tr><tr id='tocinside'><td>\n".
1699 $toc."</td></tr></table></td></tr></table><P>\n";
1702 function editSectionLink($section) {
1704 global $wgTitle,$wgUser,$oldid;
1705 if($wgTitle->isProtected() && !$wgUser->isSysop()) return "";
1706 if($oldid) return "";
1707 $editurl="§ion={$section}";
1708 $url=$this->makeKnownLink($wgTitle->getPrefixedText(),wfMsg("editsection"),"action=edit".$editurl);
1709 return "<div style=\"float:right;margin-left:5px;\"><small>[".$url."]</small></div>";
1714 include_once( "SkinStandard.php" );
1715 include_once( "SkinNostalgia.php" );
1716 include_once( "SkinCologneBlue.php" );