if ( isset( $prop['langlinks'] ) ) {
$result_array['langlinks'] = $this->formatLangLinks( $p_result->getLanguageLinks() );
}
+ if ( isset( $prop['languageshtml'] ) ) {
+ $languagesHtml = $this->languagesHtml( $p_result->getLanguageLinks() );
+ $result_array['languageshtml'] = array();
+ $result->setContent( $result_array['languageshtml'], $languagesHtml );
+ }
if ( isset( $prop['categories'] ) ) {
$result_array['categories'] = $this->formatCategoryLinks( $p_result->getCategories() );
}
+ if ( isset( $prop['categorieshtml'] ) ) {
+ $categoriesHtml = $this->categoriesHtml( $p_result->getCategories() );
+ $result_array['categorieshtml'] = array();
+ $result->setContent( $result_array['categorieshtml'], $categoriesHtml );
+ }
if ( isset( $prop['links'] ) ) {
$result_array['links'] = $this->formatLinks( $p_result->getLinks() );
}
return $result;
}
+ private function categoriesHtml( $categories ) {
+ global $wgOut, $wgUser;
+ $wgOut->addCategoryLinks( $categories );
+ $sk = $wgUser->getSkin();
+ return $sk->getCategories();
+ }
+
+ private function languagesHtml( $languages ) {
+ global $wgOut, $wgUser;
+ $wgOut->setLanguageLinks( $languages );
+ $sk = $wgUser->getSkin();
+ return $sk->otherLanguages();
+ }
+
private function formatLinks( $links ) {
$result = array();
foreach ( $links as $ns => $nslinks ) {
ApiBase::PARAM_TYPE => array(
'text',
'langlinks',
+ 'languageshtml',
'categories',
+ 'categorieshtml',
'links',
'templates',
'images',
' text - Gives the parsed text of the wikitext',
' langlinks - Gives the langlinks the parsed wikitext',
' categories - Gives the categories of the parsed wikitext',
+ ' categorieshtml - Gives the html version of the categories',
+ ' languageshtml - Gives the html version of the languagelinks',
' links - Gives the internal links in the parsed wikitext',
' templates - Gives the templates in the parsed wikitext',
' images - Gives the images in the parsed wikitext',