2003-08-02 20:43:11 +00:00
|
|
|
<?
|
|
|
|
|
|
|
|
|
|
# Splitting edit page/HTML interface from Article...
|
|
|
|
|
# The actual database and text munging is still in Article,
|
|
|
|
|
# but it should get easier to call those from alternate
|
|
|
|
|
# interfaces.
|
|
|
|
|
|
|
|
|
|
class EditPage {
|
|
|
|
|
var $mArticle;
|
|
|
|
|
var $mTitle;
|
|
|
|
|
|
|
|
|
|
function EditPage( $article ) {
|
|
|
|
|
$this->mArticle =& $article;
|
|
|
|
|
global $wgTitle;
|
|
|
|
|
$this->mTitle =& $wgTitle;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# This is the function that gets called for "action=edit".
|
|
|
|
|
|
|
|
|
|
function edit()
|
|
|
|
|
{
|
2003-08-05 11:04:02 +00:00
|
|
|
global $wgOut, $wgUser, $wgWhitelistEdit;
|
2003-08-02 20:43:11 +00:00
|
|
|
global $wpTextbox1, $wpSummary, $wpSave, $wpPreview;
|
|
|
|
|
global $wpMinoredit, $wpEdittime, $wpTextbox2;
|
|
|
|
|
|
|
|
|
|
$fields = array( "wpTextbox1", "wpSummary", "wpTextbox2" );
|
|
|
|
|
wfCleanFormFields( $fields );
|
|
|
|
|
|
|
|
|
|
if ( ! $this->mTitle->userCanEdit() ) {
|
2003-12-02 22:38:16 +00:00
|
|
|
$wgOut->readOnlyPage( $this->mArticle->getContent(), true );
|
2003-08-02 20:43:11 +00:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if ( $wgUser->isBlocked() ) {
|
|
|
|
|
$this->blockedIPpage();
|
|
|
|
|
return;
|
|
|
|
|
}
|
2003-08-05 11:04:02 +00:00
|
|
|
if ( !$wgUser->getID() && $wgWhitelistEdit ) {
|
|
|
|
|
$this->userNotLoggedInPage();
|
|
|
|
|
return;
|
|
|
|
|
}
|
2003-08-02 20:43:11 +00:00
|
|
|
if ( wfReadOnly() ) {
|
|
|
|
|
if( isset( $wpSave ) or isset( $wpPreview ) ) {
|
|
|
|
|
$this->editForm( "preview" );
|
|
|
|
|
} else {
|
2003-09-09 05:46:22 +00:00
|
|
|
$wgOut->readOnlyPage( $this->mArticle->getContent() );
|
2003-08-02 20:43:11 +00:00
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if ( $_SERVER['REQUEST_METHOD'] != "POST" ) unset( $wpSave );
|
|
|
|
|
if ( isset( $wpSave ) ) {
|
|
|
|
|
$this->editForm( "save" );
|
|
|
|
|
} else if ( isset( $wpPreview ) ) {
|
|
|
|
|
$this->editForm( "preview" );
|
|
|
|
|
} else { # First time through
|
|
|
|
|
$this->editForm( "initial" );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Since there is only one text field on the edit form,
|
|
|
|
|
# pressing <enter> will cause the form to be submitted, but
|
|
|
|
|
# the submit button value won't appear in the query, so we
|
|
|
|
|
# Fake it here before going back to edit(). This is kind of
|
|
|
|
|
# ugly, but it helps some old URLs to still work.
|
|
|
|
|
|
|
|
|
|
function submit()
|
|
|
|
|
{
|
|
|
|
|
global $wpSave, $wpPreview;
|
|
|
|
|
if ( ! isset( $wpPreview ) ) { $wpSave = 1; }
|
|
|
|
|
|
|
|
|
|
$this->edit();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# The edit form is self-submitting, so that when things like
|
|
|
|
|
# preview and edit conflicts occur, we get the same form back
|
|
|
|
|
# with the extra stuff added. Only when the final submission
|
|
|
|
|
# is made and all is well do we actually save and redirect to
|
|
|
|
|
# the newly-edited page.
|
|
|
|
|
|
|
|
|
|
function editForm( $formtype )
|
|
|
|
|
{
|
|
|
|
|
global $wgOut, $wgUser;
|
|
|
|
|
global $wpTextbox1, $wpSummary, $wpWatchthis;
|
|
|
|
|
global $wpSave, $wpPreview;
|
|
|
|
|
global $wpMinoredit, $wpEdittime, $wpTextbox2, $wpSection;
|
|
|
|
|
global $oldid, $redirect, $section;
|
|
|
|
|
global $wgLang;
|
|
|
|
|
|
|
|
|
|
if(isset($wpSection)) { $section=$wpSection; } else { $wpSection=$section; }
|
|
|
|
|
|
|
|
|
|
$sk = $wgUser->getSkin();
|
|
|
|
|
$isConflict = false;
|
|
|
|
|
$wpTextbox1 = rtrim ( $wpTextbox1 ) ; # To avoid text getting longer on each preview
|
|
|
|
|
|
|
|
|
|
if(!$this->mTitle->getArticleID()) { # new article
|
|
|
|
|
|
|
|
|
|
$wgOut->addWikiText(wfmsg("newarticletext"));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Attempt submission here. This will check for edit conflicts,
|
|
|
|
|
# and redundantly check for locked database, blocked IPs, etc.
|
|
|
|
|
# that edit() already checked just in case someone tries to sneak
|
|
|
|
|
# in the back door with a hand-edited submission URL.
|
|
|
|
|
|
|
|
|
|
if ( "save" == $formtype ) {
|
|
|
|
|
if ( $wgUser->isBlocked() ) {
|
|
|
|
|
$this->blockedIPpage();
|
|
|
|
|
return;
|
|
|
|
|
}
|
2003-08-05 11:04:02 +00:00
|
|
|
if ( !$wgUser->getID() && $wgWhitelistEdit ) {
|
|
|
|
|
$this->userNotLoggedInPage();
|
|
|
|
|
return;
|
|
|
|
|
}
|
2003-08-02 20:43:11 +00:00
|
|
|
if ( wfReadOnly() ) {
|
|
|
|
|
$wgOut->readOnlyPage();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
# If article is new, insert it.
|
New edit toolbar for bold, italic, links, headlines, math, images, media,
sigs, horizontal lines (more can be added easily). Select text and click
to apply, or just click to see an example. Mouseover should show speedtips.
Also, access keys for the edit window (ALT+P=Preview, ALT+S=Save) -> Moz+IE
2004-01-11 04:11:43 +00:00
|
|
|
|
|
|
|
|
$aid = $this->mTitle->getArticleID();
|
2003-08-02 20:43:11 +00:00
|
|
|
if ( 0 == $aid ) {
|
New edit toolbar for bold, italic, links, headlines, math, images, media,
sigs, horizontal lines (more can be added easily). Select text and click
to apply, or just click to see an example. Mouseover should show speedtips.
Also, access keys for the edit window (ALT+P=Preview, ALT+S=Save) -> Moz+IE
2004-01-11 04:11:43 +00:00
|
|
|
# we need to strip Windoze linebreaks because some browsers
|
2003-08-02 20:43:11 +00:00
|
|
|
# append them and the string comparison fails
|
|
|
|
|
if ( ( "" == $wpTextbox1 ) ||
|
|
|
|
|
( wfMsg( "newarticletext" ) == rtrim( preg_replace("/\r/","",$wpTextbox1) ) ) ) {
|
|
|
|
|
$wgOut->redirect( wfLocalUrl(
|
|
|
|
|
$this->mTitle->getPrefixedURL() ) );
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
$this->mArticle->insertNewArticle( $wpTextbox1, $wpSummary, $wpMinoredit, $wpWatchthis );
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
# Article exists. Check for edit conflict.
|
|
|
|
|
# Don't check for conflict when appending a comment - this should always work
|
|
|
|
|
|
|
|
|
|
$this->mArticle->clear(); # Force reload of dates, etc.
|
New edit toolbar for bold, italic, links, headlines, math, images, media,
sigs, horizontal lines (more can be added easily). Select text and click
to apply, or just click to see an example. Mouseover should show speedtips.
Also, access keys for the edit window (ALT+P=Preview, ALT+S=Save) -> Moz+IE
2004-01-11 04:11:43 +00:00
|
|
|
if ( $section!="new" && ( $this->mArticle->getTimestamp() != $wpEdittime ) ) {
|
|
|
|
|
$isConflict = true;
|
2003-08-02 20:43:11 +00:00
|
|
|
}
|
|
|
|
|
$u = $wgUser->getID();
|
|
|
|
|
|
|
|
|
|
# Supress edit conflict with self
|
|
|
|
|
|
|
|
|
|
if ( ( 0 != $u ) && ( $this->mArticle->getUser() == $u ) ) {
|
|
|
|
|
$isConflict = false;
|
|
|
|
|
} else {
|
|
|
|
|
# switch from section editing to normal editing in edit conflict
|
|
|
|
|
if($isConflict) {
|
|
|
|
|
$section="";$wpSection="";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if ( ! $isConflict ) {
|
|
|
|
|
# All's well: update the article here
|
2003-08-17 11:58:33 +00:00
|
|
|
if($this->mArticle->updateArticle( $wpTextbox1, $wpSummary, $wpMinoredit, $wpWatchthis, $wpSection ))
|
|
|
|
|
return;
|
|
|
|
|
else
|
|
|
|
|
$isConflict = true;
|
2003-08-02 20:43:11 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
# First time through: get contents, set time for conflict
|
|
|
|
|
# checking, etc.
|
|
|
|
|
|
|
|
|
|
if ( "initial" == $formtype ) {
|
|
|
|
|
$wpEdittime = $this->mArticle->getTimestamp();
|
|
|
|
|
$wpTextbox1 = $this->mArticle->getContent(true);
|
|
|
|
|
$wpSummary = "";
|
|
|
|
|
}
|
|
|
|
|
$wgOut->setRobotpolicy( "noindex,nofollow" );
|
|
|
|
|
$wgOut->setArticleFlag( false );
|
|
|
|
|
|
|
|
|
|
if ( $isConflict ) {
|
2003-11-15 14:21:29 +00:00
|
|
|
$s = wfMsg( "editconflict", $this->mTitle->getPrefixedText() );
|
2003-08-02 20:43:11 +00:00
|
|
|
$wgOut->setPageTitle( $s );
|
|
|
|
|
$wgOut->addHTML( wfMsg( "explainconflict" ) );
|
|
|
|
|
|
|
|
|
|
$wpTextbox2 = $wpTextbox1;
|
|
|
|
|
$wpTextbox1 = $this->mArticle->getContent(true);
|
|
|
|
|
$wpEdittime = $this->mArticle->getTimestamp();
|
|
|
|
|
} else {
|
2003-11-15 14:21:29 +00:00
|
|
|
$s = wfMsg( "editing", $this->mTitle->getPrefixedText() );
|
2003-08-02 20:43:11 +00:00
|
|
|
|
New edit toolbar for bold, italic, links, headlines, math, images, media,
sigs, horizontal lines (more can be added easily). Select text and click
to apply, or just click to see an example. Mouseover should show speedtips.
Also, access keys for the edit window (ALT+P=Preview, ALT+S=Save) -> Moz+IE
2004-01-11 04:11:43 +00:00
|
|
|
if($section!="") {
|
2003-08-02 20:43:11 +00:00
|
|
|
if($section=="new") {
|
|
|
|
|
$s.=wfMsg("commentedit");
|
|
|
|
|
} else {
|
|
|
|
|
$s.=wfMsg("sectionedit");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$wgOut->setPageTitle( $s );
|
|
|
|
|
if ( $oldid ) {
|
|
|
|
|
$this->mArticle->setOldSubtitle();
|
|
|
|
|
$wgOut->addHTML( wfMsg( "editingold" ) );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( wfReadOnly() ) {
|
|
|
|
|
$wgOut->addHTML( "<strong>" .
|
|
|
|
|
wfMsg( "readonlywarning" ) .
|
|
|
|
|
"</strong>" );
|
|
|
|
|
}
|
|
|
|
|
if( $this->mTitle->isProtected() ) {
|
|
|
|
|
$wgOut->addHTML( "<strong>" . wfMsg( "protectedpagewarning" ) .
|
|
|
|
|
"</strong><br />\n" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$kblength = (int)(strlen( $wpTextbox1 ) / 1024);
|
|
|
|
|
if( $kblength > 29 ) {
|
New edit toolbar for bold, italic, links, headlines, math, images, media,
sigs, horizontal lines (more can be added easily). Select text and click
to apply, or just click to see an example. Mouseover should show speedtips.
Also, access keys for the edit window (ALT+P=Preview, ALT+S=Save) -> Moz+IE
2004-01-11 04:11:43 +00:00
|
|
|
$wgOut->addHTML( "<strong>" .
|
2003-11-15 14:21:29 +00:00
|
|
|
wfMsg( "longpagewarning", $kblength )
|
2003-08-02 20:43:11 +00:00
|
|
|
. "</strong>" );
|
|
|
|
|
}
|
New edit toolbar for bold, italic, links, headlines, math, images, media,
sigs, horizontal lines (more can be added easily). Select text and click
to apply, or just click to see an example. Mouseover should show speedtips.
Also, access keys for the edit window (ALT+P=Preview, ALT+S=Save) -> Moz+IE
2004-01-11 04:11:43 +00:00
|
|
|
|
2003-08-02 20:43:11 +00:00
|
|
|
$rows = $wgUser->getOption( "rows" );
|
|
|
|
|
$cols = $wgUser->getOption( "cols" );
|
|
|
|
|
|
|
|
|
|
$ew = $wgUser->getOption( "editwidth" );
|
|
|
|
|
if ( $ew ) $ew = " style=\"width:100%\"";
|
|
|
|
|
else $ew = "" ;
|
|
|
|
|
|
|
|
|
|
$q = "action=submit";
|
|
|
|
|
if ( "no" == $redirect ) { $q .= "&redirect=no"; }
|
|
|
|
|
$action = wfEscapeHTML( wfLocalUrl( $this->mTitle->getPrefixedURL(), $q ) );
|
|
|
|
|
|
New edit toolbar for bold, italic, links, headlines, math, images, media,
sigs, horizontal lines (more can be added easily). Select text and click
to apply, or just click to see an example. Mouseover should show speedtips.
Also, access keys for the edit window (ALT+P=Preview, ALT+S=Save) -> Moz+IE
2004-01-11 04:11:43 +00:00
|
|
|
$summary = wfMsg( "summary" );
|
2003-08-02 20:43:11 +00:00
|
|
|
$subject = wfMsg("subject");
|
|
|
|
|
$minor = wfMsg( "minoredit" );
|
|
|
|
|
$watchthis = wfMsg ("watchthis");
|
|
|
|
|
$save = wfMsg( "savearticle" );
|
|
|
|
|
$prev = wfMsg( "showpreview" );
|
|
|
|
|
|
|
|
|
|
$cancel = $sk->makeKnownLink( $this->mTitle->getPrefixedURL(),
|
|
|
|
|
wfMsg( "cancel" ) );
|
|
|
|
|
$edithelp = $sk->makeKnownLink( wfMsg( "edithelppage" ),
|
|
|
|
|
wfMsg( "edithelp" ) );
|
2003-11-15 14:21:29 +00:00
|
|
|
$copywarn = wfMsg( "copyrightwarning", $sk->makeKnownLink(
|
|
|
|
|
wfMsg( "copyrightpage" ) ) );
|
2003-08-02 20:43:11 +00:00
|
|
|
|
|
|
|
|
$wpTextbox1 = wfEscapeHTML( $wpTextbox1 );
|
|
|
|
|
$wpTextbox2 = wfEscapeHTML( $wpTextbox2 );
|
|
|
|
|
$wpSummary = wfEscapeHTML( $wpSummary );
|
New edit toolbar for bold, italic, links, headlines, math, images, media,
sigs, horizontal lines (more can be added easily). Select text and click
to apply, or just click to see an example. Mouseover should show speedtips.
Also, access keys for the edit window (ALT+P=Preview, ALT+S=Save) -> Moz+IE
2004-01-11 04:11:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
if($wgUser->getOption("showtoolbar")) {
|
|
|
|
|
// prepare toolbar for edit buttons
|
|
|
|
|
$toolbar=$sk->getEditToolbar();
|
|
|
|
|
}
|
|
|
|
|
|
2003-08-02 20:43:11 +00:00
|
|
|
// activate checkboxes if user wants them to be always active
|
|
|
|
|
if (!$wpPreview && $wgUser->getOption("watchdefault")) $wpWatchthis=1;
|
New edit toolbar for bold, italic, links, headlines, math, images, media,
sigs, horizontal lines (more can be added easily). Select text and click
to apply, or just click to see an example. Mouseover should show speedtips.
Also, access keys for the edit window (ALT+P=Preview, ALT+S=Save) -> Moz+IE
2004-01-11 04:11:43 +00:00
|
|
|
if (!$wpPreview && $wgUser->getOption("minordefault")) $wpMinoredit=1;
|
|
|
|
|
|
2003-08-02 20:43:11 +00:00
|
|
|
// activate checkbox also if user is already watching the page,
|
|
|
|
|
// require wpWatchthis to be unset so that second condition is not
|
|
|
|
|
// checked unnecessarily
|
|
|
|
|
if (!$wpWatchthis && !$wpPreview && $this->mTitle->userIsWatching()) $wpWatchthis=1;
|
New edit toolbar for bold, italic, links, headlines, math, images, media,
sigs, horizontal lines (more can be added easily). Select text and click
to apply, or just click to see an example. Mouseover should show speedtips.
Also, access keys for the edit window (ALT+P=Preview, ALT+S=Save) -> Moz+IE
2004-01-11 04:11:43 +00:00
|
|
|
|
2003-08-02 20:43:11 +00:00
|
|
|
if ( 0 != $wgUser->getID() ) {
|
|
|
|
|
$checkboxhtml=
|
2003-08-16 22:53:30 +00:00
|
|
|
"<input tabindex=3 type=checkbox value=1 name='wpMinoredit'".($wpMinoredit?" checked":"")." id='wpMinoredit'>".
|
|
|
|
|
"<label for='wpMinoredit'>{$minor}</label>".
|
|
|
|
|
"<input tabindex=4 type=checkbox name='wpWatchthis'".($wpWatchthis?" checked":"")." id='wpWatchthis'>".
|
|
|
|
|
"<label for='wpWatchthis'>{$watchthis}</label><br>";
|
New edit toolbar for bold, italic, links, headlines, math, images, media,
sigs, horizontal lines (more can be added easily). Select text and click
to apply, or just click to see an example. Mouseover should show speedtips.
Also, access keys for the edit window (ALT+P=Preview, ALT+S=Save) -> Moz+IE
2004-01-11 04:11:43 +00:00
|
|
|
|
2003-08-02 20:43:11 +00:00
|
|
|
} else {
|
|
|
|
|
$checkboxhtml="";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( "preview" == $formtype) {
|
New edit toolbar for bold, italic, links, headlines, math, images, media,
sigs, horizontal lines (more can be added easily). Select text and click
to apply, or just click to see an example. Mouseover should show speedtips.
Also, access keys for the edit window (ALT+P=Preview, ALT+S=Save) -> Moz+IE
2004-01-11 04:11:43 +00:00
|
|
|
|
|
|
|
|
$previewhead="<h2>" . wfMsg( "preview" ) . "</h2>\n<p><large><center><font color=\"#cc0000\">" .
|
2003-08-02 20:43:11 +00:00
|
|
|
wfMsg( "note" ) . wfMsg( "previewnote" ) . "</font></center></large><P>\n";
|
|
|
|
|
if ( $isConflict ) {
|
|
|
|
|
$previewhead.="<h2>" . wfMsg( "previewconflict" ) .
|
|
|
|
|
"</h2>\n";
|
|
|
|
|
}
|
|
|
|
|
$previewtext = wfUnescapeHTML( $wpTextbox1 );
|
New edit toolbar for bold, italic, links, headlines, math, images, media,
sigs, horizontal lines (more can be added easily). Select text and click
to apply, or just click to see an example. Mouseover should show speedtips.
Also, access keys for the edit window (ALT+P=Preview, ALT+S=Save) -> Moz+IE
2004-01-11 04:11:43 +00:00
|
|
|
|
2003-08-02 20:43:11 +00:00
|
|
|
if($wgUser->getOption("previewontop")) {
|
|
|
|
|
$wgOut->addHTML($previewhead);
|
|
|
|
|
$wgOut->addWikiText( $this->mArticle->preSaveTransform( $previewtext ) ."\n\n");
|
|
|
|
|
}
|
|
|
|
|
$wgOut->addHTML( "<br clear=\"all\" />\n" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# if this is a comment, show a subject line at the top, which is also the edit summary.
|
|
|
|
|
# Otherwise, show a summary field at the bottom
|
|
|
|
|
if($section=="new") {
|
|
|
|
|
|
|
|
|
|
$commentsubject="{$subject}: <input tabindex=1 type=text value=\"{$wpSummary}\" name=\"wpSummary\" maxlength=200 size=60><br>";
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
$editsummary="{$summary}: <input tabindex=3 type=text value=\"{$wpSummary}\" name=\"wpSummary\" maxlength=200 size=60><br>";
|
|
|
|
|
}
|
|
|
|
|
|
2003-12-11 05:52:15 +00:00
|
|
|
if( $_GET["action"] == "edit" ) {
|
|
|
|
|
# Don't select the edit box on preview; this interferes with seeing what's going on.
|
|
|
|
|
$wgOut->setOnloadHandler( "document.editform.wpTextbox1.focus()" );
|
|
|
|
|
}
|
2003-08-02 20:43:11 +00:00
|
|
|
$wgOut->addHTML( "
|
New edit toolbar for bold, italic, links, headlines, math, images, media,
sigs, horizontal lines (more can be added easily). Select text and click
to apply, or just click to see an example. Mouseover should show speedtips.
Also, access keys for the edit window (ALT+P=Preview, ALT+S=Save) -> Moz+IE
2004-01-11 04:11:43 +00:00
|
|
|
{$toolbar}
|
2003-08-02 20:43:11 +00:00
|
|
|
<form id=\"editform\" name=\"editform\" method=\"post\" action=\"$action\"
|
|
|
|
|
enctype=\"application/x-www-form-urlencoded\">
|
|
|
|
|
{$commentsubject}
|
|
|
|
|
<textarea tabindex=2 name=\"wpTextbox1\" rows={$rows}
|
|
|
|
|
cols={$cols}{$ew} wrap=\"virtual\">" .
|
|
|
|
|
$wgLang->recodeForEdit( $wpTextbox1 ) .
|
|
|
|
|
"
|
|
|
|
|
</textarea>
|
|
|
|
|
<br>{$editsummary}
|
|
|
|
|
{$checkboxhtml}
|
New edit toolbar for bold, italic, links, headlines, math, images, media,
sigs, horizontal lines (more can be added easily). Select text and click
to apply, or just click to see an example. Mouseover should show speedtips.
Also, access keys for the edit window (ALT+P=Preview, ALT+S=Save) -> Moz+IE
2004-01-11 04:11:43 +00:00
|
|
|
<input tabindex=5 type=submit value=\"{$save}\" name=\"wpSave\" accesskey=\"s\">
|
|
|
|
|
<input tabindex=6 type=submit value=\"{$prev}\" name=\"wpPreview\" accesskey=\"p\">
|
2003-08-02 20:43:11 +00:00
|
|
|
<em>{$cancel}</em> | <em>{$edithelp}</em>
|
|
|
|
|
<br><br>{$copywarn}
|
|
|
|
|
<input type=hidden value=\"{$section}\" name=\"wpSection\">
|
|
|
|
|
<input type=hidden value=\"{$wpEdittime}\" name=\"wpEdittime\">\n" );
|
|
|
|
|
|
|
|
|
|
if ( $isConflict ) {
|
|
|
|
|
$wgOut->addHTML( "<h2>" . wfMsg( "yourdiff" ) . "</h2>\n" );
|
|
|
|
|
DifferenceEngine::showDiff( $wpTextbox2, $wpTextbox1,
|
|
|
|
|
wfMsg( "yourtext" ), wfMsg( "storedversion" ) );
|
|
|
|
|
|
|
|
|
|
$wgOut->addHTML( "<h2>" . wfMsg( "yourtext" ) . "</h2>
|
|
|
|
|
<textarea tabindex=6 name=\"wpTextbox2\" rows={$rows} cols={$cols} wrap=virtual>"
|
|
|
|
|
. $wgLang->recodeForEdit( $wpTextbox2 ) .
|
|
|
|
|
"
|
|
|
|
|
</textarea>" );
|
|
|
|
|
}
|
|
|
|
|
$wgOut->addHTML( "</form>\n" );
|
|
|
|
|
if($formtype =="preview" && !$wgUser->getOption("previewontop")) {
|
|
|
|
|
$wgOut->addHTML($previewhead);
|
|
|
|
|
$wgOut->addWikiText( $this->mArticle->preSaveTransform( $previewtext ) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function blockedIPpage()
|
|
|
|
|
{
|
|
|
|
|
global $wgOut, $wgUser, $wgLang;
|
|
|
|
|
|
|
|
|
|
$wgOut->setPageTitle( wfMsg( "blockedtitle" ) );
|
|
|
|
|
$wgOut->setRobotpolicy( "noindex,nofollow" );
|
|
|
|
|
$wgOut->setArticleFlag( false );
|
|
|
|
|
|
|
|
|
|
$id = $wgUser->blockedBy();
|
|
|
|
|
$reason = $wgUser->blockedFor();
|
2003-12-12 00:25:29 +00:00
|
|
|
$ip = getenv( "REMOTE_ADDR" );
|
2003-08-02 20:43:11 +00:00
|
|
|
|
|
|
|
|
$name = User::whoIs( $id );
|
|
|
|
|
$link = "[[" . $wgLang->getNsText( Namespace::getUser() ) .
|
|
|
|
|
":{$name}|{$name}]]";
|
|
|
|
|
|
2003-12-12 00:25:29 +00:00
|
|
|
$wgOut->addWikiText( wfMsg( "blockedtext", $link, $reason, $ip ) );
|
2003-08-02 20:43:11 +00:00
|
|
|
$wgOut->returnToMain( false );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-08-05 11:04:02 +00:00
|
|
|
|
|
|
|
|
function userNotLoggedInPage()
|
|
|
|
|
{
|
|
|
|
|
global $wgOut, $wgUser, $wgLang;
|
|
|
|
|
|
|
|
|
|
$wgOut->setPageTitle( wfMsg( "whitelistedittitle" ) );
|
|
|
|
|
$wgOut->setRobotpolicy( "noindex,nofollow" );
|
|
|
|
|
$wgOut->setArticleFlag( false );
|
|
|
|
|
|
|
|
|
|
$wgOut->addWikiText( wfMsg( "whitelistedittext" ) );
|
|
|
|
|
$wgOut->returnToMain( false );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-08-02 20:43:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
?>
|