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:
@ -35,7 +35,7 @@ class AdminBuildingEvent extends Event {
|
||||
}
|
||||
}
|
||||
|
||||
class AdminPage extends SimpleExtension {
|
||||
class AdminPage extends Extension {
|
||||
public function onPageRequest(PageRequestEvent $event) {
|
||||
global $page, $user;
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
require_once "lib/S3.php";
|
||||
|
||||
class UploadS3 extends SimpleExtension {
|
||||
class UploadS3 extends Extension {
|
||||
public function onInitExt(InitExtEvent $event) {
|
||||
global $config;
|
||||
$config->set_default_string("amazon_s3_access", "");
|
||||
|
@ -19,7 +19,7 @@ class AuthorSetEvent extends Event {
|
||||
}
|
||||
}
|
||||
|
||||
class Artists extends SimpleExtension {
|
||||
class Artists extends Extension {
|
||||
public function onImageInfoSet(ImageInfoSetEvent $event) {
|
||||
global $user;
|
||||
if (isset($_POST["tag_edit__author"])) {
|
||||
|
@ -19,7 +19,7 @@
|
||||
* from Essex"
|
||||
*/
|
||||
|
||||
class BanWords extends SimpleExtension {
|
||||
class BanWords extends Extension {
|
||||
public function onInitExt(InitExtEvent $event) {
|
||||
global $config;
|
||||
$config->set_default_string('banned_words', "
|
||||
|
@ -27,7 +27,7 @@
|
||||
* </pre>
|
||||
*/
|
||||
|
||||
class Blocks extends SimpleExtension {
|
||||
class Blocks extends Extension {
|
||||
public function onPageRequest(PageRequestEvent $event) {
|
||||
global $config, $page;
|
||||
$all = $config->get_string("blocks_text");
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
* Development TODO at http://github.com/zshall/shimmie2/issues
|
||||
*/
|
||||
class Blotter extends SimpleExtension {
|
||||
class Blotter extends Extension {
|
||||
public function onInitExt(InitExtEvent $event) {
|
||||
/**
|
||||
* I love re-using this installer don't I...
|
||||
|
@ -6,7 +6,7 @@
|
||||
* Description: Allow users to bookmark searches
|
||||
*/
|
||||
|
||||
class Bookmarks extends SimpleExtension {
|
||||
class Bookmarks extends Extension {
|
||||
public function onInitExt(InitExtEvent $event) {
|
||||
$this->install();
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
* engine" notification they have
|
||||
*/
|
||||
|
||||
class BrowserSearch extends SimpleExtension {
|
||||
class BrowserSearch extends Extension {
|
||||
public function onInitExt(InitExtEvent $event) {
|
||||
global $config;
|
||||
$config->set_default_string("search_suggestions_results_order", 'a');
|
||||
|
@ -14,7 +14,7 @@
|
||||
* <p><b>Note:</b> requires the "admin" extension to be enabled
|
||||
*/
|
||||
|
||||
class BulkAdd extends SimpleExtension {
|
||||
class BulkAdd extends Extension {
|
||||
public function onPageRequest(PageRequestEvent $event) {
|
||||
global $page, $user;
|
||||
if($event->page_matches("bulk_add")) {
|
||||
|
@ -47,7 +47,7 @@ Completely compatibility will probably involve a rewrite with a different URL
|
||||
|
||||
*/
|
||||
|
||||
class DanbooruApi extends SimpleExtension {
|
||||
class DanbooruApi extends Extension {
|
||||
public function onPageRequest(PageRequestEvent $event) {
|
||||
if($event->page_matches("api") && ($event->get_arg(0) == 'danbooru')) {
|
||||
$this->api_danbooru($event);
|
||||
|
@ -11,7 +11,7 @@
|
||||
* message specified in the box.
|
||||
*/
|
||||
|
||||
class Downtime extends SimpleExtension {
|
||||
class Downtime extends Extension {
|
||||
public function get_priority() {return 10;}
|
||||
|
||||
public function onSetupBuilding($event) {
|
||||
|
@ -24,7 +24,7 @@ class Emoticons extends FormatterExtension {
|
||||
}
|
||||
}
|
||||
|
||||
class EmoticonList extends SimpleExtension {
|
||||
class EmoticonList extends Extension {
|
||||
public function onPageRequest(PageRequestEvent $event) {
|
||||
if($event->page_matches("emote/list")) {
|
||||
$this->theme->display_emotes(glob("ext/emoticons/default/*"));
|
||||
|
@ -12,7 +12,7 @@
|
||||
* versions of PHP I should test with, etc.
|
||||
*/
|
||||
|
||||
class ET extends SimpleExtension {
|
||||
class ET extends Extension {
|
||||
public function onPageRequest(PageRequestEvent $event) {
|
||||
global $user;
|
||||
if($event->page_matches("system_info")) {
|
||||
|
@ -26,7 +26,7 @@ class FavoriteSetEvent extends Event {
|
||||
}
|
||||
}
|
||||
|
||||
class Favorites extends SimpleExtension {
|
||||
class Favorites extends Extension {
|
||||
public function onInitExt(InitExtEvent $event) {
|
||||
global $config;
|
||||
if($config->get_int("ext_favorites_version", 0) < 1) {
|
||||
|
@ -18,7 +18,7 @@
|
||||
* every couple of hours.
|
||||
*/
|
||||
|
||||
class Featured extends SimpleExtension {
|
||||
class Featured extends Extension {
|
||||
public function onInitExt(InitExtEvent $event) {
|
||||
global $config;
|
||||
$config->set_default_int('featured_id', 0);
|
||||
|
@ -8,7 +8,7 @@
|
||||
* Documentation:
|
||||
*/
|
||||
|
||||
class Forum extends SimpleExtension {
|
||||
class Forum extends Extension {
|
||||
public function onInitExt(InitExtEvent $event) {
|
||||
global $config, $database;
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
* <br>7-zip: <code>7zr x -o"%d" "%f"</code>
|
||||
*/
|
||||
|
||||
class ArchiveFileHandler extends SimpleExtension {
|
||||
class ArchiveFileHandler extends Extension {
|
||||
public function onInitExt(InitExtEvent $event) {
|
||||
global $config;
|
||||
$config->set_default_string('archive_extract_command', 'unzip -d "%d" "%f"');
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Description: Handle windows icons
|
||||
*/
|
||||
|
||||
class IcoFileHandler extends SimpleExtension {
|
||||
class IcoFileHandler extends Extension {
|
||||
public function onDataUpload(DataUploadEvent $event) {
|
||||
if($this->supported_ext($event->type) && $this->check_contents($event->tmpname)) {
|
||||
$hash = $event->hash;
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Description: Handle SVG files
|
||||
*/
|
||||
|
||||
class SVGFileHandler extends SimpleExtension {
|
||||
class SVGFileHandler extends Extension {
|
||||
public function onDataUpload(DataUploadEvent $event) {
|
||||
if($this->supported_ext($event->type) && $this->check_contents($event->tmpname)) {
|
||||
$hash = $event->hash;
|
||||
|
@ -6,7 +6,7 @@
|
||||
* License: GPLv2
|
||||
* Description: Use an additional stylesheet on certain holidays.
|
||||
*/
|
||||
class Holiday extends SimpleExtension {
|
||||
class Holiday extends Extension {
|
||||
public function onInitExt(InitExtEvent $event) {
|
||||
global $config;
|
||||
$config->set_default_bool("holiday_aprilfools", false);
|
||||
|
@ -15,7 +15,7 @@
|
||||
* alongside the default choices.
|
||||
*/
|
||||
|
||||
class Home extends SimpleExtension {
|
||||
class Home extends Extension {
|
||||
public function onInitExt(InitExtEvent $event) {
|
||||
global $config;
|
||||
$config->set_default_string("home_links", '[$base/post/list|Posts]
|
||||
|
@ -29,7 +29,7 @@ class AddImageHashBanEvent extends Event {
|
||||
}
|
||||
}
|
||||
// }}}
|
||||
class ImageBan extends SimpleExtension {
|
||||
class ImageBan extends Extension {
|
||||
public function onInitExt(InitExtEvent $event) {
|
||||
global $config, $database;
|
||||
if($config->get_int("ext_imageban_version") < 1) {
|
||||
|
@ -34,7 +34,7 @@ class AddIPBanEvent extends Event {
|
||||
}
|
||||
// }}}
|
||||
|
||||
class IPBan extends SimpleExtension {
|
||||
class IPBan extends Extension {
|
||||
public function get_priority() {return 10;}
|
||||
|
||||
public function onInitExt(InitExtEvent $event) {
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Author: Artanis <artanis.00@gmail.com>
|
||||
* Description: Show various forms of link to each image, for copy & paste
|
||||
*/
|
||||
class LinkImage extends SimpleExtension {
|
||||
class LinkImage extends Extension {
|
||||
public function onDisplayingImage(DisplayingImageEvent $event) {
|
||||
global $page;
|
||||
$this->theme->links_block($page, $this->data($event->image));
|
||||
|
@ -6,7 +6,7 @@
|
||||
* Visibility: admin
|
||||
*/
|
||||
|
||||
class LogDatabase extends SimpleExtension {
|
||||
class LogDatabase extends Extension {
|
||||
public function onInitExt(InitExtEvent $event) {
|
||||
global $database;
|
||||
global $config;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* As of now only compatible with the lite theme.
|
||||
*/
|
||||
|
||||
class MassTagger extends SimpleExtension {
|
||||
class MassTagger extends Extension {
|
||||
public function onPostListBuilding(PostListBuildingEvent $event) {
|
||||
global $config, $page, $user;
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
* Any HTML is allowed
|
||||
*/
|
||||
|
||||
class News extends SimpleExtension {
|
||||
class News extends Extension {
|
||||
public function onPostListBuilding(PostListBuildingEvent $event) {
|
||||
global $config, $page;
|
||||
if(strlen($config->get_string("news_text")) > 0) {
|
||||
|
@ -7,7 +7,7 @@
|
||||
* Documentation:
|
||||
*/
|
||||
|
||||
class Notes extends SimpleExtension {
|
||||
class Notes extends Extension {
|
||||
public function onInitExt(InitExtEvent $event) {
|
||||
global $config, $database;
|
||||
|
||||
|
@ -19,7 +19,7 @@ class NumericScoreSetEvent extends Event {
|
||||
}
|
||||
}
|
||||
|
||||
class NumericScore extends SimpleExtension {
|
||||
class NumericScore extends Extension {
|
||||
public function onInitExt(InitExtEvent $event) {
|
||||
global $config;
|
||||
if($config->get_int("ext_numeric_score_version", 0) < 1) {
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Description: ChibiPaint-based Oekaki uploader
|
||||
*/
|
||||
|
||||
class Oekaki extends SimpleExtension {
|
||||
class Oekaki extends Extension {
|
||||
public function onPageRequest(PageRequestEvent $event) {
|
||||
global $user, $page;
|
||||
|
||||
|
@ -42,7 +42,7 @@ class PM {
|
||||
}
|
||||
}
|
||||
|
||||
class PrivMsg extends SimpleExtension {
|
||||
class PrivMsg extends Extension {
|
||||
public function onInitExt(InitExtEvent $event) {
|
||||
global $config, $database;
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
class PoolCreationException extends SCoreException {
|
||||
}
|
||||
|
||||
class Pools extends SimpleExtension {
|
||||
class Pools extends Extension {
|
||||
public function onInitExt(InitExtEvent $event) {
|
||||
global $config, $database;
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
* Further modified by Shish to remove the 7MB local QR generator
|
||||
* and replace it with a link to google chart APIs
|
||||
*/
|
||||
class QRImage extends SimpleExtension {
|
||||
class QRImage extends Extension {
|
||||
public function onDisplayingImage(DisplayingImageEvent $event) {
|
||||
$this->theme->links_block(make_http(make_link('image/'.$event->image->id.'.jpg')));
|
||||
}
|
||||
|
@ -19,7 +19,7 @@
|
||||
* <code>/random_image/download/size=1024x768+cute</code>
|
||||
*/
|
||||
|
||||
class RandomImage extends SimpleExtension {
|
||||
class RandomImage extends Extension {
|
||||
public function onPageRequest(PageRequestEvent $event) {
|
||||
global $config, $database, $page, $user;
|
||||
if($event->page_matches("random_image")) {
|
||||
|
@ -17,7 +17,7 @@ class RatingSetEvent extends Event {
|
||||
}
|
||||
}
|
||||
|
||||
class Ratings extends SimpleExtension {
|
||||
class Ratings extends Extension {
|
||||
public function onAdminBuilding(AdminBuildingEvent $event) {
|
||||
$this->theme->display_bulk_rater();
|
||||
}
|
||||
|
@ -12,7 +12,7 @@
|
||||
* since been increased.
|
||||
*/
|
||||
|
||||
class RegenThumb extends SimpleExtension {
|
||||
class RegenThumb extends Extension {
|
||||
public function onPageRequest(PageRequestEvent $event) {
|
||||
global $config, $database, $page, $user;
|
||||
|
||||
|
@ -29,7 +29,7 @@ class AddReportedImageEvent extends Event {
|
||||
}
|
||||
}
|
||||
|
||||
class ReportImage extends SimpleExtension {
|
||||
class ReportImage extends Extension {
|
||||
public function onInitExt(InitExtEvent $event) {
|
||||
global $config;
|
||||
$config->set_default_bool('report_image_show_thumbs', true);
|
||||
|
@ -5,7 +5,7 @@
|
||||
* License: GPLv2
|
||||
* Description: Allows the admin to set min / max image dimentions
|
||||
*/
|
||||
class ResolutionLimit extends SimpleExtension {
|
||||
class ResolutionLimit extends Extension {
|
||||
public function get_priority() {return 40;} // early, to veto ImageUploadEvent
|
||||
|
||||
public function onImageAddition(ImageAdditionEvent $event) {
|
||||
|
@ -26,7 +26,7 @@ class ImageResizeException extends SCoreException {
|
||||
/**
|
||||
* This class handles image resize requests.
|
||||
*/
|
||||
class ResizeImage extends SimpleExtension {
|
||||
class ResizeImage extends Extension {
|
||||
|
||||
public function onInitExt(InitExtEvent $event) {
|
||||
global $config;
|
||||
|
@ -6,7 +6,7 @@
|
||||
* Description: Self explanatory
|
||||
*/
|
||||
|
||||
class RSS_Comments extends SimpleExtension {
|
||||
class RSS_Comments extends Extension {
|
||||
public function onPostListBuilding(PostListBuildingEvent $event) {
|
||||
global $config, $page;
|
||||
$title = $config->get_string('title');
|
||||
|
@ -6,7 +6,7 @@
|
||||
* Description: Self explanatory
|
||||
*/
|
||||
|
||||
class RSS_Images extends SimpleExtension {
|
||||
class RSS_Images extends Extension {
|
||||
public function onPostListBuilding(PostListBuildingEvent $event) {
|
||||
global $config, $page;
|
||||
$title = $config->get_string('title');
|
||||
|
@ -26,7 +26,7 @@ class _SafeImage {
|
||||
}
|
||||
}
|
||||
|
||||
class ShimmieApi extends SimpleExtension {
|
||||
class ShimmieApi extends Extension {
|
||||
public function onPageRequest(PageRequestEvent $event) {
|
||||
global $database, $page;
|
||||
|
||||
|
@ -205,7 +205,7 @@ class TestFinder extends TestSuite {
|
||||
}
|
||||
}
|
||||
|
||||
class SimpleSCoreTest extends SimpleExtension {
|
||||
class SimpleSCoreTest extends Extension {
|
||||
public function onPageRequest(PageRequestEvent $event) {
|
||||
global $page;
|
||||
if($event->page_matches("test")) {
|
||||
|
@ -9,7 +9,7 @@
|
||||
* This extension sets the "description" meta tag in the header
|
||||
* of pages so that search engines can pick it up
|
||||
*/
|
||||
class SiteDescription extends SimpleExtension {
|
||||
class SiteDescription extends Extension {
|
||||
public function onPageRequest(PageRequestEvent $event) {
|
||||
global $config, $page;
|
||||
if(strlen($config->get_string("site_description")) > 0) {
|
||||
|
@ -7,7 +7,7 @@
|
||||
* Documentation:
|
||||
*/
|
||||
|
||||
class XMLSitemap extends SimpleExtension {
|
||||
class XMLSitemap extends Extension {
|
||||
public function onPageRequest(PageRequestEvent $event) {
|
||||
if($event->page_matches("sitemap.xml")) {
|
||||
$images = Image::find_images(0, 50, array());
|
||||
|
@ -12,7 +12,7 @@
|
||||
* colorize used tags in cloud || always show used tags in front of cloud
|
||||
* theme junk
|
||||
*/
|
||||
class TagEditCloud extends SimpleExtension {
|
||||
class TagEditCloud extends Extension {
|
||||
public function onImageInfoBoxBuilding(ImageInfoBoxBuildingEvent $event) {
|
||||
global $config;
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Description: Keep a record of tag changes, and allows you to revert changes.
|
||||
*/
|
||||
|
||||
class Tag_History extends SimpleExtension {
|
||||
class Tag_History extends Extension {
|
||||
// in before tags are actually set, so that "get current tags" works
|
||||
public function get_priority() {return 40;}
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
* Do not remove this notice.
|
||||
*/
|
||||
|
||||
class Tagger extends SimpleExtension {
|
||||
class Tagger extends Extension {
|
||||
public function onDisplayingImage(DisplayingImageEvent $event) {
|
||||
global $page, $config, $user;
|
||||
|
||||
@ -32,7 +32,7 @@ class Tagger extends SimpleExtension {
|
||||
}
|
||||
|
||||
// Tagger AJAX back-end
|
||||
class TaggerXML extends SimpleExtension {
|
||||
class TaggerXML extends Extension {
|
||||
public function get_priority() {return 10;}
|
||||
|
||||
public function onPageRequest(PageRequestEvent $event) {
|
||||
|
@ -8,7 +8,7 @@
|
||||
* Formatting is done with HTML
|
||||
*/
|
||||
|
||||
class Tips extends SimpleExtension {
|
||||
class Tips extends Extension {
|
||||
public function onInitExt(InitExtEvent $event) {
|
||||
global $config, $database;
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
* Description: Show a twitter feed with the Sea of Clouds script
|
||||
*/
|
||||
|
||||
class TwitterSoc extends SimpleExtension {
|
||||
class TwitterSoc extends Extension {
|
||||
public function onPostListBuilding(PostListBuildingEvent $event) {
|
||||
global $config, $page;
|
||||
if(strlen($config->get_string("twitter_soc_username")) > 0) {
|
||||
|
@ -6,7 +6,7 @@
|
||||
* License: GPLv2
|
||||
* Description: Shimmie updater!
|
||||
*/
|
||||
class Update extends SimpleExtension {
|
||||
class Update extends Extension {
|
||||
public function onInitExt(InitExtEvent $event) {
|
||||
global $config;
|
||||
$config->set_default_string("update_url", "http://nodeload.github.com/shish/shimmie2/zipball/master"); //best to avoid using https
|
||||
|
@ -53,7 +53,7 @@ class WikiPage {
|
||||
}
|
||||
}
|
||||
|
||||
class Wiki extends SimpleExtension {
|
||||
class Wiki extends Extension {
|
||||
public function onInitExt(InitExtEvent $event) {
|
||||
global $database;
|
||||
global $config;
|
||||
|
@ -6,7 +6,7 @@
|
||||
* Description: Simple search and replace
|
||||
*/
|
||||
|
||||
class WordFilter extends SimpleExtension {
|
||||
class WordFilter extends Extension {
|
||||
// before emoticon filter
|
||||
public function get_priority() {return 40;}
|
||||
|
||||
|
Reference in New Issue
Block a user