Exemple #1
0
 /**
  * @param XoopsTheme $theme
  *
  * @return bool
  */
 public static function loadThemeLocale(XoopsTheme $theme)
 {
     $xoops = Xoops::getInstance();
     $locales = self::getUserLocales();
     foreach ($locales as $locale) {
         $fullPath = $xoops->path($theme->resourcePath("locale/{$locale}/locale.php"));
         $fullPath2 = $xoops->path($theme->resourcePath("locale/{$locale}/{$locale}.php"));
         if (XoopsLoad::fileExists($fullPath)) {
             XoopsLoad::addMap(array(strtolower($theme->folderName . 'ThemeLocale') => $fullPath));
             if (XoopsLoad::fileExists($fullPath2)) {
                 XoopsLoad::addMap(array(strtolower($theme->folderName . "ThemeLocale{$locale}") => $fullPath2));
             }
             return true;
         }
     }
     return false;
 }