Added more plugin hooks:
* :controller_messages_new_after_save * :controller_messages_reply_after_save * :controller_wiki_edit_after_save #3306 git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2774 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
ea7ff8dd76
commit
4ba8308507
|
@ -46,6 +46,7 @@ class MessagesController < ApplicationController
|
||||||
@message.sticky = params[:message]['sticky']
|
@message.sticky = params[:message]['sticky']
|
||||||
end
|
end
|
||||||
if request.post? && @message.save
|
if request.post? && @message.save
|
||||||
|
call_hook(:controller_messages_new_after_save, { :params => params, :message => @message})
|
||||||
attach_files(@message, params[:attachments])
|
attach_files(@message, params[:attachments])
|
||||||
redirect_to :action => 'show', :id => @message
|
redirect_to :action => 'show', :id => @message
|
||||||
end
|
end
|
||||||
|
@ -58,6 +59,7 @@ class MessagesController < ApplicationController
|
||||||
@reply.board = @board
|
@reply.board = @board
|
||||||
@topic.children << @reply
|
@topic.children << @reply
|
||||||
if !@reply.new_record?
|
if !@reply.new_record?
|
||||||
|
call_hook(:controller_messages_reply_after_save, { :params => params, :message => @reply})
|
||||||
attach_files(@reply, params[:attachments])
|
attach_files(@reply, params[:attachments])
|
||||||
end
|
end
|
||||||
redirect_to :action => 'show', :id => @topic
|
redirect_to :action => 'show', :id => @topic
|
||||||
|
|
|
@ -83,6 +83,7 @@ class WikiController < ApplicationController
|
||||||
@content.author = User.current
|
@content.author = User.current
|
||||||
# if page is new @page.save will also save content, but not if page isn't a new record
|
# if page is new @page.save will also save content, but not if page isn't a new record
|
||||||
if (@page.new_record? ? @page.save : @content.save)
|
if (@page.new_record? ? @page.save : @content.save)
|
||||||
|
call_hook(:controller_wiki_edit_after_save, { :params => params, :page => @page})
|
||||||
redirect_to :action => 'index', :id => @project, :page => @page.title
|
redirect_to :action => 'index', :id => @project, :page => @page.title
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue