/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
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html>
- <head>
- <title>Module m_comment</title>
- <link rel="stylesheet" type="text/css" href="stylesheet.css" title="EDoc">
- </head>
- <body bgcolor="white">
- <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>
- <hr>
- <h1>Module m_comment</h1>
- <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.
- <p>Copyright 2010-2011 Marc Worrell
- Date: 2010-01-15
- </p>
- <p><b>Behaviours:</b> <a href="gen_model.html"><tt>gen_model</tt></a>.</p>
- <p><b>Authors:</b> Marc Worrell (<a href="mailto:marc@worrell.nl"><tt>marc@worrell.nl</tt></a>).</p>
- <h2><a name="description">Description</a></h2>Model for managing the comments on a page.
- <h2><a name="index">Function Index</a></h2>
- <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>
- <tr><td valign="top"><a href="#get-2">get/2</a></td><td>Fetch a specific comment from the database.</td></tr>
- <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>
- <tr><td valign="top"><a href="#insert-5">insert/5</a></td><td>Insert a new comment.</td></tr>
- <tr><td valign="top"><a href="#list_rsc-2">list_rsc/2</a></td><td>List all comments of the resource.</td></tr>
- <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>
- <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>
- <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>
- <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>
- <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>
- </table>
- <h2><a name="functions">Function Details</a></h2>
- <h3 class="function"><a name="delete-2">delete/2</a></h3>
- <div class="spec">
- <p><tt>delete(CommentId, Context) -> any()</tt></p>
- </div><p>Delete a comment. Only possible if the user has edit permission on the page.</p>
- <h3 class="function"><a name="get-2">get/2</a></h3>
- <div class="spec">
- <p><tt>get(CommentId::<a href="#type-int">int()</a>, Context) -> PropList</tt></p>
- </div><p>Fetch a specific comment from the database.</p>
- <h3 class="function"><a name="gravatar_code-1">gravatar_code/1</a></h3>
- <div class="spec">
- <p><tt>gravatar_code(Email) -> list()</tt></p>
- </div><p>Return the gravatar code of an email address. See also http://gravatar.com/</p>
- <h3 class="function"><a name="insert-5">insert/5</a></h3>
- <div class="spec">
- <p><tt>insert(Id::<a href="#type-int">int()</a>, Name::string(), Email::string(), Message::string(), Context) -> {ok, CommentId} | {error, Reason}</tt></p>
- </div><p>Insert a new comment. Fetches the submitter information from the Context.</p>
- <h3 class="function"><a name="list_rsc-2">list_rsc/2</a></h3>
- <div class="spec">
- <p><tt>list_rsc(RscId::<a href="#type-int">int()</a>, Context) -> [PropList]</tt></p>
- </div><p>List all comments of the resource.</p>
- <h3 class="function"><a name="m_find_value-3">m_find_value/3</a></h3>
- <div class="spec">
- <p><tt>m_find_value(Id::Key, M::Source, Context) -> term()</tt></p>
- </div><p>Fetch the value for the key from a model source</p>
- <h3 class="function"><a name="m_to_list-2">m_to_list/2</a></h3>
- <div class="spec">
- <p><tt>m_to_list(X1::Source, Context) -> []</tt></p>
- </div><p>Transform a m_config value to a list, used for template loops</p>
- <h3 class="function"><a name="m_value-2">m_value/2</a></h3>
- <div class="spec">
- <p><tt>m_value(M::Source, Context) -> term()</tt></p>
- </div><p>Transform a model value so that it can be formatted or piped through filters</p>
- <h3 class="function"><a name="search-3">search/3</a></h3>
- <div class="spec">
- <p><tt>search(X1, OfffsetLimit, Context) -> any()</tt></p>
- </div><p>Return the search as used by z_search and the search model.</p>
- <h3 class="function"><a name="toggle-2">toggle/2</a></h3>
- <div class="spec">
- <p><tt>toggle(CommentId, Context) -> any()</tt></p>
- </div><p>Toggle the visibility of a comment, return the new visibility</p>
- <hr>
- <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>
- <p><i>Generated by EDoc, Aug 12 2011, 19:36:11.</i></p>
- </body>
- </html>