##// END OF EJS Templates
Change plugins directory through the configuration.yml file (#24007)....
Jean-Philippe Lang -
r15581:7a9a22f3dd62
parent child
Show More
@@ -75,6 +75,15 default:
75 # attachments_storage_path: D:/redmine/files
75 # attachments_storage_path: D:/redmine/files
76 attachments_storage_path:
76 attachments_storage_path:
77
77
78 # Absolute path to the directory where plugins are stored.
79 # The default is the 'plugins' directory in your Redmine instance.
80 # Your Redmine instance needs to have read permission on this
81 # directory.
82 # Examples:
83 # plugins_path: /var/redmine/plugins
84 # plugins_path: D:/redmine/plugins
85 plugins_path:
86
78 # Configuration of the autologin cookie.
87 # Configuration of the autologin cookie.
79 # autologin_cookie_name: the name of the cookie (default: autologin)
88 # autologin_cookie_name: the name of the cookie (default: autologin)
80 # autologin_cookie_path: the cookie path (default: /)
89 # autologin_cookie_path: the cookie path (default: /)
@@ -7,7 +7,12 class RedminePluginGenerator < Rails::Generators::NamedBase
7 super
7 super
8 @plugin_name = file_name.underscore
8 @plugin_name = file_name.underscore
9 @plugin_pretty_name = plugin_name.titleize
9 @plugin_pretty_name = plugin_name.titleize
10 @plugin_path = "plugins/#{plugin_name}"
10 if Redmine::Configuration['plugins_path'].nil?
11 @plugin_path = File.join(Rails.root, 'plugins', plugin_name)
12 else
13 @plugin_path = File.join(Redmine::Configuration['plugins_path'], plugin_name)
14 end
15 puts @plugin_path
11 end
16 end
12
17
13 def copy_templates
18 def copy_templates
@@ -9,7 +9,11 class RedminePluginControllerGenerator < Rails::Generators::NamedBase
9 super
9 super
10 @plugin_name = file_name.underscore
10 @plugin_name = file_name.underscore
11 @plugin_pretty_name = plugin_name.titleize
11 @plugin_pretty_name = plugin_name.titleize
12 @plugin_path = "plugins/#{plugin_name}"
12 if Redmine::Configuration['plugins_path'].nil?
13 @plugin_path = File.join(Rails.root, 'plugins', plugin_name)
14 else
15 @plugin_path = File.join(Redmine::Configuration['plugins_path'], plugin_name)
16 end
13 @controller_class = controller.camelize
17 @controller_class = controller.camelize
14 end
18 end
15
19
@@ -14,7 +14,11 class RedminePluginModelGenerator < Rails::Generators::NamedBase
14 super
14 super
15 @plugin_name = file_name.underscore
15 @plugin_name = file_name.underscore
16 @plugin_pretty_name = plugin_name.titleize
16 @plugin_pretty_name = plugin_name.titleize
17 @plugin_path = "plugins/#{plugin_name}"
17 if Redmine::Configuration['plugins_path'].nil?
18 @plugin_path = File.join(Rails.root, 'plugins', plugin_name)
19 else
20 @plugin_path = File.join(Redmine::Configuration['plugins_path'], plugin_name)
21 end
18 @model_class = model.camelize
22 @model_class = model.camelize
19 @table_name = @model_class.tableize
23 @table_name = @model_class.tableize
20 @migration_filename = "create_#{@table_name}"
24 @migration_filename = "create_#{@table_name}"
@@ -44,7 +44,7 module Redmine #:nodoc:
44 # When rendered, the plugin settings value is available as the local variable +settings+
44 # When rendered, the plugin settings value is available as the local variable +settings+
45 class Plugin
45 class Plugin
46 cattr_accessor :directory
46 cattr_accessor :directory
47 self.directory = File.join(Rails.root, 'plugins')
47 self.directory = Redmine::Configuration['plugins_path'] || File.join(Rails.root, 'plugins')
48
48
49 cattr_accessor :public_directory
49 cattr_accessor :public_directory
50 self.public_directory = File.join(Rails.root, 'public', 'plugin_assets')
50 self.public_directory = File.join(Rails.root, 'public', 'plugin_assets')
General Comments 0
You need to be logged in to leave comments. Login now