remove some globals

git-svn-id: file:///home/shish/svn/shimmie2/trunk@255 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
shish 2007-07-10 21:16:49 +00:00
parent 0b46cc98d8
commit 6e93425fe5
7 changed files with 8 additions and 14 deletions

View file

@ -43,8 +43,7 @@ class AdminPage extends Extension {
if(is_a($event, 'DisplayingImageEvent')) { if(is_a($event, 'DisplayingImageEvent')) {
global $user; global $user;
if($user->is_admin()) { if($user->is_admin()) {
global $page; $event->page->add_block(new Block("Admin", $this->build_del_block($event->image->id), "left"));
$page->add_block(new Block("Admin", $this->build_del_block($event->image->id), "left"));
} }
} }

View file

@ -95,14 +95,13 @@ class CommentList extends Extension {
} }
if(is_a($event, 'DisplayingImageEvent')) { if(is_a($event, 'DisplayingImageEvent')) {
global $page;
if($this->can_comment()) { if($this->can_comment()) {
$page->add_block(new Block("Comments", $event->page->add_block(new Block("Comments",
$this->build_image_comments($event->image->id). $this->build_image_comments($event->image->id).
$this->theme->build_postbox($event->image->id), "main", 30)); $this->theme->build_postbox($event->image->id), "main", 30));
} }
else { else {
$page->add_block(new Block("Comments", $event->page->add_block(new Block("Comments",
$this->build_image_comments($event->image->id), "main", 30)); $this->build_image_comments($event->image->id), "main", 30));
} }
} }

View file

@ -14,10 +14,9 @@ class RegenThumb extends Extension {
} }
if(is_a($event, 'DisplayingImageEvent')) { if(is_a($event, 'DisplayingImageEvent')) {
global $page;
global $user; global $user;
if($user->is_admin()) { if($user->is_admin()) {
$this->theme->display_buttons($page, $event->image->id); $this->theme->display_buttons($event->page, $event->image->id);
} }
} }
} }

View file

@ -33,8 +33,7 @@ class TagEdit extends Extension {
} }
if(is_a($event, 'DisplayingImageEvent')) { if(is_a($event, 'DisplayingImageEvent')) {
global $page; $event->page->add_block(new Block(null, $this->build_tag_editor($event->image), "main", 5));
$page->add_block(new Block(null, $this->build_tag_editor($event->image), "main", 5));
} }
if(is_a($event, 'TagSetEvent')) { if(is_a($event, 'TagSetEvent')) {

View file

@ -42,10 +42,9 @@ class TagList extends Extension {
} }
if(is_a($event, 'DisplayingImageEvent')) { if(is_a($event, 'DisplayingImageEvent')) {
global $page;
global $config; global $config;
if($config->get_int('tag_list_length') > 0) { if($config->get_int('tag_list_length') > 0) {
$this->add_related_block($page, $event->image); $this->add_related_block($event->page, $event->image);
} }
} }

View file

@ -25,7 +25,7 @@ class ViewImage extends Extension {
if(is_a($event, 'DisplayingImageEvent')) { if(is_a($event, 'DisplayingImageEvent')) {
$image = $event->get_image(); $image = $event->get_image();
global $page; $page = $event->page;
$page->set_title("Image {$image->id}: ".html_escape($image->get_tag_list())); $page->set_title("Image {$image->id}: ".html_escape($image->get_tag_list()));
$page->set_heading(html_escape($image->get_tag_list())); $page->set_heading(html_escape($image->get_tag_list()));
$page->add_block(new Block("Navigation", $this->build_navigation($image->id), "left", 0)); $page->add_block(new Block("Navigation", $this->build_navigation($image->id), "left", 0));

View file

@ -7,9 +7,8 @@ class Zoom extends Extension {
if($this->theme == null) $this->theme = get_theme_object("zoom", "ZoomTheme"); if($this->theme == null) $this->theme = get_theme_object("zoom", "ZoomTheme");
if(is_a($event, 'DisplayingImageEvent')) { if(is_a($event, 'DisplayingImageEvent')) {
global $page;
global $config; global $config;
$this->theme->display_zoomer($page, $config->get_bool("image_zoom", false)); $this->theme->display_zoomer($event->page, $config->get_bool("image_zoom", false));
} }
if(is_a($event, 'SetupBuildingEvent')) { if(is_a($event, 'SetupBuildingEvent')) {