Skip to content

Commit

Permalink
Initial support for MediaWiki 1.43
Browse files Browse the repository at this point in the history
  • Loading branch information
jdarwood007 committed Nov 25, 2024
1 parent c6b5be7 commit e370eda
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 14 deletions.
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ Parts of this theme are licensed under [BSD 3-clause license](https://www.openso
* **1.x**: Compatible with SMF2.0 [No longer actively developed]

#### Branches organization:
* ***master*** - main branch, v2.1 (smfCurve2) compatible with **SMF2.1**, Supporting MediaWiki 1.39+
* ***2.0*** - main branch, v2.0 (smfCurve2) compatible with **SMF2.1**, Supporting MediaWiki 1.31-1.35
* ***1.4*** - for MediaWiki 1.31-1.35 (LTS)
* ***1.3*** - for MediaWiki 1.27 (LTS)
* ***1.2*** - for MediaWiki 1.25+
* ***1.1*** - for MediaWiki 1.23 (LTS)
* ***1.0*** - for old MediaWiki installs (Prior to 1.23)
| Version | MediaWiki | SMF 2.0 | SMF 2.1 |
| ------- | ---------- | ------------------ | ------------------ |
| master | 1.43 (LTS) | :white_check_mark: | :white_check_mark: |
| 2.0 | 1.39 (LTS | :white_check_mark: | :white_check_mark: |
| 1.4 | 1.35 (LTS) | :white_check_mark: | :x: |
| 1.3 | 1.27 (LTS) | :white_check_mark: | :x: |
| 1.2 | 1.25 | :white_check_mark: | :x: |
| 1.1 | 1.23 (LTS) | :white_check_mark: | :x: |
| 1.0 | 1.23- | :white_check_mark: | :x: |

#### Notes:
Feel free to fork this repository and make your desired changes.
Expand Down
12 changes: 7 additions & 5 deletions includes/smfCurve2Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public function execute()

case 'TOOLBOX':
$this->buildBox('tb', $this->get('sidebar')['TOOLBOX'], 'toolbox', 'SkinTemplateToolboxEnd' );
Hooks::run( 'smfCurve2AfterToolbox' );
(MediaWikiServices::getInstance()->getHookContainer())->run( 'smfCurve2AfterToolbox' );
break;

case 'LANGUAGES':
Expand Down Expand Up @@ -326,7 +326,7 @@ public function execute()
</div>
<!-- #footerfix -->';

Hooks::run( 'smfcurve2BeforeFooter' );
(MediaWikiServices::getInstance()->getHookContainer())->run( 'smfcurve2BeforeFooter' );

if (method_exists($this, 'customPagePreFooter'))
$this->customPagePreFooter();
Expand Down Expand Up @@ -404,9 +404,11 @@ public function userMenu($limitUrls = [], $inverseLimit = false, $menuID = 'u')
continue;
elseif (!empty($limitUrls) && !empty($inverseLimit) && in_array($key, $limitUrls))
continue;
elseif (empty($item['href']))
continue;

echo '
<li data-key="', $key, '" id="', Sanitizer::escapeIdForAttribute('pt-' . $key), '"', ($item['active'] ? ' class="active"' : ''), '>
<li data-key="', $key, '" id="', Sanitizer::escapeIdForAttribute('pt-' . $key), '"', (!empty($item['active']) ? ' class="active"' : ''), '>
<a href="', htmlspecialchars($item['href']) , '"', (!empty($item['class']) ? ' class="' . htmlspecialchars($item['class']) . '"' : ''), '><span class="generic_icons '.Sanitizer::escapeIdForAttribute($key).'"></span><span class="pt-itemText">', htmlspecialchars($item['text']), '</span></a>
</li>';
}
Expand Down Expand Up @@ -542,7 +544,7 @@ function toolbox()
echo '
<li id="t-ispermalink">', $this->getMsg('permalink')->text(), '</li>';

Hooks::run('smfCurve2AfterToolboxEnd');
(MediaWikiServices::getInstance()->getHookContainer())->run('smfCurve2AfterToolboxEnd');

echo '
</ul>
Expand Down Expand Up @@ -587,7 +589,7 @@ protected function buildBox($boxName, $cont, $msg = null, $hook = null)
if ($hook !== null) {
// Avoid PHP 7.1 warning
$skin = $this;
Hooks::run($hook, [ &$skin, true ]);
(MediaWikiServices::getInstance()->getHookContainer())->run($hook, [ &$skin, true ]);
}

echo '
Expand Down
30 changes: 28 additions & 2 deletions skin.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,20 @@
"ResourceModules": {
"skins.smfcurve2": {
"targets": [ "desktop", "mobile" ],
"class": "ResourceLoaderSkinModule",
"class": "MediaWiki\\ResourceLoader\\SkinModule",
"features": [
"elements",
"interface",
"logo",
"content-links",
"content-media",
"interface-message-box",
"interface-category",
"content-tables",
"i18n-ordered-lists",
"i18n-all-lists-margins",
"i18n-headings"
],
"styles": {
"resources/css/main.css": {
"media": "screen"
Expand All @@ -78,7 +91,20 @@
},
"skins.smfcurve2custom": {
"targets": [ "desktop", "mobile" ],
"class": "ResourceLoaderSkinModule",
"class": "MediaWiki\\ResourceLoader\\SkinModule",
"features": [
"elements",
"interface",
"logo",
"content-links",
"content-media",
"interface-message-box",
"interface-category",
"content-tables",
"i18n-ordered-lists",
"i18n-all-lists-margins",
"i18n-headings"
],
"styles": {
"resources/css/custom.css": {
"media": "screen"
Expand Down

0 comments on commit e370eda

Please sign in to comment.