r22953 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r22952‎ | r22953 | r22954 >
Date:14:27, 13 June 2007
Author:kim
Status:old
Tags:
Comment:
corrected some tpyos and o-thinks
now DefinedMeanings support ?view_as=raw option
This format is not yet set in stone,
using for code reading and debugging
Modified paths:
  • /trunk/extensions/Wikidata/OmegaWiki/DefinedMeaning.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Wikidata/OmegaWiki/DefinedMeaning.php
@@ -7,11 +7,20 @@
88 class DefinedMeaning extends DefaultWikidataApplication {
99 public function view() {
1010 global
11 - $wgOut, $wgTitle;
 11+ $wgOut, $wgTitle, $wgRequest;
1212
1313 $this->showDataSetPanel=false;
1414 parent::view();
1515
 16+ $view_as=$wgRequest->getText('view_as');
 17+
 18+ if ($view_as=="raw") {
 19+ $wgOut->disable();
 20+
 21+ header("Content-Type: text/plain; charset=UTF-8");
 22+ echo($this->raw());
 23+ return;
 24+ }
1625 $this->outputViewHeader();
1726
1827 // Obtain ID from title of the form "DefinedMeaning:Foo (1234)" for database lookup
@@ -30,7 +39,6 @@
3140 )
3241 )
3342 );
34 -
3543 $this->outputViewFooter();
3644 }
3745
@@ -84,13 +92,17 @@
8593 @return Basic CSV data dump
8694 */
8795 public function raw() {
 96+ global
 97+ $wgTitle;
 98+
 99+ $definedMeaningId = $this->getDefinedMeaningIdFromTitle($wgTitle->getText());
88100 $record=getDefinedMeaningRecord(
89101 $definedMeaningId,
90102 $this->filterLanguageId,
91103 $this->possiblySynonymousRelationTypeId,
92104 $this->viewQueryTransactionInformation
93105 );
94 - return $recurd;
 106+ return $record;
95107 }
96108
97109 protected function save($referenceTransaction) {

Status & tagging log