Patch #1052 ยป wikiinc.patch
| lib/redmine/wiki_formatting/macros.rb | ||
|---|---|---|
|
|
||
|
desc "Include a wiki page. Example:\n\n !{{include(Foo)}}"
|
||
|
macro :include do |obj, args|
|
||
|
if @project && !@project.wiki.nil?
|
||
|
page = @project.wiki.find_page(args.first)
|
||
|
if args[1]
|
||
|
incproject = Project.find(args[1])
|
||
|
if !incproject
|
||
|
raise "Project #{args[1]} doesn't exist"
|
||
|
end
|
||
|
else
|
||
|
incproject = @project
|
||
|
end
|
||
|
if incproject && !incproject.wiki.nil?
|
||
|
page = incproject.wiki.find_page(args.first)
|
||
|
if page && page.content
|
||
|
@included_wiki_pages ||= []
|
||
|
raise 'Circular inclusion detected' if @included_wiki_pages.include?(page.title)
|
||