On Wed, Mar 5, 2008 at 10:44 AM, raymond@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.
Simetrical schrieb:
On Wed, Mar 5, 2008 at 10:44 AM, raymond-Y8jq7F6rJ48dvk2hry9Ukdi2O/JbrIOy@public.gmane.org wrote:
# Look for 'special:' in the line
$pos = strpos( $line, 'special:' );
Eek, case-sensitive?
Fixed with r31591.
$canonical = strtolower( trim( substr( $line, $pos + 8 ) ) );
Don't use magic numbers. $pos + strlen( 'special:' ) is more comprehensible.
Fixed with r31591 too. Thanks :)
return '<p style="float:' . $align . ';" class="mw-specialspecialpages-edit">' . $link . '</p>';
Why not put the float style in the class definition?
You mean by adding this class to main.css?
. . .
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 ...
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?
The intention was to give this extra flexibility. You can use multiple columns now and sort in any manner the community finds it useful.
But I will think about/work on your suggestion to use messagekeys instead to avoid duplication of the special pages list.
Raymond.
On Wed, Mar 5, 2008 at 11:56 AM, Raimond Spekking raimond.spekking@gmail.com wrote:
Why not put the float style in the class definition?
You mean by adding this class to main.css?
Well, no, shared.css.
The intention was to give this extra flexibility. You can use multiple columns now and sort in any manner the community finds it useful.
But I will think about/work on your suggestion to use messagekeys instead to avoid duplication of the special pages list.
But what happens when an extension adds a special page? What happens when a new special page is added to the core software? It will be put at the end until someone manually alters the list. Maybe you're giving a little extra flexibility, but on the other hand you're forcing more ongoing maintenance to get it to work nicely.
As a wiki administrator, for something as trivial as this, I would certainly prefer to have a sensible ordering that I *couldn't* change than a modifiable ordering that I *had to* change. Especially given that with an appropriate hook or two, any changes I really wanted could be done by extensions.
"Simetrical" Simetrical+wikilist@gmail.com wrote in message news:7c2a12e20803050907x3895a8f8o7d900a5fb589571f@mail.gmail.com...
On Wed, Mar 5, 2008 at 11:56 AM, Raimond Spekking raimond.spekking@gmail.com wrote:
The intention was to give this extra flexibility. You can use multiple columns now and sort in any manner the community finds it useful.
But I will think about/work on your suggestion to use messagekeys instead to avoid duplication of the special pages list.
But what happens when an extension adds a special page? What happens when a new special page is added to the core software? It will be put at the end until someone manually alters the list. Maybe you're giving a little extra flexibility, but on the other hand you're forcing more ongoing maintenance to get it to work nicely.
As a wiki administrator, for something as trivial as this, I would certainly prefer to have a sensible ordering that I *couldn't* change than a modifiable ordering that I *had to* change. Especially given that with an appropriate hook or two, any changes I really wanted could be done by extensions.
I've been planning to rework the Special:SpecialPages page for a while now, but it looks like someone has beaten me to it! In case it's any use, here's how I was planning to implement the change:
Each special page would have an extra 'section' parameter added to it's definition, e.g. 'user-management'.
The special page list would group items under their sections, in alphabetical order. If a section only has one item then it is added to a special 'miscellaneous' category instead, to stop a list where there are loads of single-element sections.
The labels for each section are pulled from the MediaWiki namespace, at sp-section-name, e.g. 'sp-section-user-management'. If no string is defined, then hyphens become spaces and each word is capitalised (or rather, put into appropriate title-case for the interface language).
Extensions also specify a 'section' when they are defined. These may be one of the built-in sections or a new one. The fact that sections with a single entry are collapsed into the 'miscellaneous' section avoids the problem of having many extensions that each specify a different section, whilst stopping extensions from being restricted to a potentially fairly narrow group of built-in sections.
A global variable $wgSpecialPageSectionOverrides allows sections to be overridden if necessary (key is name of special page, value is new section to put it in).
The page output is nicely wrapped in CSS classes so that layout can be modified (columns, boxes, etc.).
I hope some of these notes help with the implementation of this feature. I'd be happy to contribute further, either to discussions or coding, if that would be useful.
- Mark Clements (HappyDog)
Mark Clements schrieb:
I've been planning to rework the Special:SpecialPages page for a while now, but it looks like someone has beaten me to it! In case it's any use, here's how I was planning to implement the change:
You get a second chance due to Brion reverted me. I will work on other things in the meantime :)
Raymond.
On Wed, Mar 5, 2008 at 1:16 PM, Mark Clements gmane@kennel17.co.uk wrote:
If no string is defined, then hyphens become spaces and each word is capitalised (or rather, put into appropriate title-case for the interface language).
I don't see any reason to avoid our usual method of printing messages that <arent-defined>. It's ugly, but it should be, because something or other has broken. I doubt it would be an issue anyway, so adding special logic to handle it is pointless and bloaty.
A global variable $wgSpecialPageSectionOverrides allows sections to be overridden if necessary (key is name of special page, value is new section to put it in).
I'd say just go with a hook in the SpecialPage constructor. It seems simpler and more flexible. I don't think such a narrow feature needs its own config variable.
"Simetrical" Simetrical+wikilist@gmail.com wrote in message news:7c2a12e20803051623r6641fc3exb0b70201808220b2@mail.gmail.com...
On Wed, Mar 5, 2008 at 1:16 PM, Mark Clements
gmane@kennel17.co.uk wrote:
If no string is defined, then hyphens become spaces and each word is capitalised (or
rather,
put into appropriate title-case for the interface language).
I don't see any reason to avoid our usual method of printing messages that <arent-defined>. It's ugly, but it should be, because something or other has broken. I doubt it would be an issue anyway, so adding special logic to handle it is pointless and bloaty.
This is slightly different though. As the section names are extensible, we would be in a situation where every extension that is not in one of the built-in section would need to include the interface text for it's section heading. If two extensions in the same section differ in their default text, which one has precedence? What happens if this section name is later added to core? If extensions can just use a sensible English name knowin that the default rendering is normally sufficient then it makes things a lot easier to maintain, plus we still have the full flexibility of the localisation system. Once this is in use, I envisage that sections that have a sufficiently high number of common extensions in them will have default labels added to core, even if core doesn't have any extensions in that section itself.
A global variable $wgSpecialPageSectionOverrides allows sections to be overridden if necessary (key is name of special page, value is new
section
to put it in).
I'd say just go with a hook in the SpecialPage constructor. It seems simpler and more flexible. I don't think such a narrow feature needs its own config variable.
To be honest, I added that in response to the e-mail, where it seemed to be desired functionality. I'm not sure how useful it would be in practice. I will leave it out for now.
- Mark Clements (HappyDog)
On Wed, Mar 5, 2008 at 7:37 PM, Mark Clements gmane@kennel17.co.uk wrote:
This is slightly different though. As the section names are extensible, we would be in a situation where every extension that is not in one of the built-in section would need to include the interface text for it's section heading. If two extensions in the same section differ in their default text, which one has precedence? What happens if this section name is later added to core? If extensions can just use a sensible English name knowin that the default rendering is normally sufficient then it makes things a lot easier to maintain, plus we still have the full flexibility of the localisation system. Once this is in use, I envisage that sections that have a sufficiently high number of common extensions in them will have default labels added to core, even if core doesn't have any extensions in that section itself.
I would say that maybe you should avoid such deliberate decentralization and anarchy to begin with. Create a fixed list of core categories, and provide a mechanism for extensions to add their own if they have some reason (for instance, if they create many special pages). The expectation should be that most extensions should not consider adding any categories beyond the default, and those that do should prefix the keys as usual to avoid conflict. It shouldn't be focusing on each special page making up its own mind with special provisions for things like some loner page deciding it wants to be in its own category. Picture categorization by a single small group of people in a unified fashion, with a few independent extensions needing the ability to slightly expand on the groupings -- because that's the reality, not a ton of independent pages that don't know about any of the others.
To be honest, I added that in response to the e-mail, where it seemed to be desired functionality. I'm not sure how useful it would be in practice. I will leave it out for now.
Makes sense. Too much flexibility can definitely be a bad thing: it's always a tradeoff against uniformity and simplicity, which have their own merits.
Simetrical wrote: [snip]
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.
[snip]
I've reverted this, as I too find it rather fragile and unmaintainable.
-- brion vibber (brion @ wikimedia.org)
wikitech-l@lists.wikimedia.org