* @package block * @link https://www.zentao.net */ namespace zin; /** * 展示主题切换页面。 * Print theme switch. */ function printThemeSwitch() { global $lang, $config, $app; $themes = array(); foreach($lang->block->themes as $themeKey => $themeName) { $image = $config->webRoot . "theme/default/images/guide/theme_{$themeKey}.png"; $themes[] = cell ( set::width($app->getClientLang() == 'en' ? '168px' : '172px'), setClass("p-1 pb-0 rounded-md block theme-{$themeKey}", $app->cookie->theme == $themeKey ? 'active' : ''), div ( div ( setClass('w-full theme-block state'), set('data-theme', $themeKey), img ( set('src', $image) ), div ( setClass("px-2 py-1 text-center text-white"), span ( icon('check-circle mr-2 hidden'), $themeName ) ) ) ) ); } return div ( setClass('theme-switch'), div ( div ( setClass('flex flex-wrap gap-7 px-10 pt-6'), $themes ) ) ); }