-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUnFlow.php
106 lines (86 loc) · 3.13 KB
/
UnFlow.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?php
/**
* UnFlow extension
*
* Enable at your own risk...it might explode.
*
* Config options below
*/
/**
* Full page name of pages to enable UnFlow upon
* @var array
*/
$wgUnFlowPages = array();
/**
* Namespaces to enable UnFlow upon
* @var array
*/
$wgUnFlowNamespaces = array( NS_USER_TALK );
// Useful when screwing with ContentHandler stuff
$wgContentHandlerUseDB = false;
// Extension setup stuff
define( 'NS_POST', 656 );
define( 'NS_POST_TALK', 657 ); // @fixme wtf
define( 'NS_TOPIC', 658 );
define( "NS_TOPIC_TALK", 689 ); // @fixme wtf
$wgContentHandlers['IndexContent'] = 'IndexContentHandler';
$wgContentHandlers['UnPostContent'] = 'UnPostContentHandler';
$wgNamespaceContentModels[NS_POST] = 'UnPostContent';
$wgHooks['CanonicalNamespaces'][] = 'UnHooks::onCanonicalNamespaces';
$wgHooks['BeforePageDisplay'][] = 'UnHooks::onBeforePageDisplay';
$wgHooks['ContentHandlerDefaultModelFor'][] = 'UnHooks::onContentHandlerDefaultModelFor';
$wgHooks['PageContentSaveComplete'][] = 'UnHooks::onPageContentSaveComplete';
$wgHooks['LoadExtensionSchemaUpdates'][] = function( DatabaseUpdater $upd ) {
$upd->addExtensionTable( 'unpost_revids', __DIR__ . '/tables.sql' );
return true;
};
$wgResourceModules['ext.UnFlow.indent'] = array(
'styles' => 'ext.UnFlow.indent.css',
'localBasePath' => __DIR__ . '/modules',
'remoteExtPath' => 'UnFlow/modules',
);
$wgResourceModules['ext.UnFlow.reply'] = array(
'scripts' => 'ext.UnFlow.reply.js',
'dependencies' => array(
'mediawiki.api',
'mediawiki.Uri',
),
'messages' => array(
'unflow-submit-reply',
'unflow-submit-cancel',
),
'localBasePath' => __DIR__ . '/modules',
'remoteExtPath' => 'UnFlow/modules',
);
$wgExtensionCredits['other'][] = array(
'path' => __FILE__,
'author' => array( 'Uncyclomedia Foundation' ),
'name' => 'UnFlow',
'version' => '-1',
);
$wgExtensionMessagesFiles['UnFlow'] = __DIR__ . '/UnFlow.i18n.php';
$wgAPIModules['newtopic'] = 'ApiNewTopic';
$wgAPIModules['newreply'] = 'ApiNewReply';
$wgSpecialPages['NewReply'] = 'SpecialNewReply';
$wgSpecialPages['NewTopic'] = 'SpecialNewTopic';
$wgAutoloadClasses += array(
// API modules
'ApiNewTopic' => __DIR__ . '/api/ApiNewTopic.php',
'ApiNewReply' => __DIR__ . '/api/ApiNewReply.php',
// Specials
'SpecialNewReply' => __DIR__ . '/specials/SpecialNewReply.php',
'SpecialNewTopic' => __DIR__ . '/specials/SpecialNewTopic.php',
// ContentHandler
'UnPostContent' => __DIR__ . '/content/UnPostContent.php',
'UnPostContentHandler' => __DIR__ . '/content/UnPostContentHandler.php',
'IndexContent' => __DIR__ . '/content/IndexContent.php',
'IndexContentHandler' => __DIR__ . '/content/IndexContentHandler.php',
'UnDifferenceEngine' => __DIR__ . '/content/UnDifferenceEngine.php',
'IndexDifferenceEngine'=> __DIR__ . '/content/IndexDifferenceEngine.php',
// UnThings
'UnFlow' => __DIR__ . '/includes/UnFlow.php',
'UnHooks' => __DIR__ . '/includes/UnHooks.php',
'UnPost' => __DIR__ . '/includes/UnPost.php',
'UnThread' => __DIR__ . '/includes/UnThread.php',
'UnTOC' => __DIR__ . '/includes/UnTOC.php',
);