Sha256: b02b81930e3028ad55421d0c8a118d3fc401c3855be64adf077fe0dbd9972631

Contents?: true

Size: 1.31 KB

Versions: 34

Compression:

Stored size: 1.31 KB

Contents

module ErpApp
	module Desktop
		module ControlPanel
			class DesktopManagementController < ErpApp::ApplicationController

			  def desktop_preferences
          user = current_user
          desktop = ::Desktop.find_by_user(user)
		  
          render :inline => "{\"success\":true, \"preference_types\":#{desktop.preference_types.to_json(:include => :preference_options)}}"
			  end

			  def selected_desktop_preferences
          user = current_user
          desktop = ::Desktop.find_by_user(user)
		  
          render :inline => "{\"success\":true, \"preferences\":#{desktop.preferences.to_json(:include => [:preference_type, :preference_option])}}"
			  end

			  def update_desktop_preferences
          user = current_user
          desktop = ::Desktop.find_by_user(user)

          params.each do |k,v|
            desktop.set_preference(k, v) unless (k.to_s == 'action' or k.to_s == 'controller' or k.to_s == 'authenticity_token')
          end
          desktop.save
				
          render :inline => "{\"success\":true, \"preferences\":#{desktop.preferences.to_json(:include => [:preference_type, :preference_option])}}"
			  end

			  def add_background
          render :inline => ::Desktop.add_background(params[:description], params[:image_data]).to_json
			  end
			end
		end
	end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
erp_app-4.2.0 app/controllers/erp_app/desktop/control_panel/desktop_management_controller.rb
erp_app-4.0.0 app/controllers/erp_app/desktop/control_panel/desktop_management_controller.rb
erp_app-3.1.16 app/controllers/erp_app/desktop/control_panel/desktop_management_controller.rb
erp_app-3.1.15 app/controllers/erp_app/desktop/control_panel/desktop_management_controller.rb
erp_app-3.1.14 app/controllers/erp_app/desktop/control_panel/desktop_management_controller.rb
erp_app-3.1.13 app/controllers/erp_app/desktop/control_panel/desktop_management_controller.rb
erp_app-3.1.12 app/controllers/erp_app/desktop/control_panel/desktop_management_controller.rb
erp_app-3.1.11 app/controllers/erp_app/desktop/control_panel/desktop_management_controller.rb
erp_app-3.1.10 app/controllers/erp_app/desktop/control_panel/desktop_management_controller.rb
erp_app-3.1.9 app/controllers/erp_app/desktop/control_panel/desktop_management_controller.rb
erp_app-3.1.8 app/controllers/erp_app/desktop/control_panel/desktop_management_controller.rb
erp_app-3.1.7 app/controllers/erp_app/desktop/control_panel/desktop_management_controller.rb
erp_app-3.1.6 app/controllers/erp_app/desktop/control_panel/desktop_management_controller.rb
erp_app-3.1.5 app/controllers/erp_app/desktop/control_panel/desktop_management_controller.rb
erp_app-3.1.4 app/controllers/erp_app/desktop/control_panel/desktop_management_controller.rb
erp_app-3.1.3 app/controllers/erp_app/desktop/control_panel/desktop_management_controller.rb
erp_app-3.1.2 app/controllers/erp_app/desktop/control_panel/desktop_management_controller.rb
erp_app-3.0.16 app/controllers/erp_app/desktop/control_panel/desktop_management_controller.rb
erp_app-3.0.15 app/controllers/erp_app/desktop/control_panel/desktop_management_controller.rb
erp_app-3.1.1 app/controllers/erp_app/desktop/control_panel/desktop_management_controller.rb