r95890 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95889‎ | r95890 | r95891 >
Date:17:41, 31 August 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
added missing sort and order param definitions
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QueryPrinter.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/languages/SMW_Messages.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QueryPrinter.php
@@ -637,6 +637,15 @@
638638 $params['limit']->setMessage( 'smw_paramdesc_limit' );
639639 $params['limit']->setDefault( 20 );
640640
 641+ $params['sort'] = new ListParameter( 'sort' );
 642+ $params['sort']->setMessage( 'smw-paramdesc-sort' );
 643+ $params['sort']->setDefault( '' );
 644+
 645+ $params['order'] = new ListParameter( 'order' );
 646+ $params['order']->setMessage( 'smw-paramdesc-order' );
 647+ $params['order']->setDefault( '' );
 648+ $params['order']->addCriteria( new CriterionInArray( 'descending', 'desc', 'asc', 'ascending', 'rand', 'random' ) );
 649+
641650 $params['offset'] = new Parameter( 'offset', Parameter::TYPE_INTEGER );
642651 $params['offset']->setMessage( 'smw_paramdesc_offset' );
643652 $params['offset']->setDefault( 0 );
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_Messages.php
@@ -93,6 +93,8 @@
9494 'smw-paramdesc-dsv-filename' => 'The name for the DSV file',
9595 'smw-smwdoc-description' => 'Shows a table of all parameters that can be used for the specified result format together with default values and descriptions.',
9696 'smw-smwdoc-par-format' => 'The result format to display parameter documentation for.',
 97+ 'smw-paramdesc-sort' => 'Property to sort the query by',
 98+ 'smw-paramdesc-order' => 'Order of the query sort',
9799
98100 // Messages and strings for inline queries
99101 'smw_iq_disabled' => "Semantic queries have been disabled for this wiki.",