Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore.php |
— | — | @@ -211,6 +211,23 @@ |
212 | 212 | } |
213 | 213 | $db->freeResult($res); |
214 | 214 | break; |
| 215 | + case '_wpg': // wiki page |
| 216 | + $res = $db->select( $db->tableName('smw_relations'), |
| 217 | + 'object_title, object_namespace', |
| 218 | + 'subject_id=' . $db->addQuotes($subject->getArticleID()) . |
| 219 | + ' AND relation_title=' . $db->addQuotes($attribute->getDBkey()) . |
| 220 | + $this->getSQLConditions($requestoptions,'object_title','object_title'), |
| 221 | + 'SMW::getAttributeValues', $this->getSQLOptions($requestoptions,'object_title') ); |
| 222 | + if($db->numRows( $res ) > 0) { |
| 223 | + while($row = $db->fetchObject($res)) { |
| 224 | + $dv = SMWDataValueFactory::newTypeIDValue('_wpg'); |
| 225 | + $dv->setOutputFormat($outputformat); |
| 226 | + $dv->setValues($row->object_title, $row->object_namespace); |
| 227 | + $result[] = $dv; |
| 228 | + } |
| 229 | + } |
| 230 | + $db->freeResult($res); |
| 231 | + break; |
215 | 232 | default: // all others |
216 | 233 | if ( ($requestoptions !== NULL) && ($requestoptions->boundary !== NULL) && |
217 | 234 | ($requestoptions->boundary->isNumeric()) ) { |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DataValueFactory.php |
— | — | @@ -47,7 +47,10 @@ |
48 | 48 | if ($atitle !== NULL) { |
49 | 49 | return SMWDataValueFactory::newAttributeObjectValue($atitle,$value,$caption); |
50 | 50 | } else { |
51 | | - return new SMWErrorValue(wfMsgForContent('smw_notype'),$value,$caption); |
| 51 | + $type = SMWDataValueFactory::newTypeIDValue('__typ'); |
| 52 | + $type->setXSDValue('_wpg'); |
| 53 | + SMWDataValueFactory::$m_typelabels[$attstring] = $type; |
| 54 | + return SMWDataValueFactory::newTypeIDValue('_wpg',$value,$caption,$attstring); |
52 | 55 | } |
53 | 56 | } |
54 | 57 | |
— | — | @@ -68,7 +71,10 @@ |
69 | 72 | $result = SMWDataValueFactory::newTypeObjectValue(SMWDataValueFactory::$m_typelabels[$attstring], $value, $caption, $attstring); |
70 | 73 | return $result; |
71 | 74 | } elseif (count($typearray)==0) { |
72 | | - return new SMWErrorValue(wfMsgForContent('smw_notype'), $value, $caption); |
| 75 | + $type = SMWDataValueFactory::newTypeIDValue('__typ'); |
| 76 | + $type->setXSDValue('_wpg'); |
| 77 | + SMWDataValueFactory::$m_typelabels[$attstring] = $type; |
| 78 | + return SMWDataValueFactory::newTypeIDValue('_wpg',$value,$caption,$attstring); |
73 | 79 | } else { |
74 | 80 | return new SMWErrorValue(wfMsgForContent('smw_manytypes'), $value, $caption); |
75 | 81 | } |