Index: trunk/extensions/SemanticMediaWiki/includes/SMW_QueryPrinter.php |
— | — | @@ -21,8 +21,10 @@ |
22 | 22 | protected $mLinkOthers; // should article names of other columns (besides the first) be linked? |
23 | 23 | protected $mDefault = ''; // default return value for empty queries |
24 | 24 | protected $mShowHeaders = true; // should the headers (property names) be printed? |
| 25 | + protected $mShowErrors = true; // should errors possibly be printed? |
25 | 26 | protected $mInline; // is this query result "inline" in some page (only then a link to unshown results is created, error handling may also be affected) |
26 | 27 | protected $mLinker; // Linker object as needed for making result links. Might come from some skin at some time. |
| 28 | + |
27 | 29 | |
28 | 30 | /** |
29 | 31 | * Constructor. The parameter $format is a format string |
— | — | @@ -161,11 +163,18 @@ |
162 | 164 | * Can be used if not specific error formatting is desired. Compatible with HTML |
163 | 165 | * and Wiki. |
164 | 166 | */ |
165 | | - protected function getErrorString($res) { |
166 | | - return smwfEncodeMessages($res->getErrors()); |
| 167 | + public function getErrorString($res) { |
| 168 | + return $this->mShowErrors?smwfEncodeMessages($res->getErrors()):''; |
167 | 169 | } |
168 | 170 | |
169 | 171 | /** |
| 172 | + * Change if errors should be shown- |
| 173 | + */ |
| 174 | + public function setShowErrors($show) { |
| 175 | + $this->mShowErrors = $show; |
| 176 | + } |
| 177 | + |
| 178 | + /** |
170 | 179 | * @DEPRECATED (since >1.0) use getResult() |
171 | 180 | */ |
172 | 181 | public function getResultHTML($results, $params) { |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_QP_List.php |
— | — | @@ -160,7 +160,7 @@ |
161 | 161 | // $link->setParameter($this->mSep,'sep'); |
162 | 162 | // } |
163 | 163 | |
164 | | - $link->setParameter('ul','format'); // always use ul, other formats suck as search page output |
| 164 | + $link->setParameter('ul','format'); // always use ul, other formats hardly work as search page output |
165 | 165 | if ($this->mTemplate != '') { |
166 | 166 | $link->setParameter($this->mTemplate,'template'); |
167 | 167 | if (array_key_exists('link', $this->m_params)) { // linking may interfere with templates |