r103568 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103567‎ | r103568 | r103569 >
Date:03:33, 18 November 2011
Author:yaron
Status:deferred
Tags:
Comment:
Changed 'title' parameter for #formlink to 'tooltip'
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_ParserFunctions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_ParserFunctions.php
@@ -41,22 +41,23 @@
4242 *
4343 * 'formlink' is called as:
4444 *
45 - * {{#formlink:form=|link text=|link type=|title=|query string=|target=}}
 45+ * {{#formlink:form=|link text=|link type=|tooltip=|query string=|target=
 46+ * |popup}}
4647 *
4748 * This function returns HTML representing a link to a form; given that
4849 * no page name is entered by the the user, the form must be one that
4950 * creates an automatic page name, or else it will display an error
5051 * message when the user clicks on the link.
5152 *
52 - * The first two arguments are mandatory: 'form' is the name of the SF
53 - * form, and 'link text' is the text of the link. 'link type' is the type of
54 - * the link: if set to 'button', the link will be a button; if set to
55 - * 'post button', the link will be a button that uses the 'POST' method to
56 - * send other values to the form; if set to anything else or not called, it
57 - * will be a standard hyperlink. 'title' sets the 'title' HTML attribute
58 - * for the link, if it's an actual link; i.e., the hovering tooltip text.
59 - * 'query string' is the text to be added to the generated URL's query
60 - * string (or, in the case of 'post button' to be sent as hidden inputs).
 53+ * The first two arguments are mandatory:
 54+ * 'form' is the name of the SF form, and 'link text' is the text of the link.
 55+ * 'link type' is the type of the link: if set to 'button', the link will be
 56+ * a button; if set to 'post button', the link will be a button that uses the
 57+ * 'POST' method to send other values to the form; if set to anything else or
 58+ * not called, it will be a standard hyperlink.
 59+ * 'tooltip' sets a hovering tooltip text, if it's an actual link.
 60+ * 'query string' is the text to be added to the generated URL's query string
 61+ * (or, in the case of 'post button', to be sent as hidden inputs).
6162 * 'target' is an optional value, setting the name of the page to be
6263 * edited by the form.
6364 *
@@ -160,7 +161,7 @@
161162 $params = func_get_args();
162163 array_shift( $params ); // We don't need the parser.
163164 // Set defaults.
164 - $inFormName = $inLinkStr = $inLinkType = $inTitle =
 165+ $inFormName = $inLinkStr = $inLinkType = $inTooltip =
165166 $inQueryStr = $inTargetName = '';
166167 $classStr = "";
167168 // assign params
@@ -194,8 +195,8 @@
195196 $inLinkType = $value;
196197 } elseif ( $param_name == 'query string' ) {
197198 $inQueryStr = $value;
198 - } elseif ( $param_name == 'title' ) {
199 - $inTitle = Sanitizer::decodeCharReferences( $value );
 199+ } elseif ( $param_name == 'tooltip' ) {
 200+ $inTooltip = Sanitizer::decodeCharReferences( $value );
200201 } elseif ( $param_name == 'target' ) {
201202 $inTargetName = $value;
202203 } elseif ( $param_name == null && $value == 'popup'
@@ -269,7 +270,7 @@
270271 $classStr .= " new";
271272 }
272273 }
273 - $str = Xml::tags( 'a', array('href' => $link_url, 'class' => $classStr, 'title' => $inTitle), $inLinkStr );
 274+ $str = Xml::tags( 'a', array( 'href' => $link_url, 'class' => $classStr, 'title' => $inTooltip ), $inLinkStr );
274275 }
275276 // hack to remove newline from beginning of output, thanks to
276277 // http://jimbojw.com/wiki/index.php?title=Raw_HTML_Output_from_a_MediaWiki_Parser_Function