and make the extensions match

git-svn-id: file:///home/shish/svn/shimmie2/trunk@1003 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
shish 2008-08-23 12:08:19 +00:00
parent 1e4d7d1938
commit 434fab2dc5
55 changed files with 111 additions and 111 deletions

View File

@ -6,8 +6,8 @@
* Description: Auto-complete for search and upload tags * Description: Auto-complete for search and upload tags
*/ */
class AutoComplete extends Extension { class AutoComplete implements Extension {
public function receive_event($event) { public function receive_event(Event $event) {
if(($event instanceof PageRequestEvent) && ($event->page_name == "index" || $event->page_name == "view")) { if(($event instanceof PageRequestEvent) && ($event->page_name == "index" || $event->page_name == "view")) {
$event->page->add_header("<script>autocomplete_url='".html_escape(make_link("autocomplete"))."';</script>"); $event->page->add_header("<script>autocomplete_url='".html_escape(make_link("autocomplete"))."';</script>");
} }

View File

@ -6,8 +6,8 @@
* Description: For stopping spam and other comment abuse * Description: For stopping spam and other comment abuse
*/ */
class BanWords extends Extension { class BanWords implements Extension {
public function receive_event($event) { public function receive_event(Event $event) {
if($event instanceof InitExtEvent) { if($event instanceof InitExtEvent) {
global $config; global $config;
$config->set_default_string('banned_words', " $config->set_default_string('banned_words', "

View File

@ -11,8 +11,8 @@
* *
*/ */
class BrowserSearch extends Extension { class BrowserSearch implements Extension {
public function receive_event($event) { public function receive_event(Event $event) {
global $page; global $page;
global $config; global $config;

View File

@ -6,10 +6,10 @@
* Description: Bulk add server-side images * Description: Bulk add server-side images
*/ */
class BulkAdd extends Extension { class BulkAdd implements Extension {
var $theme; var $theme;
public function receive_event($event) { public function receive_event(Event $event) {
if(is_null($this->theme)) $this->theme = get_theme_object("bulk_add", "BulkAddTheme"); if(is_null($this->theme)) $this->theme = get_theme_object("bulk_add", "BulkAddTheme");
if(($event instanceof PageRequestEvent) && ($event->page_name == "bulk_add")) { if(($event instanceof PageRequestEvent) && ($event->page_name == "bulk_add")) {

View File

@ -38,10 +38,10 @@ Completely compatibility will probably involve a rewrite with a different URL
*/ */
class DanbooruApi extends Extension class DanbooruApi implements Extension
{ {
// Receive the event // Receive the event
public function receive_event($event) public function receive_event(Event $event)
{ {
// Check if someone is accessing /api/danbooru (us) // Check if someone is accessing /api/danbooru (us)
if(($event instanceof PageRequestEvent) && ($event->page_name == "api") && ($event->get_arg(0) == 'danbooru')) if(($event instanceof PageRequestEvent) && ($event->page_name == "api") && ($event->get_arg(0) == 'danbooru'))

View File

@ -6,10 +6,10 @@
* Description: Show a "down for maintenance" page * Description: Show a "down for maintenance" page
*/ */
class Downtime extends Extension { class Downtime implements Extension {
var $theme; var $theme;
public function receive_event($event) { public function receive_event(Event $event) {
if(is_null($this->theme)) $this->theme = get_theme_object("downtime", "DowntimeTheme"); if(is_null($this->theme)) $this->theme = get_theme_object("downtime", "DowntimeTheme");
if($event instanceof SetupBuildingEvent) { if($event instanceof SetupBuildingEvent) {

View File

@ -6,8 +6,8 @@
* Description: Turn :smile: into a link to smile.gif * Description: Turn :smile: into a link to smile.gif
*/ */
class Emoticons extends Extension { class Emoticons implements Extension {
public function receive_event($event) { public function receive_event(Event $event) {
if($event instanceof TextFormattingEvent) { if($event instanceof TextFormattingEvent) {
$event->formatted = $this->bbcode_to_html($event->formatted); $event->formatted = $this->bbcode_to_html($event->formatted);
$event->stripped = $this->bbcode_to_text($event->stripped); $event->stripped = $this->bbcode_to_text($event->stripped);

View File

@ -6,10 +6,10 @@
* Description: Show various bits of system information, for debugging * Description: Show various bits of system information, for debugging
*/ */
class ET extends Extension { class ET implements Extension {
var $theme; var $theme;
public function receive_event($event) { public function receive_event(Event $event) {
if(is_null($this->theme)) $this->theme = get_theme_object("et", "ETTheme"); if(is_null($this->theme)) $this->theme = get_theme_object("et", "ETTheme");
if(($event instanceof PageRequestEvent) && ($event->page_name == "system_info")) { if(($event instanceof PageRequestEvent) && ($event->page_name == "system_info")) {

View File

@ -6,10 +6,10 @@
* Description: A log of things that happen, for abuse tracking * Description: A log of things that happen, for abuse tracking
*/ */
class EventLog extends Extension { class EventLog implements Extension {
var $theme; var $theme;
public function receive_event($event) { public function receive_event(Event $event) {
if(is_null($this->theme)) $this->theme = get_theme_object("event_log", "EventLogTheme"); if(is_null($this->theme)) $this->theme = get_theme_object("event_log", "EventLogTheme");
if($event instanceof InitExtEvent) { if($event instanceof InitExtEvent) {

View File

@ -6,10 +6,10 @@
* Description: Bring a specific image to the users' attentions * Description: Bring a specific image to the users' attentions
*/ */
class Featured extends Extension { class Featured implements Extension {
var $theme; var $theme;
public function receive_event($event) { public function receive_event(Event $event) {
if(is_null($this->theme)) $this->theme = get_theme_object("featured", "FeaturedTheme"); if(is_null($this->theme)) $this->theme = get_theme_object("featured", "FeaturedTheme");
if($event instanceof InitExtEvent) { if($event instanceof InitExtEvent) {

View File

@ -5,8 +5,8 @@
* Description: Allow users to upload archives (zip, etc) * Description: Allow users to upload archives (zip, etc)
*/ */
class ArchiveFileHandler extends Extension { class ArchiveFileHandler implements Extension {
public function receive_event($event) { public function receive_event(Event $event) {
if($event instanceof InitExtEvent) { if($event instanceof InitExtEvent) {
global $config; global $config;
$config->set_default_string('archive_extract_command', 'unzip -d "%d" "%f"'); $config->set_default_string('archive_extract_command', 'unzip -d "%d" "%f"');

View File

@ -5,10 +5,10 @@
* Description: Handle Flash files * Description: Handle Flash files
*/ */
class FlashFileHandler extends Extension { class FlashFileHandler implements Extension {
var $theme; var $theme;
public function receive_event($event) { public function receive_event(Event $event) {
if(is_null($this->theme)) $this->theme = get_theme_object("handle_flash", "FlashFileHandlerTheme"); if(is_null($this->theme)) $this->theme = get_theme_object("handle_flash", "FlashFileHandlerTheme");
if(($event instanceof DataUploadEvent) && $this->supported_ext($event->type) && $this->check_contents($event->tmpname)) { if(($event instanceof DataUploadEvent) && $this->supported_ext($event->type) && $this->check_contents($event->tmpname)) {

View File

@ -5,10 +5,10 @@
* Description: Handle windows icons * Description: Handle windows icons
*/ */
class IcoFileHandler extends Extension { class IcoFileHandler implements Extension {
var $theme; var $theme;
public function receive_event($event) { public function receive_event(Event $event) {
if(is_null($this->theme)) $this->theme = get_theme_object("handle_ico", "IcoFileHandlerTheme"); if(is_null($this->theme)) $this->theme = get_theme_object("handle_ico", "IcoFileHandlerTheme");
if(($event instanceof DataUploadEvent) && $this->supported_ext($event->type) && $this->check_contents($event->tmpname)) { if(($event instanceof DataUploadEvent) && $this->supported_ext($event->type) && $this->check_contents($event->tmpname)) {

View File

@ -5,10 +5,10 @@
* Description: Handle MP3 files * Description: Handle MP3 files
*/ */
class MP3FileHandler extends Extension { class MP3FileHandler implements Extension {
var $theme; var $theme;
public function receive_event($event) { public function receive_event(Event $event) {
if(is_null($this->theme)) $this->theme = get_theme_object("handle_mp3", "MP3FileHandlerTheme"); if(is_null($this->theme)) $this->theme = get_theme_object("handle_mp3", "MP3FileHandlerTheme");
if(($event instanceof DataUploadEvent) && $this->supported_ext($event->type) && $this->check_contents($event->tmpname)) { if(($event instanceof DataUploadEvent) && $this->supported_ext($event->type) && $this->check_contents($event->tmpname)) {

View File

@ -5,10 +5,10 @@
* Description: Handle SVG files * Description: Handle SVG files
*/ */
class SVGFileHandler extends Extension { class SVGFileHandler implements Extension {
var $theme; var $theme;
public function receive_event($event) { public function receive_event(Event $event) {
if(is_null($this->theme)) $this->theme = get_theme_object("handle_svg", "SVGFileHandlerTheme"); if(is_null($this->theme)) $this->theme = get_theme_object("handle_svg", "SVGFileHandlerTheme");
if(($event instanceof DataUploadEvent) && $this->supported_ext($event->type) && $this->check_contents($event->tmpname)) { if(($event instanceof DataUploadEvent) && $this->supported_ext($event->type) && $this->check_contents($event->tmpname)) {

View File

@ -8,10 +8,10 @@
* page is accessed via /home. * page is accessed via /home.
*/ */
class Home extends Extension { class Home implements Extension {
var $theme; var $theme;
public function receive_event($event) { public function receive_event(Event $event) {
if(is_null($this->theme)) $this->theme = get_theme_object("home", "HomeTheme"); if(is_null($this->theme)) $this->theme = get_theme_object("home", "HomeTheme");
if(($event instanceof PageRequestEvent) && ($event->page_name == "home")) if(($event instanceof PageRequestEvent) && ($event->page_name == "home"))

View File

@ -30,10 +30,10 @@ class AddImageHashBanEvent extends Event {
} }
} }
// }}} // }}}
class Image_Hash_Ban extends Extension { class Image_Hash_Ban implements Extension {
var $theme; var $theme;
public function receive_event($event) { public function receive_event(Event $event) {
if(is_null($this->theme)) $this->theme = get_theme_object("Image_Hash_Ban", "ImageBanTheme"); if(is_null($this->theme)) $this->theme = get_theme_object("Image_Hash_Ban", "ImageBanTheme");
if($event instanceof InitExtEvent) { if($event instanceof InitExtEvent) {

View File

@ -30,10 +30,10 @@ class AddIPBanEvent extends Event {
} }
// }}} // }}}
class IPBan extends Extension { class IPBan implements Extension {
var $theme; var $theme;
// event handler {{{ // event handler {{{
public function receive_event($event) { public function receive_event(Event $event) {
if(is_null($this->theme)) $this->theme = get_theme_object("ipban", "IPBanTheme"); if(is_null($this->theme)) $this->theme = get_theme_object("ipban", "IPBanTheme");
if($event instanceof InitExtEvent) { if($event instanceof InitExtEvent) {

View File

@ -4,10 +4,10 @@
* Author: Artanis <artanis.00@gmail.com> * Author: Artanis <artanis.00@gmail.com>
* Description: Show various forms of link to each image, for copy & paste * Description: Show various forms of link to each image, for copy & paste
*/ */
class LinkImage extends Extension { class LinkImage implements Extension {
var $theme; var $theme;
public function receive_event($event) { public function receive_event(Event $event) {
if(is_null($this->theme)) $this->theme = get_theme_object("link_image", "LinkImageTheme"); if(is_null($this->theme)) $this->theme = get_theme_object("link_image", "LinkImageTheme");
if(($event instanceof DisplayingImageEvent)) { if(($event instanceof DisplayingImageEvent)) {
global $config; global $config;

View File

@ -6,10 +6,10 @@
* Description: Show a short amonut of text in a block on the post list * Description: Show a short amonut of text in a block on the post list
*/ */
class News extends Extension { class News implements Extension {
var $theme; var $theme;
public function receive_event($event) { public function receive_event(Event $event) {
if(is_null($this->theme)) $this->theme = get_theme_object("news", "NewsTheme"); if(is_null($this->theme)) $this->theme = get_theme_object("news", "NewsTheme");
if($event instanceof PostListBuildingEvent) { if($event instanceof PostListBuildingEvent) {

View File

@ -6,10 +6,10 @@
* Description: Adds notes overlaid on the images * Description: Adds notes overlaid on the images
*/ */
class Notes extends Extension { class Notes implements Extension {
var $theme; var $theme;
public function receive_event($event) { public function receive_event(Event $event) {
if(is_null($this->theme)) $this->theme = get_theme_object("notes", "NotesTheme"); if(is_null($this->theme)) $this->theme = get_theme_object("notes", "NotesTheme");
if($event instanceof InitExtEvent) { if($event instanceof InitExtEvent) {

View File

@ -16,10 +16,10 @@ class NumericScoreSetEvent extends Event {
} }
} }
class NumericScore extends Extension { class NumericScore implements Extension {
var $theme; var $theme;
public function receive_event($event) { public function receive_event(Event $event) {
if(is_null($this->theme)) $this->theme = get_theme_object("numeric_score", "NumericScoreTheme"); if(is_null($this->theme)) $this->theme = get_theme_object("numeric_score", "NumericScoreTheme");
if($event instanceof InitExtEvent) { if($event instanceof InitExtEvent) {

View File

@ -5,8 +5,8 @@
* License: GPLv2 * License: GPLv2
* Description: Adds a link to piclensify the gallery * Description: Adds a link to piclensify the gallery
*/ */
class PicLens extends Extension { class PicLens implements Extension {
public function receive_event($event) { public function receive_event(Event $event) {
if($event instanceof PageRequestEvent) { if($event instanceof PageRequestEvent) {
$event->page->add_header("<script type=\"text/javascript\" src=\"http://lite.piclens.com/current/piclens.js\"></script>"); $event->page->add_header("<script type=\"text/javascript\" src=\"http://lite.piclens.com/current/piclens.js\"></script>");
} }

View File

@ -7,8 +7,8 @@
* Link: http://trac.shishnet.org/shimmie2/wiki/Contrib/Extensions/RandomImage * Link: http://trac.shishnet.org/shimmie2/wiki/Contrib/Extensions/RandomImage
*/ */
class RandomImage extends Extension { class RandomImage implements Extension {
public function receive_event($event) { public function receive_event(Event $event) {
if(($event instanceof PageRequestEvent) && ($event->page_name == "random_image")) { if(($event instanceof PageRequestEvent) && ($event->page_name == "random_image")) {
global $database; global $database;

View File

@ -16,10 +16,10 @@ class RatingSetEvent extends Event {
} }
} }
class Ratings extends Extension { class Ratings implements Extension {
var $theme; var $theme;
public function receive_event($event) { public function receive_event(Event $event) {
if(is_null($this->theme)) $this->theme = get_theme_object("rating", "RatingsTheme"); if(is_null($this->theme)) $this->theme = get_theme_object("rating", "RatingsTheme");
if($event instanceof InitExtEvent) { if($event instanceof InitExtEvent) {

View File

@ -6,10 +6,10 @@
* Description: Regenerate a thumbnail image * Description: Regenerate a thumbnail image
*/ */
class RegenThumb extends Extension { class RegenThumb implements Extension {
var $theme; var $theme;
public function receive_event($event) { public function receive_event(Event $event) {
if(is_null($this->theme)) $this->theme = get_theme_object("regen_thumb", "RegenThumbTheme"); if(is_null($this->theme)) $this->theme = get_theme_object("regen_thumb", "RegenThumbTheme");
if(($event instanceof PageRequestEvent) && ($event->page_name == "regen_thumb")) { if(($event instanceof PageRequestEvent) && ($event->page_name == "regen_thumb")) {

View File

@ -29,10 +29,10 @@ class AddReportedImageEvent extends Event {
} }
} }
class ReportImage extends Extension { class ReportImage implements Extension {
var $theme; var $theme;
public function receive_event($event) { public function receive_event(Event $event) {
if(is_null($this->theme)) $this->theme = get_theme_object("report_image", "ReportImageTheme"); if(is_null($this->theme)) $this->theme = get_theme_object("report_image", "ReportImageTheme");
if($event instanceof InitExtEvent) { if($event instanceof InitExtEvent) {

View File

@ -5,8 +5,8 @@
* License: GPLv2 * License: GPLv2
* Description: Allows the admin to set min / max image dimentions * Description: Allows the admin to set min / max image dimentions
*/ */
class ResolutionLimit extends Extension { class ResolutionLimit implements Extension {
public function receive_event($event) { public function receive_event(Event $event) {
if($event instanceof ImageAdditionEvent) { if($event instanceof ImageAdditionEvent) {
global $config; global $config;
$min_w = $config->get_int("upload_min_width", -1); $min_w = $config->get_int("upload_min_width", -1);

View File

@ -6,9 +6,9 @@
* Description: Self explanitory * Description: Self explanitory
*/ */
class RSS_Comments extends Extension { class RSS_Comments implements Extension {
// event handling {{{ // event handling {{{
public function receive_event($event) { public function receive_event(Event $event) {
if($event instanceof PostListBuildingEvent) { if($event instanceof PostListBuildingEvent) {
global $page; global $page;
global $config; global $config;

View File

@ -6,9 +6,9 @@
* Description: Self explanitory * Description: Self explanitory
*/ */
class RSS_Images extends Extension { class RSS_Images implements Extension {
// event handling {{{ // event handling {{{
public function receive_event($event) { public function receive_event(Event $event) {
if($event instanceof PostListBuildingEvent) { if($event instanceof PostListBuildingEvent) {
global $page; global $page;
global $config; global $config;

View File

@ -6,8 +6,8 @@
* Description: Sets the "description" meta-info in the page header, for * Description: Sets the "description" meta-info in the page header, for
* eg search engines to read * eg search engines to read
*/ */
class SiteDescription extends Extension { class SiteDescription implements Extension {
public function receive_event($event) { public function receive_event(Event $event) {
if($event instanceof PageRequestEvent) { if($event instanceof PageRequestEvent) {
global $config; global $config;
if(strlen($config->get_string("site_description")) > 0) { if(strlen($config->get_string("site_description")) > 0) {

View File

@ -6,10 +6,10 @@
* Description: Provides a button to check for updates * Description: Provides a button to check for updates
*/ */
class SVNUpdate extends Extension { class SVNUpdate implements Extension {
var $theme; var $theme;
public function receive_event($event) { public function receive_event(Event $event) {
if(is_null($this->theme)) $this->theme = get_theme_object("svn_update", "SVNUpdateTheme"); if(is_null($this->theme)) $this->theme = get_theme_object("svn_update", "SVNUpdateTheme");
if(($event instanceof PageRequestEvent) && ($event->page_name == "update")) { if(($event instanceof PageRequestEvent) && ($event->page_name == "update")) {

View File

@ -5,10 +5,10 @@
* Description: Keep a record of tag changes * Description: Keep a record of tag changes
*/ */
class Tag_History extends Extension { class Tag_History implements Extension {
var $theme; var $theme;
public function receive_event($event) { public function receive_event(Event $event) {
if(is_null($this->theme)) $this->theme = get_theme_object("tag_history", "Tag_HistoryTheme"); if(is_null($this->theme)) $this->theme = get_theme_object("tag_history", "Tag_HistoryTheme");
if(($event instanceof InitExtEvent)) { if(($event instanceof InitExtEvent)) {

View File

@ -6,7 +6,7 @@
* Do not remove this notice. * Do not remove this notice.
*/ */
class Tagger extends Extension { class Tagger implements Extension {
var $theme; var $theme;
public function receive_event ($event) { public function receive_event ($event) {
@ -41,8 +41,8 @@ class Tagger extends Extension {
add_event_listener(new Tagger()); add_event_listener(new Tagger());
// Tagger AJAX back-end // Tagger AJAX back-end
class TaggerXML extends Extension { class TaggerXML implements Extension {
public function receive_event($event) { public function receive_event(Event $event) {
if(($event instanceof PageRequestEvent) if(($event instanceof PageRequestEvent)
&& $event->page_name == "tagger" && $event->page_name == "tagger"
&& $event->get_arg(0) == "tags") && $event->get_arg(0) == "tags")

View File

@ -16,10 +16,10 @@ class TextScoreSetEvent extends Event {
} }
} }
class TextScore extends Extension { class TextScore implements Extension {
var $theme; var $theme;
public function receive_event($event) { public function receive_event(Event $event) {
if(is_null($this->theme)) $this->theme = get_theme_object("text_score", "TextScoreTheme"); if(is_null($this->theme)) $this->theme = get_theme_object("text_score", "TextScoreTheme");
if(($event instanceof InitExtEvent)) { if(($event instanceof InitExtEvent)) {

View File

@ -51,10 +51,10 @@ class WikiPage {
} }
} }
// }}} // }}}
class Wiki extends Extension { class Wiki implements Extension {
var $theme; var $theme;
public function receive_event($event) { public function receive_event(Event $event) {
if(is_null($this->theme)) $this->theme = get_theme_object("wiki", "WikiTheme"); if(is_null($this->theme)) $this->theme = get_theme_object("wiki", "WikiTheme");
if(($event instanceof InitExtEvent)) { if(($event instanceof InitExtEvent)) {

View File

@ -6,8 +6,8 @@
* Description: Simple search and replace * Description: Simple search and replace
*/ */
class WordFilter extends Extension { class WordFilter implements Extension {
public function receive_event($event) { public function receive_event(Event $event) {
if($event instanceof TextFormattingEvent) { if($event instanceof TextFormattingEvent) {
$event->formatted = $this->filter($event->formatted); $event->formatted = $this->filter($event->formatted);
$event->stripped = $this->filter($event->stripped); $event->stripped = $this->filter($event->stripped);

View File

@ -6,10 +6,10 @@
* Description: Scales down too-large images using browser based scaling * Description: Scales down too-large images using browser based scaling
*/ */
class Zoom extends Extension { class Zoom implements Extension {
var $theme; var $theme;
public function receive_event($event) { public function receive_event(Event $event) {
if($this->theme == null) $this->theme = get_theme_object("zoom", "ZoomTheme"); if($this->theme == null) $this->theme = get_theme_object("zoom", "ZoomTheme");
if($event instanceof DisplayingImageEvent) { if($event instanceof DisplayingImageEvent) {

View File

@ -11,10 +11,10 @@ class AdminBuildingEvent extends Event {
} }
// }}} // }}}
class AdminPage extends Extension { class AdminPage implements Extension {
var $theme; var $theme;
public function receive_event($event) { public function receive_event(Event $event) {
if(is_null($this->theme)) $this->theme = get_theme_object("admin", "AdminPageTheme"); if(is_null($this->theme)) $this->theme = get_theme_object("admin", "AdminPageTheme");
if(($event instanceof PageRequestEvent) && ($event->page_name == "admin")) { if(($event instanceof PageRequestEvent) && ($event->page_name == "admin")) {

View File

@ -10,10 +10,10 @@ class AddAliasEvent extends Event {
} }
} }
class AliasEditor extends Extension { class AliasEditor implements Extension {
var $theme; var $theme;
public function receive_event($event) { public function receive_event(Event $event) {
if(is_null($this->theme)) $this->theme = get_theme_object("alias_editor", "AliasEditorTheme"); if(is_null($this->theme)) $this->theme = get_theme_object("alias_editor", "AliasEditorTheme");
if(($event instanceof PageRequestEvent) && ($event->page_name == "alias")) { if(($event instanceof PageRequestEvent) && ($event->page_name == "alias")) {

View File

@ -1,7 +1,7 @@
<?php <?php
class BBCode extends Extension { class BBCode implements Extension {
public function receive_event($event) { public function receive_event(Event $event) {
if($event instanceof TextFormattingEvent) { if($event instanceof TextFormattingEvent) {
$event->formatted = $this->bbcode_to_html($event->formatted); $event->formatted = $this->bbcode_to_html($event->formatted);
$event->stripped = $this->bbcode_to_text($event->stripped); $event->stripped = $this->bbcode_to_text($event->stripped);

View File

@ -48,10 +48,10 @@ class Comment { // {{{
} }
} // }}} } // }}}
class CommentList extends Extension { class CommentList implements Extension {
var $theme; var $theme;
// event handler {{{ // event handler {{{
public function receive_event($event) { public function receive_event(Event $event) {
if(is_null($this->theme)) $this->theme = get_theme_object("comment", "CommentListTheme"); if(is_null($this->theme)) $this->theme = get_theme_object("comment", "CommentListTheme");
if($event instanceof InitExtEvent) { if($event instanceof InitExtEvent) {

View File

@ -53,10 +53,10 @@ class ExtensionInfo { // {{{
} }
} // }}} } // }}}
class ExtManager extends Extension { class ExtManager implements Extension {
var $theme; var $theme;
public function receive_event($event) { public function receive_event(Event $event) {
if(is_null($this->theme)) $this->theme = get_theme_object("ext_manager", "ExtManagerTheme"); if(is_null($this->theme)) $this->theme = get_theme_object("ext_manager", "ExtManagerTheme");
if(($event instanceof PageRequestEvent) && ($event->page_name == "ext_manager")) { if(($event instanceof PageRequestEvent) && ($event->page_name == "ext_manager")) {

View File

@ -1,7 +1,7 @@
<?php <?php
class Handle404 extends Extension { class Handle404 implements Extension {
public function receive_event($event) { public function receive_event(Event $event) {
if($event instanceof PageRequestEvent) { if($event instanceof PageRequestEvent) {
$page = $event->page; $page = $event->page;
// hax. // hax.

View File

@ -5,10 +5,10 @@
* Description: Handle JPG, PNG, GIF, etc files * Description: Handle JPG, PNG, GIF, etc files
*/ */
class PixelFileHandler extends Extension { class PixelFileHandler implements Extension {
var $theme; var $theme;
public function receive_event($event) { public function receive_event(Event $event) {
if(is_null($this->theme)) $this->theme = get_theme_object("handle_pixel", "PixelFileHandlerTheme"); if(is_null($this->theme)) $this->theme = get_theme_object("handle_pixel", "PixelFileHandlerTheme");
if(($event instanceof DataUploadEvent) && $this->supported_ext($event->type) && $this->check_contents($event->tmpname)) { if(($event instanceof DataUploadEvent) && $this->supported_ext($event->type) && $this->check_contents($event->tmpname)) {

View File

@ -3,9 +3,9 @@
* A class to handle adding / getting / removing image * A class to handle adding / getting / removing image
* files from the disk * files from the disk
*/ */
class ImageIO extends Extension { class ImageIO implements Extension {
// event handling {{{ // event handling {{{
public function receive_event($event) { public function receive_event(Event $event) {
if($event instanceof InitExtEvent) { if($event instanceof InitExtEvent) {
global $config; global $config;
$config->set_default_int('thumb_width', 192); $config->set_default_int('thumb_width', 192);

View File

@ -10,10 +10,10 @@ class PostListBuildingEvent extends Event {
} }
} }
class Index extends Extension { class Index implements Extension {
var $theme; var $theme;
public function receive_event($event) { public function receive_event(Event $event) {
if(is_null($this->theme)) $this->theme = get_theme_object("index", "IndexTheme"); if(is_null($this->theme)) $this->theme = get_theme_object("index", "IndexTheme");
if($event instanceof InitExtEvent) { if($event instanceof InitExtEvent) {

View File

@ -1,6 +1,6 @@
<?php <?php
class LoadExtData extends Extension { class LoadExtData implements Extension {
public function receive_event($event) { public function receive_event(Event $event) {
if($event instanceof PageRequestEvent) { if($event instanceof PageRequestEvent) {
global $page, $config; global $page, $config;

View File

@ -122,10 +122,10 @@ class SetupBlock extends Block {
} }
// }}} // }}}
class Setup extends Extension { class Setup implements Extension {
var $theme; var $theme;
public function receive_event($event) { public function receive_event(Event $event) {
if(is_null($this->theme)) $this->theme = get_theme_object("setup", "SetupTheme"); if(is_null($this->theme)) $this->theme = get_theme_object("setup", "SetupTheme");
if($event instanceof InitExtEvent) { if($event instanceof InitExtEvent) {

View File

@ -1,9 +1,9 @@
<?php <?php
class TagEdit extends Extension { class TagEdit implements Extension {
var $theme; var $theme;
// event handling {{{ // event handling {{{
public function receive_event($event) { public function receive_event(Event $event) {
if(is_null($this->theme)) $this->theme = get_theme_object("tag_edit", "TagEditTheme"); if(is_null($this->theme)) $this->theme = get_theme_object("tag_edit", "TagEditTheme");
if(($event instanceof PageRequestEvent) && ($event->page_name == "tag_edit")) { if(($event instanceof PageRequestEvent) && ($event->page_name == "tag_edit")) {

View File

@ -1,10 +1,10 @@
<?php <?php
class TagList extends Extension { class TagList implements Extension {
var $theme = null; var $theme = null;
// event handling {{{ // event handling {{{
public function receive_event($event) { public function receive_event(Event $event) {
if($this->theme == null) $this->theme = get_theme_object("tag_list", "TagListTheme"); if($this->theme == null) $this->theme = get_theme_object("tag_list", "TagListTheme");
if($event instanceof InitExtEvent) { if($event instanceof InitExtEvent) {

View File

@ -1,7 +1,7 @@
<?php <?php
class Upgrade extends Extension { class Upgrade implements Extension {
public function receive_event($event) { public function receive_event(Event $event) {
if($event instanceof InitExtEvent) { if($event instanceof InitExtEvent) {
$this->do_things(); $this->do_things();
} }

View File

@ -1,9 +1,9 @@
<?php <?php
class Upload extends Extension { class Upload implements Extension {
var $theme; var $theme;
// event handling {{{ // event handling {{{
public function receive_event($event) { public function receive_event(Event $event) {
if(is_null($this->theme)) $this->theme = get_theme_object("upload", "UploadTheme"); if(is_null($this->theme)) $this->theme = get_theme_object("upload", "UploadTheme");
$is_full = (disk_free_space("./images/") < 100*1024*1024); $is_full = (disk_free_space("./images/") < 100*1024*1024);

View File

@ -36,11 +36,11 @@ class UserCreationEvent extends Event {
} }
} }
class UserPage extends Extension { class UserPage implements Extension {
var $theme; var $theme;
// event handling {{{ // event handling {{{
public function receive_event($event) { public function receive_event(Event $event) {
if(is_null($this->theme)) $this->theme = get_theme_object("user", "UserPageTheme"); if(is_null($this->theme)) $this->theme = get_theme_object("user", "UserPageTheme");
if($event instanceof InitExtEvent) { if($event instanceof InitExtEvent) {

View File

@ -39,10 +39,10 @@ class ImageAdminBlockBuildingEvent extends Event {
$this->parts[$position] = $html; $this->parts[$position] = $html;
} }
} }
class ViewImage extends Extension { class ViewImage implements Extension {
var $theme; var $theme;
public function receive_event($event) { public function receive_event(Event $event) {
if(is_null($this->theme)) $this->theme = get_theme_object("view", "ViewTheme"); if(is_null($this->theme)) $this->theme = get_theme_object("view", "ViewTheme");
if(($event instanceof PageRequestEvent) && ($event->page_name == "post") && ($event->get_arg(0) == "view")) { if(($event instanceof PageRequestEvent) && ($event->page_name == "post") && ($event->get_arg(0) == "view")) {