This repository has been archived by the owner on Dec 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
chameleon.php
98 lines (85 loc) · 2.95 KB
/
chameleon.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
<?php
/**
* The Chameleon skin. A Mediawiki skin using Twitter Bootstrap.
*
* @see https://www.mediawiki.org/wiki/Skin:Chameleon
*
* @author Stephan Gambke
* @version 0.1
*
*/
/**
* The main file of the Chameleon skin
*
* @copyright (C) 2013, Stephan Gambke
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License, version 3 (or later)
*
* This file is part of the MediaWiki skin Chameleon.
* The Chameleon skin 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 3 of the License, or
* (at your option) any later version.
*
* The Chameleon skin is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @file
* @ingroup Skins
*/
if ( !defined( 'MEDIAWIKI' ) ) {
die( 'This file is part of a MediaWiki extension, it is not a valid entry point.' );
}
if ( !defined( 'BS_VERSION' ) ) {
die( '<b>Error:</b> The <a href="https://www.mediawiki.org/wiki/Skin:Chameleon">Chameleon</a> skin depends on the Bootstrap extension. You need to install the <a href="https://www.mediawiki.org/wiki/Extension:Bootstrap">Bootstrap</a> extension first.' );
}
// define the skin's version
define( 'CHAMELEON_VERSION', '0.2 alpha' );
// set extension credits
$wgExtensionCredits['skin'][] = array(
'path' => __FILE__,
'name' => 'Chameleon',
'descriptionmsg' => 'chameleon-desc',
'author' => '[http://www.mediawiki.org/wiki/User:F.trott Stephan Gambke]',
'url' => 'https://www.mediawiki.org/wiki/Skin:Chameleon',
'version' => CHAMELEON_VERSION,
);
// register skin
$wgValidSkinNames['chameleon'] = 'Chameleon';
// register skin class (must be 'Skin' . SkinName)
$wgAutoloadClasses['SkinChameleon'] = dirname( __FILE__ ) . '/Chameleon.skin.php';
$egChameleonLayoutFile= dirname( __FILE__ ) . '/layouts/standard.xml';
$chameleonComponents = array(
'Component',
'Structure',
'Container',
'Row',
'Cell',
'Grid',
'NavbarHorizontal',
'NavHead',
'TabList',
'NewtalkNotifier',
'PersonalTools',
'Logo',
'SearchForm',
'SiteNotice',
'ToolbarHorizontal',
'FooterInfo',
'FooterPlaces',
'FooterIcons',
'MainContent',
'Html',
);
foreach ( $chameleonComponents as $component ) {
$wgAutoloadClasses['skins\\chameleon\\components\\' . $component] = dirname( __FILE__ ) . '/components/' . $component. '.php';
}
// register message file for i18n
$wgExtensionMessagesFiles['Chameleon'] = dirname( __FILE__ ) . '/Chameleon.i18n.php';
// register Bootstrap modules (for now, just register everything)
Bootstrap::getBootstrap()->addAllBootstrapModules();
Bootstrap::getBootstrap()->addExternalModule( __DIR__, '/css/screen.less' );