Example #1
1
 /**
  * Configures a theme to be active for the current user's session.
  */
 public function get_preview_theme()
 {
     $theme_name = $this->handler_vars['theme_name'];
     $theme_dir = $this->handler_vars['theme_dir'];
     if (isset($theme_name) && isset($theme_dir)) {
         if (Themes::get_theme_dir() == $theme_dir) {
             Themes::cancel_preview();
             Session::notice(_t("Ended the preview of the theme '%s'", array($theme_name)));
         } else {
             if (Themes::preview_theme($theme_name, $theme_dir)) {
                 Session::notice(_t("Previewing theme '%s'", array($theme_name)));
             }
         }
     }
     Utils::redirect(URL::get('admin', 'page=themes'));
 }