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( '' ); } } }