Aktionen

MediaWiki

Sidebar: Unterschied zwischen den Versionen

Aus Gemeinwohlwiki Braunschweig

(Änderung 891 von Matthias (Diskussion) rückgängig gemacht.)
Zeile 1: Zeile 1:
$wgHooks['BaseTemplateToolbox'][] = 'modifyToolbox';
+
* Navigation
 +
** mainpage|mainpage-description
 +
* Initiativen
 +
** Kategorie:Alle Initiativen|Initiativen nach Namen
 +
** Kategorie:Themen|Initiativen nach Themen
 +
** Kategorie:Methoden|Initiativen nach Methoden
 +
** Kategorie:Zielgruppen|Initiativen nach Zielgruppen
 +
* Wissen
 +
** Kategorie: Tipps & Erfahrungen|Tipps & Erfahrungen
 +
** Kategorie: Kommunikationstools|Kommunikationstools
 +
** Kategorie: Organisationstools|Organisationstools
 +
* Ressourcen
 +
** Ressourcenangebote|Ressourcenangebote
 +
* Anleitungen
 +
** Kategorie:Kopiervorlagen|Anleitungen und Kopiervorlagen
  
function modifyToolbox( BaseTemplate $baseTemplate, array &$toolbox ) {
+
* SEARCH
 
+
* TOOLBOX
static $keywords = array( 'WHATLINKSHERE', 'RECENTCHANGESLINKED', 'FEEDS', 'CONTRIBUTIONS', 'LOG', 'BLOCKIP', 'EMAILUSER', 'USERRIGHTS', 'UPLOAD', 'SPECIALPAGES', 'PRINT', 'PERMALINK', 'INFO' );
+
** WHATLINKSHERE|whatlinkshere
 
+
** UPLOAD|upload
$modifiedToolbox = array();
+
** SPECIALPAGES|specialpages
 
 
// Walk in the MediaWiki:Sidebar message, section toolbox
 
foreach ( $baseTemplate->data['sidebar']['TOOLBOX'] as $value ) {
 
$specialLink = false;
 
 
 
// Search if the keyword exists
 
foreach ( $keywords as $key ) {
 
if ( $value['href'] == Title::newFromText($key)->fixSpecialName()->getLinkURL() ) {
 
$specialLink = true;
 
 
 
// This is a keyword, hence add this special link
 
if ( array_key_exists( strtolower($key), $toolbox ) ) {
 
$modifiedToolbox[strtolower($key)] = $toolbox[strtolower($key)];
 
break;
 
}
 
}
 
}
 
 
 
// This is a normal link
 
if ( !$specialLink ) {
 
$modifiedToolbox[] = $value;
 
}
 
}
 
 
 
$toolbox = $modifiedToolbox;
 
 
 
return true;
 
}
 

Version vom 12. Januar 2021, 08:43 Uhr

  • Navigation
    • mainpage|mainpage-description
  • Initiativen
    • Kategorie:Alle Initiativen|Initiativen nach Namen
    • Kategorie:Themen|Initiativen nach Themen
    • Kategorie:Methoden|Initiativen nach Methoden
    • Kategorie:Zielgruppen|Initiativen nach Zielgruppen
  • Wissen
    • Kategorie: Tipps & Erfahrungen|Tipps & Erfahrungen
    • Kategorie: Kommunikationstools|Kommunikationstools
    • Kategorie: Organisationstools|Organisationstools
  • Ressourcen
    • Ressourcenangebote|Ressourcenangebote
  • Anleitungen
    • Kategorie:Kopiervorlagen|Anleitungen und Kopiervorlagen
  • SEARCH
  • TOOLBOX
    • WHATLINKSHERE|whatlinkshere
    • UPLOAD|upload
    • SPECIALPAGES|specialpages