diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-03 17:53:05 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-03 17:53:05 +0000 |
commit | 4766f36a4d74924f21ff329c4318ce4e069ffa04 (patch) | |
tree | 969b84632f2a8b0db79788a8a6db8e41d63e5cb4 /mod/blog/views/default/object/blog.php | |
parent | 57a217fd6b708844407486046a1faa23b46cac08 (diff) | |
download | elgg-4766f36a4d74924f21ff329c4318ce4e069ffa04.tar.gz elgg-4766f36a4d74924f21ff329c4318ce4e069ffa04.tar.bz2 |
Pulled in the interface changes.
git-svn-id: http://code.elgg.org/elgg/trunk@5257 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/blog/views/default/object/blog.php')
-rw-r--r-- | mod/blog/views/default/object/blog.php | 150 |
1 files changed, 150 insertions, 0 deletions
diff --git a/mod/blog/views/default/object/blog.php b/mod/blog/views/default/object/blog.php new file mode 100644 index 000000000..898705911 --- /dev/null +++ b/mod/blog/views/default/object/blog.php @@ -0,0 +1,150 @@ +<?php + + /** + * Elgg blog individual post view + * + * @package ElggBlog + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Ben Werdmuller <ben@curverider.co.uk> + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.com/ + * + * @uses $vars['entity'] Optionally, the blog post to view + */ + + if (isset($vars['entity'])) { + + //display comments link? + if ($vars['entity']->comments_on == 'Off') { + $comments_on = false; + } else { + $comments_on = true; + } + + if (get_context() == "search" && $vars['entity'] instanceof ElggObject) { + + //display the correct layout depending on gallery or list view + if (get_input('search_viewtype') == "gallery") { + + //display the gallery view + echo elgg_view("blog/gallery",$vars); + + } else { + + echo elgg_view("blog/listing",$vars); + + } + + + } else { + + if ($vars['entity'] instanceof ElggObject) { + + $url = $vars['entity']->getURL(); + $owner = $vars['entity']->getOwnerEntity(); + $canedit = $vars['entity']->canEdit(); + + } else { + + $url = 'javascript:history.go(-1);'; + $owner = $vars['user']; + $canedit = false; + + } +?> + + <div class="contentWrapper singleview"> + + <div class="blog_post"> + <h3><a href="<?php echo $url; ?>"><?php echo $vars['entity']->title; ?></a></h3> + <!-- display the user icon --> + <div class="blog_post_icon"> + <?php + echo elgg_view("profile/icon",array('entity' => $owner, 'size' => 'tiny')); + ?> + </div> + <p class="strapline"> + <?php + + echo sprintf(elgg_echo("blog:strapline"), + date("F j, Y",$vars['entity']->time_created) + ); + + ?> + <?php echo elgg_echo('by'); ?> <a href="<?php echo $vars['url']; ?>pg/blog/<?php echo $owner->username; ?>"><?php echo $owner->name; ?></a> + <!-- display the comments link --> + <?php + if($comments_on && $vars['entity'] instanceof ElggObject){ + //get the number of comments + $num_comments = elgg_count_comments($vars['entity']); + ?> + <a href="<?php echo $url; ?>"><?php echo sprintf(elgg_echo("comments")) . " (" . $num_comments . ")"; ?></a><br /> + <?php + } + ?> + </p> + <!-- display tags --> + <?php + + $tags = elgg_view('output/tags', array('tags' => $vars['entity']->tags)); + if (!empty($tags)) { + echo '<p class="tags">' . $tags . '</p>'; + } + + $categories = elgg_view('categories/view', $vars); + if (!empty($categories)) { + echo '<p class="categories">' . $categories . '</p>'; + } + + ?> + <div class="clearfloat"></div> + <div class="blog_post_body"> + + <!-- display the actual blog post --> + <?php + + echo elgg_view('output/longtext',array('value' => $vars['entity']->description)); + + ?> + </div><div class="clearfloat"></div> + <!-- display edit options if it is the blog post owner --> + <p class="options"> + <?php + + if ($canedit) { + + ?> + <a href="<?php echo $vars['url']; ?>mod/blog/edit.php?blogpost=<?php echo $vars['entity']->getGUID(); ?>"><?php echo elgg_echo("edit"); ?></a> + <?php + + echo elgg_view("output/confirmlink", array( + 'href' => $vars['url'] . "action/blog/delete?blogpost=" . $vars['entity']->getGUID(), + 'text' => elgg_echo('delete'), + 'confirm' => elgg_echo('deleteconfirm'), + )); + + // Allow the menu to be extended + echo elgg_view("editmenu",array('entity' => $vars['entity'])); + + ?> + <?php + } + + ?> + </p> + </div> + </div> + +<?php + + // If we've been asked to display the full view + // Now handled by annotation framework + /*if (isset($vars['full']) && $vars['full'] == true && $comments_on == 'on' && $vars['entity'] instanceof ElggEntity) { + echo elgg_view_comments($vars['entity']); + }*/ + + } + + } + +?> |