Skip to content

Commit

Permalink
MDL-27427 - Blog - Adding ability to delete entries from external blogs
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnfwlr authored and danpoltawski committed Apr 10, 2012
1 parent 697f104 commit d4341ff
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions blog/locallib.php
Expand Up @@ -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'));
Expand Down

0 comments on commit d4341ff

Please sign in to comment.