annotate extra/sample_plugin/init.rb @ 1517:dffacf8a6908
redmine-2.5
Update to Redmine SVN revision 13367 on 2.5-stable branch
author |
Chris Cannam |
date |
Tue, 09 Sep 2014 09:29:00 +0100 |
parents |
433d4f72a19b |
children |
|
rev |
line source |
Chris@1115
|
1 Rails.logger.info 'Starting Example plugin for RedMine'
|
Chris@0
|
2
|
Chris@0
|
3 Redmine::Plugin.register :sample_plugin do
|
Chris@0
|
4 name 'Example plugin'
|
Chris@0
|
5 author 'Author name'
|
Chris@0
|
6 description 'This is a sample plugin for Redmine'
|
Chris@0
|
7 version '0.0.1'
|
Chris@0
|
8 settings :default => {'sample_setting' => 'value', 'foo'=>'bar'}, :partial => 'settings/sample_plugin_settings'
|
Chris@0
|
9
|
Chris@0
|
10 # This plugin adds a project module
|
Chris@0
|
11 # It can be enabled/disabled at project level (Project settings -> Modules)
|
Chris@0
|
12 project_module :example_module do
|
Chris@0
|
13 # A public action
|
Chris@0
|
14 permission :example_say_hello, {:example => [:say_hello]}, :public => true
|
Chris@0
|
15 # This permission has to be explicitly given
|
Chris@0
|
16 # It will be listed on the permissions screen
|
Chris@0
|
17 permission :example_say_goodbye, {:example => [:say_goodbye]}
|
Chris@0
|
18 # This permission can be given to project members only
|
Chris@0
|
19 permission :view_meetings, {:meetings => [:index, :show]}, :require => :member
|
Chris@0
|
20 end
|
Chris@0
|
21
|
Chris@0
|
22 # A new item is added to the project menu
|
Chris@0
|
23 menu :project_menu, :sample_plugin, { :controller => 'example', :action => 'say_hello' }, :caption => 'Sample'
|
Chris@1115
|
24
|
Chris@0
|
25 # Meetings are added to the activity view
|
Chris@0
|
26 activity_provider :meetings
|
Chris@0
|
27 end
|