| @@ 281-290 (lines=10) @@ | ||
| 278 | * |
|
| 279 | * @return string |
|
| 280 | */ |
|
| 281 | public static function translate($key, $dirname = 'xoops') |
|
| 282 | { |
|
| 283 | $class = self::getClassFromDirname($dirname); |
|
| 284 | if (defined("$class::$key")) { |
|
| 285 | return constant("$class::$key"); |
|
| 286 | } elseif (defined($key)) { |
|
| 287 | return constant($key); |
|
| 288 | } |
|
| 289 | return $key; |
|
| 290 | } |
|
| 291 | ||
| 292 | /** |
|
| 293 | * @param string $key |
|
| @@ 298-308 (lines=11) @@ | ||
| 295 | * |
|
| 296 | * @return string |
|
| 297 | */ |
|
| 298 | public static function translateTheme($key, $dirname = '') |
|
| 299 | { |
|
| 300 | $class = self::getThemeClassFromDirname($dirname); |
|
| 301 | ||
| 302 | if (defined("$class::$key")) { |
|
| 303 | return constant("$class::$key"); |
|
| 304 | } elseif (defined($key)) { |
|
| 305 | return constant($key); |
|
| 306 | } |
|
| 307 | return $key; |
|
| 308 | } |
|
| 309 | ||
| 310 | /** |
|
| 311 | * @param string $dirname |
|