Beispiel #1
0
 /**
  * Blocks::generateCacheId()
  *
  * @param string $cache_id cache identifier
  *
  * @return string
  */
 public function generateCacheId($cache_id)
 {
     if ($this->theme) {
         $cache_id = $this->theme->generateCacheId($cache_id);
     }
     return $cache_id;
 }
Beispiel #2
0
 /**
  * load locale for theme
  * 
  * @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;
 }