/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
- %% @author Marc Worrell <marc@worrell.nl>
- %% @copyright 2010 Marc Worrell
- %% Date: 2010-09-07
- %% @doc Stream template updates to the user agent
- -module(action_development_development_templates_stream).
- -author("Marc Worrell <marc@worrell.nl>").
- -include("zotonic.hrl").
- %% interface functions
- -export([
- render_action/4,
- event/2
- ]).
- render_action(TriggerId, TargetId, _Args, Context) ->
- Postback = {development_templates_stream, [{target, TargetId}]},
- {PostbackMsgJS, _PickledPostback} = z_render:make_postback(Postback, none, TriggerId, TargetId, ?MODULE, Context),
- {PostbackMsgJS, Context}.
- %% @doc Flush the caches of all sites.
- event({postback, {development_templates_stream, [{target, Target}]}, _TriggerId, _TargetId}, Context) ->
- z_notifier:notify1({debug_stream, Target, template}, Context),
- Context.