diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-06 19:56:06 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-06 19:56:06 +0000 |
commit | 1a792bebc590cdcfc1b888a33209df92be51400d (patch) | |
tree | 87e913b42593b74713a9280b7a7ea3ca4bb2f93e /engine/lib/views.php | |
parent | cfaa89dd2d32bc3c17d55def95a1fd49187e1667 (diff) | |
download | elgg-1a792bebc590cdcfc1b888a33209df92be51400d.tar.gz elgg-1a792bebc590cdcfc1b888a33209df92be51400d.tar.bz2 |
moved the count comments and likes functions into the ElggEntity class
git-svn-id: http://code.elgg.org/elgg/trunk@8047 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/views.php')
-rw-r--r-- | engine/lib/views.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/engine/lib/views.php b/engine/lib/views.php index 72cfeb2b6..d76456d83 100644 --- a/engine/lib/views.php +++ b/engine/lib/views.php @@ -1098,6 +1098,27 @@ function elgg_view_latest_comments($owner_guid, $type = 'object', $subtype = '', ); return elgg_view('layout/objects/module', $params); } + +/** + * Returns the HTML for "likes" on entities. + * + * @param ElggEntity $entity The entity to like + * + * @return string|false The HTML for the likes, or false on failure + * + * @since 1.8.0 + * @see @elgg_view core/likes/display + */ +function elgg_view_likes($entity) { + if (!($entity instanceof ElggEntity)) { + return false; + } + + $params = array('entity' => $entity); + + return elgg_view('core/likes/display', $params); +} + /** * Wrapper function for the image block display pattern. * |