r16895 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r16894‎ | r16895 | r16896 >
Date:18:05, 9 October 2006
Author:collinj
Status:old
Tags:
Comment:
(bug 7364, comment #22) Invert working of one option
Modified paths:
  • /trunk/extensions/Chemistry/ChemFunctions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Chemistry/ChemFunctions.php
@@ -24,7 +24,7 @@
2525 * searchfor: alternate (e.g. CAS-sorted) formula to search for (plain formula, e.g. "C12H22O11"
2626 * noprocess: results in the text between the tags not to be processed, for 'difficult' formula's like:
2727 * "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.
2929 * N.B. : use noprocess with the searchfor parameter, otherwise search results may (!) be garbage/broken links.
3030 * N.B.2 : the text between the tags is interpreted as HTML, not as wikitext!
3131 *
@@ -49,7 +49,7 @@
5050 function RenderChemForm( $input, $argv, &$parser ) {
5151 global $wgServer, $wgScript, $wgChemFunctions_Messages, $wgMessageCache;
5252
53 - require_once( 'extensions/ChemFunctions.i18n.php' );
 53+ require_once( 'ChemFunctions.i18n.php' );
5454
5555 # add messages
5656 global $wgMessageCache, $wgChemFunctions_Messages;
@@ -90,15 +90,15 @@
9191 $showthis = Sanitizer::removeHTMLtags( $showthis);
9292 $searchfor = Sanitizer::removeHTMLtags( $searchfor);
9393
94 - $nolink = false;
95 - if ( isset( $argv["nolink"] ) )
96 - $nolink = $argv["nolink"];
 94+ $link = false;
 95+ if ( isset( $argv["link"] ) )
 96+ $link = $argv["link"];
9797
98 - if ( $nolink ) {
99 - $output = $showthis;
100 - } else {
 98+ if ( $link ) {
10199 $title = Title::makeTitle( NS_SPECIAL, 'Chemicalsources' );
102100 $output = "<a href = " . $title->getFullUrl() . "?Formula=" . $searchfor . ">" . $showthis . "</a>";
 101+ } else {
 102+ $output = $showthis;
103103 }
104104
105105 return $output;

Follow-up revisions

RevisionCommit summaryAuthorDate
r17153(bug 7364, comment #24) Update to Chemistry extension by Beetstra:...collinj18:27, 21 October 2006

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r16831(bug 7364) New extension for chemical substance identifiersrotem12:07, 7 October 2006
r16843(bug 7364, comment #20) Removed link, added possibility to explanation in i18ncollinj15:38, 7 October 2006