Extension:Wiki2LaTeX/Development/wiki2latex.php

<?php

/* * File:   wiki2latex.php * Created: 2007-09-01 * Version: 0.7 * * Purpose: * Registers Wiki2LaTeX to Mediawiki * * License: * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */

if ( !defined('MEDIAWIKI') ) { $msg = 'To install Wiki2LaTeX, put the following line in LocalSettings.php: '; $msg .= 'require_once( $IP."/extensions/path_to_Wiki2LaTeX_files/wiki2latex.php" );'; echo $msg; exit( 1 ); }

$w2lConfig         = array; $w2lTags           = array; $w2lEvents         = array; $w2lParserFunctions = array;

// for compatibility... $w2l_config    =& $w2lConfig; $w2l_tags      =& $w2lTags; $w2l_pFunctions =& $w2lParserFunctions; $w2l_events    =& $w2lEvents;

// load config files require_once('w2lDefaultConfig.php'); require_once('w2lConfig.php');

// Require the class-files require_once('w2lCore.php'); require_once('w2lTags.php'); require_once('w2lParser.php'); //require_once('w2lSpecial.php');

//$wgAutoloadClasses['Wiki2LaTeXSpecialPage'] = dirname(__FILE__). '/w2lSpecialPage.php';

$w2lCore         = new Wiki2LaTeX; $w2lExtensionTags = new Wiki2LaTeXTags;

//$wgSpecialPages['Wiki2LaTeXSpecialPage'] = 'Wiki2LaTeXSpecialPage';

$wgHooks['LoadAllMessages'][]           = &$w2lCore; $wgHooks['SkinTemplateContentActions'][] = &$w2lCore; $wgHooks['UnknownAction'][]             = &$w2lCore; $wgHooks['BeforePageDisplay'][]         = &$w2lCore;

$wgExtensionFunctions[] = array(&$w2lCore,         'Setup'); $wgExtensionFunctions[] = array(&$w2lExtensionTags, 'Setup');