Extensão:PerPageLicense

From MediaWiki.org
Jump to navigation Jump to search
This page is a translated version of the page Extension:PerPageLicense and the translation is 21% complete.

Other languages:
Deutsch • ‎English • ‎català • ‎español • ‎français • ‎italiano • ‎magyar • ‎polski • ‎português • ‎português do Brasil • ‎sicilianu • ‎suomi • ‎中文 • ‎日本語 • ‎한국어
Manual de extensões do MediaWikiManual:Extensions
Crystal Clear action run.svg
PerPageLicense

Estado da versão:Extension status beta

ImplementaçãoTemplate:Extension#type Parser extension
DescriçãoTemplate:Extension#description Enables licenses to be set on a per-namespace or per-page basis
Autor(es)Template:Extension#username (Leucostictetalk)
Última versãoTemplate:Extension#version 1.0.1 (2014-06-02)
MediaWikiTemplate:Extension#mediawiki 1.20+
Alterações à
base de dados
Template:Extension#needs-updatephp
Não
LicençaTemplate:Extension#license GNU General Public License 3.0 or later
Exportação (Download)
ExemploTemplate:Extension#example http://wiki.mises.org
ParâmetrosTemplate:Extension#parameters
$wgPerPageLicenseLicenses

$wgPerPageLicenseTemplatePage

$wgPerPageLicenseNamespaces
Hooks usadosTemplate:Extension#hook
ParserBeforeStripManual:Hooks/ParserBeforeStrip

Traduza a extensão PerPageLicense se ela estiver disponível na wiki translatewiki.net

Verifique a matriz de utilização e versões

The PerPageLicense extension enables license footer variables (viz. $wgRightsIcon, $wgRightsUrl, and $wgRightsText) to be set on a per-namespace or per-page basis.

Download

The extension can be retrieved directly from Git [?]:

  • Browse code
  • Some extensions have tags for stable releases.
  • Each branch is associated with a past MediaWiki release. There is also a "master" branch containing the latest alpha version (might require an alpha version of MediaWiki).

Extract the snapshot and place it in the extensions/PerPageLicense/ directory of your MediaWiki installation.

If you are familiar with git and have shell access to your server, you can also obtain the extension as follows:

cd extensions/
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/PerPageLicense.git

Instalação

  • Exporte e coloque o ficheiro, ou ficheiros, num diretório chamado PerPageLicense, na sua pasta extensions/.
  • Acrescente o seguinte código ao fundo do ficheiro LocalSettings.php:
    require_once "$IP/extensions/PerPageLicense/PerPageLicense.php";
    
  • YesY Pronto – Na página especial Special:Version da sua wiki verifique se a extensão foi instalada.

Configuration

Change these settings to your liking, making sure that you include them in LocalSettings.php after the require_once line installing the extension.

// Page from which to obtain templates and associated licenses.
$wgPerPageLicenseTemplatePage = 'MediaWiki:License-templates';
// Array of licenses.
$wgPerPageLicenseLicenses = array (
        'cc-0' => array(
                'url' => 'http://creativecommons.org/publicdomain/zero/1.0/',
                'src' => "{$wgStylePath}/common/images/cc-by-sa.png",
                'alt' => 'Creative Commons 0',
        ),
        'cc-by-nc-sa' => array(
                'url' => 'http://creativecommons.org/licenses/by-nc/3.0/',
                'src' => "{$wgStylePath}/common/images/cc-by-nc-sa.png",
                'alt' => 'Creative Commons Attribution-NonCommercial 3.0 Unported',
        ),
        'cc-by' => array(
                'url' => 'http://creativecommons.org/licenses/by/3.0/',
                'src' => "{$wgStylePath}/common/images/cc-by.png",
                'alt' => 'Creative Commons Attribution 3.0 Unported',
        ),
        'cc-by-sa' => array(
                'url' => 'http://creativecommons.org/licenses/by-sa/3.0/',
                'src' => "{$wgStylePath}/common/images/cc-by-sa.png",
                'alt' => 'Creative Commons Attribution Share-Alike 3.0 Unported',
        ),
        'gnu-fdl' => array(
                'url' => 'http://www.gnu.org/copyleft/fdl.html',
                'src' => "{$wgStylePath}/common/images/gnu-fdl.png",
                'alt' => 'GNU Free Documentation License',
        ),
        'public-domain' => array(
                'url' => 'http://creativecommons.org/licenses/publicdomain/',
                'src' => "{$wgStylePath}/common/images/public-domain.png",
                'alt' => 'public domain'
        ),
);
// Array of namespaces and their licenses.
$wgPerPageLicenseNamespaces = array();

As an example, you might put:

$wgPerPageLicenseNamespaces = array (
	0 => 'cc-0',
);

This would license everything in mainspace as Creative Commons Zero.

Uso

Edit MediaWiki:License-templates on your wiki. Add templates and their associated licenses. Put each on a separate line. E.g.:

|Wikipedia text || cc-by-sa

Now any page with the {{Wikipedia text}} template will show the license footers for CC BY-SA. Note that in the event of a conflict between per-namespace and per-page licensing, the per-page licensing prevails.