Index: trunk/extensions/Configure/SpecialViewConfig.php |
— | — | @@ -44,7 +44,6 @@ |
45 | 45 | } |
46 | 46 | |
47 | 47 | $this->version = $version; |
48 | | - $this->wiki = $wiki; |
49 | 48 | |
50 | 49 | if ( $diff = $wgRequest->getVal( 'diff' ) ) { |
51 | 50 | if ( !in_array( $diff, $versions ) && $diff != 'default' ) { |
— | — | @@ -82,7 +81,7 @@ |
83 | 82 | */ |
84 | 83 | protected function showDiff() { |
85 | 84 | global $wgOut; |
86 | | - $wikis = $this->isUserAllowedAll() ? true : array( $this->wiki ); |
| 85 | + $wikis = $this->isUserAllowedAll() ? true : array( $this->mWiki ); |
87 | 86 | $diffEngine = new HistoryConfigurationDiff( $this->diff, $this->version, $wikis ); |
88 | 87 | $diffEngine->setViewCallback( array( $this, 'userCanRead' ) ); |
89 | 88 | $wgOut->addHTML( $diffEngine->getHTML() ); |
— | — | @@ -117,16 +116,19 @@ |
118 | 117 | |
119 | 118 | /** |
120 | 119 | * Build links to old version of the configuration |
121 | | - * |
122 | 120 | */ |
123 | 121 | protected function buildOldVersionSelect() { |
124 | | - global $wgConf, $wgLang, $wgUser, $wgScript; |
| 122 | + global $wgConf, $wgLang, $wgUser, $wgRequest, $wgScript; |
125 | 123 | if ( !$this->isWebConfig ) |
126 | 124 | return ''; |
127 | 125 | |
128 | 126 | $self = $this->getTitle(); |
129 | 127 | $pager = $wgConf->getPager(); |
130 | 128 | $pager->setFormatCallback( array( $this, 'formatVersionRow' ) ); |
| 129 | + |
| 130 | + $wiki = $this->isUserAllowedInterwiki() && $wgRequest->getVal( 'view', 'all' ) == 'all' ? false : $this->mWiki; |
| 131 | + $pager->setWiki( $wiki ); |
| 132 | + |
131 | 133 | $showDiff = $pager->getNumRows() > 1; |
132 | 134 | |
133 | 135 | $formatConf = array( |
— | — | @@ -150,6 +152,8 @@ |
151 | 153 | $this->formatConf = $formatConf; |
152 | 154 | |
153 | 155 | $text = wfMsgExt( 'configure-old-versions', array( 'parse' ) ); |
| 156 | + if( $this->isUserAllowedInterwiki() ) |
| 157 | + $text .= $this->getWikiSelectForm(); |
154 | 158 | $text .= $pager->getNavigationBar(); |
155 | 159 | if ( $showDiff ) { |
156 | 160 | $text .= Xml::openElement( 'form', array( 'action' => $wgScript ) ) . "\n" . |
— | — | @@ -259,6 +263,31 @@ |
260 | 264 | } |
261 | 265 | |
262 | 266 | /** |
| 267 | + * Get a form to select the wiki to configure |
| 268 | + */ |
| 269 | + protected function getWikiSelectForm() { |
| 270 | + global $wgConfigureWikis, $wgScript, $wgRequest; |
| 271 | + if ( $wgConfigureWikis === false || !$this->isUserAllowedInterwiki() ) |
| 272 | + return ''; |
| 273 | + $form = '<fieldset><legend>' . wfMsgHtml( 'configure-select-wiki' ) . '</legend>'; |
| 274 | + $form .= wfMsgExt( 'configure-select-wiki-view-desc', array( 'parse' ) ); |
| 275 | + $form .= Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ); |
| 276 | + $form .= Xml::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ); |
| 277 | + if ( is_array( $wgConfigureWikis ) ) { |
| 278 | + $form .= wfMsgExt( 'configure-select-wiki-available', |
| 279 | + array( 'parse' ), implode( ', ', $wgConfigureWikis ) ); |
| 280 | + } |
| 281 | + $all = ( $wgRequest->getVal( 'view', 'all' ) == 'all' ); |
| 282 | + $form .= Xml::radioLabel( wfMsg( 'configure-select-wiki-view-all' ), 'view', 'all', 'wiki-all', $all ); |
| 283 | + $form .= "<br />\n"; |
| 284 | + $form .= Xml::radioLabel( wfMsg( 'configure-select-wiki-view-specific' ), 'view', 'specific', 'wiki-specific', !$all ) . ' '; |
| 285 | + $form .= Xml::input( 'wiki', false, $this->mWiki ) . "<br />\n"; |
| 286 | + $form .= Xml::submitButton( wfMsg( 'configure-select-wiki-submit' ) ); |
| 287 | + $form .= '</form></fieldset>'; |
| 288 | + return $form; |
| 289 | + } |
| 290 | + |
| 291 | + /** |
263 | 292 | * Taken from PageHistory.php |
264 | 293 | */ |
265 | 294 | protected function getButton() { |
Index: trunk/extensions/Configure/CHANGELOG |
— | — | @@ -5,6 +5,8 @@ |
6 | 6 | * JavaScript-based setting search in Special:Configure, Special:Extensions |
7 | 7 | and Special:ViewConfig |
8 | 8 | * Hidden settings now have a summary |
| 9 | + * Added a search box at the top Special:ViewConfig to display versions for a |
| 10 | + specific wiki |
9 | 11 | |
10 | 12 | 0.10.12 - 2 December 2008 |
11 | 13 | * Fix a problem of duplicate files with the same timestamp if two users save |
Index: trunk/extensions/Configure/Configure.i18n.php |
— | — | @@ -25,8 +25,8 @@ |
26 | 26 | 'configure-ext-settings' => 'Settings', |
27 | 27 | 'configure-ext-use-extension' => 'Use this extension', |
28 | 28 | 'configure-ext-use' => 'Use', |
29 | | - 'configure-form-reason' => 'Reason for change:', |
30 | | - 'configure-customised' => "''This setting has been customised''", |
| 29 | + 'configure-form-reason' => 'Reason for change:', |
| 30 | + 'configure-customised' => "''This setting has been customised''", |
31 | 31 | |
32 | 32 | 'configure-arrayinput-oneperline' => "''(one per line)''", |
33 | 33 | 'configure-summary' => 'This special page allows you to configure this wiki, see [http://www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings] for more information.', |
— | — | @@ -46,10 +46,10 @@ |
47 | 47 | 'configure-js-get-image-url' => 'Convert file name to URL', |
48 | 48 | 'configure-js-image-error' => 'An error occured while fetching the URL. Please check that the file exists.', |
49 | 49 | 'configure-js-biglist-shown' => 'Setting details can be hidden', |
50 | | - 'configure-js-biglist-hidden' => 'Setting details hidden', |
51 | | - 'configure-js-biglist-show' => '[show details]', |
52 | | - 'configure-js-biglist-hide' => '[hide details]', |
53 | | - 'configure-js-summary-none' => 'No settings', |
| 50 | + 'configure-js-biglist-hidden' => 'Setting details hidden', |
| 51 | + 'configure-js-biglist-show' => '[show details]', |
| 52 | + 'configure-js-biglist-hide' => '[hide details]', |
| 53 | + 'configure-js-summary-none' => 'No settings', |
54 | 54 | 'configure-js-search-legend' => 'Search settings', |
55 | 55 | 'configure-js-search-prompt' => 'Query: ', |
56 | 56 | 'configure-no-diff' => 'There are no changes between selected versions.', |
— | — | @@ -61,11 +61,11 @@ |
62 | 62 | 'configure-old' => 'Old versions', |
63 | 63 | 'configure-old-versions' => 'List of old versions of the configuration:', |
64 | 64 | 'configure-old-not-available' => 'The old version of the settings you requested, $1, is not available', |
65 | | - 'configure-old-changes' => 'changes', |
66 | | - 'configure-old-summary' => '$1 by $2 $4 $3', |
| 65 | + 'configure-old-changes' => 'changes', |
| 66 | + 'configure-old-summary' => '$1 by $2 $4 $3', |
67 | 67 | 'configure-saved' => 'The configuration has been saved', |
68 | 68 | 'configure-backlink' => 'Return to form', |
69 | | - 'configure-section-robots' => 'Web crawlers', |
| 69 | + 'configure-section-robots' => 'Web crawlers', |
70 | 70 | 'configure-section-features' => 'Features', |
71 | 71 | 'configure-section-general' => 'General settings', |
72 | 72 | 'configure-section-paths' => 'Paths', |
— | — | @@ -125,15 +125,18 @@ |
126 | 126 | 'configure-section-copyright' => 'Copyright', |
127 | 127 | 'configure-section-htcp' => 'HTCP multicast', |
128 | 128 | 'configure-section-misc' => 'Miscellaneous', |
129 | | - 'configure-section-filter' => 'Filtering', |
| 129 | + 'configure-section-filter' => 'Filtering', |
130 | 130 | 'configure-section-mw-extensions' => 'MediaWiki extensions', |
131 | 131 | 'configure-section-external-tools' => 'External tools', |
132 | 132 | 'configure-section-filesystem' => 'Filesystem and Shell interaction', |
133 | 133 | 'configure-section-thumbnail' => 'Image thumbnailing', |
134 | | - 'configure-section-output' => 'Output', |
| 134 | + 'configure-section-output' => 'Output', |
135 | 135 | 'configure-select-wiki' => 'Wiki selection', |
136 | 136 | 'configure-select-wiki-available' => 'Authorized values: $1', |
137 | 137 | 'configure-select-wiki-desc' => 'Select the wiki you want to configure.', |
| 138 | + 'configure-select-wiki-view-desc' => 'Select a wiki for which you want to see the versions.', |
| 139 | + 'configure-select-wiki-view-all' => 'All wikis', |
| 140 | + 'configure-select-wiki-view-specific' => 'Specific wiki:', |
138 | 141 | 'configure-select-wiki-submit' => 'Validate', |
139 | 142 | 'configure-setting-not-available' => 'This setting is not available in this version of MediaWiki', |
140 | 143 | 'configure-transwiki-not-in-range' => 'The requested wiki, $1, is not in allowed values ($2).', |
— | — | @@ -141,7 +144,7 @@ |
142 | 145 | 'configure-view-all-versions' => 'Full list of versions', |
143 | 146 | 'configure-view-default' => 'Default settings', |
144 | 147 | 'configure-view-not-allowed' => 'You are not allowed to see this setting', |
145 | | - 'configure-viewconfig-line' => '$1 $2 by $3 $5: $4', |
| 148 | + 'configure-viewconfig-line' => '$1 $2 by $3 $5: $4', |
146 | 149 | 'extensions' => 'Configure the extensions', |
147 | 150 | 'right-configure' => 'Configure the wiki', |
148 | 151 | 'right-configure-all' => 'Configure all wiki settings', |
— | — | @@ -1113,6 +1116,9 @@ |
1114 | 1117 | 'configure-select-wiki-available' => 'Valeurs autorisées : $1', |
1115 | 1118 | 'configure-select-wiki-desc' => 'Sélectionnez le wiki que vous voulez configurer.', |
1116 | 1119 | 'configure-select-wiki-submit' => 'Valider', |
| 1120 | + 'configure-select-wiki-view-desc' => 'Sélectionnez le wiki pour lequel vous voulez voir les versions.', |
| 1121 | + 'configure-select-wiki-view-all' => 'Tous les wikis', |
| 1122 | + 'configure-select-wiki-view-specific' => 'Un wiki spécifique :', |
1117 | 1123 | 'configure-setting-not-available' => "Ce paramètre n'est pas disponible sur cette version de MediaWiki", |
1118 | 1124 | 'configure-transwiki-not-in-range' => "Le wiki demandé, $1, n'est pas dans les valeurs autorisées ($2).", |
1119 | 1125 | 'configure-view' => 'Voir', |
Index: trunk/extensions/Configure/Configure.pager-db.php |
— | — | @@ -8,7 +8,7 @@ |
9 | 9 | * @author Alexandre Emsenhuber |
10 | 10 | */ |
11 | 11 | class ConfigurationPagerDb extends ReverseChronologicalPager { |
12 | | - protected $mHandler, $mCallback, $mCounter = 0; |
| 12 | + protected $mHandler, $mCallback, $mCounter = 0, $mWiki = false; |
13 | 13 | |
14 | 14 | function __construct( ConfigureHandlerDb $handler ) { |
15 | 15 | parent::__construct(); |
— | — | @@ -16,14 +16,22 @@ |
17 | 17 | $this->mDb = $handler->getSlaveDB(); |
18 | 18 | } |
19 | 19 | |
| 20 | + function setWiki( $wiki ) { |
| 21 | + $this->mWiki = $wiki; |
| 22 | + } |
| 23 | + |
20 | 24 | function getQueryInfo() { |
21 | | - $queryInfo = array( |
| 25 | + $conds = array(); |
| 26 | + if( $this->mWiki ) { |
| 27 | + $conds['cv_wiki'] = $this->mWiki; |
| 28 | + } |
| 29 | + |
| 30 | + return array( |
22 | 31 | 'tables' => array( 'config_version' ), |
23 | 32 | 'fields' => array( '*' ), |
24 | | - 'conds' => array(), |
| 33 | + 'conds' => $conds, |
25 | 34 | 'options' => array() |
26 | 35 | ); |
27 | | - return $queryInfo; |
28 | 36 | } |
29 | 37 | |
30 | 38 | function getIndexField() { |
Index: trunk/extensions/Configure/Configure.pager-files.php |
— | — | @@ -7,14 +7,25 @@ |
8 | 8 | * @author Alexandre Emsenhuber |
9 | 9 | */ |
10 | 10 | class ConfigurationPagerFiles implements Pager { |
11 | | - protected $mHandler, $mCallback; |
| 11 | + protected $mHandler, $mCallback, $mWiki = false; |
12 | 12 | |
13 | 13 | function __construct( ConfigureHandler $handler ) { |
14 | 14 | $this->mHandler = $handler; |
15 | 15 | } |
16 | 16 | |
| 17 | + function setWiki( $wiki ) { |
| 18 | + $this->mWiki = $wiki; |
| 19 | + } |
| 20 | + |
| 21 | + function getVersionOptions() { |
| 22 | + $ret = array(); |
| 23 | + if( $this->mWiki ) |
| 24 | + $ret['wiki'] = $this->mWiki; |
| 25 | + return $ret; |
| 26 | + } |
| 27 | + |
17 | 28 | function getBody() { |
18 | | - $versions = $this->mHandler->getArchiveVersions(); |
| 29 | + $versions = $this->mHandler->getArchiveVersions( $this->getVersionOptions() ); |
19 | 30 | if ( empty( $versions ) ) { |
20 | 31 | return wfMsgExt( 'configure-no-old', array( 'parse' ) ); |
21 | 32 | } |
— | — | @@ -39,13 +50,17 @@ |
40 | 51 | } |
41 | 52 | |
42 | 53 | function getNumRows() { |
43 | | - return count( $this->mHandler->listArchiveVersions() ); |
| 54 | + return count( $this->mHandler->listArchiveVersions( $this->getVersionOptions() ) ); |
44 | 55 | } |
45 | 56 | |
46 | 57 | function getNavigationBar() { |
47 | 58 | return ''; |
48 | 59 | } |
49 | 60 | |
| 61 | + function getSearchForm() { |
| 62 | + return ''; |
| 63 | + } |
| 64 | + |
50 | 65 | function setFormatCallback( $callback ) { |
51 | 66 | $this->mCallback = $callback; |
52 | 67 | } |