server("PATH_INFO"); if (empty($path)) { $path = "/" . $input->get("kohana_uri"); } self::$site = module::get_var("gallery", "active_site_theme"); self::$admin = module::get_var("gallery", "active_admin_theme"); if (!(identity::active_user()->admin && $theme_name = $input->get("theme"))) { $theme_name = $path == "/admin" || !strncmp($path, "/admin/", 7) ? self::$admin : self::$site; } $modules = Kohana::config("core.modules"); array_unshift($modules, THEMEPATH . $theme_name); Kohana::config_set("core.modules", $modules); } static function get_info($theme_name) { $theme_name = preg_replace("/[^\w]/", "", $theme_name); $file = THEMEPATH . "$theme_name/theme.info"; $theme_info = new ArrayObject(parse_ini_file($file), ArrayObject::ARRAY_AS_PROPS); $theme_info->description = t($theme_info->description); $theme_info->name = t($theme_info->name); return $theme_info; } }