r22561 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r22560‎ | r22561 | r22562 >
Date:10:54, 30 May 2007
Author:erik
Status:old
Tags:
Comment:
suppress warnings when calling from UI
Modified paths:
  • /trunk/extensions/Wikidata/OmegaWiki/DefinedMeaning.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/SpecialConceptMapping.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Wikidata/OmegaWiki/DefinedMeaning.php
@@ -163,7 +163,7 @@
164164 }
165165 $cmtitle=Title::newFromText("Special:ConceptMapping");
166166 $titleText=$wgTitle->getPrefixedURL();
167 - $cmlink=$sk->makeLinkObj($cmtitle,"<small>link to other concepts</small>","set_$dc=$titleText");
 167+ $cmlink=$sk->makeLinkObj($cmtitle,"<small>Add link to other concepts</small>","set_$dc=$titleText&suppressWarnings=true");
168168 $html.="<tr><td>$cmlink</td></tr>\n";
169169 $html.="</table>\n";
170170 $html.="</div>\n";
Index: trunk/extensions/Wikidata/OmegaWiki/SpecialConceptMapping.php
@@ -89,6 +89,7 @@
9090 $mappings=array();
9191 foreach ($sets as $key=>$set) {
9292 $rq=$wgRequest->getText("set_".$key);
 93+ $noerror=$wgRequest->getText("suppressWarnings");
9394 $rq=trim($rq);
9495 $dmData=new DefinedMeaningData();
9596 $dmData->setDataset($set);
@@ -103,13 +104,18 @@
104105 $id=$dmData->getId();
105106 $title=$dmData->getTitleText();
106107 }
107 -
108 - $wgOut->addHTML("$key: $rq ($title)");
 108+ if(!$noerror) {
 109+ $wgOut->addHTML("$key: $rq ($title)");
 110+ }
109111 if ($id!=null) {
110112 $mappings[$key]=$id;
111 - $wgOut->addHTML(' <span style="color:green">[OK]</span>');
 113+ if(!$noerror) {
 114+ $wgOut->addHTML(' <span style="color:green">[OK]</span>');
 115+ }
112116 } else {
113 - $wgOut->addHTML(' <span style="color:red">[not present or malformed]</span>');
 117+ if(!$noerror) {
 118+ $wgOut->addHTML(' <span style="color:red">[not present or malformed]</span>');
 119+ }
114120 }
115121 $wgOut->addHTML("<br>\n");
116122 }