Index: trunk/extensions/SemanticForms/includes/SF_ParserFunctions.php |
— | — | @@ -41,22 +41,23 @@ |
42 | 42 | * |
43 | 43 | * 'formlink' is called as: |
44 | 44 | * |
45 | | - * {{#formlink:form=|link text=|link type=|title=|query string=|target=}} |
| 45 | + * {{#formlink:form=|link text=|link type=|tooltip=|query string=|target= |
| 46 | + * |popup}} |
46 | 47 | * |
47 | 48 | * This function returns HTML representing a link to a form; given that |
48 | 49 | * no page name is entered by the the user, the form must be one that |
49 | 50 | * creates an automatic page name, or else it will display an error |
50 | 51 | * message when the user clicks on the link. |
51 | 52 | * |
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). |
61 | 62 | * 'target' is an optional value, setting the name of the page to be |
62 | 63 | * edited by the form. |
63 | 64 | * |
— | — | @@ -160,7 +161,7 @@ |
161 | 162 | $params = func_get_args(); |
162 | 163 | array_shift( $params ); // We don't need the parser. |
163 | 164 | // Set defaults. |
164 | | - $inFormName = $inLinkStr = $inLinkType = $inTitle = |
| 165 | + $inFormName = $inLinkStr = $inLinkType = $inTooltip = |
165 | 166 | $inQueryStr = $inTargetName = ''; |
166 | 167 | $classStr = ""; |
167 | 168 | // assign params |
— | — | @@ -194,8 +195,8 @@ |
195 | 196 | $inLinkType = $value; |
196 | 197 | } elseif ( $param_name == 'query string' ) { |
197 | 198 | $inQueryStr = $value; |
198 | | - } elseif ( $param_name == 'title' ) { |
199 | | - $inTitle = Sanitizer::decodeCharReferences( $value ); |
| 199 | + } elseif ( $param_name == 'tooltip' ) { |
| 200 | + $inTooltip = Sanitizer::decodeCharReferences( $value ); |
200 | 201 | } elseif ( $param_name == 'target' ) { |
201 | 202 | $inTargetName = $value; |
202 | 203 | } elseif ( $param_name == null && $value == 'popup' |
— | — | @@ -269,7 +270,7 @@ |
270 | 271 | $classStr .= " new"; |
271 | 272 | } |
272 | 273 | } |
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 ); |
274 | 275 | } |
275 | 276 | // hack to remove newline from beginning of output, thanks to |
276 | 277 | // http://jimbojw.com/wiki/index.php?title=Raw_HTML_Output_from_a_MediaWiki_Parser_Function |