Browse files

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

  • Loading branch information...
1 parent 4c9d373 commit 5cd936cb575d5a1123b6b81fe8d88e9fba450ab5 @jsnfwlr jsnfwlr committed with danpoltawski Apr 2, 2012
Showing with 10 additions and 3 deletions.
  1. +10 −3 blog/locallib.php
View
13 blog/locallib.php
@@ -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 5cd936c

Please sign in to comment.