r73661 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73660‎ | r73661 | r73662 >
Date:16:16, 24 September 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
changes for 0.7 - filtering out QP parameters provided by SMW
Modified paths:
  • /trunk/extensions/SemanticMaps/includes/queryprinters/SM_MapPrinter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMaps/includes/queryprinters/SM_MapPrinter.php
@@ -165,41 +165,27 @@
166166
167167 $validator = new Validator( $this->getName() );
168168
169 - /* TODO: filter these!
170 - // SMW #Ask: parameters
171 - 'limit' => array(
172 - 'type' => 'integer',
173 - 'criteria' => array(
174 - 'in_range' => array( 0, false )
175 - )
176 - ),
177 - 'offset' => array(
178 - 'type' => 'integer'
179 - ),
180 - 'sort' => array(),
181 - 'order' => array(
182 - 'criteria' => array(
183 - 'in_array' => array( 'ascending', 'asc', 'descending', 'desc', 'reverse' )
184 - )
185 - ),
186 - 'headers' => array(
187 - 'criteria' => array(
188 - 'in_array' => array( 'show', 'hide' )
189 - )
190 - ),
191 - 'mainlabel' => array(),
192 - 'link' => array(
193 - 'criteria' => array(
194 - 'in_array' => array( 'none', 'subject', 'all' )
195 - )
196 - ),
197 - 'default' => array(),
198 - 'intro' => array(),
199 - 'outro' => array(),
200 - 'searchlabel' => array(),
201 - 'distance' => array(),
202 - */
 169+ $paramsToFilter = array(
 170+ 'limit',
 171+ 'offset',
 172+ 'sort',
 173+ 'order',
 174+ 'headers',
 175+ 'mainlabel',
 176+ 'link',
 177+ 'default',
 178+ 'intro',
 179+ 'outro',
 180+ 'searchlabel',
 181+ 'distance'
 182+ );
203183
 184+ foreach ( $paramsToFilter as $paramName ) {
 185+ if ( aray_key_exists( $paramName, $mapProperties ) ) {
 186+ unset( $mapProperties[$paramName] );
 187+ }
 188+ }
 189+
204190 $validator->setParameters( $mapProperties, $parameterInfo );
205191
206192 $validator->validateParameters();

Status & tagging log