Paladox has uploaded a new change for review. https://gerrit.wikimedia.org/r/231048
Change subject: e name extension back to intersection ...................................................................... e name extension back to intersection Reasons: 1. There is an extension already named DynamicPageList. This makes it confusing for users if there are two extension named like each other. 2. This repo hasent been renamed so might as well keep the name sync with repo. 3. All the i18n messages refer to it as intersection even qqq.json desc refers to this as intersections. There are links for intersection and not updated for DynamicPageList. Change-Id: I75f6c9af611b7bc42f8c53ad52517e8d9695ef80 --- M DynamicPageList.php R Intersection.hooks.php R Intersection.tests.txt M intersection.php 4 files changed, 80 insertions(+), 76 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/intersection refs/changes/48/231048/1 diff --git a/DynamicPageList.php b/DynamicPageList.php index d88569e..e7d69a6 100644 --- a/DynamicPageList.php +++ b/DynamicPageList.php @@ -1,72 +1 @@ -<?php -/* - - Purpose: outputs a bulleted list of most recent - items residing in a category, or a union - of several categories. - - Contributors: n:en:User:IlyaHaykinson n:en:User:Amgine - http://en.wikinews.org/wiki/User:Amgine - http://en.wikinews.org/wiki/User:IlyaHaykinson - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - http://www.gnu.org/copyleft/gpl.html - - Current feature request list - 1. Unset cached of calling page - 2. RSS feed output? (GNSM extension?) - - To install, add following to LocalSettings.php - include("$IP/extensions/intersection/DynamicPageList.php"); - -*/ - -if ( !defined( 'MEDIAWIKI' ) ) { - die( 'This is not a valid entry point to MediaWiki.' ); -} - -// Extension credits that will show up on Special:Version -$wgExtensionCredits['parserhook'][] = array( - 'path' => __FILE__, - 'name' => 'DynamicPageList', - 'version' => '1.7.0', - 'descriptionmsg' => 'intersection-desc', - 'url' => 'https://www.mediawiki.org/wiki/Extension:Intersection', - 'author' => array( '[http://en.wikinews.org/wiki/User:Amgine Amgine]', '[http://en.wikinews.org/wiki/User:IlyaHaykinson IlyaHaykinson]' ), -); - -// Internationalization file -$wgMessagesDirs['DynamicPageList'] = __DIR__ . '/i18n'; - -$wgAutoloadClasses['DynamicPageListHooks'] = __DIR__ . '/DynamicPageList.hooks.php'; - -// Parser tests -// Warning, these only work when run with parserTests.php. There will be -// failures if run via phpunit! (you may want to comment the below line -// out if you're regularly running phpunit tests) -$wgParserTestFiles[] = __DIR__ . '/DynamicPageList.tests.txt'; - -# Configuration variables. Warning: These use DLP instead of DPL -# for historical reasons (pretend Dynamic list of pages) -$wgDLPmaxCategories = 6; // Maximum number of categories to look for -$wgDLPMaxResultCount = 200; // Maximum number of results to allow -$wgDLPAllowUnlimitedResults = false; // Allow unlimited results -$wgDLPAllowUnlimitedCategories = false; // Allow unlimited categories -// How long to cache pages using DPL's in seconds. Default to 1 day. Set to -// false to not decrease cache time (most efficient), Set to 0 to disable -// cache altogether (inefficient, but results will never be outdated) -$wgDLPMaxCacheTime = 60*60*24; // How long to cache pages - -$wgHooks['ParserFirstCallInit'][] = 'DynamicPageListHooks::onParserFirstCallInit'; +intersection.php \ No newline at end of file diff --git a/DynamicPageList.hooks.php b/Intersection.hooks.php similarity index 97% rename from DynamicPageList.hooks.php rename to Intersection.hooks.php index f2aada0..b40f0bc 100644 --- a/DynamicPageList.hooks.php +++ b/Intersection.hooks.php @@ -1,21 +1,23 @@ <?php -class DynamicPageListHooks { +class IntersectionHooks { /** * Set up the <DynamicPageList> tag. + * Set up the <Intersection> tag. * @param Parser &$parser * @return boolean true */ public static function onParserFirstCallInit( &$parser ) { - $parser->setHook( 'DynamicPageList', 'DynamicPageListHooks::renderDynamicPageList' ); + $parser->setHook( 'DynamicPageList', 'IntersectionHooks::renderIntersection' ); + $parser->setHook( 'Intersection', 'IntersectionHooks::renderIntersection' ); return true; } /** * The callback function for converting the input text to HTML output */ - public static function renderDynamicPageList( $input, $args, $mwParser ) { + public static function renderIntersection( $input, $args, $mwParser ) { global $wgContLang; global $wgDisableCounters; // to determine if to allow sorting by #hits. global $wgDLPmaxCategories, $wgDLPMaxResultCount, $wgDLPMaxCacheTime; diff --git a/DynamicPageList.tests.txt b/Intersection.tests.txt similarity index 100% rename from DynamicPageList.tests.txt rename to Intersection.tests.txt diff --git a/intersection.php b/intersection.php index ba28483..6be3317 120000 --- a/intersection.php +++ b/intersection.php @@ -1 +1,74 @@ -DynamicPageList.php \ No newline at end of file +DynamicPageList.php + +<?php +/* + + Purpose: outputs a bulleted list of most recent + items residing in a category, or a union + of several categories. + + Contributors: n:en:User:IlyaHaykinson n:en:User:Amgine + http://en.wikinews.org/wiki/User:Amgine + http://en.wikinews.org/wiki/User:IlyaHaykinson + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + http://www.gnu.org/copyleft/gpl.html + + Current feature request list + 1. Unset cached of calling page + 2. RSS feed output? (GNSM extension?) + + To install, add following to LocalSettings.php + include("$IP/extensions/intersection/DynamicPageList.php"); + +*/ + +if ( !defined( 'MEDIAWIKI' ) ) { + die( 'This is not a valid entry point to MediaWiki.' ); +} + +// Extension credits that will show up on Special:Version +$wgExtensionCredits['parserhook'][] = array( + 'path' => __FILE__, + 'name' => 'Intersection', + 'version' => '1.7.0', + 'descriptionmsg' => 'intersection-desc', + 'url' => 'https://www.mediawiki.org/wiki/Extension:Intersection', + 'author' => array( '[http://en.wikinews.org/wiki/User:Amgine Amgine]', '[http://en.wikinews.org/wiki/User:IlyaHaykinson IlyaHaykinson]' ), +); + +// Internationalization file +$wgMessagesDirs['Intersection'] = __DIR__ . '/i18n'; + +$wgAutoloadClasses['IntersectionHooks'] = __DIR__ . '/Intersection.hooks.php'; + +// Parser tests +// Warning, these only work when run with parserTests.php. There will be +// failures if run via phpunit! (you may want to comment the below line +// out if you're regularly running phpunit tests) +$wgParserTestFiles[] = __DIR__ . '/Intersection.tests.txt'; + +# Configuration variables. Warning: These use DLP instead of DPL +# for historical reasons (pretend Dynamic list of pages) +$wgDLPmaxCategories = 6; // Maximum number of categories to look for +$wgDLPMaxResultCount = 200; // Maximum number of results to allow +$wgDLPAllowUnlimitedResults = false; // Allow unlimited results +$wgDLPAllowUnlimitedCategories = false; // Allow unlimited categories +// How long to cache pages using DPL's in seconds. Default to 1 day. Set to +// false to not decrease cache time (most efficient), Set to 0 to disable +// cache altogether (inefficient, but results will never be outdated) +$wgDLPMaxCacheTime = 60*60*24; // How long to cache pages + +$wgHooks['ParserFirstCallInit'][] = 'IntersectionHooks::onParserFirstCallInit'; -- To view, visit https://gerrit.wikimedia.org/r/231048 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I75f6c9af611b7bc42f8c53ad52517e8d9695ef80 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/intersection Gerrit-Branch: master Gerrit-Owner: Paladox <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
