PageRenderTime 17ms CodeModel.GetById 9ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 6
 7-module(action_development_development_templates_stream).
 8-author("Marc Worrell <marc@worrell.nl>").
 9-include("zotonic.hrl").
10
11%% interface functions
12-export([
13    render_action/4,
14    event/2
15]).
16
17render_action(TriggerId, TargetId, _Args, Context) ->
18    Postback = {development_templates_stream, [{target, TargetId}]},
19    {PostbackMsgJS, _PickledPostback} = z_render:make_postback(Postback, none, TriggerId, TargetId, ?MODULE, Context),
20    {PostbackMsgJS, Context}.
21
22%% @doc Flush the caches of all sites.
23event({postback, {development_templates_stream, [{target, Target}]}, _TriggerId, _TargetId}, Context) ->
24    z_notifier:notify1({debug_stream, Target, template}, Context),
25    Context.