r43985 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43984‎ | r43985 | r43986 >
Date:19:32, 26 November 2008
Author:ialex
Status:resolved
Tags:
Comment:
unbreak Special:ViewConfig, no settings were shown
Modified paths:
  • /trunk/extensions/Configure/Configure.page.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Configure/Configure.page.php
@@ -1150,7 +1150,7 @@
11511151 }
11521152 $read = $this->userCanRead( $setting );
11531153 $edit = $this->userCanEdit( $setting );
1154 - if ( $edit )
 1154+ if ( $this->mCanEdit ? $edit : $read )
11551155 $res = false;
11561156 $perms[$setting] = array( 'read' => $read, 'edit' => $edit );
11571157 }
@@ -1159,8 +1159,8 @@
11601160 }
11611161
11621162 $thisSection = '';
 1163+ #echo "$title => "; var_dump( $res ); echo "<br/>\n";
11631164 if ( !$res ) {
1164 - $first = true;
11651165 if ( !isset( $param['showlink'] ) ) {
11661166 $showlink = true;
11671167 } elseif ( is_array( $param['showlink'] ) ) {
@@ -1181,8 +1181,10 @@
11821182 'value' => $this->getSettingValue( $setting ),
11831183 'link' => $showlink,
11841184 );
1185 - $canEdit = isset( $params['edit'] ) ? $params['edit'] : $this->userCanEdit( $setting );
1186 - if ($canEdit) {
 1185+ $show = $this->mCanEdit ?
 1186+ ( isset( $params['edit'] ) ? $params['edit'] : $this->userCanEdit( $setting ) ) :
 1187+ ( isset( $params['read'] ) ? $params['read'] : $this->userCanRead( $setting ) );
 1188+ if ( $show ) {
11871189 $thisGroup .= $this->buildTableRow( $setting, $params );
11881190 } else {
11891191 ## Don't even show it.
@@ -1191,7 +1193,6 @@
11921194
11931195 if ( $thisGroup ) {
11941196 $thisSection .= $this->buildTableHeading( $group ) . $thisGroup . Xml::closeElement( 'table' );
1195 - $first = false;
11961197 }
11971198 }
11981199
@@ -1202,6 +1203,7 @@
12031204 }
12041205
12051206 }
 1207+ #die;
12061208 return $ret;
12071209 }
12081210 }

Status & tagging log