Sha256: 628597cef0df1313a8e2c3184b42774edb23113aff6a2e6a26173ae318da054d

Contents?: true

Size: 1.17 KB

Versions: 7

Compression:

Stored size: 1.17 KB

Contents

class Plugins::FrontCache::AdminController < CamaleonCms::Apps::PluginsAdminController
  include Plugins::FrontCache::FrontCacheHelper
  def settings
    @caches = current_site.get_meta("front_cache_elements", {paths: []})
    @caches[:paths] << "" unless @caches[:paths].present?
  end

  def save_settings
    current_site.set_meta("front_cache_elements", {paths: (params[:cache][:paths].delete_if{|a| !a.present?  } ||[]),
                                                   posts: (params[:cache][:posts]||[]),
                                                   post_types: (params[:cache][:post_type]||[]),
                                                   skip_posts: (params[:cache][:skip_posts]||[]),
                                                   cache_login: params[:cache][:cache_login],
                                                   home: params[:cache][:home]
                                                  })
    flash[:notice] = "#{t('plugin.front_cache.message.settings_saved')}"
    redirect_to action: :settings
  end

  def clean_cache
    flash[:notice] = "#{t('plugin.front_cache.message.cache_destroyed')}"
    front_cache_clean()
    redirect_to :back
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
camaleon_cms-2.3.6 app/apps/plugins/front_cache/admin_controller.rb
camaleon_cms-2.3.5 app/apps/plugins/front_cache/admin_controller.rb
camaleon_cms-2.3.4 app/apps/plugins/front_cache/admin_controller.rb
camaleon_cms-2.3.3 app/apps/plugins/front_cache/admin_controller.rb
camaleon_cms-2.3.2 app/apps/plugins/front_cache/admin_controller.rb
camaleon_cms-2.3.1 app/apps/plugins/front_cache/admin_controller.rb
camaleon_cms-2.3.0 app/apps/plugins/front_cache/admin_controller.rb