Index: trunk/extensions/Wikidata/OmegaWiki/SpecialNeedsTranslation.php |
— | — | @@ -113,30 +113,30 @@ |
114 | 114 | |
115 | 115 | $definitionAttribute = new Attribute( "definition", wfMsg( "ow_Definition" ), "definition" ); |
116 | 116 | |
117 | | - $recordSet = new ArrayRecordSet( new Structure( $o->definedMeaningId, $o->expressionId, $o->definedMeaningReference, $definitionAttribute ), new Structure( $o->definedMeaningId, $o->expressionId ) ); |
| 117 | + $recordSet = new ArrayRecordSet( new Structure( $o->definedMeaningId, $o->expressionId, $o->expression, $definitionAttribute ), new Structure( $o->definedMeaningId, $o->expressionId ) ); |
118 | 118 | |
119 | 119 | while ( $row = $dbr->fetchObject( $queryResult ) ) { |
120 | | - $DMRecord = new ArrayRecord( $o->definedMeaningReferenceStructure ); |
121 | | - $DMRecord->definedMeaningId = $row->source_defined_meaning_id ; |
122 | | - $DMRecord->definedMeaningLabel = $row->source_spelling ; |
123 | | - $DMRecord->definedMeaningDefiningExpression = $row->source_spelling ; |
124 | | - $DMRecord->language = $row->source_language_id; |
| 120 | + $expressionRecord = new ArrayRecord( $o->expressionStructure ); |
| 121 | + $expressionRecord->language = $row->source_language_id; |
| 122 | + $spellingAsLink = definedMeaningReferenceAsLink( $row->source_defined_meaning_id, $row->source_spelling, $row->source_spelling ); |
| 123 | + $expressionRecord->spelling = $spellingAsLink ; |
125 | 124 | |
126 | | - $recordSet->addRecord( array( $row->source_defined_meaning_id, $row->source_expression_id, $DMRecord, getDefinedMeaningDefinition( $row->source_defined_meaning_id ) ) ); |
| 125 | + $definition = getDefinedMeaningDefinitionForLanguage( $row->source_defined_meaning_id, $row->source_language_id ) ; |
| 126 | + if ( $definition == "" ) { |
| 127 | + $definition = getDefinedMeaningDefinition( $row->source_defined_meaning_id ) ; |
| 128 | + } |
| 129 | + |
| 130 | + $recordSet->addRecord( array( $row->source_defined_meaning_id, $row->source_expression_id, $expressionRecord, $definition ) ); |
127 | 131 | } |
128 | 132 | |
129 | | - $expressionEditor = new RecordTableCellEditor( $o->definedMeaningReference ); |
| 133 | + $expressionEditor = new RecordTableCellEditor( $o->expression ); |
130 | 134 | $expressionEditor->addEditor( new LanguageEditor( $o->language, new SimplePermissionController( false ), false ) ); |
131 | | - $expressionEditor->addEditor( new DefinedMeaningEditor( $o->definedMeaningId, new SimplePermissionController( false ), false ) ); |
| 135 | + $expressionEditor->addEditor( new ShortTextNoEscapeEditor( $o->spelling, new SimplePermissionController( false ), false ) ); |
132 | 136 | |
133 | 137 | $editor = new RecordSetTableEditor( null, new SimplePermissionController( false ), new ShowEditFieldChecker( true ), new AllowAddController( false ), false, false, null ); |
134 | 138 | $editor->addEditor( $expressionEditor ); |
135 | 139 | $editor->addEditor( new TextEditor( $definitionAttribute, new SimplePermissionController( false ), false, true, 75 ) ); |
136 | 140 | |
137 | | - // cosmetics : changing the titles of the columns |
138 | | - $o->definedMeaningReference->name = wfMsgSc( "Expression" ) ; |
139 | | - $o->definedMeaningId->name = wfMsgSc( "Spelling" ) ; |
140 | | - |
141 | 141 | global $wgOut; |
142 | 142 | |
143 | 143 | $wgOut->addHTML( "Showing $nbshown out of $queryResultCount" ) ; |
— | — | @@ -147,3 +147,4 @@ |
148 | 148 | SpecialPage::addPage( new SpecialNeedsTranslation ); |
149 | 149 | } |
150 | 150 | |
| 151 | + |
Index: trunk/extensions/Wikidata/OmegaWiki/Editor.php |
— | — | @@ -1175,6 +1175,12 @@ |
1176 | 1176 | } |
1177 | 1177 | } |
1178 | 1178 | |
| 1179 | +class ShortTextNoEscapeEditor extends ShortTextEditor { |
| 1180 | + public function getViewHTML( IdStack $idPath, $value ) { |
| 1181 | + return $value ; |
| 1182 | + } |
| 1183 | +} |
| 1184 | + |
1179 | 1185 | class LinkEditor extends ShortTextEditor { |
1180 | 1186 | public function getViewHTML( IdStack $idPath, $value ) { |
1181 | 1187 | $label = htmlspecialchars( $value->linkLabel ); |