merge image admin buttons into a single block

git-svn-id: file:///home/shish/svn/shimmie2/trunk@897 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
shish
2008-06-14 11:36:19 +00:00
parent fab31bcb53
commit 8f252df282
8 changed files with 40 additions and 20 deletions

View File

@@ -24,6 +24,21 @@ class ImageInfoSetEvent extends Event {
}
}
class ImageAdminBlockBuildingEvent extends Event {
var $parts = array();
var $image = null;
var $user = null;
public function ImageAdminBlockBuildingEvent($image, $user) {
$this->image = $image;
$this->user = $user;
}
public function add_part($html, $position=50) {
while(isset($this->parts[$position])) $position++;
$this->parts[$position] = $html;
}
}
class ViewImage extends Extension {
var $theme;
@@ -38,6 +53,10 @@ class ViewImage extends Extension {
if(!is_null($image)) {
send_event(new DisplayingImageEvent($image, $event->page));
$iabbe = new ImageAdminBlockBuildingEvent($image, $event->user);
send_event($iabbe);
ksort($iabbe->parts);
$this->theme->display_admin_block($event->page, $iabbe->parts);
}
else {
$this->theme->display_error($event->page, "Image not found", "No image in the database has the ID #$image_id");