"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "includes/specials/SpecialRecentchanges.php" between
mediawiki-1.31.1.tar.gz and mediawiki-1.32.0.tar.gz

About: MediaWiki is a wiki engine (the collaborative editing software that runs for e.g. Wikipedia, the free encyclopedia).

SpecialRecentchanges.php  (mediawiki-1.31.1):SpecialRecentchanges.php  (mediawiki-1.32.0)
skipping to change at line 38 skipping to change at line 38
/** /**
* A special page that lists last changes made to the wiki * A special page that lists last changes made to the wiki
* *
* @ingroup SpecialPage * @ingroup SpecialPage
*/ */
class SpecialRecentChanges extends ChangesListSpecialPage { class SpecialRecentChanges extends ChangesListSpecialPage {
protected static $savedQueriesPreferenceName = 'rcfilters-saved-queries'; protected static $savedQueriesPreferenceName = 'rcfilters-saved-queries';
protected static $daysPreferenceName = 'rcdays'; // Use general RecentCha nges preference protected static $daysPreferenceName = 'rcdays'; // Use general RecentCha nges preference
protected static $limitPreferenceName = 'rcfilters-limit'; // Use RCFilte rs-specific preference protected static $limitPreferenceName = 'rcfilters-limit'; // Use RCFilte rs-specific preference
protected static $collapsedPreferenceName = 'rcfilters-rc-collapsed';
private $watchlistFilterGroupDefinition; private $watchlistFilterGroupDefinition;
public function __construct( $name = 'Recentchanges', $restriction = '' ) { public function __construct( $name = 'Recentchanges', $restriction = '' ) {
parent::__construct( $name, $restriction ); parent::__construct( $name, $restriction );
$this->watchlistFilterGroupDefinition = [ $this->watchlistFilterGroupDefinition = [
'name' => 'watchlist', 'name' => 'watchlist',
'title' => 'rcfilters-filtergroup-watchlist', 'title' => 'rcfilters-filtergroup-watchlist',
'class' => ChangesListStringOptionsFilterGroup::class, 'class' => ChangesListStringOptionsFilterGroup::class,
skipping to change at line 228 skipping to change at line 229
$changeType = $this->getFilterGroup( 'changeType' ); $changeType = $this->getFilterGroup( 'changeType' );
$hideCategorization = $changeType->getFilter( 'hidecategorization ' ); $hideCategorization = $changeType->getFilter( 'hidecategorization ' );
if ( $hideCategorization !== null ) { if ( $hideCategorization !== null ) {
// Conditional on feature being available // Conditional on feature being available
$hideCategorization->setDefault( $user->getBoolOption( 'h idecategorization' ) ); $hideCategorization->setDefault( $user->getBoolOption( 'h idecategorization' ) );
} }
} }
/** /**
* Get all custom filters
*
* @return array Map of filter URL param names to properties (msg/default
)
*/
protected function getCustomFilters() {
if ( $this->customFilters === null ) {
$this->customFilters = parent::getCustomFilters();
Hooks::run( 'SpecialRecentChangesFilters', [ $this, &$thi
s->customFilters ], '1.23' );
}
return $this->customFilters;
}
/**
* Process $par and put options found in $opts. Used when including the p age. * Process $par and put options found in $opts. Used when including the p age.
* *
* @param string $par * @param string $par
* @param FormOptions $opts * @param FormOptions $opts
*/ */
public function parseParameters( $par, FormOptions $opts ) { public function parseParameters( $par, FormOptions $opts ) {
parent::parseParameters( $par, $opts ); parent::parseParameters( $par, $opts );
$bits = preg_split( '/\s*,\s*/', trim( $par ) ); $bits = preg_split( '/\s*,\s*/', trim( $par ) );
foreach ( $bits as $bit ) { foreach ( $bits as $bit ) {
skipping to change at line 355 skipping to change at line 342
// knowledge to use an index merge if it wants (it may us e some other index though). // knowledge to use an index merge if it wants (it may us e some other index though).
$conds + [ 'rc_new' => [ 0, 1 ] ], $conds + [ 'rc_new' => [ 0, 1 ] ],
__METHOD__, __METHOD__,
$query_options, $query_options,
$join_conds $join_conds
); );
return $rows; return $rows;
} }
protected function runMainQueryHook( &$tables, &$fields, &$conds,
&$query_options, &$join_conds, $opts
) {
return parent::runMainQueryHook( $tables, $fields, $conds, $query
_options, $join_conds, $opts )
&& Hooks::run(
'SpecialRecentChangesQuery',
[ &$conds, &$tables, &$join_conds, $opts, &$query
_options, &$fields ],
'1.23'
);
}
protected function getDB() { protected function getDB() {
return wfGetDB( DB_REPLICA, 'recentchanges' ); return wfGetDB( DB_REPLICA, 'recentchanges' );
} }
public function outputFeedLinks() { public function outputFeedLinks() {
$this->addFeedLinks( $this->getFeedQuery() ); $this->addFeedLinks( $this->getFeedQuery() );
} }
/** /**
* Get URL query parameters for action=feedrecentchanges API feed of curr ent recent changes view. * Get URL query parameters for action=feedrecentchanges API feed of curr ent recent changes view.
skipping to change at line 580 skipping to change at line 556
$this->setBottomText( $opts ); $this->setBottomText( $opts );
} }
/** /**
* Send the text to be displayed above the options * Send the text to be displayed above the options
* *
* @param FormOptions $opts Unused * @param FormOptions $opts Unused
*/ */
function setTopText( FormOptions $opts ) { function setTopText( FormOptions $opts ) {
global $wgContLang;
$message = $this->msg( 'recentchangestext' )->inContentLanguage() ; $message = $this->msg( 'recentchangestext' )->inContentLanguage() ;
if ( !$message->isDisabled() ) { if ( !$message->isDisabled() ) {
$contLang = MediaWikiServices::getInstance()->getContentL anguage();
// Parse the message in this weird ugly way to preserve t he ability to include interlanguage // Parse the message in this weird ugly way to preserve t he ability to include interlanguage
// links in it (T172461). In the future when T66969 is re solved, perhaps we can just use // links in it (T172461). In the future when T66969 is re solved, perhaps we can just use
// $message->parse() instead. This code is copied from Me ssage::parseText(). // $message->parse() instead. This code is copied from Me ssage::parseText().
$parserOutput = MessageCache::singleton()->parse( $parserOutput = MessageCache::singleton()->parse(
$message->plain(), $message->plain(),
$this->getPageTitle(), $this->getPageTitle(),
/*linestart*/true, /*linestart*/true,
// Message class sets the interface flag to false when parsing in a language different than // Message class sets the interface flag to false when parsing in a language different than
// user language, and this is wiki content langua ge // user language, and this is wiki content langua ge
/*interface*/false, /*interface*/false,
$wgContLang $contLang
); );
$content = $parserOutput->getText( [ $content = $parserOutput->getText( [
'enableSectionEditLinks' => false, 'enableSectionEditLinks' => false,
] ); ] );
// Add only metadata here (including the language links), text is added below // Add only metadata here (including the language links), text is added below
$this->getOutput()->addParserOutputMetadata( $parserOutpu t ); $this->getOutput()->addParserOutputMetadata( $parserOutpu t );
$langAttributes = [ $langAttributes = [
'lang' => $wgContLang->getHtmlCode(), 'lang' => $contLang->getHtmlCode(),
'dir' => $wgContLang->getDir(), 'dir' => $contLang->getDir(),
]; ];
$topLinksAttributes = [ 'class' => 'mw-recentchanges-topl inks' ]; $topLinksAttributes = [ 'class' => 'mw-recentchanges-topl inks' ];
if ( $this->isStructuredFilterUiEnabled() ) { if ( $this->isStructuredFilterUiEnabled() ) {
// Check whether the widget is already collapsed or expanded // Check whether the widget is already collapsed or expanded
$collapsedState = $this->getRequest()->getCookie( 'rcfilters-toplinks-collapsed-state' ); $collapsedState = $this->getRequest()->getCookie( 'rcfilters-toplinks-collapsed-state' );
// Note that an empty/unset cookie means collapse d, so check for !== 'expanded' // Note that an empty/unset cookie means collapse d, so check for !== 'expanded'
$topLinksAttributes[ 'class' ] .= $collapsedState !== 'expanded' ? $topLinksAttributes[ 'class' ] .= $collapsedState !== 'expanded' ?
' mw-recentchanges-toplinks-collapsed' : ''; ' mw-recentchanges-toplinks-collapsed' : '';
 End of changes. 7 change blocks. 
34 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)