Index: trunk/extensions/Configure/Configure.page.php |
— | — | @@ -210,11 +210,11 @@ |
211 | 211 | static $notEditable; |
212 | 212 | if ( !isset( $notEditable ) ) { |
213 | 213 | global $wgConfigureNotEditableSettings, $wgConfigureEditableSettings; |
214 | | - |
| 214 | + |
215 | 215 | if ( !count($wgConfigureNotEditableSettings) && count($wgConfigureEditableSettings ) ) { |
216 | 216 | $wgConfigureNotEditableSettings = array_diff( array_keys( $this->mConfSettings->getAllSettings() ), $wgConfigureEditableSettings ); |
217 | 217 | } |
218 | | - |
| 218 | + |
219 | 219 | $notEditable = array_merge( $this->mConfSettings->getUneditableSettings(), |
220 | 220 | $wgConfigureNotEditableSettings ); |
221 | 221 | } |
— | — | @@ -351,7 +351,7 @@ |
352 | 352 | $diffLink = ''; |
353 | 353 | if ($prev) |
354 | 354 | $diffLink = '(' . $skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'ViewConfig' ), wfMsg( 'configure-old-changes' ), "version=$ts&diff=$prev" ) . ')'; |
355 | | - |
| 355 | + |
356 | 356 | ## Make user link... |
357 | 357 | $userLink = ''; |
358 | 358 | if( !$data['userwiki'] || !$data['username'] ) { |
— | — | @@ -364,15 +364,15 @@ |
365 | 365 | ## Last-ditch |
366 | 366 | $userLink = $data['username'].'@'.$data['userwiki']; |
367 | 367 | } |
368 | | - |
| 368 | + |
369 | 369 | $text = wfMsgExt( 'configure-old-summary', array( 'replaceafter', 'parseinline'), array( $link, $userLink, $diffLink ) ); |
370 | | - |
| 370 | + |
371 | 371 | $prev = $ts; |
372 | | - |
| 372 | + |
373 | 373 | $links[] = $text; |
374 | 374 | } |
375 | 375 | } |
376 | | - |
| 376 | + |
377 | 377 | ## Reset into descending order |
378 | 378 | $links = array_reverse( $links ); |
379 | 379 | ## Take out the first ten... |
— | — | @@ -389,7 +389,7 @@ |
390 | 390 | } |
391 | 391 | $link = SpecialPage::getTitleFor( 'ViewConfig' ); |
392 | 392 | $text .= $skin->makeKnownLinkObj( $link, wfMsgHtml( 'configure-view-all-versions' ) ); |
393 | | - |
| 393 | + |
394 | 394 | $text .= '</fieldset>'; |
395 | 395 | return $text; |
396 | 396 | } |
— | — | @@ -449,7 +449,7 @@ |
450 | 450 | case 'assoc': |
451 | 451 | $i = 0; |
452 | 452 | $arr = array(); |
453 | | - while ( isset( $_REQUEST['wp' . $name . '-key-' . $i] ) && |
| 453 | + while ( isset( $_REQUEST['wp' . $name . '-key-' . $i] ) && |
454 | 454 | isset( $_REQUEST['wp' . $name . '-val-' . $i] ) ) |
455 | 455 | { |
456 | 456 | $key = $_REQUEST['wp' . $name . '-key-' . $i]; |
— | — | @@ -539,7 +539,7 @@ |
540 | 540 | if ( $arrType == 'group-bool' ) { |
541 | 541 | $encId = Sanitizer::escapeId( $id ); |
542 | 542 | if ( $id != $encId ) { |
543 | | - $val = $wgRequest->getCheck( str_replace( '.', '_', $encId ) ) || |
| 543 | + $val = $wgRequest->getCheck( str_replace( '.', '_', $encId ) ) || |
544 | 544 | $wgRequest->getCheck( $encId ) || $wgRequest->getCheck( $id ); |
545 | 545 | } else { |
546 | 546 | $val = $wgRequest->getCheck( $id ); |
— | — | @@ -679,7 +679,7 @@ |
680 | 680 | $this->buildOldVersionSelect() . "\n" . |
681 | 681 | ( $this->mCanEdit ? |
682 | 682 | $this->getWikiSelectForm() . |
683 | | - Xml::openElement( 'form', array( 'method' => 'post', 'action' => $action, |
| 683 | + Xml::openElement( 'form', array( 'method' => 'post', 'action' => $action, |
684 | 684 | 'id' => 'configure-form' ) ) . "\n" : |
685 | 685 | Xml::openElement( 'div', array( 'id' => 'configure-form' ) ) |
686 | 686 | ) . |
— | — | @@ -689,9 +689,9 @@ |
690 | 690 | Xml::openElement( 'div', array( 'id' => 'prefsubmit' ) ) . "\n" . |
691 | 691 | Xml::openElement( 'div', array() ) . "\n" . |
692 | 692 | Xml::hidden( 'wpEditToken', $wgUser->editToken() ) . "\n" . |
693 | | - Xml::element( 'input', array( 'type' => 'submit', 'name' => 'wpSave', |
| 693 | + Xml::element( 'input', array( 'type' => 'submit', 'name' => 'wpSave', |
694 | 694 | 'class' => 'btnSavePrefs', 'value' => wfMsgHtml( 'configure-btn-save' ) ) ) . "\n" . |
695 | | - Xml::element( 'input', array( 'type' => 'submit', 'name' => 'wpPreview', |
| 695 | + Xml::element( 'input', array( 'type' => 'submit', 'name' => 'wpPreview', |
696 | 696 | 'value' => wfMsgHtml( 'showdiff' ) ) ) . "\n" . |
697 | 697 | Xml::closeElement( 'div' ) . "\n" . |
698 | 698 | Xml::closeElement( 'div' ) . "\n" . |
— | — | @@ -699,7 +699,7 @@ |
700 | 700 | 'value' => $wgUser->editToken() ) ) . "\n" . |
701 | 701 | ( $this->mWiki ? Xml::element( 'input', array( 'type' => 'hidden', 'name' => 'wpWiki', |
702 | 702 | 'value' => $this->mWiki ) ) . "\n" : '' ) |
703 | | - : '' |
| 703 | + : '' |
704 | 704 | ) . |
705 | 705 | Xml::closeElement( 'div' ) . "\n" . |
706 | 706 | Xml::closeElement( $this->mCanEdit ? 'form' : 'div' ) |
— | — | @@ -864,24 +864,24 @@ |
865 | 865 | } |
866 | 866 | if ( $type == 'assoc' ) { |
867 | 867 | ## See if the key/value has a special description |
868 | | - |
| 868 | + |
869 | 869 | $keydesc = wfMsgExt( "configure-setting-$conf-key", 'parseinline' ); |
870 | 870 | $valdesc = wfMsgExt( "configure-setting-$conf-value", 'parseinline' ); |
871 | | - |
| 871 | + |
872 | 872 | if (wfEmptyMsg( "configure-setting-$conf-key", $keydesc )) |
873 | 873 | $keydesc = wfMsgHtml( 'configure-desc-key' ); |
874 | 874 | if (wfEmptyMsg( "configure-setting-$conf-value", $valdesc )) |
875 | 875 | $valdesc = wfMsgHtml( 'configure-desc-val' ); |
876 | | - |
| 876 | + |
877 | 877 | $classes = array('configure-array-table'); |
878 | | - |
| 878 | + |
879 | 879 | $classes[] = ($allowed ? 'assoc' : 'assoc disabled'); |
880 | 880 | if (count($default) > 5) |
881 | 881 | $classes[] = 'configure-biglist'; |
882 | | - |
| 882 | + |
883 | 883 | if ( !$allowed ) |
884 | 884 | $classes[] = 'disabled'; |
885 | | - |
| 885 | + |
886 | 886 | $text = Xml::openElement( 'table', array( 'class' => ( implode( ' ', $classes ) ), |
887 | 887 | 'id' => $conf ) ) . "\n"; |
888 | 888 | $text .= "<tr><th>{$keydesc}</th><th>{$valdesc}</th></tr>\n"; |
— | — | @@ -974,7 +974,7 @@ |
975 | 975 | global $wgContLang; |
976 | 976 | $nsdesc = wfMsgHtml( 'configure-desc-ns' ); |
977 | 977 | $valdesc = wfMsgExt( "configure-setting-$conf-value", 'parseinline' ); |
978 | | - |
| 978 | + |
979 | 979 | if (wfEmptyMsg( "configure-setting-$conf-value", $valdesc )) |
980 | 980 | $valdesc = wfMsgHtml( 'configure-desc-val' ); |
981 | 981 | $text = "<table class='configure-array-table ns-text configure-biglist'>\n<tr><th>{$nsdesc}</th><th>{$valdesc}</th></tr>\n"; |
— | — | @@ -1001,7 +1001,7 @@ |
1002 | 1002 | global $wgContLang; |
1003 | 1003 | $nsdesc = wfMsgHtml( 'configure-desc-ns' ); |
1004 | 1004 | $valdesc = wfMsgExt( "configure-setting-$conf-value", 'parseinline' ); |
1005 | | - |
| 1005 | + |
1006 | 1006 | if (wfEmptyMsg( "configure-setting-$conf-value", $valdesc )) |
1007 | 1007 | $valdesc = wfMsgHtml( 'configure-desc-val' ); |
1008 | 1008 | $text = "<table class='ns-array configure-biglist configure-array-table'>\n<tr><th>{$nsdesc}</th><th>{$valdesc}</th></tr>\n"; |
— | — | @@ -1022,7 +1022,7 @@ |
1023 | 1023 | ( isset( $default[$ns] ) ? implode( "\n", (array)$default[$ns] ) : '' ) . |
1024 | 1024 | Xml::closeElement( 'textarea' ) . "<br/>\n"; |
1025 | 1025 | } else { |
1026 | | - $text .= "<pre>" . ( isset( $default[$ns] ) ? |
| 1026 | + $text .= "<pre>" . ( isset( $default[$ns] ) ? |
1027 | 1027 | htmlspecialchars( implode( "\n", (array)$default[$ns] ) ) : '' ) . "\n</pre>"; |
1028 | 1028 | } |
1029 | 1029 | $text .= '</td></tr>'; |
— | — | @@ -1047,7 +1047,7 @@ |
1048 | 1048 | } |
1049 | 1049 | $groupdesc = wfMsgHtml( 'configure-desc-group' ); |
1050 | 1050 | $valdesc = wfMsgExt( "configure-setting-$conf-value", 'parseinline' ); |
1051 | | - |
| 1051 | + |
1052 | 1052 | if (wfEmptyMsg( "configure-setting-$conf-value", $valdesc )) |
1053 | 1053 | $valdesc = wfMsgHtml( 'configure-desc-val' ); |
1054 | 1054 | $encConf = htmlspecialchars( $conf ); |
— | — | @@ -1157,9 +1157,8 @@ |
1158 | 1158 | if ( !count( $groups[$name] ) ) |
1159 | 1159 | unset( $groups[$name] ); |
1160 | 1160 | } |
1161 | | - |
| 1161 | + |
1162 | 1162 | $thisSection = ''; |
1163 | | - #echo "$title => "; var_dump( $res ); echo "<br/>\n"; |
1164 | 1163 | if ( !$res ) { |
1165 | 1164 | if ( !isset( $param['showlink'] ) ) { |
1166 | 1165 | $showlink = true; |
— | — | @@ -1190,12 +1189,12 @@ |
1191 | 1190 | ## Don't even show it. |
1192 | 1191 | } |
1193 | 1192 | } |
1194 | | - |
| 1193 | + |
1195 | 1194 | if ( $thisGroup ) { |
1196 | 1195 | $thisSection .= $this->buildTableHeading( $group ) . $thisGroup . Xml::closeElement( 'table' ); |
1197 | 1196 | } |
1198 | 1197 | } |
1199 | | - |
| 1198 | + |
1200 | 1199 | if ( $thisSection ) { |
1201 | 1200 | $thisSection = Xml::tags( 'legend', null, wfMsgExt( "configure-section-$title", array( 'parseinline' ) ) ) . $thisSection; |
1202 | 1201 | $ret .= Xml::tags( 'fieldset', null, $thisSection ); |
— | — | @@ -1203,7 +1202,6 @@ |
1204 | 1203 | } |
1205 | 1204 | |
1206 | 1205 | } |
1207 | | - #die; |
1208 | 1206 | return $ret; |
1209 | 1207 | } |
1210 | 1208 | } |