var $mMetaData = '';
# Form values
- var $save = false, $preview = false;
+ var $save = false, $preview = false, $diff = false;
var $minoredit = false, $watchthis = false;
var $textbox1 = '', $textbox2 = '', $summary = '';
var $edittime = '', $section = '';
$wgOut->readOnlyPage( $this->mArticle->getContent( true ), true );
return;
}
- if ( !$this->preview && $wgUser->isBlocked( !$this->save ) ) {
+ if ( !$this->preview && !$this->diff && $wgUser->isBlocked( !$this->save ) ) {
# When previewing, don't check blocked state - will get caught at save time.
# Also, check when starting edition is done against slave to improve performance.
$this->blockedIPpage();
if ( wfReadOnly() ) {
if( $this->save || $this->preview ) {
$this->editForm( 'preview' );
+ } else if ( $this->diff ) {
+ $this->editForm( 'diff' );
} else {
$wgOut->readOnlyPage( $this->mArticle->getContent( true ) );
}
$this->editForm( 'save' );
} else if ( $this->preview ) {
$this->editForm( 'preview' );
+ } else if ( $this->diff ) {
+ $this->editForm( 'diff' );
} else { # First time through
if( $wgUser->getOption('previewonfirst') ) {
$this->editForm( 'preview', true );
# The unmarked state will be assumed to be a save,
# if the form seems otherwise complete.
$this->preview = $request->getCheck( 'wpPreview' );
+ $this->diff = $request->getCheck( 'wpDiff' );
} else {
# Page might be a hack attempt posted from
# an external site. Preview instead of saving.
$this->preview = true;
}
}
- $this->save = !$this->preview;
+ $this->save = ! ( $this->preview OR $this->diff );
if( !preg_match( '/^\d{14}$/', $this->edittime )) {
$this->edittime = null;
}
$this->edittime = '';
$this->preview = false;
$this->save = false;
+ $this->diff = false;
$this->minoredit = false;
$this->watchthis = false;
}
* is made and all is well do we actually save and redirect to
* the newly-edited page.
*
- * @param string $formtype Type of form either : save, initial or preview
+ * @param string $formtype Type of form either : save, initial, diff or preview
* @param bool $firsttime True to load form data from db
*/
function editForm( $formtype, $firsttime = false ) {
$watchthis = wfMsg ('watchthis');
$save = wfMsg('savearticle');
$prev = wfMsg('showpreview');
+ $diff = wfMsg('showdiff');
$cancel = $sk->makeKnownLink( $this->mTitle->getPrefixedText(),
wfMsg('cancel') );
}
// activate checkboxes if user wants them to be always active
- if( !$this->preview ) {
+ if( !$this->preview && !$this->diff ) {
if( $wgUser->getOption( 'watchdefault' ) ) $this->watchthis = true;
if( $wgUser->getOption( 'minordefault' ) ) $this->minoredit = true;
$wgOut->addHTML( '<div id="wikiPreview">' );
if ( 'preview' == $formtype) {
$previewOutput = $this->getPreviewText( $isConflict, $isCssJsSubpage );
- if( $wgUser->getOption('previewontop' ) ) {
+ if ( $wgUser->getOption('previewontop' ) ) {
$wgOut->addHTML( $previewOutput );
$wgOut->addHTML( "<br style=\"clear:both;\" />\n" );
}
}
$wgOut->addHTML( '</div>' );
+ $wgOut->addHTML( '<div id="wikiDiff">' );
+ if ( 'diff' == $formtype ) {
+ require_once( 'DifferenceEngine.php' );
+ $oldtext = $this->mArticle->getContent( true );
+ $newtext = $this->textbox1;
+ $oldtitle = wfMsg( 'currentrev' );
+ $newtitle = wfMsg( 'yourtext' );
+
+ if ( $oldtext != wfMsg( 'noarticletext' ) || $newtext != '' ) {
+ $difftext = DifferenceEngine::getDiff( $oldtext, $newtext, $oldtitle, $newtitle );
+ }
+ if ( $wgUser->getOption('previewontop' ) ) {
+ $wgOut->addHTML( $difftext );
+ $wgOut->addHTML( "<br style=\"clear:both;\" />\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
$editsummary="{$summary}: <input tabindex='3' type='text' value=\"$summarytext\" name=\"wpSummary\" maxlength='200' size='60' /><br />";
}
- if( !$this->preview ) {
+ if( !$this->preview && !$this->diff ) {
# Don't select the edit box on preview; this interferes with seeing what's going on.
$wgOut->setOnloadHandler( 'document.editform.wpTextbox1.focus()' );
}
" title=\"".wfMsg('tooltip-save')."\"/>
<input tabindex='6' id='wpPreview' type='submit' $liveOnclick value=\"{$prev}\" name=\"wpPreview\" accesskey=\"".wfMsg('accesskey-preview')."\"".
" title=\"".wfMsg('tooltip-preview')."\"/>
+<input tabindex='6' id='wpDiff' type='submit' value=\"{$diff}\" name=\"wpDiff\" accesskey=\"".wfMsg('accesskey-diff')."\"".
+" title=\"".wfMsg('tooltip-diff')."\"/>
<em>{$cancel}</em> | <em>{$edithelp}</em>{$templates}" );
$wgOut->addWikiText( $copywarn );
$wgOut->addHTML( "
</textarea>" );
}
$wgOut->addHTML( "</form>\n" );
- if($formtype =="preview" && !$wgUser->getOption("previewontop")) {
- $wgOut->addHTML('<div id="wikiPreview">' . $previewOutput . '</div>');
+ if ( $formtype == 'preview' && !$wgUser->getOption( 'previewontop' ) ) {
+ $wgOut->addHTML( '<div id="wikiPreview">' . $previewOutput . '</div>' );
+ }
+ if ( $formtype == 'diff' && !$wgUser->getOption( 'previewontop' ) ) {
+ $wgOut->addHTML( '<div id="wikiPreview">' . $difftext . '</div>' );
}
}
+ function getDiffText() {
+ }
+
+ /**
+ * @todo document
+ */
function getPreviewText( $isConflict, $isCssJsSubpage ) {
- global $wgOut, $wgUser, $wgTitle, $wgParser;
+ global $wgOut, $wgUser, $wgTitle, $wgParser, $wgAllowDiffPreview, $wgEnableDiffPreviewPreference;
$previewhead = '<h2>' . htmlspecialchars( wfMsg( 'preview' ) ) . "</h2>\n" .
"<p class='previewnote'>" . htmlspecialchars( wfMsg( 'previewnote' ) ) . "</p>\n";
if ( $isConflict ) {
$wgTitle, $parserOptions );
$previewHTML = $parserOutput->mText;
+
$wgOut->addCategoryLinks($parserOutput->getCategoryLinks());
$wgOut->addLanguageLinks($parserOutput->getLanguageLinks());
return $previewhead . $previewHTML;
# For compatibility with Latin-1 installations, please
# don't add literal characters above U+00ff.
#
-require_once( "LanguageUtf8.php" );
+require_once( 'LanguageUtf8.php' );
# See Language.php for notes.
if($wgMetaNamespace === FALSE)
- $wgMetaNamespace = str_replace( " ", "_", $wgSitename );
+ $wgMetaNamespace = str_replace( ' ', '_', $wgSitename );
/* private */ $wgNamespaceNamesDe = array(
- NS_MEDIA => "Media",
- NS_SPECIAL => "Spezial",
- NS_MAIN => "",
- NS_TALK => "Diskussion",
- NS_USER => "Benutzer",
- NS_USER_TALK => "Benutzer_Diskussion",
+ NS_MEDIA => 'Media',
+ NS_SPECIAL => 'Spezial',
+ NS_MAIN => '',
+ NS_TALK => 'Diskussion',
+ NS_USER => 'Benutzer',
+ NS_USER_TALK => 'Benutzer_Diskussion',
NS_PROJECT => $wgMetaNamespace,
- NS_PROJECT_TALK => $wgMetaNamespace . "_Diskussion",
- NS_IMAGE => "Bild",
- NS_IMAGE_TALK => "Bild_Diskussion",
- NS_MEDIAWIKI => "MediaWiki",
- NS_MEDIAWIKI_TALK => "MediaWiki_Diskussion",
- NS_TEMPLATE => "Vorlage",
- NS_TEMPLATE_TALK => "Vorlage_Diskussion",
- NS_HELP => "Hilfe",
- NS_HELP_TALK => "Hilfe_Diskussion",
- NS_CATEGORY => "Kategorie",
- NS_CATEGORY_TALK => "Kategorie_Diskussion"
+ NS_PROJECT_TALK => $wgMetaNamespace . '_Diskussion',
+ NS_IMAGE => 'Bild',
+ NS_IMAGE_TALK => 'Bild_Diskussion',
+ NS_MEDIAWIKI => 'MediaWiki',
+ NS_MEDIAWIKI_TALK => 'MediaWiki_Diskussion',
+ NS_TEMPLATE => 'Vorlage',
+ NS_TEMPLATE_TALK => 'Vorlage_Diskussion',
+ NS_HELP => 'Hilfe',
+ NS_HELP_TALK => 'Hilfe_Diskussion',
+ NS_CATEGORY => 'Kategorie',
+ NS_CATEGORY_TALK => 'Kategorie_Diskussion'
) + $wgNamespaceNamesEn;
/* private */ $wgQuickbarSettingsDe = array(
- "Keine", "Links, fest", "Rechts, fest", "Links, schwebend"
+ 'Keine', 'Links, fest', 'Rechts, fest', 'Links, schwebend'
);
/* private */ $wgSkinNamesDe = array(
- 'standard' => "Klassik",
- 'nostalgia' => "Nostalgie",
- 'cologneblue' => "Kölnisch Blau",
- 'smarty' => "Paddington",
- 'montparnasse' => "Montparnasse",
- 'davinci' => "DaVinci",
- 'mono' => "Mono",
- 'monobook' => "MonoBook",
- 'myskin' => "MySkin",
- 'chick' => "Küken"
+ 'standard' => 'Klassik',
+ 'nostalgia' => 'Nostalgie',
+ 'cologneblue' => 'Kölnisch Blau',
+ 'smarty' => 'Paddington',
+ 'montparnasse' => 'Montparnasse',
+ 'davinci' => 'DaVinci',
+ 'mono' => 'Mono',
+ 'monobook' => 'MonoBook',
+ 'myskin' => 'MySkin',
+ 'chick' => 'Küken'
);
/* private */ $wgBookstoreListDe = array(
- "Verzeichnis lieferbarer Bücher" => "http://www.buchhandel.de/sixcms/list.php?page=buchhandel_profisuche_frameset&suchfeld=isbn&suchwert=$1&x=0&y=0",
- "abebooks.de" => "http://www.abebooks.de/servlet/BookSearchPL?ph=2&isbn=$1",
- "Amazon.de" => "http://www.amazon.de/exec/obidos/ISBN=$1",
- "Lehmanns Fachbuchhandlung" => "http://www.lob.de/cgi-bin/work/suche?flag=new&stich1=$1",
+ 'Verzeichnis lieferbarer Bücher' => 'http://www.buchhandel.de/sixcms/list.php?page=buchhandel_profisuche_frameset&suchfeld=isbn&suchwert=$1&x=0&y=0',
+ 'abebooks.de' => 'http://www.abebooks.de/servlet/BookSearchPL?ph=2&isbn=$1',
+ 'Amazon.de' => 'http://www.amazon.de/exec/obidos/ISBN=$1',
+ 'Lehmanns Fachbuchhandlung' => 'http://www.lob.de/cgi-bin/work/suche?flag=new&stich1=$1',
);
/* private */ $wgValidSpecialPagesDe = array(
- "Userlogin" => "",
- "Userlogout" => "",
- "Preferences" => "Meine Benutzereinstellungen",
- "Watchlist" => "Meine Beobachtungsliste",
- "Recentchanges" => "Letzte Änderungen",
- "Upload" => "Dateien hochladen",
- "Imagelist" => "Hochgeladene Dateien",
- "Listusers" => "Registrierte Benutzer",
- "Statistics" => "Seitenstatistik",
- "Randompage" => "Zufälliger Artikel",
-
- "Lonelypages" => "Verwaiste Artikel",
- "Unusedimages" => "Verwaiste Dateien",
- "Popularpages" => "Beliebte Artikel",
- "Wantedpages" => "Gewünschte Artikel",
- "Shortpages" => "Kurze Artikel",
- "Longpages" => "Lange Artikel",
- "Newpages" => "Neue Artikel",
- "Ancientpages" => "Älteste Artikel",
+ 'Userlogin' => '',
+ 'Userlogout' => '',
+ 'Preferences' => 'Meine Benutzereinstellungen',
+ 'Watchlist' => 'Meine Beobachtungsliste',
+ 'Recentchanges' => 'Letzte Änderungen',
+ 'Upload' => 'Dateien hochladen',
+ 'Imagelist' => 'Hochgeladene Dateien',
+ 'Listusers' => 'Registrierte Benutzer',
+ 'Statistics' => 'Seitenstatistik',
+ 'Randompage' => 'Zufälliger Artikel',
+
+ 'Lonelypages' => 'Verwaiste Artikel',
+ 'Unusedimages' => 'Verwaiste Dateien',
+ 'Popularpages' => 'Beliebte Artikel',
+ 'Wantedpages' => 'Gewünschte Artikel',
+ 'Shortpages' => 'Kurze Artikel',
+ 'Longpages' => 'Lange Artikel',
+ 'Newpages' => 'Neue Artikel',
+ 'Ancientpages' => 'Älteste Artikel',
/* "Intl" => "Interlanguage Links", */
- "Allpages" => "Alle Artikel (alphabetisch)",
-
- "Ipblocklist" => "Blockierte IP-Adressen",
- "Maintenance" => "Wartungsseite",
- "Specialpages" => "",
- "Contributions" => "",
- "Movepage" => "",
- "Emailuser" => "",
- "Whatlinkshere" => "",
- "Recentchangeslinked" => "",
+ 'Allpages' => 'Alle Artikel (alphabetisch)',
+
+ 'Ipblocklist' => 'Blockierte IP-Adressen',
+ 'Maintenance' => 'Wartungsseite',
+ 'Specialpages' => '',
+ "Contributions" => '',
+ "Movepage" => '',
+ "Emailuser" => '',
+ "Whatlinkshere" => '',
+ "Recentchangeslinked" => '',
"Booksources" => "Externe Buchhandlungen",
"Categories" => "Seiten-Kategorien",
"Export" => "XML-Seitenexport",
#
"categories" => "Seitenkategorien",
"category" => "Kategorie",
-"category_header" => "Artikel in der Kategorie \"$1\"",
+'category_header' => 'Artikel in der Kategorie "$1"',
"subcategories" => "Unterkategorien",
"linktrail" => "/^([ä|ö|ü|ß|a-z]+)(.*)\$/sD",
"mainpage" => "Hauptseite",
"protectedpage" => "Geschützte Seite",
"administrators" => "Project:Administratoren",
"sysoptitle" => "Sysop-Zugang notwendig",
-"sysoptext" => "Dieser Vorgang kann aus Sicherheitsgründen nur von Benutzern mit \"Sysop\"-Status durchgeführt werden. Siehe auch $1.",
+'sysoptext' => 'Dieser Vorgang kann aus Sicherheitsgründen nur von Benutzern mit"Sysop"-Status durchgeführt werden. Siehe auch $1.',
"developertitle" => "Entwickler-Zugang notwendig",
-"developertext" => "Dieser Vorgang kann aus Sicherheitsgründen nur von Benutzern mit \"Entwickler\"-Status durchgeführt werden. Siehe auch $1.",
-"bureaucrattitle" => "Bürokraten-Rechte notwendig",
-"bureaucrattext" => "Dieser Vorgang kann nur von Benutzern mit \"Bürokrat\"-Status durchgeführt werden.",
+'developertext' => 'Dieser Vorgang kann aus Sicherheitsgründen nur von Benutzern mit"Entwickler"-Status durchgeführt werden. Siehe auch $1.',
+'bureaucrattitle' => 'Bürokraten-Rechte notwendig',
+'bureaucrattext' => 'Dieser Vorgang kann nur von Benutzern mit "Bürokrat"-Status durchgeführt werden.',
"nbytes" => "$1 Byte",
"go" => "Los",
"ok" => "OK",
"sitesubtitle" => "Die freie Enzyklopädie",
"pagetitle" => "$1 - {{SITENAME}}",
"sitesubtitle" => "Die freie Wissensdatenbank",
-"retrievedfrom" => "Von \"$1\"",
+'retrievedfrom' => 'Von "$1"',
"newmessages" => "Sie haben $1.",
"newmessageslink" => "neue Nachrichten",
"editsection" => "bearbeiten",
"savearticle" => "Artikel speichern",
"preview" => "Vorschau",
"showpreview" => "Vorschau zeigen",
+"showdiff" => "Änderungen zeigen",
"blockedtitle" => "Benutzer ist blockiert",
"blockedtext" => "Ihr Benutzername oder Ihre IP-Adresse wurde von $1 blockiert.
Als Grund wurde angegeben:<br />$2<p>Bitte kontaktieren Sie den Administrator, um über die Blockierung zu sprechen.",
'tooltip-minoredit' => 'Diese Änderung als klein markieren. [alt-i]',
'tooltip-save' => 'Änderungen speichern [alt-s]',
'tooltip-preview' => 'Vorschau der Änderungen an dieser Seite. Benutzen Sie dies vor dem Speichern! [alt-p]',
+'tooltip-diff' => 'Zeigt Ihre Änderungen am Text tabellarisch an [alt-d]',
'tooltip-contributions' => 'Liste der beiträge dieses Benutzers.',
'tooltip-emailuser' => 'Senden Sie eine Mail an diesen Benutzer',
'tooltip-rss' => 'RSS-Feed von dieser Seite.',
'accesskey-minoredit' => 'i',
'accesskey-save' => 's',
'accesskey-preview' => 'p',
+'accesskey-diff' => 'd',
'accesskey-contributions' => '',
'accesskey-emailuser' => '',
'accesskey-compareselectedversions' => 'v',