/modules/mod_development/actions/action_development_development_templates_stream.erl

https://code.google.com/p/zotonic/ · Erlang · 25 lines · 14 code · 5 blank · 6 comment · 0 complexity · 329757b34f1731e8e1fc3696ee3956bc MD5 · raw file

  1. %% @author Marc Worrell <marc@worrell.nl>
  2. %% @copyright 2010 Marc Worrell
  3. %% Date: 2010-09-07
  4. %% @doc Stream template updates to the user agent
  5. -module(action_development_development_templates_stream).
  6. -author("Marc Worrell <marc@worrell.nl>").
  7. -include("zotonic.hrl").
  8. %% interface functions
  9. -export([
  10. render_action/4,
  11. event/2
  12. ]).
  13. render_action(TriggerId, TargetId, _Args, Context) ->
  14. Postback = {development_templates_stream, [{target, TargetId}]},
  15. {PostbackMsgJS, _PickledPostback} = z_render:make_postback(Postback, none, TriggerId, TargetId, ?MODULE, Context),
  16. {PostbackMsgJS, Context}.
  17. %% @doc Flush the caches of all sites.
  18. event({postback, {development_templates_stream, [{target, Target}]}, _TriggerId, _TargetId}, Context) ->
  19. z_notifier:notify1({debug_stream, Target, template}, Context),
  20. Context.