comparison vendor/plugins/redmine_bibliography/init.rb @ 1068:e11d8d13ebc5 bibplugin_cache

Added local caching to the publications helper; patch to the projects controller to load the publications helper; added patch to the plugin init file
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Tue, 20 Nov 2012 16:55:41 +0000
parents 75351d69e2ba
children 858f042e8d11
comparison
equal deleted inserted replaced
1067:2ad2f9ab46a6 1068:e11d8d13ebc5
3 3
4 require 'bibtex' 4 require 'bibtex'
5 require 'citeproc' 5 require 'citeproc'
6 6
7 7
8 RAILS_DEFAULT_LOGGER.info 'Starting Bibliography Plugin for RedMine' 8 RAILS_DEFAULT_LOGGER.info 'Starting Bibliography Plugin for Redmine'
9 9
10 # Patches to the Redmine core. 10 # Patches to the Redmine core.
11 Dispatcher.to_prepare :redmine_model_dependencies do 11 Dispatcher.to_prepare :redmine_model_dependencies do
12 require_dependency 'project' 12 require_dependency 'project'
13 require_dependency 'user' 13 require_dependency 'user'
23 23
24 unless Mailer.included_modules.include? Bibliography::MailerPatch 24 unless Mailer.included_modules.include? Bibliography::MailerPatch
25 Mailer.send(:include, Bibliography::MailerPatch) 25 Mailer.send(:include, Bibliography::MailerPatch)
26 end 26 end
27 27
28 unless ProjectsController.included_modules.include?(Bibliography::ProjectsControllerPatch)
29 ProjectsController.send(:include, Bibliography::ProjectsControllerPatch)
30 end
28 31
29 end 32 end
30 33
31 34
32 # Plugin Info 35 # Plugin Info
49 end 52 end
50 53
51 # extending the Project Menu 54 # extending the Project Menu
52 menu :project_menu, :publications, { :controller => 'publications', :action => 'index', :path => nil }, :after => :activity, :param => :project_id, :caption => Proc.new { Setting.plugin_redmine_bibliography['menu'] }, 55 menu :project_menu, :publications, { :controller => 'publications', :action => 'index', :path => nil }, :after => :activity, :param => :project_id, :caption => Proc.new { Setting.plugin_redmine_bibliography['menu'] },
53 :if => Proc.new { !Setting.plugin_redmine_bibliography['menu'].blank? } 56 :if => Proc.new { !Setting.plugin_redmine_bibliography['menu'].blank? }
54 57
55 end 58 end