Github mirror of MediaWiki extension MassAction - our actual code is hosted with Gerrit (please see https://www.mediawiki.org/wiki/Developer_access for contributing
PHP Other
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
compat
config
db
i18n
resources
src
tests/phpunit
.gitignore
.gitreview
.phpcs.xml
CODE_OF_CONDUCT.md
Gruntfile.js
LICENSE
MassAction.alias.php
MassAction.php
README.md
composer.json
package.json

README.md


MassAction

MassAction is a MediaWiki extension that lets you easily perform Actions on a list of Targets that has been created using a number of Matchers using a SpecialPage and the MediaWiki JobQueue.

Configuration

MassAction uses a single global variable "$wgMassActionConfig" to store its configuration. A sample configuration can be found within the repository in the 'config' directory. Some example are included below for convenience.

An empty configuration can be seen below:

$wgMassActionConfig = array(
	'targets' => array(),
);

A configuration with a single Target type but no Actions or Matchers can be seen below:

$wgMassActionConfig = array(
	'targets' => array(
		'wikipage' => array(
			'class' => 'MassAction\Targets\WikiPage\WikiPageTarget',
			'lister' => 'MassAction\Targets\WikiPage\WikiPageLister',
			'actions' => array(),
			'matchers' => array(),
		),
	),
);

A configuration with a single Target type and multiple Actions and Matchers can be seen below:

$wgMassActionConfig = array(
	'targets' => array(
		'wikipage' => array(
			'class' => 'MassAction\Targets\WikiPage\WikiPageTarget',
			'lister' => 'MassAction\Targets\WikiPage\WikiPageLister',
			'actions' => array(
				'prepend' => 'MassAction\Targets\WikiPage\Actions\PrependAction',
				'append' => 'MassAction\Targets\WikiPage\Actions\AppendAction',
				'regexreplace' => 'MassAction\Targets\WikiPage\Actions\RegexReplaceAction',
				'regexrename' => 'MassAction\Targets\WikiPage\Actions\RegexRenameAction',
			),
			'matchers' => array(
				'namespace' => 'MassAction\Targets\WikiPage\Matchers\NamespaceMatcher',
				'redirect' => 'MassAction\Targets\WikiPage\Matchers\RedirectMatcher',
				'titleregex' => 'MassAction\Targets\WikiPage\Matchers\TitleRegexMatcher',
			),
		),
	),
);

Usage

Tasks can be created using Special:MassAction.

Once a Task has been created you will be able to see the Actions that will be taken and the Targets that they will be taken on before anything is saved to the database.

Depending on what Target type has been selected on the special page different options will be presented during the task creation process.

Extension

MassAction can easily be extended by implementing the abstract classes listed below:

  • Target
  • TargetData
  • Lister
  • Matcher
  • Action

Implementations of these classes can then be plugged straight into the MassAction configuration.

License

MassAction is licensed under the GNU General Public License 2.0 or any later version. You may obtain a copy of this license at http://www.gnu.org/copyleft/gpl.html.

Credits

A full list of contributors can be found in the version control history.