Index: trunk/extensions/Wikidata/OmegaWiki/DefinedMeaning.php |
— | — | @@ -7,11 +7,20 @@ |
8 | 8 | class DefinedMeaning extends DefaultWikidataApplication { |
9 | 9 | public function view() { |
10 | 10 | global |
11 | | - $wgOut, $wgTitle; |
| 11 | + $wgOut, $wgTitle, $wgRequest; |
12 | 12 | |
13 | 13 | $this->showDataSetPanel=false; |
14 | 14 | parent::view(); |
15 | 15 | |
| 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 | + } |
16 | 25 | $this->outputViewHeader(); |
17 | 26 | |
18 | 27 | // Obtain ID from title of the form "DefinedMeaning:Foo (1234)" for database lookup |
— | — | @@ -30,7 +39,6 @@ |
31 | 40 | ) |
32 | 41 | ) |
33 | 42 | ); |
34 | | - |
35 | 43 | $this->outputViewFooter(); |
36 | 44 | } |
37 | 45 | |
— | — | @@ -84,13 +92,17 @@ |
85 | 93 | @return Basic CSV data dump |
86 | 94 | */ |
87 | 95 | public function raw() { |
| 96 | + global |
| 97 | + $wgTitle; |
| 98 | + |
| 99 | + $definedMeaningId = $this->getDefinedMeaningIdFromTitle($wgTitle->getText()); |
88 | 100 | $record=getDefinedMeaningRecord( |
89 | 101 | $definedMeaningId, |
90 | 102 | $this->filterLanguageId, |
91 | 103 | $this->possiblySynonymousRelationTypeId, |
92 | 104 | $this->viewQueryTransactionInformation |
93 | 105 | ); |
94 | | - return $recurd; |
| 106 | + return $record; |
95 | 107 | } |
96 | 108 | |
97 | 109 | protected function save($referenceTransaction) { |