r16843 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r16842‎ | r16843 | r16844 >
Date:15:38, 7 October 2006
Author:collinj
Status:old
Tags:
Comment:
(bug 7364, comment #20) Removed link, added possibility to explanation in i18n
Modified paths:
  • /trunk/extensions/Chemistry/ChemFunctions.i18n.php (modified) (history)
  • /trunk/extensions/Chemistry/SpecialChemicalsources.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Chemistry/SpecialChemicalsources.php
@@ -20,7 +20,7 @@
2121 * These parameters are built into the page [[Wikipedia:Chemical Sources]] by replacement
2222 * of the $ codes (empty codes giving empty strings).
2323 *
24 - * Note: ChemFunctions.i18n.php has to be stored in the same folder like SpecialChemicalsources.php
 24+ * Note: ChemFunctions.i18n.php has to be stored in the same folder like SpecialChemicalsources.php
2525 *
2626 * @package MediaWiki
2727 * @subpackage SpecialPage
@@ -65,7 +65,7 @@
6666 $ParamsCheck = "";
6767 global $wgChemFunctions_ChemicalIdentifiers;
6868 foreach ($wgChemFunctions_ChemicalIdentifiers as $key) {
69 - if ( isset( $Params [$key] ) )
 69+ if ( isset( $Params [$key] ) )
7070 $ParamsCheck .= $Params [$key];
7171 }
7272 if ($ParamsCheck) {
@@ -106,7 +106,7 @@
107107 $Params['CAS'] = preg_replace( '/[^0-9\-]/', "", $Params['CAS'] );
108108 else $Params['CAS'] = '';
109109 if ( isset( $Params['EINECS'] ) )
110 - $Params['EINECS'] = preg_replace( '/[^0-9\-]/', "", $Params['EINECS'] );
 110+ $Params['EINECS'] = preg_replace( '/[^0-9\-]/', "", $Params['EINECS'] );
111111 else $Params['EINECS'] = '';
112112 if ( isset( $Params['CHEBI'] ) )
113113 $Params['CHEBI'] = preg_replace( '/[^0-9\-]/', "", $Params['CHEBI'] );
@@ -173,7 +173,7 @@
174174 "\$MIXNameFormula" => $TEMPNAMEFORMULA);
175175 global $wgChemFunctions_ChemicalIdentifiers;
176176 foreach ($wgChemFunctions_ChemicalIdentifiers as $key) {
177 - if ( isset( $Params[$key] ) )
 177+ if ( isset( $Params[$key] ) )
178178 $transParams["\$" . $key] = $Params[$key] ;
179179 }
180180 return $transParams;
@@ -187,6 +187,7 @@
188188 $go = htmlspecialchars( wfMsg( "go" ) );
189189
190190 global $wgChemFunctions_ChemicalIdentifiers;
 191+ $wgOut->addWikitext ( wfMsg('ChemFunctions_SearchExplanation'));
191192 $wgOut->addHTML("<table><tr><td>");
192193 foreach ($wgChemFunctions_ChemicalIdentifiers as $key) {
193194 $this->GetParam_Row("ChemFunctions_" . $key, $key, $action, $go);
@@ -197,7 +198,7 @@
198199 function GetParam_Row($p, $q, $action, $go) {
199200 #Creates a table row
200201 global $wgOut;
201 - $wgOut->addWikitext("[[" . htmlspecialchars( wfMsg( $p ) ) . "]]: ");
 202+ $wgOut->addHTML ( wfMsg( $p ) . ": ");
202203 $wgOut->addHTML("</td><td>
203204 <form action=\"$action\" method='post'>
204205 <input name=\"$q\" id=\"$q\" />
Index: trunk/extensions/Chemistry/ChemFunctions.i18n.php
@@ -53,6 +53,7 @@
5454 'ChemFunctions_ECNumber' => 'ECNumber',
5555 'ChemFunctions_Formula' => 'Formula',
5656 'ChemFunctions_Name' => 'IUPAC Name',
 57+ 'ChemFunctions_SearchExplanation' => '',
5758 'ChemFunctions_ChemicalDataList' => 'Below is a list of links to sites that may provide information about the chemical substance you are looking for.<br /><br />
5859 * <a href="http://webbook.nist.gov/cgi/cbook.cgi?ID=$MIXCASNameFormula&Units=SI">Compound $MIXCASNameFormula at NIST</a><br />
5960 * <a href="http://ptcl.chem.ox.ac.uk/MSDS/">MSDS at the Oxford University (UK) (not searchable)</a><br />'
@@ -75,6 +76,7 @@
7677 'ChemFunctions_ECNumber' => 'ECNumber',
7778 'ChemFunctions_Formula' => 'Formula',
7879 'ChemFunctions_Name' => 'IUPAC Name',
 80+ 'ChemFunctions_SearchExplanation' => '',
7981 'ChemFunctions_ChemicalDataList' => 'Nachfolgend finden Sie Links zu Seiten, die eventuell Informationen über chemische Substanzen anbieten, nach denen Sie suchen:<br /><br />
8082 * <a href="http://webbook.nist.gov/cgi/cbook.cgi?ID=$MIXCASNameFormula&Units=SI">Verbindung $MIXCASNameFormula auf NIST</a><br />
8183 * <a href="http://ptcl.chem.ox.ac.uk/MSDS/">MSDS an der Oxford University (UK) (nicht durchsuchbar)</a><br />'
@@ -97,6 +99,7 @@
98100 'ChemFunctions_ECNumber' => 'EC Nummer',
99101 'ChemFunctions_Formula' => 'Formula',
100102 'ChemFunctions_Name' => 'IUPAC Naam',
 103+ 'ChemFunctions_SearchExplanation' => '',
101104 'ChemFunctions_ChemicalDataList' => 'Hieronder staat een lijst van pagina\'s, die meer informatie over de chemische verbinding kunnen verschaffen.<br /><br />
102105 * <a href="http://webbook.nist.gov/cgi/cbook.cgi?ID=$MIXCASNameFormula&Units=SI">Verbinding $MIXCASNameFormula op de pagina van het NIST</a><br />
103106 * <a href="http://ptcl.chem.ox.ac.uk/MSDS/">MSDS op de pagina van de Oxford University (UK) (geen zoekresultaten)</a><br />'

Follow-up revisions

RevisionCommit summaryAuthorDate
r16895(bug 7364, comment #22) Invert working of one optioncollinj18:05, 9 October 2006
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