Index: trunk/extensions/Translate/SpecialManageGroups.php |
— | — | @@ -18,7 +18,7 @@ |
19 | 19 | * |
20 | 20 | * @todo Needs documentation. |
21 | 21 | */ |
22 | | -class SpecialManageGroups { |
| 22 | +class SpecialManageGroups extends SpecialPage { |
23 | 23 | protected $skin, $user, $out; |
24 | 24 | /** |
25 | 25 | * Maximum allowed processing time in seconds. |
— | — | @@ -33,9 +33,10 @@ |
34 | 34 | $this->out = $wgOut; |
35 | 35 | $this->user = $wgUser; |
36 | 36 | $this->skin = $wgUser->getSkin(); |
| 37 | + parent::__construct( 'ManageMessageGroups', 'translate-manage' ); |
37 | 38 | } |
38 | 39 | |
39 | | - public function execute() { |
| 40 | + public function execute( $par ) { |
40 | 41 | global $wgRequest; |
41 | 42 | |
42 | 43 | $this->out->setPageTitle( htmlspecialchars( wfMsg( 'translate-managegroups' ) ) ); |
— | — | @@ -85,6 +86,8 @@ |
86 | 87 | continue; |
87 | 88 | } |
88 | 89 | |
| 90 | + wfDebug( __METHOD__ . ": {$group->getId()}\n" ); |
| 91 | + |
89 | 92 | $link = $this->skin->link( $this->getTitle(), $group->getLabel(), array(), array( 'group' => $group->getId() ) ); |
90 | 93 | $out = $link . $separator; |
91 | 94 | |
— | — | @@ -96,10 +99,20 @@ |
97 | 100 | $wgLang->time( $timestamp ) |
98 | 101 | ); |
99 | 102 | |
100 | | - if ( !$cache->isValid() ) { |
101 | | - $out = '<span style="color:red">!!</span> ' . $out; |
| 103 | + $languages = array_keys( Language::getLanguageNames( false ) ); |
| 104 | + $modified = array(); |
| 105 | + |
| 106 | + foreach ( $languages as $code ) { |
| 107 | + $cache = new MessageGroupCache( $group, $code ); |
| 108 | + if ( !$cache->isValid() ) $modified[] = $code; |
102 | 109 | } |
103 | 110 | |
| 111 | + if ( count( $modified ) ) { |
| 112 | + $out = '[' . implode( ",", $modified ) . '] ' . $out; |
| 113 | + } else { |
| 114 | + $out = Html::rawElement( 'span', array( 'style' => 'color:grey' ), $out ); |
| 115 | + } |
| 116 | + |
104 | 117 | } else { |
105 | 118 | $out .= wfMsg( 'translate-manage-newgroup' ); |
106 | 119 | } |
— | — | @@ -124,13 +137,6 @@ |
125 | 138 | } |
126 | 139 | |
127 | 140 | /** |
128 | | - * Special:Translate/manage. |
129 | | - */ |
130 | | - public function getTitle() { |
131 | | - return SpecialPage::getTitleFor( 'Translate', 'manage' ); |
132 | | - } |
133 | | - |
134 | | - /** |
135 | 141 | * @todo Very long code block; split up. |
136 | 142 | */ |
137 | 143 | public function importForm( $group, $code ) { |
Index: trunk/extensions/Translate/TranslatePage.php |
— | — | @@ -39,18 +39,7 @@ |
40 | 40 | |
41 | 41 | $this->setHeaders(); |
42 | 42 | |
43 | | - if ( $parameters === 'manage' ) { |
44 | | - $this->restriction( 'translate-manage' ); |
45 | | - if ( !$this->userCanExecute( $wgUser ) ) { |
46 | | - $this->displayRestrictionError(); |
47 | | - return; |
48 | | - } |
49 | | - |
50 | | - $manage = new SpecialManageGroups(); |
51 | | - $manage->execute(); |
52 | | - |
53 | | - return; |
54 | | - } elseif ( $parameters === 'editpage' ) { |
| 43 | + if ( $parameters === 'editpage' ) { |
55 | 44 | $editpage = TranslationEditPage::newFromRequest( $wgRequest ); |
56 | 45 | |
57 | 46 | if ( $editpage ) { |
Index: trunk/extensions/Translate/Translate.php |
— | — | @@ -66,6 +66,8 @@ |
67 | 67 | $wgSpecialPageGroups['LanguageStats'] = 'wiki'; |
68 | 68 | $wgSpecialPages['ImportTranslations'] = 'SpecialImportTranslations'; |
69 | 69 | $wgSpecialPageGroups['ImportTranslations'] = 'wiki'; |
| 70 | +$wgSpecialPages['ManageMessageGroups'] = 'SpecialManageGroups'; |
| 71 | +$wgSpecialPageGroups['ManageMessageGroups'] = 'wiki'; |
70 | 72 | // Unlisted special page; does not need $wgSpecialPageGroups. |
71 | 73 | $wgSpecialPages['FirstSteps'] = 'SpecialFirstSteps'; |
72 | 74 | // Unlisted special page; does not need $wgSpecialPageGroups. |
Index: trunk/extensions/Translate/Translate.alias.php |
— | — | @@ -20,6 +20,7 @@ |
21 | 21 | 'LanguageStats' => array( 'LanguageStats' ), |
22 | 22 | 'PageTranslation' => array( 'PageTranslation' ), |
23 | 23 | 'ImportTranslations' => array( 'ImportTranslations' ), |
| 24 | + 'ManageMessageGroups'=> array( 'ManageMessageGroups' ), |
24 | 25 | 'FirstSteps' => array( 'FirstSteps' ), |
25 | 26 | 'SupportedLanguages' => array( 'SupportedLanguages' ), |
26 | 27 | 'MyLanguage' => array( 'MyLanguage' ), |