diff options
Diffstat (limited to 'mod/blog/views/default')
-rw-r--r-- | mod/blog/views/default/blog/forms/edit.php | 15 | ||||
-rw-r--r-- | mod/blog/views/default/object/blog.php | 16 |
2 files changed, 27 insertions, 4 deletions
diff --git a/mod/blog/views/default/blog/forms/edit.php b/mod/blog/views/default/blog/forms/edit.php index fb069961b..ff8ae8767 100644 --- a/mod/blog/views/default/blog/forms/edit.php +++ b/mod/blog/views/default/blog/forms/edit.php @@ -13,12 +13,12 @@ */
// Set title, form destination
- if (isset($vars['object'])) {
+ if (isset($vars['entity'])) {
$title = sprintf(elgg_echo("blog:editpost"),$object->title);
$action = "blog/edit";
- $title = $vars['object']->title;
- $body = $vars['object']->description;
- $tags = $vars['object']->tags;
+ $title = $vars['entity']->title;
+ $body = $vars['entity']->description;
+ $tags = $vars['entity']->tags;
} else {
$title = elgg_echo("blog:addpost");
$action = "blog/add";
@@ -76,6 +76,13 @@ ?>
</p>
<p>
+ <?php
+
+ if (isset($vars['entity'])) {
+ ?><input type="hidden" name="blogpost" value="<?php echo $vars['entity']->getGUID(); ?>" /><?php
+ }
+
+ ?>
<input type="submit" value="<?php echo elgg_echo('save'); ?>" />
</p>
diff --git a/mod/blog/views/default/object/blog.php b/mod/blog/views/default/object/blog.php index b136267d7..6fcf041ba 100644 --- a/mod/blog/views/default/object/blog.php +++ b/mod/blog/views/default/object/blog.php @@ -44,6 +44,22 @@ ?>
</p>
+ <?php
+
+ if ($vars['entity']->canEdit()) {
+ ?>
+ <a href="<?php echo $vars['url']; ?>mod/blog/edit.php?blogpost=<?php echo $vars['entity']->getGUID(); ?>"><?php echo elgg_echo("edit"); ?></a>
+ <a href="<?php echo $vars['url']; ?>mod/blog/delete.php?blogpost=<?php echo $vars['entity']->getGUID(); ?>"><?php echo elgg_echo("delete"); ?></a>
+ <?php
+
+ // Allow the menu to be extended
+ echo elgg_view("editmenu",array('entity' => $vars['entity']));
+
+ ?>
+ <?php
+ }
+
+ ?>
</div>
<?php
|