Index: trunk/extensions/SemanticMediaWiki/languages/SMW_Language.php |
— | — | @@ -53,6 +53,22 @@ |
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
| 57 | + * Extends the array of special properties with a mapping from an $id to a |
| 58 | + * language dependent label. |
| 59 | + * NOTE: this function is provided for ad hoc compatibility with the Halo project. |
| 60 | + * A better solution will replace it at some time. |
| 61 | + */ |
| 62 | + function addSpecialProperty($id, $label) { |
| 63 | + if (array_key_exists($id, $this->smwSpecialProperties)) { |
| 64 | + trigger_error('The ID "' . $id . '" already belongs to the special property "' . $this->smwSpecialProperties[$key] . '" and thus cannot be used for "' . $label . '".', E_USER_WARNING); |
| 65 | + } elseif ($id < 1000) { |
| 66 | + trigger_error('IDs below 1000 are not allowed for custom special properties. Registration of "' . $label . '" failed.', E_USER_WARNING); |
| 67 | + } else { |
| 68 | + $this->smwSpecialProperties[$id] = $label; |
| 69 | + } |
| 70 | + } |
| 71 | + |
| 72 | + /** |
57 | 73 | * Function that returns all content messages (those that are stored |
58 | 74 | * in some article, and can thus not be translated to individual users). |
59 | 75 | */ |