Index: trunk/extensions/SemanticMediaWiki/specials/QueryPages/SMW_SpecialWantedProperties.php |
— | — | @@ -0,0 +1,43 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * @author Markus Krötzsch |
| 5 | + * |
| 6 | + * This page shows all used attributes. |
| 7 | + */ |
| 8 | + |
| 9 | +if (!defined('MEDIAWIKI')) die(); |
| 10 | + |
| 11 | +global $smwgIP; |
| 12 | +include_once( "$smwgIP/specials/QueryPages/SMW_QueryPage.php" ); |
| 13 | + |
| 14 | +class WantedPropertiesPage extends SMWQueryPage { |
| 15 | + |
| 16 | + function getName() { |
| 17 | + /// TODO: should probably use SMW prefix |
| 18 | + return "WantedProperties"; |
| 19 | + } |
| 20 | + |
| 21 | + function isExpensive() { |
| 22 | + return false; /// disables caching for now |
| 23 | + } |
| 24 | + |
| 25 | + function isSyndicated() { |
| 26 | + return false; ///TODO: why not? |
| 27 | + } |
| 28 | + |
| 29 | + function getPageHeader() { |
| 30 | + return '<p>' . wfMsg('smw_wantedproperties_docu') . "</p><br />\n"; |
| 31 | + } |
| 32 | + |
| 33 | + function formatResult( $skin, $result ) { |
| 34 | + global $wgLang, $wgExtraNamespaces; |
| 35 | + $proplink = $skin->makeLinkObj( $result[0], $result[0]->getText() ); |
| 36 | + return wfMsg('smw_wantedproperty_template', $proplink, $result[1]); |
| 37 | + } |
| 38 | + |
| 39 | + function getResults($requestoptions) { |
| 40 | + return smwfGetStore()->getWantedPropertiesSpecial($requestoptions); |
| 41 | + } |
| 42 | + |
| 43 | +} |
| 44 | + |
Property changes on: trunk/extensions/SemanticMediaWiki/specials/QueryPages/SMW_SpecialWantedProperties.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 45 | + native |
Index: trunk/extensions/SemanticMediaWiki/specials/QueryPages/SMW_SpecialUnusedProperties.php |
— | — | @@ -0,0 +1,52 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * @author Markus Krötzsch |
| 5 | + * |
| 6 | + * This page shows all used attributes. |
| 7 | + */ |
| 8 | + |
| 9 | +if (!defined('MEDIAWIKI')) die(); |
| 10 | + |
| 11 | +global $smwgIP; |
| 12 | +include_once( "$smwgIP/specials/QueryPages/SMW_QueryPage.php" ); |
| 13 | + |
| 14 | +class UnusedPropertiesPage extends SMWQueryPage { |
| 15 | + |
| 16 | + function getName() { |
| 17 | + /// TODO: should probably use SMW prefix |
| 18 | + return "UnusedProperties"; |
| 19 | + } |
| 20 | + |
| 21 | + function isExpensive() { |
| 22 | + return false; /// disables caching for now |
| 23 | + } |
| 24 | + |
| 25 | + function isSyndicated() { |
| 26 | + return false; ///TODO: why not? |
| 27 | + } |
| 28 | + |
| 29 | + function getPageHeader() { |
| 30 | + return '<p>' . wfMsg('smw_unusedproperties_docu') . "</p><br />\n"; |
| 31 | + } |
| 32 | + |
| 33 | + function formatResult( $skin, $result ) { |
| 34 | + global $wgLang, $wgExtraNamespaces; |
| 35 | + $proplink = $skin->makeKnownLinkObj( $result, $result->getText() ); |
| 36 | + $types = smwfGetStore()->getSpecialValues($result, SMW_SP_HAS_TYPE); |
| 37 | + if (count($types) >= 1) { |
| 38 | + $typestring = $types[0]->getLongHTMLText($skin); |
| 39 | + } else { |
| 40 | + $type = SMWDataValueFactory::newSpecialValue(SMW_SP_HAS_TYPE); |
| 41 | + $type->setXSDValue('_wpg'); |
| 42 | + $typestring = $type->getLongHTMLText($skin); |
| 43 | + $errors[] = wfMsg('smw_propertylackstype', $type->getLongHTMLText($skin)); |
| 44 | + } |
| 45 | + return wfMsg('smw_unusedproperty_template', $proplink, $typestring) . ' ' . smwfEncodeMessages($errors); |
| 46 | + } |
| 47 | + |
| 48 | + function getResults($requestoptions) { |
| 49 | + return smwfGetStore()->getUnusedPropertiesSpecial($requestoptions); |
| 50 | + } |
| 51 | + |
| 52 | +} |
| 53 | + |
Property changes on: trunk/extensions/SemanticMediaWiki/specials/QueryPages/SMW_SpecialUnusedProperties.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 54 | + native |