2012-04-27 15:14:24 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* MediaWiki Extension: Echo
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
|
|
* in the Software without restriction, including without limitation the rights
|
|
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* This program is distributed WITHOUT ANY WARRANTY.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @ingroup Extensions
|
|
|
|
* @author Andrew Garrett
|
|
|
|
*/
|
|
|
|
|
|
|
|
# Alert the user that this is not a valid entry point to MediaWiki if they try to access the special pages file directly.
|
|
|
|
if ( !defined( 'MEDIAWIKI' ) ) {
|
|
|
|
echo <<<EOT
|
|
|
|
To install this extension, put the following line in LocalSettings.php:
|
|
|
|
require_once( "$IP/extensions/Echo/Echo.php" );
|
|
|
|
EOT;
|
|
|
|
exit( 1 );
|
|
|
|
}
|
|
|
|
|
|
|
|
// Extension credits that will show up on Special:Version
|
|
|
|
$wgExtensionCredits['specialpage'][] = array(
|
|
|
|
'path' => __FILE__,
|
|
|
|
'name' => 'Echo',
|
2012-12-14 16:49:06 +00:00
|
|
|
'url' => 'https://www.mediawiki.org/wiki/Extension:Echo',
|
|
|
|
'author' => array( 'Andrew Garrett', 'Ryan Kaldari', 'Benny Situ', 'Luke Welling' ),
|
2012-04-27 15:14:24 +00:00
|
|
|
'descriptionmsg' => 'echo-desc',
|
|
|
|
);
|
|
|
|
|
|
|
|
$dir = dirname( __FILE__ ) . '/';
|
|
|
|
$wgExtensionMessagesFiles['Echo'] = $dir . 'Echo.i18n.php';
|
2012-10-23 22:37:22 +00:00
|
|
|
$wgExtensionMessagesFiles['EchoAliases'] = $dir . 'Echo.alias.php';
|
2012-04-27 15:14:24 +00:00
|
|
|
|
2012-12-14 16:34:12 +00:00
|
|
|
$wgAutoloadClasses['EchoHooks'] = $dir . 'Hooks.php';
|
|
|
|
$wgAutoloadClasses['EchoEvent'] = $dir . 'model/Event.php';
|
|
|
|
$wgAutoloadClasses['EchoNotification'] = $dir . 'model/Notification.php';
|
|
|
|
$wgAutoloadClasses['MWEchoEmailBatch'] = $dir . 'includes/EmailBatch.php';
|
2013-01-15 23:21:39 +00:00
|
|
|
$wgAutoloadClasses['MWDbEchoEmailBatch'] = $dir . 'includes/DbEmailBatch.php';
|
2013-03-06 00:04:48 +00:00
|
|
|
$wgAutoloadClasses['MWEchoEmailBundler'] = $dir . 'includes/EmailBundler.php';
|
|
|
|
$wgAutoloadClasses['MWDbEchoEmailBundler'] = $dir . 'includes/DbEmailBundler.php';
|
2013-05-07 23:27:46 +00:00
|
|
|
$wgAutoloadClasses['MWEchoEventLogging'] = $dir . 'includes/EventLogging.php';
|
2012-04-27 15:14:24 +00:00
|
|
|
|
|
|
|
// Formatters
|
2012-12-14 16:34:12 +00:00
|
|
|
$wgAutoloadClasses['EchoNotificationFormatter'] = $dir . 'formatters/NotificationFormatter.php';
|
|
|
|
$wgAutoloadClasses['EchoBasicFormatter'] = $dir . 'formatters/BasicFormatter.php';
|
|
|
|
$wgAutoloadClasses['EchoEditFormatter'] = $dir . 'formatters/EditFormatter.php';
|
|
|
|
$wgAutoloadClasses['EchoCommentFormatter'] = $dir . 'formatters/CommentFormatter.php';
|
2013-03-13 00:49:19 +00:00
|
|
|
$wgAutoloadClasses['EchoUserRightsFormatter'] = $dir . 'formatters/UserRightsFormatter.php';
|
2013-01-15 23:21:39 +00:00
|
|
|
$wgAutoloadClasses['EchoPageLinkFormatter'] = $dir . 'formatters/PageLinkFormatter.php';
|
2013-07-24 03:50:43 +00:00
|
|
|
$wgAutoloadClasses['EchoEditUserTalkFormatter'] = $dir . 'formatters/EditUserTalkFormatter.php';
|
2012-04-27 15:14:24 +00:00
|
|
|
|
2013-06-24 00:22:08 +00:00
|
|
|
// Email formatters
|
|
|
|
$wgAutoloadClasses['EchoEmailFormatter'] = $dir . 'includes/EmailFormatter.php';
|
|
|
|
$wgAutoloadClasses['EchoTextEmailFormatter'] = $dir . 'includes/EmailFormatter.php';
|
|
|
|
$wgAutoloadClasses['EchoHTMLEmailFormatter'] = $dir . 'includes/EmailFormatter.php';
|
|
|
|
$wgAutoloadClasses['EchoEmailMode'] = $dir . 'includes/EmailFormatter.php';
|
|
|
|
$wgAutoloadClasses['EchoEmailSingle'] = $dir . 'includes/EmailFormatter.php';
|
|
|
|
$wgAutoloadClasses['EchoEmailDigest'] = $dir . 'includes/EmailFormatter.php';
|
2013-07-09 00:41:08 +00:00
|
|
|
$wgAutoloadClasses['EchoEmailDecorator'] = $dir . 'includes/EmailFormatter.php';
|
|
|
|
$wgAutoloadClasses['EchoTextEmailDecorator'] = $dir . 'includes/EmailFormatter.php';
|
|
|
|
$wgAutoloadClasses['EchoHTMLEmailDecorator'] = $dir . 'includes/EmailFormatter.php';
|
2013-06-24 00:22:08 +00:00
|
|
|
|
2012-04-27 15:14:24 +00:00
|
|
|
// Internal stuff
|
2012-12-14 16:34:12 +00:00
|
|
|
$wgAutoloadClasses['EchoNotifier'] = $dir . 'Notifier.php';
|
|
|
|
$wgAutoloadClasses['EchoNotificationController'] = $dir . 'controller/NotificationController.php';
|
|
|
|
$wgAutoloadClasses['EchoDiscussionParser'] = $dir . 'includes/DiscussionParser.php';
|
2013-05-19 04:15:45 +00:00
|
|
|
$wgAutoloadClasses['EchoDiffParser'] = $dir . 'includes/DiffParser.php';
|
2012-04-27 15:14:24 +00:00
|
|
|
|
2012-06-06 07:04:28 +00:00
|
|
|
// Job queue
|
2012-12-14 16:34:12 +00:00
|
|
|
$wgAutoloadClasses['EchoNotificationJob'] = $dir . 'jobs/NotificationJob.php';
|
2012-06-06 07:04:28 +00:00
|
|
|
$wgJobClasses['EchoNotificationJob'] = 'EchoNotificationJob';
|
2013-03-06 00:04:48 +00:00
|
|
|
$wgAutoloadClasses['MWEchoNotificationEmailBundleJob'] = $dir . 'jobs/NotificationEmailBundleJob.php';
|
|
|
|
$wgJobClasses['MWEchoNotificationEmailBundleJob'] = 'MWEchoNotificationEmailBundleJob';
|
2012-06-06 07:04:28 +00:00
|
|
|
|
2012-04-27 15:14:24 +00:00
|
|
|
// API
|
2013-05-09 18:50:05 +00:00
|
|
|
$wgAutoloadClasses['ApiEchoNotifications'] = $dir . 'api/ApiEchoNotifications.php';
|
2012-04-27 15:14:24 +00:00
|
|
|
$wgAPIMetaModules['notifications'] = 'ApiEchoNotifications';
|
|
|
|
|
|
|
|
// Special page
|
2012-12-14 16:34:12 +00:00
|
|
|
$wgAutoloadClasses['SpecialNotifications'] = $dir . 'special/SpecialNotifications.php';
|
2012-04-27 15:14:24 +00:00
|
|
|
$wgSpecialPages['Notifications'] = 'SpecialNotifications';
|
2013-01-30 09:31:34 +00:00
|
|
|
$wgSpecialPageGroups['Notifications'] = 'users';
|
2012-04-27 15:14:24 +00:00
|
|
|
|
2013-01-15 23:21:39 +00:00
|
|
|
// Backend support
|
|
|
|
$wgAutoloadClasses['MWEchoBackend'] = $dir . 'includes/EchoBackend.php';
|
|
|
|
$wgAutoloadClasses['MWDbEchoBackend'] = $dir . 'includes/DbEchoBackend.php';
|
2013-04-09 22:13:39 +00:00
|
|
|
$wgAutoloadClasses['MWEchoDbFactory'] = $dir . 'includes/EchoDbFactory.php';
|
2013-05-24 22:51:47 +00:00
|
|
|
$wgAutoloadClasses['MWEchoNotifUser'] = $dir . 'includes/NotifUser.php';
|
2013-01-15 23:21:39 +00:00
|
|
|
|
2013-05-06 22:34:50 +00:00
|
|
|
// Whitelist and Blacklist
|
|
|
|
$wgAutoloadClasses['EchoContainmentList'] = $dir . 'includes/ContainmentSet.php';
|
|
|
|
$wgAutoloadClasses['EchoContainmentSet'] = $dir . 'includes/ContainmentSet.php';
|
|
|
|
$wgAutoloadClasses['EchoArrayList'] = $dir . 'includes/ContainmentSet.php';
|
|
|
|
$wgAutoloadClasses['EchoOnWikiList'] = $dir . 'includes/ContainmentSet.php';
|
|
|
|
$wgAutoloadClasses['EchoCachedList'] = $dir . 'includes/ContainmentSet.php';
|
|
|
|
|
2013-05-09 18:50:05 +00:00
|
|
|
// Maintenance testing
|
|
|
|
$wgAutoloadClasses['EchoBatchRowUpdate'] = $dir . 'includes/BatchRowUpdate.php';
|
|
|
|
$wgAutoloadClasses['EchoBatchRowWriter'] = $dir . 'includes/BatchRowUpdate.php';
|
|
|
|
$wgAutoloadClasses['EchoBatchRowIterator'] = $dir . 'includes/BatchRowUpdate.php';
|
|
|
|
$wgAutoloadClasses['EchoRowUpdateGenerator'] = $dir . 'includes/BatchRowUpdate.php';
|
|
|
|
$wgAutoloadClasses['EchoSuppressionRowUpdateGenerator'] = $dir . 'includes/schemaUpdate.php';
|
|
|
|
|
2012-04-27 15:14:24 +00:00
|
|
|
// Housekeeping hooks
|
|
|
|
$wgHooks['LoadExtensionSchemaUpdates'][] = 'EchoHooks::getSchemaUpdates';
|
|
|
|
$wgHooks['GetPreferences'][] = 'EchoHooks::getPreferences';
|
2012-06-01 10:57:09 +00:00
|
|
|
$wgHooks['PersonalUrls'][] = 'EchoHooks::onPersonalUrls';
|
|
|
|
$wgHooks['BeforePageDisplay'][] = 'EchoHooks::beforePageDisplay';
|
2012-07-31 21:18:16 +00:00
|
|
|
$wgHooks['MakeGlobalVariablesScript'][] = 'EchoHooks::makeGlobalVariablesScript';
|
2012-07-31 00:29:49 +00:00
|
|
|
$wgHooks['UnitTestsList'][] = 'EchoHooks::getUnitTests';
|
2013-03-01 00:26:59 +00:00
|
|
|
$wgHooks['ResourceLoaderRegisterModules'][] = 'EchoHooks::onResourceLoaderRegisterModules';
|
2013-03-13 00:49:19 +00:00
|
|
|
$wgHooks['UserRights'][] = 'EchoHooks::onUserRights';
|
2013-04-30 02:53:33 +00:00
|
|
|
$wgHooks['UserLoadOptions'][] = 'EchoHooks::onUserLoadOptions';
|
|
|
|
$wgHooks['UserSaveOptions'][] = 'EchoHooks::onUserSaveOptions';
|
2013-05-24 22:51:47 +00:00
|
|
|
$wgHooks['UserClearNewTalkNotification'][] = 'EchoHooks::onUserClearNewTalkNotification';
|
2012-06-01 10:57:09 +00:00
|
|
|
|
2013-01-15 23:21:39 +00:00
|
|
|
// Extension initialization
|
|
|
|
$wgExtensionFunctions[] = 'EchoHooks::initEchoExtension';
|
|
|
|
|
2012-06-01 10:57:09 +00:00
|
|
|
$echoResourceTemplate = array(
|
2012-12-14 16:34:12 +00:00
|
|
|
'localBasePath' => $dir . 'modules',
|
2012-06-01 10:57:09 +00:00
|
|
|
'remoteExtPath' => 'Echo/modules',
|
|
|
|
'group' => 'ext.echo',
|
|
|
|
);
|
2012-04-27 15:14:24 +00:00
|
|
|
|
|
|
|
$wgResourceModules += array(
|
2012-06-01 10:57:09 +00:00
|
|
|
'ext.echo.base' => $echoResourceTemplate + array(
|
|
|
|
'styles' => 'base/ext.echo.base.css',
|
2012-07-31 21:18:16 +00:00
|
|
|
'scripts' => 'base/ext.echo.base.js',
|
2013-01-14 23:52:46 +00:00
|
|
|
'dependencies' => array(
|
|
|
|
'jquery.ui.button',
|
2013-05-16 18:37:49 +00:00
|
|
|
'mediawiki.api',
|
2013-01-14 23:52:46 +00:00
|
|
|
),
|
|
|
|
'messages' => array(
|
|
|
|
'cancel',
|
|
|
|
'echo-dismiss-button',
|
|
|
|
'echo-error-preference',
|
|
|
|
'echo-error-token',
|
|
|
|
),
|
2012-06-01 10:57:09 +00:00
|
|
|
),
|
|
|
|
'ext.echo.overlay' => $echoResourceTemplate + array(
|
2012-07-31 21:18:16 +00:00
|
|
|
'scripts' => array(
|
|
|
|
'overlay/ext.echo.overlay.js',
|
|
|
|
),
|
2012-06-01 10:57:09 +00:00
|
|
|
'styles' => 'overlay/ext.echo.overlay.css',
|
2013-06-02 20:04:29 +00:00
|
|
|
'skinStyles' => array(
|
|
|
|
'modern' => 'overlay/ext.echo.overlay.modern.css',
|
|
|
|
'monobook' => 'overlay/ext.echo.overlay.monobook.css',
|
|
|
|
),
|
2012-07-31 21:18:16 +00:00
|
|
|
'dependencies' => array(
|
|
|
|
'ext.echo.base',
|
|
|
|
'mediawiki.jqueryMsg',
|
2013-04-17 01:00:21 +00:00
|
|
|
'mediawiki.ui',
|
2013-05-15 23:10:49 +00:00
|
|
|
'mediawiki.util',
|
2012-07-31 21:18:16 +00:00
|
|
|
),
|
2012-06-08 05:55:01 +00:00
|
|
|
'messages' => array(
|
|
|
|
'echo-overlay-title',
|
2012-12-17 21:58:18 +00:00
|
|
|
'echo-overlay-title-overflow',
|
2012-06-08 05:55:01 +00:00
|
|
|
'echo-overlay-link',
|
|
|
|
'echo-none',
|
2013-04-17 01:00:21 +00:00
|
|
|
'echo-mark-all-as-read',
|
2013-04-26 23:58:03 +00:00
|
|
|
'echo-more-info',
|
2013-05-09 23:11:22 +00:00
|
|
|
'echo-feedback',
|
2012-06-08 05:55:01 +00:00
|
|
|
),
|
2012-06-01 10:57:09 +00:00
|
|
|
),
|
|
|
|
'ext.echo.special' => $echoResourceTemplate + array(
|
2012-12-07 01:08:33 +00:00
|
|
|
'scripts' => array(
|
|
|
|
'special/ext.echo.special.js',
|
|
|
|
),
|
|
|
|
'styles' => 'special/ext.echo.special.css',
|
2012-07-31 00:29:49 +00:00
|
|
|
'dependencies' => array(
|
|
|
|
'ext.echo.base',
|
2012-12-07 01:08:33 +00:00
|
|
|
'mediawiki.jqueryMsg',
|
2012-07-31 00:29:49 +00:00
|
|
|
),
|
2012-12-07 01:08:33 +00:00
|
|
|
'messages' => array(
|
|
|
|
'echo-load-more-error',
|
2013-01-04 21:56:30 +00:00
|
|
|
'echo-more-info',
|
2013-04-12 18:52:34 +00:00
|
|
|
'echo-feedback',
|
2012-12-07 01:08:33 +00:00
|
|
|
),
|
2013-06-12 21:10:56 +00:00
|
|
|
'position' => 'top',
|
2012-07-31 00:29:49 +00:00
|
|
|
),
|
2013-05-14 07:05:09 +00:00
|
|
|
'ext.echo.alert' => $echoResourceTemplate + array(
|
|
|
|
'scripts' => array(
|
|
|
|
'alert/ext.echo.alert.js',
|
|
|
|
),
|
|
|
|
'styles' => 'alert/ext.echo.alert.css',
|
2013-06-02 20:04:29 +00:00
|
|
|
'skinStyles' => array(
|
|
|
|
'modern' => 'alert/ext.echo.alert.modern.css',
|
|
|
|
),
|
2013-05-14 07:05:09 +00:00
|
|
|
'messages' => array(
|
|
|
|
'echo-new-messages',
|
|
|
|
'colon-separator',
|
|
|
|
),
|
|
|
|
),
|
2013-05-15 23:10:49 +00:00
|
|
|
'ext.echo.badge' => $echoResourceTemplate + array(
|
|
|
|
'styles' => 'badge/ext.echo.badge.css',
|
|
|
|
'skinStyles' => array(
|
|
|
|
'modern' => 'badge/ext.echo.badge.modern.css',
|
2013-06-02 20:04:29 +00:00
|
|
|
'monobook' => 'badge/ext.echo.badge.monobook.css',
|
2013-05-15 23:10:49 +00:00
|
|
|
),
|
|
|
|
),
|
2012-04-27 15:14:24 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This Echo hook can be used to define users who are by default interested in
|
|
|
|
* certain events.
|
|
|
|
* For example, it can be used to say that users are by default interested in
|
|
|
|
* their own user talk page being edited. In fact, that is what it is used for
|
|
|
|
* internally.
|
|
|
|
*/
|
2012-10-22 20:40:58 +00:00
|
|
|
$wgHooks['EchoGetDefaultNotifiedUsers'][] = 'EchoHooks::getDefaultNotifiedUsers';
|
|
|
|
$wgHooks['EchoGetNotificationTypes'][] = 'EchoHooks::getNotificationTypes';
|
2013-01-15 23:21:39 +00:00
|
|
|
$wgHooks['EchoGetBundleRules'][] = 'EchoHooks::onEchoGetBundleRules';
|
2013-05-01 19:27:32 +00:00
|
|
|
$wgHooks['EchoAbortEmailNotification'][] = 'EchoHooks::onEchoAbortEmailNotification';
|
2013-05-24 22:51:47 +00:00
|
|
|
$wgHooks['EchoCreateNotificationComplete'][] = 'EchoHooks::onEchoCreateNotificationComplete';
|
2012-04-27 15:14:24 +00:00
|
|
|
|
|
|
|
// Hook appropriate events
|
|
|
|
$wgHooks['ArticleSaveComplete'][] = 'EchoHooks::onArticleSaved';
|
2012-08-31 23:35:16 +00:00
|
|
|
$wgHooks['AddNewAccount'][] = 'EchoHooks::onAccountCreated';
|
2012-07-18 19:39:33 +00:00
|
|
|
$wgHooks['ArticleRollbackComplete'][] = 'EchoHooks::onRollbackComplete';
|
2013-04-12 22:12:22 +00:00
|
|
|
$wgHooks['UserSaveSettings'][] = 'EchoHooks::onUserSaveSettings';
|
2012-04-27 15:14:24 +00:00
|
|
|
|
2012-12-19 22:35:45 +00:00
|
|
|
// Disable ordinary user talk page email notifications
|
2013-06-08 01:05:35 +00:00
|
|
|
$wgHooks['AbortTalkPageEmailNotification'][] = 'EchoHooks::onAbortTalkPageEmailNotification';
|
2012-07-31 20:44:43 +00:00
|
|
|
// Disable the yellow bar of death
|
2013-05-05 00:49:08 +00:00
|
|
|
$wgHooks['GetNewMessagesAlert'][] = 'EchoHooks::abortNewMessagesAlert';
|
2012-12-26 22:05:29 +00:00
|
|
|
$wgHooks['LinksUpdateAfterInsert'][] = 'EchoHooks::onLinksUpdateAfterInsert';
|
2012-07-17 22:19:32 +00:00
|
|
|
|
2012-04-27 15:14:24 +00:00
|
|
|
// Configuration
|
|
|
|
|
2013-01-15 23:21:39 +00:00
|
|
|
// The name of the backend to use for Echo, eg, Db, Redis, Zeromq
|
|
|
|
$wgEchoBackendName = 'Db';
|
|
|
|
|
2013-02-28 23:52:12 +00:00
|
|
|
/**
|
|
|
|
* The backend object
|
|
|
|
* @var MWEchoBackend
|
|
|
|
*/
|
2013-01-15 23:21:39 +00:00
|
|
|
$wgEchoBackend = null;
|
|
|
|
|
2012-11-27 01:53:35 +00:00
|
|
|
// Whether to turn on email batch function
|
|
|
|
$wgEchoEnableEmailBatch = true;
|
2012-11-13 23:06:11 +00:00
|
|
|
|
2013-01-04 21:56:30 +00:00
|
|
|
// URL for more information about the Echo notification system
|
|
|
|
$wgEchoHelpPage = '//www.mediawiki.org/wiki/Special:MyLanguage/Help:Extension:Echo';
|
|
|
|
|
2012-12-19 20:28:17 +00:00
|
|
|
// Whether to use job queue to process web and email notifications, bypass the queue for now
|
|
|
|
// since it's taking more than an hour to run in mediawiki.org, this is not acceptable for the
|
|
|
|
// purpose of testing notification.
|
|
|
|
// Todo - Abstract this into classes like: JobQueueNone, JobQueueMySQL, JobQueueRedis
|
|
|
|
$wgEchoUseJobQueue = false;
|
|
|
|
|
2012-10-25 20:39:41 +00:00
|
|
|
// The organization address, the value should be defined in LocalSettings.php
|
|
|
|
$wgEchoEmailFooterAddress = '';
|
2012-08-02 19:50:46 +00:00
|
|
|
|
2013-04-17 16:26:05 +00:00
|
|
|
// The email address for both "from" and "reply to" on email notifications.
|
|
|
|
// Should be defined in LocalSettings.php
|
|
|
|
$wgNotificationSender = $wgPasswordSender;
|
|
|
|
// Name for "from" on email notifications. Should be defined in LocalSettings.php
|
|
|
|
$wgNotificationSenderName = $wgPasswordSenderName;
|
|
|
|
// Name for "reply to" on email notifications. Should be defined in LocalSettings.php
|
|
|
|
$wgNotificationReplyName = 'No Reply';
|
|
|
|
|
2013-04-09 22:13:39 +00:00
|
|
|
// Use the main db if this is set to false, to use a specific external db, just
|
|
|
|
// use any key defined in $wgExternalServers
|
|
|
|
$wgEchoCluster = false;
|
|
|
|
|
2012-11-13 23:06:11 +00:00
|
|
|
// The max notification count showed in badge
|
2013-01-15 23:21:39 +00:00
|
|
|
// The max number showed in bundled message, eg, <user> and 99+ others <action>
|
2012-11-13 23:06:11 +00:00
|
|
|
$wgEchoMaxNotificationCount = 99;
|
|
|
|
|
2013-03-06 00:04:48 +00:00
|
|
|
// The time interval between each bundle email in seconds
|
|
|
|
// set a small number for test wikis, should set this to 0 to disable email bundling
|
|
|
|
// if there is no delay queue support
|
|
|
|
$wgEchoBundleEmailInterval = 0;
|
|
|
|
|
2013-05-14 07:05:09 +00:00
|
|
|
// Whether or not to enable a new talk page message alert for logged in users
|
|
|
|
$wgEchoNewMsgAlert = true;
|
|
|
|
|
2013-06-08 01:05:35 +00:00
|
|
|
// Cohort study period. This array should consist of 3 TS_MW format timestamps
|
|
|
|
// in ascending order, the 1st one is when the bucketing and study start, the 2nd
|
|
|
|
// one is when the bucketing ends, the 3rd one is when the study ends. Set this
|
|
|
|
// to empty array to disable Cohort study, this should be defined in LocalSettings.php
|
|
|
|
$wgEchoCohortInterval = array();
|
|
|
|
|
2013-02-16 02:20:34 +00:00
|
|
|
// Define which output formats are available for each notification category
|
2013-01-14 23:52:46 +00:00
|
|
|
$wgEchoDefaultNotificationTypes = array(
|
2012-04-27 15:14:24 +00:00
|
|
|
'all' => array(
|
2013-01-14 23:52:46 +00:00
|
|
|
'web' => true,
|
2012-05-17 15:36:18 +00:00
|
|
|
'email' => true,
|
2013-02-16 02:20:34 +00:00
|
|
|
),
|
2012-04-27 15:14:24 +00:00
|
|
|
);
|
|
|
|
|
2012-11-16 21:03:57 +00:00
|
|
|
// Definitions of the different types of notification delivery that are possible.
|
|
|
|
// Each definition consists of a class name and a function name.
|
|
|
|
// See also: EchoNotificationController class.
|
2012-04-27 15:14:24 +00:00
|
|
|
$wgEchoNotifiers = array(
|
2013-01-14 23:52:46 +00:00
|
|
|
'web' => array( 'EchoNotifier', 'notifyWithNotification' ), // web-based notification
|
2012-08-30 16:04:39 +00:00
|
|
|
'email' => array( 'EchoNotifier', 'notifyWithEmail' ),
|
2012-04-27 15:14:24 +00:00
|
|
|
);
|
|
|
|
|
2013-05-06 22:34:50 +00:00
|
|
|
// List of usernames that will not trigger notification creation. This is initially
|
|
|
|
// for bots that perform automated edits that are not important enough to regularly
|
|
|
|
// spam people with notifications. Set to empty array when not in use.
|
|
|
|
$wgEchoAgentBlacklist = array();
|
|
|
|
|
|
|
|
// Page location of community maintained blacklist within NS_MEDIAWIKI. Set to null to disable.
|
|
|
|
$wgEchoOnWikiBlacklist = 'Echo-blacklist';
|
|
|
|
|
|
|
|
// sprintf format of per-user notification agent whitelists. Set to null to disable.
|
|
|
|
$wgEchoPerUserWhitelistFormat = '%s/Echo-whitelist';
|
|
|
|
|
2013-02-16 02:20:34 +00:00
|
|
|
// Define the categories that notifications can belong to. Categories can be
|
2013-05-02 00:12:59 +00:00
|
|
|
// assigned the following parameters: priority, nodismiss, tooltip, and usergroups.
|
|
|
|
// All parameters are optional.
|
2013-02-16 02:20:34 +00:00
|
|
|
// If a notifications type doesn't have a category parameter, it is
|
|
|
|
// automatically assigned to the 'other' category which is lowest priority and
|
|
|
|
// has no preferences or dismissibility.
|
|
|
|
// The priority parameter controls the order in which notifications are
|
|
|
|
// displayed in preferences and batch emails. Priority ranges from 1 to 10. If
|
|
|
|
// the priority is not specified, it defaults to 10, which is the lowest.
|
2013-01-17 00:31:56 +00:00
|
|
|
// The usergroups param specifies an array of usergroups eligible to recieve the
|
2013-02-16 02:20:34 +00:00
|
|
|
// notifications in the category. If no usergroups parameter is specified, all
|
|
|
|
// groups are eligible.
|
|
|
|
// The nodismiss parameter disables the dismissability of notifications in the
|
|
|
|
// category. It can either be set to an array of output formats (see
|
|
|
|
// $wgEchoNotifiers) or an array containing 'all'.
|
|
|
|
$wgEchoNotificationCategories = array(
|
|
|
|
'system' => array(
|
|
|
|
'priority' => 9,
|
|
|
|
'no-dismiss' => array( 'all' ),
|
|
|
|
),
|
|
|
|
'other' => array(
|
|
|
|
'no-dismiss' => array( 'all' ),
|
2013-01-14 23:52:46 +00:00
|
|
|
),
|
2012-11-27 01:53:35 +00:00
|
|
|
'edit-user-talk' => array(
|
2013-01-14 23:52:46 +00:00
|
|
|
'priority' => 1,
|
2013-02-16 02:20:34 +00:00
|
|
|
'no-dismiss' => array( 'web' ),
|
2013-05-02 00:12:59 +00:00
|
|
|
'tooltip' => 'echo-pref-tooltip-edit-user-talk',
|
2012-11-27 01:53:35 +00:00
|
|
|
),
|
|
|
|
'reverted' => array(
|
2012-10-28 16:47:41 +00:00
|
|
|
'priority' => 9,
|
2013-05-02 00:12:59 +00:00
|
|
|
'tooltip' => 'echo-pref-tooltip-reverted',
|
2012-11-27 01:53:35 +00:00
|
|
|
),
|
2012-12-26 22:05:29 +00:00
|
|
|
'article-linked' => array(
|
2012-10-28 16:47:41 +00:00
|
|
|
'priority' => 5,
|
2013-05-02 00:12:59 +00:00
|
|
|
'tooltip' => 'echo-pref-tooltip-article-linked',
|
2012-10-28 16:47:41 +00:00
|
|
|
),
|
|
|
|
'mention' => array(
|
|
|
|
'priority' => 4,
|
2013-05-02 00:12:59 +00:00
|
|
|
'tooltip' => 'echo-pref-tooltip-mention',
|
2012-12-26 22:05:29 +00:00
|
|
|
),
|
2012-11-27 01:53:35 +00:00
|
|
|
);
|
|
|
|
|
2013-04-29 03:40:56 +00:00
|
|
|
$echoIconPath = "Echo/modules/icons";
|
|
|
|
|
|
|
|
// Defines icons, which are 30x30 images. This is passed to BeforeCreateEchoEvent so
|
|
|
|
// extensions can define their own icons with the same structure. It is recommended that
|
|
|
|
// extensions prefix their icon key. An example is myextension-name. This will help
|
|
|
|
// avoid namespace conflicts.
|
|
|
|
//
|
|
|
|
// You can use either a path or a url, but not both.
|
|
|
|
// The value of 'path' is relative to $wgExtensionAssetsPath.
|
|
|
|
//
|
|
|
|
// The value of 'url' should be a URL.
|
|
|
|
//
|
|
|
|
// You should customize the site icon URL, which is:
|
|
|
|
// $wgEchoNotificationIcons['site']['url']
|
|
|
|
$wgEchoNotificationIcons = array(
|
|
|
|
'placeholder' => array(
|
|
|
|
'path' => "$echoIconPath/Generic.png",
|
|
|
|
),
|
|
|
|
'trash' => array(
|
|
|
|
'path' => "$echoIconPath/Deletion.png",
|
|
|
|
),
|
|
|
|
'chat' => array(
|
|
|
|
'path' => "$echoIconPath/Talk.png",
|
|
|
|
),
|
|
|
|
'linked' => array(
|
|
|
|
'path' => "$echoIconPath/CrossReferenced.png",
|
|
|
|
),
|
|
|
|
'featured' => array(
|
|
|
|
'path' => "$echoIconPath/Featured.png",
|
|
|
|
),
|
|
|
|
'reviewed' => array(
|
|
|
|
'path' => "$echoIconPath/Reviewed.png",
|
|
|
|
),
|
|
|
|
'tagged' => array(
|
|
|
|
'path' => "$echoIconPath/ReviewedWithTags.png",
|
|
|
|
),
|
|
|
|
'revert' => array(
|
|
|
|
'path' => "$echoIconPath/Revert.png",
|
|
|
|
),
|
|
|
|
'checkmark' => array(
|
|
|
|
'path' => "$echoIconPath/Reviewed.png",
|
|
|
|
),
|
|
|
|
'gratitude' => array(
|
|
|
|
'path' => "$echoIconPath/Gratitude.png",
|
|
|
|
),
|
|
|
|
'site' => array(
|
|
|
|
'url' => false
|
|
|
|
),
|
|
|
|
);
|
|
|
|
|
2013-02-15 23:34:47 +00:00
|
|
|
// Definitions of the notification event types built into Echo.
|
|
|
|
// If formatter-class isn't specified, defaults to EchoBasicFormatter.
|
2013-02-16 02:20:34 +00:00
|
|
|
$wgEchoNotifications = array(
|
2013-01-14 23:52:46 +00:00
|
|
|
'welcome' => array(
|
2013-02-16 02:20:34 +00:00
|
|
|
'category' => 'system',
|
2013-04-30 22:28:50 +00:00
|
|
|
'group' => 'positive',
|
2013-01-14 23:52:46 +00:00
|
|
|
'title-message' => 'notification-new-user',
|
|
|
|
'title-params' => array( 'agent' ),
|
2013-04-29 03:40:56 +00:00
|
|
|
'icon' => 'site',
|
2013-01-14 23:52:46 +00:00
|
|
|
),
|
2012-04-27 15:14:24 +00:00
|
|
|
'edit-user-talk' => array(
|
2013-06-12 23:18:26 +00:00
|
|
|
'primary-link' => array( 'message' => 'notification-link-text-view-message', 'destination' => 'section' ),
|
|
|
|
'secondary-link' => array( 'message' => 'notification-link-text-view-changes', 'destination' => 'diff' ),
|
2013-02-16 02:20:34 +00:00
|
|
|
'category' => 'edit-user-talk',
|
|
|
|
'group' => 'interactive',
|
2013-01-15 23:21:39 +00:00
|
|
|
'bundle' => array( 'web' => true, 'email' => false ),
|
2013-07-24 03:50:43 +00:00
|
|
|
'formatter-class' => 'EchoEditUserTalkFormatter',
|
2013-01-07 22:44:58 +00:00
|
|
|
'title-message' => 'notification-edit-talk-page2',
|
2013-05-14 22:22:52 +00:00
|
|
|
'title-params' => array( 'agent', 'user', 'subject-anchor' ),
|
2013-01-15 23:21:39 +00:00
|
|
|
'bundle-message' => 'notification-edit-talk-page-bundle',
|
|
|
|
'bundle-params' => array( 'agent', 'user', 'agent-other-display', 'agent-other-count' ),
|
2013-01-07 22:44:58 +00:00
|
|
|
'flyout-message' => 'notification-edit-talk-page-flyout2',
|
2013-05-14 22:22:52 +00:00
|
|
|
'flyout-params' => array( 'agent', 'user', 'subject-anchor' ),
|
2013-01-07 22:44:58 +00:00
|
|
|
'email-subject-message' => 'notification-edit-talk-page-email-subject2',
|
2013-06-24 00:22:08 +00:00
|
|
|
'email-subject-params' => array( 'agent' ),
|
2013-01-07 22:44:58 +00:00
|
|
|
'email-body-batch-message' => 'notification-edit-talk-page-email-batch-body2',
|
2013-03-06 00:04:48 +00:00
|
|
|
'email-body-batch-params' => array( 'agent' ),
|
|
|
|
'email-body-batch-bundle-message' => 'notification-edit-user-talk-email-batch-bundle-body',
|
|
|
|
'email-body-batch-bundle-params' => array( 'agent', 'agent-other-display', 'agent-other-count' ),
|
2012-08-01 18:35:30 +00:00
|
|
|
'icon' => 'chat',
|
2012-04-27 15:14:24 +00:00
|
|
|
),
|
2012-07-18 19:39:33 +00:00
|
|
|
'reverted' => array(
|
2013-06-12 23:18:26 +00:00
|
|
|
'primary-link' => array( 'message' => 'notification-link-text-view-edit', 'destination' => 'diff' ),
|
2013-02-16 02:20:34 +00:00
|
|
|
'category' => 'reverted',
|
|
|
|
'group' => 'negative',
|
2013-02-15 23:34:47 +00:00
|
|
|
'formatter-class' => 'EchoEditFormatter',
|
2013-01-07 22:44:58 +00:00
|
|
|
'title-message' => 'notification-reverted2',
|
2012-12-10 05:01:00 +00:00
|
|
|
'title-params' => array( 'agent', 'title', 'difflink', 'number' ),
|
2013-01-07 22:44:58 +00:00
|
|
|
'flyout-message' => 'notification-reverted-flyout2',
|
|
|
|
'flyout-params' => array( 'agent', 'title', 'difflink', 'number' ),
|
|
|
|
'email-subject-message' => 'notification-reverted-email-subject2',
|
2012-12-28 23:43:20 +00:00
|
|
|
'email-subject-params' => array( 'agent', 'title', 'number' ),
|
2013-01-07 22:44:58 +00:00
|
|
|
'email-body-batch-message' => 'notification-reverted-email-batch-body2',
|
2012-12-28 23:43:20 +00:00
|
|
|
'email-body-batch-params' => array( 'agent', 'title', 'number' ),
|
2012-07-18 19:39:33 +00:00
|
|
|
'icon' => 'revert',
|
2012-12-26 22:05:29 +00:00
|
|
|
),
|
2013-01-15 23:21:39 +00:00
|
|
|
'page-linked' => array(
|
2013-06-12 23:18:26 +00:00
|
|
|
'primary-link' => array( 'message' => 'notification-link-text-view-page', 'destination' => 'link-from-page' ),
|
2013-02-16 02:20:34 +00:00
|
|
|
'category' => 'article-linked',
|
2013-04-30 22:28:50 +00:00
|
|
|
'group' => 'neutral',
|
2013-03-06 00:04:48 +00:00
|
|
|
'bundle' => array( 'web' => true, 'email' => true ),
|
2013-01-15 23:21:39 +00:00
|
|
|
'formatter-class' => 'EchoPageLinkFormatter',
|
|
|
|
'title-message' => 'notification-page-linked',
|
|
|
|
'title-params' => array( 'agent', 'title', 'link-from-page' ),
|
|
|
|
'bundle-message' => 'notification-page-linked-bundle',
|
|
|
|
'bundle-params' => array( 'agent', 'title', 'link-from-page', 'link-from-page-other-display', 'link-from-page-other-count' ),
|
|
|
|
'flyout-message' => 'notification-page-linked-flyout',
|
|
|
|
'flyout-params' => array( 'agent', 'title', 'link-from-page' ),
|
|
|
|
'email-subject-message' => 'notification-page-linked-email-subject',
|
|
|
|
'email-subject-params' => array(),
|
|
|
|
'email-body-batch-message' => 'notification-page-linked-email-batch-body',
|
|
|
|
'email-body-batch-params' => array( 'agent', 'title', 'link-from-page' ),
|
2013-03-06 00:04:48 +00:00
|
|
|
'email-body-batch-bundle-message' => 'notification-page-linked-email-batch-bundle-body',
|
|
|
|
'email-body-batch-bundle-params' => array( 'agent', 'title', 'link-from-page', 'link-from-page-other-display', 'link-from-page-other-count' ),
|
2012-12-26 22:05:29 +00:00
|
|
|
'icon' => 'linked',
|
|
|
|
),
|
2012-10-28 16:47:41 +00:00
|
|
|
'mention' => array(
|
2013-06-12 23:18:26 +00:00
|
|
|
'primary-link' => array( 'message' => 'notification-link-text-view-mention', 'destination' => 'section' ),
|
|
|
|
'secondary-link' => array( 'message' => 'notification-link-text-view-changes', 'destination' => 'diff' ),
|
2013-02-16 02:20:34 +00:00
|
|
|
'category' => 'mention',
|
|
|
|
'group' => 'interactive',
|
2013-02-25 19:19:18 +00:00
|
|
|
'formatter-class' => 'EchoCommentFormatter',
|
2012-10-28 16:47:41 +00:00
|
|
|
'title-message' => 'notification-mention',
|
2013-07-24 03:50:43 +00:00
|
|
|
'title-params' => array( 'agent', 'subject-anchor', 'title', 'section-title', 'main-title-text' ),
|
2012-10-28 16:47:41 +00:00
|
|
|
'flyout-message' => 'notification-mention-flyout',
|
2013-07-24 03:50:43 +00:00
|
|
|
'flyout-params' => array( 'agent', 'subject-anchor', 'title', 'section-title', 'main-title-text' ),
|
2012-10-28 16:47:41 +00:00
|
|
|
'email-subject-message' => 'notification-mention-email-subject',
|
|
|
|
'email-subject-params' => array( 'agent' ),
|
|
|
|
'email-body-batch-message' => 'notification-mention-email-batch-body',
|
2013-07-24 03:50:43 +00:00
|
|
|
'email-body-batch-params' => array( 'agent', 'title', 'section-title', 'main-title-text' ),
|
2012-10-28 16:47:41 +00:00
|
|
|
'icon' => 'chat',
|
2013-03-13 00:49:19 +00:00
|
|
|
),
|
|
|
|
'user-rights' => array(
|
2013-08-01 00:18:23 +00:00
|
|
|
'primary-link' => array( 'message' => 'echo-learn-more', 'destination' => 'user-rights-list' ),
|
2013-03-13 00:49:19 +00:00
|
|
|
'category' => 'system',
|
2013-04-30 22:28:50 +00:00
|
|
|
'group' => 'neutral',
|
2013-03-13 00:49:19 +00:00
|
|
|
'formatter-class' => 'EchoUserRightsFormatter',
|
|
|
|
'title-message' => 'notification-user-rights',
|
|
|
|
'title-params' => array( 'agent', 'user-rights-list' ),
|
|
|
|
'flyout-message' => 'notification-user-rights-flyout',
|
|
|
|
'flyout-params' => array( 'agent', 'user-rights-list' ),
|
|
|
|
'email-subject-message' => 'notification-user-rights-email-subject',
|
|
|
|
'email-subject-params' => array(),
|
|
|
|
'email-body-batch-message' => 'notification-user-rights-email-batch-body',
|
|
|
|
'email-body-batch-params' => array( 'agent', 'user-rights-list' ),
|
2013-04-29 03:40:56 +00:00
|
|
|
'icon' => 'site',
|
2013-03-13 00:49:19 +00:00
|
|
|
),
|
2012-06-08 05:33:25 +00:00
|
|
|
);
|
2013-01-17 23:06:40 +00:00
|
|
|
|
|
|
|
// Enable notifications for all logged in users by default
|
2013-03-20 01:10:23 +00:00
|
|
|
$wgDefaultUserOptions['echo-notify-show-link'] = true;
|
2013-01-17 23:06:40 +00:00
|
|
|
|
2013-05-14 07:05:09 +00:00
|
|
|
// Enable new talk page messages alert for all logged in users by default
|
|
|
|
$wgDefaultUserOptions['echo-show-alert'] = true;
|
|
|
|
|
2013-01-17 23:06:40 +00:00
|
|
|
// By default, send emails for each notification as they come in
|
|
|
|
$wgDefaultUserOptions['echo-email-frequency'] = EchoHooks::EMAIL_IMMEDIATELY;
|
|
|
|
|
2013-06-24 00:22:08 +00:00
|
|
|
if ( $wgAllowHTMLEmail ) {
|
|
|
|
$wgDefaultUserOptions['echo-email-format'] = EchoHooks::EMAIL_FORMAT_HTML;
|
|
|
|
} else {
|
|
|
|
$wgDefaultUserOptions['echo-email-format'] = EchoHooks::EMAIL_FORMAT_PLAIN_TEXT;
|
|
|
|
}
|
|
|
|
|
2013-04-25 00:41:47 +00:00
|
|
|
// Set all of the events to notify by web but not email by default (won't affect events that don't email)
|
2013-03-06 19:56:23 +00:00
|
|
|
foreach ( $wgEchoNotificationCategories as $category => $categoryData ) {
|
2013-04-25 00:41:47 +00:00
|
|
|
$wgDefaultUserOptions["echo-subscriptions-email-{$category}"] = false;
|
|
|
|
$wgDefaultUserOptions["echo-subscriptions-web-{$category}"] = true;
|
2013-01-17 23:06:40 +00:00
|
|
|
}
|
2013-01-15 23:21:39 +00:00
|
|
|
|
2013-04-27 01:39:11 +00:00
|
|
|
// most settings default to web on, email off, but override these
|
|
|
|
$wgDefaultUserOptions['echo-subscriptions-email-system'] = true;
|
2013-04-25 00:41:47 +00:00
|
|
|
$wgDefaultUserOptions['echo-subscriptions-web-article-linked'] = false;
|
2013-03-01 00:26:59 +00:00
|
|
|
|
2013-02-16 02:20:34 +00:00
|
|
|
// Echo Configuration for EventLogging
|
2013-03-01 00:26:59 +00:00
|
|
|
$wgEchoConfig = array(
|
2013-06-05 20:44:06 +00:00
|
|
|
'version' => '1.4',
|
2013-05-07 23:27:46 +00:00
|
|
|
// default all eventlogging off, overwrite them in site configuration
|
2013-03-01 00:26:59 +00:00
|
|
|
'eventlogging' => array (
|
|
|
|
'Echo' => array (
|
2013-03-06 19:56:23 +00:00
|
|
|
'enabled' => false,
|
2013-04-30 22:26:58 +00:00
|
|
|
'revision' => 5423520
|
2013-05-07 23:27:46 +00:00
|
|
|
),
|
|
|
|
'EchoMail' => array (
|
|
|
|
'enabled' => false,
|
|
|
|
'revision' => 5467650
|
|
|
|
),
|
2013-05-16 21:14:26 +00:00
|
|
|
'EchoPrefUpdate' => array (
|
|
|
|
'enabled' => false,
|
|
|
|
'revision' => 5488876
|
|
|
|
),
|
2013-06-05 20:44:06 +00:00
|
|
|
'EchoInteraction' => array (
|
|
|
|
'enabled' => false,
|
|
|
|
'revision' => 5539940
|
|
|
|
),
|
2013-03-01 00:26:59 +00:00
|
|
|
)
|
|
|
|
);
|