* @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', '25%'), set('class', 'pt-2 px-2'), div ( set('class', 'block ' . ($app->cookie->theme == $themeKey ? 'active' : '')), div ( set('class', 'w-full theme-block state'), set('data-theme', $themeKey), img ( set('class', 'p-2'), set('src', $image) ), div ( set('class', "px-2 pb-1 text-center theme-{$themeKey}"), span ( icon('check-circle mr-2 hidden'), $themeName ), ) ) ) ); } return div ( set('class', 'theme-switch'), div ( div ( set('class','flex flex-wrap'), $themes ) ) ); }