$nh=$wgUser->getOption( "numberheadings" );
$st=$wgUser->getOption( "showtoc" );
$es=$wgUser->getID() && $wgUser->getOption( "editsection" );
+ if($wgTitle->getPrefixedText()==wfMsg("mainpage")) {$st=0;}
$sk=$wgUser->getSkin();
preg_match_all("/<H([1-6])(.*?>)(.*?)<\/H[1-6]>/i",$text,$matches);
if($st) {
$toc.=$sk->tocLine($anchor,$tocline);
}
+ if($es && !isset($wpPreview)) {
+ $head[$c].=$sk->editSectionLink($c+1);
+ }
$head[$c].="<H".$level.$matches[2][$c]
."<a name=\"".$anchor."\">"
.$headline
$blocks=preg_split("/<H[1-6].*?>.*?<\/H[1-6]>/i",$text);
$i=0;
- foreach($blocks as $block) {
- $full.=$block;
- if($es && $c>0 && !isset($wpPreview)) {
- $full.=$sk->editSectionLink($i);
+
+ foreach($blocks as $block) {
+ if($es && !isset($wpPreview) && $c>0 && $i==0) {
+ $full.=$sk->editSectionLink(0);
}
+ $full.=$block;
$full.=$head[$i];
$i++;
}
function editSectionLink($section) {
- global $wgTitle;
- $editurl="§ion={$section}";
+ global $wgTitle,$wgUser,$oldid;
+ if($wgTitle->isProtected() && !$wgUser->isSysop()) return "";
+ if($oldid) return "";
+ $editurl="§ion={$section}";
$url=$this->makeKnownLink($wgTitle->getPrefixedText(),wfMsg("editsection"),"action=edit".$editurl);
- return "<p style=\"text-align:left;\"><small>[".$url."]</small></p>";
+ return "<div style=\"float:right;margin-left:5px;\"><small>[".$url."]</small></div>";
}
}
"previewconflict" => "This preview reflects the text in the upper
text editing area as it will appear if you choose to save.",
"editing" => "Editing $1",
+"sectionedit" => " (section)",
"editconflict" => "Edit conflict: $1",
"explainconflict" => "Someone else has changed this page since you
started editing it.
wfLocalUrl( "Special:Userlogin" ) . "\">logged in</a>
to set user preferences.",
"prefslogintext" => "You are logged in as \"$1\".
-Your internal ID number is $2.
-
-See [[Wikipedia:User preferences help]] for help deciphering the options.",
+Your internal ID number is $2.",
"prefsreset" => "Preferences have been reset from storage.",
"qbsettings" => "Quickbar settings",
"changepassword" => "Change password",
}
if ( 0 == $diff ) { return $ts; }
- $t = gmmktime( ( (int)substr( $ts, 8, 2) ) + $diff,
+ $t = mktime( ( (int)substr( $ts, 8, 2) ) + $diff,
(int)substr( $ts, 10, 2 ), (int)substr( $ts, 12, 2 ),
(int)substr( $ts, 4, 2 ), (int)substr( $ts, 6, 2 ),
(int)substr( $ts, 0, 4 ) );
- return gmdate( "YmdHis", $t );
+ return date( "YmdHis", $t );
}
function date( $ts, $adj = false )
function rfc1123( $ts )
{
- return gmdate( "D, d M Y H:i:s T", $ts );
+ return date( "D, d M Y H:i:s T", $ts );
}
function getValidSpecialPages()