summaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-09-23 17:19:27 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-09-23 17:19:27 +0000
commite4f0864e3a7f17f0e8a282aad29202f53bf11139 (patch)
treea40440471a6b0a8bc8aedf9d89d8bf2ef27e918f /app/controllers
parenta42a115b8fa21ab506cd40765a9e5684f022451b (diff)
downloadredmine-e4f0864e3a7f17f0e8a282aad29202f53bf11139.tar.gz
redmine-e4f0864e3a7f17f0e8a282aad29202f53bf11139.zip
Basic plugin support.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@752 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/admin_controller.rb3
-rw-r--r--app/controllers/settings_controller.rb12
2 files changed, 14 insertions, 1 deletions
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb
index ccc107507..bceab361c 100644
--- a/app/controllers/admin_controller.rb
+++ b/app/controllers/admin_controller.rb
@@ -74,6 +74,7 @@ class AdminController < ApplicationController
:default_admin_changed => User.find(:first, :conditions => ["login=? and hashed_password=?", 'admin', User.hash_password('admin')]).nil?,
:file_repository_writable => File.writable?(Attachment.storage_path),
:rmagick_available => Object.const_defined?(:Magick)
- }
+ }
+ @plugins = Redmine::Plugin.registered_plugins
end
end
diff --git a/app/controllers/settings_controller.rb b/app/controllers/settings_controller.rb
index 229a4ab3c..09af63176 100644
--- a/app/controllers/settings_controller.rb
+++ b/app/controllers/settings_controller.rb
@@ -30,4 +30,16 @@ class SettingsController < ApplicationController
redirect_to :action => 'edit' and return
end
end
+
+ def plugin
+ plugin_id = params[:id].to_sym
+ @plugin = Redmine::Plugin.registered_plugins[plugin_id]
+ if request.post?
+ Setting["plugin_#{plugin_id}"] = params[:settings]
+ flash[:notice] = l(:notice_successful_update)
+ redirect_to :action => 'plugin', :id => params[:id]
+ end
+ @partial = "../../vendor/plugins/#{plugin_id}/app/views/" + @plugin.settings[:partial]
+ @settings = Setting["plugin_#{plugin_id}"]
+ end
end