/**
  * 风格设置
  *
  * 设置当前页面风格,需要两个参数,$type风格类型,$theme该类型下风格
  *
  * @see WindSimpleController::setTheme()
  * @param string $type 风格类型(site,space,area...)
  * @param string $theme 风格别名
  */
 protected function setTheme($type, $theme)
 {
     $config = Wekit::C('site');
     $themePack = $config['theme.' . $type . '.pack'];
     $themePack = 'THEMES:' . $themePack;
     // 风格预览,管理员权限
     if ($style = Pw::getCookie('style_preview')) {
         list($s_theme, $s_type) = explode('|', $style, 2);
         if ($s_type == $type) {
             $theme = $s_theme;
             Wekit::C()->site->set('theme.' . $type . '.default', $theme);
         }
     }
     if (!$theme) {
         $theme = $config['theme.' . $type . '.default'];
     }
     parent::setTheme($theme, $themePack);
 }
Exemplo n.º 2
0
 public function setTheme($theme)
 {
     return parent::setTheme($theme);
 }