r23761 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23760‎ | r23761 | r23762 >
Date:00:52, 6 July 2007
Author:kim
Status:old
Tags:
Comment:
copyTo now has a UI

(Does OptionPanel allow me to give the "show"
button another name? I'll check tomorrow)
Modified paths:
  • /trunk/extensions/Wikidata/OmegaWiki/DefinedMeaning.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/DefinedMeaningModel.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Wikidata/OmegaWiki/DefinedMeaning.php
@@ -21,6 +21,11 @@
2222 }
2323 $definedMeaningModel = new DefinedMeaningModel($dmInfo["id"]);
2424
 25+ $copyTo=$wgRequest->getText('CopyTo');
 26+ if ($copyTo) {
 27+ $definedMeaningModel->copyTo($copyTo);
 28+ }
 29+
2530 if(!empty($dmInfo["expression"]))
2631 $definedMeaningModel->setDefiningExpression($dmInfo["expression"]);
2732
@@ -187,9 +192,29 @@
188193 $titleText=$wgTitle->getPrefixedURL();
189194 $cmlink=$sk->makeLinkObj($cmtitle,"<small>".wfMsg("add_concept_link")."</small>","set_$dc=$titleText&suppressWarnings=true");
190195 $html.="<tr><td>$cmlink</td></tr>\n";
 196+ $html.="<tr><td>".$this->getCopyPanel()."<td><tr>";
191197 $html.="</table>\n";
192198 $html.="</div>\n";
193199 return $html;
194200 }
 201+
 202+ /**
 203+ * @returns user interface html for copying Defined Meanings between
 204+ datasets
 205+ */
 206+ protected function getCopyPanel() {
 207+
 208+ # mostly same code as in SpecialAddCollection... possibly might
 209+ # make a nice separate function
 210+ $datasets=wdGetDatasets();
 211+ $datasetarray['']=wfMsg('ow_none_selected');
 212+ foreach($datasets as $datasetid=>$dataset) {
 213+ $datasetarray[$datasetid]=$dataset->fetchName();
 214+ }
 215+ $html= getOptionPanel( array (
 216+ 'Copy to' => getSelect('CopyTo', $datasetarray)
 217+ ));
 218+ return $html;
 219+ }
195220 }
196221
Index: trunk/extensions/Wikidata/OmegaWiki/DefinedMeaningModel.php
@@ -297,7 +297,8 @@
298298 * @returns defined meaning id in the new dataset
299299 */
300300 public function copyTo($dataset) {
301 - $definedMeaningID=$this->getDefinedMeaningID();
 301+ #$definedMeaningID=$this->getId();
 302+ echo "copy to:$dataset ";
302303 #$from_dc=$this->getDataset();
303304 $to_dc=$dataset;
304305 # TODO We should actually thoroughly check that everything
@@ -461,4 +462,4 @@
462463 return $this->exists;
463464 }
464465
465 -}
\ No newline at end of file
 466+}

Status & tagging log