From 8493d93de949eb089885daaa5158041de6e0c93b Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sun, 18 Sep 2005 15:26:31 +0000 Subject: [PATCH] * Removing Special:Licensesearch --- includes/SpecialLicensesearch.php | 141 ------------------------------ includes/SpecialPage.php | 1 - languages/Language.php | 5 -- 3 files changed, 147 deletions(-) delete mode 100644 includes/SpecialLicensesearch.php diff --git a/includes/SpecialLicensesearch.php b/includes/SpecialLicensesearch.php deleted file mode 100644 index 4e0ce370fc..0000000000 --- a/includes/SpecialLicensesearch.php +++ /dev/null @@ -1,141 +0,0 @@ - - * @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; -} -?> diff --git a/includes/SpecialPage.php b/includes/SpecialPage.php index 6b60b9e528..9133f8e5b7 100644 --- a/includes/SpecialPage.php +++ b/includes/SpecialPage.php @@ -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 ) diff --git a/languages/Language.php b/languages/Language.php index 0104bbd300..c7dd029fa5 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -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', -- 2.20.1