diff vendor/plugins/embedded/init.rb @ 154:317821dd92c9 feature_20

Add Embedded plugin, for Doxygen/Javadoc use
author Chris Cannam
date Thu, 27 Jan 2011 09:08:03 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/embedded/init.rb	Thu Jan 27 09:08:03 2011 +0000
@@ -0,0 +1,33 @@
+require 'redmine'
+require 'embedded'
+
+Redmine::Plugin.register :embedded do
+  name 'Embedded'
+  author 'Jean-Philippe Lang'
+  description 'Embed various documentations in your projects'
+  version '0.0.1'
+  settings :default => { 'path' => '/var/doc/{PROJECT}/html',
+                         'index' => 'main.html overview-summary.html index.html',
+                         'extensions' => 'html png gif',
+                         'template' => '',
+                         'encoding' => '',
+                         'menu' => 'Embedded' },
+           :partial => 'settings/embedded'
+
+  project_module :embedded do
+    permission :view_embedded_doc, {:embedded => :index}
+  end
+
+  menu :project_menu, :embedded, { :controller => 'embedded', :action => 'index', :path => nil },
+                                 :caption => Proc.new { Setting.plugin_embedded['menu'] },
+                                 :if => Proc.new { !Setting.plugin_embedded['menu'].blank? }
+end
+
+# Routes
+class << ActionController::Routing::Routes;self;end.class_eval do
+  define_method :clear!, lambda {}
+end
+
+ActionController::Routing::Routes.draw do |map|
+  map.connect 'embedded/:id/*path', :controller => 'embedded', :action => 'index'
+end