Index: trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialSearchByAttribute.php |
— | — | @@ -53,35 +53,36 @@ |
54 | 54 | $html .= wfMsg('smw_sbv_docu') . "\n"; |
55 | 55 | } else { |
56 | 56 | // Now that we have an attribute, let's figure out the datavalue |
57 | | - $value = SMWDataValue::newAttributeValue( $attribute->getText(), $valuestring ); |
| 57 | + $value = SMWDataValueFactory::newAttributeObjectValue( $attribute, $valuestring ); |
58 | 58 | if ( $value->isValid() == FALSE ) { // no value understood |
59 | 59 | $html .= wfMSG('smw_sbv_novalue', $skin->makeLinkObj($attribute, $attribute->getText())); |
60 | 60 | $valuestring = ''; |
61 | 61 | } else { // everything is given |
62 | | - $wgOut->setPagetitle( $attribute->getText() . ' ' . $value->getUserValue() ); |
| 62 | + $wgOut->setPagetitle( $attribute->getText() . ' ' . $value->getXSDValue() ); //TODO: use escaped wiki value instead? |
63 | 63 | |
64 | 64 | $options = new SMWRequestOptions(); |
65 | 65 | $options->limit = $limit+1; |
66 | 66 | $options->offset = $offset; |
67 | 67 | |
68 | | - $res = &smwfGetStore()->getAttributeSubjects( $attribute, $value, $options, 'gt' ); |
| 68 | + $res = &smwfGetStore()->getAttributeSubjects( $attribute, $value, $options ); |
69 | 69 | $count = count($res); |
70 | 70 | |
71 | 71 | |
72 | | - $html .= wfMsg('smw_sbv_displayresult', $skin->makeLinkObj($attribute, $attribute->getText()), $value->getUserValue()) . "<br />\n"; |
| 72 | + $html .= wfMsg('smw_sbv_displayresult', $skin->makeLinkObj($attribute, $attribute->getText()), $value->getShortHTMLText($skin)) . "<br />\n"; |
73 | 73 | |
74 | 74 | // prepare navigation bar |
75 | 75 | if ($offset > 0) |
76 | | - $navigation = '<a href="' . htmlspecialchars($skin->makeSpecialUrl('SearchByAttribute','offset=' . max(0,$offset-$limit) . '&limit=' . $limit . '&attribute=' . urlencode($attribute->getText()) .'&value=' . urlencode($value->getUserValue()))) . '">' . wfMsg('smw_result_prev') . '</a>'; |
| 76 | + $navigation = '<a href="' . htmlspecialchars($skin->makeSpecialUrl('SearchByAttribute','offset=' . max(0,$offset-$limit) . '&limit=' . $limit . '&attribute=' . urlencode($attribute->getText()) .'&value=' . urlencode($value->getWikiValue()))) . '">' . wfMsg('smw_result_prev') . '</a>'; |
77 | 77 | else |
78 | 78 | $navigation = wfMsg('smw_result_prev'); |
79 | 79 | |
80 | 80 | $navigation .= ' <b>' . wfMsg('smw_result_results') . ' ' . ($offset+1) . '– ' . ($offset + min($count, $limit)) . '</b> '; |
81 | 81 | |
82 | | - if ($count>$limit) |
83 | | - $navigation .= ' <a href="' . htmlspecialchars($skin->makeSpecialUrl('SearchByAttribute', 'offset=' . ($offset+$limit) . '&limit=' . $limit . '&attribute=' . urlencode($attribute->getText()) . '&value=' . urlencode($value->getUserValue()))) . '">' . wfMsg('smw_result_next') . '</a>'; |
84 | | - else |
| 82 | + if ($count>$limit) { |
| 83 | + $navigation .= ' <a href="' . htmlspecialchars($skin->makeSpecialUrl('SearchByAttribute', 'offset=' . ($offset+$limit) . '&limit=' . $limit . '&attribute=' . urlencode($attribute->getText()) . '&value=' . urlencode($value->getWikiValue()))) . '">' . wfMsg('smw_result_next') . '</a>'; |
| 84 | + } else { |
85 | 85 | $navigation .= wfMsg('smw_result_next'); |
| 86 | + } |
86 | 87 | |
87 | 88 | $max = false; $first=true; |
88 | 89 | foreach (array(20,50,100,250,500) as $l) { |
— | — | @@ -96,7 +97,7 @@ |
97 | 98 | $max = true; |
98 | 99 | } |
99 | 100 | if ( $limit != $l ) { |
100 | | - $navigation .= '<a href="' . htmlspecialchars($skin->makeSpecialUrl('SearchByAttribute','offset=' . $offset . '&limit=' . $l . '&attribute=' . urlencode($attribute->getText()) . '&value=' . urlencode($value->getUserValue()))) . '">' . $l . '</a>'; |
| 101 | + $navigation .= '<a href="' . htmlspecialchars($skin->makeSpecialUrl('SearchByAttribute','offset=' . $offset . '&limit=' . $l . '&attribute=' . urlencode($attribute->getText()) . '&value=' . urlencode($value->getWikiValue()))) . '">' . $l . '</a>'; |
101 | 102 | } else { |
102 | 103 | $navigation .= '<b>' . $l . '</b>'; |
103 | 104 | } |