Sha256: 568518f04c64e0f42db57f0a56538c4f0638ac7c674582ac1578c5fdcf3dd969

Contents?: true

Size: 784 Bytes

Versions: 9

Compression:

Stored size: 784 Bytes

Contents

require 'action_controller'

ActionController::Base.class_eval {
  private
    def globalize_request
      # Create super global PHP variables
      $_SESSION = self.session
      $_SERVER  = self.env
      $_REQUEST = self.request.filtered_parameters
    end

  private
    def store_session
      # Store pre-defined widget_list session items to the actual session

      %w(pageDisplayLimit DRILL_DOWNS CURRENT_GROUPING ROW_LIMIT list_checks SEARCH_FILTER LIST_SEQUENCE LIST_COL_SORT list_count DRILL_DOWN_FILTERS).each { |key|
        self.session[key] = $_SESSION[key]
      }

      test= 1
    end
}

ActionController::Base.instance_eval {
  helper_method :globalize_request

  helper_method :store_session

  before_filter :globalize_request

  after_filter :store_session
}

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
widget_list-1.3.7 lib/extensions/action_controller_base.rb
widget_list-1.3.6 lib/extensions/action_controller_base.rb
widget_list-1.3.5 lib/extensions/action_controller_base.rb
widget_list-1.2.0 lib/extensions/action_controller_base.rb
widget_list-1.1.9 lib/extensions/action_controller_base.rb
widget_list-1.1.8 lib/extensions/action_controller_base.rb
widget_list-1.1.7 lib/extensions/action_controller_base.rb
widget_list-1.1.6 lib/extensions/action_controller_base.rb
widget_list-1.1.5 lib/extensions/action_controller_base.rb