From: Aaron Schulz Date: Fri, 5 Sep 2008 18:03:42 +0000 (+0000) Subject: Add level select (bug 12961) X-Git-Tag: 1.31.0-rc.0~45460 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=b791252b113a453c8e05aa7592998656ea593761;p=lhc%2Fweb%2Fwiklou.git Add level select (bug 12961) --- diff --git a/includes/specials/SpecialProtectedtitles.php b/includes/specials/SpecialProtectedtitles.php index 2ec68a66b2..390103e12a 100644 --- a/includes/specials/SpecialProtectedtitles.php +++ b/includes/specials/SpecialProtectedtitles.php @@ -102,7 +102,7 @@ class ProtectedTitlesForm { Xml::element( 'legend', array(), wfMsg( 'protectedtitles' ) ) . Xml::hidden( 'title', $special ) . " \n" . $this->getNamespaceMenu( $namespace ) . " \n" . - // $this->getLevelMenu( $level ) . "
\n" . + $this->getLevelMenu( $level ) . " \n" . " " . Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "\n" . ""; } @@ -137,7 +137,10 @@ class ProtectedTitlesForm { $m[$text] = $type; } } - + // Is there only one level (aside from "all")? + if( count($m) <= 2 ) { + return ''; + } // Third pass generates sorted XHTML content foreach( $m as $text => $type ) { $selected = ($type == $pr_level ); @@ -190,7 +193,8 @@ class ProtectedtitlesPager extends AlphabeticPager { function getQueryInfo() { $conds = $this->mConds; $conds[] = 'pt_expiry>' . $this->mDb->addQuotes( $this->mDb->timestamp() ); - + if( $this->level ) + $conds['pt_create_perm'] = $this->level; if( !is_null($this->namespace) ) $conds[] = 'pt_namespace=' . $this->mDb->addQuotes( $this->namespace ); return array(