}
$params = $this->extractRequestParams();
+ $prop = array_flip( (array)$params['prop'] );
if ( isset( $params['title'] ) && !isset( $params['lang'] ) ) {
$this->dieUsageMsg( array( 'missingparam', 'lang' ) );
}
+ // Handle deprecated param
+ $this->requireMaxOneParameter( $params, 'url', 'prop' );
+ if ( $params['url'] ) {
+ $prop = array( 'url' => 1 );
+ }
+
$this->addFields( array(
'll_from',
'll_lang',
break;
}
$entry = array( 'lang' => $row->ll_lang );
- if ( $params['url'] ) {
+ if ( isset( $prop['url'] ) ) {
$title = Title::newFromText( "{$row->ll_lang}:{$row->ll_title}" );
if ( $title ) {
$entry['url'] = wfExpandUrl( $title->getFullURL(), PROTO_CURRENT );
ApiBase::PARAM_MAX2 => ApiBase::LIMIT_BIG2
),
'continue' => null,
- 'url' => false,
+ 'url' => array(
+ ApiBase::PARAM_DFLT => false,
+ ApiBase::PARAM_DEPRECATED => true,
+ ),
+ 'prop' => array(
+ ApiBase::PARAM_ISMULTI => true,
+ ApiBase::PARAM_TYPE => array(
+ 'url',
+ )
+ ),
'lang' => null,
'title' => null,
'dir' => array(
return array(
'limit' => 'How many langlinks to return',
'continue' => 'When more results are available, use this to continue',
- 'url' => 'Whether to get the full URL',
+ 'url' => "Whether to get the full URL (Cannot be used with {$this->getModulePrefix()}prop)",
+ 'prop' => array(
+ 'Which additional properties to get for each interlanguage link',
+ ' url - Adds the full URL',
+ ),
'lang' => 'Language code',
'title' => "Link to search for. Must be used with {$this->getModulePrefix()}lang",
'dir' => 'The direction in which to list',
}
public function getPossibleErrors() {
- return array_merge( parent::getPossibleErrors(), array(
- array( 'missingparam', 'lang' ),
- ) );
+ return array_merge( parent::getPossibleErrors(),
+ $this->getRequireMaxOneParameterErrorMessages(
+ array( 'url', 'prop' )
+ ),
+ array(
+ array( 'missingparam', 'lang' ),
+ )
+ );
}
public function getExamples() {