00001 <?php
00002
00014 class SMWSpecialWantedProperties extends SpecialPage {
00015
00016 public function __construct() {
00017 parent::__construct( 'WantedProperties' );
00018 }
00019
00020 public function execute( $param ) {
00021 wfProfileIn( 'smwfDoSpecialWantedProperties (SMW)' );
00022
00023 global $wgOut;
00024
00025 $wgOut->setPageTitle( wfMsg( 'wantedproperties' ) );
00026
00027 $rep = new SMWWantedPropertiesPage();
00028
00029 list( $limit, $offset ) = wfCheckLimits();
00030 $rep->doQuery( $offset, $limit );
00031
00032
00033 SMWOutputs::commitToOutputPage( $wgOut );
00034
00035 wfProfileOut( 'smwfDoSpecialWantedProperties (SMW)' );
00036 }
00037
00038 }
00039
00048 class SMWWantedPropertiesPage extends SMWQueryPage {
00049
00050 function getName() {
00051 return "WantedProperties";
00052 }
00053
00054 function isExpensive() {
00055 return false;
00056 }
00057
00058 function isSyndicated() {
00059 return false;
00060 }
00061
00062 function getPageHeader() {
00063 return '<p>' . wfMsg( 'smw_wantedproperties_docu' ) . "</p><br />\n";
00064 }
00065
00072 function formatResult( $skin, $result ) {
00073 $linker = smwfGetLinker();
00074
00075 if ( $result[0]->isUserDefined() ) {
00076 $proplink = $linker->makeLinkObj( $result[0]->getDiWikiPage()->getTitle(), htmlspecialchars( $result[0]->getLabel() ), 'action=view' );
00077 } else {
00078 $proplink = SMWDataValueFactory::newDataItemValue( $result[0], new SMWDIProperty( '_TYPE' ) )->getLongHTMLText( $linker );
00079 }
00080
00081 return wfMsgExt( 'smw_wantedproperty_template', array( 'parsemag' ), $proplink, $result[1] );
00082 }
00083
00084 function getResults( $requestoptions ) {
00085 return smwfGetStore()->getWantedPropertiesSpecial( $requestoptions );
00086 }
00087
00088 }