Index: trunk/extensions/SemanticMediaWiki/specials/QueryPages/SMW_SpecialTypes.php |
— | — | @@ -1,28 +1,13 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | /** |
5 | | - * File holding the SMWSpecialTypes class for the Special:Types page. |
6 | | - * |
7 | | - * @file SMW_SpecialTypes.php |
8 | | - * |
9 | | - * @ingroup SMWSpecialPage |
10 | | - * @ingroup SpecialPage |
11 | | - * |
12 | | - * @author S Page |
13 | | - * @author Markus Krötzsch |
14 | | - * @author Jeroen De Dauw |
15 | | - */ |
16 | | - |
17 | | -if ( !defined( 'MEDIAWIKI' ) ) { |
18 | | - die( 'Not an entry point.' ); |
19 | | -} |
20 | | - |
21 | | -/** |
22 | 5 | * This special page for MediaWiki provides information about types. Type information is |
23 | 6 | * stored in the smw_attributes database table, gathered both from the annotations in |
24 | 7 | * articles, and from metadata already some global variables managed by SMWTypeHandlerFactory, |
25 | 8 | * and in Type: Wiki pages. This only reports on the Type: Wiki pages. |
26 | 9 | * |
| 10 | + * @file SMW_SpecialTypes.php |
| 11 | + * |
27 | 12 | * @ingroup SMWSpecialPage |
28 | 13 | * @ingroup SpecialPage |
29 | 14 | * |
— | — | @@ -75,6 +60,35 @@ |
76 | 61 | return '<p>' . wfMsg( 'smw_types_docu' ) . "</p><br />\n"; |
77 | 62 | } |
78 | 63 | |
| 64 | + /* Failed attempt to fix https://bugzilla.wikimedia.org/show_bug.cgi?id=27440 |
| 65 | + function getQueryInfo() { |
| 66 | + $joinConds = array(); |
| 67 | + |
| 68 | + foreach ( SMWDataValueFactory::getKnownTypeLabels() as $label ) { |
| 69 | + $label = str_replace( ' ', '_', $label ); // DBkey form so that SQL can elminate duplicates |
| 70 | + $joinConds['page'] = array( 'UNION', "(SELECT 'Types' as type, " . |
| 71 | + SMW_NS_TYPE . |
| 72 | + " as namespace, '$label' as title, " . |
| 73 | + "'$label' as value, 1 as count)" ); |
| 74 | + } |
| 75 | + |
| 76 | + return array( |
| 77 | + 'tables' => array( 'page' ), |
| 78 | + 'fields' => array( |
| 79 | + SMW_NS_TYPE . ' AS namespace', |
| 80 | + 'page_title AS value', |
| 81 | + 'page_title AS title', |
| 82 | + '1 AS count' |
| 83 | + ), |
| 84 | + 'conds' => array( |
| 85 | + 'page_namespace' => SMW_NS_TYPE, |
| 86 | + 'page_is_redirect' => '0' |
| 87 | + ), |
| 88 | + 'join_conds' => $joinConds |
| 89 | + ); |
| 90 | + } |
| 91 | + */ |
| 92 | + |
79 | 93 | function getSQL() { |
80 | 94 | global $smwgContLang; |
81 | 95 | $dbr = wfGetDB( DB_SLAVE ); |
— | — | @@ -102,7 +116,7 @@ |
103 | 117 | } |
104 | 118 | |
105 | 119 | /** |
106 | | - * Returns the info about a type as HTML |
| 120 | + * Returns the info about a type as HTML. |
107 | 121 | */ |
108 | 122 | function getTypeInfo( $skin, $titletext ) { |
109 | 123 | $tv = SMWDataValueFactory::newTypeIDValue( '__typ', $titletext ); |
— | — | @@ -135,5 +149,3 @@ |
136 | 150 | } |
137 | 151 | |
138 | 152 | } |
139 | | - |
140 | | - |
Index: trunk/extensions/SemanticMediaWiki/specials/QueryPages/SMW_SpecialProperties.php |
— | — | @@ -1,27 +1,13 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | /** |
5 | | - * File holding the SMWSpecialProperties class for the Special:Properties page. |
6 | | - * |
| 5 | + * This special page for MediaWiki shows all used properties. |
| 6 | + * |
7 | 7 | * @file SMW_SpecialProperties.php |
8 | 8 | * |
9 | 9 | * @ingroup SMWSpecialPage |
10 | 10 | * @ingroup SpecialPage |
11 | | - * |
12 | | - * @author Markus Krötzsch |
13 | | - * @author Jeroen De Dauw |
14 | | - */ |
15 | | - |
16 | | -if ( !defined( 'MEDIAWIKI' ) ) { |
17 | | - die( 'Not an entry point.' ); |
18 | | -} |
19 | | - |
20 | | -/** |
21 | | - * This special page for MediaWiki shows all used properties. |
22 | 11 | * |
23 | | - * @ingroup SMWSpecialPage |
24 | | - * @ingroup SpecialPage |
25 | | - * |
26 | 12 | * @author Markus Krötzsch |
27 | 13 | * @author Jeroen De Dauw |
28 | 14 | */ |
— | — | @@ -116,4 +102,3 @@ |
117 | 103 | } |
118 | 104 | |
119 | 105 | } |
120 | | - |