r40503 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40502‎ | r40503 | r40504 >
Date:18:03, 5 September 2008
Author:aaron
Status:old
Tags:
Comment:
Add level select (bug 12961)
Modified paths:
  • /trunk/phase3/includes/specials/SpecialProtectedtitles.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialProtectedtitles.php
@@ -102,7 +102,7 @@
103103 Xml::element( 'legend', array(), wfMsg( 'protectedtitles' ) ) .
104104 Xml::hidden( 'title', $special ) . " \n" .
105105 $this->getNamespaceMenu( $namespace ) . " \n" .
106 - // $this->getLevelMenu( $level ) . "<br/>\n" .
 106+ $this->getLevelMenu( $level ) . "&nbsp;\n" .
107107 "&nbsp;" . Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "\n" .
108108 "</fieldset></form>";
109109 }
@@ -137,7 +137,10 @@
138138 $m[$text] = $type;
139139 }
140140 }
141 -
 141+ // Is there only one level (aside from "all")?
 142+ if( count($m) <= 2 ) {
 143+ return '';
 144+ }
142145 // Third pass generates sorted XHTML content
143146 foreach( $m as $text => $type ) {
144147 $selected = ($type == $pr_level );
@@ -190,7 +193,8 @@
191194 function getQueryInfo() {
192195 $conds = $this->mConds;
193196 $conds[] = 'pt_expiry>' . $this->mDb->addQuotes( $this->mDb->timestamp() );
194 -
 197+ if( $this->level )
 198+ $conds['pt_create_perm'] = $this->level;
195199 if( !is_null($this->namespace) )
196200 $conds[] = 'pt_namespace=' . $this->mDb->addQuotes( $this->namespace );
197201 return array(