Index: trunk/extensions/SemanticForms/includes/SF_FormPrinter.php |
— | — | @@ -62,43 +62,19 @@ |
63 | 63 | * Must be derived from SFFormInput. |
64 | 64 | */ |
65 | 65 | public function registerInputType( $inputTypeClass ) { |
66 | | - global $smwgContLang; |
67 | | - |
68 | 66 | $inputTypeName = call_user_func( array( $inputTypeClass, 'getName' ) ); |
69 | 67 | $this->mInputTypeClasses[$inputTypeName] = $inputTypeClass; |
70 | 68 | $this->setInputTypeHook( $inputTypeName, array( $inputTypeClass, 'getHTML' ), array() ); |
71 | 69 | |
72 | 70 | $defaultProperties = call_user_func( array( $inputTypeClass, 'getDefaultPropTypes' ) ); |
73 | | - foreach ( $defaultProperties as $propertyTypeID => $additionalValues ) { |
74 | | - if ( $smwgContLang != null ) { |
75 | | - if ( class_exists( 'SMWDIProperty' ) ) { |
76 | | - // For SMW 1.6+, we use the ID of each |
77 | | - // property, instead of its label. |
78 | | - $propertyType = $propertyTypeID; |
79 | | - } else { |
80 | | - $datatypeLabels = $smwgContLang->getDatatypeLabels(); |
81 | | - $datatypeLabels['enumeration'] = 'enumeration'; |
82 | | - $propertyType = $datatypeLabels[$propertyTypeID]; |
83 | | - } |
84 | | - $this->setSemanticTypeHook( $propertyType, false, array( $inputTypeClass, 'getHTML' ), $additionalValues ); |
85 | | - } |
86 | | - $this->mDefaultInputForPropType[$propertyTypeID] = $inputTypeName; |
| 71 | + foreach ( $defaultProperties as $propertyType => $additionalValues ) { |
| 72 | + $this->setSemanticTypeHook( $propertyType, false, array( $inputTypeClass, 'getHTML' ), $additionalValues ); |
| 73 | + $this->mDefaultInputForPropType[$propertyType] = $inputTypeName; |
87 | 74 | } |
88 | 75 | $defaultPropertyLists = call_user_func( array( $inputTypeClass, 'getDefaultPropTypeLists' ) ); |
89 | | - foreach ( $defaultPropertyLists as $propertyTypeID => $additionalValues ) { |
90 | | - if ( $smwgContLang != null ) { |
91 | | - if ( class_exists( 'SMWDIProperty' ) ) { |
92 | | - // For SMW 1.6+, we use the ID of each |
93 | | - // property, instead of its label. |
94 | | - $propertyType = $propertyTypeID; |
95 | | - } else { |
96 | | - $datatypeLabels = $smwgContLang->getDatatypeLabels(); |
97 | | - $datatypeLabels['enumeration'] = 'enumeration'; |
98 | | - $propertyType = $datatypeLabels[$propertyTypeID]; |
99 | | - } |
100 | | - $this->setSemanticTypeHook( $propertyType, true, array( $inputTypeClass, 'getHTML' ), $additionalValues ); |
101 | | - } |
102 | | - $this->mDefaultInputForPropTypeList[$propertyTypeID] = $inputTypeName; |
| 76 | + foreach ( $defaultPropertyLists as $propertyType => $additionalValues ) { |
| 77 | + $this->setSemanticTypeHook( $propertyType, true, array( $inputTypeClass, 'getHTML' ), $additionalValues ); |
| 78 | + $this->mDefaultInputForPropTypeList[$propertyType] = $inputTypeName; |
103 | 79 | } |
104 | 80 | |
105 | 81 | $otherProperties = call_user_func( array( $inputTypeClass, 'getOtherPropTypesHandled' ) ); |