function SemanticGlossaryRegisterProperties() { SMWDIProperty::registerProperty('___glt', '_str', SG_PROP_GLT, true); SMWDIProperty::registerProperty('___gld', '_txt', SG_PROP_GLD, true); SMWDIProperty::registerProperty('___gll', '_str', SG_PROP_GLL, true); return true; }
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; }
function saclInitProperties() { // Read restriction properties SMWDIProperty::registerProperty('___VISIBLE', '_str', wfMsgForContent('sacl-property-visibility')); SMWDIProperty::registerProperty('___VISIBLE_WL_GROUP', '_str', wfMsgForContent('sacl-property-visibility-wl-group')); SMWDIProperty::registerProperty('___VISIBLE_WL_USER', '_wpg', wfMsgForContent('sacl-property-visibility-wl-user')); SMWDIProperty::registerPropertyAlias('___VISIBLE', 'Visible to'); SMWDIProperty::registerPropertyAlias('___VISIBLE_WL_GROUP', 'Visible to group'); SMWDIProperty::registerPropertyAlias('___VISIBLE_WL_USER', 'Visible to user'); // Write restriction properties SMWDIProperty::registerProperty('___EDITABLE', '_str', wfMsgForContent('sacl-property-editable')); SMWDIProperty::registerProperty('___EDITABLE_WL_GROUP', '_str', wfMsgForContent('sacl-property-editable-wl-group')); SMWDIProperty::registerProperty('___EDITABLE_WL_USER', '_wpg', wfMsgForContent('sacl-property-editable-wl-user')); SMWDIProperty::registerPropertyAlias('___EDITABLE_BY', 'Editable by'); SMWDIProperty::registerPropertyAlias('___EDITABLE_WL_GROUP', 'Editable by group'); SMWDIProperty::registerPropertyAlias('___EDITABLE_WL_USER', 'Editable by user'); return true; }
/** * @brief Initializes all properties, hooks into smwInitProperties. * * @return true */ public static function sespInitProperties() { // Page author SMWDIProperty::registerProperty('___EUSER', '_wpg', wfMsgForContent('sesp-property-author')); SMWDIProperty::registerPropertyAlias('___EUSER', 'Page author'); // Page creator SMWDIProperty::registerProperty('___CUSER', '_wpg', wfMsgForContent('sesp-property-first-author')); SMWDIProperty::registerPropertyAlias('___CUSER', 'Page creator'); // Revision ID SMWDIProperty::registerProperty('___REVID', '_num', wfMsgForContent('sesp-property-revision-id')); SMWDIProperty::registerPropertyAlias('___REVID', 'Revision ID'); //View count SMWDIProperty::registerProperty('___VIEWS', '_num', wfMsgForContent('sesp-property-view-count')); SMWDIProperty::registerPropertyAlias('___VIEWS', 'Number of page views'); //Sub pages SMWDIProperty::registerProperty('___SUBP', '_wpg', wfMsgForContent('sesp-property-subpages')); SMWDIProperty::registerPropertyAlias('___SUBP', 'Subpage'); //Number of revisions SMWDIProperty::registerProperty('___NREV', '_num', wfMsgForContent('sesp-property-revisions')); SMWDIProperty::registerPropertyAlias('___NREV', 'Number of revisions'); //Number of talk page revisions SMWDIProperty::registerProperty('___NTREV', '_num', wfMsgForContent('sesp-property-talk-revisions')); SMWDIProperty::registerPropertyAlias('___NTREV', 'Number of talk page revisions'); // MIME type SMWDIProperty::registerProperty('___MIMETYPE', '_str', wfMsgForContent('sesp-property-mimetype')); SMWDIProperty::registerPropertyAlias('___MIMETYPE', 'MIME type'); // MIME type SMWDIProperty::registerProperty('___MEDIATYPE', '_str', wfMsgForContent('sesp-property-mediatype')); SMWDIProperty::registerPropertyAlias('___MEDIATYPE', 'Media type'); // SHORTURL type SMWDIProperty::registerProperty('___SHORTURL', '_uri', wfMsgForContent('sesp-property-shorturl')); SMWDIProperty::registerPropertyAlias('___SHORTURL', 'Short URL'); // METADATA types SMWDIProperty::registerProperty('___EXIFDATETIME', '_dat', wfMsgForContent('exif-datetimeoriginal')); SMWDIProperty::registerPropertyAlias('___EXIFDATETIME', 'Exposure date'); SMWDIProperty::registerProperty('___EXIFSOFTWARE', '_str', wfMsgForContent('exif-software')); SMWDIProperty::registerPropertyAlias('___EXIFSOFTWARE', 'Software'); return true; }
/** * A function for registering/overwriting predefined properties for SMW. Should be called from * within the hook 'smwInitProperties'. Ids should start with three underscores "___" to avoid * current and future confusion with SMW built-ins. * * @deprecated Use SMWDIProperty::registerProperty(). Will vanish before SMW 1.7. */ public static function registerProperty($id, $typeid, $label = false, $show = false) { SMWDIProperty::registerProperty($id, $typeid, $label, $show); }
public static function registerProperty($id, $typeid, $label) { if (class_exists('SMWDIProperty')) { SMWDIProperty::registerProperty($id, $typeid, $label, true); } else { SMWPropertyValue::registerProperty($id, $typeid, $label, 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; }
function dtfInitProperties() { global $dtgContLang; $dt_props = $dtgContLang->getPropertyLabels(); SMWDIProperty::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; }