'Tabber', 'author' => 'Eric Fortin', 'url' => 'https://www.mediawiki.org/wiki/Extension:Tabber', 'descriptionmsg' => 'tabber-desc', 'version' => '1.2' ); $dir = dirname(__FILE__) . '/'; # Internationalisation file $wgExtensionMessagesFiles['Tabber'] = $dir . 'Tabber.i18n.php'; $wgExtensionFunctions[] = "wfTabber"; // function adds the wiki extension function wfTabber() { global $wgParser; $wgParser->setHook( "tabber", "renderTabber" ); } function renderTabber( $paramstring, $params = array() ){ global $wgParser, $wgScriptPath; $wgParser->disableCache(); $path = $wgScriptPath . '/extensions/Tabber/'; $htmlHeader = '' . '' . '
'; $htmlFooter = '
'; $htmlTabs = ''; $arr = explode("|-|", $paramstring); foreach($arr as $tab){ $htmlTabs .= buildTab($tab); } return $htmlHeader . $htmlTabs . $htmlFooter; } function buildTab($tab){ global $wgParser; if( trim($tab) == '' ) return ''; $arr = preg_split("/=/",$tab); $tabName = array_shift( $arr ); $tabBody = $wgParser->recursiveTagParse( implode("=",$arr) ); $tab = '
' . '

'.$tabBody.'

' . '
'; return $tab; }