@@ -40,6 +40,7 class WikiController < ApplicationController | |||
|
40 | 40 | helper :attachments |
|
41 | 41 | include AttachmentsHelper |
|
42 | 42 | helper :watchers |
|
43 | include Redmine::Export::PDF | |
|
43 | 44 | |
|
44 | 45 | # List of pages, sorted alphabetically and by parent (hierarchy) |
|
45 | 46 | def index |
@@ -71,7 +72,10 class WikiController < ApplicationController | |||
|
71 | 72 | end |
|
72 | 73 | @content = @page.content_for_version(params[:version]) |
|
73 | 74 | if User.current.allowed_to?(:export_wiki_pages, @project) |
|
74 |
if params[:format] == ' |
|
|
75 | if params[:format] == 'pdf' | |
|
76 | send_data(wiki_to_pdf(@page, @project), :type => 'application/pdf', :filename => "#{@page.title}.pdf") | |
|
77 | return | |
|
78 | elsif params[:format] == 'html' | |
|
75 | 79 | export = render_to_string :action => 'export', :layout => false |
|
76 | 80 | send_data(export, :type => 'text/html', :filename => "#{@page.title}.html") |
|
77 | 81 | return |
@@ -53,6 +53,7 | |||
|
53 | 53 | <% end %> |
|
54 | 54 | |
|
55 | 55 | <% other_formats_links do |f| %> |
|
56 | <%= f.link_to 'PDF', :url => {:id => @page.title, :version => @content.version} %> | |
|
56 | 57 | <%= f.link_to 'HTML', :url => {:id => @page.title, :version => @content.version} %> |
|
57 | 58 | <%= f.link_to 'TXT', :url => {:id => @page.title, :version => @content.version} %> |
|
58 | 59 | <% end if User.current.allowed_to?(:export_wiki_pages, @project) %> |
General Comments 0
You need to be logged in to leave comments.
Login now