/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. <h1>Module m_comment</h1>
  11. <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.
  12. <p>Copyright Š 2010-2011 Marc Worrell
  13. Date: 2010-01-15
  14. </p>
  15. <p><b>Behaviours:</b> <a href="gen_model.html"><tt>gen_model</tt></a>.</p>
  16. <p><b>Authors:</b> Marc Worrell (<a href="mailto:marc@worrell.nl"><tt>marc@worrell.nl</tt></a>).</p>
  17. <h2><a name="description">Description</a></h2>Model for managing the comments on a page.
  18. <h2><a name="index">Function Index</a></h2>
  19. <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>
  20. <tr><td valign="top"><a href="#get-2">get/2</a></td><td>Fetch a specific comment from the database.</td></tr>
  21. <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>
  22. <tr><td valign="top"><a href="#insert-5">insert/5</a></td><td>Insert a new comment.</td></tr>
  23. <tr><td valign="top"><a href="#list_rsc-2">list_rsc/2</a></td><td>List all comments of the resource.</td></tr>
  24. <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>
  25. <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>
  26. <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>
  27. <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>
  28. <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>
  29. </table>
  30. <h2><a name="functions">Function Details</a></h2>
  31. <h3 class="function"><a name="delete-2">delete/2</a></h3>
  32. <div class="spec">
  33. <p><tt>delete(CommentId, Context) -&gt; any()</tt></p>
  34. </div><p>Delete a comment. Only possible if the user has edit permission on the page.</p>
  35. <h3 class="function"><a name="get-2">get/2</a></h3>
  36. <div class="spec">
  37. <p><tt>get(CommentId::<a href="#type-int">int()</a>, Context) -&gt; PropList</tt></p>
  38. </div><p>Fetch a specific comment from the database.</p>
  39. <h3 class="function"><a name="gravatar_code-1">gravatar_code/1</a></h3>
  40. <div class="spec">
  41. <p><tt>gravatar_code(Email) -&gt; list()</tt></p>
  42. </div><p>Return the gravatar code of an email address. See also http://gravatar.com/</p>
  43. <h3 class="function"><a name="insert-5">insert/5</a></h3>
  44. <div class="spec">
  45. <p><tt>insert(Id::<a href="#type-int">int()</a>, Name::string(), Email::string(), Message::string(), Context) -&gt; {ok, CommentId} | {error, Reason}</tt></p>
  46. </div><p>Insert a new comment. Fetches the submitter information from the Context.</p>
  47. <h3 class="function"><a name="list_rsc-2">list_rsc/2</a></h3>
  48. <div class="spec">
  49. <p><tt>list_rsc(RscId::<a href="#type-int">int()</a>, Context) -&gt; [PropList]</tt></p>
  50. </div><p>List all comments of the resource.</p>
  51. <h3 class="function"><a name="m_find_value-3">m_find_value/3</a></h3>
  52. <div class="spec">
  53. <p><tt>m_find_value(Id::Key, M::Source, Context) -&gt; term()</tt></p>
  54. </div><p>Fetch the value for the key from a model source</p>
  55. <h3 class="function"><a name="m_to_list-2">m_to_list/2</a></h3>
  56. <div class="spec">
  57. <p><tt>m_to_list(X1::Source, Context) -&gt; []</tt></p>
  58. </div><p>Transform a m_config value to a list, used for template loops</p>
  59. <h3 class="function"><a name="m_value-2">m_value/2</a></h3>
  60. <div class="spec">
  61. <p><tt>m_value(M::Source, Context) -&gt; term()</tt></p>
  62. </div><p>Transform a model value so that it can be formatted or piped through filters</p>
  63. <h3 class="function"><a name="search-3">search/3</a></h3>
  64. <div class="spec">
  65. <p><tt>search(X1, OfffsetLimit, Context) -&gt; any()</tt></p>
  66. </div><p>Return the search as used by z_search and the search model.</p>
  67. <h3 class="function"><a name="toggle-2">toggle/2</a></h3>
  68. <div class="spec">
  69. <p><tt>toggle(CommentId, Context) -&gt; any()</tt></p>
  70. </div><p>Toggle the visibility of a comment, return the new visibility</p>
  71. <hr>
  72. <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>
  73. <p><i>Generated by EDoc, Aug 12 2011, 19:36:11.</i></p>
  74. </body>
  75. </html>