https://bugzilla.wikimedia.org/show_bug.cgi?id=16175
--- Comment #6 from Happy-melon <[email protected]> 2009-07-19 17:12:56 UTC --- (In reply to comment #5) > You can very well add the id with wrapWikiMsg too, (are you sure classes are > not enough? we've got jQuery soon). Don't over engineer, IMO this is just standard encapsulation; in the same way that we are now hunting down and destroying all hardcoded SQL statements to allow proper database abstraction, the codebase would, in an ideal world, not contain any hardcoded HTML for the same reasons. > because I have nowhere > seen even a suggestion that we would change what Xml-functions would do. The > only proposal was to create a new HTML class by Simetrical, which sounds much > more sane. Which would then be deployed by a steady conversion of "Xml::..." to "Html::..." across the codebase. Which can be greped for, unlike hardcoded instances. > > What you are suggesting now, is not readable, even ignoring the unsusual > indendation. And oh, did you mention that you changed some class names too? Where? "error" is added to cascadeprotectedwarning and titleprotectedwarning to be consistent with longpage-error, but I don't see any classes *changed*. I'm not wedded to the "error" class; I can see the distinction between longpage-error and the other notices. I used "id=mw-*edit*-..." to match the one warning (longpage-error) that *does* currently have an ID; I don't like it (they should be the standard "mw-<message_name>" like everywhere else), but it was to *avoid* changing ids. > if you really really want it, you can even combine wrapWikiMsg and > Xml-functions, something like this: > > ->wrapWikiMsg( Xml::element( 'div', array( 'class' => 'foo', 'id' => 'daa' ), > '$1' ), 'baz' ); > What's better about that? The $1 string injection in wrapWikiMsg() is *even more* obfuscated than addHTML(). As I said, I'd be perfecly happy to add another global function, but I was under the impression that we wanted fewer message functions (and global functions generally), not more. Maybe a method in OutputPage would be preferable... $wgOut->outputMsgDiv() or somesuch...? -- Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. You are on the CC list for the bug. _______________________________________________ Wikibugs-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikibugs-l
