Index: trunk/extensions/SemanticMediaWiki/includes/export/SMW_Exporter.php |
— | — | @@ -70,12 +70,19 @@ |
71 | 71 | * @param mixed $typesvalueforproperty either an SMWTypesValue or null |
72 | 72 | */ |
73 | 73 | static public function makeExportDataForSubject( SMWDIWikiPage $subject, $typesvalueforproperty = null ) { |
| 74 | + global $wgContLang; |
74 | 75 | $result = new SMWExpData( self::getDataItemExpData( $subject ) ); |
75 | | - $subj_title = Title::makeTitle( $subject->getNamespace(), $subject->getDBkey() ); |
| 76 | + $subjectTitle = str_replace( '_', ' ', $subject->getDBkey() ); |
| 77 | + if ( $subject->getNamespace() !== 0 ) { |
| 78 | + $prefixedSubjectTitle = $wgContLang->getNsText( $subject->getNamespace()) . ":" . $subjectTitle; |
| 79 | + } else { |
| 80 | + $prefixedSubjectTitle = $subjectTitle; |
| 81 | + } |
| 82 | + $prefixedSubjectUrl = wfUrlencode( str_replace( ' ', '_', $prefixedSubjectTitle ) ); |
76 | 83 | switch ( $subject->getNamespace() ) { |
77 | 84 | case NS_CATEGORY: case SMW_NS_CONCEPT: |
78 | 85 | $maintype_pe = SMWExporter::getSpecialNsResource( 'owl', 'Class' ); |
79 | | - $label = $subj_title->getText(); |
| 86 | + $label = $subjectTitle; |
80 | 87 | break; |
81 | 88 | case SMW_NS_PROPERTY: |
82 | 89 | if ( $typesvalueforproperty == null ) { |
— | — | @@ -83,17 +90,17 @@ |
84 | 91 | $typesvalueforproperty = end( $types ); |
85 | 92 | } |
86 | 93 | $maintype_pe = SMWExporter::getSpecialNsResource( 'owl', SMWExporter::getOWLPropertyType( $typesvalueforproperty ) ); |
87 | | - $label = $subj_title->getText(); |
| 94 | + $label = $subjectTitle; |
88 | 95 | break; |
89 | 96 | default: |
90 | | - $label = $subj_title->getPrefixedText(); |
| 97 | + $label = $prefixedSubjectTitle; |
91 | 98 | $maintype_pe = SMWExporter::getSpecialNsResource( 'swivt', 'Subject' ); |
92 | 99 | } |
93 | 100 | $ed = new SMWExpLiteral( $label ); |
94 | 101 | $result->addPropertyObjectValue( SMWExporter::getSpecialNsResource( 'rdfs', 'label' ), $ed ); |
95 | | - $ed = new SMWExpResource( '&wikiurl;' . $subj_title->getPrefixedURL() ); |
| 102 | + $ed = new SMWExpResource( '&wikiurl;' . $prefixedSubjectUrl ); |
96 | 103 | $result->addPropertyObjectValue( SMWExporter::getSpecialNsResource( 'swivt', 'page' ), $ed ); |
97 | | - $ed = new SMWExpResource( SMWExporter::$m_exporturl . '/' . $subj_title->getPrefixedURL() ); |
| 104 | + $ed = new SMWExpResource( SMWExporter::$m_exporturl . '/' . $prefixedSubjectUrl ); |
98 | 105 | $result->addPropertyObjectValue( SMWExporter::getSpecialNsResource( 'rdfs', 'isDefinedBy' ), $ed ); |
99 | 106 | $result->addPropertyObjectValue( SMWExporter::getSpecialNsResource( 'rdf', 'type' ), $maintype_pe ); |
100 | 107 | $ed = new SMWExpLiteral( $subject->getNamespace(), 'http://www.w3.org/2001/XMLSchema#integer' ); |