Sisyphus
: 1 2023 | : 18631 | : 37766575
en ru br
ALT

:: /WWW
: mediawiki-extensions-SpecialNamespaces

                   Gear   Bugs and FR  Repocop 

SpecialNamespaces-1.0gerrit/000075500000000000000000000000001213676351500161565ustar00rootroot00000000000000SpecialNamespaces-1.0gerrit/README000064400000000000000000000011471213676351500170410ustar00rootroot00000000000000
1. Create database table namespace_names with the following SQL query: (Make sure to add your wiki's table prefix if there is one, e.g. mw_)
CREATE TABLE `mw_namespace_names` (
`ns_id` INT(8) NOT NULL DEFAULT '0',
`ns_name` VARCHAR(200) NOT NULL DEFAULT '',
`ns_default` tinyint(1) NOT NULL DEFAULT '0',
`ns_canonical` tinyint(1) DEFAULT NULL
) ENGINE=MyISAM DEFAULT;

2. Assign the necessary permissions in LocalSettings.php to allow specific user groups to edit namespaces:
$wgGroupPermissions['sysop']['namespaces'] = true;

3. Installation can be verified through the Special:Version page of your wiki
SpecialNamespaces-1.0gerrit/SpecialNamespaces.alias.php000064400000000000000000000002661213676351500233430ustar00rootroot00000000000000<?php
/**
* Aliases for Special:Namespaces
*
* @addtogroup Extensions
*/

$aliases = array();

/** English
*/
$aliases['en'] = array(
'Namespaces' => array( 'Namespaces' ),
);
SpecialNamespaces-1.0gerrit/SpecialNamespaces.css000064400000000000000000000007621213676351500222550ustar00rootroot00000000000000
/**
* CSS for Special:Namespaces
*/

table.mw-namespacestable.intro th {
padding-right: 1.4ex;
vertical-align: top;
}

table.mw-namespacestable.intro th.mw-align-left {
text-align: left;
}

table.mw-namespacestable.intro th.mw-align-right {
text-align: right;
}

table.mw-namespacestable.body td.mw-namespacestable-default,
table.mw-namespacestable.body td.mw-namespacestable-canonical,
table.mw-namespacestable.body td.mw-namespacestable-modify {
text-align: center;
}

SpecialNamespaces-1.0gerrit/SpecialNamespaces.i18n.php000064400000000000000000000621051213676351500230310ustar00rootroot00000000000000<?php
/**
* Internationalisation file for extension Namespaces.
*
* @addtogroup Extensions
*
*/

$messages = array();

/** English (English)
*/
$messages['en'] = array(
# general messages
'namespaces' => 'View and edit namespaces data',
'namespaces-title-norights' => 'View namespaces data',
'namespaces-desc' => 'Adds a [[Special:Namespaces|special page]] to view and edit the namespaces table',
'namespaces_intro' => 'This is an overview of the namespaces table. Meanings of the data in the columns:',
'namespaces_nsid' => 'Number',
'namespaces_nsid_intro' => 'Namespace number (0-15 used internally within MediaWiki, odd numbers are talk namespaces)',
'namespaces_nsname' => 'Name',
'namespaces_nsname_intro' => 'Namespace name, used as a prefix: on wiki pages in this namespace.',
'namespaces_default' => 'Default',
'namespaces_default_intro' => 'This is the default name of this namespace in the local language, not an alias.',
'namespaces_default_1_intro' => 'Namespace is listed under this name in [[Special:Allpages]]',
'namespaces_default_0_intro' => 'Namespace is reachable under this name, but some other prefix exists as displayed default.',
'namespaces_canonical' => 'Canonical',
'namespaces_canonical_intro' => 'This is the default name of the namespace before translation.',
'namespaces_canonical_1_intro' => 'Yes. (Note that each numbered namespace has exactly one canonical name.)',
'namespaces_canonical_0_intro' => 'No.',
'namespaces_intro_footer' => 'See [http://www.mediawiki.org/wiki/Namespaces MediaWiki.org] for more information about [[mw:help:namespaces|namespaces]].',
'namespaces_1' => 'yes',
'namespaces_0' => 'no',
'namespaces_error' => 'The namespaces table is empty.',

# modifying permitted
'namespaces_edit' => 'Edit',
'namespaces_reasonfield' => 'Reason',
'namespaces_defaultreason' => '',

# deleting a prefix
'namespaces_delquestion' => 'Deleting "$1"',
'namespaces_deleting' => 'You are deleting namespace "$1".',
'namespaces_deleted' => 'Namespace "$1" was removed from the namespaces table.',
'namespaces_delfailed' => 'Namespace "$1" could not be removed from the namespaces table.',

# adding a prefix
'namespaces_addtext' => 'Add a namespace',
'namespaces_addintro' => 'You are adding a new namespace. Remember that odd numbers are talk pages and the range 0-15 is reserved for default namespaces.',
'namespaces_addbutton' => 'Add',
'namespaces_added' => 'Namespace "$1" was added to the namespaces table.',
'namespaces_addfailed' => 'Namespace "$1" could not be added to the namespaces table.',
'namespaces_defaultname' => '',

# editing a prefix
'namespaces_edittext' => 'Editing a namespace',
'namespaces_editintro' => 'You are editing a namespace.
Remember that this can break existing links.',
'namespaces_edited' => 'Namespace "$1" was modified in the namespaces table.',
'namespaces_editerror' => 'Namespace "$1" can not be modified in the namespaces table.
Possibly it does not exist.',
'namespaces-badprefix' => 'Specified namespace "$1" contains invalid characters',

# namespaces log
'namespaces_logpagename' => 'Namespaces table log',
'namespaces_log_added' => 'added "$2" ($3) (default: $4) (canonical: $5)',
'namespaces_log_edited' => 'modified "$2" : ($3) (default: $4) (canonical: $5)',
'namespaces_log_deleted' => 'removed "$2" from the namespaces',
'namespaces_logpagetext' => 'This is a log of changes to the [[Special:Namespaces|namespaces]].',
'namespaces_logentry' => '', # do not translate this message

# rights
'right-namespaces' => 'Edit namespaces data',
'action-namespaces' => 'change this namespace entry',
);

/** Message documentation (Message documentation)
*/
$messages['qqq'] = array(
'namespaces' => 'This message is the title of the special page [[Special:Namespaces]].',
'namespaces-title-norights' => 'Part of the namespaces extension. This message is the title of the special page [[Special:Namespaces]] when the user has no right to edit the namespaces data, so can only view them.',
'namespaces-desc' => '-',
'namespaces_intro' => 'Part of the namespaces extension. Shown as introductory text on [[Special:Namespaces]].',
'namespaces_nsid' => 'Used on [[Special:Namespaces]] as a column header of the table.',
'namespaces_nsid_intro' => 'Used on [[Special:Namespaces]] so as to explain the data in the {{msg-mw|namespaces_nsid}} column of the table. ',
'namespaces_nsname' => 'Used on [[Special:Namespaces]] as a column header of the table.',
'namespaces_nsname_intro' => 'Used on [[Special:Namespaces]] so as to explain the data in the {{msg-mw|namespaces_nsname}} column of the table.',
'namespaces_default' => 'Used on [[Special:Namespaces]] as a column header.',
'namespaces_default_intro' => 'Used on [[Special:Namespaces]] so as to explain the data in the {{msg-mw|namespaces_default}} column of the table.',
'namespaces_default_0_intro' => 'Used on [[Special:Namespaces]] so as to descripe the meaning of the value 0 in the {{msg-mw|namespaces_default}} column of the table.',
'namespaces_default_1_intro' => 'Used on [[Special:Namespaces]] so as to descripe the meaning of the value 1 in the {{msg-mw|namespaces_default}} column of the table.',
'namespaces_canonical' => 'User in [[Special:Namespaces]] as table column header.',
'namespaces_canonical_intro' => 'Used on [[Special:Namespaces]] so as to explain the data in the {{msg-mw|namespaces_canonical}} column of the table.',
'namespaces_canonical_1_intro' => 'Used on [[Special:Namespaces]] so as to descripe the meaning of the value 1 in the {{msg-mw|namespaces_canonical}} column of the table.',
'namespaces_canonical_0_intro' => 'Used on [[Special:Namespaces]] so as to describe the meaning of the value 0 in the {{msg-mw|namespaces_canonical}} column of the table.',
'namespaces_intro_footer' => 'Part of the namespaces extension. Shown as last pice of the introductory text on [[Special:Namespaces]].
Parameter $1 contains the following (a link): [http://www.mediawiki.org/wiki/Namespaces MediaWiki.org]',
'namespaces_1' => "''\\Yes'''-value to be inserted into the columns headed by {{msg-mw|namespaces_default}} and {{msg-mw|namespaces_canonical}}.

{{Identical|Yes}}",
'namespaces_0' => "''\\No'''-value to be inserted into the columns headed by {{msg-mw|namespaces_default}} and {{msg-mw|namespaces_canonical}}.

{{Identical|No}}",
'namespaces_error' => 'This message is shown when the Special:Namespaces page is empty.',
'namespaces_edit' => 'For users allowed to edit the namespaces table via [[Special:Namespaces]], this text is shown as the column header above the edit buttons.

{{Identical|Edit}}',
'namespaces_reasonfield' => '{{Identical|Reason}}',
'namespaces_defaultreason' => 'This message is the default reason in the namespaces log (when adding or deleting a namespace).

{{Identical|No reason given}}',
'namespaces_delquestion' => 'Parameter $1 is the namespace you are deleting.',
'namespaces_deleting' => '-',
'namespaces_addbutton' => 'This message is the text of the button to submit the namespace you are adding.

{{Identical|Add}}',
'namespaces_editerror' => 'Error message when modifying a namespace has failed.',
'namespaces_logpagename' => 'Part of the namespaces extension. This message is shown as page title on Special:Log/namespaces.',
'namespaces_log_added' => 'Shows up in "Special:Log/namespaces" when someone has added a namespace. Leave parameters and text between brackets exactly as it is.',
'namespaces_log_edited' => 'Shows up in "Special:Log/namespaces" when someone has modified a namespace. Leave parameters and text between brackets exactly as it is.',
'namespaces_log_deleted' => 'Shows up in "Special:Log/namespaces" when someone removed a namespace.',
'namespaces_logpagetext' => 'Part of the namespaces extension. Summary shown on Special:Log/namespaces.',
'right-namespaces' => '{{doc-right}}',
'action-namespaces' => '{{doc-action}}',
);

/** Danish (Dansk)
*/
$messages['da'] = array(
'namespaces_1' => 'ja',
'namespaces_0' => 'nej',
'namespaces_reasonfield' => 'Begrundelse',
'action-namespaces' => 'ændre dette namespace',
);

/** German (Deutsch)
*/
$messages['de'] = array(
'namespaces' => 'Namespaces-Daten betrachten und bearbeiten',
'namespaces-title-norights' => 'Namespaces-Daten betrachten',
'namespaces-desc' => '[[Special:Namespaces|Spezialseite]] zur Pflege der Namespaces',
'namespaces_intro' => 'Dies ist ein Überblick des Inhalts der Namespaces.
Die Daten in den einzelnen Spalten haben die folgende Bedeutung:',
'namespaces_intro_footer' => 'Siehe [http://www.mediawiki.org/wiki/Namespaces MediaWiki.org], um weitere Informationen über die Namespaces.',
'namespaces_1' => 'ja',
'namespaces_0' => 'nein',
'namespaces_error' => 'Die Namespaces-Tabelle ist leer.',
'namespaces_edit' => 'Bearbeiten',
'namespaces_reasonfield' => 'Grund',
'namespaces_defaultreason' => 'kein Grund angegeben',
'namespaces_delquestion' => 'Löscht „$1“',
'namespaces_deleting' => 'Du bist dabei das namespace „$1“ zu löschen.',
'namespaces_deleted' => '„$1“ wurde erfolgreich aus der namespaces entfernt.',
'namespaces_delfailed' => '„$1“ konnte nicht aus der namespaces gelöscht werden.',
'namespaces_addtext' => 'Ein namespace hinzufügen',
'namespaces_addintro' => 'Du fügst ein neues namespace hinzu. Beachte, dass es kein Leerzeichen ( ), Kaufmännisches Und (&), Gleichheitszeichen (=) und keinen Doppelpunkt (:) enthalten darf.',
'namespaces_addbutton' => 'Hinzufügen',
'namespaces_added' => '„$1“ wurde erfolgreich der namespaces hinzugefügt.',
'namespaces_addfailed' => '„$1“ konnte nicht der namespaces hinzugefügt werden.',
'namespaces_edittext' => 'Namespaces bearbeiten',
'namespaces_logpagename' => 'Namespaces-Logbuch',
'namespaces_log_added' => 'hat „$2“ ($3) (canonical: $4) (lokal: $5) der namespaces hinzugefügt',
'namespaces_log_edited' => 'veränderte Präfix „$2“: ($3) (canonical: $4) (lokal: $5) in der namespaces',
'namespaces_log_deleted' => 'hat „$2“ aus der namespaces entfernt',
'namespaces_logpagetext' => 'In diesem Logbuch werden Änderungen an der [[Special:Namespaces|Namespaces]] protokolliert.',
'right-namespaces' => 'Namespaces bearbeiten',
'action-namespaces' => 'Diesen Namespaces-Eintrag ändern',
);

/* Greek
*/
$messages['el'] = array(
'namespaces_1' => 'ναι',
'namespaces_0' => 'όχι',
'namespaces_edit' => 'Επεξεργασία',
'namespaces_reasonfield' => 'Λόγος',
'namespaces_defaultreason' => 'Δεν δίνετε λόγος',
'namespaces_delquestion' => 'Διαγραφή του "$1"',
'namespaces_addbutton' => 'Προσθήκη',
);

/** Esperanto (Esperanto)
*/
$messages['eo'] = array(
'namespaces_1' => 'jes',
'namespaces_0' => 'ne',
'namespaces_edit' => 'Redakti',
'namespaces_reasonfield' => 'Kialo',
'namespaces_defaultreason' => 'nenia kialo skribata',
'namespaces_delquestion' => 'Forigante "$1"',
'namespaces_deleting' => 'Vi forigas "$1".',
'namespaces_addbutton' => 'Aldoni',
);

/** Spanish (Español)
*/
$messages['es'] = array(
'namespaces' => 'Ver y editar namespaces',
'namespaces-title-norights' => 'Ver datos de namespaces',
'namespaces-desc' => 'Añade una [[Special:Namespaces|página especial]] para ver y editar namespaces',
'namespaces_intro' => 'Esta es una visión general de namespaces. Los significados de los datos en las columnas:',
'namespaces_1' => 'Sí',
'namespaces_0' => 'no',
'namespaces_error' => 'La tabla de namespaces está vacía.',
'namespaces_edit' => 'Editar',
'namespaces_reasonfield' => 'Motivo',
'namespaces_defaultreason' => 'no se da ninguna razón',
'namespaces_delquestion' => 'Borrando «$1»',
'namespaces_deleting' => 'Estás borrando el prefijo «$1».',
'namespaces_deleted' => 'El «$1» ha sido borrado correctamente de namespaces.',
'namespaces_delfailed' => 'El «$1» no puede ser borrado de namespaces.',
'namespaces_addtext' => 'Añadir un namespace',
'namespaces_addintro' => "Estás añadiendo un nuevo namespace.",
'namespaces_addbutton' => 'Agregar',
'namespaces_added' => 'El «$1» ha sido añadido correctamente a la tabla de namespaces.',
'namespaces_addfailed' => 'El «$1» no se puede añadir a la tabla de namespaces.',
'namespaces_edittext' => 'Editando un namespace',
'namespaces_editintro' => 'Estás editando un namespace. Recuerda que esto puede romper enlaces existentes.',
'namespaces_edited' => 'El «$1» ha sido modificado correctamente en la tabla de namespaces.',
'namespaces_editerror' => 'El «$1» no puede ser modificado en la tabla de namespaces. Posiblemente no exista.',
'namespaces-badprefix' => 'El namespace «$1» contiene caracteres no válidos',
'namespaces_logpagename' => 'Tabla de registro de namespaces',
'namespaces_log_added' => 'añadido el prefijo «$2» ($3) (canonical: $4) (default: $5) a la tabla de namespaces.',
'namespaces_log_edited' => 'modificado el prefijo «$2» : ($3) (canonical: $4) (default: $5) en la tabla de namespaces',
'namespaces_log_deleted' => 'eliminado el prefijo «$2» de la tabla de namespaces',
'right-namespaces' => 'Editar datos de namespaces',
'action-namespaces' => 'cambiar esta entrada namespaces',
);

/** Estonian (Eesti)
*/
$messages['et'] = array(
'namespaces_1' => 'jah',
'namespaces_0' => 'ei',
'namespaces_edit' => 'Redigeeri',
'namespaces_reasonfield' => 'Põhjus',
'namespaces_defaultreason' => 'põhjendust ei ole kirja pandud',
);

/** Basque (Euskara)
*/
$messages['eu'] = array(
'namespaces_1' => 'bai',
'namespaces_0' => 'ez',
'namespaces_reasonfield' => 'Arrazoia',
'namespaces_defaultreason' => 'ez da arrazoirik eman',
'namespaces_addbutton' => 'Erantsi',
'namespaces_edittext' => 'Namespaces aurrizkia editatzen',
);

/** Finnish (Suomi)
*/
$messages['fi'] = array(
'namespaces_1' => 'kyllä',
'namespaces_0' => 'ei',
'namespaces_error' => 'Virhe: Namespaces-taulu on tyhjä tai jokin muu meni pieleen.',
'namespaces_edit' => 'Muokkaa',
'namespaces_reasonfield' => 'Syy',
'namespaces_defaultreason' => 'ei annettua syytä',
'namespaces_addbutton' => 'Lisää',
'namespaces_edittext' => 'Muokataan namespaces',
'namespaces_edited' => 'Etuliitettä ”$1” muokattiin onnistuneesti namespaces.',
'namespaces_editerror' => 'Etuliitettä ”$1” ei voi muokata namespaces.',
'namespaces_logpagename' => 'Namespacestaululoki',
'namespaces_logpagetext' => 'Tämä on loki muutoksista [[Special:Namespaces|namespaces]].',
'right-namespaces' => 'Muokata namespaces',
'action-namespaces' => 'muokata tätä namespaces',
);

/** French (Français)
*/
$messages['fr'] = array(
'namespaces' => 'Voir et manipuler les données d\'espace nominal (namespaces)',
'namespaces-title-norights' => 'Voir les données d\'espace nominal (namespaces)',
'namespaces-desc' => 'Ajoute une [[Special:Namespaces|page spéciale]] pour voir et manipuler les « namespaces »',
'namespaces_intro' => 'Voici les significations des données:',
'namespaces_nsid' => 'Numéro',
'namespaces_nsid_intro' => 'Numéro d\'espace nominal à utiliser internement dans la base de données du wiki.',
'namespaces_nsname' => 'Nom',
'namespaces_nsname_intro' => 'Nom d\'espace nominal, comme préfixe: qui apparait au <i>nom de la page</i> wiki.',
'namespaces_default' => 'Défaut',
'namespaces_default_intro' => 'Ce nom sera:',
'namespaces_default_0_intro' => 'utilisé uniquement comme un alias, mais pas affiché aux pages mêmes ou [[Special:Allpages]]',
'namespaces_default_1_intro' => 'utilisé comme préfixe du titres affichés aux pages du wiki',
'namespaces_canonical' => 'Canonical',
'namespaces_canonical_intro' => 'Pas utilisé',
'namespaces_canonical_1_intro' => '',
'namespaces_canonical_0_intro' => '',
'namespaces_intro_footer' => 'Voyez [[mw:Help:Namespaces|Namespaces]] et [[mw:Manual:Namespace|instructions aux administrateurs]] chez [http://www.mediawiki.org/wiki/Namespaces MediaWiki.org] pour plus d\'informations.',
'namespaces_1' => 'oui',
'namespaces_0' => 'non',
'namespaces_error' => 'La table des namespaces est vide.',
'namespaces_edit' => 'Modifier',
'namespaces_reasonfield' => 'Motif',
'namespaces_defaultreason' => '', # 'Aucun motif donné'
'namespaces_delquestion' => 'Suppression de « $1 »',
'namespaces_deleting' => 'Vous effacez présentement l\'espace nominal « $1 ».',
'namespaces_deleted' => '« $1 » a été enlevé avec succès des « namespaces ».',
'namespaces_delfailed' => '« $1 » n\'a pas pu être enlevé des « namespaces ».',
'namespaces_addtext' => 'Ajouter un namespace',
'namespaces_addintro' => 'Vous êtes en train d\'ajouter un namespace.',
'namespaces_addbutton' => 'Ajouter',
'namespaces_added' => '« $1 » a été ajouté comme namespace.',
'namespaces_addfailed' => '« $1 » n\'a pas pu être ajouté comme namespace.',
'namespaces_edittext' => 'Modifier un namespace',
'namespaces_editintro' => 'Vous modifiez un namespace. Rappelez-vous que cela peut casser des liens existants.',
'namespaces_edited' => 'Le namespace « $1 » a été modifié avec succès.',
'namespaces_editerror' => '« $1 » ne peut pas être modifié. Il se peut qu\'il n\'existe pas.',
'namespaces_badprefix' => 'Le préfixe namespaces spécifié « $1 » contient des caractères invalides',
'namespaces_logpagename' => 'Journal des namespaces',
'namespaces_log_added' => 'a ajouté « $2 » ($3) (canonical: $4) (défaut: $5)',
'namespaces_log_edited' => 'a modifié « $2 » : ($3) (canonical: $4) (défaut: $5)',
'namespaces_log_deleted' => 'a supprimé « $2 » des namespaces',
'namespaces_logpagetext' => 'Ceci est le journal des changements des [[Special:Namespaces|namespaces]].',
'right-namespaces' => 'Modifier les données namespaces',
'action-namespaces' => 'modifier cet espace nominal namespace',
);

/** Croatian (Hrvatski)
*/
$messages['hr'] = array(
'namespaces' => 'Vidi i uredi namespaces',
'namespaces-title-norights' => 'Gledanje namespaces',
'namespaces-desc' => 'Dodaje [[Special:Namespaces|posebnu stranicu]] za gledanje i uređivanje namespaces',
'namespaces_error' => 'Namespaces tablica je prazna.',
'namespaces_reasonfield' => 'Razlog',
'namespaces_defaultreason' => 'nema razloga',
'namespaces_addbutton' => 'Dodaj',
);

/** Italian (Italiano)
*/
$messages['it'] = array(
'namespaces_1' => 'si',
'namespaces_0' => 'no',
'namespaces_error' => "La tabella degli namespaces è vuota.",
'namespaces_edit' => 'Modifica',
'namespaces_reasonfield' => 'Motivo',
'namespaces_defaultreason' => 'nessuna motivazione indicata',
'namespaces_delquestion' => 'Cancello "$1"',
'namespaces_deleting' => 'Stai cancellando il "$1"',
'namespaces_deleted' => 'Il "$1" è stato cancellato con successo dalla tabella degli namespaces.',
'namespaces_delfailed' => 'Rimozione del "$1" dalla tabella degli namespaces fallita.',
'namespaces_addtext' => 'Aggiungi un namespace',
'namespaces_addintro' => 'Sta per essere aggiunto un nuovo namespace.',
'namespaces_addbutton' => 'Aggiungi',
'namespaces_edittext' => 'Modifica di namespaces',
'namespaces_edited' => 'Il "$1" è stato modificato.',
'namespaces_logpagename' => 'Registro tabella namespaces',
'namespaces_log_added' => 'ha aggiunto "$2" ($3) (canonical: $4) (default: $5) alla namespaces',
'namespaces_log_edited' => 'ha modificato "$2" : ($3) (canonical: $4) (default: $5) nella namespaces',
'namespaces_log_deleted' => 'ha rimosso "$2" dalla namespaces',
'namespaces_logpagetext' => 'Registro dei cambiamenti apportati alla [[Special:Namespaces|namespaces]].',
'right-namespaces' => 'Modifica i dati namespaces',
'action-namespaces' => 'modificare questo namespaces',
);

/** Latin (Latina)
*/
$messages['la'] = array(
'namespaces_error' => 'Tabula est vacua.',
'namespaces_reasonfield' => 'Causa',
'namespaces_defaultreason' => 'nulla causa data',
'namespaces_delquestion' => 'Removens "$1"',
'namespaces_deleting' => 'Delens "$1".',
'namespaces_addbutton' => 'Addere',
);

/** Norwegian (bokmål)‬ (‪Norsk (bokmål)‬)
*/
$messages['no'] = array(
'namespaces' => 'Vis og manipuler namespaces',
'namespaces-title-norights' => 'Vis namespaces',
'namespaces-desc' => 'Legger til en [[Special:Namespaces|spesialside]] som gjør at man kan se og redigere namespaces.',
'namespaces_intro' => 'Dette er en oversikt over namespaces. Betydningene til dataene i kolonnene:',
'namespaces_1' => 'ja',
'namespaces_0' => 'nei',
'namespaces_error' => 'Namespacestabellen er tom.',
'namespaces_reasonfield' => 'Årsak',
'namespaces_defaultreason' => 'ingen grunn gitt',
'namespaces_delquestion' => 'Sletter «$1»',
'namespaces_deleting' => 'Du sletter prefikset «$1».',
'namespaces_deleted' => 'Prefikset «$1» ble fjernet fra namespaces.',
'namespaces_delfailed' => 'Prefikset «$1» kunne ikke fjernes fra namespaces.',
'namespaces_addtext' => 'Legg til et namespace.',
'namespaces_addintro' => 'Du legger til et nytt namespace.',
'namespaces_addbutton' => 'Legg til',
'namespaces_added' => 'Prefikset «$1» ble lagt til i namespaces.',
'namespaces_addfailed' => 'Prefikset «$1» kunne ikke legges til i namespacestabellen. Det er kanskje brukt der fra før.',
'namespaces_edittext' => 'Redigerer et namespacesprefiks',
'namespaces_editintro' => 'Du redigerer et namespacesprefiks. Merk at dette kan ødelegge eksisterende lenker.',
'namespaces_edited' => 'Prefikset «$1» ble endret i namespacestabellen.',
'namespaces_editerror' => 'Prefikset «$1» kan ikke endres i namespaces.',
'namespaces_logpagename' => 'Namespacestabellogg',
'namespaces_log_added' => 'La til «$2» ($3) (canonical: $4) (default: $5) til namespaces',
'namespaces_log_edited' => 'endret prefikset «$2»: ($3) (canonical: $4) (default: $5) i namespaces',
'namespaces_log_deleted' => 'Fjernet prefikset «$2» fra namespaces',
'namespaces_logpagetext' => 'Dette er en logg over endringer i [[Special:Namespaces|namespaces]].',
'right-namespaces' => 'Redigere namespacesdata',
);

/** Portuguese (Português do Brasil)
*/
$messages['pt'] = array(
'namespaces' => 'Ver e editar dados de namespaces',
'namespaces-title-norights' => 'Ver dados namespaces',
'namespaces-desc' => 'Adiciona uma [[Special:Namespaces|página especial]] para visualizar e editar namespaces',
'namespaces_intro' => 'Isto é um resumo da tabela de namespaces. Significado dos dados nas colunas:',
'namespaces_intro_footer' => 'Veja [http://www.mediawiki.org/wiki/Namespaces MediaWiki.org] para mais informações sobre namespaces.',
'namespaces_1' => 'sim',
'namespaces_0' => 'não',
'namespaces_error' => 'A tabela de namespaces está vazia.',
'namespaces_edit' => 'Editar',
'namespaces_reasonfield' => 'Motivo',
'namespaces_defaultreason' => 'sem motivo especificado',
'namespaces_delquestion' => 'Apagando "$1"',
'namespaces_deleting' => 'Você está apagando o "$1".',
'namespaces_deleted' => 'O "$1" foi removido da namespaces.',
'namespaces_delfailed' => 'O "$1" não pôde ser removido da namespaces.',
'namespaces_addtext' => 'Adicionar um namespace',
'namespaces_addintro' => 'Você se encontra prestes a adicionar um novo namespace.',
'namespaces_addbutton' => 'Adicionar',
'namespaces_added' => '"$1" foi adicionado à tabela de namespaces com sucesso.',
'namespaces_addfailed' => '"$1" não pôde ser adicionado à tabela de namespaces.',
'namespaces_edittext' => 'Editando um namespace',
'namespaces_editintro' => 'Você está editando um namespace. Lembre-se de que isto pode quebrar ligações existentes.',
'namespaces_edited' => '"$1" foi modificado na tabela de namespaces com sucesso.',
'namespaces_editerror' => '"$1" não pode ser modificado na tabela de namespaces. Possivelmente, não existe.',
'namespaces-badprefix' => 'Namespace "$1" contém caracteres inválidos',
'namespaces_logpagename' => 'Registro da tabela de namespaces',
'namespaces_log_added' => 'adicionado "$2" ($3) (canonical: $4) (default: $5) à tabela de namespaces',
'namespaces_log_edited' => 'modificado o prefixo "$2": ($3) (canonical: $4) (default: $5) na tabela de namespaces',
'namespaces_log_deleted' => 'removido o prefixo "$2" da tabela de namespaces',
'namespaces_logpagetext' => 'Este é um registro das alterações [[Special:Namespaces|de namespaces]].',
'right-namespaces' => 'Editar dados de namespaces',
'action-namespaces' => 'alterar esta entrada namespaces',
);

/** Romanian (Română)
*/
$messages['ro'] = array(
'namespaces_1' => 'da',
'namespaces_0' => 'nu',
'namespaces_edit' => 'Modificare',
'namespaces_reasonfield' => 'Motiv',
'namespaces_defaultreason' => 'nici un motiv oferit',
'namespaces_delquestion' => 'Ştergere "$1"',
'namespaces_addbutton' => 'Adaugă',
);

/** Russian (Русский)
*/
$messages['ru'] = array(
'namespaces_1' => 'да',
'namespaces_0' => 'нет',
'namespaces_edit' => 'Править',
'namespaces_reasonfield' => 'Причина',
'namespaces_defaultreason' => 'причина не указана',
);

/* Chinese (Simplified)
*/
$messages['zh-hans'] = array(
'namespaces_1' => '是',
'namespaces_0' => '否',
'namespaces_reasonfield' => '原因',
'namespaces_addbutton' => '加入',
);

/** Traditional Chinese (‪中文(繁體)‬)
*/
$messages['zh-hant'] = array(
'namespaces_1' => '是',
'namespaces_0' => '否',
'namespaces_reasonfield' => '原因',
'namespaces_addbutton' => '加入',
);

SpecialNamespaces-1.0gerrit/SpecialNamespaces.php000064400000000000000000000146721213676351500222610ustar00rootroot00000000000000<?php
/**
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This extension requires memcached and uses [[mw:Manual:Hooks/CanonicalNamespaces]]
* see http://www.mediawiki.org/wiki/Extension:SpecialNamespaces
*
* SpecialNamespaces is an unsupported derivative work based on Special:Interwiki
*
* Authors of the original Interwiki extension were:
* @author Stephanie Amanda Stevens <phroziac@gmail.com>
* @author SPQRobin <robin_1273@hotmail.com>
* @copyright Copyright (C) 2005-2007 Stephanie Amanda Stevens
* @copyright Copyright (C) 2007 SPQRobin
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
* Formatting improvements Stephen Kennedy, 2006.
*/

if ( !defined( 'MEDIAWIKI' ) ) {
die();
}

$wgExtensionCredits['specialpage'][] = array(
'path' => __FILE__,
'name' => 'SpecialNamespaces',
'url' => 'https://mediawiki.org/wiki/Extension:SpecialNamespaces',
'description' => 'Adds a [[Special:Namespaces|special page]] to view and edit the namespaces table',
'author' => array( 'Stephanie Amanda Stevens', 'SPQRobin', 'others' ),
'descriptionmsg' => 'namespaces-desc',
);

$dir = dirname( __FILE__ ) . '/';
$wgExtensionMessagesFiles['Namespaces'] = $dir . 'SpecialNamespaces.i18n.php';
$wgExtensionAliasesFiles['Namespaces'] = $dir . 'SpecialNamespaces.alias.php';

$wgSpecialPages['Namespaces'] = 'SpecialNamespaces';
$wgSpecialPageGroups['Namespaces'] = 'wiki';
$wgAutoloadClasses['SpecialNamespaces'] = $dir . 'SpecialNamespaces_body.php';

$wgAvailableRights[] = 'namespaces';
$wgGroupPermissions['sysop']['namespaces'] = true;

$wgLogTypes[] = 'namespaces';
$wgLogNames['namespaces'] = 'namespaces_logpagename';
$wgLogHeaders['namespaces'] = 'namespaces_logpagetext';
$wgLogActions['namespaces/namespaces'] = 'namespaces_logentry';
$wgLogActions['namespaces/ns_add'] = 'namespaces_log_added';
$wgLogActions['namespaces/ns_delete'] = 'namespaces_log_deleted';
$wgLogActions['namespaces/ns_edit'] = 'namespaces_log_edited';

# hook to retrieve $wgExtraNamespaces[...] from cached database table (namespace_names)
$wgHooks['CanonicalNamespaces'][] = 'fnNamespaceHook';

# hook for initial database table creation on MW 1.18+
$wgHooks['LoadExtensionSchemaUpdates'][] = 'fnNamespaceSchemaUpdates';

/**
* Database table creation (invoked in maintenance/update.php script)
*
* Installs a hook to call fnNamespaceCreateTables() to build an empty 'namespace_names' MySQL table.
* If the table already exists, this code does nothing.
*/
function fnNamespaceSchemaUpdates( DatabaseUpdater $updater ) {
$updater->addExtensionUpdate( array( 'fnNamespaceCreateTables' ) );
return true;
}

/**
* Create database table 'namespace_names' if it does not already exist (invoked from update.php)
*
* @param DatabaseUpdater $updater - the instance of update.php which initiated this installation process
* @return (no return value) - output table (if created) is sent to main database with status to console
*/
function fnNamespaceCreateTables( $updater ) {
global $wgDBtype;
$base = dirname( __FILE__ );
$db = $updater->getDB();

if ( $db->tableExists( 'namespace_names' ) ) {
$updater->output( "...namespace_names table already exists.\n" );
} else {
$sourcefile = $wgDBtype === 'postgres' ? '/namespace_names.pg.sql' : '/namespace_names.sql';
$db->sourceFile( dirname( __FILE__ ) . $sourcefile );
}
$updater->output( "...namespace_names table added.\n" );
}

/**
* Retrieve list of canonical namespaces from database table 'namespace_names'
* Global namespace lists $wgExtraNamespaces[] and $wgNamespaceAliases[] are updated as needed
*
* This is a MediaWiki hook function, which uses the 'CanonicalNamespaces' hook in MW 1.17+
* Use of memcached (where available) is necessary to avoid severe performance penalty for multiple db accesses
*
* @param array &$namespaces - the list of canonical namespaces retrieved from 'namespace_names' will be placed here
* @return boolean true at all times (as a MediaWiki hook must always return a value)
*/
function fnNamespaceHook ( array &$namespaces ) {
global $wgExtraNamespaces, $wgNamespaceAliases;
global $wgDBname, $wgMemc;
global $wgSitename, $wgMetaNamespace, $wgMetaNamespaceTalk;

if ( $wgExtraNamespaces == NULL ) {
$wgExtraNamespaces = array();
}
if ( $wgNamespaceAliases == NULL ) {
$wgNamespaceAliases = array();
}

$key = wfMemcKey( 'SpecialNamespaces', 'names' );
$cached = $wgMemc->get( $key );

if ( ( $cached == NULL ) || ( !is_array( $cached ) ) ) {

// if namespaces are not in memcache, retrieve them from main database
$dbr =& wfGetDB( DB_SLAVE );
$res = $dbr->select( 'namespace_names', '*' );
$numrows = $dbr->numRows( $res );
if ( $numrows > 0 )
while ( $s = $dbr->fetchObject( $res ) ) {

// for each namespace...
$nsindex = htmlspecialchars( $s->ns_id );
$nsname = htmlspecialchars( $s->ns_name );
$nscanonical = htmlspecialchars( $s->ns_canonical );
$nsdefault = htmlspecialchars( $s->ns_default );
$nsname = str_replace( ' ', '_', $nsname );
$nsname = str_replace( ':', '', $nsname );

// add the namespace (or namespace alias) to global configuration variables
if ( $nsdefault > 0 ) {
$wgExtraNamespaces[$nsindex] = $nsname;
if ( $nsindex == NS_PROJECT ) {
$wgSitename = $nsname;
$wgMetaNamespace = str_replace( ' ', '_', $nsname );
}
if ( $nsindex == NS_PROJECT_TALK ) {
$wgMetaNamespaceTalk = str_replace( ' ', '_', $nsname );
}
} else {
$wgNamespaceAliases[$nsname] = $nsindex;
}

// if canonical, add the namespace to list of canonical names in MW hook parameter
if ( $nscanonical > 0 ) {
$namespaces[$nsindex] = $nsname;
}
}
$dbr->freeResult( $res );

// store this info to memcache for re-use on subsequent page loads
$wgMemc->set ( $key, array(
'ns' => $namespaces,
'ens' => $wgExtraNamespaces,
'aka' => $wgNamespaceAliases,
'site' => $wgSitename,
'project' => $wgMetaNamespace,
'prjtalk' => $wgMetaNamespaceTalk
) );
} else {
// if data was retrieved from memcache, use it directly
$namespaces = $cached['ns'];
$wgExtraNamespaces = $cached['ens'];
$wgNamespaceAliases = $cached['aka'];
$wgSitename = $cached['site'];
$wgMetaNamespace = $cached['project'];
$wgMetaNamespaceTalk = $cached['prjtalk'];
}
return true;
}
SpecialNamespaces-1.0gerrit/SpecialNamespaces_body.php000064400000000000000000000313621213676351500232710ustar00rootroot00000000000000<?php
/**
* implements Special:Namespaces
* @ingroup SpecialPage
*/
class SpecialNamespaces extends SpecialPage {
function __construct() {
parent::__construct( 'Namespaces' );
}

function discard() {
global $wgMemc;
$wgMemc->delete( wfMemcKey( 'SpecialNamespaces', 'names' ) );
}

function execute( $par ) {
$admin = $this->getUser()->isAllowed( 'namespaces' );
$this->setHeaders();
$this->outputHeader();

if ( $admin ) {
$this->getOutput()->setPagetitle( wfMessage( 'namespaces' ) );
} else {
$this->getOutput()->setPagetitle( wfMessage( 'namespaces-title-norights' ) );
}
$req = $this->getRequest();
$action = $req->getVal( 'action', $par );

switch ( $action ) {
case "delete":
case "edit" :
case "add" :
if ( !$admin ) {
$this->getOutput()->permissionRequired( 'namespaces' );
return;
}
$this->showForm( $action );
break;
case "submit":
if ( !$admin ) {
$this->getOutput()->permissionRequired( 'namespaces' );
return;
}
if ( !$req->wasPosted() || !$this->getUser()->matchEditToken( $req->getVal( 'wpEditToken' ) ) ) {
$this->getOutput()->addWikiMsg( 'sessionfailure' );
return;
}
$this->doSubmit();
break;
default:
$this->showList( $admin );
break;
}
}

function showForm( $action ) {
$actionUrl = $this->getTitle()->getLocalURL( 'action=submit' );
$req = $this->getRequest();
$token = $this->getUser()->getEditToken();
$defaultreason = $req->getVal( 'wpNamespacesReason', wfMessage( 'namespaces_defaultreason' )->text() );

switch ( $action ) {
case "delete":

$nsid = $req->getVal( 'prefix' );
$nsoldname = $req->getVal( 'name' );
$button = wfMessage( 'delete' )->text();
$topmessage = wfMessage( 'namespaces_delquestion', $nsid )->text();
$deletingmessage = wfMessage( 'namespaces_deleting', $nsoldname )->text();
$reasonmessage = wfMessage( 'deletecomment' )->text();

$this->getOutput()->addHTML(
Xml::openElement( 'fieldset' ) .
Xml::element( 'legend', null, $topmessage ) .
Xml::openElement( 'form', array( 'id' => 'mw-namespaces-deleteform', 'method' => 'post', 'action' => $actionUrl ) ) .
Xml::openElement( 'table' ) .
"<tr><td>$deletingmessage</td></tr>" .
'<tr><td class="mw-label">' . Xml::label( $reasonmessage, 'mw-namespaces-deletereason' ) . '</td>' .
'<td class="mw-input">' .
Xml::input( 'wpNamespacesReason', 60, $defaultreason, array( 'tabindex' => '1', 'id' => 'mw-namespaces-deletereason', 'maxlength' => '200' ) ) .
'</td></tr>' .
'<tr><td class="mw-submit">' . Xml::submitButton( $button, array( 'id' => 'mw-namespaces-submit' ) ) .
Html::hidden( 'wpNamespacesID', $nsid ) .
Html::hidden( 'wpNamespacesOldName', $nsoldname ) .
Html::hidden( 'wpNamespacesAction', $action ) .
Html::hidden( 'wpEditToken', $token ) .
'</td></tr>' .
Xml::closeElement( 'table' ) .
Xml::closeElement( 'form' ) .
Xml::closeElement( 'fieldset' )
);
break;
case "edit" :
case "add" :
if ( $action == "edit" ) {
$nsid = $req->getVal( 'prefix' );
$nsoldname = $req->getVal( 'name' );
$dbr = wfGetDB( DB_SLAVE );
$row = $dbr->selectRow( 'namespace_names', '*', array( 'ns_name' => $nsoldname, 'ns_id' => $nsid ) );
if ( !$row ) {
$this->error( 'namespaces_editerror', $nsoldname );
return;
}
$nsid = '<tt>' . htmlspecialchars( $row->ns_id ) . '</tt>';
$defaultname = $row->ns_name;
$nsdefault = $row->ns_default;
$nscanonical = $row->ns_canonical;
$old = Html::hidden( 'wpNamespacesID', $row->ns_id );
$old .= Html::hidden( 'wpNamespacesOldName', $row->ns_name );
$topmessage = wfMessage( 'namespaces_edittext' )->parse();
$intromessage = wfMessage( 'namespaces_editintro' )->parse();
$button = wfMessage( 'edit' )->text();
} else {
$nsid = $req->getVal( 'wpNamespacesID' ) ? $req->getVal( 'wpNamespacesID' ) : $req->getVal( 'prefix' );
$nsid = Xml::input( 'wpNamespacesID', 20, $nsid, array( 'tabindex' => '1', 'id' => 'mw-namespaces-nsid', 'maxlength' => '20' ) );
$nsdefault = $req->getCheck( 'wpNamespacesDefault' );
$nscanonical = $req->getCheck( 'wpNamespacesCanonical' );
$old = '';
$defaultname = $req->getVal( 'wpNamespacesName' ) ? $req->getVal( 'wpNamespacesName' ) : wfMessage( 'namespaces_defaultname' )->text() ;
$topmessage = wfMessage( 'namespaces_addtext' )->parse();
$intromessage = wfMessage( 'namespaces_addintro' )->parse();
$button = wfMessage( 'namespaces_addbutton' )->text();
}

$nsidmessage = wfMessage( 'namespaces_nsid' )->parse();
$nsdefaultmessage = wfMessage( 'namespaces_default' )->text();
$nscanonicalmessage = wfMessage( 'namespaces_canonical' )->text();
$reasonmessage = wfMessage( 'namespaces_reasonfield' )->text();
$nsnamemessage = wfMessage( 'namespaces_nsname' )->text();

$this->getOutput()->addHTML(
Xml::openElement( 'fieldset' ) .
Xml::element( 'legend', null, $topmessage ) .
$intromessage .
Xml::openElement( 'form', array( 'id' => 'mw-namespaces-editform', 'method' => 'post', 'action' => $actionUrl ) ) .
Xml::openElement( 'table', array( 'id' => "mw-namespaces-$action" ) ) .
"<tr><td class='mw-label'>$nsidmessage</td><td><tt>$nsid</tt></td></tr>" .
"<tr><td class='mw-label'>" . Xml::label( $nsdefaultmessage, 'mw-namespaces-nsdefault' ) . '</td>' .
"<td class='mw-input'>" . Xml::check( 'wpNamespacesDefault', $nsdefault, array( 'id' => 'mw-namespaces-nsdefault' ) ) . '</td></tr>' .
'<tr><td class="mw-label">' . Xml::label( $nscanonicalmessage, 'mw-namespaces-nscanonical' ) . '</td>' .
'<td class="mw-input">' . Xml::check( 'wpNamespacesCanonical', $nscanonical, array( 'id' => 'mw-namespaces-nscanonical' ) ) . '</td></tr>' .
'<tr><td class="mw-label">' . Xml::label( $nsnamemessage, 'mw-namespaces-nsname' ) . '</td>' .
'<td class="mw-input">' . Xml::input( 'wpNamespacesName', 60, $defaultname, array( 'tabindex' => '1', 'maxlength' => '200', 'id' => 'mw-namespaces-nsname' ) ) . '</td></tr>' .
'<tr><td class="mw-label">' . Xml::label( $reasonmessage, 'mw-namespaces-editreason' ) . '</td>' .
'<td class="mw-input">' . Xml::input( 'wpNamespacesReason', 60, $defaultreason, array( 'tabindex' => '1', 'id' => 'mw-namespaces-editreason', 'maxlength' => '200' ) ) .
Html::hidden( 'wpNamespacesAction', $action ) .
$old .
Html::hidden( 'wpEditToken', $token ) .
'</td></tr>' .
'<tr><td class="mw-submit">' . Xml::submitButton( $button, array( 'id' => 'mw-namespaces-submit' ) ) . '</td></tr>' .
Xml::closeElement( 'table' ) .
Xml::closeElement( 'form' ) .
Xml::closeElement( 'fieldset' )
);
break;
}
}

function doSubmit() {
$req = $this->getRequest();
$nsoldname = $req->getVal( 'wpNamespacesOldName' );
$nsid = $req->getVal( 'wpNamespacesID' );
$do = $req->getVal( 'wpNamespacesAction' );
$nsoldname = str_replace( '+', '_', $nsoldname );
if ( preg_match( '/[\s:&=]/', $nsid ) ) {
$this->error( 'namespaces-badprefix', htmlspecialchars( $nsid ) );
$this->showForm( $do );
return;
}
$reason = $req->getText( 'wpNamespacesReason' );
$selfTitle = $this->getTitle();
$dbw = wfGetDB( DB_MASTER );
switch ( $do ) {
case "delete":
$dbw->delete( 'namespace_names', array( 'ns_name' => $nsoldname, 'ns_id' => $nsid ), __METHOD__ );

if ( $dbw->affectedRows() == 0 ) {
$this->error( 'namespaces_delfailed', $nsoldname );
$this->showForm( $do );
} else {
$this->getOutput()->addWikiText( wfMessage( 'namespaces_deleted', $nsoldname )->text() );
$this->getOutput()->returnToMain( false, $selfTitle );
$log = new LogPage( 'namespaces' );
$log->addEntry( 'ns_delete', $selfTitle, $reason, array( $nsoldname ) );
}
$this->discard();
break;
case "edit":
case "add":
$newname = $req->getVal( 'wpNamespacesName' );
$nsdefault = $req->getCheck( 'wpNamespacesDefault' ) ? 1 : 0;
$nscanonical = $req->getCheck( 'wpNamespacesCanonical' ) ? 1 : 0;
$data = array( 'ns_id' => $nsid, 'ns_name' => $newname,
'ns_default' => $nsdefault, 'ns_canonical' => $nscanonical );

if ( $do == 'add' ) {
$dbw->insert( 'namespace_names', $data, __METHOD__, 'IGNORE' );
} else {
$dbw->update( 'namespace_names', $data, array( 'ns_name' => $nsoldname ), __METHOD__, 'IGNORE' );
}

if ( $dbw->affectedRows() == 0 ) {
$this->error( "namespaces_{$do}failed", $nsid );
$this->showForm( $do );
} else {
$this->getOutput()->addWikiMsg( "namespaces_{$do}ed", $nsid );
$this->getOutput()->returnToMain( false, $selfTitle );
$log = new LogPage( 'namespaces' );
$log->addEntry( 'ns_' . $do, $selfTitle, $reason, array( $nsid, $newname, $nsdefault, $nscanonical ) );
}
$this->discard();
break;
}
}

function trans_default( $tl, $msg0, $msg1 ) {
if ( $tl === '0' )
return $msg0;
if ( $tl === '1' )
return $msg1;
return htmlspecialchars( $tl );
}

function showList( $admin ) {
global $wgScriptPath;

$this->getOutput()->addExtensionStyle( "{$wgScriptPath}/extensions/Namespaces/SpecialNamespaces.css" );

$nsidmessage = wfMessage( 'namespaces_nsid' )->parse();
$nsnamemessage = wfMessage( 'namespaces_nsname' )->parse();
$nsdefaultmessage = wfMessage( 'namespaces_default' )->parse();
$nscanonicalmessage = wfMessage( 'namespaces_canonical' )->parse();
$message_0 = wfMessage( 'namespaces_0' )->parse();
$message_1 = wfMessage( 'namespaces_1' )->parse();

$out = '
<table width="100%" cellspacing="0" cellpadding="0" border="0" style="border:0" class="mw-namespacestable wikitable intro">
<tr><th class="mw-align-left">' . $nsidmessage . '</th><td>' . wfMessage( 'namespaces_nsid_intro' )->parse() . '</td></tr>
<tr><th class="mw-align-left">' . $nsnamemessage . '</th><td>' . wfMessage( 'namespaces_nsname_intro' )->parse() . '</td></tr>
<tr><th class="mw-align-left">' . $nsdefaultmessage . '</th><td>' . wfMessage( 'namespaces_default_intro' )->parse() . '</td></tr>
<tr><th class="mw-align-right">' . $message_1 . '</th><td>' . wfMessage( 'namespaces_default_1_intro' )->parse() . '</td></tr>
<tr><th class="mw-align-right">' . $message_0 . '</th><td>' . wfMessage( 'namespaces_default_0_intro' )->parse() . '</td></tr>
<tr><th class="mw-align-left">' . $nscanonicalmessage . '</th><td>' . wfMessage( 'namespaces_canonical_intro' )->parse() . '</td></tr>';
$out .= '
<tr><th class="mw-align-right">' . $message_1 . '</th><td>' . wfMessage( 'namespaces_canonical_1_intro' )->parse() . '</td></tr>
<tr><th class="mw-align-right">' . $message_0 . '</th><td>' . wfMessage( 'namespaces_canonical_0_intro' )->parse() . '</td></tr>
';
$out .= '</table>
';
$this->getOutput()->addWikiMsg( 'namespaces_intro' );
$this->getOutput()->addHTML( $out );
$this->getOutput()->addWikiMsg( 'namespaces_intro_footer' );
$selfTitle = $this->getTitle();

if ( $admin ) {
$skin = $this->getUser()->getSkin();
$addtext = wfMessage( 'namespaces_addtext' )->parse();
$addlink = Linker::link( $selfTitle, $addtext, array(), array( 'action' => 'add' ) );
$this->getOutput()->addHTML( '<p>' . $addlink . '</p>' );
}

$dbr = wfGetDB( DB_SLAVE );
$res = $dbr->select( 'namespace_names', '*', 1, __METHOD__, array( 'ORDER BY' => 'ns_id' ) );
$numrows = $res->numRows();
if ( $numrows == 0 ) {
$this->error( 'namespaces_error' );
return;
}

$out = "
<table width='100%' class='mw-namespacestable wikitable body'>
<tr id='namespacestable-header'><th>$nsidmessage</th> <th>$nsnamemessage</th> <th>$nsdefaultmessage</th> <th>$nscanonicalmessage</th>";
if ( $admin ) {
$deletemessage = wfMessage( 'delete' )->parse();
$editmessage = wfMessage( 'edit' )->parse();
$out .= '<th>' . wfMessage( 'namespaces_edit' )->parse() . '</th>';
}
$out .= "</tr>\n";

while ( $s = $res->fetchObject() ) {
$nsid = htmlspecialchars( $s->ns_id );
$nsname = htmlspecialchars( $s->ns_name );
$nsdefault = $this->trans_default( $s->ns_default, $message_0, $message_1 );
$nscanonical = $this->trans_default( $s->ns_canonical, $message_0, $message_1 );
$out .= "<tr class='mw-namespacestable-row'>
<td class='mw-namespacestable-nsid'>$nsid</td>
<td class='mw-namespacestable-nsname'>$nsname</td>
<td class='mw-namespacestable-nsdefault'>$nsdefault</td>
<td class='mw-namespacestable-nscanonical'>$nscanonical</td>";
if ( $admin ) {
$out .= '<td class="mw-namespacestable-modify">';
$out .= $skin->link( $selfTitle, $editmessage, array(),
array( 'action' => 'edit', 'prefix' => $nsid, 'name' => $nsname ) );
$out .= ', ';
$out .= $skin->link( $selfTitle, $deletemessage, array(),
array( 'action' => 'delete', 'prefix' => $nsid, 'name' => $nsname ) );
$out .= '</td>';
}

$out .= "\n</tr>\n";
}
$res->free();
$out .= "</table><br />";
$this->getOutput()->addHTML( $out );
}

function error() {
$args = func_get_args();
$this->getOutput()->wrapWikiMsg( "<p class='error'>$1</p>", $args );
}
}
SpecialNamespaces-1.0gerrit/namespace_names.pg.sql000064400000000000000000000004351213676351500224250ustar00rootroot00000000000000-- This is the Postgres version
-- See namespace_names.sql for the original version

BEGIN;

CREATE TABLE namespace_names (
ns_id INTEGER NOT NULL DEFAULT 0,
ns_name TEXT NOT NULL DEFAULT '',
ns_default INTEGER NOT NULL DEFAULT 0,
ns_canonical INTEGER DEFAULT NULL
);

COMMIT;
SpecialNamespaces-1.0gerrit/namespace_names.sql000064400000000000000000000006321213676351500220170ustar00rootroot00000000000000-- Tables for the SpecialNamespaces extension
-- vim: autoindent syn=mysql sts=2 sw=2
-- Replace /*$wgDBprefix*/ with the proper prefix

CREATE TABLE /*$wgDBprefix*/namespace_names (
`ns_id` INT(8) NOT NULL DEFAULT '0',
`ns_name` VARCHAR(200) NOT NULL DEFAULT '',
`ns_default` tinyint(1) NOT NULL DEFAULT '0',
`ns_canonical` tinyint(1) DEFAULT NULL,
PRIMARY KEY (`ns_name`)
) /*$wgDBTableOptions*/;

 
: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
: Michael Shigorin