21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
# File 'lib/_workflow/attachment.rb', line 21
def _get(arg)
if _hide? arg
elsif arg[:action] == :create || arg[:action] == :update
new_item = item_instance '_001'
item_outs = _g_default(arg) {|item, item_arg|
action = item[:id][Bike::REX::ID_NEW] ? :create : :delete
button_tmpl = my[:tmpl][:"submit_#{action}"] || <<_html.chomp
<input type="submit" name="@(short_name).action-#{action}" value="#{_ action.to_s}" />
_html
button = item.send(:_get_by_tmpl, {}, button_tmpl)
item_arg[:action] = :create if action == :create
item_tmpl = item[:tmpl][:index].sub(/[\w\W]*\$\(.*?\)/, "\\&#{button}")
item.send(:_get_by_tmpl, item_arg, item_tmpl)
}
tmpl = my[:tmpl][:index].gsub('$()', item_outs)
_get_by_tmpl({:p_action => arg[:p_action], :action => :update}, tmpl)
else
super
end
end
|