Index: trunk/extensions/SemanticMediaWiki/includes/SMW_QueryProcessor.php |
— | — | @@ -46,7 +46,7 @@ |
47 | 47 | } else { |
48 | 48 | $mainlabel = $qp->getLabel(); |
49 | 49 | } |
50 | | - if ( !$desc->isSingleton() || (count($desc->getPrintRequests()) + count($extraprintouts) == 0) ) { |
| 50 | + if ( ( !$desc->isSingleton() || (count($desc->getPrintRequests()) + count($extraprintouts) == 0) ) && ($mainlabel != '-') ) { |
51 | 51 | $desc->prependPrintRequest(new SMWPrintRequest(SMW_PRINT_THIS, $mainlabel)); |
52 | 52 | } |
53 | 53 | |
— | — | @@ -109,7 +109,19 @@ |
110 | 110 | $param = substr($param,1); |
111 | 111 | $parts = explode('=',$param,2); |
112 | 112 | $propparts = explode('#',$parts[0],2); |
113 | | - if ($wgContLang->getNsText(NS_CATEGORY) != ucfirst(trim($propparts[0]))) { |
| 113 | + if (trim($propparts[0]) == '') { // print "this" |
| 114 | + $printmode = SMW_PRINT_THIS; |
| 115 | + if (count($parts) == 1) { // no label found, use empty label |
| 116 | + $parts[] = ''; |
| 117 | + } |
| 118 | + $property = NULL; |
| 119 | + } elseif ($wgContLang->getNsText(NS_CATEGORY) == ucfirst(trim($propparts[0]))) { // print category |
| 120 | + $property = NULL; |
| 121 | + $printmode = SMW_PRINT_CATS; |
| 122 | + if (count($parts) == 1) { // no label found, use category label |
| 123 | + $parts[] = $wgContLang->getNSText(NS_CATEGORY); |
| 124 | + } |
| 125 | + } else { // print property |
114 | 126 | $property = Title::newFromText(trim($propparts[0]), SMW_NS_PROPERTY); // trim needed for \n |
115 | 127 | if ($property === NULL) { // too bad, this is no legal property name, ignore |
116 | 128 | continue; |
— | — | @@ -118,12 +130,6 @@ |
119 | 131 | if (count($parts) == 1) { // no label found, use property name |
120 | 132 | $parts[] = $property->getText(); |
121 | 133 | } |
122 | | - } else { |
123 | | - $property = NULL; |
124 | | - $printmode = SMW_PRINT_CATS; |
125 | | - if (count($parts) == 1) { // no label found, use category label |
126 | | - $parts[] = $wgContLang->getNSText(NS_CATEGORY); |
127 | | - } |
128 | 134 | } |
129 | 135 | if (count($propparts) == 1) { // no outputformat found, use property name |
130 | 136 | $propparts[] = ''; |