From d1b09de7ecc42933532f2820c8e325d0d6cd42de Mon Sep 17 00:00:00 2001 From: mwjames Date: Sat, 14 Jan 2017 02:20:00 +0100 Subject: [PATCH] Show redirects (synonyms) on property page, refs 1927 --- DefaultSettings.php | 42 +++++++++++++-- i18n/en.json | 7 +-- includes/SMW_PageLister.php | 20 +++++-- includes/Settings.php | 2 + includes/articlepages/SMW_PropertyPage.php | 61 +++++++++++++++------- 5 files changed, 101 insertions(+), 31 deletions(-) diff --git a/DefaultSettings.php b/DefaultSettings.php index 06e965279c..2e78d260b4 100644 --- a/DefaultSettings.php +++ b/DefaultSettings.php @@ -39,6 +39,15 @@ 'smwgSemanticsEnabled' => false, ## + ### + # CompatibilityMode is to force SMW to work with other extensions that may impact + # performance in an unanticipated way or may contain potential incompatibilities. + # + # @since 2.4 + ## + 'smwgEnabledCompatibilityMode' => false, + ## + ### # Use another storage backend for Semantic MediaWiki. The default is suitable # for most uses of SMW. @@ -154,6 +163,8 @@ # be the smallest even namespace number that is not in use yet. However, it # must not be smaller than 100. ## + # 'smwgNamespaceIndex' => 100, + ## ### # Overwriting the following array, you can define for which namespaces @@ -277,6 +288,8 @@ ### # Whether the browse display is to be generated using an API request or not. + # + # @since 2.5 ## 'smwgBrowseByApi' => true, ## @@ -303,14 +316,35 @@ ## ### - # How many values should at most be displayed for a page on the Property page? + # Property page to limit the query request for individual values + # + # How many values should at most be displayed for a page on the Property + # page and if large values are desired, consider reducing + # $smwgPropertyPagingLimit for better performance. + # + # @since 1.3 + ## + 'smwgMaxPropertyValues' => 3, + ## + + ### + # Property page to limit the query request on subproperties + # + # @since 2.5 + ## + 'smwgSubPropertyListLimit' => 25, + ## + + ### + # Property page to limit the query request on redirects + # + # @since 2.5 ## - 'smwgMaxPropertyValues' => 3, // if large values are desired, consider reducing $smwgPropertyPagingLimit for better performance - 'smwgSubPropertyListLimit' => 25, // property page to limit the query request on subproperties + 'smwgRedirectPropertyListLimit' => 25, ## ### - # Settings for inline queries ({{ #ask:...}}) and for semantic queries in + # Settings for inline queries ({{#ask:...}}) and for semantic queries in # general. This can especially be used to prevent overly high server-load due # to complex queries. The following settings affect all queries, wherever they # occur. diff --git a/i18n/en.json b/i18n/en.json index fabe3f8c05..ab27cbfca1 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -131,9 +131,10 @@ "smw_typearticlecount": "Showing $1 {{PLURAL:$1|property|properties}} using this type.", "smw_attribute_header": "Pages using the property \"$1\"", "smw_attributearticlecount": "Showing $1 {{PLURAL:$1|page|pages}} using this property.", - "smw_subproperty_header": "Subproperties", - "smw-subpropertylist-count": "This property has the following $1 {{PLURAL:$1|subproperty|subproperties}}:", - "smw-subpropertylist-count-with-restricted-note": "This property has the following $1 {{PLURAL:$1|subproperty|subproperties}} (more are available but the selection is restricted to [https://www.semantic-mediawiki.org/wiki/Help:$smwgSubPropertyListLimit $2]):", + "smw-propertylist-subproperty-header": "Subproperties", + "smw-propertylist-redirect-header": "Synonyms", + "smw-propertylist-count": "Showing $1 related {{PLURAL:$1|property|properties}}.", + "smw-propertylist-count-with-restricted-note": "Showing $1 related {{PLURAL:$1|property|properties}} (more are available but the display is restricted to \"$2\").", "specialpages-group-smw_group": "Semantic MediaWiki", "exportrdf": "Export pages to RDF", "smw_exportrdf_docu": "This page allows you to obtain data from a page in RDF format.\nTo export pages, enter the titles in the text box below, one title per line.", diff --git a/includes/SMW_PageLister.php b/includes/SMW_PageLister.php index d15a5732dd..aa810856e2 100644 --- a/includes/SMW_PageLister.php +++ b/includes/SMW_PageLister.php @@ -277,19 +277,17 @@ public static function getColumnList( $start, $end, array $diWikiPages, $diPrope * @return string */ public static function getShortList( $start, $end, array $diWikiPages, $diProperty ) { - global $wgContLang; $startDv = \SMW\DataValueFactory::getInstance()->newDataValueByItem( $diWikiPages[$start], $diProperty ); - $sortkey = \SMW\StoreFactory::getStore()->getWikiPageSortKey( $diWikiPages[$start] ); - $startChar = $wgContLang->convert( $wgContLang->firstChar( $sortkey ) ); + $startChar = self::getFirstChar( $diWikiPages[$start] ); + $r = '

' . htmlspecialchars( $startChar ) . "

\n" . '

" . htmlspecialchars( $startChar ) . "

\n