Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_Description.php |
— | — | @@ -119,10 +119,18 @@ |
120 | 120 | } |
121 | 121 | |
122 | 122 | public function addPrintRequest(SMWPrintRequest $printrequest) { |
123 | | - return $this->m_printreqs[$printrequest->getHash()] = $printrequest; |
| 123 | + $this->m_printreqs[$printrequest->getHash()] = $printrequest; |
124 | 124 | } |
125 | | - |
| 125 | + |
126 | 126 | /** |
| 127 | + * Add a new print request, but at the beginning of the list of requests |
| 128 | + * (thus it will be printed first). |
| 129 | + */ |
| 130 | + public function prependPrintRequest(SMWPrintRequest $printrequest) { |
| 131 | + $this->m_printreqs = array_merge(array($printrequest->getHash() => $printrequest), $this->m_printreqs); |
| 132 | + } |
| 133 | + |
| 134 | + /** |
127 | 135 | * Return a string expressing this query. |
128 | 136 | */ |
129 | 137 | abstract public function getQueryString(); |
— | — | @@ -268,11 +276,11 @@ |
269 | 277 | } |
270 | 278 | |
271 | 279 | public function getQueryString() { |
272 | | - $result = ''; |
| 280 | + $result = '<q>'; |
273 | 281 | foreach ($this->m_descriptions as $desc) { |
274 | 282 | $result .= $desc->getQueryString() . ' '; |
275 | 283 | } |
276 | | - return $result; |
| 284 | + return $result . '</q>'; |
277 | 285 | } |
278 | 286 | } |
279 | 287 | |
— | — | @@ -339,7 +347,7 @@ |
340 | 348 | } |
341 | 349 | |
342 | 350 | public function getQueryString() { |
343 | | - return '[[' . $this->m_relation->getText() . '::' . $this->m_description->getQueryString() . ']]'; |
| 351 | + return '[[' . $this->m_relation->getText() . '::<q>' . $this->m_description->getQueryString() . '<q/>]]'; |
344 | 352 | } |
345 | 353 | } |
346 | 354 | |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore.php |
— | — | @@ -852,12 +852,12 @@ |
853 | 853 | } elseif ($description instanceof SMWNominalDescription) { |
854 | 854 | if (array_key_exists('PREVREL', $curtables)) { |
855 | 855 | $where .= $curtables['PREVREL'] . '.object_title=' . |
856 | | - $db->addQuotes($description->getIndividual()->getText()) . ' AND ' . |
| 856 | + $db->addQuotes($description->getIndividual()->getDBKey()) . ' AND ' . |
857 | 857 | $curtables['PREVREL'] . '.object_namespace=' . |
858 | 858 | $description->getIndividual()->getNamespace(); |
859 | 859 | } elseif ($this->addInnerJoin('PAGE', $from, $db, $curtables)) { |
860 | 860 | $where .= $curtables['PAGE'] . '.page_title=' . |
861 | | - $db->addQuotes($description->getIndividual()->getText()) . ' AND ' . |
| 861 | + $db->addQuotes($description->getIndividual()->getDBKey()) . ' AND ' . |
862 | 862 | $curtables['PAGE'] . '.page_namespace=' . |
863 | 863 | $description->getIndividual()->getNamespace(); |
864 | 864 | } |