Module m_comment

Model for managing the comments on a page.

Copyright © 2010-2011 Marc Worrell Date: 2010-01-15

Behaviours: zotonic_model.

Authors: Marc Worrell (marc@worrell.nl).

Description

Model for managing the comments on a page.

Function Index

delete/2Delete a comment.
get/2Fetch a specific comment from the database.
gravatar_code/1Return the gravatar code of an email address.
insert/6Insert a new comment.
is_deletable/2Check if a comment can be deleted.
list_rsc/2List all comments of the resource.
m_get/3Fetch the value for the key from a model source.
merge/3Move all comments from one resource to another.
search/3Return the search as used by z_search and the search model.
toggle/2Toggle the visibility of a comment, return the new visibility.

Function Details

delete/2

delete(CommentId, Context) -> any()

Delete a comment. Only possible if the user has edit permission on the page.

get/2

get(CommentId::int(), Context) -> PropList

Fetch a specific comment from the database.

gravatar_code/1

gravatar_code(Email) -> list()

Return the gravatar code of an email address. See also http://gravatar.com/

insert/6

insert(RscId::m_rsc:resource(), Name::string(), Email::string(), Message::string(), Is_visible::boolean(), Context::z:context()) -> {ok, pos_integer()} | {error, any()}

Insert a new comment. Fetches the submitter information from the Context.

is_deletable/2

is_deletable(CommentId, Context) -> any()

Check if a comment can be deleted

list_rsc/2

list_rsc(RscId::m_rsc:resource(), Context::z:context()) -> list()

List all comments of the resource.

m_get/3

m_get(Rest::list(), Msg::zotonic_model:opt_msg(), Context::z:context()) -> zotonic_model:return()

Fetch the value for the key from a model source

merge/3

merge(WinnerId::m_rsc:resource(), LoserId::m_rsc:resource(), Context::z:context()) -> ok

Move all comments from one resource to another

search/3

search(X1, OfffsetLimit, Context) -> any()

Return the search as used by z_search and the search model.

toggle/2

toggle(CommentId, Context) -> any()

Toggle the visibility of a comment, return the new visibility


Generated by EDoc