Index: trunk/extensions/TranslationNotifications/TranslationNotifications.alias.php |
— | — | @@ -10,5 +10,12 @@ |
11 | 11 | |
12 | 12 | /** English (English) */ |
13 | 13 | $specialPageAliases['en'] = array( |
| 14 | + 'NotifyTranslators' => array( 'NotifyTranslators' ), |
14 | 15 | 'TranslatorSignup' => array( 'TranslatorSignup' ), |
15 | 16 | ); |
| 17 | + |
| 18 | +/** Hebrew (עברית) */ |
| 19 | +$specialPageAliases['he'] = array( |
| 20 | + 'NotifyTranslators' => array( 'מכתבים_למתרגמים' ), |
| 21 | + 'TranslatorSignup' => array( 'רישום_מתרגמים' ), |
| 22 | +); |
Index: trunk/extensions/TranslationNotifications/resources/ext.translationnotifications.notifytranslators.js |
— | — | @@ -0,0 +1,32 @@ |
| 2 | +/** |
| 3 | + * JavaScript functions for embedding jQuery controls |
| 4 | + * into TranslationNotificatnions forms. |
| 5 | + * |
| 6 | + * @author Amir E. Aharoni |
| 7 | + * @copyright Copyright © 2012 Amir E. Aharoni |
| 8 | + * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
| 9 | + */ |
| 10 | + |
| 11 | +(function ( $ ) { |
| 12 | + $( document ).ready( function( page, group ) { |
| 13 | + // Based on UploadWizard |
| 14 | + $( '#mw-input-wpDeadlineDate' ).datepicker( { |
| 15 | + dateFormat: 'yy-mm-dd', |
| 16 | + constrainInput: false, |
| 17 | + showOn: 'focus', |
| 18 | + changeMonth: true, |
| 19 | + changeYear: true, |
| 20 | + showAnim: false, |
| 21 | + showButtonPanel: true |
| 22 | + } ) |
| 23 | + .data( 'open', 0 ) |
| 24 | + .click( function() { |
| 25 | + var $this = $( this ); |
| 26 | + if ( $this.data( 'open' ) === 0 ) { |
| 27 | + $this.data( 'open', 1 ).datepicker( 'show' ); |
| 28 | + } else { |
| 29 | + $this.data( 'open', 0 ).datepicker( 'hide' ); |
| 30 | + } |
| 31 | + } ); |
| 32 | + } ); |
| 33 | +} )( jQuery ); |
Property changes on: trunk/extensions/TranslationNotifications/resources/ext.translationnotifications.notifytranslators.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 34 | + native |
Index: trunk/extensions/TranslationNotifications/SpecialNotifyTranslators.php |
— | — | @@ -0,0 +1,68 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Form for translation managers to send a notification |
| 5 | + * to registered translators. |
| 6 | + * |
| 7 | + * @file |
| 8 | + * @author Amir E. Aharoni |
| 9 | + * @copyright Copyright © 2012, Amir E. Aharoni |
| 10 | + * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
| 11 | + */ |
| 12 | + |
| 13 | +/** |
| 14 | + * Form for translation managers to send a notification |
| 15 | + * to registered translators. |
| 16 | + * |
| 17 | + * @ingroup SpecialPage TranslateSpecialPage |
| 18 | + */ |
| 19 | + |
| 20 | +class SpecialNotifyTranslators extends SpecialPage { |
| 21 | + protected static $right = 'translate-manage'; |
| 22 | + |
| 23 | + public function __construct() { |
| 24 | + parent::__construct( 'NotifyTranslators' ); |
| 25 | + } |
| 26 | + |
| 27 | + public function execute( $parameters ) { |
| 28 | + global $wgUser, $wgOut; |
| 29 | + if ( !$wgUser->isallowed( self::$right ) ) { |
| 30 | + throw new PermissionsError( self::$right ); |
| 31 | + } |
| 32 | + |
| 33 | + $wgOut->addModules( 'ext.translationnotifications.notifytranslators' ); |
| 34 | + |
| 35 | + $context = $this->getContext(); |
| 36 | + $htmlForm = new HtmlForm( $this->getDataModel(), $context, 'translationnotifications' ); |
| 37 | + $htmlForm->setId( 'notifytranslators-form' ); |
| 38 | + $htmlForm->setSubmitText( $context->msg( 'translationnotifications-send-notification-button' )->text() ); |
| 39 | + $htmlForm->setSubmitID( 'translationnotifications-send-notification-button' ); |
| 40 | + $htmlForm->setSubmitCallback( array( $this, 'formSubmit' ) ); |
| 41 | + $htmlForm->show(); |
| 42 | + |
| 43 | + $this->setHeaders(); |
| 44 | + } |
| 45 | + |
| 46 | + public function getDataModel() { |
| 47 | + $m['LanguagesToNotify'] = array( |
| 48 | + 'type' => 'text', |
| 49 | + 'rows' => 20, |
| 50 | + 'cols' => 80, |
| 51 | + 'label-message' => 'translationnotifications-languages-to-notify-label', |
| 52 | + ); |
| 53 | + |
| 54 | + $m['NotificationText'] = array( |
| 55 | + 'type' => 'textarea', |
| 56 | + 'rows' => 20, |
| 57 | + 'cols' => 80, |
| 58 | + 'label-message' => 'emailmessage', |
| 59 | + ); |
| 60 | + |
| 61 | + $m['DeadlineDate'] = array( |
| 62 | + 'type' => 'text', |
| 63 | + 'size' => 20, |
| 64 | + 'label-message' => 'translationnotifications-deadline-label', |
| 65 | + ); |
| 66 | + |
| 67 | + return $m; |
| 68 | + } |
| 69 | +} |
Property changes on: trunk/extensions/TranslationNotifications/SpecialNotifyTranslators.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 70 | + native |
Index: trunk/extensions/TranslationNotifications/TranslationNotifications.php |
— | — | @@ -25,11 +25,26 @@ |
26 | 26 | |
27 | 27 | $dir = dirname( __FILE__ ); |
28 | 28 | $wgSpecialPages['TranslatorSignup'] = 'SpecialTranslatorSignup'; |
| 29 | +$wgSpecialPages['NotifyTranslators'] = 'SpecialNotifyTranslators'; |
29 | 30 | $wgSpecialPageGroups['TranslatorSignup'] = 'login'; |
| 31 | +$wgSpecialPageGroups['NotifyTranslators'] = 'users'; |
30 | 32 | $wgExtensionMessagesFiles['TranslationNotifications'] = "$dir/TranslationNotifications.i18n.php"; |
31 | 33 | $wgExtensionMessagesFiles['TranslationNotificationsAlias'] = "$dir/TranslationNotifications.alias.php"; |
32 | 34 | $wgAutoloadClasses['SpecialTranslatorSignup'] = "$dir/SpecialTranslatorSignup.php"; |
| 35 | +$wgAutoloadClasses['SpecialNotifyTranslators'] = "$dir/SpecialNotifyTranslators.php"; |
33 | 36 | |
| 37 | +$resourcePaths = array( |
| 38 | + 'localBasePath' => dirname( __FILE__ ), |
| 39 | + 'remoteExtPath' => 'TranslationNotifications' |
| 40 | +); |
| 41 | + |
| 42 | +$wgResourceModules['ext.translationnotifications.notifytranslators'] = array( |
| 43 | + 'scripts' => 'resources/ext.translationnotifications.notifytranslators.js', |
| 44 | + 'dependencies' => array( |
| 45 | + 'jquery.ui.datepicker' |
| 46 | + ), |
| 47 | +) + $resourcePaths; |
| 48 | + |
34 | 49 | $wgTranslationNotificationsContactMethods = array( |
35 | 50 | 'email' => true, |
36 | 51 | 'talkpage' => true, |