Plugin FAQ » History » Version 1

Jean-Baptiste Barth, 2013-05-16 16:27

1 1 Jean-Baptiste Barth
h1. Frequently Asked Questions about Redmine plugins
2 1 Jean-Baptiste Barth
3 1 Jean-Baptiste Barth
{{toc}}
4 1 Jean-Baptiste Barth
5 1 Jean-Baptiste Barth
This page aims at documenting how to achieve simple things in Redmine plugins.
6 1 Jean-Baptiste Barth
7 1 Jean-Baptiste Barth
h2. Determine if a module is enabled
8 1 Jean-Baptiste Barth
9 1 Jean-Baptiste Barth
If your project is in the @@project@ variable: <pre><code class="ruby">
10 1 Jean-Baptiste Barth
if @project.module_enabled?("<module_name>")
11 1 Jean-Baptiste Barth
</code></pre>
12 1 Jean-Baptiste Barth
13 1 Jean-Baptiste Barth
First _modules_ are a project level concept. So be sure to make this check in an action that operates at project level. Redmine core generally uses a @before_filter@ called @find_project@ to find the current project in standard actions, which populates the @@project@ variable.
14 1 Jean-Baptiste Barth
15 1 Jean-Baptiste Barth
Available modules as of Redmine 2.3.x are: boards, calendar, documents, files, gantt, issue_tracking, news, repository, time_tracking, wiki. Each plugin can add its own module (see [[Plugin_Tutorial]] which adds a "polls" module).