r79459 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79458‎ | r79459 | r79460 >
Date:00:05, 2 January 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Added parameter descriptions
Modified paths:
  • /trunk/extensions/SubPageList/RELEASE-NOTES (modified) (history)
  • /trunk/extensions/SubPageList/SubPageList.class.php (modified) (history)
  • /trunk/extensions/SubPageList/SubPageList.i18n.php (modified) (history)
  • /trunk/extensions/SubPageList/SubPageList.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SubPageList/RELEASE-NOTES
@@ -4,6 +4,12 @@
55 Latest version of the release notes: http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/SubPageList/RELEASE-NOTES?view=co
66
77
 8+=== Version 0.2 ===
 9+2011-01-xx
 10+
 11+* Fixed bug in pathstyle and sortby parameters.
 12+* Added parameter descriptions.
 13+
814 === Version 0.1 ===
915 2010-12-31
1016
Index: trunk/extensions/SubPageList/SubPageList.i18n.php
@@ -20,4 +20,13 @@
2121 'spl-desc' => 'Adds a <code><nowiki><splist /></nowiki></code> tag that enables you to list subpages',
2222
2323 'spl-nosubpages' => '$1 has no subpages to list.',
 24+
 25+ 'spl-subpages-par-sort' => 'The direction to sort in.',
 26+ 'spl-subpages-par-sortby' => 'What to sort the subpages by.',
 27+ 'spl-subpages-par-format' => 'The subpage list can be displayed in several formats. Numbered lists (ol), bulleted lists (ul) and comma-separated lists (list).',
 28+ 'spl-subpages-par-page' => 'The page to show the subpages for. Defaults to the current page.',
 29+ 'spl-subpages-par-showpage' => 'Idicates if the page itself should be shown in the list or not.',
 30+ 'spl-subpages-par-pathstyle' => 'The style of the path for subpages in the list.',
 31+ 'spl-subpages-par-kidsonly' => 'Allows showing only direct subpages.',
 32+ 'spl-subpages-par-limit' => 'The max amount of pages to list.',
2433 );
\ No newline at end of file
Index: trunk/extensions/SubPageList/SubPageList.php
@@ -35,7 +35,7 @@
3636 die( '<b>Error:</b> You need to have <a href="http://www.mediawiki.org/wiki/Extension:Validator">Validator</a> installed in order to use <a href="http://www.mediawiki.org/wiki/Extension:SubPageList">SubPageList</a>.<br />' );
3737 }
3838
39 -define( 'SPL_VERSION', '0.1' );
 39+define( 'SPL_VERSION', '0.2 alpha' );
4040
4141 $wgExtensionCredits['parserhook'][] = array(
4242 'path' => __FILE__,
Index: trunk/extensions/SubPageList/SubPageList.class.php
@@ -64,11 +64,13 @@
6565 $params['sort']->addCriteria( new CriterionInArray( 'asc', 'desc' ) );
6666 $params['sort']->addManipulations( new ParamManipulationFunctions( 'strtolower' ) );
6767 $params['sort']->setDefault( 'asc' );
 68+ $params['sort']->setDescription( wfMsg( 'spl-subpages-par-sort' ) );
6869
6970 $params['sortby'] = new Parameter( 'sortby' );
7071 $params['sortby']->addCriteria( new CriterionInArray( 'title', 'lastedit' ) );
7172 $params['sortby']->addManipulations( new ParamManipulationFunctions( 'strtolower' ) );
7273 $params['sortby']->setDefault( 'title' );
 74+ $params['sortby']->setDescription( wfMsg( 'spl-subpages-par-sortby' ) );
7375
7476 $params['format'] = new Parameter( 'format' );
7577 $params['format']->addAliases( 'liststyle' );
@@ -78,32 +80,38 @@
7981 'list', 'bar'
8082 ) );
8183 $params['format']->addManipulations( new ParamManipulationFunctions( 'strtolower' ) );
82 - $params['format']->setDefault( 'ul' );
 84+ $params['format']->setDefault( 'ul' );
 85+ $params['format']->setDescription( wfMsg( 'spl-subpages-par-format' ) );
8386
8487 $params['page'] = new Parameter( 'page' );
8588 $params['page']->addAliases( 'parent' );
8689 $params['page']->setDefault( '' );
 90+ $params['page']->setDescription( wfMsg( 'spl-subpages-par-page' ) );
8791
8892 $params['showpage'] = new Parameter( 'showpage', Parameter::TYPE_BOOLEAN );
8993 $params['showpage']->addAliases( 'showparent' );
9094 $params['showpage']->setDefault( 'no' );
 95+ $params['showpage']->setDescription( wfMsg( 'spl-subpages-par-showpage' ) );
9196
9297 $params['pathstyle'] = new Parameter( 'pathstyle' );
9398 $params['pathstyle']->addAliases( 'showpath' );
94 - $params['sortby']->addCriteria( new CriterionInArray(
 99+ $params['pathstyle']->addCriteria( new CriterionInArray(
95100 'none', 'no',
96101 'children', 'notparent',
97102 'full'
98103 ) );
99104 $params['pathstyle']->setDefault( 'none' );
100105 $params['pathstyle']->addManipulations( new ParamManipulationFunctions( 'strtolower' ) );
101 -
 106+ $params['pathstyle']->setDescription( wfMsg( 'spl-subpages-par-pathstyle' ) );
 107+
102108 $params['kidsonly'] = new Parameter( 'kidsonly', Parameter::TYPE_BOOLEAN );
103109 $params['kidsonly']->setDefault( 'no' );
 110+ $params['kidsonly']->setDescription( wfMsg( 'spl-subpages-par-kidsonly' ) );
104111
105112 $params['limit'] = new Parameter( 'limit', Parameter::TYPE_INTEGER );
106113 $params['limit']->setDefault( 200 );
107114 $params['limit']->addCriteria( new CriterionInRange( 1, 500 ) );
 115+ $params['limit']->setDescription( wfMsg( 'spl-subpages-par-limit' ) );
108116
109117 return $params;
110118 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r79484Follow-up r79459: Fix typo, slight tweaks. Add extension to Translatewikiraymond09:40, 2 January 2011

Status & tagging log