getSkin();
$this->setHeaders();
$wgOut->setPagetitle( wfMsg( "gadgets-title" ) );
$wgOut->addWikiText( wfMsg( "gadgets-pagetext" ) );
$gadgets = wfLoadGadgetsStructured();
if ( !$gadgets ) return;
$lang = "";
if ( $wgLang->getCode() != $wgContLang->getCode() ) {
$lang = "/" . $wgLang->getCode();
}
$listOpen = false;
$msgOpt = array( 'parseinline', 'parsemag' );
foreach ( $gadgets as $section => $entries ) {
if ( $section !== false && $section !== '' ) {
$t = Title::makeTitleSafe( NS_MEDIAWIKI, "Gadget-section-$section$lang" );
$lnk = $t ? $skin->makeLinkObj( $t, wfMsgHTML("edit"), 'action=edit' ) : htmlspecialchars($section);
$ttext = wfMsgExt( "gadget-section-$section", $msgOpt );
if( $listOpen ) {
$wgOut->addHTML( '' );
$listOpen = false;
}
$wgOut->addHTML( "\n
$ttext [$lnk]
\n" );
}
foreach ( $entries as $gname => $code ) {
$t = Title::makeTitleSafe( NS_MEDIAWIKI, "Gadget-$gname$lang" );
if ( !$t ) continue;
$lnk = $skin->makeLinkObj( $t, wfMsgHTML("edit"), 'action=edit' );
$ttext = wfMsgExt( "gadget-$gname", $msgOpt );
if( !$listOpen ) {
$listOpen = true;
$wgOut->addHTML( '' );
}
$wgOut->addHTML( "- " );
$wgOut->addHTML( "$ttext [$lnk]
" );
$wgOut->addHTML( wfMsgHTML( "gadgets-uses" ) . wfMsg( 'colon-separator' ) );
$first = true;
foreach ( $code as $codePage ) {
$t = Title::makeTitleSafe( NS_MEDIAWIKI, "Gadget-$codePage" );
if ( !$t ) continue;
if ( $first ) $first = false;
else $wgOut->addHTML(", ");
$lnk = $skin->makeLinkObj( $t, htmlspecialchars( $t->getText() ) );
$wgOut->addHTML($lnk);
}
$wgOut->addHTML( " " );
}
}
if( $listOpen ) {
$wgOut->addHTML( '
' );
}
}
}