Index: trunk/extensions/Chemistry/ChemFunctions.php |
— | — | @@ -24,7 +24,7 @@ |
25 | 25 | * searchfor: alternate (e.g. CAS-sorted) formula to search for (plain formula, e.g. "C12H22O11" |
26 | 26 | * noprocess: results in the text between the tags not to be processed, for 'difficult' formula's like: |
27 | 27 | * "CuSO4 . 10 H2O" , where the 10 should not be subscripted. |
28 | | - * nolink: results in the text between the tags to be no link to special:chemicalsources. |
| 28 | + * link: results in the text between the tags to be a link to special:chemicalsources. |
29 | 29 | * N.B. : use noprocess with the searchfor parameter, otherwise search results may (!) be garbage/broken links. |
30 | 30 | * N.B.2 : the text between the tags is interpreted as HTML, not as wikitext! |
31 | 31 | * |
— | — | @@ -49,7 +49,7 @@ |
50 | 50 | function RenderChemForm( $input, $argv, &$parser ) { |
51 | 51 | global $wgServer, $wgScript, $wgChemFunctions_Messages, $wgMessageCache; |
52 | 52 | |
53 | | - require_once( 'extensions/ChemFunctions.i18n.php' ); |
| 53 | + require_once( 'ChemFunctions.i18n.php' ); |
54 | 54 | |
55 | 55 | # add messages |
56 | 56 | global $wgMessageCache, $wgChemFunctions_Messages; |
— | — | @@ -90,15 +90,15 @@ |
91 | 91 | $showthis = Sanitizer::removeHTMLtags( $showthis); |
92 | 92 | $searchfor = Sanitizer::removeHTMLtags( $searchfor); |
93 | 93 | |
94 | | - $nolink = false; |
95 | | - if ( isset( $argv["nolink"] ) ) |
96 | | - $nolink = $argv["nolink"]; |
| 94 | + $link = false; |
| 95 | + if ( isset( $argv["link"] ) ) |
| 96 | + $link = $argv["link"]; |
97 | 97 | |
98 | | - if ( $nolink ) { |
99 | | - $output = $showthis; |
100 | | - } else { |
| 98 | + if ( $link ) { |
101 | 99 | $title = Title::makeTitle( NS_SPECIAL, 'Chemicalsources' ); |
102 | 100 | $output = "<a href = " . $title->getFullUrl() . "?Formula=" . $searchfor . ">" . $showthis . "</a>"; |
| 101 | + } else { |
| 102 | + $output = $showthis; |
103 | 103 | } |
104 | 104 | |
105 | 105 | return $output; |