Jump to content

Extension:GlobalPreferences/pt

From mediawiki.org
Para ajuda do utilizador final para esta extensão, por favor, consulte Ajuda:Extensão:GlobalPreferences

.}}

MediaWiki extensions manual
GlobalPreferences
Release status: stable
Implementation Special page , Hook
Description Permite que um utilizador defina as preferências globais do utilizador ("wikifarm-wide")
Author(s) Kunal Mehta, Sam Wilson
Latest version 0.1.2 (2018-02-13)
Compatibility policy Snapshots releases along with MediaWiki. Master is not backward compatible.
MediaWiki 1.25+
Database changes Yes
  • $wgGlobalPreferencesDB
  • $wgGlobalPreferencesAutoPrefs
Licence GNU General Public License 2.0 or later
Download
Help Help:Extension:GlobalPreferences/pt
Translate the GlobalPreferences extension if it is available at translatewiki.net
Issues Open tasks · Report a bug

A extensão GlobalPreferences permite que um utilizador defina algumas ou todas das suas preferências para serem utilizadas globalmente em todas as wikis numa família wiki. Por exemplo, pode definir o seu tema para ser o mesmo em todas as wikis, mas ter definições diferentes da lista de páginas vigiadas em wikis diferentes. Também é possível para as preferências globais para indicar exceções locais em wikis particulares.

Although it is possible to have global user preferences without any extension by setting up a shared database with a shared user_properties table, the GlobalPreferences extension is useful for more varied use cases such as:

  • A user wants to set the same language on all wikis, but wants to keep one wiki on its default.
  • One wiki has a preference hidden with $wgHiddenPrefs , and another doesn't.
  • A user wants to set a different skin on each wiki.
  • Two wikis have two different gadgets named the same.
  • A wiki has an extension installed which sets a preference, but that extension is not enabled on another wiki in the farm.

Instalação

[edit]

Before GlobalPreferences can work, you need to set up central user IDs . This can be done with the CentralAuth extension (or other CentralIdLookup provider) but for most wiki families can more easily be done with shared database tables. (This will mean that users' email addresses, passwords, and real names[1] will be set across all wikis, and won't be able to be set on a per-wiki basis.)

If using the shared tables approach, set the following in LocalSettings.php :

$wgSharedDB = '<shared_wiki_database>';
$wgSharedTables = [ 'user' ]; // Note that 'user_properties' is not included.

Then GlobalPreferences can be installed in the usual manner:

  • Download and move the extracted GlobalPreferences folder to your extensions/ directory.
    Developers and code contributors should install the extension from Git instead, using:
    cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/GlobalPreferences
    
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'GlobalPreferences' );
    // No need to set $wgGlobalPreferencesDB if it's the same as $wgSharedDB.
    $wgGlobalPreferencesDB = '<global_preferences_database>';
    
  • Run the update script which will automatically create the necessary database tables that this extension needs.
  • If you are using a database for $wgGlobalPreferencesDB that is not a MediaWiki database (and so won't be updated when you run the update script) then you'll have to install the required database table manually. The SQL required is in the sql/ directory.

e.g. for sqllite:

php maintenance/run.php sql --wikidb my_wiki extensions/GlobalPreferences/sql/sqlite/tables-generated.sql
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

If you also have the Echo extension installed then GlobalPreferences must be loaded after Echo in LocalSettings.php.

Configuração

[edit]
$wgGlobalPreferencesDB
Name of the database to store global preferences in. If no value is given, $wgSharedDB will be used, and if that is empty $wgDBname will be used.
This database does not have to be one that is used for anything else, but often is set to the same as wherever central user data is stored.

Marcação de uma preferência como não globalizável

[edit]

Non-globalizable preferences are ignored by GlobalPreferences. If you have programmatically defined a preference (via the GetPreferences hook), then you can mark it as non-globalizable by setting the noglobal property to true.

API

[edit]

The extension provides APIs to get and set local and global preferences. They are documented in API subpage.

Consultar também

[edit]

Notas

[edit]
  1. The 'real name' preference is a confusing one because it's handled separately to all other preferences that can be modified from Special:Preferences. See Phabricator:T72670.