r37122 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r37121‎ | r37122 | r37123 >
Date:18:37, 5 July 2008
Author:mkroetzsch
Status:old
Tags:
Comment:
improved layout (use space before the default further result link, user given links may not want the space
though)
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_QP_List.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_QueryPrinter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/SMW_QueryPrinter.php
@@ -21,8 +21,10 @@
2222 protected $mLinkOthers; // should article names of other columns (besides the first) be linked?
2323 protected $mDefault = ''; // default return value for empty queries
2424 protected $mShowHeaders = true; // should the headers (property names) be printed?
 25+ protected $mShowErrors = true; // should errors possibly be printed?
2526 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)
2627 protected $mLinker; // Linker object as needed for making result links. Might come from some skin at some time.
 28+
2729
2830 /**
2931 * Constructor. The parameter $format is a format string
@@ -161,11 +163,18 @@
162164 * Can be used if not specific error formatting is desired. Compatible with HTML
163165 * and Wiki.
164166 */
165 - protected function getErrorString($res) {
166 - return smwfEncodeMessages($res->getErrors());
 167+ public function getErrorString($res) {
 168+ return $this->mShowErrors?smwfEncodeMessages($res->getErrors()):'';
167169 }
168170
169171 /**
 172+ * Change if errors should be shown-
 173+ */
 174+ public function setShowErrors($show) {
 175+ $this->mShowErrors = $show;
 176+ }
 177+
 178+ /**
170179 * @DEPRECATED (since >1.0) use getResult()
171180 */
172181 public function getResultHTML($results, $params) {
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_QP_List.php
@@ -160,7 +160,7 @@
161161 // $link->setParameter($this->mSep,'sep');
162162 // }
163163
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
165165 if ($this->mTemplate != '') {
166166 $link->setParameter($this->mTemplate,'template');
167167 if (array_key_exists('link', $this->m_params)) { // linking may interfere with templates

Status & tagging log