reduce broken form submissions
* Add --old-redirects-only option to maintenance/refreshLinks.php, to add old
redirects to the redirect table
-* (bug 10457) Reorganize Special:Specialpages. Customizable by editing
- [[MediaWiki:specialpages-tpl]]
=== Bug fixes in 1.13 ===
*/
/**
- * Main function
+ *
*/
function wfSpecialSpecialpages() {
global $wgOut, $wgUser, $wgMessageCache;
$wgMessageCache->loadAllMessages();
$wgOut->setRobotpolicy( 'noindex,nofollow' ); # Is this really needed?
+ $sk = $wgUser->getSkin();
- # Read the special pages
- $pagesRegular = SpecialPage::getRegularPages();
- $pagesRestricted = SpecialPage::getRestrictedPages();
- if( count( $pagesRegular ) == 0 && count( $pagesRestricted ) == 0 ) {
- # Yeah, that was pointless. Thanks for coming.
- return;
- }
-
- # Put regular and restricted special pages into sortable arrays
- $unsortedPagesRegular = wfSpecialSpecialpages_read( $pagesRegular );
- $unsortedPagesRestricted = wfSpecialSpecialpages_read( $pagesRestricted );
-
- # Read the template
- $tpl = wfMsg( 'specialpages-tpl' );
- $newSpecialPage = '';
-
- # Parse the template and create a localized wikitext page
- foreach ( explode( "\n", $tpl ) as $line ) {
- # Look for 'special:' in the line
- $pos = strpos( strtolower( $line ), 'special:' );
- if( $pos >= 0 ) {
-
- # Preserve the line start
- $lineStart = ( $pos > 0 ) ? substr( $line, 0, $pos ) : '';
+ /** Pages available to all */
+ wfSpecialSpecialpages_gen( SpecialPage::getRegularPages(), 'spheading', $sk );
- # Get the canonical special page name
- $canonical = strtolower( trim( substr( $line, $pos + strlen( 'special:' ) ) ) );
-
- # Check if it is a valid regular special page name
- # Restricted pages will be added at the end
- if( isset( $unsortedPagesRegular[$canonical] ) ) {
- # Add a new line
- $newSpecialPage .= $lineStart . "[[special:" . $canonical . "|" . $unsortedPagesRegular[$canonical] . "]]\n";
- # Delete this regular special page from the array to avoid double output
- unset( $unsortedPagesRegular[$canonical] );
- } else {
- # Ok, no valid special page, but add the line to the output
- $newSpecialPage .= $line . "\n";
- }
- } else {
- $newSpecialPage .= $line . "\n";
- }
- }
-
- # Add the rest
- $newSpecialPage .= wfSpecialSpecialpages_out( 'specialpages-other', $unsortedPagesRegular );
- # Add the restricted special pages
- $newSpecialPage .= wfSpecialSpecialpages_out( 'restrictedpheading', $unsortedPagesRestricted );
-
- # Output the customized special pages list
- $wgOut->addWikiText( $newSpecialPage );
-
- if ( $wgUser->isAllowed( 'editinterface' ) ) {
- # Output a nice link to edit the template
- $wgOut->addHtml( wfSpecialSpecialpages_edit() );
- }
+ /** Restricted special pages */
+ wfSpecialSpecialpages_gen( SpecialPage::getRestrictedPages(), 'restrictedpheading', $sk );
}
/**
- * Output the rest special pages as wikitext
- * @param string $heading Message name for the heading
- * @param array $sortedPages List of other special pages
- * @return string $rest Wikitext
+ * sub function generating the list of pages
+ * @param $pages the list of pages
+ * @param $heading header to be used
+ * @param $sk skin object ???
*/
-function wfSpecialSpecialpages_out( $heading, $pages ) {
+function wfSpecialSpecialpages_gen($pages,$heading,$sk) {
global $wgOut, $wgSortSpecialPages;
if( count( $pages ) == 0 ) {
return;
}
- # Sort
- if ( $wgSortSpecialPages ) {
- asort( $pages );
+ /** Put them into a sortable array */
+ $sortedPages = array();
+ foreach ( $pages as $page ) {
+ if ( $page->isListed() ) {
+ $sortedPages[$page->getDescription()] = $page->getTitle();
+ }
}
- # Now output the rest special pages as wikitext
- $rest = '== ' . wfMsgExt( $heading, array( 'parseinline' ) ) . " ==\n";
- foreach ( $pages as $title => $desc ) {
- $rest .= "* [[special:" . $title . "|" . $desc . "]]\n";
+ /** Sort */
+ if ( $wgSortSpecialPages ) {
+ ksort( $sortedPages );
}
- return $rest;
-}
-/**
- * Create array with descriptions and names of special pages
- * @param array $pagelist List of special pages
- * @return array $unsortedPagesList Wikitext
- */
-function wfSpecialSpecialpages_read( $pagelist ) {
- $unsortedPagesList = array();
- foreach ( $pagelist as $page ) {
- if ( $page->isListed() ) {
- $name = strtolower( $page->getName() );
- $unsortedPagesList[$name] = $page->getDescription();
- }
+ /** Now output the HTML */
+ $wgOut->addHTML( '<h2>' . wfMsgHtml( $heading ) . "</h2>\n<ul>" );
+ foreach ( $sortedPages as $desc => $title ) {
+ $link = $sk->makeKnownLinkObj( $title , htmlspecialchars( $desc ) );
+ $wgOut->addHTML( "<li>{$link}</li>\n" );
}
- return $unsortedPagesList;
+ $wgOut->addHTML( "</ul>\n" );
}
-/**
- * Build edit link to MediaWiki:specialpages-tpl
- *
- * @return string
- */
-function wfSpecialSpecialpages_edit() {
- global $wgUser, $wgContLang;
- $align = $wgContLang->isRtl() ? 'left' : 'right';
- $skin = $wgUser->getSkin();
- $link = $skin->makeLink ( 'MediaWiki:specialpages-tpl', wfMsgHtml( 'specialpages-edit' ) );
- return '<p style="float:' . $align . ';" class="mw-specialspecialpages-edit">' . $link . '</p>';
-}
+
'protectedtitlesempty' => 'Zur Zeit sind mit den angegebenen Parametern keine Seiten zur Neuerstellung gesperrt.',
'listusers' => 'Benutzerverzeichnis',
'listusers-summary' => "Diese Spezialseite listet alle registrierten Benutzer auf; die Gesamtzahl kann [[Special:Statistics|hier]] eingesehen werden. Über das Auswahlfeld ''Gruppe'' lässt sich die Abfrage auf bestimmte Benutzergruppen einschränken.",
+'specialpages' => 'Spezialseiten',
+'specialpages-summary' => 'Diese Seite bietet einen Überblick aller Spezialseiten. Diese werden automatisch generiert und können nicht bearbeitet werden.',
+'spheading' => 'Spezialseiten für alle Benutzer',
+'restrictedpheading' => 'Spezialseiten für Administratoren',
'newpages' => 'Neue Seiten',
'newpages-summary' => 'Diese Spezialseite listet alle neu erstellten Seiten der letzten 30 Tage auf. Die Ausgabe kann auf einen Namensraum und/oder Benutzernamen eingeschränkt werden.',
'newpages-username' => 'Benutzername:',
'pager-newer-n' => '{{PLURAL:$1|nächster|nächste $1}}',
'pager-older-n' => '{{PLURAL:$1|vorheriger|vorherige $1}}',
-# Special:Specialpages
-'specialpages' => 'Spezialseiten',
-'specialpages-summary' => 'Diese Seite bietet einen Überblick aller Spezialseiten.',
-'specialpages-other' => 'Weitere Spezialseiten für alle Benutzer',
-'restrictedpheading' => 'Spezialseiten für Benutzer mit erweiterten Rechten',
-'specialpages-edit' => 'Diese Seite bearbeiten',
-'specialpages-tpl' => '
-<!-- Format: pro Zeile ein kanonischer (englischer) Spezialseitenname:
-* special:specialpagename
-Alle anderen Zeilen werden als normaler (Wiki)Text ausgewertet -->
-== Allgemeine Listen ==
-{{int:specialpages-tpl-lists}}
-
-== Wartungslisten ==
-{{int:specialpages-tpl-maint}}
-
-== Werkzeuge ==
-{{int:specialpages-tpl-tools}}
-
-== Logbücher und Informationen ==
-{{int:specialpages-tpl-info}}
-
-== Persönliche Seiten ==
-{{int:specialpages-tpl-pers}}',
-
# Book sources
'booksources' => 'ISBN-Suche',
'booksources-summary' => 'Auf dieser Spezialseite kannst du eine ISBN eingeben und erhältst dann eine Liste mit Onlinekatalogen und Bezugsmöglichkeiten zur gesuchten ISBN. Bindestriche oder Leerzeichen zwischen den Ziffern spielen für die Suche keine Rolle.',
'protectedtitlesempty' => 'No titles are currently protected with these parameters.',
'listusers' => 'User list',
'listusers-summary' => '', # only translate this message to other languages if you have to change it
+'specialpages' => 'Special pages',
+'specialpages-summary' => '', # only translate this message to other languages if you have to change it
+'spheading' => 'Special pages for all users',
+'restrictedpheading' => 'Restricted special pages',
'newpages' => 'New pages',
'newpages-summary' => '', # only translate this message to other languages if you have to change it
'newpages-username' => 'Username:',
'pager-newer-n' => '{{PLURAL:$1|newer 1|newer $1}}',
'pager-older-n' => '{{PLURAL:$1|older 1|older $1}}',
-# Special:Specialpages
-'specialpages' => 'Special pages',
-'specialpages-summary' => '', # only translate this message to other languages if you have to change it
-'specialpages-other' => 'More special pages for all users',
-'restrictedpheading' => 'Restricted special pages',
-'specialpages-edit' => 'Edit this page',
-'specialpages-tpl' => '
-<!-- Format: per line one canonical (english) special page name:
-* special:specialpagename
-All other lines are rendered as normal (wiki)text -->
-== General page lists ==
-{{int:specialpages-tpl-lists}}
-
-== Maintenance page lists ==
-{{int:specialpages-tpl-maint}}
-
-== Tools ==
-{{int:specialpages-tpl-tools}}
-
-== Logs and information ==
-{{int:specialpages-tpl-info}}
-
-== Personal pages ==
-{{int:specialpages-tpl-pers}}',
-
-'specialpages-tpl-lists' => '
-* special:Allpages
-* special:Prefixindex
-* special:Categories
-* special:Disambiguations
-* special:Listredirects', # don't translate or duplicate this message to other languages
-
-'specialpages-tpl-tools' => '
-* special:Export
-* special:Filepath
-* special:MIMEsearch
-* special:Randompage
-* special:Randomredirect
-* special:Search
-* special:Upload', # don't translate or duplicate this message to other languages
-
-'specialpages-tpl-maint' => '
-* special:Mostcategories
-* special:Fewestrevisions
-* special:Mostrevisions
-* special:BrokenRedirects
-* special:Deadendpages
-* special:DoubleRedirects
-* special:Longpages
-* special:Mostlinkedcategories
-* special:Mostimages
-* special:Mostlinked
-* special:Mostlinkedtemplates
-* special:Popularpages
-* special:Ancientpages
-* special:Lonelypages
-* special:Shortpages
-* special:Withoutinterwiki
-* special:Protectedpages
-* special:Protectedtitles
-* special:Uncategorizedcategories
-* special:Uncategorizedimages
-* special:Uncategorizedpages
-* special:Uncategorizedtemplates
-* special:Unusedcategories
-* special:Unusedimages
-* special:Unusedtemplates', # don't translate or duplicate this message to other languages
-'specialpages-tpl-info' => '
-* special:Ipblocklist
-* special:Booksources
-* special:Imagelist
-* special:Log
-* special:Newpages
-* special:Newimages
-* special:Recentchanges
-* special:Statistics
-* special:Allmessages
-* special:Contributions
-* special:Listusers
-* special:Version
-* special:Wantedcategories
-* special:Wantedpages
-* special:Whatlinkshere', # don't translate or duplicate this message to other languages
-'specialpages-tpl-pers' => '
-* special:Preferences
-* special:Watchlist
-* special:Userlogin', # don't translate or duplicate this message to other languages
-
# Book sources
'booksources' => 'Book sources',
'booksources-summary' => '', # only translate this message to other languages if you have to change it
'sp-contributions-username' => 'IP Address or username:',
'sp-contributions-submit' => 'Search',
'sp-contributions-explain' => '', # only translate this message to other languages if you have to change it
-'sp-contributions-footer' => '-',
+'sp-contributions-footer' => '-', # don't translate or duplicate this message to other languages
'sp-contributions-footer-anon' => '-', # don't translate or duplicate this message to other languages
'sp-newimages-showfrom' => 'Show new files starting from $1',
Images are shown in full resolution, other file types are started with their associated program directly.
Enter the file name without the "{{ns:image}}:" prefix.',
+
);
'protectedtitlestext' => 'Les titres suivants sont protégés à la création',
'protectedtitlesempty' => "Aucun titre n'est actuellement protégé avec ces paramètres.",
'listusers' => 'Liste des inscrits',
+'specialpages' => 'Pages spéciales',
+'spheading' => 'Pages spéciales',
+'restrictedpheading' => 'Pages spéciales réservées',
'newpages' => 'Nouvelles pages',
'newpages-username' => 'Utilisateur :',
'ancientpages' => 'Articles les moins récemment modifiés',
'pager-newer-n' => '{{PLURAL:$1|1 plus récente|$1 plus récentes}}',
'pager-older-n' => '{{PLURAL:$1|1 plus ancienne|$1 plus anciennes}}',
-# Special:Specialpages
-'specialpages' => 'Pages spéciales',
-'specialpages-other' => 'Autres pages spéciales pour tous les utilisateurs',
-'restrictedpheading' => 'Pages spéciales réservées',
-'specialpages-edit' => 'Modifier cette page',
-'specialpages-tpl' => '
-<!-- Format: un nom canonique (en anglais) de page spéciale par ligne :
-* special:specialpagename
-Toutes les autres lignes seront considérées comme du (wiki)text normal -->
-== Pages générales ==
-{{int:specialpages-tpl-lists}}
-
-== Maintenance ==
-{{int:specialpages-tpl-maint}}
-
-== Outils ==
-{{int:specialpages-tpl-tools}}
-
-== Journaux et autres informations ==
-{{int:specialpages-tpl-info}}
-
-== Pages personnelles ==
-{{int:specialpages-tpl-pers}}',
-
# Book sources
'booksources' => 'Ouvrages de référence',
'booksources-search-legend' => 'Rechercher parmi des ouvrages de référence',
<strong>אם זהו ניסיון עריכה לגיטימי, אנא נסו שנית. אם זה לא עוזר, נסו לצאת מהחשבון ולהיכנס אליו שנית.</strong>',
'token_suffix_mismatch' => '<strong>עריכתכם נדחתה כיוון שהדפדפן שלכם מחק את תווי הניקוד בסימון העריכה. העריכה נדחתה כדי למנוע בעיות כאלה בטקסט של הדף. ייתכן שזה קרה בגלל שירות פרוקסי אנונימי פגום.</strong>',
'editing' => 'עריכת $1',
+'editinguser' => "משנה את הרשאות המשתמש של '''[[User:$1|$1]]''' ([[User talk:$1|{{int:talkpagelinktext}}]] | [[Special:Contributions/$1|{{int:contribslink}}]])",
'editingsection' => 'עריכת $1 (פסקה)',
'editingcomment' => 'עריכת $1 (הערה)',
'editconflict' => 'התנגשות עריכה: $1',
'userrights-lookup-user' => 'ניהול קבוצות משתמש',
'userrights-user-editname' => 'שם משתמש:',
'editusergroup' => 'עריכת קבוצות משתמשים',
-'editinguser' => "משנה את הרשאות המשתמש של '''[[User:$1|$1]]''' ([[User talk:$1|{{int:talkpagelinktext}}]] | [[Special:Contributions/$1|{{int:contribslink}}]])",
'userrights-editusergroup' => 'עריכת קבוצות משתמש',
'saveusergroups' => 'שמירת קבוצות משתמש',
'userrights-groupsmember' => 'חבר בקבוצות:',
'protectedtitlestext' => 'הכותרות הבאות מוגנות מפני יצירה:',
'protectedtitlesempty' => 'אין כרגע כותרות מוגנות עם הפרמטרים האלה.',
'listusers' => 'רשימת משתמשים',
+'specialpages' => 'דפים מיוחדים',
+'spheading' => 'דפים מיוחדים',
+'restrictedpheading' => 'דפים מיוחדים מוגבלים',
'newpages' => 'דפים חדשים',
'newpages-username' => 'שם משתמש:',
'ancientpages' => 'דפים מוזנחים',
'pager-newer-n' => '{{plural:$1|הבאה|$1 הבאות}}',
'pager-older-n' => '{{plural:$1|הקודמת|$1 הקודמות}}',
-# Special:Specialpages
-'specialpages' => 'דפים מיוחדים',
-'specialpages-other' => 'דפים מיוחדים נוספים לכל המשתמשים',
-'restrictedpheading' => 'דפים מיוחדים מוגבלים',
-'specialpages-edit' => 'עריכה',
-'specialpages-tpl' => '
-<!-- פורמט: בכל שורה, השם הרגיל (באנגלית) של כל דף מיוחד
-* special:specialpagename
-כל השורות האחרות מפורשת כטקסט ויקי רגיל -->
-== רשימות דפים כלליות ==
-{{int:specialpages-tpl-lists}}
-
-== רשימות דפים לתחזוקה ==
-{{int:specialpages-tpl-maint}}
-
-== כלים ==
-{{int:specialpages-tpl-tools}}
-
-== יומנים ומידע ==
-{{int:specialpages-tpl-info}}
-
-== דפים אישיים ==
-{{int:specialpages-tpl-pers}}',
-
# Book sources
'booksources' => 'משאבי ספרות חיצוניים',
'booksources-search-legend' => 'חיפוש משאבי ספרות חיצוניים',
'talkpagetext',
'trackback',
'trackbackexcerpt',
- 'specialpages-tpl-lists',
- 'specialpages-tpl-tools',
- 'specialpages-tpl-maint',
- 'specialpages-tpl-info',
- 'specialpages-tpl-pers',
);
/** Optional messages, which may be translated only if changed in the other language. */
'protectedtitlesempty',
'listusers',
'listusers-summary',
+ 'specialpages',
+ 'specialpages-summary',
+ 'spheading',
+ 'restrictedpheading',
'newpages',
'newpages-summary',
'newpages-username',
'pager-newer-n',
'pager-older-n',
),
- 'specialspecialpages' => array(
- 'specialpages',
- 'specialpages-summary',
- 'specialpages-other',
- 'restrictedpheading',
- 'specialpages-edit',
- 'specialpages-tpl',
- 'specialpages-tpl-lists',
- 'specialpages-tpl-tools',
- 'specialpages-tpl-maint',
- 'specialpages-tpl-info',
- 'specialpages-tpl-pers',
- ),
'booksources' => array(
'booksources',
'booksources-summary',
'withoutinterwiki' => '',
'fewestrevisions' => '',
'specialpages' => 'Miscellaneous special pages',
- 'specialspecialpages' => 'Special:Specialpages',
'booksources' => 'Book sources',
'specialpages2' => '',
'logpages' => 'Special:Log',