function sdfInitProperties() { global $sdgContLang, $wgLanguageCode; $sd_property_vals = array( SD_SP_HAS_FILTER => array( '_SD_F', '_wpg' ), SD_SP_COVERS_PROPERTY => array( '_SD_CP', '_wpp' ), SD_SP_HAS_VALUE => array( '_SD_V', '_str' ), SD_SP_GETS_VALUES_FROM_CATEGORY => array( '_SD_VC', '_wpc' ), SD_SP_USES_TIME_PERIOD => array( '_SD_TP', '_str' ), SD_SP_HAS_INPUT_TYPE => array( '_SD_IT', '_str' ), SD_SP_REQUIRES_FILTER => array( '_SD_RF', '_wpg' ), SD_SP_HAS_LABEL => array( '_SD_L', '_str' ), SD_SP_HAS_DRILLDOWN_TITLE => array( '_SD_DT', '_str' ), SD_SP_HAS_DISPLAY_PARAMETERS => array( '_SD_DP', '_str' ), ); // register main property labels $sd_prop_labels = $sdgContLang->getPropertyLabels(); foreach ( $sd_prop_labels as $prop_id => $prop_alias ) { $prop_vals = $sd_property_vals[$prop_id]; if ( class_exists( 'SMWDIProperty' ) ) { SMWDIProperty::registerProperty( $prop_vals[0], $prop_vals[1], $prop_alias, true ); } else { SMWPropertyValue::registerProperty( $prop_vals[0], $prop_vals[1], $prop_alias, true ); } } // if it's not English, add the English-language aliases as well if ( $wgLanguageCode != 'en' ) { $sd_prop_aliases = $sdgContLang->getPropertyAliases(); foreach ( $sd_prop_aliases as $prop_alias => $prop_id ) { $prop_vals = $sd_property_vals[$prop_id]; if ( class_exists( 'SMWDIProperty' ) ) { SMWDIProperty::registerPropertyAlias( $prop_vals[0], $prop_alias ); } else { SMWPropertyValue::registerPropertyAlias( $prop_vals[0], $prop_alias ); } } } return true; }