diff --git a/contrib/admin_utils/main.php b/contrib/admin_utils/main.php
index 0bdaffc5..1d3d52c3 100644
--- a/contrib/admin_utils/main.php
+++ b/contrib/admin_utils/main.php
@@ -13,7 +13,7 @@ class AdminUtils extends Extension {
public function receive_event($event) {
if(is_null($this->theme)) $this->theme = get_theme_object("admin_utils", "AdminUtilsTheme");
- if(is_a($event, 'PageRequestEvent') && ($event->page == "admin_utils")) {
+ if(is_a($event, 'PageRequestEvent') && ($event->page_name == "admin_utils")) {
global $user;
if($user->is_admin()) {
set_time_limit(0);
@@ -30,9 +30,8 @@ class AdminUtils extends Extension {
break;
}
- global $page;
- $page->set_mode("redirect");
- $page->set_redirect(make_link("admin"));
+ $event->page->set_mode("redirect");
+ $event->page->set_redirect(make_link("admin"));
}
}
diff --git a/contrib/autocomplete/main.php b/contrib/autocomplete/main.php
index 9f41cc1e..0dc03490 100644
--- a/contrib/autocomplete/main.php
+++ b/contrib/autocomplete/main.php
@@ -9,15 +9,13 @@
class AutoComplete extends Extension {
public function receive_event($event) {
- if(is_a($event, 'PageRequestEvent') && ($event->page == "index" || $event->page == "view")) {
- global $page;
- $page->add_header("");
+ if(is_a($event, 'PageRequestEvent') && ($event->page_name == "index" || $event->page_name == "view")) {
+ $event->page->add_header("");
}
- if(is_a($event, 'PageRequestEvent') && ($event->page == "autocomplete")) {
- global $page;
- $page->set_mode("data");
- $page->set_type("text/plain");
- $page->set_data($this->get_completions($event->get_arg(0)));
+ if(is_a($event, 'PageRequestEvent') && ($event->page_name == "autocomplete")) {
+ $event->page->set_mode("data");
+ $event->page->set_type("text/plain");
+ $event->page->set_data($this->get_completions($event->get_arg(0)));
}
}
diff --git a/contrib/home/main.php b/contrib/home/main.php
index 3aca1443..5e5457a4 100644
--- a/contrib/home/main.php
+++ b/contrib/home/main.php
@@ -13,7 +13,7 @@ class Home extends Extension {
public function receive_event($event) {
global $page;
- if(is_a($event, 'PageRequestEvent') && ($event->page == "home"))
+ if(is_a($event, 'PageRequestEvent') && ($event->page_name == "home"))
{
// this is a request to display this page so output the page.
$this->output_pages();
diff --git a/contrib/link_image/main.php b/contrib/link_image/main.php
index c560ab6a..110ab19b 100644
--- a/contrib/link_image/main.php
+++ b/contrib/link_image/main.php
@@ -5,12 +5,11 @@ class LinkImage extends Extension {
public function receive_event($event) {
if(is_null($this->theme)) $this->theme = get_theme_object("link_image", "LinkImageTheme");
if(is_a($event, 'DisplayingImageEvent')) {
- global $page;
global $config;
- $data_href = $config->get_string("data_href");
- $page->add_header("",0);
+ $data_href = get_base_href();
+ $event->page->add_header("",0);
- $this->theme->links_block($page,$this->data($event->image));
+ $this->theme->links_block($event->page,$this->data($event->image));
}
if(is_a($event, 'SetupBuildingEvent')) {
$sb = new SetupBlock("Link to Image");
@@ -20,10 +19,8 @@ class LinkImage extends Extension {
if(is_a($event, 'InitExtEvent')) {
global $config;
//just set default if empty.
- if ($config->get_string("ext_link-img_text-link_format") == "") {
- $config->set_string("ext_link-img_text-link_format",
+ $config->set_default_string("ext_link-img_text-link_format",
'$title - $id ($ext $size $filesize)');
- }
}
}
private function data($image) {
diff --git a/contrib/notes/main.php b/contrib/notes/main.php
index f2372f2d..36129386 100644
--- a/contrib/notes/main.php
+++ b/contrib/notes/main.php
@@ -21,10 +21,9 @@ class Notes extends Extension {
}
if(is_a($event, 'DisplayingImageEvent')) {
- global $page;
global $database;
$notes = $database->db->GetAll("SELECT * FROM image_notes WHERE image_id = ?", array($event->image->id));
- $this->theme->display_notes($page, $notes);
+ $this->theme->display_notes($event->page, $notes);
}
}
diff --git a/contrib/rss_comments/main.php b/contrib/rss_comments/main.php
index f18de32c..4af26266 100644
--- a/contrib/rss_comments/main.php
+++ b/contrib/rss_comments/main.php
@@ -10,7 +10,7 @@
class RSS_Comments extends Extension {
// event handling {{{
public function receive_event($event) {
- if(is_a($event, 'PageRequestEvent') && ($event->page == "index")) {
+ if(is_a($event, 'PageRequestEvent') && ($event->page_name == "index")) {
global $page;
global $config;
$title = $config->get_string('title');
@@ -18,7 +18,7 @@ class RSS_Comments extends Extension {
$page->add_header("");
}
- if(is_a($event, 'PageRequestEvent') && ($event->page == "rss")) {
+ if(is_a($event, 'PageRequestEvent') && ($event->page_name == "rss")) {
if($event->get_arg(0) == 'comments') {
global $database;
$this->do_rss($database);
diff --git a/contrib/site_description/main.php b/contrib/site_description/main.php
index 257fe67d..3753d2ef 100644
--- a/contrib/site_description/main.php
+++ b/contrib/site_description/main.php
@@ -12,10 +12,10 @@
class SiteDescription extends Extension {
public function receive_event($event) {
if(is_a($event, 'PageRequestEvent')) {
- global $page, $config;
+ global $config;
if(strlen($config->get_string("site_description")) > 0) {
$description = $config->get_string("site_description");
- $page->add_header("");
+ $event->page->add_header("");
}
}
if(is_a($event, 'SetupBuildingEvent')) {
diff --git a/contrib/tag_history/main.php b/contrib/tag_history/main.php
index 206ab13d..45585233 100644
--- a/contrib/tag_history/main.php
+++ b/contrib/tag_history/main.php
@@ -10,7 +10,7 @@ class Tag_History extends Extension {
}
}
- if(is_a($event, 'PageRequestEvent') && ($event->page == "tag_history"))
+ if(is_a($event, 'PageRequestEvent') && ($event->page_name == "tag_history"))
{
if($event->get_arg(0) == "revert")
{
diff --git a/contrib/wiki/main.php b/contrib/wiki/main.php
index 19aea167..7137549f 100644
--- a/contrib/wiki/main.php
+++ b/contrib/wiki/main.php
@@ -60,7 +60,7 @@ class Wiki extends Extension {
$this->setup();
}
- if(is_a($event, 'PageRequestEvent') && ($event->page == "wiki")) {
+ if(is_a($event, 'PageRequestEvent') && ($event->page_name == "wiki")) {
global $page;
$page->add_block(new NavBlock());
diff --git a/core/events/pagerequest.event.php b/core/events/pagerequest.event.php
index 1a0c25ce..1295866d 100644
--- a/core/events/pagerequest.event.php
+++ b/core/events/pagerequest.event.php
@@ -12,14 +12,14 @@
* Used for initial page generation triggers
*/
class PageRequestEvent extends Event {
- var $page;
+ var $page_name;
var $args;
- var $page_object;
+ var $page;
- public function PageRequestEvent($page, $args, $page_object) {
- $this->page = $page;
+ public function PageRequestEvent($page_name, $args, $page) {
+ $this->page_name = $page_name;
$this->args = $args;
- $this->page_object = $page_object;
+ $this->page = $page;
}
public function get_arg($n) {
diff --git a/core/util.inc.php b/core/util.inc.php
index b0eb4775..98d87002 100644
--- a/core/util.inc.php
+++ b/core/util.inc.php
@@ -363,24 +363,24 @@ function _get_query_parts() {
return split('/', $path);
}
-function _get_page_request($page_object) {
+function _get_page_request($page) {
global $config;
$args = _get_query_parts();
if(count($args) == 0 || strlen($args[0]) == 0) {
- $page = $config->get_string('front_page', 'index');
+ $page_name = $config->get_string('front_page', 'index');
$args = array();
}
else if(count($args) == 1) {
- $page = $args[0];
+ $page_name = $args[0];
$args = array();
}
else {
- $page = $args[0];
+ $page_name = $args[0];
$args = array_slice($args, 1);
}
- return new PageRequestEvent($page, $args, $page_object);
+ return new PageRequestEvent($page_name, $args, $page);
}
function _get_user() {
diff --git a/ext/admin/main.php b/ext/admin/main.php
index dd1a99c7..635c037e 100644
--- a/ext/admin/main.php
+++ b/ext/admin/main.php
@@ -11,7 +11,7 @@ class AdminBuildingEvent extends Event {
class AdminPage extends Extension {
// event handler {{{
public function receive_event($event) {
- if(is_a($event, 'PageRequestEvent') && ($event->page == "admin")) {
+ if(is_a($event, 'PageRequestEvent') && ($event->page_name == "admin")) {
global $user;
if(!$user->is_admin()) {
global $page;
diff --git a/ext/alias_editor/main.php b/ext/alias_editor/main.php
index 5baa461f..fb30513a 100644
--- a/ext/alias_editor/main.php
+++ b/ext/alias_editor/main.php
@@ -16,12 +16,16 @@ class AliasEditor extends Extension {
public function receive_event($event) {
if(is_null($this->theme)) $this->theme = get_theme_object("alias_editor", "AliasEditorTheme");
- if(is_a($event, 'PageRequestEvent') && ($event->page == "alias")) {
+ if(is_a($event, 'PageRequestEvent') && ($event->page_name == "alias")) {
global $user;
if($event->get_arg(0) == "add") {
if($user->is_admin()) {
if(isset($_POST['oldtag']) && isset($_POST['newtag'])) {
send_event(new AddAliasEvent($_POST['oldtag'], $_POST['newtag']));
+
+ global $page;
+ $event->page->set_mode("redirect");
+ $event->page->set_redirect(make_link("alias/list"));
}
}
}
@@ -31,32 +35,25 @@ class AliasEditor extends Extension {
global $database;
$database->Execute("DELETE FROM aliases WHERE oldtag=?", array($_POST['oldtag']));
- global $page;
- $page->set_mode("redirect");
- $page->set_redirect(make_link("alias/list"));
+ $event->page->set_mode("redirect");
+ $event->page->set_redirect(make_link("alias/list"));
}
}
}
else if($event->get_arg(0) == "list") {
- global $page;
global $database;
- $this->theme->display_aliases($page, $database->db->GetAssoc("SELECT oldtag, newtag FROM aliases"), $user->is_admin());
+ $this->theme->display_aliases($event->page, $database->db->GetAssoc("SELECT oldtag, newtag FROM aliases"), $user->is_admin());
}
else if($event->get_arg(0) == "export") {
- global $page;
- $page->set_mode("data");
- $page->set_type("text/plain");
- $page->set_data($this->get_alias_csv());
+ $event->page->set_mode("data");
+ $event->page->set_type("text/plain");
+ $event->page->set_data($this->get_alias_csv());
}
}
if(is_a($event, 'AddAliasEvent')) {
global $database;
$database->Execute("INSERT INTO aliases(oldtag, newtag) VALUES(?, ?)", array($event->oldtag, $event->newtag));
-
- global $page;
- $page->set_mode("redirect");
- $page->set_redirect(make_link("alias/list"));
}
if(is_a($event, 'UserBlockBuildingEvent')) {
diff --git a/ext/bulk_add/main.php b/ext/bulk_add/main.php
index e5509f01..2bf9c086 100644
--- a/ext/bulk_add/main.php
+++ b/ext/bulk_add/main.php
@@ -6,13 +6,13 @@ class BulkAdd extends Extension {
public function receive_event($event) {
if(is_null($this->theme)) $this->theme = get_theme_object("bulk_add", "BulkAddTheme");
- if(is_a($event, 'PageRequestEvent') && ($event->page == "bulk_add")) {
+ if(is_a($event, 'PageRequestEvent') && ($event->page_name == "bulk_add")) {
global $user;
if($user->is_admin() && isset($_POST['dir'])) {
set_time_limit(0);
$this->add_dir($_POST['dir']);
- $this->theme->display_upload_results($event->page_object);
+ $this->theme->display_upload_results($event->page);
}
}
diff --git a/ext/comment/main.php b/ext/comment/main.php
index 8871b565..9c05c7c9 100644
--- a/ext/comment/main.php
+++ b/ext/comment/main.php
@@ -69,7 +69,7 @@ class CommentList extends Extension {
}
}
- if(is_a($event, 'PageRequestEvent') && ($event->page == "comment")) {
+ if(is_a($event, 'PageRequestEvent') && ($event->page_name == "comment")) {
if($event->get_arg(0) == "add") {
$this->add_comment_wrapper($_POST['image_id'], $_POST['comment']);
}
@@ -79,8 +79,8 @@ class CommentList extends Extension {
// FIXME: post, not args
if($event->count_args() == 3) {
send_event(new CommentDeletionEvent($event->get_arg(1)));
- $event->page_object->set_mode("redirect");
- $event->page_object->set_redirect(make_link("post/view/".$event->get_arg(2)));
+ $event->page->set_mode("redirect");
+ $event->page->set_redirect(make_link("post/view/".$event->get_arg(2)));
}
}
else {
@@ -91,11 +91,10 @@ class CommentList extends Extension {
$this->build_page($event->get_arg(1));
}
}
- if(is_a($event, 'PageRequestEvent') && ($event->page == "index")) {
- global $page;
+ if(is_a($event, 'PageRequestEvent') && ($event->page_name == "index")) {
global $config;
if($config->get_int("comment_count") > 0) {
- $page->add_block(new Block("Comments", $this->build_recent_comments(), "left"));
+ $event->page->add_block(new Block("Comments", $this->build_recent_comments(), "left"));
}
}
diff --git a/ext/downtime/main.php b/ext/downtime/main.php
index 1cd8cc8a..7f721b9a 100644
--- a/ext/downtime/main.php
+++ b/ext/downtime/main.php
@@ -17,7 +17,7 @@ class Downtime extends Extension {
if(is_a($event, 'PageRequestEvent')) {
global $config;
if($config->get_bool("downtime")) {
- $this->theme->display_notification($event->page_object);
+ $this->theme->display_notification($event->page);
}
}
}
@@ -34,7 +34,7 @@ class Downtime extends Extension {
}
private function is_safe_page($event) {
- if($event->page == "user" && $event->get_arg(0) == "login") return true;
+ if($event->page_name == "user" && $event->get_arg(0) == "login") return true;
else return false;
}
}
diff --git a/ext/et/main.php b/ext/et/main.php
index 4f3adf4d..982b211a 100644
--- a/ext/et/main.php
+++ b/ext/et/main.php
@@ -6,10 +6,10 @@ class ET extends Extension {
public function receive_event($event) {
if(is_null($this->theme)) $this->theme = get_theme_object("et", "ETTheme");
- if(is_a($event, 'PageRequestEvent') && ($event->page == "system_info")) {
+ if(is_a($event, 'PageRequestEvent') && ($event->page_name == "system_info")) {
global $user;
if($user->is_admin()) {
- $this->theme->display_info_page($event->page_object, $this->get_info());
+ $this->theme->display_info_page($event->page, $this->get_info());
}
}
diff --git a/ext/handle_404/main.php b/ext/handle_404/main.php
index eeecc264..4c3b8abf 100644
--- a/ext/handle_404/main.php
+++ b/ext/handle_404/main.php
@@ -3,7 +3,7 @@
class Handle404 extends Extension {
public function receive_event($event) {
if(is_a($event, 'PageRequestEvent')) {
- $page = $event->page_object;
+ $page = $event->page;
// hax.
if($page->mode == "page" && (!isset($page->blocks) || $this->count_main($page->blocks) == 0)) {
$h_pagename = html_escape($event->page);
diff --git a/ext/image/main.php b/ext/image/main.php
index f4066cd6..d2eea187 100644
--- a/ext/image/main.php
+++ b/ext/image/main.php
@@ -20,10 +20,10 @@ class ImageIO extends Extension {
if(!is_null($num) && preg_match("/(\d+)/", $num, $matches)) {
$num = $matches[1];
- if($event->page == "image") {
+ if($event->page_name == "image") {
$this->send_file($num, "image");
}
- else if($event->page == "thumb") {
+ else if($event->page_name == "thumb") {
$this->send_file($num, "thumb");
}
}
diff --git a/ext/index/main.php b/ext/index/main.php
index 947ac310..1617631e 100644
--- a/ext/index/main.php
+++ b/ext/index/main.php
@@ -13,9 +13,9 @@ class Index extends Extension {
$config->set_default_bool("index_tips", true);
}
- if(is_a($event, 'PageRequestEvent') && (($event->page == "index") ||
- ($event->page == "post" && $event->get_arg(0) == "list"))) {
- if($event->page == "post") array_shift($event->args);
+ if(is_a($event, 'PageRequestEvent') && (($event->page_name == "index") ||
+ ($event->page_name == "post" && $event->get_arg(0) == "list"))) {
+ if($event->page_name == "post") array_shift($event->args);
$search_terms = array();
$page_number = 1;
@@ -42,7 +42,7 @@ class Index extends Extension {
$images = $database->get_images(($page_number-1)*$count, $count, $search_terms);
$this->theme->set_page($page_number, $total_pages, $search_terms);
- $this->theme->display_page($event->page_object, $images);
+ $this->theme->display_page($event->page, $images);
}
if(is_a($event, 'SetupBuildingEvent')) {
diff --git a/ext/ipban/main.php b/ext/ipban/main.php
index 08f8a8da..5742bfc8 100644
--- a/ext/ipban/main.php
+++ b/ext/ipban/main.php
@@ -38,7 +38,7 @@ class IPBan extends Extension {
$this->check_ip_ban();
- if(is_a($event, 'PageRequestEvent') && ($event->page == "ip_ban")) {
+ if(is_a($event, 'PageRequestEvent') && ($event->page_name == "ip_ban")) {
global $user;
if($user->is_admin()) {
if($event->get_arg(0) == "add") {
diff --git a/ext/news/main.php b/ext/news/main.php
index a45e03fd..24d4ef86 100644
--- a/ext/news/main.php
+++ b/ext/news/main.php
@@ -6,10 +6,10 @@ class News extends Extension {
public function receive_event($event) {
if(is_null($this->theme)) $this->theme = get_theme_object("news", "NewsTheme");
- if(is_a($event, 'PageRequestEvent') && ($event->page == "index")) {
+ if(is_a($event, 'PageRequestEvent') && ($event->page_name == "index")) {
global $config;
if(strlen($config->get_string("news_text")) > 0) {
- $this->theme->display_news($event->page_object, $config->get_string("news_text"));
+ $this->theme->display_news($event->page, $config->get_string("news_text"));
}
}
if(is_a($event, 'SetupBuildingEvent')) {
diff --git a/ext/regen_thumb/main.php b/ext/regen_thumb/main.php
index 8f48ca47..0379ca96 100644
--- a/ext/regen_thumb/main.php
+++ b/ext/regen_thumb/main.php
@@ -6,7 +6,7 @@ class RegenThumb extends Extension {
public function receive_event($event) {
if(is_null($this->theme)) $this->theme = get_theme_object("regen_thumb", "RegenThumbTheme");
- if(is_a($event, 'PageRequestEvent') && ($event->page == "regen_thumb")) {
+ if(is_a($event, 'PageRequestEvent') && ($event->page_name == "regen_thumb")) {
global $user;
if($user->is_admin() && isset($_POST['program']) && isset($_POST['image_id'])) {
$this->make_thumb($_POST['program'], $_POST['image_id']);
diff --git a/ext/rss_images/main.php b/ext/rss_images/main.php
index dc1e0983..a38a3496 100644
--- a/ext/rss_images/main.php
+++ b/ext/rss_images/main.php
@@ -3,7 +3,7 @@
class RSS_Images extends Extension {
// event handling {{{
public function receive_event($event) {
- if(is_a($event, 'PageRequestEvent') && ($event->page == "index")) {
+ if(is_a($event, 'PageRequestEvent') && ($event->page_name == "index")) {
global $page;
global $config;
$title = $config->get_string('title');
@@ -11,7 +11,7 @@ class RSS_Images extends Extension {
$page->add_header("");
}
- if(is_a($event, 'PageRequestEvent') && ($event->page == "rss")) {
+ if(is_a($event, 'PageRequestEvent') && ($event->page_name == "rss")) {
if($event->get_arg(0) == 'images') {
global $database;
$this->do_rss($database->get_images(0, 12));
diff --git a/ext/setup/main.php b/ext/setup/main.php
index e21d774b..80a3788b 100644
--- a/ext/setup/main.php
+++ b/ext/setup/main.php
@@ -125,7 +125,7 @@ class SetupBlock extends Block {
class Setup extends Extension {
// event handling {{{
public function receive_event($event) {
- if(is_a($event, 'PageRequestEvent') && ($event->page == "setup")) {
+ if(is_a($event, 'PageRequestEvent') && ($event->page_name == "setup")) {
global $user;
if(!$user->is_admin()) {
global $page;
diff --git a/ext/tag_edit/main.php b/ext/tag_edit/main.php
index 77e3cff8..9ef19496 100644
--- a/ext/tag_edit/main.php
+++ b/ext/tag_edit/main.php
@@ -3,7 +3,7 @@
class TagEdit extends Extension {
// event handling {{{
public function receive_event($event) {
- if(is_a($event, 'PageRequestEvent') && ($event->page == "tag_edit")) {
+ if(is_a($event, 'PageRequestEvent') && ($event->page_name == "tag_edit")) {
global $page;
if($event->get_arg(0) == "set") {
if($this->can_tag()) {
diff --git a/ext/tag_list/main.php b/ext/tag_list/main.php
index dd371b6a..78d8e1de 100644
--- a/ext/tag_list/main.php
+++ b/ext/tag_list/main.php
@@ -14,7 +14,7 @@ class TagList extends Extension {
$config->set_default_string("info_link", 'http://en.wikipedia.org/wiki/$tag');
}
- if(is_a($event, 'PageRequestEvent') && ($event->page == "tags")) {
+ if(is_a($event, 'PageRequestEvent') && ($event->page_name == "tags")) {
global $page;
$this->theme->set_navigation($this->build_navigation());
@@ -35,7 +35,7 @@ class TagList extends Extension {
}
$this->theme->display_page($page);
}
- if(is_a($event, 'PageRequestEvent') && ($event->page == "index")) {
+ if(is_a($event, 'PageRequestEvent') && ($event->page_name == "index")) {
global $config;
global $page;
if($config->get_int('tag_list_length') > 0) {
diff --git a/ext/upload/main.php b/ext/upload/main.php
index 1918327b..1493dead 100644
--- a/ext/upload/main.php
+++ b/ext/upload/main.php
@@ -13,12 +13,12 @@ class Upload extends Extension {
$config->set_default_bool('upload_anon', false);
}
- if(is_a($event, 'PageRequestEvent') && ($event->page == "index")) {
+ if(is_a($event, 'PageRequestEvent') && ($event->page_name == "index")) {
if($this->can_upload()) {
- $this->theme->display_block($event->page_object);
+ $this->theme->display_block($event->page);
}
}
- if(is_a($event, 'PageRequestEvent') && ($event->page == "upload")) {
+ if(is_a($event, 'PageRequestEvent') && ($event->page_name == "upload")) {
if($this->can_upload()) {
global $page;
@@ -27,10 +27,10 @@ class Upload extends Extension {
$ok = $ok & $this->try_upload($file);
}
- $this->theme->display_upload_status($event->page_object, $ok);
+ $this->theme->display_upload_status($event->page, $ok);
}
else {
- $this->theme->display_error($event->page_object, "Upload Denied", "Anonymous posting is disabled");
+ $this->theme->display_error($event->page, "Upload Denied", "Anonymous posting is disabled");
}
}
diff --git a/ext/user/main.php b/ext/user/main.php
index 8428175f..ed7f1093 100644
--- a/ext/user/main.php
+++ b/ext/user/main.php
@@ -37,7 +37,7 @@ class UserPage extends Extension {
$config->set_default_int("login_memory", 365);
}
- if(is_a($event, 'PageRequestEvent') && ($event->page == "user")) {
+ if(is_a($event, 'PageRequestEvent') && ($event->page_name == "user")) {
global $page;
global $user;
global $database;
@@ -81,7 +81,7 @@ class UserPage extends Extension {
global $page;
if($user->is_anonymous()) {
- $this->theme->display_login_block($event->page_object);
+ $this->theme->display_login_block($event->page);
}
else {
$page->add_block(new Block("User Links", $this->build_links_block(), "left", 90));
diff --git a/ext/view/main.php b/ext/view/main.php
index ad5bc9ff..db5c7136 100644
--- a/ext/view/main.php
+++ b/ext/view/main.php
@@ -6,17 +6,17 @@ class ViewImage extends Extension {
public function receive_event($event) {
if(is_null($this->theme)) $this->theme = get_theme_object("view", "ViewTheme");
- if(is_a($event, 'PageRequestEvent') && ($event->page == "post") && ($event->get_arg(0) == "view")) {
+ if(is_a($event, 'PageRequestEvent') && ($event->page_name == "post") && ($event->get_arg(0) == "view")) {
$image_id = int_escape($event->get_arg(1));
global $database;
$image = $database->get_image($image_id);
if(!is_null($image)) {
- send_event(new DisplayingImageEvent($image, $event->page_object));
+ send_event(new DisplayingImageEvent($image, $event->page));
}
else {
- $this->theme->display_image_not_found($event->page_object, $image_id);
+ $this->theme->display_image_not_found($event->page, $image_id);
}
}