Skip to content

Commit

Permalink
Allow viewing of locked wikis
Browse files Browse the repository at this point in the history
  • Loading branch information
AgentIsai authored Sep 16, 2024
1 parent 61869c2 commit b2949d2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions includes/SpecialWikiDiscover.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public function execute( $subPage ) {
$stateOptions = [
'(any)' => 'any',
'Active' => 'active',
'Locked' => 'locked',
];

if ( $this->getConfig()->get( 'CreateWikiUseClosedWikis' ) ) {
Expand Down
6 changes: 5 additions & 1 deletion includes/WikiDiscoverWikisPager.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ public function formatValue( $name, $value ) {
case 'wiki_closed':
if ( $wikiDiscover->isDeleted( $wiki ) ) {
$formatted = 'Deleted';
} elseif ( $wikiDiscover->isLocked( $wiki ) ) {
$formatted = 'Locked';
} elseif ( $wikiDiscover->isClosed( $wiki ) ) {
$formatted = 'Closed';
} elseif ( $wikiDiscover->isInactive( $wiki ) ) {
Expand Down Expand Up @@ -178,7 +180,7 @@ public function getQueryInfo() {

$info = [
'tables' => [ 'cw_wikis' ],
'fields' => array_merge( [ 'wiki_dbname', 'wiki_language', 'wiki_deleted', 'wiki_category', 'wiki_creation' ], $fields ),
'fields' => array_merge( [ 'wiki_dbname', 'wiki_language', 'wiki_deleted', 'wiki_locked', 'wiki_category', 'wiki_creation' ], $fields ),
'conds' => [],
'joins_conds' => [],
];
Expand All @@ -194,6 +196,8 @@ public function getQueryInfo() {
if ( $this->state && $this->state !== 'any' ) {
if ( $this->state === 'deleted' ) {
$info['conds']['wiki_deleted'] = 1;
} elseif ( $this->state === 'locked' ) {
$info['conds']['wiki_locked'] = 1;
} elseif ( $config->get( 'CreateWikiUseClosedWikis' ) && $this->state === 'closed' ) {
$info['conds']['wiki_closed'] = 1;
$info['conds']['wiki_deleted'] = 0;
Expand Down

0 comments on commit b2949d2

Please sign in to comment.