1 | <?php
|
---|
2 | /*
|
---|
3 | To enable this extension, put all files in this directory into a "wiki2xml"
|
---|
4 | subdirectory of your MediaWiki extensions directory.
|
---|
5 | Also, add
|
---|
6 | require_once ( "extensions/wiki2xml/extension.php" ) ;
|
---|
7 | to your LocalSettings.php
|
---|
8 | The extension will then be accessed as [[Special:Wiki2XML]].
|
---|
9 | */
|
---|
10 |
|
---|
11 | if( !defined( 'MEDIAWIKI' ) ) die();
|
---|
12 |
|
---|
13 | # Integrating into the MediaWiki environment
|
---|
14 |
|
---|
15 | $wgExtensionCredits['Wiki2XML'][] = array(
|
---|
16 | 'name' => 'Wiki2XML',
|
---|
17 | 'description' => 'An extension to convert wiki markup into XML.',
|
---|
18 | 'author' => 'Magnus Manske'
|
---|
19 | );
|
---|
20 |
|
---|
21 | $wgExtensionFunctions[] = 'wfWiki2XMLExtension';
|
---|
22 |
|
---|
23 | # for Special::Version:
|
---|
24 | $wgExtensionCredits['parserhook'][] = array(
|
---|
25 | 'name' => 'wiki2xml extension',
|
---|
26 | 'author' => 'Magnus Manske et al.',
|
---|
27 | 'url' => 'http://en.wikipedia.org/wiki/User:Magnus_Manske',
|
---|
28 | 'version' => 'v0.02',
|
---|
29 | );
|
---|
30 |
|
---|
31 |
|
---|
32 | #_____________________________________________________________________________
|
---|
33 |
|
---|
34 | /**
|
---|
35 | * The special page
|
---|
36 | */
|
---|
37 | function wfWiki2XMLExtension() { # Checked for HTML and MySQL insertion attacks
|
---|
38 | global $IP, $wgMessageCache;
|
---|
39 | # wfTasksAddCache();
|
---|
40 |
|
---|
41 | // FIXME : i18n
|
---|
42 | $wgMessageCache->addMessage( 'wiki2xml', 'Wiki2XML' );
|
---|
43 |
|
---|
44 | require_once $IP.'/includes/SpecialPage.php';
|
---|
45 |
|
---|
46 | class SpecialWiki2XML extends SpecialPage {
|
---|
47 |
|
---|
48 | /**
|
---|
49 | * Constructor
|
---|
50 | */
|
---|
51 | function SpecialWiki2XML() { # Checked for HTML and MySQL insertion attacks
|
---|
52 | SpecialPage::SpecialPage( 'Wiki2XML' );
|
---|
53 | $this->includable( true );
|
---|
54 | }
|
---|
55 |
|
---|
56 | /**
|
---|
57 | * Special page main function
|
---|
58 | */
|
---|
59 | function execute( $par = null ) { # Checked for HTML and MySQL insertion attacks
|
---|
60 | global $wgOut, $wgRequest, $wgUser, $wgTitle, $IP;
|
---|
61 | $fname = 'Special::Tasks:execute';
|
---|
62 | global $xmlg , $html_named_entities_mapping_mine, $content_provider;
|
---|
63 | include_once ( "default.php" ) ;
|
---|
64 | $xmlg['sourcedir'] = $IP.'/extensions/wiki2xml' ;
|
---|
65 | include_once ( "w2x.php" ) ;
|
---|
66 |
|
---|
67 | $this->setHeaders();
|
---|
68 | $wgOut->addHtml( $out );
|
---|
69 | }
|
---|
70 |
|
---|
71 | } # end of class
|
---|
72 |
|
---|
73 | SpecialPage::addPage( new SpecialWiki2XML );
|
---|
74 | }
|
---|
75 |
|
---|
76 |
|
---|
77 | ?>
|
---|