r105999 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105998‎ | r105999 | r106000 >
Date:09:52, 13 December 2011
Author:hashar
Status:ok (Comments)
Tags:
Comment:
bring back Linker::tooltip()

Was marked deprecated with r42702 although that helper makes code a bit
nicer:

Linker::tooltip( 'message' );

Xml::expandAttributes( array(
'title' => Linker::titleAttrib( 'message' )
) );

(the later would give you 'title=""' when 'tooltip-message' message does
not exist.
Modified paths:
  • /trunk/phase3/includes/Linker.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Linker.php
@@ -2034,14 +2034,9 @@
20352035 }
20362036
20372037 /**
2038 - * @deprecated since 1.14
2039 - * TODO: remove?!
2040 - *
20412038 * Returns raw bits of HTML, use titleAttrib()
20422039 */
20432040 public static function tooltip( $name, $options = null ) {
2044 - wfDeprecated( __METHOD__, '1.14' );
2045 -
20462041 # @todo FIXME: If Sanitizer::expandAttributes() treated "false" as "output
20472042 # no attribute" instead of "output '' as value for attribute", this
20482043 # would be two lines.

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r42702Create new, better tooltip/accesskey methods...simetrical23:58, 27 October 2008

Comments

#Comment by Brion VIBBER (talk | contribs)   21:44, 13 December 2011

In general we recommend against this sort of thing because it's used in awful HTML construction methods concat'ing a bunch of strings and hoping you end up with something right. :)

Would tend to be better to

if ($tooltip) {
  $attribs['tooltip'] = $tooltip;
}

?

#Comment by Brion VIBBER (talk | contribs)   22:14, 20 December 2011

This is ok as the usages are in old horrible patterns anyway; they should be fixed up and *THEN* this can be marked deprecated.

#Comment by Hashar (talk | contribs)   22:31, 20 December 2011

Thanks brion :)

Status & tagging log