forked from Cavemanon/cavepaintings
remove regular Extension, have SimpleExtension take its place, optimise the event system based on SimpleExtension methods
This commit is contained in:
@@ -22,7 +22,7 @@ class AddAliasEvent extends Event {
|
||||
|
||||
class AddAliasException extends SCoreException {}
|
||||
|
||||
class AliasEditor extends SimpleExtension {
|
||||
class AliasEditor extends Extension {
|
||||
public function onPageRequest(PageRequestEvent $event) {
|
||||
global $config, $database, $page, $user;
|
||||
|
||||
|
@@ -60,7 +60,7 @@ class Comment {
|
||||
}
|
||||
}
|
||||
|
||||
class CommentList extends SimpleExtension {
|
||||
class CommentList extends Extension {
|
||||
public function onInitExt(InitExtEvent $event) {
|
||||
global $config, $database;
|
||||
$config->set_default_bool('comment_anon', true);
|
||||
|
@@ -87,7 +87,7 @@ class ExtensionInfo {
|
||||
}
|
||||
}
|
||||
|
||||
class ExtManager extends SimpleExtension {
|
||||
class ExtManager extends Extension {
|
||||
public function onPageRequest(PageRequestEvent $event) {
|
||||
global $page, $user;
|
||||
if($event->page_matches("ext_manager")) {
|
||||
|
@@ -8,7 +8,7 @@
|
||||
* Description: Shows an error message when the user views a page with no content
|
||||
*/
|
||||
|
||||
class Handle404 extends SimpleExtension {
|
||||
class Handle404 extends Extension {
|
||||
public function onPageRequest(PageRequestEvent $event) {
|
||||
global $page;
|
||||
// hax.
|
||||
|
@@ -129,7 +129,7 @@ class ParseLinkTemplateEvent extends Event {
|
||||
/**
|
||||
* A class to handle adding / getting / removing image files from the disk.
|
||||
*/
|
||||
class ImageIO extends SimpleExtension {
|
||||
class ImageIO extends Extension {
|
||||
public function onInitExt(InitExtEvent $event) {
|
||||
global $config;
|
||||
$config->set_default_int('thumb_width', 192);
|
||||
|
@@ -128,7 +128,7 @@ class PostListBuildingEvent extends Event {
|
||||
}
|
||||
}
|
||||
|
||||
class Index extends SimpleExtension {
|
||||
class Index extends Extension {
|
||||
public function onInitExt(InitExtEvent $event) {
|
||||
global $config;
|
||||
$config->set_default_int("index_width", 3);
|
||||
|
@@ -7,7 +7,7 @@
|
||||
* Description: Provides an interface for sending and receiving mail.
|
||||
*/
|
||||
|
||||
class Mail extends SimpleExtension {
|
||||
class Mail extends Extension {
|
||||
public function onSetupBuilding(SetupBuildingEvent $event) {
|
||||
$sb = new SetupBlock("Mailing Options");
|
||||
$sb->add_text_option("mail_sub", "<br>Subject prefix: ");
|
||||
@@ -26,7 +26,7 @@ class Mail extends SimpleExtension {
|
||||
$config->set_default_string("mail_fot", "<a href='".make_http(make_link())."'>".$config->get_string("site_title")."</a>");
|
||||
}
|
||||
}
|
||||
class MailTest extends SimpleExtension {
|
||||
class MailTest extends Extension {
|
||||
public function onPageRequest(PageRequestEvent $event) {
|
||||
if($event->page_matches("mail/test")) {
|
||||
global $page;
|
||||
|
@@ -161,7 +161,7 @@ class SetupBlock extends Block {
|
||||
}
|
||||
// }}}
|
||||
|
||||
class Setup extends SimpleExtension {
|
||||
class Setup extends Extension {
|
||||
public function onInitExt(InitExtEvent $event) {
|
||||
global $config;
|
||||
$config->set_default_string("title", "Shimmie");
|
||||
|
@@ -55,7 +55,7 @@ class LockSetEvent extends Event {
|
||||
}
|
||||
}
|
||||
|
||||
class TagEdit extends SimpleExtension {
|
||||
class TagEdit extends Extension {
|
||||
public function onPageRequest(PageRequestEvent $event) {
|
||||
global $user, $page;
|
||||
if($event->page_matches("tag_edit")) {
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* Description: Show the tags in various ways
|
||||
*/
|
||||
|
||||
class TagList extends SimpleExtension {
|
||||
class TagList extends Extension {
|
||||
public function onInitExt(InitExtEvent $event) {
|
||||
global $config;
|
||||
$config->set_default_int("tag_list_length", 15);
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* Visibility: admin
|
||||
*/
|
||||
|
||||
class Upgrade extends SimpleExtension {
|
||||
class Upgrade extends Extension {
|
||||
public function onInitExt(InitExtEvent $event) {
|
||||
global $config, $database;
|
||||
|
||||
|
@@ -41,7 +41,7 @@ class UploadException extends SCoreException {}
|
||||
* All files that are uploaded to the site are handled through this class.
|
||||
* This also includes transloaded files as well.
|
||||
*/
|
||||
class Upload extends SimpleExtension {
|
||||
class Upload extends Extension {
|
||||
// early, so it can stop the DataUploadEvent before any data handlers see it
|
||||
public function get_priority() {return 40;}
|
||||
|
||||
|
@@ -42,7 +42,7 @@ class UserCreationEvent extends Event {
|
||||
|
||||
class UserCreationException extends SCoreException {}
|
||||
|
||||
class UserPage extends SimpleExtension {
|
||||
class UserPage extends Extension {
|
||||
public function onInitExt(InitExtEvent $event) {
|
||||
global $config;
|
||||
$config->set_default_bool("login_signup_enabled", true);
|
||||
|
@@ -66,7 +66,7 @@ class ImageAdminBlockBuildingEvent extends Event {
|
||||
}
|
||||
}
|
||||
|
||||
class ViewImage extends SimpleExtension {
|
||||
class ViewImage extends Extension {
|
||||
public function onPageRequest(PageRequestEvent $event) {
|
||||
global $page, $user;
|
||||
|
||||
|
Reference in New Issue
Block a user