On Wed, Mar 5, 2008 at 10:44 AM, <raymond(a)svn.wikimedia.org> wrote:
+ # Look for 'special:' in the
line
+ $pos = strpos( $line, 'special:' );
Eek, case-sensitive?
+ $canonical = strtolower(
trim( substr( $line, $pos + 8 ) ) );
Don't use magic numbers. $pos + strlen( 'special:' ) is more comprehensible.
+ return '<p style="float:' .
$align . ';" class="mw-specialspecialpages-edit">' . $link .
'</p>';
Why not put the float style in the class definition?
+== Allgemeine Listen ==
+:special:Allpages
+: special:Prefixindex
+;special:Categories
+* special:Disambiguations
+* special:Listredirects
+
+== Wartungslisten ==
+* special:Mostcategories
. . .
If you're going to use messages, wouldn't it be better to have a
single cross-language message for this, and have the titles be indexes
into other messages the way Sidebar does it? Like
== specialpages-generalpagelists ==
:special:Allpages
...
with MediaWiki:Specialpages-generalpagelists = "General page lists",
"Allgemeine Listen", or whatever else? Having a separate message used
for every language duplicates a ton of info and will be a big
maintenance headache if anyone wants to adjust the display, either in
the software or locally on a multilingual wiki.
Also, currently there would be serious problems if you wanted to
include the string "special:" in any of the descriptive text, it looks
like. Using message keys means this isn't a problem, unless you have
"special:" in the message key (which is technically not prohibited,
but not conventional and certainly never useful).
There are other problems with using a message altogether, though.
Every time a new special page is added to the software, it will appear
at the end in any wiki that's customized this message. Every time an
extension adds a special page, it will appear at the end in any wiki
until an admin picks some arbitrary place to put it. Also, if various
wikis decide to use this functionality to sort the pages in all
different ways, it will become very confusing for anyone who uses
multiple wikis to use the page, since it will be completely different
on every wiki. On the other hand, is there any real downside to
hardcoding the categories and orderings, having a fixed set of
categories and allowing each special page to insert itself into the
category it likes best? Does anyone really need this extra
flexibility?
But this is definitely a nice change in principle. It's something
that I've wanted to see for some time. Special:Specialpages has long
since gotten out of hand.