r35242 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r35241‎ | r35242 | r35243 >
Date:19:08, 23 May 2008
Author:ialex
Status:old
Tags:
Comment:
* Link setting to documentation on www.mediawiki.org
* Added $wgMaximumMovedPages
* $wgSitemapNamespaces now looks like other namespace settings
Modified paths:
  • /trunk/extensions/Configure/CHANGELOG (modified) (history)
  • /trunk/extensions/Configure/Configure.css (modified) (history)
  • /trunk/extensions/Configure/Configure.php (modified) (history)
  • /trunk/extensions/Configure/Configure.settings.php (modified) (history)
  • /trunk/extensions/Configure/SpecialConfigure.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Configure/Configure.settings.php
@@ -1,6 +1,5 @@
22 <?php
33 if ( !defined( 'MEDIAWIKI' ) ) die();
4 -
54 /**
65 * @file
76 * @ingroup Extensions
@@ -341,6 +340,14 @@
342341 'wgSpamRegex' => 'text',
343342 'wgWhitelistRead' => 'array',
344343 ),
 344+ 'block' => array(
 345+ 'wgBlockAllowsUTEdit' => 'bool',
 346+ 'wgSysopEmailBans' => 'bool',
 347+ 'wgSysopRangeBans' => 'bool',
 348+ 'wgSysopUserBans' => 'bool',
 349+ ),
 350+ ),
 351+ 'groups' => array(
345352 'groups' => array(
346353 'wgGroupPermissions' => 'array',
347354 'wgAddGroups' => 'array',
@@ -348,12 +355,6 @@
349356 'wgGroupsAddToSelf' => 'array',
350357 'wgGroupsRemoveFromSelf' => 'array',
351358 ),
352 - 'block' => array(
353 - 'wgBlockAllowsUTEdit' => 'bool',
354 - 'wgSysopEmailBans' => 'bool',
355 - 'wgSysopRangeBans' => 'bool',
356 - 'wgSysopUserBans' => 'bool',
357 - ),
358359 ),
359360 'rates' => array(
360361 'rates' => array(
@@ -408,6 +409,7 @@
409410 'wgDisableSearchUpdate' => 'bool',
410411 'wgDisableTextSearch' => 'bool',
411412 'wgAPIMaxDBRows' => 'int',
 413+ 'wgMaximumMovedPages' => 'int',
412414 'wgMiserMode' => 'bool',
413415 'wgShowHostnames' => 'bool',
414416 'wgUseDumbLinkUpdate' => 'bool',
@@ -676,10 +678,11 @@
677679 *
678680 * Types used:
679681 * - simple: single dimension array with numeric key
680 - * - assoc: single dimension array with associative key => val
681 - * - ns-bool: single dimension array with namespaces numbers in the key and a
682 - * boolean value
683 - * - ns-text: same as ns-bool but with a string in the value
 682+ * - assoc: single dimension array with associative key => val
 683+ * - ns-bool: single dimension array with namespaces numbers in the key and a
 684+ * boolean value
 685+ * - ns-text: same as ns-bool but with a string in the value
 686+ * - ns-simple: like simple, but values are restricted to namespaces index
684687 * - group-bool: two dimensions array with group name in first key, right name
685688 * in the second and boolean value
686689 * - group-array: two dimensions array with group name in first key and then
@@ -719,6 +722,7 @@
720723 'wgNamespacesWithSubpages' => 'ns-bool',
721724 'wgNoFollowNsExceptions' => 'ns-text',
722725 'wgNonincludableNamespaces' => 'ns-bool',
 726+ 'wgSitemapNamespaces' => 'ns-simple',
723727 'wgArticleRobotPolicies' => 'assoc',
724728 # Skins
725729 'wgSkipSkins' => 'simple',
@@ -798,7 +802,6 @@
799803 'wgGrammarForms' => 'array',
800804 'wgRedirectSources' => 'simple',
801805 'wgRestrictionTypes' => 'simple',
802 - 'wgSitemapNamespaces' => 'simple',
803806 );
804807
805808 /**
@@ -1097,6 +1100,7 @@
10981101 'wgRCFilterByAge' => array( array( '1.13alpha', '>=' ) ),
10991102 'wgRCLinkLimits' => array( array( '1.13alpha', '>=' ) ),
11001103 'wgRCLinkDays' => array( array( '1.13alpha', '>=' ) ),
 1104+ 'wgMaximumMovedPages' => array( array( '1.13alpha', '>=' ) ),
11011105 ## Obsolete
11021106 'wgProfileSampleRate' => array( array( '1.8alpha', '<' ) ),
11031107 'wgProfilerType' => array( array( '1.8alpha', '<' ) ),
Index: trunk/extensions/Configure/CHANGELOG
@@ -1,6 +1,11 @@
22 This file lists changes on this extension.
33 Localisation updates are done on betawiki and aren't listed here.
44
 5+0.3.3 - 23 May 2008
 6+ * Link setting to documentation on www.mediawiki.org
 7+ * Added $wgMaximumMovedPages
 8+ * $wgSitemapNamespaces now looks like other namespace settings
 9+
510 0.3.2 - 22 May 2008
611 Added Special:ViewConfig to allow sysop by default to see the current
712 configuration
Index: trunk/extensions/Configure/Configure.php
@@ -17,15 +17,20 @@
1818 'url' => 'http://www.mediawiki.org/wiki/Extension:Configure',
1919 'description' => 'Allow authorised users to configure the wiki by a web-based interface',
2020 'descriptionmsg' => 'configure-desc',
21 - 'version' => '0.3.2',
 21+ 'version' => '0.3.3',
2222 );
2323
2424 ## Adding new rights...
2525 $wgAvailableRights[] = 'configure';
2626 $wgAvailableRights[] = 'configure-all';
 27+$wgAvailableRights[] = 'viewconfig';
 28+$wgAvailableRights[] = 'viewconfig-all';
 29+
 30+## Rights for Special:Configure
2731 $wgGroupPermissions['bureaucrat']['configure'] = true;
2832 #$wgGroupPermissions['developer']['configure-all'] = true;
2933
 34+## Rights for Special:ViewConfig
3035 $wgGroupPermissions['sysop']['viewconfig'] = true;
3136 $wgGroupPermissions['bureaucrat']['viewconfig-all'] = true;
3237
@@ -54,4 +59,4 @@
5560 $wgConfigureFilesPath = "$IP/serialized";
5661
5762 ## Styles versions
58 -$wgConfigureStyleVersion = '1';
\ No newline at end of file
 63+$wgConfigureStyleVersion = '2';
\ No newline at end of file
Index: trunk/extensions/Configure/Configure.css
@@ -29,6 +29,19 @@
3030 }
3131
3232 /**
 33+ * links
 34+ */
 35+a.configure-doc,
 36+a.configure-doc:hover,
 37+a.configure-doc:active {
 38+ color: #021488;
 39+}
 40+
 41+a.configure-doc:visited {
 42+ color: #0318d8;
 43+}
 44+
 45+/**
3346 * disabled settings
3447 */
3548 td.disabled > hr {
Index: trunk/extensions/Configure/SpecialConfigure.php
@@ -285,6 +285,15 @@
286286 }
287287 $settings[$name] = $arr;
288288 break;
 289+ case 'ns-simple':
 290+ global $wgContLang;
 291+ $arr = array();
 292+ foreach( $wgContLang->getNamespaces() as $ns => $unused ){
 293+ if( $wgRequest->getCheck( 'wp' . $name . '-ns' . strval( $ns ) ) )
 294+ $arr[] = $ns;
 295+ }
 296+ $settings[$name] = $arr;
 297+ break;
289298 case 'ns-array':
290299 global $wgContLang;
291300 $arr = array();
@@ -653,7 +662,7 @@
654663 $text .= "</textarea>\n";
655664 return $text;
656665 }
657 - if( $type == 'ns-bool' ){
 666+ if( $type == 'ns-bool' || $type == 'ns-simple' ){
658667 global $wgContLang;
659668 $text = '';
660669 $attr = ( !$allowed ) ? array( 'disabled' => 'disabled' ) : array();
@@ -662,11 +671,16 @@
663672 if( '' == $name ) {
664673 $name = wfMsgExt( 'blanknamespace', array( 'parseinline' ) );
665674 }
 675+ if( $type == 'ns-bool' ){
 676+ $checked = isset( $default[$ns] ) && $default[$ns];
 677+ } else {
 678+ $checked = in_array( $ns, (array)$default );
 679+ }
666680 $text .= Xml::checkLabel(
667681 $name,
668682 "wp{$conf}-ns{$ns}",
669683 "wp{$conf}-ns{$ns}",
670 - ( isset( $default[$ns] ) && $default[$ns] ),
 684+ $checked,
671685 $attr
672686 ) . "\n";
673687 }
@@ -790,7 +804,9 @@
791805 $msgVal = wfMsgExt( $msg, array( 'parseinline' ) );
792806 if( wfEmptyMsg( $msg, $msgVal ) )
793807 $msgVal = "\$$conf";
794 - $td1 = Xml::openElement( 'td', $align ) . $msgVal . '</td>';
 808+ $url = 'http://www.mediawiki.org/wiki/Manual:$' . $conf;
 809+ $link = Xml::element( 'a', array( 'href' => $url, 'class' => 'configure-doc' ), $msgVal );
 810+ $td1 = Xml::openElement( 'td', $align ) . $link . '</td>';
795811 if( $this->isSettingAvailable( $conf ) )
796812 $td2 = Xml::openElement( 'td', $align ) . $this->buildInput( $conf, $type, $default ) . '</td>';
797813 else

Status & tagging log