forked from Cavemanon/cavepaintings
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:
@ -49,10 +49,9 @@ class Featured extends Extension {
|
||||
}
|
||||
*/
|
||||
|
||||
if(is_a($event, 'DisplayingImageEvent')) {
|
||||
global $user;
|
||||
if($user->is_admin()) {
|
||||
$this->theme->display_buttons($event->page, $event->image->id);
|
||||
if(is_a($event, 'ImageAdminBlockBuildingEvent')) {
|
||||
if($event->user->is_admin()) {
|
||||
$event->add_part($this->theme->get_buttons_html($event->image->id));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8,14 +8,13 @@ class FeaturedTheme extends Themelet {
|
||||
$page->add_block(new Block("Featured Image", $this->build_thumb_html($image), "left", 3));
|
||||
}
|
||||
|
||||
public function display_buttons($page, $image_id) {
|
||||
$html = "
|
||||
public function get_buttons_html($image_id) {
|
||||
return "
|
||||
<form action='".make_link("set_feature")."' method='POST'>
|
||||
<input type='hidden' name='image_id' value='$image_id'>
|
||||
<input type='submit' value='Featue This'>
|
||||
</form>
|
||||
";
|
||||
$page->add_block(new Block("Featured Image", $html, "left"));
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -22,10 +22,9 @@ class RegenThumb extends Extension {
|
||||
}
|
||||
}
|
||||
|
||||
if(is_a($event, 'DisplayingImageEvent')) {
|
||||
global $user;
|
||||
if($user->is_admin()) {
|
||||
$this->theme->display_buttons($event->page, $event->image->id);
|
||||
if(is_a($event, 'ImageAdminBlockBuildingEvent')) {
|
||||
if($event->user->is_admin()) {
|
||||
$event->add_part($this->theme->get_buttons_html($event->image->id));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,14 +4,13 @@ class RegenThumbTheme extends Themelet {
|
||||
/*
|
||||
* Show a form which offers to regenerate the thumb of an image with ID #$image_id
|
||||
*/
|
||||
public function display_buttons($page, $image_id) {
|
||||
$html = "
|
||||
public function get_buttons_html($image_id) {
|
||||
return "
|
||||
<form action='".make_link("regen_thumb")."' method='POST'>
|
||||
<input type='hidden' name='image_id' value='$image_id'>
|
||||
<input type='submit' value='Regenerate'>
|
||||
</form>
|
||||
";
|
||||
$page->add_block(new Block("Regen Thumb", $html, "left"));
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user