PhotoPage: move edit button from old admin bar to widget

This commit is contained in:
Aaron van Geffen 2023-03-11 15:17:36 +01:00
parent 277611e0ac
commit c6902150f0
2 changed files with 2 additions and 5 deletions

View File

@ -27,10 +27,6 @@ class ViewPhoto extends HTMLController
$this->handleConfirmDelete($user, $author, $photo);
else
$this->handleViewPhoto($user, $author, $photo);
// Add an edit button to the admin bar.
if ($user->isAdmin())
$this->admin_bar->appendItem(BASEURL . '/editasset/?id=' . $photo->getId(), 'Edit this photo');
}
private function handleConfirmDelete(User $user, User $author, Asset $photo)

View File

@ -250,7 +250,8 @@ class PhotoPage extends Template
echo '
<div id="user_actions_box" class="content-box">
<h3>Actions</h3>
<a class="btn btn-danger" href="', BASEURL, '/', $this->photo->getSlug(), '?confirm_delete">Delete</a>
<a class="btn btn-primary" href="', BASEURL, '/editasset/?id=', $this->photo->getId(), '?confirm_delete">Edit photo</a>
<a class="btn btn-danger" href="', BASEURL, '/', $this->photo->getSlug(), '?confirm_delete">Delete photo</a>
</div>';
}
}