r54182 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r54181‎ | r54182 | r54183 >
Date:18:53, 1 August 2009
Author:mkroetzsch
Status:deferred
Tags:
Comment:
parameter $smwgMaxPropertyValues to control number of values that are shown for each page in the listing on Property pages (Bug 14506)
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/RELEASE-NOTES (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_Settings.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/articlepages/SMW_PropertyPage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/RELEASE-NOTES
@@ -11,6 +11,8 @@
1212 * New configuration parameter $smwgMaxNonExpNumber to set the maximal number that
1313 SMW will normally display without using scientific exp notation. Defaults to
1414 1000000000000000.
 15+* New configuration parameter $smwgMaxPropertyValues to control number of values
 16+ that are shown for each page in the listing on Property pages. Defaults to 3.
1517 * The #ask parameter "headers" can now be given the value "plain" to get query
1618 results that show the printout label (e.g. property name) but without a link.
1719 * Numerous bugfixes
Index: trunk/extensions/SemanticMediaWiki/includes/articlepages/SMW_PropertyPage.php
@@ -107,7 +107,7 @@
108108 * one column and object articles/values in the other one.
109109 */
110110 private function subjectObjectList() {
111 - global $wgContLang;
 111+ global $wgContLang, $smwgMaxPropertyValues;
112112 $store = smwfGetStore();
113113
114114 $ac = count($this->articles);
@@ -137,7 +137,7 @@
138138 '&nbsp;' . $searchlink->getHTML($this->getSkin()) . '</td><td class="smwprops">';
139139 // Property values
140140 $ropts = new SMWRequestOptions();
141 - $ropts->limit = 4;
 141+ $ropts->limit = $smwgMaxPropertyValues + 1;
142142 $values = $store->getPropertyValues($this->articles[$index], $this->mProperty, $ropts);
143143 $i=0;
144144 foreach ($values as $value) {
@@ -145,7 +145,7 @@
146146 $r .= ', ';
147147 }
148148 $i++;
149 - if ($i < 4) {
 149+ if ($i < $smwgMaxPropertyValues + 1) {
150150 $r .= $value->getLongHTMLText($this->getSkin()) . $value->getInfolinkText(SMW_OUTPUT_HTML, $this->getSkin());
151151 } else {
152152 $searchlink = SMWInfolink::newInversePropertySearchLink('&hellip;', $this->articles[$index]->getWikiValue(), $this->mTitle->getText());
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Settings.php
@@ -148,6 +148,12 @@
149149 ##
150150
151151 ###
 152+# How many values should at most be displayed for a page on the Property page?
 153+##
 154+$smwgMaxPropertyValues = 3; // if large values are desired, consider reducing $smwgPropertyPagingLimit for unchanged performance
 155+##
 156+
 157+###
152158 # Settings for inline queries ({{#ask:...}}) and for semantic queries in
153159 # general. This can especially be used to prevent overly high server-load by
154160 # complex queries. The following settings affect all queries, wherever they

Status & tagging log