Merge branch 'feature/2.4.0/view-for-macros' into 2.4.0-finn-master

pull/41/head
Romano Licker 13 years ago
commit c3e502b3eb
  1. 2
      app/helpers/application_helper.rb
  2. 10
      lib/redmine/wiki_formatting/macros.rb

@ -482,7 +482,7 @@ module ApplicationHelper
project = options[:project] || @project || (obj && obj.respond_to?(:project) ? obj.project : nil)
only_path = options.delete(:only_path) == false ? false : true
text = Redmine::WikiFormatting.to_html(Setting.text_formatting, text, :object => obj, :attribute => attr) { |macro, args| exec_macro(macro, obj, args) }
text = Redmine::WikiFormatting.to_html(Setting.text_formatting, text, :object => obj, :attribute => attr) { |macro, args| exec_macro(macro, obj, args, :view => self) }
@parsed_headings = []
text = parse_non_pre_blocks(text) do |text|

@ -16,9 +16,15 @@ module Redmine
module WikiFormatting
module Macros
module Definitions
def exec_macro(name, obj, args)
def exec_macro(name, obj, args, options={})
method_name = "macro_#{name}"
send(method_name, obj, args) if respond_to?(method_name)
if respond_to?(method_name)
if method(method_name).arity == 2
send(method_name, obj, args)
else
send(method_name, obj, args, options)
end
end
end
def extract_macro_options(args, *keys)

Loading…
Cancel
Save