Mercurial > hg > soundsoftware-site
comparison plugins/redmine_bibliography/init.rb @ 1117:b4b72f1eb644 redmine-2.2-integration
Moved all the plugins from the vendor folder to the application root folder.
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Tue, 08 Jan 2013 12:32:05 +0000 |
parents | vendor/plugins/redmine_bibliography/init.rb@fe32745aaa3d |
children | 35686c1667de |
comparison
equal
deleted
inserted
replaced
1116:bb32da3bea34 | 1117:b4b72f1eb644 |
---|---|
1 require 'redmine' | |
2 require 'dispatcher' | |
3 | |
4 require 'bibtex' | |
5 require 'citeproc' | |
6 | |
7 # Patches to the Redmine core. | |
8 Dispatcher.to_prepare :redmine_model_dependencies do | |
9 require_dependency 'project' | |
10 require_dependency 'user' | |
11 require_dependency 'mailer' | |
12 | |
13 unless Project.included_modules.include? Bibliography::ProjectPublicationsPatch | |
14 Project.send(:include, Bibliography::ProjectPublicationsPatch) | |
15 end | |
16 | |
17 unless User.included_modules.include? Bibliography::UserAuthorPatch | |
18 User.send(:include, Bibliography::UserAuthorPatch) | |
19 end | |
20 | |
21 unless Mailer.included_modules.include? Bibliography::MailerPatch | |
22 Mailer.send(:include, Bibliography::MailerPatch) | |
23 end | |
24 | |
25 unless ProjectsHelper.included_modules.include?(Bibliography::ProjectsHelperPatch) | |
26 ProjectsHelper.send(:include, Bibliography::ProjectsHelperPatch) | |
27 end | |
28 end | |
29 | |
30 | |
31 # Plugin Info | |
32 Redmine::Plugin.register :redmine_bibliography do | |
33 name 'Redmine Bibliography plugin' | |
34 author 'Chris Cannam, Luis Figueira' | |
35 description 'This is a bibliography management plugin for Redmine' | |
36 version '0.0.1' | |
37 url 'http://example.com/path/to/plugin' | |
38 author_url 'http://example.com/about' | |
39 | |
40 settings :default => { 'menu' => 'Publications' }, :partial => 'settings/bibliography' | |
41 | |
42 project_module :redmine_bibliography do | |
43 permission :publications, { :publications => :index }, :public => true | |
44 permission :edit_publication, {:publications => [:edit, :update]} | |
45 permission :add_publication, {:publications => [:new, :create]} | |
46 permission :delete_publication, {:publications => :destroy} | |
47 | |
48 end | |
49 | |
50 # extending the Project Menu | |
51 menu :project_menu, :publications, { :controller => 'publications', :action => 'index', :path => nil }, :after => :activity, :param => :project_id, :caption => Proc.new { Setting.plugin_redmine_bibliography['menu'] }, | |
52 :if => Proc.new { !Setting.plugin_redmine_bibliography['menu'].blank? } | |
53 | |
54 end |