Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DataValueFactory.php |
— | — | @@ -216,16 +216,6 @@ |
217 | 217 | } |
218 | 218 | |
219 | 219 | /** |
220 | | - * Register a new SMWDataValue class for dealing with some type. Will be included and |
221 | | - * instantiated dynamically if needed. |
222 | | - * @DEPRECATED |
223 | | - */ |
224 | | - static public function registerDataValueClass($typestring, $filepart, $classname) { |
225 | | - SMWDataValueFactory::initDatatypes(); |
226 | | - SMWDataValueFactory::$m_typeclasses[$typestring] = $classname; |
227 | | - } |
228 | | - |
229 | | - /** |
230 | 220 | * Gather all available datatypes and label<=>id<=>datatype associations. This method |
231 | 221 | * is called before most methods of this factory. |
232 | 222 | */ |
— | — | @@ -267,14 +257,23 @@ |
268 | 258 | * A function for registering/overwriting datatypes for SMW. Should be called from |
269 | 259 | * within the hook 'smwInitDatatypes'. |
270 | 260 | */ |
271 | | - static function registerDatatype($id, $classname, $label='') { |
| 261 | + static function registerDatatype($id, $classname, $label=false) { |
272 | 262 | SMWDataValueFactory::$m_typeclasses[$id] = $classname; |
273 | | - if ($label != '') { |
| 263 | + if ($label != false) { |
274 | 264 | SMWDataValueFactory::$m_typelabels[$id] = $label; |
275 | 265 | } |
276 | 266 | } |
277 | 267 | |
278 | 268 | /** |
| 269 | + * Add a new alias label to an existing datatype id. Note that every ID should have a primary |
| 270 | + * label, either provided by SMW or registered with registerDatatype. This function should be |
| 271 | + * called from within the hook 'smwInitDatatypes'. |
| 272 | + */ |
| 273 | + static function registerDatatypeAlias($id, $label) { |
| 274 | + SMWDataValueFactory::$m_typealiases[$label] = $id; |
| 275 | + } |
| 276 | + |
| 277 | + /** |
279 | 278 | * Look up the ID that identifies the datatype of the given label internally. |
280 | 279 | * This id is used for all internal operations. Compound types are not supported |
281 | 280 | * by this method (decomposition happens earlier). Custom types get their DBkeyed |