You are here

public function sweaver_plugin_themesettings::sweaver_init in Sweaver 7

Same name and namespace in other branches
  1. 6 plugins/sweaver_plugin_themesettings/sweaver_plugin_themesettings.inc \sweaver_plugin_themesettings::sweaver_init()

Init function.

Overrides sweaver_plugin::sweaver_init

File

plugins/sweaver_plugin_themesettings/sweaver_plugin_themesettings.inc, line 12
Theme settings plugin.

Class

sweaver_plugin_themesettings
@file Theme settings plugin.

Code

public function sweaver_init() {

  // Override theme settings in $conf variable when in Draft.
  if (sweaver_session(NULL, 'draft_mode') || sweaver_session(NULL, 'sweaver_temp')) {
    $sweaver = Sweaver::get_instance();
    $sweaver_style = $sweaver
      ->get_current_style();
    if (isset($sweaver_style->themesettings) && !empty($sweaver_style->themesettings)) {
      global $conf;
      $theme_settings_name = str_replace('/', '_', 'theme_' . $sweaver
        ->get_theme_key() . '_settings');
      $conf[$theme_settings_name] = unserialize($sweaver_style->themesettings);
    }
  }
}