Project

General

Profile

Patch #1052 ยป wikiinc.patch

Patch file - W Snyder, 2008-04-13 17:36

View differences:

lib/redmine/wiki_formatting/macros.rb
79 79
      
80 80
      desc "Include a wiki page. Example:\n\n  !{{include(Foo)}}"
81 81
      macro :include do |obj, args|
82
        if @project && !@project.wiki.nil?
83
          page = @project.wiki.find_page(args.first)
82
        if args[1]
83
          incproject = Project.find(args[1])
84
          if !incproject
85
            raise "Project #{args[1]} doesn't exist"
86
          end          
87
        else
88
          incproject = @project
89
        end
90
        if incproject && !incproject.wiki.nil?
91
          page = incproject.wiki.find_page(args.first)
84 92
          if page && page.content
85 93
            @included_wiki_pages ||= []
86 94
            raise 'Circular inclusion detected' if @included_wiki_pages.include?(page.title)
    (1-1/1)