Extension talk:Lockdown/hiding pages

From MediaWiki.org
Jump to: navigation, search

Contents

[edit] Other patches

Note, that similar things should be done in a few other files...

I've done it in:

  • includes/SpecialBrokenRedirects.php -- in function formatResult (similar to Special:Listredirects patch):
  global $wgUser, $wgContLang;
+ if ( namespaceIsVisible( $result->namespace ) ) {
      $fromObj = Title::makeTitle( $result->namespace, $result->title );
      ...
+ }
  • includes/SpecialDoubleRedirects.php -- in function formatResult (similar to Special:Listredirects patch):
  global $wgContLang;
+ if ( namespaceIsVisible( $result->namespace ) ) {
      $fname = 'DoubleRedirectsPage::formatResult';
      ...
+ }
  • includes/SpecialWhatlinkshere.php -- in function showIndirectLinks in loop (similar to Special:Prefixindex patch):
  foreach ( $rows as $row )
+     if ( namespaceIsVisible( $row->page_namespace ) ) {
          $nt = Title::makeTitle( $row->page_namespace, $row->page_title );
          ...
+     }
  • includes/SpecialProtectedpages.php -- in function formatRow:
  ...
  if( is_null( $skin ) )
      $skin = $wgUser->getSkin();
+ if ( namespaceIsVisible( $row->page_namespace ) ) {
      $title = Title::makeTitleSafe( $row->page_namespace, $row->page_title );
      ...
+ }

--zuo (85.222.69.4 03:21, 20 April 2008 (UTC))


Please update the scripts for Mediawiki 1.16. They are needed. Thank you very much for your help guys!


[edit] Special:LinkSearch

/includes/specials/LinkSearch.php
function formatResult():
        function formatResult( $skin, $result ) {
+               if ( namespaceIsVisible( $result->namespace ) ) {

                        $title = Title::makeTitle( $result->namespace, $result->title );
                        $url = $result->url;
                        $pageLink = $skin->makeKnownLinkObj( $title );
                        $urlLink = $skin->makeExternalLink( $url, $url );

                        return wfMsgHtml( 'linksearch-line', $urlLink, $pageLink );
+               }else{
+                       return '';
+               }
        }
⇨ Dr Brains ∞ Doléances ∞ 13:35, 20 November 2010 (UTC)

[edit] Special:Contributions

/includes/specials/Contributions.php

[edit] Special Page

function formatRow():
+               if ( namespaceIsVisible( $page->getNamespace() ) ) {
                        return $ret;
+               }else{
+                       return ' ';
+               }
⇨ Dr Brains ∞ Doléances ∞ 13:35, 20 November 2010 (UTC)

[edit] RSS/Atom Feed Page

function feed():
                if( $pager->getNumRows() > 0 ) {
                        while( $row = $pager->mResult->fetchObject() ) {
+                               $title = Title::MakeTitle( intval( $row->page_namespace ), $row->page_title );
+                               if(namespaceIsVisible( $title->getNamespace() )){
                                        $feed->outItem( $this->feedItem( $row ) );
+                              }
                        }
                }
⇨ Dr Brains ∞ Doléances ∞ 13:35, 20 November 2010 (UTC)

[edit] Special:DeletedContributions

/includes/specials/DeletedContributions.php
function formatRow():
+               if ( namespaceIsVisible( $page->getNamespace() ) ) {
                        return $ret;
+               }else{
+                       return ' ';
+               }
⇨ Dr Brains ∞ Doléances ∞ 13:35, 20 November 2010 (UTC)

[edit] Special:Disambiguations

/includes/specials/Disambiguations.php
function formatResult()
        function formatResult( $skin, $result ) {
                global $wgContLang;
                $title = Title::newFromID( $result->value );
+               if ( namespaceIsVisible( $title->getNamespace() ) ) {

                        $dp = Title::makeTitle( $result->namespace, $result->title );

                        $from = $skin->link( $title );
                        $edit = $skin->link( $title, "(".wfMsgHtml("qbedit").")", array(), array( 'redirect' => 'no', 'action' => 'edit' ) );
                        $arr  = $wgContLang->getArrow();
                        $to   = $skin->link( $dp );

                        return "$from $edit $arr $to";
+               }else{
+                       return ' ';
+               }
        }

[edit] Extensions

[edit] Special:CategoryTree

/extensiosn/CategoryTree/CategoryTreeFunctions.php
function renderNodeInfo()
                $ns = $title->getNamespace();
+               if (!( namespaceIsVisible( $ns ) )) {
+                       return ' ';
+               }
                $key = $title->getDBkey();
⇨ Dr Brains ∞ Doléances ∞ 13:35, 20 November 2010 (UTC)

[edit] Special:Book

/extensiosn/Collection/Collection.body.php
static function addArticle( )
+               if (! namespaceIsVisible( $title->getNamespace()) ) return false;
                $article = new Article( $title, $oldid );
                $latest = $article->getLatest();
                ...
⇨ Dr Brains ∞ Doléances ∞ 17:25, 20 November 2010 (UTC)

[edit] Special:Nuke

/extensiosn/Nuke/SpecialNuke_body.php
function listForm()
                foreach( $pages as $info ) {
+                       if (namespaceIsVisible( $title->getNamespace()) ){
                                list( $title, $edits ) = $info;
                                $image = $title->getNamespace() == NS_IMAGE ? wfLocalFile( $title ) : false;
                                $thumb = $image && $image->exists() ? $image->getThumbnail( 120, 120 ) : false;

                                $changes = wfMsgExt( 'nchanges', 'parsemag', $wgLang->formatNum( $edits ) );
                        
                                $wgOut->addHTML( '<li>' .
                                        Xml::check( 'pages[]', true,
                                                array( 'value' =>  $title->getPrefixedDbKey() )
                                        ) .
                                        ' ' .
                                        ( $thumb ? $thumb->toHtml( array( 'desc-link' => true ) ) : '' ) .
                                        $sk->makeKnownLinkObj( $title ) .
                                        ' (' .
                                        $sk->makeKnownLinkObj( $title, $changes, 'action=history' ) .
                                        ")</li>\n" );
+                      }
                }
⇨ Dr Brains ∞ Doléances ∞ 17:31, 20 November 2010 (UTC)
Personal tools
Namespaces

Variants
Actions
Navigation
Support
Download
Development
Communication
Print/export
Toolbox