# Better double-check that it hasn't been deleted yet!
$this->mPage->loadPageData( 'fromdbmaster' );
if ( !$this->mPage->exists() ) {
+ $deleteLogPage = new LogPage( 'delete' );
$outputPage = $this->getContext()->getOutput();
$outputPage->setPageTitle( wfMessage( 'cannotdelete-title', $title->getPrefixedText() ) );
$outputPage->wrapWikiMsg( "<div class=\"error mw-error-cannotdelete\">\n$1\n</div>",
array( 'cannotdelete', wfEscapeWikiText( $title->getPrefixedText() ) )
);
- $outputPage->addHTML( Xml::element( 'h2', null, LogPage::logName( 'delete' ) ) );
+ $outputPage->addHTML(
+ Xml::element( 'h2', null, $deleteLogPage->getName()->text() )
+ );
LogEventsList::showLogExtract(
$outputPage,
'delete',
}
$outputPage->addHTML( $form );
- $outputPage->addHTML( Xml::element( 'h2', null, LogPage::logName( 'delete' ) ) );
+
+ $deleteLogPage = new LogPage( 'delete' );
+ $outputPage->addHTML( Xml::element( 'h2', null, $deleteLogPage->getName()->text() ) );
LogEventsList::showLogExtract( $outputPage, 'delete',
$this->getTitle()
);
$outputPage->setPageTitle( wfMessage( 'cannotdelete-title', $this->getTitle()->getPrefixedText() ) );
if ( $error == '' ) {
$errors = $status->getErrorsArray();
+ $deleteLogPage = new LogPage( 'delete' );
$outputPage->wrapWikiMsg( "<div class=\"error mw-error-cannotdelete\">\n$1\n</div>",
$errors[0]
);
- $outputPage->addHTML( Xml::element( 'h2', null, LogPage::logName( 'delete' ) ) );
+ $outputPage->addHTML( Xml::element( 'h2', null, $deleteLogPage->getName()->text() ) );
LogEventsList::showLogExtract(
$outputPage,
$r .= ' '.$rcObj->timestamp.' </td><td>';
# Article or log link
if( $logType ) {
- $logtitle = SpecialPage::getTitleFor( 'Log', $logType );
- $logname = LogPage::logName( $logType );
- $r .= $this->msg( 'parentheses' )->rawParams( Linker::linkKnown( $logtitle, htmlspecialchars( $logname ) ) )->escaped();
+ $logPage = new LogPage( $logType );
+ $logTitle = SpecialPage::getTitleFor( 'Log', $logType );
+ $logName = $logPage->getName()->escaped();
+ $r .= $this->msg( 'parentheses' )->rawParams( Linker::linkKnown( $logTitle, $logName ) )->escaped();
} else {
$this->insertArticleLink( $r, $rcObj, $rcObj->unpatrolled, $rcObj->watched );
}
*/
private function showLogEntries() {
global $wgOut;
- $wgOut->addHTML( '<h2>' . htmlspecialchars( LogPage::logName( 'delete' ) ) . "</h2>\n" );
+ $deleteLogPage = new LogPage( 'delete' );
+ $wgOut->addHTML( '<h2>' . $deleteLogPage->getName()->escaped() . "</h2>\n" );
LogEventsList::showLogExtract( $wgOut, 'delete', $this->title );
}
$this->disabledAttrib = $this->disabled
? array( 'disabled' => 'disabled' )
: array();
-
+
$this->loadData();
}
-
+
/**
* Loads the current state of protection into the object.
*/
function loadData() {
global $wgRequest, $wgUser;
global $wgRestrictionLevels;
-
+
$this->mCascade = $this->mTitle->areRestrictionsCascading();
$this->mReason = $wgRequest->getText( 'mwProtect-reason' );
foreach( $this->mApplicableTypes as $action ) {
// @todo FIXME: This form currently requires individual selections,
// but the db allows multiples separated by commas.
-
+
// Pull the actual restriction from the DB
$this->mRestrictions[$action] = implode( '', $this->mTitle->getRestrictions( $action ) );
* Get the expiry time for a given action, by combining the relevant inputs.
*
* @param $action string
- *
+ *
* @return string 14-char timestamp or "infinity", or false if the input was invalid
*/
function getExpiry( $action ) {
return wfMsg( 'protect-fallback', $permission );
}
}
-
+
function buildCleanupScript() {
global $wgRestrictionLevels, $wgGroupPermissions, $wgOut;
$cascadeableLevels = array();
foreach( $wgRestrictionLevels as $key ) {
if ( ( isset( $wgGroupPermissions[$key]['protect'] ) && $wgGroupPermissions[$key]['protect'] )
- || $key == 'protect'
+ || $key == 'protect'
) {
$cascadeableLevels[] = $key;
}
*/
function showLogExtract( &$out ) {
# Show relevant lines from the protection log:
- $out->addHTML( Xml::element( 'h2', null, LogPage::logName( 'protect' ) ) );
+ $protectLogPage = new LogPage( 'protect' );
+ $out->addHTML( Xml::element( 'h2', null, $protectLogPage->getName()->text() ) );
LogEventsList::showLogExtract( $out, 'protect', $this->mTitle );
# Let extensions add other relevant log extracts
wfRunHooks( 'ProtectionForm::showLogExtract', array($this->mArticle,$out) );
# Use the language name for log titles, rather than Log/X
if( $name == 'Log' ) {
- $titleLink = Linker::link( $title, LogPage::logName( $par ) );
- $titleLink = wfMessage( 'parentheses' )->inLanguage( $lang )
- ->rawParams( $titleLink )->escaped();
+ $logPage = new LogPage( $par );
+ $titleLink = Linker::link( $title, $logPage->getName()->escaped() );
+ $titleLink = wfMessage( 'parentheses' )
+ ->inLanguage( $lang )
+ ->rawParams( $titleLink )
+ ->escaped();
} else {
$titleLink = Linker::link( $title );
}
$out->addWikiMsg( 'mergehistory-empty' );
}
- # Show relevant lines from the deletion log:
- $out->addHTML( '<h2>' . htmlspecialchars( LogPage::logName( 'merge' ) ) . "</h2>\n" );
+ # Show relevant lines from the merge log:
+ $mergeLogPage = new LogPage( 'merge' );
+ $out->addHTML( '<h2>' . $mergeLogPage->getName()->escaped() . "</h2>\n" );
LogEventsList::showLogExtract( $out, 'merge', $this->mTargetObj );
# When we submit, go by page ID to avoid some nasty but unlikely collisions.
}
function showLogFragment( $title ) {
+ $moveLogPage = new LogPage( 'move' );
$out = $this->getOutput();
- $out->addHTML( Xml::element( 'h2', null, LogPage::logName( 'move' ) ) );
+ $out->addHTML( Xml::element( 'h2', null, $moveLogPage->getName()->text() ) );
LogEventsList::showLogExtract( $out, 'move', $title );
}
$qc = $this->getLogQueryCond();
# Show relevant lines from the deletion log
- $output->addHTML( "<h2>" . htmlspecialchars( LogPage::logName( 'delete' ) ) . "</h2>\n" );
+ $deleteLogPage = new LogPage( 'delete' );
+ $output->addHTML( "<h2>" . $deleteLogPage->getName()->escaped() . "</h2>\n" );
LogEventsList::showLogExtract( $output, 'delete',
$this->targetObj, '', array( 'lim' => 25, 'conds' => $qc ) );
# Show relevant lines from the suppression log
if( $user->isAllowed( 'suppressionlog' ) ) {
- $output->addHTML( "<h2>" . htmlspecialchars( LogPage::logName( 'suppress' ) ) . "</h2>\n" );
+ $suppressLogPage = new LogPage( 'suppress' );
+ $output->addHTML( "<h2>" . $suppressLogPage->getName()->escaped() . "</h2>\n" );
LogEventsList::showLogExtract( $output, 'suppress',
$this->targetObj, '', array( 'lim' => 25, 'conds' => $qc ) );
}
}
# Show relevant lines from the deletion log:
- $out->addHTML( Xml::element( 'h2', null, LogPage::logName( 'delete' ) ) . "\n" );
+ $deleteLogPage = new LogPage( 'delete' );
+ $out->addHTML( Xml::element( 'h2', null, $deleteLogPage->getName()->text() ) . "\n" );
LogEventsList::showLogExtract( $out, 'delete', $this->mTargetObj );
# Show relevant lines from the suppression log:
+ $suppressLogPage = new LogPage( 'suppress' );
if( $this->getUser()->isAllowed( 'suppressionlog' ) ) {
- $out->addHTML( Xml::element( 'h2', null, LogPage::logName( 'suppress' ) ) . "\n" );
+ $out->addHTML( Xml::element( 'h2', null, $suppressLogPage->getName()->text() ) . "\n" );
LogEventsList::showLogExtract( $out, 'suppress', $this->mTargetObj );
}
* @param $output OutputPage to use
*/
protected function showLogFragment( $user, $output ) {
- $output->addHTML( Xml::element( 'h2', null, LogPage::logName( 'rights' ) . "\n" ) );
+ $rightsLogPage = new LogPage( 'rights' );
+ $output->addHTML( Xml::element( 'h2', null, $rightsLogPage->getName()->text() ) );
LogEventsList::showLogExtract( $output, 'rights', $user->getUserPage() );
}
}