Esempio n. 1
0
 /**
  * Set up predefined properties, including their label, aliases, and
  * typing information.
  */
 protected static function initPropertyRegistration()
 {
     if (is_array(SMWDIProperty::$m_prop_types)) {
         return;
         // init happened before
     }
     global $smwgContLang, $smwgUseCategoryHierarchy;
     $datatypeLabels = $smwgContLang->getDatatypeLabels();
     SMWDIProperty::$m_prop_labels = $smwgContLang->getPropertyLabels() + $datatypeLabels;
     SMWDIProperty::$m_prop_aliases = $smwgContLang->getPropertyAliases() + $smwgContLang->getDatatypeAliases();
     // Setup built-in predefined properties.
     // NOTE: all ids must start with underscores. The translation
     // for each ID, if any, is defined in the language files.
     // Properties without translation cannot be entered by or
     // displayed to users, whatever their "show" value below.
     SMWDIProperty::$m_prop_types = array('_TYPE' => array('__typ', true), '_URI' => array('__spu', true), '_INST' => array('__sin', false), '_UNIT' => array('__sps', true), '_IMPO' => array('__imp', true), '_CONV' => array('__sps', true), '_SERV' => array('__sps', true), '_PVAL' => array('__sps', true), '_REDI' => array('__red', true), '_SUBP' => array('__sup', true), '_SUBC' => array('__suc', !$smwgUseCategoryHierarchy), '_CONC' => array('__con', false), '_MDAT' => array('_dat', false), '_CDAT' => array('_dat', false), '_NEWP' => array('_boo', false), '_LEDT' => array('_wpg', false), '_ERRP' => array('_wpp', false), '_LIST' => array('__pls', true), '_SKEY' => array('__key', false), '_SF_DF' => array('__spf', true), '_SF_AF' => array('__spf', true), '_SOBJ' => array('_wpg', true), '_ASK' => array('_wpg', false), '_ASKST' => array('_cod', true), '_ASKFO' => array('_str', true), '_ASKSI' => array('_num', true), '_ASKDE' => array('_num', true));
     foreach ($datatypeLabels as $typeid => $label) {
         SMWDIProperty::$m_prop_types[$typeid] = array($typeid, true);
     }
     wfRunHooks('smwInitProperties');
 }
	/**
	 * Set up predefined properties, including their label, aliases, and
	 * typing information.
	 */
	static protected function initPropertyRegistration() {
		if ( is_array( SMWDIProperty::$m_prop_types ) ) {
			return; // init happened before
		}

		global $smwgContLang, $smwgUseCategoryHierarchy;
		$datatypeLabels = $smwgContLang->getDatatypeLabels();
		SMWDIProperty::$m_prop_labels  = $smwgContLang->getPropertyLabels() + $datatypeLabels;
		SMWDIProperty::$m_prop_aliases = $smwgContLang->getPropertyAliases() + $smwgContLang->getDatatypeAliases();
		// Setup built-in predefined properties.
		// NOTE: all ids must start with underscores. The translation
		// for each ID, if any, is defined in the language files.
		// Properties without translation cannot be entered by or
		// displayed to users, whatever their "show" value below.
		SMWDIProperty::$m_prop_types = array(
				'_TYPE'  =>  array( '__typ', true ), // "has type"
				'_URI'   =>  array( '__spu', true ), // "equivalent URI"
				'_INST'  =>  array( '__sin', false ), // instance of a category
				'_UNIT'  =>  array( '__sps', true ), // "displays unit"
				'_IMPO'  =>  array( '__imp', true ), // "imported from"
				'_CONV'  =>  array( '__sps', true ), // "corresponds to"
				'_SERV'  =>  array( '__sps', true ), // "provides service"
				'_PVAL'  =>  array( '__sps', true ), // "allows value"
				'_REDI'  =>  array( '__red', true ), // redirects to some page
				'_SUBP'  =>  array( '__sup', true ), // "subproperty of"
				'_SUBC'  =>  array( '__suc', !$smwgUseCategoryHierarchy ), // "subcategory of"
				'_CONC'  =>  array( '__con', false ), // associated concept
				'_MDAT'  =>  array( '_dat', false ), // "modification date"
				'_CDAT'  =>  array( '_dat', false ), // "creation date"
				'_ERRP'  =>  array( '_wpp', false ), // "has improper value for"
				'_LIST'  =>  array( '__pls', true ), // "has fields"
				'_SKEY'  =>  array( '__key', false ), // sort key of a page
				'_SF_DF' => array( '__spf', true ), // Semantic Form's default form property
				'_SF_AF' => array( '__spf', true ),  // Semantic Form's alternate form property
				'_SOBJ'  =>  array( '_wpg', true ), // "has subobject"
			);

		foreach ( $datatypeLabels as $typeid => $label ) {
			SMWDIProperty::$m_prop_types[$typeid] = array( $typeid, true );
		}

		wfRunHooks( 'smwInitProperties' );
	}