__FILE__, 'name' => 'Thanks', 'author' => array( 'Ryan Kaldari', ), 'version' => '1.0.0', 'url' => 'https://www.mediawiki.org/wiki/Extension:Thanks', 'descriptionmsg' => 'thanks-desc', ); /* Setup */ $dir = __DIR__; // Register files $wgAutoloadClasses['ThanksHooks'] = $dir . '/Thanks.hooks.php'; $wgAutoloadClasses['EchoThanksFormatter'] = $dir . '/ThanksFormatter.php'; $wgAutoloadClasses['ApiThank'] = $dir . '/ApiThank.php'; $wgAutoloadClasses['ThanksLogFormatter'] = $dir . '/ThanksLogFormatter.php'; $wgExtensionMessagesFiles['Thanks'] = $dir . '/Thanks.i18n.php'; // Register APIs $wgAPIModules['thank'] = 'ApiThank'; // Register hooks $wgHooks['HistoryRevisionTools'][] = 'ThanksHooks::insertThankLink'; $wgHooks['DiffRevisionTools'][] = 'ThanksHooks::insertThankLink'; $wgHooks['PageHistoryBeforeList'][] = 'ThanksHooks::onPageHistoryBeforeList'; $wgHooks['DiffViewHeader'][] = 'ThanksHooks::onDiffViewHeader'; $wgHooks['BeforeCreateEchoEvent'][] = 'ThanksHooks::onBeforeCreateEchoEvent'; $wgHooks['EchoGetDefaultNotifiedUsers'][] = 'ThanksHooks::onEchoGetDefaultNotifiedUsers'; // Register modules $wgResourceModules['ext.thanks'] = array( 'scripts' => array( 'ext.thanks.thank.js', ), 'messages' => array( 'thanks-thanked', 'thanks-error-undefined', 'thanks-error-invalidrevision', 'thanks-error-ratelimited', ), 'dependencies' => array( 'mediawiki.jqueryMsg', 'mediawiki.api', 'user.tokens', ), 'localBasePath' => $dir . '/modules', 'remoteExtPath' => 'Thanks/modules', ); // Logging $wgLogTypes[] = 'thanks'; $wgLogActionsHandlers['thanks/*'] = 'ThanksLogFormatter'; /* Configuration */ // Enable sending thanks to bots $wgThanksSendToBots = false; // Whether or not thanks should be logged in Special:Log $wgThanksLogging = true; // Set how many thanks can be sent per minute by a single user (default 10) $wgRateLimits += array( 'thanks-notification' => array( 'user' => array( 10, 60 ) ), ); // Set default user options $wgDefaultUserOptions['echo-subscriptions-web-edit-thank'] = true; $wgDefaultUserOptions['echo-subscriptions-email-edit-thank'] = false;