' .
- $wgOut->parse( wfMsg( 'confirmrecreate', $this->lastDelete->user_name , $this->lastDelete->log_comment ) ) .
+ wfMsgExt( $key, 'parseinline', $username, "
$comment" ) .
Xml::checkLabel( wfMsg( 'recreate' ), 'wpRecreate', 'wpRecreate', false,
array( 'title' => $sk->titleAttrib( 'recreate' ), 'tabindex' => 1, 'id' => 'wpRecreate' )
) .
@@ -1305,6 +1436,8 @@ HTML
$wgOut->addHTML( $this->editFormTextBeforeContent );
+ $wgOut->addHTML( $toolbar );
+
if ( $this->isConflict ) {
// In an edit conflict bypass the overrideable content form method
// and fallback to the raw wpTextbox1 since editconflicts can't be
@@ -1352,7 +1485,7 @@ HTML
}
protected function showHeader() {
- global $wgOut, $wgUser, $wgTitle, $wgMaxArticleSize, $wgLang;
+ global $wgOut, $wgUser, $wgMaxArticleSize, $wgLang;
if ( $this->isConflict ) {
$wgOut->wrapWikiMsg( "
\n$1\n
", 'explainconflict' );
$this->edittime = $this->mArticle->getTimestamp();
@@ -1403,7 +1536,7 @@ HTML
if ( !$this->mArticle->mRevision->userCan( Revision::DELETED_TEXT ) ) {
$wgOut->wrapWikiMsg( "
\n$1\n
\n", 'rev-deleted-text-permission' );
- } else if ( $this->mArticle->mRevision->isDeleted( Revision::DELETED_TEXT ) ) {
+ } elseif ( $this->mArticle->mRevision->isDeleted( Revision::DELETED_TEXT ) ) {
$wgOut->wrapWikiMsg( "
\n$1\n
\n", 'rev-deleted-text-view' );
}
@@ -1426,7 +1559,7 @@ HTML
if ( $this->isCssJsSubpage ) {
# Check the skin exists
if ( $this->isWrongCaseCssJsPage ) {
- $wgOut->wrapWikiMsg( "
\n$1\n
", array( 'userinvalidcssjstitle', $wgTitle->getSkinFromCssJsSubpage() ) );
+ $wgOut->wrapWikiMsg( "
\n$1\n
", array( 'userinvalidcssjstitle', $this->getContextTitle()->getSkinFromCssJsSubpage() ) );
}
if ( $this->formtype !== 'preview' ) {
if ( $this->isCssSubpage )
@@ -1478,9 +1611,7 @@ HTML
$wgOut->wrapWikiMsg( "
\n$1\n
",
array( 'longpageerror', $wgLang->formatNum( $this->kblength ), $wgLang->formatNum( $wgMaxArticleSize ) ) );
} else {
- $msg = 'longpage-hint';
- $text = wfMsg( $msg );
- if( !wfEmptyMsg( $msg, $text ) && $text !== '-' ) {
+ if( !wfMessage('longpage-hint')->isDisabled() ) {
$wgOut->wrapWikiMsg( "
\n$1\n
",
array( 'longpage-hint', $wgLang->formatSize( strlen( $this->textbox1 ) ), strlen( $this->textbox1 ) )
);
@@ -1495,10 +1626,10 @@ HTML
* inferred by the id given to the input. You can remove them both by
* passing array( 'id' => false ) to $userInputAttrs.
*
- * @param $summary The value of the summary input
- * @param $labelText The html to place inside the label
- * @param $inputAttrs An array of attrs to use on the input
- * @param $spanLabelAttrs An array of attrs to use on the span inside the label
+ * @param $summary string The value of the summary input
+ * @param $labelText string The html to place inside the label
+ * @param $inputAttrs array of attrs to use on the input
+ * @param $spanLabelAttrs array of attrs to use on the span inside the label
*
* @return array An array in the format array( $label, $input )
*/
@@ -1541,11 +1672,13 @@ HTML
# Add a class if 'missingsummary' is triggered to allow styling of the summary line
$summaryClass = $this->missingSummary ? 'mw-summarymissed' : 'mw-summary';
if ( $isSubjectPreview ) {
- if ( $this->nosummary )
+ if ( $this->nosummary ) {
return;
+ }
} else {
- if ( !$this->mShowSummaryField )
+ if ( !$this->mShowSummaryField ) {
return;
+ }
}
$summary = $wgContLang->recodeForEdit( $summary );
$labelText = wfMsgExt( $isSubjectPreview ? 'subject' : 'summary', 'parseinline' );
@@ -1638,6 +1771,10 @@ HTML
# Then it must be protected based on static groups (regular)
$classes[] = 'mw-textarea-protected';
}
+ # Is the title cascade-protected?
+ if ( $this->mTitle->isCascadeProtected() ) {
+ $classes[] = 'mw-textarea-cprotected';
+ }
}
$attribs = array( 'tabindex' => 1 );
if ( is_array($customAttribs) )
@@ -1655,7 +1792,7 @@ HTML
}
protected function showTextbox2() {
- $this->showTextbox( $this->textbox2, 'wpTextbox2', array( 'tabindex' => 6 ) );
+ $this->showTextbox( $this->textbox2, 'wpTextbox2', array( 'tabindex' => 6, 'readonly' ) );
}
protected function showTextbox( $content, $name, $customAttribs = array() ) {
@@ -1678,6 +1815,13 @@ HTML
'style' => '' // avoid php notices when appending preferences (appending allows customAttribs['style'] to still work
);
+ global $wgBetterDirectionality;
+ if( $wgBetterDirectionality ) {
+ $pageLang = $this->mTitle->getPageLanguage();
+ $attribs['lang'] = $pageLang->getCode();
+ $attribs['dir'] = $pageLang->getDir();
+ }
+
$wgOut->addHTML( Html::textarea( $name, $wikitext, $attribs ) );
}
@@ -1736,8 +1880,7 @@ HTML
protected function showTosSummary() {
$msg = 'editpage-tos-summary';
wfRunHooks( 'EditPageTosSummary', array( $this->mTitle, &$msg ) );
- $text = wfMsg( $msg );
- if( !wfEmptyMsg( $msg, $text ) && $text !== '-' ) {
+ if( !wfMessage( $msg )->isDisabled() ) {
global $wgOut;
$wgOut->addHTML( '
' );
$wgOut->addWikiMsgArray( $msg, array() );
@@ -1765,7 +1908,8 @@ HTML
// Allow for site and per-namespace customization of contribution/copyright notice.
wfRunHooks( 'EditPageCopyrightWarning', array( $this->mTitle, &$copywarnMsg ) );
- return "
\n" . call_user_func_array("wfMsgNoTrans", $copywarnMsg) . "\n
";
+ return "
\n" .
+ call_user_func_array("wfMsgNoTrans", $copywarnMsg) . "\n
";
}
protected function showStandardInputs( &$tabindex = 2 ) {
@@ -1793,7 +1937,7 @@ HTML
$wgOut->addHTML( "
\n
\n" );
}
- /*
+ /**
* Show an edit conflict. textbox1 is already shown in showEditForm().
* If you want to use another entry point to this function, be careful.
*/
@@ -1818,20 +1962,20 @@ HTML
$data = $dbr->selectRow(
array( 'logging', 'user' ),
array( 'log_type',
- 'log_action',
- 'log_timestamp',
- 'log_user',
- 'log_namespace',
- 'log_title',
- 'log_comment',
- 'log_params',
- 'log_deleted',
- 'user_name' ),
+ 'log_action',
+ 'log_timestamp',
+ 'log_user',
+ 'log_namespace',
+ 'log_title',
+ 'log_comment',
+ 'log_params',
+ 'log_deleted',
+ 'user_name' ),
array( 'log_namespace' => $this->mTitle->getNamespace(),
- 'log_title' => $this->mTitle->getDBkey(),
- 'log_type' => 'delete',
- 'log_action' => 'delete',
- 'user_id=log_user' ),
+ 'log_title' => $this->mTitle->getDBkey(),
+ 'log_type' => 'delete',
+ 'log_action' => 'delete',
+ 'user_id=log_user' ),
__METHOD__,
array( 'LIMIT' => 1, 'ORDER BY' => 'log_timestamp DESC' )
);
@@ -1850,7 +1994,7 @@ HTML
* @return string
*/
function getPreviewText() {
- global $wgOut, $wgUser, $wgParser, $wgMessageCache;
+ global $wgOut, $wgUser, $wgParser;
wfProfileIn( __METHOD__ );
@@ -1860,6 +2004,8 @@ HTML
} else {
$note = wfMsg( 'session_fail_preview' );
}
+ } elseif ( $this->incompleteForm ) {
+ $note = wfMsg( 'edit_form_incomplete' );
} else {
$note = wfMsg( 'previewnote' );
}
@@ -1873,12 +2019,20 @@ HTML
if ( $wgRawHtml && !$this->mTokenOk ) {
// Could be an offsite preview attempt. This is very unsafe if
// HTML is enabled, as it could be an attack.
- return $wgOut->parse( "" .
- wfMsg( 'session_fail_preview_html' ) . "
" );
+ $parsedNote = '';
+ if ( $this->textbox1 !== '' ) {
+ // Do not put big scary notice, if previewing the empty
+ // string, which happens when you initially edit
+ // a category page, due to automatic preview-on-open.
+ $parsedNote = $wgOut->parse( "" .
+ wfMsg( 'session_fail_preview_html' ) . "
" );
+ }
+ wfProfileOut( __METHOD__ );
+ return $parsedNote;
}
# don't parse user css/js, show message about preview
- # XXX: stupid php bug won't let us use $wgTitle->isCssJsSubpage() here -- This note has been there since r3530. Sure the bug was fixed time ago?
+ # XXX: stupid php bug won't let us use $this->getContextTitle()->isCssJsSubpage() here -- This note has been there since r3530. Sure the bug was fixed time ago?
if ( $this->isCssJsSubpage || $this->mTitle->isCssOrJsPage() ) {
$level = 'user';
@@ -1917,13 +2071,6 @@ HTML
wfRunHooks( 'EditPageGetPreviewText', array( $this, &$toparse ) );
- // Parse mediawiki messages with correct target language
- if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
- list( /* $unused */, $lang ) = $wgMessageCache->figureMessage( $this->mTitle->getText() );
- $obj = wfGetLangObj( $lang );
- $parserOptions->setTargetLanguage( $obj );
- }
-
$parserOptions->setTidy( true );
$parserOptions->enableLimitReport();
$parserOutput = $wgParser->parse( $this->mArticle->preSaveTransform( $toparse ),
@@ -1949,14 +2096,26 @@ HTML
'" .
$wgOut->parse( $note ) . $conflict . "\n";
+ global $wgBetterDirectionality;
+ if( $wgBetterDirectionality ) {
+ $pageLang = $this->mTitle->getPageLanguage();
+ $attribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir(),
+ 'class' => 'mw-content-'.$pageLang->getDir() );
+ $previewHTML = Html::rawElement( 'div', $attribs, $previewHTML );
+ }
wfProfileOut( __METHOD__ );
return $previewhead . $previewHTML . $this->previewTextAfterContent;
}
+ /**
+ * @return Array
+ */
function getTemplates() {
if ( $this->preview || $this->section != '' ) {
$templates = array();
- if ( !isset( $this->mParserOutput ) ) return $templates;
+ if ( !isset( $this->mParserOutput ) ) {
+ return $templates;
+ }
foreach( $this->mParserOutput->getTemplates() as $ns => $template) {
foreach( array_keys( $template ) as $dbk ) {
$templates[] = Title::makeTitle($ns, $dbk);
@@ -1996,7 +2155,7 @@ HTML
* Produce the stock "please login to edit pages" page
*/
function userNotLoggedInPage() {
- global $wgUser, $wgOut, $wgTitle;
+ global $wgUser, $wgOut;
$skin = $wgUser->getSkin();
$loginTitle = SpecialPage::getTitleFor( 'Userlogin' );
@@ -2004,7 +2163,7 @@ HTML
$loginTitle,
wfMsgHtml( 'loginreqlink' ),
array(),
- array( 'returnto' => $wgTitle->getPrefixedText() ),
+ array( 'returnto' => $this->getContextTitle()->getPrefixedText() ),
array( 'known', 'noclasses' )
);
@@ -2012,8 +2171,8 @@ HTML
$wgOut->setRobotPolicy( 'noindex,nofollow' );
$wgOut->setArticleRelated( false );
- $wgOut->addHTML( wfMsgWikiHtml( 'whitelistedittext', $loginLink ) );
- $wgOut->returnToMain( false, $wgTitle );
+ $wgOut->addWikiMsgArray( 'whitelistedittext', array( $loginLink ), array( 'replaceafter' ) );
+ $wgOut->returnToMain( false, $this->getContextTitle() );
}
/**
@@ -2038,7 +2197,7 @@ HTML
* Produce the stock "your edit contains spam" page
*
* @param $match Text which triggered one or more filters
- * @deprecated Use method spamPageWithContent() instead
+ * @deprecated since 1.17 Use method spamPageWithContent() instead
*/
static function spamPage( $match = false ) {
global $wgOut, $wgTitle;
@@ -2063,7 +2222,7 @@ HTML
* @param $match Text which triggered one or more filters
*/
public function spamPageWithContent( $match = false ) {
- global $wgOut, $wgTitle;
+ global $wgOut;
$this->textbox2 = $this->textbox1;
$wgOut->setPageTitle( wfMsg( 'spamprotectiontitle' ) );
@@ -2085,13 +2244,17 @@ HTML
$wgOut->wrapWikiMsg( '