2023-07-16 23:53:33
This commit is contained in:
parent
f475b5b33d
commit
53d13dd11d
11 changed files with 335 additions and 2 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.idea/
|
0
CHANGELOG.md
Normal file
0
CHANGELOG.md
Normal file
13
CONTRIBUTING.md
Normal file
13
CONTRIBUTING.md
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
# Contributing
|
||||||
|
|
||||||
|
- Feedback, wishes and suggestions can be sent by email.
|
||||||
|
- Constructive criticism, bug descriptions and other reports are welcome.
|
||||||
|
- Email: mail@ihub.to
|
||||||
|
|
||||||
|
## Sources
|
||||||
|
|
||||||
|
- [**GitHub**](https://github.com/pkgstore)
|
||||||
|
- [GitLab](https://gitlab.com/pkgstore) (MIRROR)
|
||||||
|
- [Codeberg](https://codeberg.org/pkgstore) (MIRROR)
|
||||||
|
- [MosHub](https://hub.mos.ru/pkgstore) (MIRROR)
|
||||||
|
- [Git.Org.Ru](https://git.org.ru/pkgstore) (MIRROR)
|
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2023 Package Store
|
Copyright (c) 2023 iHub TO <https://ihub.to>
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
23
MW_EXT_META.class.php
Normal file
23
MW_EXT_META.class.php
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace MediaWiki\Extension\PkgStore;
|
||||||
|
|
||||||
|
use OutputPage, Skin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class MW_EXT_META
|
||||||
|
*/
|
||||||
|
class MW_EXT_META
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Load resource function.
|
||||||
|
*
|
||||||
|
* @param OutputPage $out
|
||||||
|
* @param Skin $skin
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public static function onBeforePageDisplay(OutputPage $out, Skin $skin): void
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
72
MW_EXT_META.i18n.namespaces.php
Normal file
72
MW_EXT_META.i18n.namespaces.php
Normal file
|
@ -0,0 +1,72 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$namespaceNames = [];
|
||||||
|
|
||||||
|
if (!defined('NS_EXT_SANDBOX')) {
|
||||||
|
define('NS_EXT_SANDBOX', 1000000010);
|
||||||
|
define('NS_EXT_SANDBOX_TALK', 1000000011);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!defined('NS_EXT_DRAFT')) {
|
||||||
|
define('NS_EXT_DRAFT', 1000000020);
|
||||||
|
define('NS_EXT_DRAFT_TALK', 1000000021);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!defined('NS_EXT_BLOG')) {
|
||||||
|
define('NS_EXT_BLOG', 1000000030);
|
||||||
|
define('NS_EXT_BLOG_TALK', 1000000031);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!defined('NS_EXT_NEWS')) {
|
||||||
|
define('NS_EXT_NEWS', 1000000040);
|
||||||
|
define('NS_EXT_NEWS_TALK', 1000000041);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!defined('NS_EXT_EXTENSION')) {
|
||||||
|
define('NS_EXT_EXTENSION', 1000000050);
|
||||||
|
define('NS_EXT_EXTENSION_TALK', 1000000051);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!defined('NS_EXT_THEME')) {
|
||||||
|
define('NS_EXT_THEME', 1000000060);
|
||||||
|
define('NS_EXT_THEME_TALK', 1000000061);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!defined('NS_EXT_PORTAL')) {
|
||||||
|
define('NS_EXT_PORTAL', 1000000070);
|
||||||
|
define('NS_EXT_PORTAL_TALK', 1000000071);
|
||||||
|
}
|
||||||
|
|
||||||
|
$namespaceNames['en'] = [
|
||||||
|
NS_EXT_SANDBOX => 'Sandbox',
|
||||||
|
NS_EXT_SANDBOX_TALK => 'Sandbox_talk',
|
||||||
|
NS_EXT_DRAFT => 'Draft',
|
||||||
|
NS_EXT_DRAFT_TALK => 'Draft_talk',
|
||||||
|
NS_EXT_BLOG => 'Blog',
|
||||||
|
NS_EXT_BLOG_TALK => 'Blog_talk',
|
||||||
|
NS_EXT_NEWS => 'News',
|
||||||
|
NS_EXT_NEWS_TALK => 'News_talk',
|
||||||
|
NS_EXT_EXTENSION => 'Extension',
|
||||||
|
NS_EXT_EXTENSION_TALK => 'Extension_talk',
|
||||||
|
NS_EXT_THEME => 'Theme',
|
||||||
|
NS_EXT_THEME_TALK => 'Theme_talk',
|
||||||
|
NS_EXT_PORTAL => 'Portal',
|
||||||
|
NS_EXT_PORTAL_TALK => 'Portal_talk',
|
||||||
|
];
|
||||||
|
|
||||||
|
$namespaceNames['ru'] = [
|
||||||
|
NS_EXT_SANDBOX => 'Песочница',
|
||||||
|
NS_EXT_SANDBOX_TALK => 'Обсуждение_песочницы',
|
||||||
|
NS_EXT_DRAFT => 'Черновик',
|
||||||
|
NS_EXT_DRAFT_TALK => 'Обсуждение_черновика',
|
||||||
|
NS_EXT_BLOG => 'Блог',
|
||||||
|
NS_EXT_BLOG_TALK => 'Обсуждение_блога',
|
||||||
|
NS_EXT_NEWS => 'Новость',
|
||||||
|
NS_EXT_NEWS_TALK => 'Обсуждение_новости',
|
||||||
|
NS_EXT_EXTENSION => 'Расширение',
|
||||||
|
NS_EXT_EXTENSION_TALK => 'Обсуждение_расширения',
|
||||||
|
NS_EXT_THEME => 'Тема',
|
||||||
|
NS_EXT_THEME_TALK => 'Обсуждение_темы',
|
||||||
|
NS_EXT_PORTAL => 'Портал',
|
||||||
|
NS_EXT_PORTAL_TALK => 'Обсуждение_портала',
|
||||||
|
];
|
16
MW_EXT_META.php
Normal file
16
MW_EXT_META.php
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
// Confirm MediaWiki environment.
|
||||||
|
if (!defined('MEDIAWIKI')) {
|
||||||
|
die('This file is a MediaWiki extension and thus not a valid entry point.');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (function_exists('wfLoadExtension')) {
|
||||||
|
wfLoadExtension('MW_EXT_META');
|
||||||
|
// Keep i18n globals so mergeMessageFileList.php doesn't break.
|
||||||
|
$wgExtensionMessagesFiles['MW_EXT_META'] = __DIR__ . '/i18n';
|
||||||
|
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
die('This version of the MW_EXT_META extension requires MediaWiki 1.31+');
|
||||||
|
}
|
19
README.md
19
README.md
|
@ -1 +1,18 @@
|
||||||
# mediawiki-ext-meta
|
# Information
|
||||||
|
|
||||||
|
Интеграция дополнительных элементов в движок MediaWiki.
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
1. Загрузите папки и файлы в директорию `extensions/MW_EXT_META`.
|
||||||
|
2. В самый низ файла `LocalSettings.php` добавьте строку:
|
||||||
|
|
||||||
|
```php
|
||||||
|
wfLoadExtension( 'MW_EXT_META' );
|
||||||
|
```
|
||||||
|
|
||||||
|
## Syntax
|
||||||
|
|
||||||
|
```html
|
||||||
|
|
||||||
|
```
|
||||||
|
|
46
composer.json
Normal file
46
composer.json
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
{
|
||||||
|
"name": "pkgstore/mediawiki-ext-meta",
|
||||||
|
"type": "mediawiki-extension",
|
||||||
|
"description": "MediaWiki META extension.",
|
||||||
|
"license": "MIT",
|
||||||
|
"homepage": "https://ihub.to/",
|
||||||
|
"keywords": [
|
||||||
|
"mediawiki",
|
||||||
|
"meta"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "iHub TO",
|
||||||
|
"email": "mail@ihub.to",
|
||||||
|
"homepage": "https://ihub.to/",
|
||||||
|
"role": "Developer"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Kitsune Solar",
|
||||||
|
"email": "mail@kitsune.solar",
|
||||||
|
"homepage": "https://kitsune.solar/",
|
||||||
|
"role": "Developer"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/pkgstore/mediawiki-ext-meta/issues",
|
||||||
|
"source": "https://github.com/pkgstore/mediawiki-ext-meta"
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"composer/installers": "^1.0.1",
|
||||||
|
"php": ">=8.2",
|
||||||
|
"pkgstore/mediawiki-ext-kernel": "*"
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"classmap": [
|
||||||
|
"MW_EXT_META.class.php"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"config": {
|
||||||
|
"optimize-autoloader": true,
|
||||||
|
"prepend-autoloader": false
|
||||||
|
},
|
||||||
|
"extra": {
|
||||||
|
"installer-name": "MW_EXT_META"
|
||||||
|
}
|
||||||
|
}
|
134
extension.json
Normal file
134
extension.json
Normal file
|
@ -0,0 +1,134 @@
|
||||||
|
{
|
||||||
|
"name": "MW_EXT_META",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"author": [
|
||||||
|
"[https://ihub.to/ iHub TO]",
|
||||||
|
"[https://kitsune.solar/ Kitsune Solar]",
|
||||||
|
"..."
|
||||||
|
],
|
||||||
|
"url": "https://ihub.to/",
|
||||||
|
"descriptionmsg": "mw-meta-desc",
|
||||||
|
"license-name": "[https://choosealicense.com/licenses/mit/ MIT]",
|
||||||
|
"type": "other",
|
||||||
|
"require": {
|
||||||
|
"MediaWiki": ">= 1.31.0",
|
||||||
|
"extensions": {
|
||||||
|
"MW_EXT_Kernel": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"namespaces": [
|
||||||
|
{
|
||||||
|
"id": 1000000010,
|
||||||
|
"constant": "NS_EXT_SANDBOX",
|
||||||
|
"name": "Sandbox",
|
||||||
|
"subpages": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 1000000011,
|
||||||
|
"constant": "NS_EXT_SANDBOX_TALK",
|
||||||
|
"name": "Sandbox_talk"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 1000000020,
|
||||||
|
"constant": "NS_EXT_DRAFT",
|
||||||
|
"name": "Draft",
|
||||||
|
"subpages": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 1000000021,
|
||||||
|
"constant": "NS_EXT_DRAFT_TALK",
|
||||||
|
"name": "Draft_talk"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 1000000030,
|
||||||
|
"constant": "NS_EXT_BLOG",
|
||||||
|
"name": "Blog",
|
||||||
|
"subpages": false,
|
||||||
|
"content": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 1000000031,
|
||||||
|
"constant": "NS_EXT_BLOG_TALK",
|
||||||
|
"name": "Blog_talk"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 1000000040,
|
||||||
|
"constant": "NS_EXT_NEWS",
|
||||||
|
"name": "News",
|
||||||
|
"subpages": false,
|
||||||
|
"content": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 1000000041,
|
||||||
|
"constant": "NS_EXT_NEWS_TALK",
|
||||||
|
"name": "News_talk"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 1000000050,
|
||||||
|
"constant": "NS_EXT_EXTENSION",
|
||||||
|
"name": "Extension",
|
||||||
|
"subpages": true,
|
||||||
|
"content": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 1000000051,
|
||||||
|
"constant": "NS_EXT_EXTENSION_TALK",
|
||||||
|
"name": "Extension_talk"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 1000000060,
|
||||||
|
"constant": "NS_EXT_THEME",
|
||||||
|
"name": "Theme",
|
||||||
|
"subpages": true,
|
||||||
|
"content": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 1000000061,
|
||||||
|
"constant": "NS_EXT_THEME_TALK",
|
||||||
|
"name": "Theme_talk"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 1000000070,
|
||||||
|
"constant": "NS_EXT_PORTAL",
|
||||||
|
"name": "Portal",
|
||||||
|
"subpages": true,
|
||||||
|
"content": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 1000000071,
|
||||||
|
"constant": "NS_EXT_PORTAL_TALK",
|
||||||
|
"name": "Portal_talk"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"AddGroups": {
|
||||||
|
"bureaucrat": [
|
||||||
|
"editor"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"RemoveGroups": {
|
||||||
|
"bureaucrat": [
|
||||||
|
"editor"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"AutoloadClasses": {
|
||||||
|
"MediaWiki\\Extension\\PkgStore\\MW_EXT_META": "MW_EXT_META.class.php"
|
||||||
|
},
|
||||||
|
"Hooks": {
|
||||||
|
"BeforePageDisplay": [
|
||||||
|
"MediaWiki\\Extension\\PkgStore\\MW_EXT_META::onBeforePageDisplay"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"ExtensionMessagesFiles": {
|
||||||
|
"MW_EXT_METANamespaces": "MW_EXT_META.i18n.namespaces.php"
|
||||||
|
},
|
||||||
|
"MessagesDirs": {
|
||||||
|
"MW_EXT_META": [
|
||||||
|
"i18n"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"ResourceFileModulePaths": {
|
||||||
|
"localBasePath": "modules",
|
||||||
|
"remoteExtPath": "MW_EXT_META/modules"
|
||||||
|
},
|
||||||
|
"manifest_version": 2
|
||||||
|
}
|
11
i18n/ru.json
Normal file
11
i18n/ru.json
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"@metadata": {
|
||||||
|
"authors": [
|
||||||
|
"iHub TO"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"group-editor": "Редакторы",
|
||||||
|
"group-editor-member": "{{GENDER:$1|редактор}}",
|
||||||
|
"grouppage-editor": "{{ns:project}}:Редакторы",
|
||||||
|
"mw-meta-desc": "Интеграция дополнительных элементов в движок MediaWiki. Специально для проектов [METADATA / FOUNDATION https://metadata.foundation/]."
|
||||||
|
}
|
Loading…
Reference in a new issue