To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / vendor / plugins / embedded / init.rb @ 915:2a68662d5adf
History | View | Annotate | Download (1.19 KB)
| 1 |
require 'redmine'
|
|---|---|
| 2 |
require 'embedded'
|
| 3 |
|
| 4 |
Redmine::Plugin.register :embedded do |
| 5 |
name 'Embedded'
|
| 6 |
author 'Jean-Philippe Lang'
|
| 7 |
description 'Embed various documentations in your projects'
|
| 8 |
version '0.0.1'
|
| 9 |
settings :default => { 'path' => '/var/doc/{PROJECT}/html', |
| 10 |
'index' => 'main.html overview-summary.html index.html', |
| 11 |
'extensions' => 'html png gif', |
| 12 |
'template' => '', |
| 13 |
'encoding' => '', |
| 14 |
'menu' => 'Embedded' }, |
| 15 |
:partial => 'settings/embedded' |
| 16 |
|
| 17 |
project_module :embedded do |
| 18 |
permission :view_embedded_doc, {:embedded => :index} |
| 19 |
end
|
| 20 |
|
| 21 |
menu :project_menu, :embedded, { :controller => 'embedded', :action => 'index', :path => nil }, |
| 22 |
:caption => Proc.new { Setting.plugin_embedded['menu'] }, |
| 23 |
:if => Proc.new { !Setting.plugin_embedded['menu'].blank? } |
| 24 |
end
|
| 25 |
|
| 26 |
# Routes
|
| 27 |
class << ActionController::Routing::Routes;self;end.class_eval do |
| 28 |
define_method :clear!, lambda {}
|
| 29 |
end
|
| 30 |
|
| 31 |
ActionController::Routing::Routes.draw do |map| |
| 32 |
map.connect 'embedded/:id/*path', :controller => 'embedded', :action => 'index' |
| 33 |
end
|