/**
  * Registers all special properties of this extension in Semantic Media Wiki.
  *
  * The language files of the ExtTab extension contain a mapping from special
  * property constants to their string representation. These mappings are
  * added to the mapping defined by Semantic Media Wiki.
  */
 function registerSpecialProperties()
 {
     global $smwgContLang;
     foreach ($this->smwSpecialProperties as $key => $prop) {
         list($typeid, $label) = $prop;
         SMWPropertyValue::registerProperty($key, $typeid, $label, true);
     }
 }
 public static function initProperties()
 {
     SMWPropertyValue::registerProperty('___QRC_UQC', '_wpg', QRC_UQC_LABEL, false);
     SMWPropertyValue::registerProperty('___QRC_HQID', '_str', QRC_HQID_LABEL, false);
     SMWPropertyValue::registerProperty('___QRC_HQS', '_str', QRC_HQS_LABEL, false);
     SMWPropertyValue::registerProperty('___QRC_HQL', '_num', QRC_HQL_LABEL, false);
     SMWPropertyValue::registerProperty('___QRC_HQO', '_num', QRC_HQO_LABEL, false);
     SMWPropertyValue::registerProperty('___QRC_DOP', '_str', QRC_DOP_LABEL, false);
     SMWPropertyValue::registerProperty('___QRC_DOC', '_str', QRC_DOC_LABEL, false);
     SMWPropertyValue::registerProperty('___QRC_HEPP', '_str', QRC_HEPP_LABEL, false);
     SMWPropertyValue::registerProperty('___QRC_HECP', '_boo', QRC_HECP_LABEL, false);
     SMWPropertyValue::registerProperty('___QRC_ISQ', '_boo', QRC_ISQ_LABEL, false);
     return true;
 }
Esempio n. 3
0
function initProperties()
{
    if (class_exists('SMWDIProperty')) {
        SMWDIProperty::registerProperty("__SIA_RECTCOORDS", '_str', "SIArectangleCoordinates", true);
        SMWDIProperty::registerProperty("__SIA_IMG_URL", '_str', "SIAimageURL", true);
        SMWDIProperty::registerProperty("__SIA_ANNOTATED", '_str', "SIAannotatedImage", true);
        SMWDIProperty::registerProperty("__SIA_CREATED_BY", '_str', "SIAcreatedBy", true);
    } else {
        SMWPropertyValue::registerProperty("__SIA_RECTCOORDS", '_str', "SIArectangleCoordinates", true);
        SMWPropertyValue::registerProperty("__SIA_IMG_URL", '_str', "SIAimageURL", true);
        SMWPropertyValue::registerProperty("__SIA_ANNOTATED", '_str', "SIAannotatedImage", true);
        SMWPropertyValue::registerProperty("__SIA_CREATED_BY", '_str', "SIAcreatedBy", true);
    }
    return true;
}
Esempio n. 4
0
 public static function registerProperty($id, $typeid, $label)
 {
     if (class_exists('SMWDIProperty')) {
         SMWDIProperty::registerProperty($id, $typeid, $label, true);
     } else {
         SMWPropertyValue::registerProperty($id, $typeid, $label, true);
     }
 }
Esempio n. 5
0
function dtfInitProperties()
{
    global $dtgContLang;
    $dt_props = $dtgContLang->getPropertyLabels();
    SMWPropertyValue::registerProperty('_DT_XG', '_str', $dt_props[DT_SP_HAS_XML_GROUPING], true);
    // TODO - this should set a "backup" English value as well,
    // so that the phrase "Has XML grouping" works in all languages
    return true;
}
function initFolkTagProperty()
{
    SMWPropertyValue::registerProperty('_FT_TAG', '_str', 'FolkTag', true);
    return true;
}
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;
}