* @return void
*/
public function requestExtraData( $pageSet ) {
- global $wgDisableCounters;
+ global $wgDisableCounters, $wgContentHandlerUseDB;
$pageSet->requestField( 'page_restrictions' );
// when resolving redirects, no page will have this field
$pageSet->requestField( 'page_touched' );
$pageSet->requestField( 'page_latest' );
$pageSet->requestField( 'page_len' );
+ if ( $wgContentHandlerUseDB ) {
+ $pageSet->requestField( 'page_content_model' );
+ }
}
/**
$titleExists = $pageid > 0; //$title->exists() needs pageid, which is not set for all title objects
$ns = $title->getNamespace();
$dbkey = $title->getDBkey();
+
+ $pageInfo['contentmodel'] = $title->getContentModel();
+ $pageInfo['pagelanguage'] = $title->getPageLanguage()->getCode();
+
if ( $titleExists ) {
global $wgDisableCounters;
private function getWatchedInfo() {
$user = $this->getUser();
- if ( $user->isAnon() || count( $this->everything ) == 0 ) {
+ if ( $user->isAnon() || count( $this->everything ) == 0
+ || !$user->isAllowed( 'viewmywatchlist' )
+ ) {
return;
}
'starttimestamp' => array(
ApiBase::PROP_TYPE => 'timestamp',
ApiBase::PROP_NULLABLE => true
- )
+ ),
+ 'contentmodel' => 'string',
),
'watched' => array(
'watched' => 'boolean'