Kézikönyv:$wgExtensionCredits

From mediawiki.org
This page is a translated version of the page Manual:$wgExtensionCredits and the translation is 50% complete.
Outdated translations are marked like this.
Kiterjesztések: $wgExtensionCredits
A kiterjesztések névjegyének globális listája.
Bevezetve:1.5.0 (r10074)
Elavultnak jelölve:1.25.0 (Gerrit change 598739; git #2065d76b)
Eltávolítva:használatban
Megengedett értékek:Lásd alább
Alapértelmezett érték:[]

Részletek

A változóban rögzített tömb a kiterjesztések típusait, azon belül pedig nevüket, verzióikat, szerzőiket, URL-jeiket, leírásaikat és a lefordított üzenetekre mutató hivatkozásokat tartalmazza. A version, url, description és descriptionmsg mezőket nem kötelező kitölteni.

A névjegy tartalma a Speciális:Névjegy lapon tekinthető meg, így a felhasználók láthatják a telepített kiterjesztések listáját és az azokkal kapcsolatos további információkat.

Ez nem a LocalSettings.php -ban hivatkozott konfigurációs beállítás. A kiterjesztések fejlesztői általában olyan kódot írnak, amelyek az ezen globális változóban szereplő tömböt frissítik. Lásd a kiterjesztések fejlesztése és (a MediaWiki 1.25-től) a Extension registration lapot.

A MediaWiki 1.25 verziótól a felületeknek és kiterjesztéseknek nem szabad ezt a változót használniuk; ehelyett az azonos információt az extension.json, illetve a skin.json fájlok tartalmazzák. A régi és új rendszer közti átalakításhoz lásd a Manual:convertExtensionToRegistration.php lapot!

Használat

A kiterjesztések fejlesztői az alábbi módon egészíthetik ki a tömböt:

$wgExtensionCredits[$type][] = array(
	'path' => __FILE__,     // File name for the extension itself, required for getting the revision number from SVN - string, added in 1.15.0. Since 1.23 also used to create the link to the extension's license file
	'name' => "",           // Name of extension - string
	'namemsg' => "",        // Same as above but name of a message, for i18n - string, added in 1.24.0.
	'description' => "",    // Description of what the extension does - string. Omit in favour of descriptionmsg.
	'descriptionmsg' => "", // Same as above but name of a message, for i18n - string, added in 1.12.0.
	'version' => 0,         // Version number of extension - number or string
	'author' => "",         // The extension author's name - string or array for multiple
	'url' => "",            // URL of extension (usually instructions) - string
	'license-name' => "",   // Short name of the license, links LICENSE or COPYING file if existing - string, added in 1.23.0
);

The description and author fields get parsed as wiki syntax. This is often used to provide links to the author's homepage in the author field. In version 1.12 and newer, descriptionmsg will override description.

type

A $type értéke az alábbiak egyike kell, hogy legyen:

namemsg

The value of namemsg will be treated as the message key for the extension or skin name: see the help page on localisation.

As a standard, it's in the form <repositoryname>-extensionname or <repositoryname>-skinname (all lower case).

The name is the same as that of the name property.

descriptionmsg

The value of descriptionmsg will be treated as the message key for the extension description: see the help page on localisation. As a standard, it's in the form ‎<repositoryname>-desc (all lower case).

The description
  • Must be a single brief sentence: it has no closing period and implies "this extension" as a subject when needed.
  • Is usually in one of the following forms:
    • "Does"/"Adds"/"Allows to do" something (e.g. "Adds <poem> tag for poem formatting");
    • "Allow to do"/"Do" something, with the wiki or the users as subject (e.g. "Hide individual revisions from all users for legal reasons, etc.");
    • "Special page to do" something, or other noun-sentence to describe what the extension is composed of (e.g. "Provides a special page to view global file usage", "Provides Wikimedia specific messages").
      • Includes a link to the (main) added special page(s) if any, using "special page" or "do something" etc. as link labels.

author

Since MediaWiki 1.17 (r81549) the author list can contain the special hackish '...' to denote not individually named authors, i.e. other authors. The triple dot will make MediaWiki insert the "version-poweredby-others" message.

Example
$wgExtensionCredits['other'][] = array(
	'author' => array(
		'Jane Doe',
		'...'
		),
	);

license-name

Since MediaWiki 1.23 it is possible to indicate the license on "Special:Version" as well as linking to a file containing it. For this to work "path" has to be provided as well as a file named either COPYING or LICENSE. The "license-name" key should be used to provide the short name of the license, e.g. "GPL-2.0-or-later" or "MIT" adhering to the list of identifiers at spdx.org. The text from "license-name" will then be used as label for the link.

Example:

$wgExtensionCredits['other'][] = array(
	'path'         => __FILE__,
	'license-name' => 'GPL-2.0-or-later' // GNU General Public License v2.0 or later
);
Until Gerrit change 187178 (MW < 1.25), the COPYING or LICENSE file had to be in wikitext to show properly (see issue T68767)

Példa

$wgExtensionCredits['specialpage'][] = array(
	'path' => __FILE__,
	'name' => 'Example extension',
	'version' => '1.9.0',
	'author' => 'Foo Barstein',
	'url' => 'https://www.mediawiki.org/wiki/Extension:MyExtension',
	'descriptionmsg' => 'exampleextension-desc',
	'license-name' => 'GPL-2.0-or-later'
);

Lásd még