To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / .svn / pristine / a1 / a17cb23221bb655c00d6b0ce4ed2209575037f95.svn-base @ 1297:0a574315af3e
History | View | Annotate | Download (1.16 KB)
| 1 |
# Redmine sample plugin |
|---|---|
| 2 |
require 'redmine' |
| 3 |
|
| 4 |
RAILS_DEFAULT_LOGGER.info 'Starting Example plugin for RedMine' |
| 5 |
|
| 6 |
Redmine::Plugin.register :sample_plugin do |
| 7 |
name 'Example plugin' |
| 8 |
author 'Author name' |
| 9 |
description 'This is a sample plugin for Redmine' |
| 10 |
version '0.0.1' |
| 11 |
settings :default => {'sample_setting' => 'value', 'foo'=>'bar'}, :partial => 'settings/sample_plugin_settings'
|
| 12 |
|
| 13 |
# This plugin adds a project module |
| 14 |
# It can be enabled/disabled at project level (Project settings -> Modules) |
| 15 |
project_module :example_module do |
| 16 |
# A public action |
| 17 |
permission :example_say_hello, {:example => [:say_hello]}, :public => true
|
| 18 |
# This permission has to be explicitly given |
| 19 |
# It will be listed on the permissions screen |
| 20 |
permission :example_say_goodbye, {:example => [:say_goodbye]}
|
| 21 |
# This permission can be given to project members only |
| 22 |
permission :view_meetings, {:meetings => [:index, :show]}, :require => :member
|
| 23 |
end |
| 24 |
|
| 25 |
# A new item is added to the project menu |
| 26 |
menu :project_menu, :sample_plugin, { :controller => 'example', :action => 'say_hello' }, :caption => 'Sample'
|
| 27 |
|
| 28 |
# Meetings are added to the activity view |
| 29 |
activity_provider :meetings |
| 30 |
end |