}
$prop = array_flip( $params['prop'] );
$revid = false;
-
+
if ( isset( $params['section'] ) ) {
$this->section = $params['section'];
} else {
if ( isset( $prop['sections'] ) ) {
$result_array['sections'] = $p_result->getSections();
}
+
if ( isset( $prop['displaytitle'] ) ) {
$result_array['displaytitle'] = $p_result->getDisplayTitle() ?
$p_result->getDisplayTitle() :
$result_array['headhtml'] = array();
$result->setContent( $result_array['headhtml'], $out->headElement( $userSkin ) );
}
+
+ if ( isset( $prop['iwlinks'] ) ) {
+ $result_array['iwlinks'] = $this->formatIWLinks( $p_result->getInterwikiLinks() );
+ }
if ( !is_null( $oldid ) ) {
$result_array['revid'] = intval( $oldid );
'templates' => 'tl',
'images' => 'img',
'externallinks' => 'el',
+ 'iwlinks' => 'iw',
'sections' => 's',
'headitems' => 'hi',
);
return $result;
}
+ private function formatIWLinks( $iw ) {
+ $result = array();
+ foreach ( $iw as $prefix => $titles ) {
+ foreach ( $titles as $title => $id ) {
+ $entry = array();
+ $entry['prefix'] = $prefix;
+ $this->getResult()->setContent( $entry, Title::makeTitle( $ns, $title )->getFullText() );
+ $result[] = $entry;
+ }
+ }
+ return $result;
+ }
+
private function formatHeadItems( $headItems ) {
$result = array();
foreach ( $headItems as $tag => $content ) {
'revid',
'displaytitle',
'headitems',
- 'headhtml'
+ 'headhtml',
+ 'iwlinks',
)
),
'pst' => false,