$fld_protection = isset($prop['protection']);
$fld_talkid = isset($prop['talkid']);
$fld_subjectid = isset($prop['subjectid']);
+ $fld_url = isset($prop['url']);
+ $fld_readable = isset($prop['readable']);
}
$pageSet = $this->getPageSet();
$pageInfo['talkid'] = $talkids[$title->getNamespace()][$title->getDbKey()];
if($fld_subjectid && isset($subjectids[$title->getNamespace()][$title->getDbKey()]))
$pageInfo['subjectid'] = $subjectids[$title->getNamespace()][$title->getDbKey()];
+ if($fld_url) {
+ $pageInfo['fullurl'] = $title->getFullURL();
+ $pageInfo['editurl'] = $title->getFullURL('action=edit');
+ }
+ if($fld_readable)
+ if($title->userCanRead())
+ $pageInfo['readable'] = '';
$result->addValue(array (
'query',
), $pageid, $pageInfo);
}
- // Get edit/protect tokens and protection data for missing titles if requested
- // Delete and move tokens are N/A for missing titles anyway
- if(!is_null($params['token']) || $fld_protection || $fld_talkid || $fld_subjectid)
+ // Get properties for missing titles if requested
+ if(!is_null($params['token']) || $fld_protection || $fld_talkid || $fld_subjectid ||
+ $fld_url || $fld_readable)
{
$res = &$result->getData();
foreach($missing as $pageid => $title) {
$res['query']['pages'][$pageid]['talkid'] = $talkids[$title->getNamespace()][$title->getDbKey()];
if($fld_subjectid && isset($subjectids[$title->getNamespace()][$title->getDbKey()]))
$res['query']['pages'][$pageid]['subjectid'] = $subjectids[$title->getNamespace()][$title->getDbKey()];
+ if($fld_url) {
+ $res['query']['pages'][$pageid]['fullurl'] = $title->getFullURL();
+ $res['query']['pages'][$pageid]['editurl'] = $title->getFullURL('action=edit');
+ }
+ if($fld_readable)
+ if($title->userCanRead())
+ $res['query']['pages'][$pageid]['readable'] = '';
}
}
}
ApiBase :: PARAM_TYPE => array (
'protection',
'talkid',
- 'subjectid'
+ 'subjectid',
+ 'url',
+ 'readable',
)),
'token' => array (
ApiBase :: PARAM_DFLT => NULL,