diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-01-22 12:54:38 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-01-22 12:54:38 +0000 |
commit | 186f5474e37f9ebde09b9afe2c82fa711402b421 (patch) | |
tree | fd1f7bf3dc5f143f987dfed808e1105ac278487f | |
parent | c26ca19ce60abb5e6a1126708441988e172eca70 (diff) | |
download | elgg-186f5474e37f9ebde09b9afe2c82fa711402b421.tar.gz elgg-186f5474e37f9ebde09b9afe2c82fa711402b421.tar.bz2 |
using list metadata view rather than custom code
git-svn-id: http://code.elgg.org/elgg/trunk@7897 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r-- | mod/blog/views/default/object/blog.php | 47 |
1 files changed, 9 insertions, 38 deletions
diff --git a/mod/blog/views/default/object/blog.php b/mod/blog/views/default/object/blog.php index fd2c4fee8..3c5003310 100644 --- a/mod/blog/views/default/object/blog.php +++ b/mod/blog/views/default/object/blog.php @@ -43,46 +43,17 @@ if ($blog->comments_on != 'Off') { $comments_link = ''; } -// access is always shown. -$metadata = '<ul class="elgg-list-metadata">'; -$metadata .= '<li>' . elgg_view('output/access', array('entity' => $blog)) . '</li>'; - - -$likes = elgg_view_likes($blog); -$metadata .= "<li>$likes</li>"; - - -// pass <li>your data</li> back from the view -$metadata .= elgg_view("entity/metadata", array('entity' => $blog)); - -// links to delete or edit. -if ($blog->canEdit()) { - - $status = ''; - if ($blog->status != 'published') { - $status_text = elgg_echo("blog:status:{$blog->status}"); - $metadata .= "<li>$status_text</li>"; - } - - $edit_url = elgg_get_site_url() . "pg/blog/edit/{$blog->getGUID()}/"; - $edit_link = elgg_view('output/url', array( - 'href' => $edit_url, - 'text' => elgg_echo('edit'), - )); - $metadata .= "<li>$edit_link</li>"; - - $delete_url = "action/blog/delete?guid={$blog->getGUID()}"; - $delete_link = elgg_view('output/confirmlink', array( - 'href' => $delete_url, - 'text' => '<span class="elgg-icon elgg-icon-delete"></span>', - 'title' => elgg_echo('delete'), - 'confirm' => elgg_echo('deleteconfirm'), - 'text_encode' => false, - )); - $metadata .= "<li>$delete_link</li>"; +$extra_links = false; +if ($blog->canEdit() && $blog->status != 'published') { + $status_text = elgg_echo("blog:status:{$blog->status}"); + $extra_links = array($status_text); } -$metadata .= '</ul>'; +$metadata = elgg_view('layout/objects/list/metadata', array( + 'entity' => $blog, + 'handler' => 'blog', + 'links' => $extra_links, +)); $subtitle = "$author_text $date $categories $comments_link"; |