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 committed Apr 3, 2012
1 parent a280078 commit 4def846
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions blog/locallib.php
Original file line number Diff line number Diff line change
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 4def846

Please sign in to comment.