Index: trunk/extensions/MarkAsHelpful/MarkAsHelpful.i18n.php |
— | — | @@ -0,0 +1,16 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Internationalisation file for MarkAsHelpful extension. |
| 5 | + * |
| 6 | + * @file |
| 7 | + * @ingroup Extensions |
| 8 | + */ |
| 9 | + |
| 10 | +$messages = array(); |
| 11 | + |
| 12 | +/** English |
| 13 | + * @author Rob Moen |
| 14 | + */ |
| 15 | +$messages['en'] = array( |
| 16 | + 'mark-as-helpful-desc' => 'Hooks in to specified objects and provides a user interface to mark them as helpful', |
| 17 | +); |
\ No newline at end of file |
Index: trunk/extensions/MarkAsHelpful/MarkAsHelpful.php |
— | — | @@ -0,0 +1,44 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * HelpfulMarker extension |
| 5 | + * Allows specified users to mark certain objects as "Helpful" |
| 6 | + */ |
| 7 | + |
| 8 | +$wgExtensionCredits['other'][] = array( |
| 9 | + 'author' => array( 'Rob Moen', 'Benny Situ' ), |
| 10 | + 'descriptionmsg' => 'mark-as-helpful-desc', |
| 11 | + 'name' => 'MarkAsHelpful', |
| 12 | + 'url' => 'http://www.mediawiki.org/wiki/Mark_as_Helpful', |
| 13 | + 'version' => '0.1', |
| 14 | + 'path' => __FILE__, |
| 15 | +); |
| 16 | + |
| 17 | + |
| 18 | +// Object model |
| 19 | + |
| 20 | + |
| 21 | +// API |
| 22 | + |
| 23 | + |
| 24 | +// Hooks |
| 25 | +$wgAutoloadClasses['MarkAsHelpfulHooks'] = dirname(__FILE__).'/MarkAsHelpful.hooks.php'; |
| 26 | +$wgHooks['BeforePageDisplay'][] = 'MarkAsHelpfulHooks::onPageDisplay'; |
| 27 | + |
| 28 | +// Special pages |
| 29 | + |
| 30 | + |
| 31 | +// User rights |
| 32 | +$wgAvailableRights[] = 'markashelpful-view'; |
| 33 | +$wgAvailableRights[] = 'markashelpful-admin'; |
| 34 | + |
| 35 | +$wgGroupPermissions['sysop']['makrashelpful-admin'] = true; |
| 36 | + |
| 37 | +// Internationalisation |
| 38 | +$wgExtensionMessagesFiles['MarkAsHelpful'] = dirname(__FILE__).'/MarkAsHelpful.i18n.php'; |
| 39 | + |
| 40 | +// Resources |
| 41 | +$mbResourceTemplate = array( |
| 42 | + 'localBasePath' => dirname(__FILE__) . '/modules', |
| 43 | + 'remoteExtPath' => 'MarkAsHelpful/modules' |
| 44 | +); |
| 45 | + |
Index: trunk/extensions/MarkAsHelpful/MarkAsHelpful.hooks.php |
— | — | @@ -0,0 +1,29 @@ |
| 2 | +<? |
| 3 | + |
| 4 | +class MarkAsHelpfulHooks { |
| 5 | + /** |
| 6 | + * Adds MarkAsHelpful JS to the output if appropriate. |
| 7 | + * |
| 8 | + * @param $output OutputPage |
| 9 | + * @param $skin Skin |
| 10 | + */ |
| 11 | + |
| 12 | + public static function onPageDisplay( &$output, &$skin ) { |
| 13 | + if ( self::addMarkAsHelpful( $output, $skin ) ) { |
| 14 | + $output->addModules( array( 'ext.markAsHelpful' ) ); |
| 15 | + } |
| 16 | + |
| 17 | + return true; |
| 18 | + } |
| 19 | + |
| 20 | + /** |
| 21 | + * Determines whether or not we should add MarkAsHelpful to the current page. |
| 22 | + * |
| 23 | + * @param $output OutputPage |
| 24 | + * @param $skin Skin |
| 25 | + */ |
| 26 | + public static function addMarkAsHelpful ( &$output, &$skin ) { |
| 27 | + |
| 28 | + return true; |
| 29 | + } |
| 30 | +} |
\ No newline at end of file |