99400a8f971a1fc963c58274c9bdac72d2319ce5
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" #, "Smarty", "Montparnasse"
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 $fname = "Skin::initPage";
74 wfProfileIn( $fname );
76 $wgOut->addLink( "shortcut icon", "", "/favicon.ico" );
77 if ( $wgOut->isPrintable() ) { $ss = "wikiprintable.css"; }
78 else { $ss = $this->getStylesheet(); }
79 $wgOut->addLink( "stylesheet", "", "{$wgStyleSheetPath}/{$ss}" );
80 wfProfileOut( $fname );
83 function outputPage( &$out ) {
84 wfProfileIn( "Skin::outputPage" );
86 $out->out( $out->headElement() );
88 $out->out( "\n<body" );
89 $ops = $this->getBodyOptions();
90 foreach ( $ops as $name => $val ) {
91 $out->out( " $name='$val'" );
94 if ( $wgDebugComments ) {
95 $out->out( "<!-- Wiki debugging output:\n" .
96 $out->mDebugtext
. "-->\n" );
98 $out->out( $this->beforeContent() );
100 $out->out( $out->mBodytext
);
102 $out->out( $this->afterContent() );
105 $out->out( $out->reportTime() );
107 $out->out( "\n</body></html>" );
110 function getHeadScripts() {
111 global $wgStyleSheetPath;
112 $r = "<script type=\"text/javascript\" src=\"{$wgStyleSheetPath}/wikibits.js\"></script>\n";
116 function getUserStyles()
118 $s = "<style type='text/css'><!--\n";
119 $s .= $this->doGetUserStyles();
120 $s .= "//--></style>\n";
124 function doGetUserStyles()
129 if ( 1 == $wgUser->getOption( "underline" ) ) {
130 # Don't override browser settings
133 $s .= "a.stub, a.new, a.internal, a.external { " .
134 "text-decoration: none; }\n";
136 if ( 1 == $wgUser->getOption( "highlightbroken" ) ) {
137 $s .= "a.new, #quickbar a.new { color: #CC2200; }\n";
139 if ( 1 == $wgUser->getOption( "justify" ) ) {
140 $s .= "#article { text-align: justify; }\n";
145 function getBodyOptions()
147 global $wgUser, $wgTitle, $wgNamespaceBackgrounds, $wgOut, $oldid, $redirect, $diff,$action;
149 if ( 0 != $wgTitle->getNamespace() ) {
150 $a = array( "bgcolor" => "#ffffec" );
152 else $a = array( "bgcolor" => "#FFFFFF" );
153 if($wgOut->isArticle() && $wgUser->getOption("editondblclick")
155 (!$wgTitle->isProtected() ||
$wgUser->isSysop())
158 $n = $wgTitle->getPrefixedURL();
159 $t = wfMsg( "editthispage" );
161 if ( $redirect ) { $red = "&redirect={$redirect}"; }
162 if ( $oldid && ! isset( $diff ) ) {
163 $oid = "&oldid={$oldid}";
165 $s = wfLocalUrlE($n,"action=edit{$oid}{$red}");
166 $s = "document.location = \"" .$s ."\";";
167 $a +
= array ("ondblclick" => $s);
170 if($action=="edit") { # set focus in edit box
171 $foc = "document.editform.wpTextbox1.focus()";
173 $a['onload'] .= ";$foc";
181 function getExternalLinkAttributes( $link, $text )
183 global $wgUser, $wgOut, $wgLang;
185 $link = urldecode( $link );
186 $link = $wgLang->checkTitleEncoding( $link );
187 $link = str_replace( "_", " ", $link );
188 $link = wfEscapeHTML( $link );
190 if ( $wgOut->isPrintable() ) { $r = " class='printable'"; }
191 else { $r = " class='external'"; }
193 if ( 1 == $wgUser->getOption( "hover" ) ) {
194 $r .= " title=\"{$link}\"";
199 function getInternalLinkAttributes( $link, $text, $broken = false )
201 global $wgUser, $wgOut;
203 $link = urldecode( $link );
204 $link = str_replace( "_", " ", $link );
205 $link = wfEscapeHTML( $link );
207 if ( $wgOut->isPrintable() ) {
208 $r = " class='printable'";
209 } else if ( $broken == "stub" ) {
210 $r = " class='stub'";
211 } else if ( $broken == "yes" ) {
214 $r = " class='internal'";
217 if ( 1 == $wgUser->getOption( "hover" ) ) {
218 $r .= " title=\"{$link}\"";
223 function getInternalLinkAttributesObj( &$nt, $text, $broken = false )
225 global $wgUser, $wgOut;
226 $link = $nt->getEscapedText();
228 if ( $wgOut->isPrintable() ) {
229 $r = " class='printable'";
230 } else if ( $broken == "stub" ) {
231 $r = " class='stub'";
232 } else if ( $broken == "yes" ) {
235 $r = " class='internal'";
238 if ( 1 == $wgUser->getOption( "hover" ) ) {
239 $r .= ' title ="' . $nt->getEscapedText() . '"';
250 # This will be called immediately after the <body> tag. Split into
251 # two functions to make it easier to subclass.
253 function beforeContent()
255 global $wgUser, $wgOut;
257 if ( $wgOut->isPrintable() ) {
258 $s = $this->pageTitle() . $this->pageSubtitle() . "\n";
259 $s .= "\n<div class='bodytext'>";
262 return $this->doBeforeContent();
265 function doBeforeContent()
267 global $wgUser, $wgOut, $wgTitle, $wgLang;
268 $fname = "Skin::doBeforeContent";
269 wfProfileIn( $fname );
272 $qb = $this->qbSetting();
274 if( $langlinks = $this->otherLanguages() ) {
280 $borderhack = "class='top'";
283 $s .= "\n<div id='content'>\n<div id='topbar'>" .
284 "<table width='98%' border=0 cellspacing=0><tr>";
287 $left = ($qb == 1 ||
$qb == 3);
288 if($wgLang->isRTL()) $left = !$left;
291 $s .= "<td class='top' align=left valign=top rowspan='{$rows}'>" .
292 $this->logoText() . "</td>";
294 $s .= $this->getQuickbarCompensator( $rows );
296 $l = $wgLang->isRTL() ?
"right" : "left";
297 $s .= "<td {$borderhack} align='$l' valign='top'>";
299 $s .= $this->topLinks() ;
300 $s .= "<p class='subtitle'>" . $this->pageTitleLinks();
302 $r = $wgLang->isRTL() ?
"left" : "right";
303 $s .= "</td>\n<td {$borderhack} valign='top' align='$r' nowrap>";
304 $s .= $this->nameAndLogin();
305 $s .= "\n<br>" . $this->searchForm() . "</td>";
308 $s .= "</tr>\n<tr><td class='top' colspan=\"2\">$langlinks</td>";
311 if ( $shove && !$left ) { # Right
312 $s .= $this->getQuickbarCompensator( $rows );
314 $s .= "</tr></table>\n</div>\n";
315 $s .= "\n<div id='article'>";
317 $s .= $this->pageTitle();
318 $s .= $this->pageSubtitle() ;
319 $s .= getCategories(); // For some odd reason, zhis can't be a function of the object
321 wfProfileOut( $fname );
325 function getQuickbarCompensator( $rows = 1 )
327 return "<td width='152' rowspan='{$rows}'> </td>";
330 # This gets called immediately before the </body> tag.
332 function afterContent()
334 global $wgUser, $wgOut, $wgServer, $HTTP_SERVER_VARS;
337 if ( $wgOut->isPrintable() ) {
340 $u = $wgServer . $wgTitle->getFullURL();
341 $rf = wfMsg( "retrievedfrom", $u );
343 if ( $wgOut->isArticle() ) {
344 $lm = "<br>" . $this->lastModified();
347 $cr = wfMsg( "gnunote" );
348 $s .= "<p><em>{$rf}{$lm} {$cr}</em>\n";
351 return $this->doAfterContent();
354 function doAfterContent()
356 global $wgUser, $wgOut, $wgLang;
357 $fname = "Skin::doAfterContent";
358 wfProfileIn( $fname );
360 $s = "\n</div><br clear=all>\n";
362 $s .= "\n<div id='footer'>";
363 $s .= "<table width='98%' border=0 cellspacing=0><tr>";
365 $qb = $this->qbSetting();
367 $left = ($qb == 1 ||
$qb == 3);
368 if($wgLang->isRTL()) $left = !$left;
370 if ( $shove && $left ) { # Left
371 $s .= $this->getQuickbarCompensator();
373 $l = $wgLang->isRTL() ?
"right" : "left";
374 $s .= "<td class='bottom' align='$l' valign='top'>";
376 $s .= $this->bottomLinks();
377 $s .= "\n<br>" . $this->mainPageLink()
378 . " | " . $this->aboutLink()
379 . " | " . $this->specialLink( "recentchanges" )
380 . " | " . $this->searchForm()
381 . "<br>" . $this->pageStats();
384 if ( $shove && !$left ) { # Right
385 $s .= $this->getQuickbarCompensator();
387 $s .= "</tr></table>\n</div>\n</div>\n";
389 if ( 0 != $qb ) { $s .= $this->quickBar(); }
390 wfProfileOut( $fname );
394 function pageTitleLinks()
396 global $wgOut, $wgTitle, $oldid, $action, $diff, $wgUser, $wgLang, $wgUseApproval ;
398 $s = $this->printableLink();
400 if ( $wgOut->isArticle() ) {
401 if ( $wgTitle->getNamespace() == Namespace::getImage() ) {
402 $name = $wgTitle->getDBkey();
403 $link = wfEscapeHTML( wfImageUrl( $name ) );
404 $style = $this->getInternalLinkAttributes( $link, $name );
405 $s .= " | <a href=\"{$link}\"{$style}>{$name}</a>";
407 # This will show the "Approve" link if $wgUseApproval=true;
408 if ( isset ( $wgUseApproval ) && $wgUseApproval )
410 $t = $wgTitle->getDBkey();
411 $name = "Approve this article" ;
412 $link = "http://test.wikipedia.org/w/magnus/wiki.phtml?title={$t}&action=submit&doit=1" ;
413 #wfEscapeHTML( wfImageUrl( $name ) );
414 $style = $this->getExternalLinkAttributes( $link, $name );
415 $s .= " | <a href=\"{$link}\"{$style}>{$name}</a>" ;
417 if ( "history" == $action ||
isset( $diff ) ||
isset( $oldid ) ) {
418 $s .= " | " . $this->makeKnownLink( $wgTitle->getPrefixedText(),
419 wfMsg( "currentrev" ) );
422 if ( $wgUser->getNewtalk() ) {
423 # do not show "You have new messages" text when we are viewing our
426 if(!(strcmp($wgTitle->getText(),$wgUser->getName()) == 0 &&
427 $wgTitle->getNamespace()==Namespace::getTalk(Namespace::getUser()))) {
428 $n =$wgUser->getName();
429 $tl = $this->makeKnownLink( $wgLang->getNsText(
430 Namespace::getTalk( Namespace::getUser() ) ) . ":{$n}",
431 wfMsg("newmessageslink") );
432 $s.=" | <strong>". str_replace( "$1", $tl, wfMsg("newmessages") ) . "</strong>";
435 if( $wgUser->isSysop() &&
436 (($wgTitle->getArticleId() == 0) ||
($action == "history")) &&
437 ($n = $wgTitle->isDeleted() ) ) {
438 $s .= " | " . wfMsg( "thisisdeleted",
439 $this->makeKnownLink(
440 $wgLang->SpecialPage( "Undelete/" . $wgTitle->getPrefixedDBkey() ),
441 wfMsg( "restorelink", $n ) ) );
446 function printableLink()
448 global $wgOut, $wgTitle, $oldid, $action;
450 if ( "history" == $action ) { $q = "action=history&"; }
453 $s = $this->makeKnownLink( $wgTitle->getPrefixedText(),
454 WfMsg( "printableversion" ), "{$q}printable=yes" );
460 global $wgOut, $wgTitle, $wgUser;
462 $s = "<h1 class='pagetitle'>" . $wgOut->getPageTitle() . "</h1>";
463 if($wgUser->getOption("editsectiononrightclick") && $wgTitle->userCanEdit()) { $s=$this->editSectionScript(0,$s);}
467 function pageSubtitle()
469 global $wgOut,$wgTitle,$wgNamespacesWithSubpages;
471 $sub = $wgOut->getSubtitle();
472 if ( "" == $sub ) { $sub = wfMsg( "fromwikipedia" ); }
473 if($wgOut->isArticle() && $wgNamespacesWithSubpages[$wgTitle->getNamespace()]) {
474 $ptext=$wgTitle->getPrefixedText();
475 if(preg_match("/\//",$ptext)) {
476 $sub.="</p><p class='subpages'>";
477 $links=explode("/",$ptext);
480 foreach($links as $link) {
482 if ($c<count($links)) {
484 $getlink=$this->makeLink( $growingLink, $link);
485 if(preg_match("/class='new'/i",$getlink)) { break; } # this is a hack, but it saves time
498 $s = "<p class='subtitle'>{$sub}\n";
502 function nameAndLogin()
504 global $wgUser, $wgTitle, $wgLang, $wgShowIPinHeader;
506 $li = $wgLang->specialPage( "Userlogin" );
507 $lo = $wgLang->specialPage( "Userlogout" );
510 if ( 0 == $wgUser->getID() ) {
511 if( $wgShowIPinHeader ) {
512 $n = getenv( "REMOTE_ADDR" );
514 $tl = $this->makeKnownLink( $wgLang->getNsText(
515 Namespace::getTalk( Namespace::getUser() ) ) . ":{$n}",
516 $wgLang->getNsText( Namespace::getTalk( 0 ) ) );
518 $s .= $n . " (".$tl.")";
520 $s .= wfMsg("notloggedin");
523 $rt = $wgTitle->getPrefixedURL();
524 if ( 0 == strcasecmp( urlencode( $lo ), $rt ) ) {
526 } else { $q = "returnto={$rt}"; }
528 $s .= "\n<br>" . $this->makeKnownLink( $li,
529 wfMsg( "login" ), $q );
531 $n = $wgUser->getName();
532 $rt = $wgTitle->getPrefixedURL();
533 $tl = $this->makeKnownLink( $wgLang->getNsText(
534 Namespace::getTalk( Namespace::getUser() ) ) . ":{$n}",
535 $wgLang->getNsText( Namespace::getTalk( 0 ) ) );
539 $s .= $this->makeKnownLink( $wgLang->getNsText(
540 Namespace::getUser() ) . ":{$n}", $n ) . "{$tl}<br>" .
541 $this->makeKnownLink( $lo, wfMsg( "logout" ),
542 "returnto={$rt}" ) . " | " .
543 $this->specialLink( "preferences" );
545 $s .= " | " . $this->makeKnownLink( wfMsg( "helppage" ),
551 function searchForm()
555 $s = "<form name='search' class='inline' method=get action=\""
556 . wfLocalUrl( "" ) . "\">"
557 . "<input type=text name=\"search\" size=19 value=\""
558 . htmlspecialchars(substr($search,0,256)) . "\">\n"
559 . "<input type=submit name=\"go\" value=\"" . wfMsg ("go") . "\"> "
560 . "<input type=submit value=\"" . wfMsg ("search") . "\"></form>";
570 $s = $this->mainPageLink() . $sep
571 . $this->specialLink( "recentchanges" );
573 if ( $wgOut->isArticle() ) {
574 $s .= $sep . $this->editThisPage()
575 . $sep . $this->historyLink();
577 # Many people don't like this dropdown box
578 #$s .= $sep . $this->specialPagesList();
583 function bottomLinks()
585 global $wgOut, $wgUser, $wgTitle;
589 if ( $wgOut->isArticle() ) {
590 $s .= "<strong>" . $this->editThisPage() . "</strong>";
591 if ( 0 != $wgUser->getID() ) {
592 $s .= $sep . $this->watchThisPage();
594 $s .= $sep . $this->talkLink()
595 . $sep . $this->historyLink()
596 . $sep . $this->whatLinksHere()
597 . $sep . $this->watchPageLinksLink();
599 if ( $wgTitle->getNamespace() == Namespace::getUser()
600 ||
$wgTitle->getNamespace() == Namespace::getTalk(Namespace::getUser()) )
603 $id=User
::idFromName($wgTitle->getText());
604 $ip=User
::isIP($wgTitle->getText());
606 if($id ||
$ip) { # both anons and non-anons have contri list
607 $s .= $sep . $this->userContribsLink();
609 if ( 0 != $wgUser->getID() ) { # show only to signed in users
610 if($id) { # can only email non-anons
611 $s .= $sep . $this->emailUserLink();
615 if ( $wgUser->isSysop() && $wgTitle->getArticleId() ) {
616 $s .= "\n<br>" . $this->deleteThisPage() .
617 $sep . $this->protectThisPage() .
618 $sep . $this->moveThisPage();
620 $s .= "<br>\n" . $this->otherLanguages();
627 global $wgOut, $wgLang, $wgArticle;
628 global $oldid, $diff, $wgDisableCounters;
630 if ( ! $wgOut->isArticle() ) { return ""; }
631 if ( isset( $oldid ) ||
isset( $diff ) ) { return ""; }
632 if ( 0 == $wgArticle->getID() ) { return ""; }
634 if ( $wgDisableCounters ) {
637 $count = $wgArticle->getCount();
638 $s = str_replace( "$1", $count, wfMsg( "viewcount" ) );
640 $s .= $this->lastModified();
641 $s .= " " . wfMsg( "gnunote" );
642 return "<span id='pagestats'>{$s}</span>";
645 function lastModified()
647 global $wgLang, $wgArticle;
649 $d = $wgLang->timeanddate( $wgArticle->getTimestamp(), true );
650 $s = " " . str_replace( "$1", $d, wfMsg( "lastmodified" ) );
654 function logoText( $align = "" )
656 if ( "" != $align ) { $a = " align='{$align}'"; }
659 $mp = wfMsg( "mainpage" );
660 $s = "<a href=\"" . wfLocalUrlE( urlencode( $mp ) )
661 . "\"><img{$a} border=0 src=\""
662 . $this->getLogo() . "\" alt=\"" . "[{$mp}]\"></a>";
668 global $wgOut, $wgTitle, $wgUser, $action, $wgLang;
670 $fname = "Skin::quickBar";
671 wfProfileIn( $fname );
673 $tns=$wgTitle->getNamespace();
675 $s = "\n<div id='quickbar'>";
676 $s .= "\n" . $this->logoText() . "\n<hr class='sep'>";
679 $s .= $this->mainPageLink()
680 . $sep . $this->specialLink( "recentchanges" )
681 . $sep . $this->specialLink( "randompage" );
682 if ($wgUser->getID()) {
683 $s.= $sep . $this->specialLink( "watchlist" ) ;
684 $s .= $sep .$this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
685 wfMsg( "mycontris" ), "target=" . wfUrlencode($wgUser->getName() ) );
688 // only show watchlist link if logged in
689 if ( wfMsg ( "currentevents" ) != "-" ) $s .= $sep . $this->makeKnownLink( wfMsg( "currentevents" ), "" ) ;
690 $s .= "\n<br><hr class='sep'>";
691 $articleExists = $wgTitle->getArticleId();
692 if ( $wgOut->isArticle() ||
$action =="edit" ||
$action =="history" ||
$wpPreview) {
693 if($wgOut->isArticle()) {
694 $s .= "<strong>" . $this->editThisPage() . "</strong>";
695 } else { # backlink to the article in edit or history mode
696 if($articleExists){ # no backlink if no article
699 $text = wfMsg("articlepage");
702 $text = wfMsg("viewtalkpage");
705 $text = wfMsg("userpage");
708 $text = wfMsg("viewtalkpage");
711 $text = wfMsg("wikipediapage");
714 $text = wfMsg("viewtalkpage");
717 $text = wfMsg("imagepage");
720 $text = wfMsg("viewtalkpage");
723 $text= wfMsg("articlepage");
726 $link = $wgTitle->getText();
727 if ($nstext = $wgLang->getNsText($tns) ) { # add namespace if necessary
728 $link = $nstext . ":" . $link ;
731 $s .= $this->makeLink( $link, $text );
732 } elseif( $wgTitle->getNamespace() != Namespace::getSpecial() ) {
733 # we just throw in a "New page" text to tell the user that he's in edit mode,
734 # and to avoid messing with the separator that is prepended to the next item
735 $s .= "<strong>" . wfMsg("newpage") . "</strong>";
741 if( $tns%2
&& $action!="edit" && !$wpPreview) {
742 $s.="<br>".$this->makeKnownLink($wgTitle->getPrefixedText(),wfMsg("postcomment"),"action=edit§ion=new");
746 watching could cause problems in edit mode:
747 if user edits article, then loads "watch this article" in background and then saves
748 article with "Watch this article" checkbox disabled, the article is transparently
749 unwatched. Therefore we do not show the "Watch this page" link in edit mode
751 if ( 0 != $wgUser->getID() && $articleExists) {
752 if($action!="edit" && $action!="history" &&
753 $action != "submit" )
754 {$s .= $sep . $this->watchThisPage(); }
755 if ( $wgTitle->userCanEdit() ) $s .= $sep . $this->moveThisPage();
757 if ( $wgUser->isSysop() and $articleExists ) {
758 $s .= $sep . $this->deleteThisPage() .
759 $sep . $this->protectThisPage();
761 $s .= $sep . $this->talkLink();
762 if ($articleExists && $action !="history") { $s .= $sep . $this->historyLink();}
763 $s.=$sep . $this->whatLinksHere();
765 if($wgOut->isArticle()) {
766 $s .= $sep . $this->watchPageLinksLink();
769 if ( Namespace::getUser() == $wgTitle->getNamespace()
770 ||
$wgTitle->getNamespace() == Namespace::getTalk(Namespace::getUser())
773 $id=User
::idFromName($wgTitle->getText());
774 $ip=User
::isIP($wgTitle->getText());
777 $s .= $sep . $this->userContribsLink();
779 if ( 0 != $wgUser->getID() ) {
780 if($id) { # can only email real users
781 $s .= $sep . $this->emailUserLink();
785 $s .= "\n<br><hr class='sep'>";
788 if ( 0 != $wgUser->getID() ) {
789 $s .= $this->specialLink( "upload" ) . $sep;
791 $s .= $this->specialLink( "specialpages" )
792 . $sep . $this->bugReportsLink();
794 $s .= "\n<br></div>\n";
795 wfProfileOut( $fname );
799 function specialPagesList()
801 global $wgUser, $wgOut, $wgLang, $wgServer, $wgRedirectScript;
804 $validSP = $wgLang->getValidSpecialPages();
806 foreach ( $validSP as $name => $desc ) {
807 if ( "" == $desc ) { continue; }
810 if ( $wgUser->isSysop() )
812 $sysopSP = $wgLang->getSysopSpecialPages();
814 foreach ( $sysopSP as $name => $desc ) {
815 if ( "" == $desc ) { continue; }
819 if ( $wgUser->isDeveloper() )
821 $devSP = $wgLang->getDeveloperSpecialPages();
823 foreach ( $devSP as $name => $desc ) {
824 if ( "" == $desc ) { continue; }
829 $sp = wfMsg( "specialpages" );
830 $spp = $wgLang->specialPage( "Specialpages" );
832 $s = "<form id=\"specialpages\" method=\"get\" class=\"inline\" " .
833 "action=\"{$wgServer}{$wgRedirectScript}\">\n";
834 $s .= "<select name=\"wpDropdown\">\n";
835 $s .= "<option value=\"{$spp}\">{$sp}</option>\n";
837 foreach ( $a as $name => $desc ) {
838 $p = $wgLang->specialPage( $name );
839 $s .= "<option value=\"{$p}\">{$desc}</option>\n";
842 $s .= "<input type=submit value=\"{$go}\" name=redirect>\n";
847 function mainPageLink()
849 $mp = wfMsg( "mainpage" );
850 $s = $this->makeKnownLink( $mp, $mp );
854 function copyrightLink()
856 $s = $this->makeKnownLink( wfMsg( "copyrightpage" ),
857 wfMsg( "copyrightpagename" ) );
863 $s = $this->makeKnownLink( wfMsg( "aboutpage" ),
864 wfMsg( "aboutwikipedia" ) );
868 function editThisPage()
870 global $wgOut, $wgTitle, $oldid, $redirect, $diff;
872 if ( ! $wgOut->isArticle() ||
$diff ) {
873 $s = wfMsg( "protectedpage" );
874 } else if ( $wgTitle->userCanEdit() ) {
875 $n = $wgTitle->getPrefixedText();
876 $t = wfMsg( "editthispage" );
879 if ( $redirect ) { $red = "&redirect={$redirect}"; }
880 if ( $oldid && ! isset( $diff ) ) {
881 $oid = "&oldid={$oldid}";
883 $s = $this->makeKnownLink( $n, $t, "action=edit{$oid}{$red}" );
885 $s = wfMsg( "protectedpage" );
890 function deleteThisPage()
892 global $wgUser, $wgOut, $wgTitle, $diff;
894 if ( $wgTitle->getArticleId() && ( ! $diff ) && $wgUser->isSysop() ) {
895 $n = $wgTitle->getPrefixedText();
896 $t = wfMsg( "deletethispage" );
898 $s = $this->makeKnownLink( $n, $t, "action=delete" );
900 $s = wfMsg( "error" );
905 function protectThisPage()
907 global $wgUser, $wgOut, $wgTitle, $diff;
909 if ( $wgTitle->getArticleId() && ( ! $diff ) && $wgUser->isSysop() ) {
910 $n = $wgTitle->getPrefixedText();
912 if ( $wgTitle->isProtected() ) {
913 $t = wfMsg( "unprotectthispage" );
914 $q = "action=unprotect";
916 $t = wfMsg( "protectthispage" );
917 $q = "action=protect";
919 $s = $this->makeKnownLink( $n, $t, $q );
921 $s = wfMsg( "error" );
926 function watchThisPage()
928 global $wgUser, $wgOut, $wgTitle, $diff;
930 if ( $wgOut->isArticle() && ( ! $diff ) ) {
931 $n = $wgTitle->getPrefixedText();
933 if ( $wgTitle->userIsWatching() ) {
934 $t = wfMsg( "unwatchthispage" );
935 $q = "action=unwatch";
937 $t = wfMsg( "watchthispage" );
940 $s = $this->makeKnownLink( $n, $t, $q );
942 $s = wfMsg( "notanarticle" );
947 function moveThisPage()
949 global $wgTitle, $wgLang;
951 if ( $wgTitle->userCanEdit() ) {
952 $s = $this->makeKnownLink( $wgLang->specialPage( "Movepage" ),
953 wfMsg( "movethispage" ), "target=" . $wgTitle->getPrefixedURL() );
954 } // no message if page is protected - would be redundant
958 function historyLink()
962 $s = $this->makeKnownLink( $wgTitle->getPrefixedText(),
963 wfMsg( "history" ), "action=history" );
967 function whatLinksHere()
969 global $wgTitle, $wgLang;
971 $s = $this->makeKnownLink( $wgLang->specialPage( "Whatlinkshere" ),
972 wfMsg( "whatlinkshere" ), "target=" . $wgTitle->getPrefixedURL() );
976 function userContribsLink()
978 global $wgTitle, $wgLang;
980 $s = $this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
981 wfMsg( "contributions" ), "target=" . $wgTitle->getURL() );
985 function emailUserLink()
987 global $wgTitle, $wgLang;
989 $s = $this->makeKnownLink( $wgLang->specialPage( "Emailuser" ),
990 wfMsg( "emailuser" ), "target=" . $wgTitle->getURL() );
994 function watchPageLinksLink()
996 global $wgOut, $wgTitle, $wgLang;
998 if ( ! $wgOut->isArticle() ) {
999 $s = "(" . wfMsg( "notanarticle" ) . ")";
1001 $s = $this->makeKnownLink( $wgLang->specialPage(
1002 "Recentchangeslinked" ), wfMsg( "recentchangeslinked" ),
1003 "target=" . $wgTitle->getPrefixedURL() );
1008 function otherLanguages()
1010 global $wgOut, $wgLang, $wgTitle , $wgUseNewInterlanguage ;
1012 $a = $wgOut->getLanguageLinks();
1013 if ( 0 == count( $a ) ) {
1014 if ( !$wgUseNewInterlanguage ) return "";
1015 $ns = $wgLang->getNsIndex ( $wgTitle->getNamespace () ) ;
1016 if ( $ns != 0 AND $ns != 1 ) return "" ;
1018 $x = "mode=addlink&xt=".$wgTitle->getDBkey() ;
1019 return $this->makeKnownLink( $wgLang->specialPage( $pn ),
1020 wfMsg( "intl" ) , $x );
1023 if ( !$wgUseNewInterlanguage ) {
1024 $s = wfMsg( "otherlanguages" ) . ": ";
1026 global $wgLanguageCode ;
1027 $x = "mode=zoom&xt=".$wgTitle->getDBkey() ;
1028 $x .= "&xl=".$wgLanguageCode ;
1029 $s = $this->makeKnownLink( $wgLang->specialPage( "Intl" ),
1030 wfMsg( "otherlanguages" ) , $x ) . ": " ;
1034 if($wgLang->isRTL()) $s .= "<span dir='LTR'>";
1035 foreach( $a as $l ) {
1036 if ( ! $first ) { $s .= " | "; }
1039 $nt = Title
::newFromText( $l );
1040 $url = $nt->getFullURL();
1041 $text = $wgLang->getLanguageName( $nt->getInterwiki() );
1043 if ( "" == $text ) { $text = $l; }
1044 $style = $this->getExternalLinkAttributes( $l, $text );
1045 $s .= "<a href=\"{$url}\"{$style}>{$text}</a>";
1047 if($wgLang->isRTL()) $s .= "</span>";
1051 function bugReportsLink()
1053 $s = $this->makeKnownLink( wfMsg( "bugreportspage" ),
1054 wfMsg( "bugreports" ) );
1060 global $wgLinkCache;
1061 $t1 = Title
::newFromText( gmdate( "F j" ) );
1062 $t2 = Title
::newFromText( gmdate( "Y" ) );
1064 $wgLinkCache->suspend();
1065 $id = $t1->getArticleID();
1066 $wgLinkCache->resume();
1069 $s = $this->makeBrokenLink( $t1->getText() );
1071 $s = $this->makeKnownLink( $t1->getText() );
1075 $wgLinkCache->suspend();
1076 $id = $t2->getArticleID();
1077 $wgLinkCache->resume();
1080 $s .= $this->makeBrokenLink( $t2->getText() );
1082 $s .= $this->makeKnownLink( $t2->getText() );
1089 global $wgLang, $wgTitle, $wgLinkCache;
1091 $tns = $wgTitle->getNamespace();
1092 if ( -1 == $tns ) { return ""; }
1094 $pn = $wgTitle->getText();
1095 $tp = wfMsg( "talkpage" );
1096 if ( Namespace::isTalk( $tns ) ) {
1097 $lns = Namespace::getSubject( $tns );
1100 $text = wfMsg("articlepage");
1103 $text = wfMsg("userpage");
1106 $text = wfMsg("wikipediapage");
1109 $text = wfMsg("imagepage");
1112 $text= wfMsg("articlepage");
1116 $lns = Namespace::getTalk( $tns );
1119 $n = $wgLang->getNsText( $lns );
1120 if ( "" == $n ) { $link = $pn; }
1121 else { $link = "{$n}:{$pn}"; }
1123 $wgLinkCache->suspend();
1124 $s = $this->makeLink( $link, $text );
1125 $wgLinkCache->resume();
1130 # After all the page content is transformed into HTML, it makes
1131 # a final pass through here for things like table backgrounds.
1133 function transformContent( $text )
1138 # Note: This function MUST call getArticleID() on the link,
1139 # otherwise the cache won't get updated properly. See LINKCACHE.DOC.
1141 function makeLink( $title, $text = "", $query = "", $trail = "" ) {
1142 return $this->makeLinkObj( Title
::newFromText( $title ), $text, $query, $trail );
1145 function makeKnownLink( $title, $text = "", $query = "", $trail = "" ) {
1146 return $this->makeKnownLinkObj( Title
::newFromText( $title ), $text, $query, $trail );
1149 function makeBrokenLink( $title, $text = "", $query = "", $trail = "" ) {
1150 return $this->makeBrokenLinkObj( Title
::newFromText( $title ), $text, $query, $trail );
1153 function makeStubLink( $title, $text = "", $query = "", $trail = "" ) {
1154 return $this->makeStubLinkObj( Title
::newFromText( $title ), $text, $query, $trail );
1157 # Pass a title object, not a title string
1158 function makeLinkObj( &$nt, $text= "", $query = "", $trail = "" )
1160 global $wgOut, $wgUser;
1161 $fname = "Skin::makeLinkObj";
1162 wfProfileIn( $fname );
1163 if ( $nt->isExternal() ) {
1164 $u = $nt->getFullURL();
1165 if ( "" == $text ) { $text = $nt->getPrefixedText(); }
1166 $style = $this->getExternalLinkAttributes( $link, $text );
1169 if ( "" != $trail ) {
1170 if ( preg_match( "/^([a-z]+)(.*)$$/sD", $trail, $m ) ) {
1175 $retVal = "<a href=\"{$u}\"{$style}>{$text}{$inside}</a>{$trail}";
1176 } elseif ( 0 == $nt->getNamespace() && "" == $nt->getText() ) {
1177 $retVal = $this->makeKnownLinkObj( $nt, $text, $query, $trail );
1178 } elseif ( ( -1 == $nt->getNamespace() ) ||
1179 ( Namespace::getImage() == $nt->getNamespace() ) ) {
1180 $retVal = $this->makeKnownLinkObj( $nt, $text, $query, $trail );
1182 $aid = $nt->getArticleID() ;
1184 $retVal = $this->makeBrokenLinkObj( $nt, $text, $query, $trail );
1186 $threshold = $wgUser->getOption("stubthreshold") ;
1187 if ( $threshold > 0 ) {
1188 $res = wfQuery ( "SELECT HIGH_PRIORITY length(cur_text) AS x, cur_namespace, cur_is_redirect FROM cur WHERE cur_id='{$aid}'", DB_READ
) ;
1190 if ( wfNumRows( $res ) > 0 ) {
1191 $s = wfFetchObject( $res );
1193 if ( $s->cur_is_redirect
OR $s->cur_namespace
!= 0 ) {
1194 $size = $threshold*2 ; # Really big
1196 wfFreeResult( $res );
1198 $size = $threshold*2 ; # Really big
1203 if ( $size < $threshold ) {
1204 $retVal = $this->makeStubLinkObj( $nt, $text, $query, $trail );
1206 $retVal = $this->makeKnownLinkObj( $nt, $text, $query, $trail );
1210 wfProfileOut( $fname );
1214 # Pass a title object, not a title string
1215 function makeKnownLinkObj( &$nt, $text = "", $query = "", $trail = "" )
1217 global $wgOut, $wgTitle;
1219 $fname = "Skin::makeKnownLinkObj";
1220 wfProfileIn( $fname );
1222 $link = $nt->getPrefixedURL();
1224 if ( "" == $link ) {
1226 if ( "" == $text ) { $text = $nt->getFragment(); }
1228 $u = wfLocalUrlE( $link, $query );
1230 if ( "" != $nt->getFragment() ) {
1231 $u .= "#" . wfEscapeHTML( $nt->getFragment() );
1233 if ( "" == $text ) { $text = $nt->getPrefixedText(); }
1234 $style = $this->getInternalLinkAttributesObj( $nt, $text );
1237 if ( "" != $trail ) {
1238 if ( preg_match( wfMsg("linktrail"), $trail, $m ) ) {
1243 $r = "<a href=\"{$u}\"{$style}>{$text}{$inside}</a>{$trail}";
1244 wfProfileOut( $fname );
1248 # Pass a title object, not a title string
1249 function makeBrokenLinkObj( &$nt, $text = "", $query = "", $trail = "" )
1251 global $wgOut, $wgUser;
1253 $fname = "Skin::makeBrokenLinkObj";
1254 wfProfileIn( $fname );
1256 $link = $nt->getPrefixedURL();
1258 if ( "" == $query ) { $q = "action=edit"; }
1259 else { $q = "action=edit&{$query}"; }
1260 $u = wfLocalUrlE( $link, $q );
1262 if ( "" == $text ) { $text = $nt->getPrefixedText(); }
1263 $style = $this->getInternalLinkAttributesObj( $nt, $text, "yes" );
1266 if ( "" != $trail ) {
1267 if ( preg_match( wfMsg("linktrail"), $trail, $m ) ) {
1272 if ( $wgOut->isPrintable() ||
1273 ( 1 == $wgUser->getOption( "highlightbroken" ) ) ) {
1274 $s = "<a href=\"{$u}\"{$style}>{$text}{$inside}</a>{$trail}";
1276 $s = "{$text}{$inside}<a href=\"{$u}\"{$style}>?</a>{$trail}";
1279 wfProfileOut( $fname );
1283 # Pass a title object, not a title string
1284 function makeStubLinkObj( &$nt, $text = "", $query = "", $trail = "" )
1286 global $wgOut, $wgUser;
1288 $link = $nt->getPrefixedURL();
1290 $u = wfLocalUrlE( $link, $query );
1292 if ( "" == $text ) { $text = $nt->getPrefixedText(); }
1293 $style = $this->getInternalLinkAttributesObj( $nt, $text, "stub" );
1296 if ( "" != $trail ) {
1297 if ( preg_match( wfMsg("linktrail"), $trail, $m ) ) {
1302 if ( $wgOut->isPrintable() ||
1303 ( 1 == $wgUser->getOption( "highlightbroken" ) ) ) {
1304 $s = "<a href=\"{$u}\"{$style}>{$text}{$inside}</a>{$trail}";
1306 $s = "{$text}{$inside}<a href=\"{$u}\"{$style}>!</a>{$trail}";
1311 function fnamePart( $url )
1313 $basename = strrchr( $url, "/" );
1314 if ( false === $basename ) { $basename = $url; }
1315 else { $basename = substr( $basename, 1 ); }
1316 return wfEscapeHTML( $basename );
1319 function makeImage( $url, $alt = "" )
1323 if ( "" == $alt ) { $alt = $this->fnamePart( $url ); }
1324 $s = "<img src=\"{$url}\" alt=\"{$alt}\">";
1328 function makeImageLink( $name, $url, $alt = "" )
1330 global $wgOut, $wgTitle, $wgLang;
1332 $nt = Title
::newFromText( $wgLang->getNsText(
1333 Namespace::getImage() ) . ":{$name}" );
1334 $link = $nt->getPrefixedURL();
1335 if ( "" == $alt ) { $alt = $name; }
1337 $u = wfLocalUrlE( $link );
1338 $s = "<a href=\"{$u}\" class='image' title=\"{$alt}\">" .
1339 "<img border=0 src=\"{$url}\" alt=\"{$alt}\"></a>";
1343 function makeMediaLink( $name, $url, $alt = "" )
1345 global $wgOut, $wgTitle;
1347 if ( "" == $alt ) { $alt = $name; }
1348 $u = wfEscapeHTML( $url );
1349 $s = "<a href=\"{$u}\" class='internal' title=\"{$alt}\">{$alt}</a>";
1353 function specialLink( $name, $key = "" )
1357 if ( "" == $key ) { $key = strtolower( $name ); }
1358 $pn = $wgLang->ucfirst( $name );
1359 return $this->makeKnownLink( $wgLang->specialPage( $pn ),
1363 # Called by history lists and recent changes
1366 function beginRecentChangesList()
1368 $rc_cache = array() ;
1370 $this->lastdate
= "";
1374 function beginHistoryList()
1376 $this->lastdate
= $this->lastline
= "";
1377 $s = "\n<p>" . wfMsg( "histlegend" ) . "\n<ul>";
1381 function beginImageHistoryList()
1383 $s = "\n<h2>" . wfMsg( "imghistory" ) . "</h2>\n" .
1384 "<p>" . wfMsg( "imghistlegend" ) . "\n<ul>";
1388 function endRecentChangesList()
1390 $s = $this->recentChangesBlock() ;
1395 function endHistoryList()
1397 $last = wfMsg( "last" );
1399 $s = preg_replace( "/!OLDID![0-9]+!/", $last, $this->lastline
);
1404 function endImageHistoryList()
1410 function historyLine( $ts, $u, $ut, $ns, $ttl, $oid, $c, $isminor )
1414 $artname = Title
::makeName( $ns, $ttl );
1415 $last = wfMsg( "last" );
1416 $cur = wfMsg( "cur" );
1417 $cr = wfMsg( "currentrev" );
1419 if ( $oid && $this->lastline
) {
1420 $ret = preg_replace( "/!OLDID!([0-9]+)!/", $this->makeKnownLink(
1421 $artname, $last, "diff=\\1&oldid={$oid}" ), $this->lastline
);
1425 $dt = $wgLang->timeanddate( $ts, true );
1427 if ( $oid ) { $q = "oldid={$oid}"; }
1429 $link = $this->makeKnownLink( $artname, $dt, $q );
1432 $ul = $this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
1433 $ut, "target=" . $ut );
1435 $ul = $this->makeLink( $wgLang->getNsText(
1436 Namespace::getUser() ) . ":{$ut}", $ut ); }
1440 $curlink = $this->makeKnownLink( $artname, $cur,
1441 "diff=0&oldid={$oid}" );
1445 $s .= "({$curlink}) (!OLDID!{$oid}!) . .";
1447 $M = wfMsg( "minoreditletter" );
1448 if ( $isminor ) { $s .= " <strong>{$M}</strong>"; }
1449 $s .= " {$link} . . {$ul}";
1451 if ( "" != $c && "*" != $c ) { $s .= " <em>(" . wfEscapeHTML($c) . ")</em>"; }
1454 $this->lastline
= $s;
1458 function recentChangesBlockLine ( $y ) {
1459 global $wgUploadPath ;
1461 $M = wfMsg( "minoreditletter" );
1462 $N = wfMsg( "newpageletter" );
1464 $r .= "<img src='{$wgUploadPath}/Arr_.png' width=12 height=12 border=0>" ;
1466 if ( $y->isnew
) $r .= $N ;
1467 else $r .= " " ;
1468 if ( $y->isminor
) $r .= $M ;
1469 else $r .= " " ;
1470 $r .= " ".$y->timestamp
." " ;
1473 if ( $y->watched
) $link = "<strong>{$link}</strong>" ;
1479 $r .= $this->makeKnownLink( $y->secureName
, wfMsg( "hist" ), "action=history" );
1481 $r .= ") . . ".$y->userlink
;
1482 $r .= $y->usertalklink
;
1483 if ( $y->usercomment
!= "" )
1484 $r .= " <em>(".wfEscapeHTML($y->usercomment
).")</em>" ;
1489 function recentChangesBlockGroup ( $y ) {
1490 global $wgUploadPath ;
1493 $M = wfMsg( "minoreditletter" );
1494 $N = wfMsg( "newpageletter" );
1496 $userlinks = array () ;
1497 foreach ( $y AS $x ) {
1498 $oldid = $x->diffid
;
1499 if ( $x->isnew
) $isnew = true ;
1501 if ( !isset ( $userlinks[$u] ) ) $userlinks[$u] = 0 ;
1505 krsort ( $userlinks ) ;
1506 asort ( $userlinks ) ;
1508 $u = array_keys ( $userlinks ) ;
1509 foreach ( $u as $x ) {
1511 if ( $userlinks[$x] > 1 ) $z .= " ({$userlinks[$x]}×)" ;
1512 array_push ( $users , $z ) ;
1514 $users = " <font size='-1'>[".implode("; ",$users)."]</font>" ;
1517 $e = array_shift ( $e ) ;
1520 $rci = "RCI{$this->rccc}" ;
1521 $rcl = "RCL{$this->rccc}" ;
1522 $rcm = "RCM{$this->rccc}" ;
1523 $tl = "<a href='javascript:toggleVisibility(\"{$rci}\",\"{$rcm}\",\"{$rcl}\")'>" ;
1524 $tl .= "<span id='{$rcm}'><img src='{$wgUploadPath}/Arr_r.png' width=12 height=12 border=0></span>" ;
1525 $tl .= "<span id='{$rcl}' style='display:none'><img src='{$wgUploadPath}/Arr_d.png' width=12 height=12 border=0></span>" ;
1531 if ( $isnew ) $r .= $N ;
1532 else $r .= " " ;
1533 $r .= " " ; # Minor
1534 $r .= " ".$e->timestamp
." " ;
1538 if ( $e->watched
) $link = "<strong>{$link}</strong>" ;
1542 $r .= " (".count($y)." " ;
1543 if ( $isnew ) $r .= wfMsg("changes");
1544 else $r .= $this->makeKnownLink( $e->secureName
, wfMsg("changes") , "diff=0&oldid=".$oldid ) ;
1546 $r .= $this->makeKnownLink( $e->secureName
, wfMsg( "history" ), "action=history" );
1554 $r .= "<div id='{$rci}' style='display:none'>" ;
1555 foreach ( $y AS $x )
1557 $r .= "<img src='{$wgUploadPath}/Arr_.png' width=12 height=12 border=0>";
1558 $r .= "<tt> " ;
1559 if ( $x->isnew
) $r .= $N ;
1560 else $r .= " " ;
1561 if ( $x->isminor
) $r .= $M ;
1562 else $r .= " " ;
1566 if ( $x->oldid
!= 0 ) $o = "oldid=".$x->oldid
;
1567 if ( $x->islog
) $link = $x->timestamp
;
1568 else $link = $this->makeKnownLink( $x->secureName
, $x->timestamp
, $o ) ;
1569 $link = "<tt>{$link}</tt>" ;
1576 $r .= $x->lastlink
;
1577 $r .= ") . . ".$x->userlink
;
1578 $r .= $x->usertalklink
;
1579 if ( $x->usercomment
!= "" )
1580 $r .= " <em>(".wfEscapeHTML($x->usercomment
).")</em>" ;
1589 function recentChangesBlock ()
1591 global $wgUploadPath ;
1592 if ( count ( $this->rc_cache
) == 0 ) return "" ;
1593 $k = array_keys ( $this->rc_cache
) ;
1594 foreach ( $k AS $x )
1596 $y = $this->rc_cache
[$x] ;
1597 if ( count ( $y ) < 2 ) {
1598 $r .= $this->recentChangesBlockLine ( array_shift ( $y ) ) ;
1600 $r .= $this->recentChangesBlockGroup ( $y ) ;
1604 return "<div align=left>{$r}</div>" ;
1607 function recentChangesLine( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched = false, $oldid = 0 , $diffid = 0 )
1610 $usenew = $wgUser->getOption( "usenewrc" );
1612 $r = $this->recentChangesLineNew ( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched , $oldid , $diffid ) ;
1614 $r = $this->recentChangesLineOld ( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched , $oldid , $diffid ) ;
1618 function recentChangesLineOld( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched = false, $oldid = 0, $diffid = 0 )
1620 global $wgTitle, $wgLang, $wgUser;
1622 $d = $wgLang->date( $ts, true);
1624 if ( $d != $this->lastdate
) {
1625 if ( "" != $this->lastdate
) { $s .= "</ul>\n"; }
1626 $s .= "<h4>{$d}</h4>\n<ul>";
1627 $this->lastdate
= $d;
1629 $h = $wgLang->time( $ts, true );
1630 $t = Title
::makeName( $ns, $ttl );
1631 $clink = $this->makeKnownLink( $t , "" );
1632 $nt = Title
::newFromText( $t );
1635 $clink = "<strong>{$clink}</strong>";
1637 $hlink = $this->makeKnownLink( $t, wfMsg( "hist" ), "action=history" );
1638 if ( $isnew ||
$nt->isLog() ) {
1639 $dlink = wfMsg( "diff" );
1641 $dlink = $this->makeKnownLink( $t, wfMsg( "diff" ),
1642 "diff={$oldid}&oldid={$diffid}" ); # Finagle's law
1645 $ul = $this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
1646 $ut, "target=" . $ut );
1648 $ul = $this->makeLink( $wgLang->getNsText( Namespace::getUser() ) . ":{$ut}", $ut );
1651 $utns=$wgLang->getNsText(Namespace::getTalk(Namespace::getUser()));
1652 $talkname=$wgLang->getNsText(Namespace::getTalk(0)); # use the shorter name
1653 $utl= $this->makeLink($utns . ":{$ut}", $talkname );
1654 $cr = wfMsg( "currentrev" );
1656 $s .= "<li> ({$dlink}) ({$hlink}) . .";
1657 $M = wfMsg( "minoreditletter" );
1658 $N = wfMsg( "newpageletter" );
1659 if ( $isminor ) { $s .= " <strong>{$M}</strong>"; }
1660 if ( $isnew ) { $s .= "<strong>{$N}</strong>"; }
1661 $s .= " {$clink}; {$h} . . {$ul}";
1664 if ( ( 0 == $u ) && $wgUser->isSysop() ) {
1665 $blink = $this->makeKnownLink( $wgLang->specialPage(
1666 "Blockip" ), wfMsg( "blocklink" ), "ip={$ut}" );
1672 $utl = "({$utl} | {$blink})";
1676 if ( "" != $c && "*" != $c ) {
1677 $s .= " <em>(" . wfEscapeHTML( $c ) . ")</em>";
1684 function recentChangesLineNew( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched = false, $oldid = 0 , $diffid = 0 )
1686 global $wgTitle, $wgLang, $wgUser;
1688 $rc = new RecentChangesClass
;
1690 $d = $wgLang->date( $ts, true);
1693 if ( $d != $this->lastdate
) {
1694 $ret = $this->recentChangesBlock () ;
1695 $this->rc_cache
= array() ;
1696 $ret .= "<h4>{$d}</h4>\n";
1697 $this->lastdate
= $d;
1699 $h = $wgLang->time( $ts, true );
1700 $t = Title
::makeName( $ns, $ttl );
1701 $clink = $this->makeKnownLink( $t, "" ) ;
1702 if ( $oldid == 0 ) $c2link = $clink ;
1703 else $c2link = $this->makeKnownLink( $t, "" , "oldid={$oldid}" );
1704 $nt = Title
::newFromText( $t );
1706 $rc->timestamp
= $h ;
1707 $rc->oldid
= $oldid ;
1708 $rc->diffid
= $diffid ;
1709 $rc->watched
= $watched ;
1710 $rc->isnew
= $isnew ;
1711 $rc->isminor
= $isminor ;
1712 $rc->secureName
= $t ;
1713 $rc->displayName
= $nt ;
1714 $rc->link
= $clink ;
1715 $rc->usercomment
= $c ;
1716 $rc->islog
= $nt->isLog() ;
1718 if ( ( $isnew && $oldid == 0 ) ||
$nt->isLog() ) {
1719 $dlink = wfMsg( "cur" );
1721 $dlink = $this->makeKnownLink( $t, wfMsg( "cur" ),
1722 "diff=0&oldid={$oldid}" );
1725 if ( $diffid == 0 ||
$nt->isLog() ) {
1726 $plink = wfMsg( "last" );
1728 $plink = $this->makeKnownLink( $t, wfMsg( "last" ),
1729 "diff={$oldid}&oldid={$diffid}" );
1733 $ul = $this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
1734 $ut, "target=" . $ut );
1735 } else { $ul = $this->makeLink( $wgLang->getNsText(
1736 Namespace::getUser() ) . ":{$ut}", $ut ); }
1738 $rc->userlink
= $ul ;
1739 $rc->lastlink
= $plink ;
1740 $rc->curlink
= $dlink ;
1742 $utns=$wgLang->getNsText(Namespace::getTalk(Namespace::getUser()));
1743 $talkname=$wgLang->getNsText(Namespace::getTalk(0)); # use the shorter name
1744 $utl= $this->makeLink($utns . ":{$ut}", $talkname );
1746 if ( ( 0 == $u ) && $wgUser->isSysop() ) {
1747 $blink = $this->makeKnownLink( $wgLang->specialPage(
1748 "Blockip" ), wfMsg( "blocklink" ), "ip={$ut}" );
1749 $rc->usertalklink
= " ({$utl} | {$blink})";
1751 $rc->usertalklink
=" ({$utl})";
1754 if ( !isset ( $this->rc_cache
[$t] ) ) $this->rc_cache
[$t] = array() ;
1755 array_push ( $this->rc_cache
[$t] , $rc ) ;
1760 function imageHistoryLine( $iscur, $ts, $img, $u, $ut, $size, $c )
1762 global $wgUser, $wgLang, $wgTitle;
1764 $dt = $wgLang->timeanddate( $ts, true );
1765 $del = wfMsg( "deleteimg" );
1766 $cur = wfMsg( "cur" );
1769 $url = wfImageUrl( $img );
1771 if ( $wgUser->isSysop() ) {
1772 $link = wfLocalUrlE( $wgTitle->getPrefixedText(), "image=" . $wgTitle->getURL() .
1774 $style = $this->getInternalLinkAttributes( $link, $del );
1776 $dlink = "<a href=\"{$link}\"{$style}>{$del}</a>";
1781 $url = wfEscapeHTML( wfImageArchiveUrl( $img ) );
1782 if( $wgUser->getID() != 0 ) {
1783 $rlink = $this->makeKnownLink( $wgTitle->getPrefixedText(),
1784 wfMsg( "revertimg" ), "action=revert&oldimage=" .
1785 urlencode( $img ) );
1786 $dlink = $this->makeKnownLink( $wgTitle->getPrefixedText(),
1787 $del, "action=delete&oldimage=" . urlencode( $img ) );
1789 # Having live active links for non-logged in users
1790 # means that bots and spiders crawling our site can
1791 # inadvertently change content. Baaaad idea.
1792 $rlink = wfMsg( "revertimg" );
1796 if ( 0 == $u ) { $ul = $ut; }
1797 else { $ul = $this->makeLink( $wgLang->getNsText(
1798 Namespace::getUser() ) . ":{$ut}", $ut ); }
1800 $nb = str_replace( "$1", $size, wfMsg( "nbytes" ) );
1801 $style = $this->getInternalLinkAttributes( $url, $dt );
1803 $s = "<li> ({$dlink}) ({$rlink}) <a href=\"{$url}\"{$style}>{$dt}</a>"
1804 . " . . {$ul} ({$nb})";
1806 if ( "" != $c && "*" != $c ) {
1807 $s .= " <em>(" . wfEscapeHTML( $c ) . ")</em>";
1813 function tocIndent($level) {
1815 while($level-->0) $rv.="<div style=\"margin-left:2em;\">\n";
1820 function tocUnindent($level) {
1821 while($level-->0) $rv.="</div>\n";
1825 // parameter level defines if we are on an indentation level
1826 function tocLine($anchor,$tocline,$level) {
1830 return "<A CLASS=\"internal\" HREF=\"#".$anchor."\">".$tocline."</A><BR>\n";
1833 return "<div style=\"margin-bottom:0px;\">\n".
1834 "<A CLASS=\"internal\" HREF=\"#".$anchor."\">".$tocline."</A><BR>\n".
1840 function tocTable($toc) {
1841 // note to CSS fanatics: putting this in a div does not work -- div won't auto-expand
1845 $hideline = " <script type='text/javascript'>showTocToggle(\"" . wfMsg("showtoc") . "\",\"" . wfMsg("hidetoc") . "\")</script>";
1848 "<p><table border=\"0\" id=\"toc\"><tr><td align=\"center\">\n".
1849 "<b>".wfMsg("toc")."</b>" .
1851 "</td></tr><tr id='tocinside'><td align=\"left\">\n".
1852 $toc."</td></tr></table><P>\n";
1855 # These two do not check for permissions: check $wgTitle->userCanEdit before calling them
1856 function editSectionScript($section,$head) {
1858 global $wgTitle,$wgUser,$oldid;
1859 if($oldid) return $head;
1860 $url = wfLocalUrlE(urlencode($wgTitle->getPrefixedText()),"action=edit§ion=$section");
1861 return "<span onContextMenu='document.location=\"".$url."\";return false;'>{$head}</span>";
1864 function editSectionLink($section) {
1867 global $wgTitle,$wgUser,$oldid;
1868 if($oldid) return "";
1869 if ($printable) return "";
1870 $editurl="§ion={$section}";
1871 $url=$this->makeKnownLink($wgTitle->getPrefixedText(),wfMsg("editsection"),"action=edit".$editurl);
1872 return "<div style=\"float:right;margin-left:5px;\"><small>[".$url."]</small></div>";
1877 include_once( "SkinStandard.php" );
1878 include_once( "SkinNostalgia.php" );
1879 include_once( "SkinCologneBlue.php" );
1881 #include_once( "SkinSmarty.php" );