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, $wgLang;
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 $left = ($qb == 1 ||
$qb == 3);
210 if($wgLang->isRTL()) $left = !$left;
213 $s .= "<td class='top' align=left valign=top rowspan='{$rows}'>" .
214 $this->logoText() . "</td>";
216 $s .= $this->getQuickbarCompensator( $rows );
218 $s .= "<td {$borderhack} align=left valign=top>";
220 $s .= $this->topLinks() ;
221 $s .= "<p class='subtitle'>" . $this->pageTitleLinks();
223 $s .= "</td>\n<td {$borderhack} valign=top align=right nowrap>";
224 $s .= $this->nameAndLogin();
225 $s .= "\n<br>" . $this->searchForm() . "</td>";
228 $s .= "</tr>\n<tr><td class='top' colspan=\"2\">$langlinks</td>";
231 if ( $shove && !$left ) { # Right
232 $s .= $this->getQuickbarCompensator( $rows );
234 $s .= "</tr></table>\n</div>\n";
235 $s .= "\n<div id='article'>";
237 $s .= $this->pageTitle();
238 $s .= $this->pageSubtitle() . "\n<p>";
243 function getQuickbarCompensator( $rows = 1 )
245 return "<td width='152' rowspan='{$rows}'> </td>";
248 # This gets called immediately before the </body> tag.
250 function afterContent()
252 global $wgUser, $wgOut, $wgServer, $HTTP_SERVER_VARS;
254 if ( $wgOut->isPrintable() ) {
257 $u = $wgServer . $HTTP_SERVER_VARS['REQUEST_URI'];
258 $u = preg_replace( "/[?&]printable=yes/", "", $u );
259 $rf = str_replace( "$1", $u, wfMsg( "retrievedfrom" ) );
261 if ( $wgOut->isArticle() ) {
262 $lm = "<br>" . $this->lastModified();
265 $s .= "<p><em>{$rf}{$lm}</em>\n";
268 return $this->doAfterContent();
271 function doAfterContent()
273 global $wgUser, $wgOut, $wgLang;
274 wfProfileIn( "Skin::doAfterContent" );
276 $s = "\n</div><br clear=all>\n";
278 $s .= "\n<div id='footer'>";
279 $s .= "<table width='98%' border=0 cellspacing=0><tr>";
281 $qb = $this->qbSetting();
283 $left = ($qb == 1 ||
$qb == 3);
284 if($wgLang->isRTL()) $left = !$left;
286 if ( $shove && $left ) { # Left
287 $s .= $this->getQuickbarCompensator();
289 $s .= "<td class='bottom' align=left valign=top>";
291 $s .= $this->bottomLinks();
292 $s .= "\n<br>" . $this->mainPageLink()
293 . " | " . $this->aboutLink()
294 . " | " . $this->specialLink( "recentchanges" )
295 . " | " . $this->searchForm()
296 . "<br>" . $this->pageStats();
299 if ( $shove && !$left ) { # Right
300 $s .= $this->getQuickbarCompensator();
302 $s .= "</tr></table>\n</div>\n</div>\n";
304 if ( 0 != $qb ) { $s .= $this->quickBar(); }
309 function pageTitleLinks()
311 global $wgOut, $wgTitle, $oldid, $action, $diff, $wgUser, $wgLang;
313 $s = $this->printableLink();
315 if ( $wgOut->isArticle() ) {
316 if ( $wgTitle->getNamespace() == Namespace::getImage() ) {
317 $name = $wgTitle->getDBkey();
318 $link = wfEscapeHTML( wfImageUrl( $name ) );
319 $style = $this->getInternalLinkAttributes( $link, $name );
320 $s .= " | <a href=\"{$link}\"{$style}>{$name}</a>";
323 if ( "history" == $action ||
isset( $diff ) ||
isset( $oldid ) ) {
324 $s .= " | " . $this->makeKnownLink( $wgTitle->getPrefixedText(),
325 wfMsg( "currentrev" ) );
328 if ( $wgUser->getNewtalk() ) {
329 # do not show "You have new messages" text when we are viewing our
332 if(!(strcmp($wgTitle->getText(),$wgUser->getName()) == 0 &&
333 $wgTitle->getNamespace()==Namespace::getTalk(Namespace::getUser()))) {
334 $n =$wgUser->getName();
335 $tl = $this->makeKnownLink( $wgLang->getNsText(
336 Namespace::getTalk( Namespace::getUser() ) ) . ":{$n}",
337 wfMsg("newmessageslink") );
338 $s.=" | <strong>". str_replace( "$1", $tl, wfMsg("newmessages") ) . "</strong>";
344 function printableLink()
346 global $wgOut, $wgTitle, $oldid, $action;
348 if ( "history" == $action ) { $q = "action=history&"; }
351 $s = $this->makeKnownLink( $wgTitle->getPrefixedText(),
352 WfMsg( "printableversion" ), "{$q}printable=yes" );
358 global $wgOut, $wgTitle;
360 $s = "<h1 class='pagetitle'>" . $wgOut->getPageTitle() . "</h1>";
364 function pageSubtitle()
366 global $wgOut,$wgTitle,$wgNamespacesWithSubpages;
368 $sub = $wgOut->getSubtitle();
369 if ( "" == $sub ) { $sub = wfMsg( "fromwikipedia" ); }
370 if($wgOut->isArticle() && $wgNamespacesWithSubpages[$wgTitle->getNamespace()]) {
371 $ptext=$wgTitle->getPrefixedText();
372 if(preg_match("/\//",$ptext)) {
373 $sub.="</p><p class='subpages'>";
374 $links=explode("/",$ptext);
377 foreach($links as $link) {
379 if ($c<count($links)) {
381 $getlink=$this->makeLink($growinglink,$link);
382 if(preg_match("/class='new'/i",$getlink)) { break; } # this is a hack, but it saves time
395 $s = "<p class='subtitle'>{$sub}\n";
399 function nameAndLogin()
401 global $wgUser, $wgTitle, $wgLang, $wgShowIPinHeader;
403 $li = $wgLang->specialPage( "Userlogin" );
404 $lo = $wgLang->specialPage( "Userlogout" );
407 if ( 0 == $wgUser->getID() ) {
408 if( $wgShowIPinHeader ) {
409 $n = getenv( "REMOTE_ADDR" );
411 $tl = $this->makeKnownLink( $wgLang->getNsText(
412 Namespace::getTalk( Namespace::getUser() ) ) . ":{$n}",
413 $wgLang->getNsText( Namespace::getTalk( 0 ) ) );
415 $s .= $n . " (".$tl.")";
417 $s .= wfMsg("notloggedin");
420 $rt = $wgTitle->getPrefixedURL();
421 if ( 0 == strcasecmp( urlencode( $lo ), $rt ) ) {
423 } else { $q = "returnto={$rt}"; }
425 $s .= "\n<br>" . $this->makeKnownLink( $li,
426 wfMsg( "login" ), $q );
428 $n = $wgUser->getName();
429 $rt = $wgTitle->getPrefixedURL();
430 $tl = $this->makeKnownLink( $wgLang->getNsText(
431 Namespace::getTalk( Namespace::getUser() ) ) . ":{$n}",
432 $wgLang->getNsText( Namespace::getTalk( 0 ) ) );
436 $s .= $this->makeKnownLink( $wgLang->getNsText(
437 Namespace::getUser() ) . ":{$n}", $n ) . "{$tl}<br>" .
438 $this->makeKnownLink( $lo, wfMsg( "logout" ),
439 "returnto={$rt}" ) . " | " .
440 $this->specialLink( "preferences" );
442 $s .= " | " . $this->makeKnownLink( wfMsg( "helppage" ),
448 function searchForm()
452 $s = "<form name='search' class='inline' method=get action=\""
453 . wfLocalUrl( "" ) . "\">"
454 . "<input type=text name=\"search\" size=19 value=\""
455 . htmlspecialchars(substr($search,0,256)) . "\">\n"
456 . "<input type=submit name=\"go\" value=\"" . wfMsg ("go") . "\"> "
457 . "<input type=submit value=\"" . wfMsg ("search") . "\"></form>";
467 $s = $this->mainPageLink() . $sep
468 . $this->specialLink( "recentchanges" );
470 if ( $wgOut->isArticle() ) {
471 $s .= $sep . $this->editThisPage()
472 . $sep . $this->historyLink();
474 $s .= $sep . $this->specialPagesList();
479 function bottomLinks()
481 global $wgOut, $wgUser, $wgTitle;
485 if ( $wgOut->isArticle() ) {
486 $s .= "<strong>" . $this->editThisPage() . "</strong>";
487 if ( 0 != $wgUser->getID() ) {
488 $s .= $sep . $this->watchThisPage();
490 $s .= $sep . $this->talkLink()
491 . $sep . $this->historyLink()
492 . $sep . $this->whatLinksHere()
493 . $sep . $this->watchPageLinksLink();
495 if ( $wgTitle->getNamespace() == Namespace::getUser()
496 ||
$wgTitle->getNamespace() == Namespace::getTalk(Namespace::getUser()) )
499 $id=User
::idFromName($wgTitle->getText());
500 $ip=User
::isIP($wgTitle->getText());
502 if($id ||
$ip) { # both anons and non-anons have contri list
503 $s .= $sep . $this->userContribsLink();
505 if ( 0 != $wgUser->getID() ) { # show only to signed in users
506 if($id) { # can only email non-anons
507 $s .= $sep . $this->emailUserLink();
511 if ( $wgUser->isSysop() && $wgTitle->getArticleId() ) {
512 $s .= "\n<br>" . $this->deleteThisPage() .
513 $sep . $this->protectThisPage() .
514 $sep . $this->moveThisPage();
516 $s .= "<br>\n" . $this->otherLanguages();
523 global $wgOut, $wgLang, $wgArticle;
524 global $oldid, $diff, $wgDisableCounters;
526 if ( ! $wgOut->isArticle() ) { return ""; }
527 if ( isset( $oldid ) ||
isset( $diff ) ) { return ""; }
528 if ( 0 == $wgArticle->getID() ) { return ""; }
530 if ( $wgDisableCounters ) {
533 $count = $wgArticle->getCount();
534 $s = str_replace( "$1", $count, wfMsg( "viewcount" ) );
536 $s .= $this->lastModified();
537 $s .= " " . wfMsg( "gnunote" );
538 return "<span id='pagestats'>{$s}</span>";
541 function lastModified()
543 global $wgLang, $wgArticle;
545 $d = $wgLang->timeanddate( $wgArticle->getTimestamp(), true );
546 $s = " " . str_replace( "$1", $d, wfMsg( "lastmodified" ) );
550 function logoText( $align = "" )
552 if ( "" != $align ) { $a = " align='{$align}'"; }
555 $mp = wfMsg( "mainpage" );
556 $s = "<a href=\"" . wfLocalUrlE( $mp ) . "\"><img{$a} border=0 src=\""
557 . $this->getLogo() . "\" alt=\"" . "[{$mp}]\"></a>";
563 global $wgOut, $wgTitle, $wgUser, $action, $wgLang;
565 wfProfileIn( "Skin::quickBar" );
567 $s = "\n<div id='quickbar'>";
568 $s .= "\n" . $this->logoText() . "\n<hr>";
571 $s .= $this->mainPageLink()
572 . $sep . $this->specialLink( "recentchanges" )
573 . $sep . $this->specialLink( "randompage" );
574 if ($wgUser->getID()) {
575 $s.= $sep . $this->specialLink( "watchlist" ) ;
576 $s .= $sep .$this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
577 wfMsg( "mycontris" ), "target=" . wfUrlencode($wgUser->getName() ) );
580 // only show watchlist link if logged in
581 if ( wfMsg ( "currentevents" ) != "-" ) $s .= $sep . $this->makeKnownLink( wfMsg( "currentevents" ), "" ) ;
583 $articleExists = $wgTitle->getArticleId();
584 if ( $wgOut->isArticle() ||
$action =="edit" ||
$action =="history" ||
$wpPreview) {
586 if($wgOut->isArticle()) {
587 $s .= "<strong>" . $this->editThisPage() . "</strong>";
588 } else { # backlink to the article in edit or history mode
590 if($articleExists){ # no backlink if no article
591 $tns=$wgTitle->getNamespace();
594 $text = wfMsg("articlepage");
597 $text = wfMsg("viewtalkpage");
600 $text = wfMsg("userpage");
603 $text = wfMsg("viewtalkpage");
606 $text = wfMsg("wikipediapage");
609 $text = wfMsg("viewtalkpage");
612 $text = wfMsg("imagepage");
615 $text = wfMsg("viewtalkpage");
618 $text= wfMsg("articlepage");
621 $link = $wgTitle->getText();
622 if ($nstext = $wgLang->getNsText($tns) ) { # add namespace if necessary
623 $link = $nstext . ":" . $link ;
625 $s .= $this->makeLink($link, $text );
626 } elseif( $wgTitle->getNamespace() != Namespace::getSpecial() ) {
627 # we just throw in a "New page" text to tell the user that he's in edit mode,
628 # and to avoid messing with the separator that is prepended to the next item
629 $s .= "<strong>" . wfMsg("newpage") . "</strong>";
635 watching could cause problems in edit mode:
636 if user edits article, then loads "watch this article" in background and then saves
637 article with "Watch this article" checkbox disabled, the article is transparently
638 unwatched. Therefore we do not show the "Watch this page" link in edit mode
640 if ( 0 != $wgUser->getID() && $articleExists) {
641 if($action!="edit" && $action!="history" &&
642 $action != "submit" )
643 {$s .= $sep . $this->watchThisPage(); }
644 if ( $wgTitle->userCanEdit() ) $s .= $sep . $this->moveThisPage();
646 if ( $wgUser->isSysop() and $articleExists ) {
647 $s .= $sep . $this->deleteThisPage() .
648 $sep . $this->protectThisPage();
650 $s .= $sep . $this->talkLink();
651 if ($articleExists && $action !="history") { $s .= $sep . $this->historyLink();}
652 $s.=$sep . $this->whatLinksHere();
654 if($wgOut->isArticle()) {
655 $s .= $sep . $this->watchPageLinksLink();
658 if ( Namespace::getUser() == $wgTitle->getNamespace()
659 ||
$wgTitle->getNamespace() == Namespace::getTalk(Namespace::getUser())
662 $id=User
::idFromName($wgTitle->getText());
663 $ip=User
::isIP($wgTitle->getText());
666 $s .= $sep . $this->userContribsLink();
668 if ( 0 != $wgUser->getID() ) {
669 if($id) { # can only email real users
670 $s .= $sep . $this->emailUserLink();
677 if ( 0 != $wgUser->getID() ) {
678 $s .= $this->specialLink( "upload" ) . $sep;
680 $s .= $this->specialLink( "specialpages" )
681 . $sep . $this->bugReportsLink();
688 function specialPagesList()
690 global $wgUser, $wgOut, $wgLang, $wgServer, $wgRedirectScript;
693 $validSP = $wgLang->getValidSpecialPages();
695 foreach ( $validSP as $name => $desc ) {
696 if ( "" == $desc ) { continue; }
699 if ( $wgUser->isSysop() )
701 $sysopSP = $wgLang->getSysopSpecialPages();
703 foreach ( $sysopSP as $name => $desc ) {
704 if ( "" == $desc ) { continue; }
708 if ( $wgUser->isDeveloper() )
710 $devSP = $wgLang->getDeveloperSpecialPages();
712 foreach ( $devSP as $name => $desc ) {
713 if ( "" == $desc ) { continue; }
718 $sp = wfMsg( "specialpages" );
719 $spp = $wgLang->specialPage( "Specialpages" );
721 $s = "<form id=\"specialpages\" method=\"get\" class=\"inline\" " .
722 "action=\"{$wgServer}{$wgRedirectScript}\">\n";
723 $s .= "<select name=\"wpDropdown\">\n";
724 $s .= "<option value=\"{$spp}\">{$sp}</option>\n";
726 foreach ( $a as $name => $desc ) {
727 $p = $wgLang->specialPage( $name );
728 $s .= "<option value=\"{$p}\">{$desc}</option>\n";
731 $s .= "<input type=submit value=\"{$go}\" name=redirect>\n";
736 function mainPageLink()
738 $mp = wfMsg( "mainpage" );
739 $s = $this->makeKnownLink( $mp, $mp );
743 function copyrightLink()
745 $s = $this->makeKnownLink( wfMsg( "copyrightpage" ),
746 wfMsg( "copyrightpagename" ) );
752 $s = $this->makeKnownLink( wfMsg( "aboutpage" ),
753 wfMsg( "aboutwikipedia" ) );
757 function editThisPage()
759 global $wgOut, $wgTitle, $oldid, $redirect, $diff;
761 if ( ! $wgOut->isArticle() ||
$diff ) {
762 $s = wfMsg( "protectedpage" );
763 } else if ( $wgTitle->userCanEdit() ) {
764 $n = $wgTitle->getPrefixedText();
765 $t = wfMsg( "editthispage" );
768 if ( $redirect ) { $red = "&redirect={$redirect}"; }
769 if ( $oldid && ! isset( $diff ) ) {
770 $oid = "&oldid={$oldid}";
772 $s = $this->makeKnownLink( $n, $t, "action=edit{$oid}{$red}" );
774 $s = wfMsg( "protectedpage" );
779 function deleteThisPage()
781 global $wgUser, $wgOut, $wgTitle, $diff;
783 if ( $wgTitle->getArticleId() && ( ! $diff ) && $wgUser->isSysop() ) {
784 $n = $wgTitle->getPrefixedText();
785 $t = wfMsg( "deletethispage" );
787 $s = $this->makeKnownLink( $n, $t, "action=delete" );
789 $s = wfMsg( "error" );
794 function protectThisPage()
796 global $wgUser, $wgOut, $wgTitle, $diff;
798 if ( $wgTitle->getArticleId() && ( ! $diff ) && $wgUser->isSysop() ) {
799 $n = $wgTitle->getPrefixedText();
801 if ( $wgTitle->isProtected() ) {
802 $t = wfMsg( "unprotectthispage" );
803 $q = "action=unprotect";
805 $t = wfMsg( "protectthispage" );
806 $q = "action=protect";
808 $s = $this->makeKnownLink( $n, $t, $q );
810 $s = wfMsg( "error" );
815 function watchThisPage()
817 global $wgUser, $wgOut, $wgTitle, $diff;
819 if ( $wgOut->isArticle() && ( ! $diff ) ) {
820 $n = $wgTitle->getPrefixedText();
822 if ( $wgTitle->userIsWatching() ) {
823 $t = wfMsg( "unwatchthispage" );
824 $q = "action=unwatch";
826 $t = wfMsg( "watchthispage" );
829 $s = $this->makeKnownLink( $n, $t, $q );
831 $s = wfMsg( "notanarticle" );
836 function moveThisPage()
838 global $wgTitle, $wgLang;
840 if ( $wgTitle->userCanEdit() ) {
841 $s = $this->makeKnownLink( $wgLang->specialPage( "Movepage" ),
842 wfMsg( "movethispage" ), "target=" . $wgTitle->getPrefixedURL() );
843 } // no message if page is protected - would be redundant
847 function historyLink()
851 $s = $this->makeKnownLink( $wgTitle->getPrefixedText(),
852 wfMsg( "history" ), "action=history" );
856 function whatLinksHere()
858 global $wgTitle, $wgLang;
860 $s = $this->makeKnownLink( $wgLang->specialPage( "Whatlinkshere" ),
861 wfMsg( "whatlinkshere" ), "target=" . $wgTitle->getPrefixedURL() );
865 function userContribsLink()
867 global $wgTitle, $wgLang;
869 $s = $this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
870 wfMsg( "contributions" ), "target=" . $wgTitle->getURL() );
874 function emailUserLink()
876 global $wgTitle, $wgLang;
878 $s = $this->makeKnownLink( $wgLang->specialPage( "Emailuser" ),
879 wfMsg( "emailuser" ), "target=" . $wgTitle->getURL() );
883 function watchPageLinksLink()
885 global $wgOut, $wgTitle, $wgLang;
887 if ( ! $wgOut->isArticle() ) {
888 $s = "(" . wfMsg( "notanarticle" ) . ")";
890 $s = $this->makeKnownLink( $wgLang->specialPage(
891 "Recentchangeslinked" ), wfMsg( "recentchangeslinked" ),
892 "target=" . $wgTitle->getPrefixedURL() );
897 function otherLanguages()
899 global $wgOut, $wgLang, $wgTitle , $wgUseNewInterlanguage ;
901 $a = $wgOut->getLanguageLinks();
902 if ( 0 == count( $a ) ) {
903 if ( !$wgUseNewInterlanguage ) return "";
904 $ns = $wgLang->getNsIndex ( $wgTitle->getNamespace () ) ;
905 if ( $ns != 0 AND $ns != 1 ) return "" ;
907 $x = "mode=addlink&xt=".$wgTitle->getDBkey() ;
908 return $this->makeKnownLink( $wgLang->specialPage( $pn ),
909 wfMsg( "intl" ) , $x );
912 if ( !$wgUseNewInterlanguage ) {
913 $s = wfMsg( "otherlanguages" ) . ": ";
915 global $wgLanguageCode ;
916 $x = "mode=zoom&xt=".$wgTitle->getDBkey() ;
917 $x .= "&xl=".$wgLanguageCode ;
918 $s = $this->makeKnownLink( $wgLang->specialPage( "Intl" ),
919 wfMsg( "otherlanguages" ) , $x ) . ": " ;
923 foreach( $a as $l ) {
924 if ( ! $first ) { $s .= " | "; }
927 $nt = Title
::newFromText( $l );
928 $url = $nt->getFullURL();
929 $text = $wgLang->getLanguageName( $nt->getInterwiki() );
931 if ( "" == $text ) { $text = $l; }
932 $style = $this->getExternalLinkAttributes( $l, $text );
933 $s .= "<a href=\"{$url}\"{$style}>{$text}</a>";
938 function bugReportsLink()
940 $s = $this->makeKnownLink( wfMsg( "bugreportspage" ),
941 wfMsg( "bugreports" ) );
948 $t1 = Title
::newFromText( gmdate( "F j" ) );
949 $t2 = Title
::newFromText( gmdate( "Y" ) );
951 $wgLinkCache->suspend();
952 $id = $t1->getArticleID();
953 $wgLinkCache->resume();
956 $s = $this->makeBrokenLink( $t1->getText() );
958 $s = $this->makeKnownLink( $t1->getText() );
962 $wgLinkCache->suspend();
963 $id = $t2->getArticleID();
964 $wgLinkCache->resume();
967 $s .= $this->makeBrokenLink( $t2->getText() );
969 $s .= $this->makeKnownLink( $t2->getText() );
976 global $wgLang, $wgTitle, $wgLinkCache;
978 $tns = $wgTitle->getNamespace();
979 if ( -1 == $tns ) { return ""; }
981 $pn = $wgTitle->getText();
982 $tp = wfMsg( "talkpage" );
983 if ( Namespace::isTalk( $tns ) ) {
984 $lns = Namespace::getSubject( $tns );
987 $text = wfMsg("articlepage");
990 $text = wfMsg("userpage");
993 $text = wfMsg("wikipediapage");
996 $text = wfMsg("imagepage");
999 $text= wfMsg("articlepage");
1003 $lns = Namespace::getTalk( $tns );
1006 $n = $wgLang->getNsText( $lns );
1007 if ( "" == $n ) { $link = $pn; }
1008 else { $link = "{$n}:{$pn}"; }
1010 $wgLinkCache->suspend();
1011 $s = $this->makeLink( $link, $text );
1012 $wgLinkCache->resume();
1017 # After all the page content is transformed into HTML, it makes
1018 # a final pass through here for things like table backgrounds.
1020 function transformContent( $text )
1025 # Note: This function MUST call getArticleID() on the link,
1026 # otherwise the cache won't get updated properly. See LINKCACHE.DOC.
1028 function makeLink( $title, $text= "", $query = "", $trail = "" )
1030 global $wgOut, $wgUser;
1032 $nt = Title
::newFromText( $title );
1034 if ( $nt->isExternal() ) {
1035 $u = $nt->getFullURL();
1036 if ( "" == $text ) { $text = $nt->getPrefixedText(); }
1037 $style = $this->getExternalLinkAttributes( $link, $text );
1040 if ( "" != $trail ) {
1041 if ( preg_match( "/^([a-z]+)(.*)$$/sD", $trail, $m ) ) {
1046 return "<a href=\"{$u}\"{$style}>{$text}{$inside}</a>{$trail}";
1048 if ( 0 == $nt->getNamespace() && "" == $nt->getText() ) {
1049 return $this->makeKnownLink( $title, $text, $query, $trail );
1051 if ( ( -1 == $nt->getNamespace() ) ||
1052 ( Namespace::getImage() == $nt->getNamespace() ) ) {
1053 return $this->makeKnownLink( $title, $text, $query, $trail );
1055 $aid = $nt->getArticleID() ;
1057 return $this->makeBrokenLink( $title, $text, $query, $trail );
1059 $threshold = $wgUser->getOption("stubthreshold") ;
1060 if ( $threshold > 0 ) {
1061 $res = wfQuery ( "SELECT HIGH_PRIORITY length(cur_text) AS x, cur_namespace, cur_is_redirect FROM cur WHERE cur_id='{$aid}'" ) ;
1063 if ( wfNumRows( $res ) > 0 ) {
1064 $s = wfFetchObject( $res );
1066 if ( $s->cur_is_redirect
OR $s->cur_namespace
!= 0 )
1067 $size = $threshold*2 ; # Really big
1068 wfFreeResult( $res );
1069 } else $size = $threshold*2 ; # Really big
1072 if ( $size < $threshold )
1073 return $this->makeStubLink( $title, $text, $query, $trail );
1074 return $this->makeKnownLink( $title, $text, $query, $trail );
1078 function makeKnownLink( $title, $text = "", $query = "", $trail = "" )
1080 global $wgOut, $wgTitle;
1082 $nt = Title
::newFromText( $title );
1083 $link = $nt->getPrefixedURL();
1085 if ( "" == $link ) {
1087 if ( "" == $text ) { $text = $nt->getFragment(); }
1089 $u = wfLocalUrlE( $link, $query );
1091 if ( "" != $nt->getFragment() ) {
1092 $u .= "#" . wfEscapeHTML( $nt->getFragment() );
1094 if ( "" == $text ) { $text = $nt->getPrefixedText(); }
1095 $style = $this->getInternalLinkAttributes( $link, $text );
1098 if ( "" != $trail ) {
1099 if ( preg_match( wfMsg("linktrail"), $trail, $m ) ) {
1104 $r = "<a href=\"{$u}\"{$style}>{$text}{$inside}</a>{$trail}";
1108 function makeBrokenLink( $title, $text = "", $query = "", $trail = "" )
1110 global $wgOut, $wgUser;
1112 $nt = Title
::newFromText( $title );
1113 $link = $nt->getPrefixedURL();
1115 if ( "" == $query ) { $q = "action=edit"; }
1116 else { $q = "action=edit&{$query}"; }
1117 $u = wfLocalUrlE( $link, $q );
1119 if ( "" == $text ) { $text = $nt->getPrefixedText(); }
1120 $style = $this->getInternalLinkAttributes( $link, $text, "yes" );
1123 if ( "" != $trail ) {
1124 if ( preg_match( wfMsg("linktrail"), $trail, $m ) ) {
1129 if ( $wgOut->isPrintable() ||
1130 ( 1 == $wgUser->getOption( "highlightbroken" ) ) ) {
1131 $s = "<a href=\"{$u}\"{$style}>{$text}{$inside}</a>{$trail}";
1133 $s = "{$text}{$inside}<a href=\"{$u}\"{$style}>?</a>{$trail}";
1138 function makeStubLink( $title, $text = "", $query = "", $trail = "" )
1140 global $wgOut, $wgUser;
1142 $nt = Title
::newFromText( $title );
1143 $link = $nt->getPrefixedURL();
1145 $u = wfLocalUrlE( $link, $query );
1147 if ( "" == $text ) { $text = $nt->getPrefixedText(); }
1148 $style = $this->getInternalLinkAttributes( $link, $text, "stub" );
1151 if ( "" != $trail ) {
1152 if ( preg_match( wfMsg("linktrail"), $trail, $m ) ) {
1157 if ( $wgOut->isPrintable() ||
1158 ( 1 == $wgUser->getOption( "highlightbroken" ) ) ) {
1159 $s = "<a href=\"{$u}\"{$style}>{$text}{$inside}</a>{$trail}";
1161 $s = "{$text}{$inside}<a href=\"{$u}\"{$style}>!</a>{$trail}";
1166 function fnamePart( $url )
1168 $basename = strrchr( $url, "/" );
1169 if ( false === $basename ) { $basename = $url; }
1170 else { $basename = substr( $basename, 1 ); }
1171 return wfEscapeHTML( $basename );
1174 function makeImage( $url, $alt = "" )
1178 if ( "" == $alt ) { $alt = $this->fnamePart( $url ); }
1179 $s = "<img src=\"{$url}\" alt=\"{$alt}\">";
1183 function makeImageLink( $name, $url, $alt = "" )
1185 global $wgOut, $wgTitle, $wgLang;
1187 $nt = Title
::newFromText( $wgLang->getNsText(
1188 Namespace::getImage() ) . ":{$name}" );
1189 $link = $nt->getPrefixedURL();
1190 if ( "" == $alt ) { $alt = $name; }
1192 $u = wfLocalUrlE( $link );
1193 $s = "<a href=\"{$u}\" class='image' title=\"{$alt}\">" .
1194 "<img border=0 src=\"{$url}\" alt=\"{$alt}\"></a>";
1198 function makeMediaLink( $name, $url, $alt = "" )
1200 global $wgOut, $wgTitle;
1202 if ( "" == $alt ) { $alt = $name; }
1203 $u = wfEscapeHTML( $url );
1204 $s = "<a href=\"{$u}\" class='internal' title=\"{$alt}\">{$alt}</a>";
1208 function specialLink( $name, $key = "" )
1212 if ( "" == $key ) { $key = strtolower( $name ); }
1213 $pn = $wgLang->ucfirst( $name );
1214 return $this->makeKnownLink( $wgLang->specialPage( $pn ),
1218 # Called by history lists and recent changes
1221 function beginRecentChangesList()
1223 $rc_cache = array() ;
1225 $this->lastdate
= "";
1229 function beginHistoryList()
1231 $this->lastdate
= $this->lastline
= "";
1232 $s = "\n<p>" . wfMsg( "histlegend" ) . "\n<ul>";
1236 function beginImageHistoryList()
1238 $s = "\n<h2>" . wfMsg( "imghistory" ) . "</h2>\n" .
1239 "<p>" . wfMsg( "imghistlegend" ) . "\n<ul>";
1243 function endRecentChangesList()
1245 $s = $this->recentChangesBlock() ;
1250 function endHistoryList()
1252 $last = wfMsg( "last" );
1254 $s = preg_replace( "/!OLDID![0-9]+!/", $last, $this->lastline
);
1259 function endImageHistoryList()
1265 function historyLine( $ts, $u, $ut, $ns, $ttl, $oid, $c, $isminor )
1269 $artname = Title
::makeName( $ns, $ttl );
1270 $last = wfMsg( "last" );
1271 $cur = wfMsg( "cur" );
1272 $cr = wfMsg( "currentrev" );
1274 if ( $oid && $this->lastline
) {
1275 $ret = preg_replace( "/!OLDID!([0-9]+)!/", $this->makeKnownLink(
1276 $artname, $last, "diff=\\1&oldid={$oid}" ), $this->lastline
);
1280 $dt = $wgLang->timeanddate( $ts, true );
1282 if ( $oid ) { $q = "oldid={$oid}"; }
1284 $link = $this->makeKnownLink( $artname, $dt, $q );
1287 $ul = $this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
1288 $ut, "target=" . $ut );
1289 } else { $ul = $this->makeLink( $wgLang->getNsText(
1290 Namespace::getUser() ) . ":{$ut}", $ut ); }
1294 $curlink = $this->makeKnownLink( $artname, $cur,
1295 "diff=0&oldid={$oid}" );
1299 $s .= "({$curlink}) (!OLDID!{$oid}!) . .";
1301 $M = wfMsg( "minoreditletter" );
1302 if ( $isminor ) { $s .= " <strong>{$M}</strong>"; }
1303 $s .= " {$link} . . {$ul}";
1305 if ( "" != $c && "*" != $c ) { $s .= " <em>(" . wfEscapeHTML($c) . ")</em>"; }
1308 $this->lastline
= $s;
1312 function recentChangesBlockLine ( $y ) {
1313 global $wgUploadPath ;
1315 $M = wfMsg( "minoreditletter" );
1316 $N = wfMsg( "newpageletter" );
1318 $r .= "<img src='{$wgUploadPath}/Arr_.png' width=12 height=12 border=0>" ;
1320 if ( $y->isnew
) $r .= $N ;
1321 else $r .= " " ;
1322 if ( $y->isminor
) $r .= $M ;
1323 else $r .= " " ;
1324 $r .= " ".$y->timestamp
." " ;
1327 if ( $y->watched
) $link = "<strong>{$link}</strong>" ;
1333 $r .= $this->makeKnownLink( $y->secureName
, wfMsg( "hist" ), "action=history" );
1335 $r .= ") . . ".$y->userlink
;
1336 $r .= $y->usertalklink
;
1337 if ( $y->usercomment
!= "" )
1338 $r .= " <em>(".wfEscapeHTML($y->usercomment
).")</em>" ;
1343 function recentChangesBlockGroup ( $y ) {
1344 global $wgUploadPath ;
1347 $M = wfMsg( "minoreditletter" );
1348 $N = wfMsg( "newpageletter" );
1350 $userlinks = array () ;
1351 foreach ( $y AS $x ) {
1352 $oldid = $x->diffid
;
1353 if ( $x->isnew
) $isnew = true ;
1355 if ( !isset ( $userlinks[$u] ) ) $userlinks[$u] = 0 ;
1359 krsort ( $userlinks ) ;
1360 asort ( $userlinks ) ;
1362 $u = array_keys ( $userlinks ) ;
1363 foreach ( $u as $x ) {
1365 if ( $userlinks[$x] > 1 ) $z .= " ({$userlinks[$x]}×)" ;
1366 array_push ( $users , $z ) ;
1368 $users = " <font size='-1'>[".implode("; ",$users)."]</font>" ;
1371 $e = array_shift ( $e ) ;
1374 $rci = "RCI{$this->rccc}" ;
1375 $rcl = "RCL{$this->rccc}" ;
1376 $rcm = "RCM{$this->rccc}" ;
1377 $tl = "<a href='javascript:toggleVisibility(\"{$rci}\",\"{$rcm}\",\"{$rcl}\")'>" ;
1378 $tl .= "<span id='{$rcm}'><img src='{$wgUploadPath}/Arr_r.png' width=12 height=12 border=0></span>" ;
1379 $tl .= "<span id='{$rcl}' style='display:none'><img src='{$wgUploadPath}/Arr_d.png' width=12 height=12 border=0></span>" ;
1385 if ( $isnew ) $r .= $N ;
1386 else $r .= " " ;
1387 $r .= " " ; # Minor
1388 $r .= " ".$e->timestamp
." " ;
1392 if ( $e->watched
) $link = "<strong>{$link}</strong>" ;
1396 $r .= " (".count($y)." " ;
1397 if ( $isnew ) $r .= wfMsg("changes");
1398 else $r .= $this->makeKnownLink( $e->secureName
, wfMsg("changes") , "diff=0&oldid=".$oldid ) ;
1400 $r .= $this->makeKnownLink( $e->secureName
, wfMsg( "history" ), "action=history" );
1408 $r .= "<div id='{$rci}' style='display:none'>" ;
1409 foreach ( $y AS $x )
1411 $r .= "<img src='{$wgUploadPath}/Arr_.png' width=12 height=12 border=0>";
1412 $r .= "<tt> " ;
1413 if ( $x->isnew
) $r .= $N ;
1414 else $r .= " " ;
1415 if ( $x->isminor
) $r .= $M ;
1416 else $r .= " " ;
1420 if ( $x->oldid
!= 0 ) $o = "oldid=".$x->oldid
;
1421 if ( $x->islog
) $link = $x->timestamp
;
1422 else $link = $this->makeKnownLink( $x->secureName
, $x->timestamp
, $o ) ;
1423 $link = "<tt>{$link}</tt>" ;
1430 $r .= $x->lastlink
;
1431 $r .= ") . . ".$x->userlink
;
1432 $r .= $x->usertalklink
;
1433 if ( $x->usercomment
!= "" )
1434 $r .= " <em>(".wfEscapeHTML($x->usercomment
).")</em>" ;
1443 function recentChangesBlock ()
1445 global $wgUploadPath ;
1446 if ( count ( $this->rc_cache
) == 0 ) return "" ;
1447 $k = array_keys ( $this->rc_cache
) ;
1448 foreach ( $k AS $x )
1450 $y = $this->rc_cache
[$x] ;
1451 if ( count ( $y ) < 2 ) {
1452 $r .= $this->recentChangesBlockLine ( array_shift ( $y ) ) ;
1454 $r .= $this->recentChangesBlockGroup ( $y ) ;
1458 return "<div align=left>{$r}</div>" ;
1461 function recentChangesLine( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched = false, $oldid = 0 , $diffid = 0 )
1464 $usenew = $wgUser->getOption( "usenewrc" );
1466 $r = $this->recentChangesLineNew ( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched , $oldid , $diffid ) ;
1468 $r = $this->recentChangesLineOld ( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched , $oldid , $diffid ) ;
1472 function recentChangesLineOld( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched = false, $oldid = 0, $diffid = 0 )
1474 global $wgTitle, $wgLang, $wgUser;
1476 $d = $wgLang->date( $ts, true);
1478 if ( $d != $this->lastdate
) {
1479 if ( "" != $this->lastdate
) { $s .= "</ul>\n"; }
1480 $s .= "<h4>{$d}</h4>\n<ul>";
1481 $this->lastdate
= $d;
1483 $h = $wgLang->time( $ts, true );
1484 $t = Title
::makeName( $ns, $ttl );
1485 $clink = $this->makeKnownLink( $t , "" );
1486 $nt = Title
::newFromText( $t );
1489 $clink = "<strong>{$clink}</strong>";
1491 $hlink = $this->makeKnownLink( $t, wfMsg( "hist" ), "action=history" );
1492 if ( $isnew ||
$nt->isLog() ) {
1493 $dlink = wfMsg( "diff" );
1495 $dlink = $this->makeKnownLink( $t, wfMsg( "diff" ),
1496 "diff={$oldid}&oldid={$diffid}" ); # Finagle's law
1499 $ul = $this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
1500 $ut, "target=" . $ut );
1501 } else { $ul = $this->makeLink( $wgLang->getNsText(
1502 Namespace::getUser() ) . ":{$ut}", $ut ); }
1504 $utns=$wgLang->getNsText(Namespace::getTalk(Namespace::getUser()));
1505 $talkname=$wgLang->getNsText(Namespace::getTalk(0)); # use the shorter name
1506 $utl= $this->makeLink($utns . ":{$ut}", $talkname );
1507 $cr = wfMsg( "currentrev" );
1509 $s .= "<li> ({$dlink}) ({$hlink}) . .";
1510 $M = wfMsg( "minoreditletter" );
1511 $N = wfMsg( "newpageletter" );
1512 if ( $isminor ) { $s .= " <strong>{$M}</strong>"; }
1513 if ( $isnew ) { $s .= "<strong>{$N}</strong>"; }
1514 $s .= " {$clink}; {$h} . . {$ul}";
1517 if ( ( 0 == $u ) && $wgUser->isSysop() ) {
1518 $blink = $this->makeKnownLink( $wgLang->specialPage(
1519 "Blockip" ), wfMsg( "blocklink" ), "ip={$ut}" );
1525 $utl = "({$utl} | {$blink})";
1529 if ( "" != $c && "*" != $c ) {
1530 $s .= " <em>(" . wfEscapeHTML( $c ) . ")</em>";
1537 function recentChangesLineNew( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched = false, $oldid = 0 , $diffid = 0 )
1539 global $wgTitle, $wgLang, $wgUser;
1541 $rc = new RecentChangesClass
;
1543 $d = $wgLang->date( $ts, true);
1546 if ( $d != $this->lastdate
) {
1547 $ret = $this->recentChangesBlock () ;
1548 $this->rc_cache
= array() ;
1549 $ret .= "<h4>{$d}</h4>\n";
1550 $this->lastdate
= $d;
1552 $h = $wgLang->time( $ts, true );
1553 $t = Title
::makeName( $ns, $ttl );
1554 $clink = $this->makeKnownLink( $t, "" ) ;
1555 if ( $oldid == 0 ) $c2link = $clink ;
1556 else $c2link = $this->makeKnownLink( $t, "" , "oldid={$oldid}" );
1557 $nt = Title
::newFromText( $t );
1559 $rc->timestamp
= $h ;
1560 $rc->oldid
= $oldid ;
1561 $rc->diffid
= $diffid ;
1562 $rc->watched
= $watched ;
1563 $rc->isnew
= $isnew ;
1564 $rc->isminor
= $isminor ;
1565 $rc->secureName
= $t ;
1566 $rc->displayName
= $nt ;
1567 $rc->link
= $clink ;
1568 $rc->usercomment
= $c ;
1569 $rc->islog
= $nt->isLog() ;
1571 if ( ( $isnew && $oldid == 0 ) ||
$nt->isLog() ) {
1572 $dlink = wfMsg( "cur" );
1574 $dlink = $this->makeKnownLink( $t, wfMsg( "cur" ),
1575 "diff=0&oldid={$oldid}" );
1578 if ( $diffid == 0 ||
$nt->isLog() ) {
1579 $plink = wfMsg( "last" );
1581 $plink = $this->makeKnownLink( $t, wfMsg( "last" ),
1582 "diff={$oldid}&oldid={$diffid}" );
1586 $ul = $this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
1587 $ut, "target=" . $ut );
1588 } else { $ul = $this->makeLink( $wgLang->getNsText(
1589 Namespace::getUser() ) . ":{$ut}", $ut ); }
1591 $rc->userlink
= $ul ;
1592 $rc->lastlink
= $plink ;
1593 $rc->curlink
= $dlink ;
1595 $utns=$wgLang->getNsText(Namespace::getTalk(Namespace::getUser()));
1596 $talkname=$wgLang->getNsText(Namespace::getTalk(0)); # use the shorter name
1597 $utl= $this->makeLink($utns . ":{$ut}", $talkname );
1599 if ( ( 0 == $u ) && $wgUser->isSysop() ) {
1600 $blink = $this->makeKnownLink( $wgLang->specialPage(
1601 "Blockip" ), wfMsg( "blocklink" ), "ip={$ut}" );
1602 $rc->usertalklink
= " ({$utl} | {$blink})";
1604 $rc->usertalklink
=" ({$utl})";
1607 if ( !isset ( $this->rc_cache
[$t] ) ) $this->rc_cache
[$t] = array() ;
1608 array_push ( $this->rc_cache
[$t] , $rc ) ;
1613 function imageHistoryLine( $iscur, $ts, $img, $u, $ut, $size, $c )
1615 global $wgUser, $wgLang, $wgTitle;
1617 $dt = $wgLang->timeanddate( $ts, true );
1618 $del = wfMsg( "deleteimg" );
1619 $cur = wfMsg( "cur" );
1622 $url = wfImageUrl( $img );
1624 if ( $wgUser->isSysop() ) {
1625 $link = wfLocalUrlE( "", "image=" . $wgTitle->getURL() .
1627 $style = $this->getInternalLinkAttributes( $link, $del );
1629 $dlink = "<a href=\"{$link}\"{$style}>{$del}</a>";
1634 $url = wfEscapeHTML( wfImageArchiveUrl( $img ) );
1635 if( $wgUser->getID() != 0 ) {
1636 $rlink = $this->makeKnownLink( $wgTitle->getPrefixedText(),
1637 wfMsg( "revertimg" ), "action=revert&oldimage=" .
1638 urlencode( $img ) );
1639 $dlink = $this->makeKnownLink( $wgTitle->getPrefixedText(),
1640 $del, "action=delete&oldimage=" . urlencode( $img ) );
1642 # Having live active links for non-logged in users
1643 # means that bots and spiders crawling our site can
1644 # inadvertently change content. Baaaad idea.
1645 $rlink = wfMsg( "revertimg" );
1649 if ( 0 == $u ) { $ul = $ut; }
1650 else { $ul = $this->makeLink( $wgLang->getNsText(
1651 Namespace::getUser() ) . ":{$ut}", $ut ); }
1653 $nb = str_replace( "$1", $size, wfMsg( "nbytes" ) );
1654 $style = $this->getInternalLinkAttributes( $url, $dt );
1656 $s = "<li> ({$dlink}) ({$rlink}) <a href=\"{$url}\"{$style}>{$dt}</a>"
1657 . " . . {$ul} ({$nb})";
1659 if ( "" != $c && "*" != $c ) {
1660 $s .= " <em>(" . wfEscapeHTML( $c ) . ")</em>";
1666 function tocIndent($level) {
1668 while($level-->0) $rv.="<div style=\"margin-left:2em;\">\n";
1673 function tocUnindent($level) {
1674 while($level-->0) $rv.="</div>\n";
1678 // parameter level defines if we are on an indentation level
1679 function tocLine($anchor,$tocline,$level) {
1683 return "<A CLASS=\"internal\" HREF=\"#".$anchor."\">".$tocline."</A><BR>\n";
1686 return "<div style=\"margin-bottom:0px;\">\n".
1687 "<A CLASS=\"internal\" HREF=\"#".$anchor."\">".$tocline."</A><BR>\n".
1693 function tocTable($toc) {
1695 /* does not auto-expand, use table for now
1697 <div><div style=\"border-width:1px;background-color:#f3f3ff;border-color:#8888aa;border-style:solid;padding:1em;padding-bottom:1em;\">
1698 <b>".wfMsg("toc")."</b><P>
1702 "<table border=\"0\" bgcolor=\"#8888aa\" cellpadding=\"0\" cellspacing=\"1\"><tr><td>\n" .
1703 "<table border=\"0\" bgcolor=\"#f3f3ff\" CELLPADDING=5><tr><td>\n".
1704 "<b>".wfMsg("toc")."</b>" .
1705 " <script type='text/javascript'>showTocToggle(\"" . wfMsg("showtoc") . "\",\"" . wfMsg("hidetoc") . "\")</script>" .
1706 "</td></tr><tr id='tocinside'><td>\n".
1707 $toc."</td></tr></table></td></tr></table><P>\n";
1710 function editSectionLink($section) {
1712 global $wgTitle,$wgUser,$oldid;
1713 if($wgTitle->isProtected() && !$wgUser->isSysop()) return "";
1714 if($oldid) return "";
1715 $editurl="§ion={$section}";
1716 $url=$this->makeKnownLink($wgTitle->getPrefixedText(),wfMsg("editsection"),"action=edit".$editurl);
1717 return "<div style=\"float:right;margin-left:5px;\"><small>[".$url."]</small></div>";
1722 include_once( "SkinStandard.php" );
1723 include_once( "SkinNostalgia.php" );
1724 include_once( "SkinCologneBlue.php" );