cirandas.net

ref: master

app/controllers/admin/plugins_controller.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
class PluginsController < AdminController
  protect 'edit_environment_features', :environment

  def index
    @active_plugins = Noosfero::Plugin.all.map {|plugin_name| plugin_name.constantize }.compact
  end

  post_only :update
  def update
    params[:environment][:enabled_plugins].delete('')
    if @environment.update(params[:environment])
      session[:notice] = _('Plugins updated successfully.')
    else
      session[:error] = _('Plugins were not updated successfully.')
    end
    redirect_to :action => 'index'
  end

end