Extension:MsCatSelect

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual - list
Crystal Clear action run.png
MsCatSelect

Release status: stable

Implementation Page action, Ajax
Description Add a page to categories by selecting in a dropdown on the edit page.
Author(s) Martin Schwindl (RatinTalk)
Last version 4.5 (2011-11-15)
MediaWiki 1.15 - 1.17
License GPL
Download http://www.ratin.de/mscatselect.html
Parameters

$wgMainCategories $wgWarnNoCat

Hooks used
EditPage::showEditForm:initial

EditPage::attemptSave

Check usage (experimental)


The MsCatSelect extension:

  • Adds a page to categories by selecting in a dropdown on the edit page.
  • Remove categories easily from a page.
  • Define a custom list of categories.
  • Set a specific Sortkey for each category.


Furthermore:

  • If you select a category in the dropdown list another dropdown will be created with all subcategories.
  • The selected categories are receaved directly from the database (and not extracted from the text).
  • MsCatSelect will include jQuery (if you use MW 1.16)
  • This extension is based on the SelectCategory-Extension

Mscs 1.jpg Mscs 2.jpg


Contents

[edit] Usage

[edit] Installation

To install this extension, add the following to LocalSettings.php:

//Start------------------------MsCatSelect
$wgWarnNoCat = false;
require_once("$IP/extensions/MsCatSelect/mscatselect.php");
//$wgMainCategories = array("Category1","Category2");
//End--------------------------MsCatSelect

[edit] Configuration parameters

[edit] $wgWarnNoCat

Defines if you want to get warned if there is no category defined for this page.

$wgWarnNoCat  = true;

[edit] $wgMainCategories

Is an array filled with categories which should be loaded in the first dropdown. If this array is nonexistend all main categories (categories which are not a subcategory) of the wiki are loaded automaticaly.

$wgMainCategories = array("Category1","Category2");


[edit] Pages

[edit] mscatselect.i18n.php

<?php
/**
 * Internationalisation file for extension MsCatSelect.
 *  
 * @author Martin Schwindl  <martin.schwindl@ratin.de> 
 * @copyright © 2011 by Martin Schwindl
 *
 * @licence GNU General Public Licence 2.0 or later
 */
 
$messages = array();
 
/** German (Deutsch)
 * @author Martin Schwindl  <martin.schwindl@ratin.de>
 */
$messages['de'] = array(
        'selectcategory-title' => 'Oberkategorie auswählen',
        'selectcategory-untercat' => 'Neue Unterkategorie',
        'selectcategory-untercat-hinw' => 'wird in vorrausgew&auml;hlter Oberkategorie erstellt',
        'selectcategory-warnnocat' => 'VORSICHT: Diese Seite enth&auml;lt noch keine Kategorie. Bitte f&uuml;gen Sie zuerst eine Kategorie hinzu!',
        'selectcategory-cats' => 'Bereits vergebene Kategorien', 
        'selectcategory-add' => 'hinzuf&uuml;gen',
        'selectcategory-go' => 'erstellen',       
);
 
/** Czech (Česky) 1.0
 * @author Neřeknu   <narodni.hrdost@Safe-mail.net>
 */
$messages['cs'] = array(
       'selectcategory-title' => 'Hlavní kategorie',
       'selectcategory-untercat' => 'Nová podkategorie',
       'selectcategory-untercat-hinw' => 'bude vytvořena ve výše uvedené kategorii',
       'selectcategory-warnnocat' => 'UPOZORNĚNÍ: Tato stránka není zařazena do žádné kategorie. Prosím zvolte nějakou kategorii!',
       'selectcategory-cats' => 'Již přiřazené kategorie',
       'selectcategory-add' => 'přidat',
       'selectcategory-go' => 'vytvořit',
);
 
/** English
 */
Personal tools
Namespaces

Variants
Actions
Navigation
Support
Download
Development
Communication
Print/export
Toolbox