diff --git a/ext/comment/main.php b/ext/comment/main.php index 7ced2b29..af6733a5 100644 --- a/ext/comment/main.php +++ b/ext/comment/main.php @@ -61,7 +61,7 @@ class Comment { } class CommentList extends SimpleExtension { - public function onInitExt($event) { + public function onInitExt(InitExtEvent $event) { global $config, $database; $config->set_default_bool('comment_anon', true); $config->set_default_int('comment_window', 5); diff --git a/ext/image/main.php b/ext/image/main.php index 210e81d8..0fde1e24 100644 --- a/ext/image/main.php +++ b/ext/image/main.php @@ -130,7 +130,7 @@ class ParseLinkTemplateEvent extends Event { * A class to handle adding / getting / removing image files from the disk. */ class ImageIO extends SimpleExtension { - public function onInitExt($event) { + public function onInitExt(InitExtEvent $event) { global $config; $config->set_default_int('thumb_width', 192); $config->set_default_int('thumb_height', 192); @@ -147,7 +147,7 @@ class ImageIO extends SimpleExtension { $config->set_default_int('image_expires', (60*60*24*365) ); // defaults to one year } - public function onPageRequest($event) { + public function onPageRequest(PageRequestEvent $event) { $num = $event->get_arg(0); $matches = array(); if(!is_null($num) && preg_match("/(\d+)/", $num, $matches)) { @@ -186,7 +186,7 @@ class ImageIO extends SimpleExtension { } } - public function onImageAdminBlockBuilding($event) { + public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event) { global $user; global $config; @@ -199,7 +199,7 @@ class ImageIO extends SimpleExtension { } } - public function onImageAddition($event) { + public function onImageAddition(ImageAdditionEvent $event) { try { $this->add_image($event->image); } @@ -208,11 +208,11 @@ class ImageIO extends SimpleExtension { } } - public function onImageDeletion($event) { + public function onImageDeletion(ImageDeletionEvent $event) { $event->image->delete(); } - public function onImageReplace($event) { + public function onImageReplace(ImageReplaceEvent $event) { try { $this->replace_image($event->id, $event->image); } @@ -221,7 +221,7 @@ class ImageIO extends SimpleExtension { } } - public function onUserPageBuilding($event) { + public function onUserPageBuilding(UserPageBuildingEvent $event) { global $user; global $config; @@ -233,7 +233,7 @@ class ImageIO extends SimpleExtension { $event->add_stats("Images uploaded: $i_image_count, $h_image_rate per day"); } - public function onSetupBuilding($event) { + public function onSetupBuilding(SetupBuildingEvent $event) { $sb = new SetupBlock("Image Options"); $sb->position = 30; // advanced only diff --git a/ext/index/main.php b/ext/index/main.php index 5e2dc5cd..14a0ac5c 100644 --- a/ext/index/main.php +++ b/ext/index/main.php @@ -129,14 +129,14 @@ class PostListBuildingEvent extends Event { } class Index extends SimpleExtension { - public function onInitExt($event) { + public function onInitExt(InitExtEvent $event) { global $config; $config->set_default_int("index_width", 3); $config->set_default_int("index_height", 4); $config->set_default_bool("index_tips", true); } - public function onPageRequest($event) { + public function onPageRequest(PageRequestEvent $event) { global $config, $database, $page, $user; if($event->page_matches("post/list")) { if(isset($_GET['search'])) { @@ -182,7 +182,7 @@ class Index extends SimpleExtension { } } - public function onSetupBuilding($event) { + public function onSetupBuilding(SetupBuildingEvent $event) { $sb = new SetupBlock("Index Options"); $sb->position = 20; @@ -195,7 +195,7 @@ class Index extends SimpleExtension { $event->panel->add_block($sb); } - public function onSearchTermParse($event) { + public function onSearchTermParse(SearchTermParseEvent $event) { $matches = array(); // check for tags first as tag based searches are more common. if(preg_match("/tags(<|>|<=|>=|=)(\d+)/", $event->term, $matches)) { diff --git a/ext/mail/main.php b/ext/mail/main.php index 1a02c3a8..9bf09169 100644 --- a/ext/mail/main.php +++ b/ext/mail/main.php @@ -8,7 +8,7 @@ */ class Mail extends SimpleExtension { - public function onSetupBuilding($event) { + public function onSetupBuilding(SetupBuildingEvent $event) { $sb = new SetupBlock("Mailing Options"); $sb->add_text_option("mail_sub", "
Subject prefix: "); $sb->add_text_option("mail_img", "
Banner Image URL: "); @@ -18,7 +18,7 @@ class Mail extends SimpleExtension { $event->panel->add_block($sb); } - public function onInitExt($event) { + public function onInitExt(InitExtEvent $event) { global $config; $config->set_default_string("mail_sub", $config->get_string("site_title")." - "); $config->set_default_string("mail_img", make_http("ext/mail/banner.png")); @@ -27,7 +27,7 @@ class Mail extends SimpleExtension { } } class MailTest extends SimpleExtension { - public function onPageRequest($event) { + public function onPageRequest(PageRequestEvent $event) { if($event->page_matches("mail/test")) { global $page; $page->set_mode("data"); @@ -42,4 +42,4 @@ class MailTest extends SimpleExtension { } } } -?> \ No newline at end of file +?> diff --git a/ext/setup/main.php b/ext/setup/main.php index c2f47f73..28b5820c 100644 --- a/ext/setup/main.php +++ b/ext/setup/main.php @@ -162,7 +162,7 @@ class SetupBlock extends Block { // }}} class Setup extends SimpleExtension { - public function onInitExt($event) { + public function onInitExt(SetupEvent $event) { global $config; $config->set_default_string("title", "Shimmie"); $config->set_default_string("front_page", "post/list"); @@ -178,7 +178,7 @@ class Setup extends SimpleExtension { $config->set_default_bool("autocache_min_js", false); } - public function onPageRequest($event) { + public function onPageRequest(PageRequestEvent $event) { global $config, $page, $user; if($event->page_matches("nicetest")) { @@ -210,7 +210,7 @@ class Setup extends SimpleExtension { } } - public function onSetupBuilding($event) { + public function onSetupBuilding(SetupBuildingEvent $event) { $themes = array(); foreach(glob("themes/*") as $theme_dirname) { $name = str_replace("themes/", "", $theme_dirname); @@ -309,7 +309,7 @@ class Setup extends SimpleExtension { $event->panel->add_block($sb); } - public function onConfigSave($event) { + public function onConfigSave(ConfigSaveEvent $event) { global $config; foreach($_POST as $_name => $junk) { if(substr($_name, 0, 6) == "_type_") { @@ -327,7 +327,7 @@ class Setup extends SimpleExtension { log_warning("setup", "Configuration updated"); } - public function onUserBlockBuilding($event) { + public function onUserBlockBuilding(UserBlockBuildingEvent $event) { global $user; if($user->is_admin()) { $event->add_link("Board Config", make_link("setup")); diff --git a/ext/tag_edit/main.php b/ext/tag_edit/main.php index a01ca8e6..dec123f0 100644 --- a/ext/tag_edit/main.php +++ b/ext/tag_edit/main.php @@ -56,7 +56,7 @@ class LockSetEvent extends Event { } class TagEdit extends SimpleExtension { - public function onPageRequest($event) { + public function onPageRequest(PageRequestEvent $event) { global $user, $page; if($event->page_matches("tag_edit")) { if($event->get_arg(0) == "replace") { @@ -71,7 +71,7 @@ class TagEdit extends SimpleExtension { } } - public function onImageInfoSet($event) { + public function onImageInfoSet(ImageInfoSetEvent $event) { global $user, $page; if($this->can_tag($event->image)) { send_event(new TagSetEvent($event->image, $_POST['tag_edit__tags'])); @@ -88,41 +88,41 @@ class TagEdit extends SimpleExtension { } } - public function onTagSet($event) { + public function onTagSet(TagSetEvent $event) { global $user; if($user->is_admin() || !$event->image->is_locked()) { $event->image->set_tags($event->tags); } } - public function onSourceSet($event) { + public function onSourceSet(SourceSetEvent $event) { global $user; if($user->is_admin() || !$event->image->is_locked()) { $event->image->set_source($event->source); } } - public function onLockSet($event) { + public function onLockSet(LockSetEvent $event) { global $user; if($user->is_admin()) { $event->image->set_locked($event->locked); } } - public function onImageDeletion($event) { + public function onImageDeletion(ImageDeletionEvent $event) { $event->image->delete_tags_from_image(); } - public function onAdminBuilding($event) { + public function onAdminBuilding(AdminBuildingEvent $event) { $this->theme->display_mass_editor(); } // When an alias is added, oldtag becomes inaccessable - public function onAddAlias($event) { + public function onAddAlias(AddAliasEvent $event) { $this->mass_tag_edit($event->oldtag, $event->newtag); } - public function onImageInfoBoxBuilding($event) { + public function onImageInfoBoxBuilding(ImageInfoBoxBuildingEvent $event) { global $user; if($this->can_tag($event->image)) { $event->add_part($this->theme->get_tag_editor_html($event->image), 40); @@ -135,7 +135,7 @@ class TagEdit extends SimpleExtension { } } - public function onSetupBuilding($event) { + public function onSetupBuilding(SetupBuildingEvent $event) { $sb = new SetupBlock("Tag Editing"); $sb->add_bool_option("tag_edit_anon", "Allow anonymous tag editing: "); $sb->add_bool_option("source_edit_anon", "
Allow anonymous source editing: "); diff --git a/ext/tag_list/main.php b/ext/tag_list/main.php index 6edab5e8..01437155 100644 --- a/ext/tag_list/main.php +++ b/ext/tag_list/main.php @@ -6,7 +6,7 @@ */ class TagList extends SimpleExtension { - public function onInitExt($event) { + public function onInitExt(InitExtEvent $event) { global $config; $config->set_default_int("tag_list_length", 15); $config->set_default_int("popular_tag_list_length", 15); @@ -16,7 +16,7 @@ class TagList extends SimpleExtension { $config->set_default_bool("tag_list_pages", false); } - public function onPageRequest($event) { + public function onPageRequest(PageRequestEvent $event) { global $page, $database; if($event->page_matches("tags")) { @@ -59,7 +59,7 @@ class TagList extends SimpleExtension { } } - public function onPostListBuilding($event) { + public function onPostListBuilding(PostListBuildingEvent $event) { global $config, $page; if($config->get_int('tag_list_length') > 0) { if(!empty($event->search_terms)) { @@ -71,7 +71,7 @@ class TagList extends SimpleExtension { } } - public function onDisplayingImage($event) { + public function onDisplayingImage(DisplayingImageEvent $event) { global $config, $page; if($config->get_int('tag_list_length') > 0) { if($config->get_string('tag_list_image_type') == 'related') { @@ -83,7 +83,7 @@ class TagList extends SimpleExtension { } } - public function onSetupBuilding($event) { + public function onSetupBuilding(SetupBuildingEvent $event) { $sb = new SetupBlock("Tag Map Options"); $sb->add_int_option("tags_min", "Only show tags used at least "); $sb->add_label(" times"); $sb->add_bool_option("tag_list_pages", "
Paged tag lists: "); diff --git a/ext/upload/main.php b/ext/upload/main.php index 8090a08e..b1161bb6 100644 --- a/ext/upload/main.php +++ b/ext/upload/main.php @@ -45,7 +45,7 @@ class Upload extends SimpleExtension { // early, so it can stop the DataUploadEvent before any data handlers see it public function get_priority() {return 40;} - public function onInitExt($event) { + public function onInitExt(InitExtEvent $event) { global $config; $config->set_default_int('upload_count', 3); $config->set_default_int('upload_size', '1MB'); @@ -63,7 +63,7 @@ class Upload extends SimpleExtension { } - public function onPostListBuilding($event) { + public function onPostListBuilding(PostListBuildingEvent $event) { global $user, $page; if($this->can_upload($user)) { if($this->is_full) { @@ -75,7 +75,7 @@ class Upload extends SimpleExtension { } } - public function onSetupBuilding($event) { + public function onSetupBuilding(SetupBuildingEvent $event) { $tes = array(); $tes["Disabled"] = "none"; if(function_exists("curl_init")) { @@ -97,7 +97,7 @@ class Upload extends SimpleExtension { $event->panel->add_block($sb); } - public function onDataUpload($event) { + public function onDataUpload(DataUploadEvent $event) { global $config; if($this->is_full) { throw new UploadException("Upload failed; disk nearly full"); diff --git a/ext/user/main.php b/ext/user/main.php index 87fd0b47..daa04daf 100644 --- a/ext/user/main.php +++ b/ext/user/main.php @@ -43,7 +43,7 @@ class UserCreationEvent extends Event { class UserCreationException extends SCoreException {} class UserPage extends SimpleExtension { - public function onInitExt(Event $event) { + public function onInitExt(InitExtEvent $event) { global $config; $config->set_default_bool("login_signup_enabled", true); $config->set_default_int("login_memory", 365); @@ -54,7 +54,7 @@ class UserPage extends SimpleExtension { $config->set_default_bool("login_tac_bbcode", true); } - public function onPageRequest(Event $event) { + public function onPageRequest(PageRequestEvent $event) { global $config, $database, $page, $user; // user info is shown on all pages @@ -152,7 +152,7 @@ class UserPage extends SimpleExtension { } } - if(($event instanceof PageRequestEvent) && $event->page_matches("user")) { + if($event->page_matches("user")) { $display_user = ($event->count_args() == 0) ? $user : User::by_name($event->get_arg(0)); if($event->count_args() == 0 && $user->is_anonymous()) { $this->theme->display_error($page, "Not Logged In", @@ -169,7 +169,7 @@ class UserPage extends SimpleExtension { } } - public function onUserPageBuilding(Event $event) { + public function onUserPageBuilding(UserPageBuildingEvent $event) { global $page, $user, $config; $h_join_date = autodate($event->display_user->join_date); @@ -197,7 +197,7 @@ class UserPage extends SimpleExtension { } } - public function onSetupBuilding(Event $event) { + public function onSetupBuilding(SetupBuildingEvent $event) { global $config; $hosts = array( @@ -228,17 +228,17 @@ class UserPage extends SimpleExtension { $event->panel->add_block($sb); } - public function onUserBlockBuilding(Event $event) { + public function onUserBlockBuilding(UserBlockBuildingEvent $event) { $event->add_link("My Profile", make_link("user")); $event->add_link("Log Out", make_link("user_admin/logout"), 99); } - public function onUserCreation(Event $event) { + public function onUserCreation(UserCreationEvent $event) { $this->check_user_creation($event); $this->create_user($event); } - public function onSearchTermParse(Event $event) { + public function onSearchTermParse(SearchTermParseEvent $event) { global $user; $matches = array();