getSkin();
$this->setHeaders();
$wgOut->setPagetitle( wfMsg( "gadgets-title" ) );
$wgOut->addWikiText( wfMsg( "gadgets-pagetext" ) );
$gadgets = wfLoadGadgetsStructured();
if ( !$gadgets ) return;
$listOpen = false;
$msgOpt = array( 'parseinline', 'parsemag' );
foreach ( $gadgets as $section => $entries ) {
if ( $section !== false && $section !== '' ) {
$t = Title::makeTitleSafe( NS_MEDIAWIKI, "Gadget-section-$section" );
$lnk = $t ? $skin->makeLinkObj( $t, wfMsgHTML("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" );
if ( !$t ) continue;
$lnk = $skin->makeLinkObj( $t, wfMsgHTML("edit") );
$ttext = wfMsgExt( "gadget-$gname", $msgOpt );
if( !$listOpen ) {
$listOpen = true;
$wgOut->addHTML( '' );
}
$wgOut->addHTML( "- " );
$wgOut->addHTML( "$ttext [$lnk]
" );
$wgOut->addHTML( wfMsgHTML("gadgets-uses") . ": " );
$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( '
' );
}
}
}