PageRenderTime 10ms CodeModel.GetById 2ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/doc/modules/mod_comment/m_comment.html

https://code.google.com/p/zotonic/
HTML | 90 lines | 75 code | 15 blank | 0 comment | 0 complexity | 622397942f2fae70aa0c521f84cfb915 MD5 | raw file
 1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 2<html>
 3<head>
 4<title>Module m_comment</title>
 5<link rel="stylesheet" type="text/css" href="stylesheet.css" title="EDoc">
 6</head>
 7<body bgcolor="white">
 8<div class="navbar"><a name="#navbar_top"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
 9<hr>
10
11<h1>Module m_comment</h1>
12<ul class="index"><li><a href="#description">Description</a></li><li><a href="#index">Function Index</a></li><li><a href="#functions">Function Details</a></li></ul>Model for managing the comments on a page.
13<p>Copyright Š 2010-2011 Marc Worrell
14  Date: 2010-01-15
15 </p>
16
17<p><b>Behaviours:</b> <a href="gen_model.html"><tt>gen_model</tt></a>.</p>
18<p><b>Authors:</b> Marc Worrell (<a href="mailto:marc@worrell.nl"><tt>marc@worrell.nl</tt></a>).</p>
19
20<h2><a name="description">Description</a></h2>Model for managing the comments on a page.
21<h2><a name="index">Function Index</a></h2>
22<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#delete-2">delete/2</a></td><td>Delete a comment.</td></tr>
23<tr><td valign="top"><a href="#get-2">get/2</a></td><td>Fetch a specific comment from the database.</td></tr>
24<tr><td valign="top"><a href="#gravatar_code-1">gravatar_code/1</a></td><td>Return the gravatar code of an email address.</td></tr>
25<tr><td valign="top"><a href="#insert-5">insert/5</a></td><td>Insert a new comment.</td></tr>
26<tr><td valign="top"><a href="#list_rsc-2">list_rsc/2</a></td><td>List all comments of the resource.</td></tr>
27<tr><td valign="top"><a href="#m_find_value-3">m_find_value/3</a></td><td>Fetch the value for the key from a model source.</td></tr>
28<tr><td valign="top"><a href="#m_to_list-2">m_to_list/2</a></td><td>Transform a m_config value to a list, used for template loops.</td></tr>
29<tr><td valign="top"><a href="#m_value-2">m_value/2</a></td><td>Transform a model value so that it can be formatted or piped through filters.</td></tr>
30<tr><td valign="top"><a href="#search-3">search/3</a></td><td>Return the search as used by z_search and the search model.</td></tr>
31<tr><td valign="top"><a href="#toggle-2">toggle/2</a></td><td>Toggle the visibility of a comment, return the new visibility.</td></tr>
32</table>
33
34<h2><a name="functions">Function Details</a></h2>
35
36<h3 class="function"><a name="delete-2">delete/2</a></h3>
37<div class="spec">
38<p><tt>delete(CommentId, Context) -&gt; any()</tt></p>
39</div><p>Delete a comment.  Only possible if the user has edit permission on the page.</p>
40
41<h3 class="function"><a name="get-2">get/2</a></h3>
42<div class="spec">
43<p><tt>get(CommentId::<a href="#type-int">int()</a>, Context) -&gt; PropList</tt></p>
44</div><p>Fetch a specific comment from the database.</p>
45
46<h3 class="function"><a name="gravatar_code-1">gravatar_code/1</a></h3>
47<div class="spec">
48<p><tt>gravatar_code(Email) -&gt; list()</tt></p>
49</div><p>Return the gravatar code of an email address. See also http://gravatar.com/</p>
50
51<h3 class="function"><a name="insert-5">insert/5</a></h3>
52<div class="spec">
53<p><tt>insert(Id::<a href="#type-int">int()</a>, Name::string(), Email::string(), Message::string(), Context) -&gt; {ok, CommentId} | {error, Reason}</tt></p>
54</div><p>Insert a new comment. Fetches the submitter information from the Context.</p>
55
56<h3 class="function"><a name="list_rsc-2">list_rsc/2</a></h3>
57<div class="spec">
58<p><tt>list_rsc(RscId::<a href="#type-int">int()</a>, Context) -&gt; [PropList]</tt></p>
59</div><p>List all comments of the resource.</p>
60
61<h3 class="function"><a name="m_find_value-3">m_find_value/3</a></h3>
62<div class="spec">
63<p><tt>m_find_value(Id::Key, M::Source, Context) -&gt; term()</tt></p>
64</div><p>Fetch the value for the key from a model source</p>
65
66<h3 class="function"><a name="m_to_list-2">m_to_list/2</a></h3>
67<div class="spec">
68<p><tt>m_to_list(X1::Source, Context) -&gt; []</tt></p>
69</div><p>Transform a m_config value to a list, used for template loops</p>
70
71<h3 class="function"><a name="m_value-2">m_value/2</a></h3>
72<div class="spec">
73<p><tt>m_value(M::Source, Context) -&gt; term()</tt></p>
74</div><p>Transform a model value so that it can be formatted or piped through filters</p>
75
76<h3 class="function"><a name="search-3">search/3</a></h3>
77<div class="spec">
78<p><tt>search(X1, OfffsetLimit, Context) -&gt; any()</tt></p>
79</div><p>Return the search as used by z_search and the search model.</p>
80
81<h3 class="function"><a name="toggle-2">toggle/2</a></h3>
82<div class="spec">
83<p><tt>toggle(CommentId, Context) -&gt; any()</tt></p>
84</div><p>Toggle the visibility of a comment, return the new visibility</p>
85<hr>
86
87<div class="navbar"><a name="#navbar_bottom"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
88<p><i>Generated by EDoc, Aug 12 2011, 19:36:11.</i></p>
89</body>
90</html>