Extension:MarkAsHelpful

Installation
To install this extension, add the following to LocalSettings.php:

Run maintenance/update.php to install the database table

Configuration
$wgMarkAsHelpfulType *Required

Array of types to enable for mark as helpful extension, $wgMarkAsHelpfulType should be added to LocalSettings.php following MarkAsHelpful.php configuration file

Example:

API
1. ApiMarkAsHelpful - allows a user to mark/unmark an item as helpful

2. ApiGetMarkAsHelpfulItem - gets a list of users who marked the item as helpful

See the extension API files for detail information on the API parameters and output format

Hook
There are two variables in the API that control mark as helpful permissions: 1 $isAbleToMark - check if current user has permission to mark the item 2 $isAbleToShow - check if the page has permission to request the item

Both variables are false by default and the 'onMarkItemAsHelpful' hook allows users to re-define the values of these two variables, the hook function should be like: