* Removing Special:Licensesearch
authorÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Sun, 18 Sep 2005 15:26:31 +0000 (15:26 +0000)
committerÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Sun, 18 Sep 2005 15:26:31 +0000 (15:26 +0000)
includes/SpecialLicensesearch.php [deleted file]
includes/SpecialPage.php
languages/Language.php

diff --git a/includes/SpecialLicensesearch.php b/includes/SpecialLicensesearch.php
deleted file mode 100644 (file)
index 4e0ce37..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-<?php
-/**
- * Search for pages in NS_IMAGE that link to a certain page in NS_TEMPLATE
- *
- * @package MediaWiki
- * @subpackage SpecialPage
- *
- * @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
- */
-
-/* */
-require_once 'QueryPage.php';
-
-/**
- * @package MediaWiki
- * @subpackage SpecialPage
- */
-class LicensesearchPage extends QueryPage {
-       var $license;
-
-       function LicensesearchPage( $license ) {
-               $this->license = $license;
-       }
-       
-       function getName() { return 'Licensesearch'; }
-       
-       /**
-        * Due to this page relying upon extra fields being passed in the SELECT it
-        * will fail if it's set as expensive and misermode is on
-        */
-       function isExpensive() { return false; }
-       function isSyndicated() { return false; }
-       
-       function linkParameters() {
-               return array( 'license' => $this->license );
-       }
-
-       function getSQL() {
-               $dbr =& wfGetDB( DB_SLAVE );
-               extract( $dbr->tableNames( 'page', 'pagelinks' ) );
-               $license = $dbr->addQuotes( $this->license );
-               
-               return
-                       "SELECT 'Licensesearch' as type,
-                               " . NS_IMAGE . " as namespace,
-                               page_title as title,
-                               page_title as value
-                       FROM $pagelinks
-                       LEFT JOIN $page ON page_id = pl_from
-                       WHERE page_namespace = " . NS_IMAGE . " AND pl_namespace = " . NS_TEMPLATE  . " AND pl_title = $license
-                       ";
-       }
-
-       function formatResult( $skin, $result ) {
-               global $wgContLang;
-
-               $nt = Title::makeTitle( $result->namespace, $result->title );
-               $text = $wgContLang->convert( $nt->getText() );
-               $plink = $skin->makeLink( $nt->getPrefixedText(), $text );
-
-               return $plink;
-       }
-}
-
-/**
- * constructor
- */
-function wfSpecialLicensesearch( $par = null ) {
-       global $wgRequest, $wgTitle, $wgOut;
-
-       $license = isset( $par ) ? $par : $wgRequest->getText( 'license' );
-       $license = Title::newFromText( $license );
-       $license = is_object( $license ) ? $license->getText() : '';
-       
-       $wgOut->addHTML(
-               wfElement( 'form',
-                       array(
-                               'id' => 'speciallicensesearch',
-                               'method' => 'get',
-                               'action' => $wgTitle->escapeLocalUrl()
-                       ),
-                       null
-               ) .
-                       wfOpenElement( 'label' ) .
-                               wfMsgHtml( 'licensesearch_license' ) .
-                               wfElement( 'input', array(
-                                               'type' => 'text',
-                                               'size' => 20,
-                                               'name' => 'license',
-                                               'value' => $license
-                                       ),
-                                       ''
-                               ) .
-                               ' ' .
-                               wfElement( 'input', array(
-                                               'type' => 'submit',
-                                               'value' => wfMsg( 'ilsubmit' )
-                                       ),
-                                       ''
-                               ) .
-                       wfCloseElement( 'label' ) .
-               wfCloseElement( 'form' )
-       );
-
-       if ( $license == '' )
-               return;
-
-       $license = wfSpecialLicensesearchLicense( $license );
-       $wpp = new LicensesearchPage( $license );
-       
-       list( $limit, $offset ) = wfCheckLimits();
-       $wpp->doQuery( $offset, $limit );
-}
-
-function wfSpecialLicensesearchLicense( $license ) {
-       $aliases = wfSpecialLicensesearchLicenseParser();
-       
-       if ( @$aliases[$license] !== null )
-               return $aliases[$license];
-       else
-               return $license;
-}
-
-function wfSpecialLicensesearchLicenseParser() {
-       $aliases = array();
-       
-       $licenses = explode( "\n", wfMsgForContent( 'licensesearch_licenses' ) );
-       foreach ($licenses as $line) {
-               if ( strpos( $line, '*' ) !== 0 || strpos( $line, '|' ) === false)
-                       continue;
-               else {
-                       $line = ltrim( $line, '* ' );
-                       list( $template, $alias ) = explode( '|', $line, 2 );
-                       $aliases[$alias] = $template;
-               }
-       }
-
-       return $aliases;
-}
-?>
index 6b60b9e..9133f8e 100644 (file)
@@ -71,7 +71,6 @@ $wgSpecialPages = array(
        'Unlockdb'              => new SpecialPage( 'Unlockdb', 'siteadmin' ),
        'Userrights'    => new SpecialPage( 'Userrights', 'userrights' ),
        'MIMEsearch'    => new SpecialPage( 'MIMEsearch' ),
-       'Licensesearch' => new SpecialPage( 'Licensesearch' ),
 );
 
 if ( $wgUseValidation )
index 0104bbd..c7dd029 100644 (file)
@@ -1076,11 +1076,6 @@ this old version, (rev) = revert to this old version.
 'mimetype' => 'MIME type: ',
 'download' => 'download',
 
-# License search
-#
-'licensesearch' => 'License search',
-'licensesearch_license' => 'License: ',
-
 # Statistics
 #
 'statistics'   => 'Statistics',