Permalink
Browse files

MDL-27427 - Blog - Adding ability to delete entries from external blogs

  • Loading branch information...
1 parent 697f104 commit d4341ff79ca5153358103b291ad000d06849d740 @jsnfwlr jsnfwlr committed with danpoltawski Apr 2, 2012
Showing with 10 additions and 3 deletions.
  1. +10 −3 blog/locallib.php
View
@@ -292,9 +292,16 @@ public function print_html($return=false) {
$contentcell->text .= $OUTPUT->container_start('commands');
- if (blog_user_can_edit_entry($this) && empty($this->uniquehash)) {
- $contentcell->text .= html_writer::link(new moodle_url('/blog/edit.php', array('action' => 'edit', 'entryid' => $this->id)), $stredit) . ' | ';
- $contentcell->text .= html_writer::link(new moodle_url('/blog/edit.php', array('action' => 'delete', 'entryid' => $this->id)), $strdelete) . ' | ';
+ if (blog_user_can_edit_entry($this)) {
+ if (empty($this->uniquehash)) {
+ //External blog entries should not be edited
+ $contentcell->text .= html_writer::link(new moodle_url('/blog/edit.php',
+ array('action' => 'edit', 'entryid' => $this->id)),
+ $stredit) . ' | ';
+ }
+ $contentcell->text .= html_writer::link(new moodle_url('/blog/edit.php',
+ array('action' => 'delete', 'entryid' => $this->id)),
+ $strdelete) . ' | ';
}
$contentcell->text .= html_writer::link(new moodle_url('/blog/index.php', array('entryid' => $this->id)), get_string('permalink', 'blog'));

0 comments on commit d4341ff

Please sign in to comment.