[everything] bulk set event handler return types to void

This commit is contained in:
Shish 2024-01-15 11:52:35 +00:00
parent 985d34aedd
commit bb9ab613ce
106 changed files with 591 additions and 591 deletions

View file

@ -267,7 +267,7 @@ abstract class ExtensionInfo
*/
abstract class FormatterExtension extends Extension
{
public function onTextFormatting(TextFormattingEvent $event)
public function onTextFormatting(TextFormattingEvent $event): void
{
$event->formatted = $this->format($event->formatted);
$event->stripped = $this->strip($event->stripped);
@ -287,7 +287,7 @@ abstract class DataHandlerExtension extends Extension
{
protected array $SUPPORTED_MIME = [];
public function onDataUpload(DataUploadEvent $event)
public function onDataUpload(DataUploadEvent $event): void
{
global $config;
@ -349,7 +349,7 @@ abstract class DataHandlerExtension extends Extension
}
}
public function onThumbnailGeneration(ThumbnailGenerationEvent $event)
public function onThumbnailGeneration(ThumbnailGenerationEvent $event): void
{
$result = false;
if ($this->supported_mime($event->image->get_mime())) {
@ -368,7 +368,7 @@ abstract class DataHandlerExtension extends Extension
}
}
public function onDisplayingImage(DisplayingImageEvent $event)
public function onDisplayingImage(DisplayingImageEvent $event): void
{
global $config, $page;
if ($this->supported_mime($event->image->get_mime())) {
@ -380,7 +380,7 @@ abstract class DataHandlerExtension extends Extension
}
}
public function onMediaCheckProperties(MediaCheckPropertiesEvent $event)
public function onMediaCheckProperties(MediaCheckPropertiesEvent $event): void
{
if ($this->supported_mime($event->image->get_mime())) {
$this->media_check_properties($event);

View file

@ -39,7 +39,7 @@ class AdminPage extends Extension
/** @var AdminPageTheme */
protected Themelet $theme;
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $database, $page, $user;
@ -69,7 +69,7 @@ class AdminPage extends Extension
}
}
public function onCliGen(CliGenEvent $event)
public function onCliGen(CliGenEvent $event): void
{
$event->app->register('page:get')
->addArgument('query', InputArgument::REQUIRED)
@ -155,12 +155,12 @@ class AdminPage extends Extension
});
}
public function onAdminBuilding(AdminBuildingEvent $event)
public function onAdminBuilding(AdminBuildingEvent $event): void
{
$this->theme->display_page();
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
global $user;
if ($event->parent === "system") {
@ -170,7 +170,7 @@ class AdminPage extends Extension
}
}
public function onUserBlockBuilding(UserBlockBuildingEvent $event)
public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::MANAGE_ADMINTOOLS)) {

View file

@ -61,7 +61,7 @@ class AliasEditor extends Extension
/** @var AliasEditorTheme */
protected Themelet $theme;
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $config, $database, $page, $user;
@ -120,7 +120,7 @@ class AliasEditor extends Extension
}
}
public function onAddAlias(AddAliasEvent $event)
public function onAddAlias(AddAliasEvent $event): void
{
global $database;
@ -147,21 +147,21 @@ class AliasEditor extends Extension
log_info("alias_editor", "Added alias for {$event->oldtag} -> {$event->newtag}", "Added alias");
}
public function onDeleteAlias(DeleteAliasEvent $event)
public function onDeleteAlias(DeleteAliasEvent $event): void
{
global $database;
$database->execute("DELETE FROM aliases WHERE oldtag=:oldtag", ["oldtag" => $event->oldtag]);
log_info("alias_editor", "Deleted alias for {$event->oldtag}", "Deleted alias");
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
if ($event->parent == "tags") {
$event->add_nav_link("aliases", new Link('alias/list'), "Aliases", NavLink::is_active(["alias"]));
}
}
public function onUserBlockBuilding(UserBlockBuildingEvent $event)
public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::MANAGE_ALIAS_LIST)) {

View file

@ -16,7 +16,7 @@ class Approval extends Extension
/** @var ApprovalTheme */
protected Themelet $theme;
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
global $config;
@ -26,7 +26,7 @@ class Approval extends Extension
Image::$bool_props[] = "approved";
}
public function onImageAddition(ImageAdditionEvent $event)
public function onImageAddition(ImageAdditionEvent $event): void
{
global $user, $config;
@ -35,7 +35,7 @@ class Approval extends Extension
}
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user;
@ -70,17 +70,17 @@ class Approval extends Extension
}
}
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
$this->theme->display_admin_block($event);
}
public function onAdminBuilding(AdminBuildingEvent $event)
public function onAdminBuilding(AdminBuildingEvent $event): void
{
$this->theme->display_admin_form();
}
public function onAdminAction(AdminActionEvent $event)
public function onAdminAction(AdminActionEvent $event): void
{
global $database, $user;
@ -110,7 +110,7 @@ class Approval extends Extension
}
}
public function onDisplayingImage(DisplayingImageEvent $event)
public function onDisplayingImage(DisplayingImageEvent $event): void
{
global $page;
@ -120,7 +120,7 @@ class Approval extends Extension
}
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
global $user;
if ($event->parent == "posts") {
@ -130,7 +130,7 @@ class Approval extends Extension
}
}
public function onUserBlockBuilding(UserBlockBuildingEvent $event)
public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::APPROVE_IMAGE)) {
@ -139,7 +139,7 @@ class Approval extends Extension
}
public const SEARCH_REGEXP = "/^approved:(yes|no)/";
public function onSearchTermParse(SearchTermParseEvent $event)
public function onSearchTermParse(SearchTermParseEvent $event): void
{
global $user, $config;
@ -163,7 +163,7 @@ class Approval extends Extension
}
}
public function onHelpPageBuilding(HelpPageBuildingEvent $event)
public function onHelpPageBuilding(HelpPageBuildingEvent $event): void
{
global $user, $config;
if ($event->key === HelpPages::SEARCH) {
@ -214,7 +214,7 @@ class Approval extends Extension
return true;
}
public function onImageDownloading(ImageDownloadingEvent $event)
public function onImageDownloading(ImageDownloadingEvent $event): void
{
/**
* Deny images upon insufficient permissions.
@ -224,7 +224,7 @@ class Approval extends Extension
}
}
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event): void
{
global $user, $config;
if ($user->can(Permissions::APPROVE_IMAGE) && $config->get_bool(ApprovalConfig::IMAGES)) {
@ -232,7 +232,7 @@ class Approval extends Extension
}
}
public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event)
public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event): void
{
global $user, $config;
@ -245,7 +245,7 @@ class Approval extends Extension
}
}
public function onBulkAction(BulkActionEvent $event)
public function onBulkAction(BulkActionEvent $event): void
{
global $page, $user;
@ -273,7 +273,7 @@ class Approval extends Extension
}
}
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;

View file

@ -24,7 +24,7 @@ class Artists extends Extension
/** @var ArtistsTheme */
protected Themelet $theme;
public function onImageInfoSet(ImageInfoSetEvent $event)
public function onImageInfoSet(ImageInfoSetEvent $event): void
{
global $user;
if ($user->can(Permissions::EDIT_IMAGE_ARTIST) && isset($_POST["tag_edit__author"])) {
@ -32,7 +32,7 @@ class Artists extends Extension
}
}
public function onImageInfoBoxBuilding(ImageInfoBoxBuildingEvent $event)
public function onImageInfoBoxBuilding(ImageInfoBoxBuildingEvent $event): void
{
global $user;
$artistName = $this->get_artistName_by_imageID($event->image->id);
@ -41,7 +41,7 @@ class Artists extends Extension
}
}
public function onSearchTermParse(SearchTermParseEvent $event)
public function onSearchTermParse(SearchTermParseEvent $event): void
{
if (is_null($event->term)) {
return;
@ -54,14 +54,14 @@ class Artists extends Extension
}
}
public function onHelpPageBuilding(HelpPageBuildingEvent $event)
public function onHelpPageBuilding(HelpPageBuildingEvent $event): void
{
if ($event->key === HelpPages::SEARCH) {
$event->add_block(new Block("Artist", $this->theme->get_help_html()));
}
}
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $config, $database;
@ -113,7 +113,7 @@ class Artists extends Extension
}
}
public function onAuthorSet(AuthorSetEvent $event)
public function onAuthorSet(AuthorSetEvent $event): void
{
global $database;
@ -154,7 +154,7 @@ class Artists extends Extension
);
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user;

View file

@ -67,7 +67,7 @@ class AutoTagger extends Extension
/** @var AutoTaggerTheme */
protected Themelet $theme;
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $config, $database, $page, $user;
@ -126,14 +126,14 @@ class AutoTagger extends Extension
}
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
if ($event->parent == "tags") {
$event->add_nav_link("auto_tag", new Link('auto_tag/list'), "Auto-Tag", NavLink::is_active(["auto_tag"]));
}
}
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;
@ -153,7 +153,7 @@ class AutoTagger extends Extension
}
}
public function onTagSet(TagSetEvent $event)
public function onTagSet(TagSetEvent $event): void
{
$results = $this->apply_auto_tags($event->new_tags);
if (!empty($results)) {
@ -161,19 +161,19 @@ class AutoTagger extends Extension
}
}
public function onAddAutoTag(AddAutoTagEvent $event)
public function onAddAutoTag(AddAutoTagEvent $event): void
{
global $page;
$this->add_auto_tag($event->tag, $event->additional_tags);
$page->flash("Added Auto-Tag");
}
public function onDeleteAutoTag(DeleteAutoTagEvent $event)
public function onDeleteAutoTag(DeleteAutoTagEvent $event): void
{
$this->remove_auto_tag($event->tag);
}
public function onUserBlockBuilding(UserBlockBuildingEvent $event)
public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::MANAGE_AUTO_TAG)) {

View file

@ -11,7 +11,7 @@ class AutoComplete extends Extension
return 30;
} // before Home
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $page;

View file

@ -6,7 +6,7 @@ namespace Shimmie2;
class BanWords extends Extension
{
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_string('banned_words', "
@ -39,7 +39,7 @@ xanax
");
}
public function onCommentPosting(CommentPostingEvent $event)
public function onCommentPosting(CommentPostingEvent $event): void
{
global $user;
if (!$user->can(Permissions::BYPASS_COMMENT_CHECKS)) {
@ -47,17 +47,17 @@ xanax
}
}
public function onSourceSet(SourceSetEvent $event)
public function onSourceSet(SourceSetEvent $event): void
{
$this->test_text($event->source, new SCoreException("Source contains banned terms"));
}
public function onTagSet(TagSetEvent $event)
public function onTagSet(TagSetEvent $event): void
{
$this->test_text(Tag::implode($event->new_tags), new SCoreException("Tags contain banned terms"));
}
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Banned Phrases");
$sb->add_label("One per line, lines that start with slashes are treated as regex<br/>");

View file

@ -9,7 +9,7 @@ class Biography extends Extension
/** @var BiographyTheme */
protected Themelet $theme;
public function onUserPageBuilding(UserPageBuildingEvent $event)
public function onUserPageBuilding(UserPageBuildingEvent $event): void
{
global $page, $user;
$duser = $event->display_user;
@ -23,7 +23,7 @@ class Biography extends Extension
}
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user, $user_config;
if ($event->page_matches("biography")) {

View file

@ -9,7 +9,7 @@ class Blocks extends Extension
/** @var BlocksTheme */
protected Themelet $theme;
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;
if ($this->get_version("ext_blocks_version") < 1) {
@ -31,7 +31,7 @@ class Blocks extends Extension
}
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
global $user;
if ($event->parent === "system") {
@ -41,7 +41,7 @@ class Blocks extends Extension
}
}
public function onUserBlockBuilding(UserBlockBuildingEvent $event)
public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::MANAGE_BLOCKS)) {
@ -49,7 +49,7 @@ class Blocks extends Extension
}
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $cache, $database, $page, $user;

View file

@ -9,7 +9,7 @@ class Blotter extends Extension
/** @var BlotterTheme */
protected Themelet $theme;
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_int("blotter_recent", 5);
@ -17,7 +17,7 @@ class Blotter extends Extension
$config->set_default_string("blotter_position", "subheading");
}
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;
@ -42,7 +42,7 @@ class Blotter extends Extension
}
}
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Blotter");
$sb->add_int_option("blotter_recent", "<br />Number of recent entries to display: ");
@ -50,7 +50,7 @@ class Blotter extends Extension
$sb->add_choice_option("blotter_position", ["Top of page" => "subheading", "In navigation bar" => "left"], "<br>Position: ");
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
global $user;
if ($event->parent === "system") {
@ -61,7 +61,7 @@ class Blotter extends Extension
}
public function onUserBlockBuilding(UserBlockBuildingEvent $event)
public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::BLOTTER_ADMIN)) {
@ -69,7 +69,7 @@ class Blotter extends Extension
}
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $page, $database, $user;
if ($event->page_matches("blotter") && $event->count_args() > 0) {

View file

@ -6,13 +6,13 @@ namespace Shimmie2;
class BrowserSearch extends Extension
{
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_string("search_suggestions_results_order", 'a');
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $config, $database, $page;
@ -75,7 +75,7 @@ class BrowserSearch extends Extension
}
}
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sort_by = [];
$sort_by['Alphabetical'] = 'a';

View file

@ -57,7 +57,7 @@ class BulkActions extends Extension
/** @var BulkActionsTheme */
protected Themelet $theme;
public function onPostListBuilding(PostListBuildingEvent $event)
public function onPostListBuilding(PostListBuildingEvent $event): void
{
global $page, $user;
@ -77,7 +77,7 @@ class BulkActions extends Extension
}
}
public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event)
public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event): void
{
global $user;
@ -101,7 +101,7 @@ class BulkActions extends Extension
}
}
public function onCliGen(CliGenEvent $event)
public function onCliGen(CliGenEvent $event): void
{
$event->app->register('bulk-action')
->addArgument('action', InputArgument::REQUIRED)
@ -117,7 +117,7 @@ class BulkActions extends Extension
});
}
public function onBulkAction(BulkActionEvent $event)
public function onBulkAction(BulkActionEvent $event): void
{
global $page, $user;
@ -156,7 +156,7 @@ class BulkActions extends Extension
}
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user;
if ($event->page_matches("bulk_action") && $user->can(Permissions::PERFORM_BULK_ACTIONS)) {

View file

@ -27,7 +27,7 @@ class BulkAdd extends Extension
/** @var BulkAddTheme */
protected Themelet $theme;
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user;
if ($event->page_matches("bulk_add")) {
@ -39,7 +39,7 @@ class BulkAdd extends Extension
}
}
public function onCliGen(CliGenEvent $event)
public function onCliGen(CliGenEvent $event): void
{
$event->app->register('bulk-add')
->addArgument('directory', InputArgument::REQUIRED)
@ -58,12 +58,12 @@ class BulkAdd extends Extension
});
}
public function onAdminBuilding(AdminBuildingEvent $event)
public function onAdminBuilding(AdminBuildingEvent $event): void
{
$this->theme->display_admin_block();
}
public function onBulkAdd(BulkAddEvent $event)
public function onBulkAdd(BulkAddEvent $event): void
{
if (is_dir($event->dir) && is_readable($event->dir)) {
$event->results = add_dir($event->dir);

View file

@ -13,7 +13,7 @@ class BulkAddCSV extends Extension
/** @var BulkAddCSVTheme */
protected Themelet $theme;
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user;
if ($event->page_matches("bulk_add_csv")) {
@ -25,7 +25,7 @@ class BulkAddCSV extends Extension
}
}
public function onCliGen(CliGenEvent $event)
public function onCliGen(CliGenEvent $event): void
{
$event->app->register('bulk-add-csv')
->addArgument('path-to-csv', InputArgument::REQUIRED)
@ -43,7 +43,7 @@ class BulkAddCSV extends Extension
});
}
public function onAdminBuilding(AdminBuildingEvent $event)
public function onAdminBuilding(AdminBuildingEvent $event): void
{
$this->theme->display_admin_block();
}

View file

@ -17,13 +17,13 @@ class BulkDownload extends Extension
{
private const DOWNLOAD_ACTION_NAME = "bulk_download";
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_int(BulkDownloadConfig::SIZE_LIMIT, parse_shorthand_int('100MB'));
}
public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event)
public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event): void
{
global $user;
@ -32,7 +32,7 @@ class BulkDownload extends Extension
}
}
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Bulk Download");
@ -41,7 +41,7 @@ class BulkDownload extends Extension
$sb->end_table();
}
public function onBulkAction(BulkActionEvent $event)
public function onBulkAction(BulkActionEvent $event): void
{
global $user, $page, $config;

View file

@ -11,7 +11,7 @@ class BulkImportExport extends DataHandlerExtension
protected array $SUPPORTED_MIME = [MimeType::ZIP];
public function onDataUpload(DataUploadEvent $event)
public function onDataUpload(DataUploadEvent $event): void
{
global $user, $database;
@ -89,7 +89,7 @@ class BulkImportExport extends DataHandlerExtension
}
}
public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event)
public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event): void
{
global $user;
@ -98,7 +98,7 @@ class BulkImportExport extends DataHandlerExtension
}
}
public function onBulkAction(BulkActionEvent $event)
public function onBulkAction(BulkActionEvent $event): void
{
global $user, $page;

View file

@ -15,7 +15,7 @@ class BulkParentChild extends Extension
{
private const PARENT_CHILD_ACTION_NAME = "bulk_parent_child";
public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event)
public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event): void
{
global $user;
@ -24,7 +24,7 @@ class BulkParentChild extends Extension
}
}
public function onBulkAction(BulkActionEvent $event)
public function onBulkAction(BulkActionEvent $event): void
{
global $user, $page, $config;
if ($user->can(Permissions::BULK_PARENT_CHILD) &&

View file

@ -116,7 +116,7 @@ class CommentList extends Extension
/** @var CommentListTheme $theme */
public Themelet $theme;
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_int('comment_window', 5);
@ -126,7 +126,7 @@ class CommentList extends Extension
$config->set_default_bool('comment_captcha', false);
}
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;
if ($this->get_version("ext_comments_version") < 3) {
@ -179,13 +179,13 @@ class CommentList extends Extension
}
public function onPageNavBuilding(PageNavBuildingEvent $event)
public function onPageNavBuilding(PageNavBuildingEvent $event): void
{
$event->add_nav_link("comment", new Link('comment/list'), "Comments");
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
if ($event->parent == "comment") {
$event->add_nav_link("comment_list", new Link('comment/list'), "All");
@ -193,7 +193,7 @@ class CommentList extends Extension
}
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
if ($event->page_matches("comment")) {
switch ($event->get_arg(0)) {
@ -216,7 +216,7 @@ class CommentList extends Extension
}
}
public function onRobotsBuilding(RobotsBuildingEvent $event)
public function onRobotsBuilding(RobotsBuildingEvent $event): void
{
// comment lists change all the time, crawlers should
// index individual image's comments
@ -344,12 +344,12 @@ class CommentList extends Extension
$this->theme->display_all_user_comments($comments, $page_num + 1, $total_pages, $duser);
}
public function onAdminBuilding(AdminBuildingEvent $event)
public function onAdminBuilding(AdminBuildingEvent $event): void
{
$this->theme->display_admin_block();
}
public function onPostListBuilding(PostListBuildingEvent $event)
public function onPostListBuilding(PostListBuildingEvent $event): void
{
global $cache, $config;
$cc = $config->get_int("comment_count");
@ -361,7 +361,7 @@ class CommentList extends Extension
}
}
public function onUserPageBuilding(UserPageBuildingEvent $event)
public function onUserPageBuilding(UserPageBuildingEvent $event): void
{
$i_days_old = ((time() - strtotime($event->display_user->join_date)) / 86400) + 1;
$i_comment_count = Comment::count_comments_by_user($event->display_user);
@ -372,7 +372,7 @@ class CommentList extends Extension
$this->theme->display_recent_user_comments($recent, $event->display_user);
}
public function onDisplayingImage(DisplayingImageEvent $event)
public function onDisplayingImage(DisplayingImageEvent $event): void
{
global $user;
$this->theme->display_image_comments(
@ -383,12 +383,12 @@ class CommentList extends Extension
}
// TODO: split akismet into a separate class, which can veto the event
public function onCommentPosting(CommentPostingEvent $event)
public function onCommentPosting(CommentPostingEvent $event): void
{
$this->add_comment_wrapper($event->image_id, $event->user, $event->comment);
}
public function onCommentDeletion(CommentDeletionEvent $event)
public function onCommentDeletion(CommentDeletionEvent $event): void
{
global $database;
$database->execute("
@ -398,7 +398,7 @@ class CommentList extends Extension
log_info("comment", "Deleting Comment #{$event->comment_id}");
}
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Comment Options");
$sb->add_bool_option("comment_captcha", "Require CAPTCHA for anonymous comments: ");
@ -417,7 +417,7 @@ class CommentList extends Extension
$sb->add_bool_option("comment_samefags_public");
}
public function onSearchTermParse(SearchTermParseEvent $event)
public function onSearchTermParse(SearchTermParseEvent $event): void
{
if (is_null($event->term)) {
return;
@ -437,7 +437,7 @@ class CommentList extends Extension
}
}
public function onHelpPageBuilding(HelpPageBuildingEvent $event)
public function onHelpPageBuilding(HelpPageBuildingEvent $event): void
{
if ($event->key === HelpPages::SEARCH) {
$block = new Block();

View file

@ -21,7 +21,7 @@ class CronUploader extends Extension
private static bool $IMPORT_RUNNING = false;
public function onInitUserConfig(InitUserConfigEvent $event)
public function onInitUserConfig(InitUserConfigEvent $event): void
{
$event->user_config->set_default_string(
CronUploaderConfig::DIR,
@ -32,7 +32,7 @@ class CronUploader extends Extension
$event->user_config->set_default_int(CronUploaderConfig::LOG_LEVEL, SCORE_LOG_INFO);
}
public function onUserOptionsBuilding(UserOptionsBuildingEvent $event)
public function onUserOptionsBuilding(UserOptionsBuildingEvent $event): void
{
if ($event->user->can(Permissions::CRON_ADMIN)) {
$documentation_link = make_http(make_link("cron_upload"));
@ -55,7 +55,7 @@ class CronUploader extends Extension
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
if ($event->parent == "system") {
$event->add_nav_link("cron_docs", new Link('cron_upload'), "Cron Upload");
@ -66,7 +66,7 @@ class CronUploader extends Extension
* Checks if the cron upload page has been accessed
* and initializes the upload.
*/
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $user;
@ -79,7 +79,7 @@ class CronUploader extends Extension
}
}
public function onAdminBuilding(AdminBuildingEvent $event)
public function onAdminBuilding(AdminBuildingEvent $event): void
{
$failed_dir = $this->get_failed_dir();
$results = get_dir_contents($failed_dir);
@ -95,7 +95,7 @@ class CronUploader extends Extension
$this->theme->display_form($failed_dirs);
}
public function onAdminAction(AdminActionEvent $event)
public function onAdminAction(AdminActionEvent $event): void
{
$action = $event->action;
switch ($action) {
@ -120,7 +120,7 @@ class CronUploader extends Extension
}
}
public function onLog(LogEvent $event)
public function onLog(LogEvent $event): void
{
global $user_config;

View file

@ -7,7 +7,7 @@ namespace Shimmie2;
class CustomHtmlHeaders extends Extension
{
# Adds setup block for custom <head> content
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Custom HTML Headers");
@ -25,14 +25,14 @@ class CustomHtmlHeaders extends Extension
], "<br>Add website name in title");
}
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_string("sitename_in_title", "none");
}
# Load Analytics tracking code on page request
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
$this->handle_custom_html_headers();
$this->handle_modified_page_title();

View file

@ -26,7 +26,7 @@ function POST(...$args): HTMLElement
class DanbooruApi extends Extension
{
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
if ($event->page_matches("api/danbooru")) {
global $page;

View file

@ -14,7 +14,7 @@ class Download extends Extension
return 99;
}
public function onImageDownloading(ImageDownloadingEvent $event)
public function onImageDownloading(ImageDownloadingEvent $event): void
{
global $page;

View file

@ -14,14 +14,14 @@ class Downtime extends Extension
return 10;
}
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Downtime");
$sb->add_bool_option("downtime", "Disable non-admin access: ");
$sb->add_longtext_option("downtime_message", "<br>");
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $config, $page, $user;

View file

@ -12,7 +12,7 @@ class EmoticonList extends Extension
/** @var EmoticonListTheme */
protected Themelet $theme;
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
if ($event->page_matches("emote/list")) {
$this->theme->display_emotes(glob("ext/emoticons/default/*"));

View file

@ -11,7 +11,7 @@ class Eokm extends Extension
return 40;
} // early, to veto ImageUploadEvent
public function onImageAddition(ImageAdditionEvent $event)
public function onImageAddition(ImageAdditionEvent $event): void
{
global $config;
$username = $config->get_string("eokm_username");
@ -41,7 +41,7 @@ class Eokm extends Extension
}
}
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("EOKM Filter");

View file

@ -13,7 +13,7 @@ class ET extends Extension
/** @var ETTheme */
protected Themelet $theme;
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $user;
if ($event->page_matches("system_info")) {
@ -23,7 +23,7 @@ class ET extends Extension
}
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
global $user;
if ($event->parent === "system") {
@ -33,7 +33,7 @@ class ET extends Extension
}
}
public function onUserBlockBuilding(UserBlockBuildingEvent $event)
public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::VIEW_SYSINTO)) {
@ -41,7 +41,7 @@ class ET extends Extension
}
}
public function onCliGen(CliGenEvent $event)
public function onCliGen(CliGenEvent $event): void
{
$event->app->register('info')
->setDescription('List a bunch of info')

View file

@ -8,7 +8,7 @@ use function MicroHTML\{PRE};
class ETServer extends Extension
{
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $database, $page, $user;
if ($event->page_matches("register.php")) {
@ -36,7 +36,7 @@ class ETServer extends Extension
}
}
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;

View file

@ -25,7 +25,7 @@ class ExtManager extends Extension
/** @var ExtManagerTheme */
protected Themelet $theme;
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user;
if ($event->page_matches("ext_manager")) {
@ -64,7 +64,7 @@ class ExtManager extends Extension
}
}
public function onCliGen(CliGenEvent $event)
public function onCliGen(CliGenEvent $event): void
{
$event->app->register('disable-all-ext')
->setDescription('Disable all extensions')
@ -74,7 +74,7 @@ class ExtManager extends Extension
});
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
global $user;
if ($event->parent === "system") {
@ -86,7 +86,7 @@ class ExtManager extends Extension
}
}
public function onUserBlockBuilding(UserBlockBuildingEvent $event)
public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::MANAGE_EXTENSION_LIST)) {

View file

@ -27,7 +27,7 @@ class Favorites extends Extension
/** @var FavoritesTheme */
protected Themelet $theme;
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event): void
{
global $database, $user;
if (!$user->is_anonymous()) {
@ -43,7 +43,7 @@ class Favorites extends Extension
}
}
public function onDisplayingImage(DisplayingImageEvent $event)
public function onDisplayingImage(DisplayingImageEvent $event): void
{
$people = $this->list_persons_who_have_favorited($event->image);
if (count($people) > 0) {
@ -51,7 +51,7 @@ class Favorites extends Extension
}
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user;
if ($event->page_matches("change_favorite") && !$user->is_anonymous() && $user->check_auth_token()) {
@ -70,7 +70,7 @@ class Favorites extends Extension
}
}
public function onUserPageBuilding(UserPageBuildingEvent $event)
public function onUserPageBuilding(UserPageBuildingEvent $event): void
{
$i_favorites_count = Search::count_images(["favorited_by={$event->display_user->name}"]);
$i_days_old = ((time() - strtotime($event->display_user->join_date)) / 86400) + 1;
@ -79,7 +79,7 @@ class Favorites extends Extension
$event->add_stats("<a href='$favorites_link'>Posts favorited</a>: $i_favorites_count, $h_favorites_rate per day");
}
public function onImageInfoSet(ImageInfoSetEvent $event)
public function onImageInfoSet(ImageInfoSetEvent $event): void
{
global $user;
if (
@ -91,7 +91,7 @@ class Favorites extends Extension
}
}
public function onFavoriteSet(FavoriteSetEvent $event)
public function onFavoriteSet(FavoriteSetEvent $event): void
{
global $user;
$this->add_vote($event->image_id, $user->id, $event->do_set);
@ -99,18 +99,18 @@ class Favorites extends Extension
// FIXME: this should be handled by the foreign key. Check that it
// is, and then remove this
public function onImageDeletion(ImageDeletionEvent $event)
public function onImageDeletion(ImageDeletionEvent $event): void
{
global $database;
$database->execute("DELETE FROM user_favorites WHERE image_id=:image_id", ["image_id" => $event->image->id]);
}
public function onParseLinkTemplate(ParseLinkTemplateEvent $event)
public function onParseLinkTemplate(ParseLinkTemplateEvent $event): void
{
$event->replace('$favorites', (string)$event->image->favorites);
}
public function onUserBlockBuilding(UserBlockBuildingEvent $event)
public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
global $user;
@ -118,7 +118,7 @@ class Favorites extends Extension
$event->add_link("My Favorites", search_link(["favorited_by=$username"]), 20);
}
public function onSearchTermParse(SearchTermParseEvent $event)
public function onSearchTermParse(SearchTermParseEvent $event): void
{
if (is_null($event->term)) {
return;
@ -142,14 +142,14 @@ class Favorites extends Extension
}
}
public function onHelpPageBuilding(HelpPageBuildingEvent $event)
public function onHelpPageBuilding(HelpPageBuildingEvent $event): void
{
if ($event->key === HelpPages::SEARCH) {
$event->add_block(new Block("Favorites", $this->theme->get_help_html()));
}
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
global $user;
if ($event->parent == "posts") {
@ -164,7 +164,7 @@ class Favorites extends Extension
}
}
public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event)
public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event): void
{
global $user;
@ -174,7 +174,7 @@ class Favorites extends Extension
}
}
public function onBulkAction(BulkActionEvent $event)
public function onBulkAction(BulkActionEvent $event): void
{
global $page, $user;
@ -202,7 +202,7 @@ class Favorites extends Extension
}
}
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;

View file

@ -9,13 +9,13 @@ class Featured extends Extension
/** @var FeaturedTheme */
protected Themelet $theme;
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_int('featured_id', 0);
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $config, $page, $user;
if ($event->page_matches("featured_image")) {
@ -47,7 +47,7 @@ class Featured extends Extension
}
}
public function onPostListBuilding(PostListBuildingEvent $event)
public function onPostListBuilding(PostListBuildingEvent $event): void
{
global $cache, $config, $page, $user;
$fid = $config->get_int("featured_id");
@ -74,7 +74,7 @@ class Featured extends Extension
}
}
public function onImageDeletion(ImageDeletionEvent $event)
public function onImageDeletion(ImageDeletionEvent $event): void
{
global $config;
if ($event->image->id == $config->get_int("featured_id")) {
@ -83,7 +83,7 @@ class Featured extends Extension
}
}
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::EDIT_FEATURE) && $event->context == "view") {

View file

@ -17,7 +17,7 @@ class Forum extends Extension
/** @var ForumTheme */
protected Themelet $theme;
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $config, $database;
@ -65,7 +65,7 @@ class Forum extends Extension
}
}
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Forum");
$sb->add_int_option("forumTitleSubString", "Title max long: ");
@ -75,7 +75,7 @@ class Forum extends Extension
$sb->add_int_option("forumMaxCharsPerPost", "<br>Max chars per post: ");
}
public function onUserPageBuilding(UserPageBuildingEvent $event)
public function onUserPageBuilding(UserPageBuildingEvent $event): void
{
global $database;
@ -91,12 +91,12 @@ class Forum extends Extension
$event->add_stats("Forum posts: $posts_count, $posts_rate per day");
}
public function onPageNavBuilding(PageNavBuildingEvent $event)
public function onPageNavBuilding(PageNavBuildingEvent $event): void
{
$event->add_nav_link("forum", new Link('forum/index'), "Forum");
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user;

View file

@ -6,7 +6,7 @@ namespace Shimmie2;
class FourOhFour extends Extension
{
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $page;
// hax.

View file

@ -7,7 +7,7 @@ namespace Shimmie2;
class GoogleAnalytics extends Extension
{
# Add analytics to config
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Google Analytics");
$sb->add_text_option("google_analytics_id", "Analytics ID: ");
@ -15,7 +15,7 @@ class GoogleAnalytics extends Extension
}
# Load Analytics tracking code on page request
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $config, $page;

View file

@ -74,14 +74,14 @@ class GraphQL extends Extension
}
}
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_string('graphql_cors_pattern', "");
$config->set_default_bool('graphql_debug', false);
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $config, $page;
if ($event->page_matches("graphql")) {
@ -177,7 +177,7 @@ class GraphQL extends Extension
return ["image_ids" => array_map(fn ($im) => $im->id, $event->images)];
}
public function onCliGen(CliGenEvent $event)
public function onCliGen(CliGenEvent $event): void
{
$event->app->register('graphql:query')
->addArgument('query', InputArgument::REQUIRED)

View file

@ -8,13 +8,13 @@ class ArchiveFileHandler extends DataHandlerExtension
{
protected array $SUPPORTED_MIME = [MimeType::ZIP];
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_string('archive_extract_command', 'unzip -d "%d" "%f"');
}
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Archive Handler Options");
$sb->add_text_option("archive_tmp_dir", "Temporary folder: ");
@ -22,7 +22,7 @@ class ArchiveFileHandler extends DataHandlerExtension
$sb->add_label("<br>%f for archive, %d for temporary directory");
}
public function onDataUpload(DataUploadEvent $event)
public function onDataUpload(DataUploadEvent $event): void
{
if ($this->supported_mime($event->mime)) {
global $config, $page;
@ -50,7 +50,7 @@ class ArchiveFileHandler extends DataHandlerExtension
}
}
public function onDisplayingImage(DisplayingImageEvent $event)
public function onDisplayingImage(DisplayingImageEvent $event): void
{
}

View file

@ -52,7 +52,7 @@ class PixelFileHandler extends DataHandlerExtension
}
}
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event): void
{
if ($event->context == "view") {
$event->add_part("

View file

@ -13,7 +13,7 @@ class SVGFileHandler extends DataHandlerExtension
/** @var SVGFileHandlerTheme */
protected Themelet $theme;
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $page;
if ($event->page_matches("get_svg")) {
@ -32,7 +32,7 @@ class SVGFileHandler extends DataHandlerExtension
}
}
public function onDataUpload(DataUploadEvent $event)
public function onDataUpload(DataUploadEvent $event): void
{
global $config;

View file

@ -26,7 +26,7 @@ class VideoFileHandler extends DataHandlerExtension
];
protected array $SUPPORTED_MIME = self::SUPPORTED_MIME;
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
global $config;
@ -48,7 +48,7 @@ class VideoFileHandler extends DataHandlerExtension
return $output;
}
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Video Options");
$sb->start_table();

View file

@ -40,7 +40,7 @@ class HelpPages extends Extension
protected Themelet $theme;
public const SEARCH = "search";
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $page;
@ -74,18 +74,18 @@ class HelpPages extends Extension
}
}
public function onHelpPageListBuilding(HelpPageListBuildingEvent $event)
public function onHelpPageListBuilding(HelpPageListBuildingEvent $event): void
{
$event->add_page("search", "Searching");
$event->add_page("licenses", "Licenses");
}
public function onPageNavBuilding(PageNavBuildingEvent $event)
public function onPageNavBuilding(PageNavBuildingEvent $event): void
{
$event->add_nav_link("help", new Link('help'), "Help");
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
if ($event->parent == "help") {
$pages = send_event(new HelpPageListBuildingEvent())->pages;
@ -95,12 +95,12 @@ class HelpPages extends Extension
}
}
public function onUserBlockBuilding(UserBlockBuildingEvent $event)
public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
$event->add_link("Help", make_link("help"));
}
public function onHelpPageBuilding(HelpPageBuildingEvent $event)
public function onHelpPageBuilding(HelpPageBuildingEvent $event): void
{
if ($event->key == "licenses") {
$block = new Block("Software Licenses");

View file

@ -9,19 +9,19 @@ class Holiday extends Extension
/** @var HolidayTheme */
protected Themelet $theme;
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_bool("holiday_aprilfools", false);
}
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Holiday Theme");
$sb->add_bool_option("holiday_aprilfools", "Enable April Fools");
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $config;
if (date('d/m') == '01/04' && $config->get_bool("holiday_aprilfools")) {

View file

@ -9,7 +9,7 @@ class Home extends Extension
/** @var HomeTheme */
protected Themelet $theme;
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $config, $page;
if ($event->page_matches("home")) {
@ -23,7 +23,7 @@ class Home extends Extension
}
}
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
$counters = [];
$counters["None"] = "none";

View file

@ -40,7 +40,7 @@ class ImageIO extends Extension
'WEBP (Not IE compatible)' => MimeType::WEBP
];
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_string(ImageConfig::THUMB_ENGINE, MediaEngine::GD);
@ -62,7 +62,7 @@ class ImageIO extends Extension
$config->set_default_int(ImageConfig::EXPIRES, (60 * 60 * 24 * 31)); // defaults to one month
}
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $config;
@ -81,7 +81,7 @@ class ImageIO extends Extension
}
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $config, $page;
@ -113,7 +113,7 @@ class ImageIO extends Extension
}
}
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event): void
{
global $user;
@ -122,7 +122,7 @@ class ImageIO extends Extension
}
}
public function onCliGen(CliGenEvent $event)
public function onCliGen(CliGenEvent $event): void
{
$event->app->register('delete')
->addArgument('id', InputArgument::REQUIRED)
@ -135,18 +135,18 @@ class ImageIO extends Extension
});
}
public function onImageAddition(ImageAdditionEvent $event)
public function onImageAddition(ImageAdditionEvent $event): void
{
send_event(new ThumbnailGenerationEvent($event->image));
log_info("image", "Uploaded >>{$event->image->id} ({$event->image->hash})");
}
public function onImageDeletion(ImageDeletionEvent $event)
public function onImageDeletion(ImageDeletionEvent $event): void
{
$event->image->delete();
}
public function onUserPageBuilding(UserPageBuildingEvent $event)
public function onUserPageBuilding(UserPageBuildingEvent $event): void
{
$u_name = url_escape($event->display_user->name);
$i_image_count = Search::count_images(["user={$event->display_user->name}"]);
@ -156,7 +156,7 @@ class ImageIO extends Extension
$event->add_stats("<a href='$images_link'>Posts uploaded</a>: $i_image_count, $h_image_rate per day");
}
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
global $config;
@ -199,7 +199,7 @@ class ImageIO extends Extension
$sb->end_table();
}
public function onParseLinkTemplate(ParseLinkTemplateEvent $event)
public function onParseLinkTemplate(ParseLinkTemplateEvent $event): void
{
$fname = $event->image->get_filename();
$base_fname = str_contains($fname, '.') ? substr($fname, 0, strrpos($fname, '.')) : $fname;

View file

@ -62,7 +62,7 @@ class ImageBan extends Extension
/** @var ImageBanTheme */
protected Themelet $theme;
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;
if ($this->get_version("ext_imageban_version") < 1) {
@ -76,7 +76,7 @@ class ImageBan extends Extension
}
}
public function onDataUpload(DataUploadEvent $event)
public function onDataUpload(DataUploadEvent $event): void
{
global $database;
$row = $database->get_row("SELECT * FROM image_bans WHERE hash = :hash", ["hash" => $event->hash]);
@ -86,7 +86,7 @@ class ImageBan extends Extension
}
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $database, $page, $user;
@ -128,7 +128,7 @@ class ImageBan extends Extension
}
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
global $user;
if ($event->parent === "system") {
@ -138,7 +138,7 @@ class ImageBan extends Extension
}
}
public function onUserBlockBuilding(UserBlockBuildingEvent $event)
public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::BAN_IMAGE)) {
@ -146,7 +146,7 @@ class ImageBan extends Extension
}
}
public function onAddImageHashBan(AddImageHashBanEvent $event)
public function onAddImageHashBan(AddImageHashBanEvent $event): void
{
global $database;
$database->execute(
@ -156,13 +156,13 @@ class ImageBan extends Extension
log_info("image_hash_ban", "Banned hash {$event->hash} because '{$event->reason}'");
}
public function onRemoveImageHashBan(RemoveImageHashBanEvent $event)
public function onRemoveImageHashBan(RemoveImageHashBanEvent $event): void
{
global $database;
$database->execute("DELETE FROM image_bans WHERE hash = :hash", ["hash" => $event->hash]);
}
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::BAN_IMAGE)) {

View file

@ -13,14 +13,14 @@ class ImageViewCounter extends Extension
private int $view_interval = 3600; # allows views to be added each hour
# Add Setup Block with options for view counter
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Post View Counter");
$sb->add_bool_option("image_viewcounter_adminonly", "Display view counter only to admin");
}
# Adds view to database if needed
public function onDisplayingImage(DisplayingImageEvent $event)
public function onDisplayingImage(DisplayingImageEvent $event): void
{
global $database, $user;
@ -60,7 +60,7 @@ class ImageViewCounter extends Extension
);
}
public function onImageInfoBoxBuilding(ImageInfoBoxBuildingEvent $event)
public function onImageInfoBoxBuilding(ImageInfoBoxBuildingEvent $event): void
{
global $user, $database;
@ -74,7 +74,7 @@ class ImageViewCounter extends Extension
}
}
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database, $config;
@ -89,7 +89,7 @@ class ImageViewCounter extends Extension
}
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $database;
@ -108,7 +108,7 @@ class ImageViewCounter extends Extension
}
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
if ($event->parent == "posts") {
$event->add_nav_link("sort_by_visits", new Link('popular_images'), "Popular Posts");

View file

@ -16,7 +16,7 @@ class Index extends Extension
/** @var IndexTheme */
protected Themelet $theme;
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_int(IndexConfig::IMAGES, 24);
@ -24,7 +24,7 @@ class Index extends Extension
$config->set_default_string(IndexConfig::ORDER, "id DESC");
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $cache, $config, $page, $user;
if ($event->page_matches("post/list")) {
@ -122,7 +122,7 @@ class Index extends Extension
}
}
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Index Options");
$sb->position = 20;
@ -132,26 +132,26 @@ class Index extends Extension
$sb->add_label(" images on the post list");
}
public function onPageNavBuilding(PageNavBuildingEvent $event)
public function onPageNavBuilding(PageNavBuildingEvent $event): void
{
$event->add_nav_link("posts", new Link('post/list'), "Posts", NavLink::is_active(["post","view"]), 20);
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
if ($event->parent == "posts") {
$event->add_nav_link("posts_all", new Link('post/list'), "All");
}
}
public function onHelpPageBuilding(HelpPageBuildingEvent $event)
public function onHelpPageBuilding(HelpPageBuildingEvent $event): void
{
if ($event->key === HelpPages::SEARCH) {
$event->add_block(new Block("General", $this->theme->get_help_html()), 0);
}
}
public function onCliGen(CliGenEvent $event)
public function onCliGen(CliGenEvent $event): void
{
$event->app->register('search')
->addArgument('query', InputArgument::REQUIRED)
@ -166,7 +166,7 @@ class Index extends Extension
});
}
public function onSearchTermParse(SearchTermParseEvent $event)
public function onSearchTermParse(SearchTermParseEvent $event): void
{
if (is_null($event->term)) {
return;

View file

@ -88,7 +88,7 @@ class IPBan extends Extension
return 10;
}
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_string(
@ -100,7 +100,7 @@ class IPBan extends Extension
);
}
public function onUserLogin(UserLoginEvent $event)
public function onUserLogin(UserLoginEvent $event): void
{
global $cache, $config, $database, $page, $_shm_user_classes;
@ -177,7 +177,7 @@ class IPBan extends Extension
}
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
if ($event->page_matches("ip_ban")) {
global $database, $page, $user;
@ -210,7 +210,7 @@ class IPBan extends Extension
}
}
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
global $config;
@ -224,7 +224,7 @@ class IPBan extends Extension
}
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
global $user;
if ($event->parent === "system") {
@ -234,7 +234,7 @@ class IPBan extends Extension
}
}
public function onUserBlockBuilding(UserBlockBuildingEvent $event)
public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::BAN_IP)) {
@ -242,7 +242,7 @@ class IPBan extends Extension
}
}
public function onAddIPBan(AddIPBanEvent $event)
public function onAddIPBan(AddIPBanEvent $event): void
{
global $cache, $user, $database;
$sql = "INSERT INTO bans (ip, mode, reason, expires, banner_id) VALUES (:ip, :mode, :reason, :expires, :admin_id)";
@ -252,7 +252,7 @@ class IPBan extends Extension
log_info("ipban", "Banned ({$event->mode}) {$event->ip} because '{$event->reason}' until {$event->expires}");
}
public function onRemoveIPBan(RemoveIPBanEvent $event)
public function onRemoveIPBan(RemoveIPBanEvent $event): void
{
global $cache, $database;
$ban = $database->get_row("SELECT * FROM bans WHERE id = :id", ["id" => $event->id]);
@ -264,7 +264,7 @@ class IPBan extends Extension
}
}
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;

View file

@ -9,19 +9,19 @@ class LinkImage extends Extension
/** @var LinkImageTheme */
protected Themelet $theme;
public function onDisplayingImage(DisplayingImageEvent $event)
public function onDisplayingImage(DisplayingImageEvent $event): void
{
global $page;
$this->theme->links_block($page, $this->data($event->image));
}
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Link to Post");
$sb->add_text_option("ext_link-img_text-link_format", "Text Link Format: ");
}
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_string("ext_link-img_text-link_format", '$title - $id ($ext $size $filesize)');

View file

@ -6,18 +6,18 @@ namespace Shimmie2;
class LiveFeed extends Extension
{
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Live Feed");
$sb->add_text_option("livefeed_host", "IP:port to send events to: ");
}
public function onUserCreation(UserCreationEvent $event)
public function onUserCreation(UserCreationEvent $event): void
{
$this->msg("New user created: {$event->username}");
}
public function onImageAddition(ImageAdditionEvent $event)
public function onImageAddition(ImageAdditionEvent $event): void
{
global $user;
$this->msg(
@ -26,7 +26,7 @@ class LiveFeed extends Extension
);
}
public function onTagSet(TagSetEvent $event)
public function onTagSet(TagSetEvent $event): void
{
$this->msg(
make_http(make_link("post/view/".$event->image->id))." - ".
@ -34,7 +34,7 @@ class LiveFeed extends Extension
);
}
public function onCommentPosting(CommentPostingEvent $event)
public function onCommentPosting(CommentPostingEvent $event): void
{
global $user;
$this->msg(

View file

@ -6,7 +6,7 @@ namespace Shimmie2;
class LogConsole extends Extension
{
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_bool("log_console_access", true);
@ -14,7 +14,7 @@ class LogConsole extends Extension
$config->set_default_int("log_console_level", SCORE_LOG_INFO);
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $config, $page;
@ -40,7 +40,7 @@ class LogConsole extends Extension
*/
}
public function onLog(LogEvent $event)
public function onLog(LogEvent $event): void
{
global $config;
if ($event->priority >= $config->get_int("log_console_level")) {

View file

@ -230,13 +230,13 @@ class LogDatabase extends Extension
/** @var LogDatabaseTheme */
protected Themelet $theme;
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_int("log_db_priority", SCORE_LOG_INFO);
}
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;
@ -255,7 +255,7 @@ class LogDatabase extends Extension
}
}
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Logging (Database)");
$sb->add_choice_option("log_db_priority", [
@ -267,7 +267,7 @@ class LogDatabase extends Extension
], "Debug Level: ");
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $database, $user;
if ($event->page_matches("log/view")) {
@ -279,7 +279,7 @@ class LogDatabase extends Extension
}
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
global $user;
if ($event->parent === "system") {
@ -289,7 +289,7 @@ class LogDatabase extends Extension
}
}
public function onUserBlockBuilding(UserBlockBuildingEvent $event)
public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::VIEW_EVENTLOG)) {
@ -297,7 +297,7 @@ class LogDatabase extends Extension
}
}
public function onLog(LogEvent $event)
public function onLog(LogEvent $event): void
{
global $config, $database, $user;

View file

@ -6,13 +6,13 @@ namespace Shimmie2;
class LogLogstash extends Extension
{
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_string("log_logstash_host", "127.0.0.1:1234");
}
public function onLog(LogEvent $event)
public function onLog(LogEvent $event): void
{
global $user;

View file

@ -8,13 +8,13 @@ class LogNet extends Extension
{
private int $count = 0;
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_string("log_net_host", "127.0.0.1:35353");
}
public function onLog(LogEvent $event)
public function onLog(LogEvent $event): void
{
global $user;

View file

@ -61,7 +61,7 @@ class Media extends Extension
return 30;
}
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_string(MediaConfig::FFPROBE_PATH, 'ffprobe');
@ -70,7 +70,7 @@ class Media extends Extension
$config->set_default_string(MediaConfig::CONVERT_PATH, 'convert');
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user;
@ -85,7 +85,7 @@ class Media extends Extension
}
}
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Media Engine Commands");
@ -110,7 +110,7 @@ class Media extends Extension
$sb->end_table();
}
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::DELETE_IMAGE)) {
@ -118,7 +118,7 @@ class Media extends Extension
}
}
public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event)
public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::RESCAN_MEDIA)) {
@ -126,7 +126,7 @@ class Media extends Extension
}
}
public function onBulkAction(BulkActionEvent $event)
public function onBulkAction(BulkActionEvent $event): void
{
global $page, $user;
@ -151,7 +151,7 @@ class Media extends Extension
}
}
public function onCliGen(CliGenEvent $event)
public function onCliGen(CliGenEvent $event): void
{
$event->app->register('media-rescan')
->addArgument('id_or_hash', InputArgument::REQUIRED)
@ -174,7 +174,7 @@ class Media extends Extension
* @throws MediaException
* @throws InsufficientMemoryException
*/
public function onMediaResize(MediaResizeEvent $event)
public function onMediaResize(MediaResizeEvent $event): void
{
if (!in_array(
$event->resize_type,
@ -237,7 +237,7 @@ class Media extends Extension
public const CONTENT_SEARCH_TERM_REGEX = "/^content[=|:]((video)|(audio)|(image)|(unknown))$/i";
public function onSearchTermParse(SearchTermParseEvent $event)
public function onSearchTermParse(SearchTermParseEvent $event): void
{
if (is_null($event->term)) {
return;
@ -254,7 +254,7 @@ class Media extends Extension
}
}
public function onHelpPageBuilding(HelpPageBuildingEvent $event)
public function onHelpPageBuilding(HelpPageBuildingEvent $event): void
{
if ($event->key === HelpPages::SEARCH) {
$block = new Block();
@ -264,14 +264,14 @@ class Media extends Extension
}
}
public function onTagTermCheck(TagTermCheckEvent $event)
public function onTagTermCheck(TagTermCheckEvent $event): void
{
if (preg_match(self::CONTENT_SEARCH_TERM_REGEX, $event->term)) {
$event->metatag = true;
}
}
public function onParseLinkTemplate(ParseLinkTemplateEvent $event)
public function onParseLinkTemplate(ParseLinkTemplateEvent $event): void
{
if ($event->image->width && $event->image->height && $event->image->length) {
$s = ((int)($event->image->length / 100)) / 10;
@ -867,7 +867,7 @@ class Media extends Extension
return $size;
}
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $config, $database;
if ($this->get_version(MediaConfig::VERSION) < 1) {

View file

@ -15,14 +15,14 @@ class MimeSystem extends Extension
public const VERSION = "ext_mime_version";
public function onParseLinkTemplate(ParseLinkTemplateEvent $event)
public function onParseLinkTemplate(ParseLinkTemplateEvent $event): void
{
$event->replace('$ext', $event->image->get_ext());
$event->replace('$mime', $event->image->get_mime());
}
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;
@ -58,7 +58,7 @@ class MimeSystem extends Extension
}
}
public function onHelpPageBuilding(HelpPageBuildingEvent $event)
public function onHelpPageBuilding(HelpPageBuildingEvent $event): void
{
if ($event->key === HelpPages::SEARCH) {
$block = new Block();
@ -68,7 +68,7 @@ class MimeSystem extends Extension
}
}
public function onSearchTermParse(SearchTermParseEvent $event)
public function onSearchTermParse(SearchTermParseEvent $event): void
{
if (is_null($event->term)) {
return;

View file

@ -40,7 +40,7 @@ class NotATag extends Extension
return 30;
} // before ImageUploadEvent and tag_history
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;
if ($this->get_version("ext_notatag_version") < 1) {
@ -52,7 +52,7 @@ class NotATag extends Extension
}
}
public function onTagSet(TagSetEvent $event)
public function onTagSet(TagSetEvent $event): void
{
global $user;
if ($user->can(Permissions::BAN_IMAGE)) {
@ -106,7 +106,7 @@ class NotATag extends Extension
return $ok_tags;
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
global $user;
if ($event->parent === "tags") {
@ -116,7 +116,7 @@ class NotATag extends Extension
}
}
public function onUserBlockBuilding(UserBlockBuildingEvent $event)
public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::BAN_IMAGE)) {
@ -124,7 +124,7 @@ class NotATag extends Extension
}
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $database, $page, $user;

View file

@ -9,7 +9,7 @@ class Notes extends Extension
/** @var NotesTheme */
protected Themelet $theme;
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $config, $database;
@ -70,7 +70,7 @@ class Notes extends Extension
}
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user;
if ($event->page_matches("note")) {
@ -162,7 +162,7 @@ class Notes extends Extension
/*
* HERE WE LOAD THE NOTES IN THE IMAGE
*/
public function onDisplayingImage(DisplayingImageEvent $event)
public function onDisplayingImage(DisplayingImageEvent $event): void
{
global $page, $user;
@ -175,7 +175,7 @@ class Notes extends Extension
/*
* HERE WE ADD THE BUTTONS ON SIDEBAR
*/
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event): void
{
global $user;
if (!$user->is_anonymous()) {
@ -192,7 +192,7 @@ class Notes extends Extension
/*
* HERE WE ADD QUERYLETS TO ADD SEARCH SYSTEM
*/
public function onSearchTermParse(SearchTermParseEvent $event)
public function onSearchTermParse(SearchTermParseEvent $event): void
{
if (is_null($event->term)) {
return;
@ -215,7 +215,7 @@ class Notes extends Extension
}
}
public function onHelpPageBuilding(HelpPageBuildingEvent $event)
public function onHelpPageBuilding(HelpPageBuildingEvent $event): void
{
if ($event->key === HelpPages::SEARCH) {
$block = new Block();

View file

@ -104,7 +104,7 @@ class NumericScore extends Extension
/** @var NumericScoreTheme */
protected Themelet $theme;
public function onDisplayingImage(DisplayingImageEvent $event)
public function onDisplayingImage(DisplayingImageEvent $event): void
{
global $user;
if ($user->can(Permissions::CREATE_VOTE)) {
@ -112,7 +112,7 @@ class NumericScore extends Extension
}
}
public function onUserPageBuilding(UserPageBuildingEvent $event)
public function onUserPageBuilding(UserPageBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::EDIT_OTHER_VOTE)) {
@ -126,7 +126,7 @@ class NumericScore extends Extension
$event->add_stats("<a href='$link_up'>$n_up Upvotes</a> / <a href='$link_down'>$n_down Downvotes</a>");
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $config, $database, $user, $page;
@ -230,20 +230,20 @@ class NumericScore extends Extension
}
}
public function onNumericScoreSet(NumericScoreSetEvent $event)
public function onNumericScoreSet(NumericScoreSetEvent $event): void
{
global $user;
log_debug("numeric_score", "Rated >>{$event->image_id} as {$event->score}", "Rated Post");
$this->add_vote($event->image_id, $user->id, $event->score);
}
public function onImageDeletion(ImageDeletionEvent $event)
public function onImageDeletion(ImageDeletionEvent $event): void
{
global $database;
$database->execute("DELETE FROM numeric_score_votes WHERE image_id=:id", ["id" => $event->image->id]);
}
public function onUserDeletion(UserDeletionEvent $event)
public function onUserDeletion(UserDeletionEvent $event): void
{
$this->delete_votes_by($event->id);
}
@ -280,12 +280,12 @@ class NumericScore extends Extension
}
}
public function onParseLinkTemplate(ParseLinkTemplateEvent $event)
public function onParseLinkTemplate(ParseLinkTemplateEvent $event): void
{
$event->replace('$score', (string)$event->image->numeric_score);
}
public function onHelpPageBuilding(HelpPageBuildingEvent $event)
public function onHelpPageBuilding(HelpPageBuildingEvent $event): void
{
if ($event->key === HelpPages::SEARCH) {
$block = new Block();
@ -295,7 +295,7 @@ class NumericScore extends Extension
}
}
public function onSearchTermParse(SearchTermParseEvent $event)
public function onSearchTermParse(SearchTermParseEvent $event): void
{
if (is_null($event->term)) {
return;
@ -347,14 +347,14 @@ class NumericScore extends Extension
}
}
public function onTagTermCheck(TagTermCheckEvent $event)
public function onTagTermCheck(TagTermCheckEvent $event): void
{
if (preg_match("/^vote[=|:](up|down|remove)$/i", $event->term)) {
$event->metatag = true;
}
}
public function onTagTermParse(TagTermParseEvent $event)
public function onTagTermParse(TagTermParseEvent $event): void
{
$matches = [];
@ -367,7 +367,7 @@ class NumericScore extends Extension
}
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
if ($event->parent == "posts") {
$event->add_nav_link("numeric_score_day", new Link('popular_by_day'), "Popular by Day");
@ -376,7 +376,7 @@ class NumericScore extends Extension
}
}
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;

View file

@ -234,7 +234,7 @@ class OuroborosAPI extends Extension
public const ERROR_POST_CREATE_DUPE = 'Duplicate';
public const OK_POST_CREATE_UPDATE = 'Updated';
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user;

View file

@ -143,7 +143,7 @@ class PrivMsg extends Extension
/** @var PrivMsgTheme */
protected Themelet $theme;
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;
@ -181,7 +181,7 @@ class PrivMsg extends Extension
}
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
global $user;
if ($event->parent === "user") {
@ -193,7 +193,7 @@ class PrivMsg extends Extension
}
}
public function onUserBlockBuilding(UserBlockBuildingEvent $event)
public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::READ_PM)) {
@ -203,7 +203,7 @@ class PrivMsg extends Extension
}
}
public function onUserPageBuilding(UserPageBuildingEvent $event)
public function onUserPageBuilding(UserPageBuildingEvent $event): void
{
global $page, $user;
$duser = $event->display_user;
@ -218,7 +218,7 @@ class PrivMsg extends Extension
}
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $cache, $database, $page, $user;
if ($event->page_matches("pm")) {
@ -283,7 +283,7 @@ class PrivMsg extends Extension
}
}
public function onSendPM(SendPMEvent $event)
public function onSendPM(SendPMEvent $event): void
{
global $cache, $database;
$database->execute(

View file

@ -121,7 +121,7 @@ class Pools extends Extension
/** @var PoolsTheme */
protected Themelet $theme;
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
global $config;
@ -136,7 +136,7 @@ class Pools extends Extension
$config->set_default_bool(PoolsConfig::AUTO_INCREMENT_ORDER, false);
}
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;
@ -183,7 +183,7 @@ class Pools extends Extension
}
// Add a block to the Board Config / Setup
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Pools");
$sb->add_int_option(PoolsConfig::MAX_IMPORT_RESULTS, "Max results on import: ");
@ -196,12 +196,12 @@ class Pools extends Extension
//$sb->add_bool_option(PoolsConfig::ADDER_ON_VIEW_IMAGE, "<br>Show pool adder on image: ");
}
public function onPageNavBuilding(PageNavBuildingEvent $event)
public function onPageNavBuilding(PageNavBuildingEvent $event): void
{
$event->add_nav_link("pool", new Link('pool/list'), "Pools");
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
if ($event->parent == "pool") {
$event->add_nav_link("pool_list", new Link('pool/list'), "List");
@ -211,7 +211,7 @@ class Pools extends Extension
}
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $config, $database, $page, $user;
if ($event->page_matches("pool/list")) { //index
@ -442,7 +442,7 @@ class Pools extends Extension
}
}
public function onUserBlockBuilding(UserBlockBuildingEvent $event)
public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
$event->add_link("Pools", make_link("pool/list"));
}
@ -452,7 +452,7 @@ class Pools extends Extension
* image is currently a member of on a side panel, as well as a link
* to the Next image in the pool.
*/
public function onDisplayingImage(DisplayingImageEvent $event)
public function onDisplayingImage(DisplayingImageEvent $event): void
{
global $config;
@ -475,7 +475,7 @@ class Pools extends Extension
}
}
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event): void
{
global $config, $database, $user;
if ($config->get_bool(PoolsConfig::ADDER_ON_VIEW_IMAGE) && !$user->is_anonymous()) {
@ -491,14 +491,14 @@ class Pools extends Extension
}
}
public function onHelpPageBuilding(HelpPageBuildingEvent $event)
public function onHelpPageBuilding(HelpPageBuildingEvent $event): void
{
if ($event->key === HelpPages::SEARCH) {
$event->add_block(new Block("Pools", $this->theme->get_help_html()));
}
}
public function onSearchTermParse(SearchTermParseEvent $event)
public function onSearchTermParse(SearchTermParseEvent $event): void
{
if (is_null($event->term)) {
return;
@ -530,14 +530,14 @@ class Pools extends Extension
}
public function onTagTermCheck(TagTermCheckEvent $event)
public function onTagTermCheck(TagTermCheckEvent $event): void
{
if (preg_match("/^pool[=|:]([^:]*|lastcreated):?([0-9]*)$/i", $event->term)) {
$event->metatag = true;
}
}
public function onTagTermParse(TagTermParseEvent $event)
public function onTagTermParse(TagTermParseEvent $event): void
{
$matches = [];
if (preg_match("/^pool[=|:]([^:]*|lastcreated):?([0-9]*)$/i", $event->term, $matches)) {
@ -560,7 +560,7 @@ class Pools extends Extension
}
}
public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event)
public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event): void
{
global $database;
@ -571,7 +571,7 @@ class Pools extends Extension
$event->add_action("bulk_pool_add_new", "Create Pool", "", "", (string)$this->theme->get_bulk_pool_input($event->search_terms));
}
public function onBulkAction(BulkActionEvent $event)
public function onBulkAction(BulkActionEvent $event): void
{
global $user;
@ -658,7 +658,7 @@ class Pools extends Extension
$this->theme->list_pools($page, $pools, $search, $pageNumber + 1, $totalPages);
}
public function onPoolCreation(PoolCreationEvent $event)
public function onPoolCreation(PoolCreationEvent $event): void
{
global $user, $database;
@ -728,7 +728,7 @@ class Pools extends Extension
/**
* HERE WE ADD CHECKED IMAGES FROM POOL AND UPDATE THE HISTORY
*/
public function onPoolAddPosts(PoolAddPostsEvent $event)
public function onPoolAddPosts(PoolAddPostsEvent $event): void
{
global $database, $user;
@ -856,7 +856,7 @@ class Pools extends Extension
/**
* HERE WE NUKE ENTIRE POOL. WE REMOVE POOLS AND POSTS FROM REMOVED POOL AND HISTORIES ENTRIES FROM REMOVED POOL.
*/
public function onPoolDeletion(PoolDeletionEvent $event)
public function onPoolDeletion(PoolDeletionEvent $event): void
{
global $user, $database;
$poolID = $event->pool_id;

View file

@ -17,7 +17,7 @@ class PostTitles extends Extension
return 60;
}
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
global $config;
@ -25,7 +25,7 @@ class PostTitles extends Extension
$config->set_default_bool(PostTitlesConfig::SHOW_IN_WINDOW_TITLE, false);
}
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;
@ -35,7 +35,7 @@ class PostTitles extends Extension
}
}
public function onDisplayingImage(DisplayingImageEvent $event)
public function onDisplayingImage(DisplayingImageEvent $event): void
{
global $config, $page;
@ -44,14 +44,14 @@ class PostTitles extends Extension
}
}
public function onImageInfoBoxBuilding(ImageInfoBoxBuildingEvent $event)
public function onImageInfoBoxBuilding(ImageInfoBoxBuildingEvent $event): void
{
global $user;
$event->add_part($this->theme->get_title_set_html(self::get_title($event->image), $user->can(Permissions::EDIT_IMAGE_TITLE)), 10);
}
public function onImageInfoSet(ImageInfoSetEvent $event)
public function onImageInfoSet(ImageInfoSetEvent $event): void
{
global $user;
@ -61,12 +61,12 @@ class PostTitles extends Extension
}
}
public function onPostTitleSet(PostTitleSetEvent $event)
public function onPostTitleSet(PostTitleSetEvent $event): void
{
$this->set_title($event->image->id, $event->title);
}
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Post Titles");
$sb->start_table();
@ -75,11 +75,11 @@ class PostTitles extends Extension
$sb->end_table();
}
public function onBulkExport(BulkExportEvent $event)
public function onBulkExport(BulkExportEvent $event): void
{
$event->fields["title"] = $event->image->title;
}
public function onBulkImport(BulkImportEvent $event)
public function onBulkImport(BulkImportEvent $event): void
{
if (array_key_exists("title", $event->fields) && $event->fields['title'] != null) {
$this->set_title($event->image->id, $event->fields['title']);

View file

@ -16,18 +16,18 @@ class PrivateImage extends Extension
/** @var PrivateImageTheme */
protected Themelet $theme;
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
Image::$bool_props[] = "private";
}
public function onInitUserConfig(InitUserConfigEvent $event)
public function onInitUserConfig(InitUserConfigEvent $event): void
{
$event->user_config->set_default_bool(PrivateImageConfig::USER_SET_DEFAULT, false);
$event->user_config->set_default_bool(PrivateImageConfig::USER_VIEW_DEFAULT, true);
}
public function onUserOptionsBuilding(UserOptionsBuildingEvent $event)
public function onUserOptionsBuilding(UserOptionsBuildingEvent $event): void
{
global $user;
$sb = $event->panel->create_new_block("Private Posts");
@ -39,7 +39,7 @@ class PrivateImage extends Extension
$sb->end_table();
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user, $user_config;
@ -113,7 +113,7 @@ class PrivateImage extends Extension
}
}
}
public function onDisplayingImage(DisplayingImageEvent $event)
public function onDisplayingImage(DisplayingImageEvent $event): void
{
global $user, $page;
@ -125,7 +125,7 @@ class PrivateImage extends Extension
public const SEARCH_REGEXP = "/^private:(yes|no|any)/";
public function onSearchTermParse(SearchTermParseEvent $event)
public function onSearchTermParse(SearchTermParseEvent $event): void
{
global $user, $user_config;
$show_private = $user_config->get_bool(PrivateImageConfig::USER_VIEW_DEFAULT);
@ -180,7 +180,7 @@ class PrivateImage extends Extension
}
}
public function onHelpPageBuilding(HelpPageBuildingEvent $event)
public function onHelpPageBuilding(HelpPageBuildingEvent $event): void
{
if ($event->key === HelpPages::SEARCH) {
$block = new Block();
@ -221,7 +221,7 @@ class PrivateImage extends Extension
);
}
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event): void
{
global $user;
if (($user->can(Permissions::SET_PRIVATE_IMAGE) && $user->id == $event->image->owner_id) || $user->can(Permissions::SET_OTHERS_PRIVATE_IMAGES)) {
@ -229,7 +229,7 @@ class PrivateImage extends Extension
}
}
public function onImageAddition(ImageAdditionEvent $event)
public function onImageAddition(ImageAdditionEvent $event): void
{
global $user, $user_config;
if ($user_config->get_bool(PrivateImageConfig::USER_SET_DEFAULT) && $user->can(Permissions::SET_PRIVATE_IMAGE)) {
@ -237,7 +237,7 @@ class PrivateImage extends Extension
}
}
public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event)
public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event): void
{
global $user;
@ -247,7 +247,7 @@ class PrivateImage extends Extension
}
}
public function onBulkAction(BulkActionEvent $event)
public function onBulkAction(BulkActionEvent $event): void
{
global $page, $user;
@ -278,7 +278,7 @@ class PrivateImage extends Extension
break;
}
}
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;

View file

@ -9,7 +9,7 @@ class QRImage extends Extension
/** @var QRImageTheme */
protected Themelet $theme;
public function onDisplayingImage(DisplayingImageEvent $event)
public function onDisplayingImage(DisplayingImageEvent $event): void
{
$this->theme->links_block(make_http(make_link('image/'.$event->image->id.'.'.$event->image->get_ext())));
}

View file

@ -9,7 +9,7 @@ class RandomImage extends Extension
/** @var RandomImageTheme */
protected Themelet $theme;
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $page;
@ -40,13 +40,13 @@ class RandomImage extends Extension
}
}
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Random Post");
$sb->add_bool_option("show_random_block", "Show Random Block: ");
}
public function onPostListBuilding(PostListBuildingEvent $event)
public function onPostListBuilding(PostListBuildingEvent $event): void
{
global $config, $page;
if ($config->get_bool("show_random_block")) {
@ -57,7 +57,7 @@ class RandomImage extends Extension
}
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
if ($event->parent == "posts") {
$event->add_nav_link("posts_random", new Link('random_image/view'), "Random Post");

View file

@ -9,7 +9,7 @@ class RandomList extends Extension
/** @var RandomListTheme */
protected Themelet $theme;
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $config, $page;
@ -53,13 +53,13 @@ class RandomList extends Extension
}
}
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_int("random_images_list_count", 12);
}
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Random Posts List");
@ -70,7 +70,7 @@ class RandomList extends Extension
);
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
if ($event->parent == "posts") {
$event->add_nav_link("posts_random", new Link('random'), "Shuffle");

View file

@ -79,7 +79,7 @@ class Ratings extends Extension
private string $search_regexp;
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
global $config, $_shm_user_classes, $_shm_ratings;
@ -110,12 +110,12 @@ class Ratings extends Extension
return true;
}
public function onInitUserConfig(InitUserConfigEvent $event)
public function onInitUserConfig(InitUserConfigEvent $event): void
{
$event->user_config->set_default_array(RatingsConfig::USER_DEFAULTS, self::get_user_class_privs($event->user));
}
public function onImageDownloading(ImageDownloadingEvent $event)
public function onImageDownloading(ImageDownloadingEvent $event): void
{
/**
* Deny images upon insufficient permissions.
@ -125,7 +125,7 @@ class Ratings extends Extension
}
}
public function onUserOptionsBuilding(UserOptionsBuildingEvent $event)
public function onUserOptionsBuilding(UserOptionsBuildingEvent $event): void
{
global $user, $_shm_ratings;
@ -142,7 +142,7 @@ class Ratings extends Extension
$sb->add_label("This controls the default rating search results will be filtered by, and nothing else. To override in your search results, add rating:* to your search.");
}
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
global $_shm_user_classes;
@ -164,14 +164,14 @@ class Ratings extends Extension
$sb->end_table();
}
public function onImageAddition(ImageAdditionEvent $event)
public function onImageAddition(ImageAdditionEvent $event): void
{
if(!empty($event->metadata['rating'])) {
send_event(new RatingSetEvent($event->image, $event->metadata['rating']));
}
}
public function onDisplayingImage(DisplayingImageEvent $event)
public function onDisplayingImage(DisplayingImageEvent $event): void
{
global $page;
/**
@ -183,11 +183,11 @@ class Ratings extends Extension
}
}
public function onBulkExport(BulkExportEvent $event)
public function onBulkExport(BulkExportEvent $event): void
{
$event->fields["rating"] = $event->image->rating;
}
public function onBulkImport(BulkImportEvent $event)
public function onBulkImport(BulkImportEvent $event): void
{
if (array_key_exists("rating", $event->fields)
&& $event->fields['rating'] !== null
@ -196,7 +196,7 @@ class Ratings extends Extension
}
}
public function onRatingSet(RatingSetEvent $event)
public function onRatingSet(RatingSetEvent $event): void
{
if (empty($event->image->rating)) {
$old_rating = "";
@ -206,7 +206,7 @@ class Ratings extends Extension
$this->set_rating($event->image->id, $event->rating, $old_rating);
}
public function onImageInfoBoxBuilding(ImageInfoBoxBuildingEvent $event)
public function onImageInfoBoxBuilding(ImageInfoBoxBuildingEvent $event): void
{
global $user;
$event->add_part(
@ -219,7 +219,7 @@ class Ratings extends Extension
);
}
public function onImageInfoSet(ImageInfoSetEvent $event)
public function onImageInfoSet(ImageInfoSetEvent $event): void
{
global $user;
if ($user->can(Permissions::EDIT_IMAGE_RATING) && isset($_POST["rating"])) {
@ -230,14 +230,14 @@ class Ratings extends Extension
}
}
public function onParseLinkTemplate(ParseLinkTemplateEvent $event)
public function onParseLinkTemplate(ParseLinkTemplateEvent $event): void
{
if(!is_null($event->image->rating)) {
$event->replace('$rating', $this->rating_to_human($event->image->rating));
}
}
public function onHelpPageBuilding(HelpPageBuildingEvent $event)
public function onHelpPageBuilding(HelpPageBuildingEvent $event): void
{
if ($event->key === HelpPages::SEARCH) {
$ratings = self::get_sorted_ratings();
@ -245,7 +245,7 @@ class Ratings extends Extension
}
}
public function onSearchTermParse(SearchTermParseEvent $event)
public function onSearchTermParse(SearchTermParseEvent $event): void
{
global $user;
@ -277,14 +277,14 @@ class Ratings extends Extension
}
}
public function onTagTermCheck(TagTermCheckEvent $event)
public function onTagTermCheck(TagTermCheckEvent $event): void
{
if (preg_match($this->search_regexp, $event->term)) {
$event->metatag = true;
}
}
public function onTagTermParse(TagTermParseEvent $event)
public function onTagTermParse(TagTermParseEvent $event): void
{
global $user;
$matches = [];
@ -303,7 +303,7 @@ class Ratings extends Extension
}
}
public function onAdminBuilding(AdminBuildingEvent $event)
public function onAdminBuilding(AdminBuildingEvent $event): void
{
global $database, $_shm_ratings;
@ -320,7 +320,7 @@ class Ratings extends Extension
$this->theme->display_form($original_values);
}
public function onAdminAction(AdminActionEvent $event)
public function onAdminAction(AdminActionEvent $event): void
{
global $database, $user;
$action = $event->action;
@ -344,7 +344,7 @@ class Ratings extends Extension
}
}
public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event)
public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event): void
{
global $user;
@ -353,7 +353,7 @@ class Ratings extends Extension
}
}
public function onBulkAction(BulkActionEvent $event)
public function onBulkAction(BulkActionEvent $event): void
{
global $page, $user;
@ -375,7 +375,7 @@ class Ratings extends Extension
}
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $user, $page;
@ -504,7 +504,7 @@ class Ratings extends Extension
return true;
}
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database, $config;

View file

@ -17,7 +17,7 @@ class RegenThumb extends Extension
return $event->generated;
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user;
@ -41,7 +41,7 @@ class RegenThumb extends Extension
}
}
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::DELETE_IMAGE)) {
@ -49,7 +49,7 @@ class RegenThumb extends Extension
}
}
// public function onPostListBuilding(PostListBuildingEvent $event)
// public function onPostListBuilding(PostListBuildingEvent $event): void
// {
// global $user;
// if ($user->can(UserAbilities::DELETE_IMAGE) && !empty($event->search_terms)) {
@ -57,7 +57,7 @@ class RegenThumb extends Extension
// }
// }
public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event)
public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event): void
{
global $user;
@ -66,7 +66,7 @@ class RegenThumb extends Extension
}
}
public function onBulkAction(BulkActionEvent $event)
public function onBulkAction(BulkActionEvent $event): void
{
global $page, $user;
@ -91,12 +91,12 @@ class RegenThumb extends Extension
}
}
public function onAdminBuilding(AdminBuildingEvent $event)
public function onAdminBuilding(AdminBuildingEvent $event): void
{
$this->theme->display_admin_block();
}
public function onAdminAction(AdminActionEvent $event)
public function onAdminAction(AdminActionEvent $event): void
{
global $page;
switch ($event->action) {

View file

@ -25,13 +25,13 @@ class Relationships extends Extension
public const NAME = "Relationships";
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
Image::$bool_props[] = "has_children";
Image::$int_props[] = "parent_id";
}
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;
@ -52,7 +52,7 @@ class Relationships extends Extension
}
}
public function onImageInfoSet(ImageInfoSetEvent $event)
public function onImageInfoSet(ImageInfoSetEvent $event): void
{
global $user;
if ($user->can(Permissions::EDIT_IMAGE_RELATIONSHIPS)) {
@ -66,12 +66,12 @@ class Relationships extends Extension
}
}
public function onDisplayingImage(DisplayingImageEvent $event)
public function onDisplayingImage(DisplayingImageEvent $event): void
{
$this->theme->relationship_info($event->image);
}
public function onSearchTermParse(SearchTermParseEvent $event)
public function onSearchTermParse(SearchTermParseEvent $event): void
{
if (is_null($event->term)) {
return;
@ -93,7 +93,7 @@ class Relationships extends Extension
}
}
public function onHelpPageBuilding(HelpPageBuildingEvent $event)
public function onHelpPageBuilding(HelpPageBuildingEvent $event): void
{
if ($event->key === HelpPages::SEARCH) {
$block = new Block();
@ -103,14 +103,14 @@ class Relationships extends Extension
}
}
public function onTagTermCheck(TagTermCheckEvent $event)
public function onTagTermCheck(TagTermCheckEvent $event): void
{
if (preg_match("/^(parent|child)[=|:](.*)$/i", $event->term)) {
$event->metatag = true;
}
}
public function onTagTermParse(TagTermParseEvent $event)
public function onTagTermParse(TagTermParseEvent $event): void
{
$matches = [];
@ -127,12 +127,12 @@ class Relationships extends Extension
}
}
public function onImageInfoBoxBuilding(ImageInfoBoxBuildingEvent $event)
public function onImageInfoBoxBuilding(ImageInfoBoxBuildingEvent $event): void
{
$event->add_part($this->theme->get_parent_editor_html($event->image), 45);
}
public function onImageDeletion(ImageDeletionEvent $event)
public function onImageDeletion(ImageDeletionEvent $event): void
{
global $database;
@ -145,7 +145,7 @@ class Relationships extends Extension
}
}
public function onImageRelationshipSet(ImageRelationshipSetEvent $event)
public function onImageRelationshipSet(ImageRelationshipSetEvent $event): void
{
global $database;

View file

@ -9,7 +9,7 @@ class ReplaceFile extends Extension
/** @var ReplaceFileTheme */
protected Themelet $theme;
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $cache, $page, $user;
@ -45,7 +45,7 @@ class ReplaceFile extends Extension
}
}
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event): void
{
global $user;
@ -55,7 +55,7 @@ class ReplaceFile extends Extension
}
}
public function onImageReplace(ImageReplaceEvent $event)
public function onImageReplace(ImageReplaceEvent $event): void
{
$image = $event->image;

View file

@ -45,7 +45,7 @@ class ReportImage extends Extension
/** @var ReportImageTheme */
protected Themelet $theme;
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user;
if ($event->page_matches("image_report")) {
@ -82,7 +82,7 @@ class ReportImage extends Extension
}
}
public function onAddReportedImage(AddReportedImageEvent $event)
public function onAddReportedImage(AddReportedImageEvent $event): void
{
global $cache, $database;
log_info("report_image", "Adding report of >>{$event->report->image_id} with reason '{$event->report->reason}'");
@ -94,14 +94,14 @@ class ReportImage extends Extension
$cache->delete("image-report-count");
}
public function onRemoveReportedImage(RemoveReportedImageEvent $event)
public function onRemoveReportedImage(RemoveReportedImageEvent $event): void
{
global $cache, $database;
$database->execute("DELETE FROM image_reports WHERE id = :id", ["id" => $event->id]);
$cache->delete("image-report-count");
}
public function onUserPageBuilding(UserPageBuildingEvent $event)
public function onUserPageBuilding(UserPageBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::VIEW_IMAGE_REPORT)) {
@ -109,7 +109,7 @@ class ReportImage extends Extension
}
}
public function onDisplayingImage(DisplayingImageEvent $event)
public function onDisplayingImage(DisplayingImageEvent $event): void
{
global $user;
if ($user->can(Permissions::CREATE_IMAGE_REPORT)) {
@ -119,7 +119,7 @@ class ReportImage extends Extension
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
global $user;
if ($event->parent === "system") {
@ -132,7 +132,7 @@ class ReportImage extends Extension
}
}
public function onUserBlockBuilding(UserBlockBuildingEvent $event)
public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::VIEW_IMAGE_REPORT)) {
@ -142,19 +142,19 @@ class ReportImage extends Extension
}
}
public function onImageDeletion(ImageDeletionEvent $event)
public function onImageDeletion(ImageDeletionEvent $event): void
{
global $cache, $database;
$database->execute("DELETE FROM image_reports WHERE image_id = :image_id", ["image_id" => $event->image->id]);
$cache->delete("image-report-count");
}
public function onUserDeletion(UserDeletionEvent $event)
public function onUserDeletion(UserDeletionEvent $event): void
{
$this->delete_reports_by($event->id);
}
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Post Reports");
@ -174,7 +174,7 @@ class ReportImage extends Extension
$cache->delete("image-report-count");
}
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;

View file

@ -11,7 +11,7 @@ class ResolutionLimit extends Extension
return 40;
} // early, to veto ImageUploadEvent
public function onImageAddition(ImageAdditionEvent $event)
public function onImageAddition(ImageAdditionEvent $event): void
{
global $config;
$min_w = $config->get_int("upload_min_width", -1);
@ -60,7 +60,7 @@ class ResolutionLimit extends Extension
}
}
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Resolution Limits");

View file

@ -31,7 +31,7 @@ class ResizeImage extends Extension
}
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_bool(ResizeConfig::ENABLED, true);
@ -42,7 +42,7 @@ class ResizeImage extends Extension
$config->set_default_int(ResizeConfig::DEFAULT_HEIGHT, 0);
}
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event): void
{
global $user, $config;
if ($user->can(Permissions::EDIT_FILES) && $config->get_bool(ResizeConfig::ENABLED)
@ -52,7 +52,7 @@ class ResizeImage extends Extension
}
}
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Image Resize");
$sb->start_table();
@ -73,7 +73,7 @@ class ResizeImage extends Extension
$sb->end_table();
}
public function onDataUpload(DataUploadEvent $event)
public function onDataUpload(DataUploadEvent $event): void
{
global $config, $page;
@ -117,7 +117,7 @@ class ResizeImage extends Extension
}
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user;
@ -164,7 +164,7 @@ class ResizeImage extends Extension
}
}
public function onImageDownloading(ImageDownloadingEvent $event)
public function onImageDownloading(ImageDownloadingEvent $event): void
{
global $config, $user;

View file

@ -17,7 +17,7 @@ class ReverseSearchLinks extends Extension
/**
* Show the extension block when viewing an image
*/
public function onDisplayingImage(DisplayingImageEvent $event)
public function onDisplayingImage(DisplayingImageEvent $event): void
{
global $page;
@ -56,7 +56,7 @@ class ReverseSearchLinks extends Extension
/**
* Set default config values
*/
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_array(

View file

@ -23,14 +23,14 @@ class RotateImage extends Extension
public const SUPPORTED_MIME = [MimeType::JPEG, MimeType::PNG, MimeType::GIF, MimeType::WEBP];
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_bool('rotate_enabled', true);
$config->set_default_int('rotate_default_deg', 180);
}
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event): void
{
global $user, $config;
if ($user->can(Permissions::EDIT_FILES) && $config->get_bool("rotate_enabled")
@ -40,7 +40,7 @@ class RotateImage extends Extension
}
}
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Image Rotate");
$sb->add_bool_option("rotate_enabled", "Allow rotating images: ");
@ -49,7 +49,7 @@ class RotateImage extends Extension
$sb->add_label(" deg");
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user;

View file

@ -6,7 +6,7 @@ namespace Shimmie2;
class RSSComments extends Extension
{
public function onPostListBuilding(PostListBuildingEvent $event)
public function onPostListBuilding(PostListBuildingEvent $event): void
{
global $config, $page;
$title = $config->get_string(SetupConfig::TITLE);
@ -15,7 +15,7 @@ class RSSComments extends Extension
"title=\"$title - Comments\" href=\"".make_link("rss/comments")."\" />");
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $config, $database, $page;
if ($event->page_matches("rss/comments")) {
@ -75,7 +75,7 @@ EOD;
}
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
if ($event->parent == "comment") {
$event->add_nav_link("comment_rss", new Link('rss/comments'), "Feed");

View file

@ -6,7 +6,7 @@ namespace Shimmie2;
class RSSImages extends Extension
{
public function onPostListBuilding(PostListBuildingEvent $event)
public function onPostListBuilding(PostListBuildingEvent $event): void
{
global $config, $page;
$title = $config->get_string(SetupConfig::TITLE);
@ -21,7 +21,7 @@ class RSSImages extends Extension
}
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
if ($event->page_matches("rss/images")) {
$search_terms = $event->get_search_terms();
@ -41,7 +41,7 @@ class RSSImages extends Extension
}
}
public function onImageInfoSet(ImageInfoSetEvent $event)
public function onImageInfoSet(ImageInfoSetEvent $event): void
{
global $cache;
$cache->delete("rss-item-image:{$event->image->id}");
@ -129,7 +129,7 @@ class RSSImages extends Extension
return $data;
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
if ($event->parent == "posts") {
$event->add_nav_link("posts_rss", new Link('rss/images'), "Feed");

View file

@ -25,19 +25,19 @@ class Rule34 extends Extension
/** @var Rule34Theme */
protected Themelet $theme;
public function onImageDeletion(ImageDeletionEvent $event)
public function onImageDeletion(ImageDeletionEvent $event): void
{
global $database;
$database->notify("shm_image_bans", $event->image->hash);
}
public function onImageInfoSet(ImageInfoSetEvent $event)
public function onImageInfoSet(ImageInfoSetEvent $event): void
{
global $cache;
$cache->delete("thumb-block:{$event->image->id}");
}
public function onImageInfoBoxBuilding(ImageInfoBoxBuildingEvent $event)
public function onImageInfoBoxBuilding(ImageInfoBoxBuildingEvent $event): void
{
global $config;
$image_link = $config->get_string(ImageConfig::ILINK);
@ -57,7 +57,7 @@ class Rule34 extends Extension
);
}
public function onAdminBuilding(AdminBuildingEvent $event)
public function onAdminBuilding(AdminBuildingEvent $event): void
{
global $page;
$html = make_form(make_link("admin/cache_purge"), "POST");
@ -67,7 +67,7 @@ class Rule34 extends Extension
$page->add_block(new Block("Cache Purger", $html));
}
public function onUserPageBuilding(UserPageBuildingEvent $event)
public function onUserPageBuilding(UserPageBuildingEvent $event): void
{
global $database, $user, $config;
if ($user->can(Permissions::CHANGE_SETTING) && $config->get_bool('r34_comic_integration')) {
@ -76,7 +76,7 @@ class Rule34 extends Extension
}
}
public function onCliGen(CliGenEvent $event)
public function onCliGen(CliGenEvent $event): void
{
$event->app->register('wipe-thumb-cache')
->addArgument('tags', InputArgument::REQUIRED)
@ -92,7 +92,7 @@ class Rule34 extends Extension
});
}
public function onSourceSet(SourceSetEvent $event)
public function onSourceSet(SourceSetEvent $event): void
{
// Maybe check for 404?
if (empty($event->source)) {
@ -103,7 +103,7 @@ class Rule34 extends Extension
}
}
public function onRobotsBuilding(RobotsBuildingEvent $event)
public function onRobotsBuilding(RobotsBuildingEvent $event): void
{
// robots should only check the canonical site, not mirrors
if ($_SERVER['HTTP_HOST'] != "rule34.paheal.net") {
@ -111,7 +111,7 @@ class Rule34 extends Extension
}
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $database, $page, $user;

View file

@ -16,7 +16,7 @@ class S3 extends Extension
{
public int $synced = 0;
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
global $config;
@ -27,7 +27,7 @@ class S3 extends Extension
$sb->add_text_option(S3Config::IMAGE_BUCKET, "<br>Image Bucket: ");
}
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;
@ -41,7 +41,7 @@ class S3 extends Extension
}
}
public function onCliGen(CliGenEvent $event)
public function onCliGen(CliGenEvent $event): void
{
$event->app->register('s3:process')
->setDescription('Process the S3 queue')
@ -91,7 +91,7 @@ class S3 extends Extension
});
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $config, $page, $user;
if ($event->page_matches("s3/sync")) {
@ -109,7 +109,7 @@ class S3 extends Extension
}
}
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::DELETE_IMAGE)) {
@ -121,23 +121,23 @@ class S3 extends Extension
}
}
public function onImageAddition(ImageAdditionEvent $event)
public function onImageAddition(ImageAdditionEvent $event): void
{
// Tags aren't set at this point, let's wait for the TagSetEvent
// $this->sync_post($event->image);
}
public function onTagSet(TagSetEvent $event)
public function onTagSet(TagSetEvent $event): void
{
$this->sync_post($event->image, $event->new_tags);
}
public function onImageDeletion(ImageDeletionEvent $event)
public function onImageDeletion(ImageDeletionEvent $event): void
{
$this->remove_file($event->image->hash);
}
public function onImageReplace(ImageReplaceEvent $event)
public function onImageReplace(ImageReplaceEvent $event): void
{
$this->remove_file($event->old_hash);
$this->sync_post($event->image);

View file

@ -300,7 +300,7 @@ class Setup extends Extension
/** @var SetupTheme */
protected Themelet $theme;
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_string(SetupConfig::TITLE, "Shimmie");
@ -310,7 +310,7 @@ class Setup extends Extension
$config->set_default_bool(SetupConfig::WORD_WRAP, true);
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $config, $page, $user;
@ -340,7 +340,7 @@ class Setup extends Extension
}
}
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
$themes = [];
foreach (glob("themes/*") as $theme_dirname) {
@ -393,7 +393,7 @@ class Setup extends Extension
$sb->add_text_option("api_recaptcha_pubkey", "<br>Site key: ");
}
public function onConfigSave(ConfigSaveEvent $event)
public function onConfigSave(ConfigSaveEvent $event): void
{
$config = $event->config;
foreach ($_POST as $_name => $junk) {
@ -424,7 +424,7 @@ class Setup extends Extension
log_warning("setup", "Cache cleared");
}
public function onCliGen(CliGenEvent $event)
public function onCliGen(CliGenEvent $event): void
{
$event->app->register('config:get')
->addArgument('key', InputArgument::REQUIRED)
@ -446,7 +446,7 @@ class Setup extends Extension
});
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
global $user;
if ($event->parent === "system") {
@ -456,7 +456,7 @@ class Setup extends Extension
}
}
public function onUserBlockBuilding(UserBlockBuildingEvent $event)
public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::CHANGE_SETTING)) {
@ -464,7 +464,7 @@ class Setup extends Extension
}
}
public function onParseLinkTemplate(ParseLinkTemplateEvent $event)
public function onParseLinkTemplate(ParseLinkTemplateEvent $event): void
{
global $config;
$event->replace('$base', $config->get_string('base_href'));

View file

@ -6,7 +6,7 @@ namespace Shimmie2;
class SiteDescription extends Extension
{
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $config, $page;
if (!empty($config->get_string("site_description"))) {
@ -19,7 +19,7 @@ class SiteDescription extends Extension
}
}
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Site Description");
$sb->add_text_option("site_description", "Description: ");

View file

@ -9,7 +9,7 @@ class XMLSitemap extends Extension
private string $sitemap_queue = "";
private string $sitemap_filepath = ""; // set onPageRequest
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
if ($event->page_matches("sitemap.xml")) {
global $config;
@ -29,7 +29,7 @@ class XMLSitemap extends Extension
}
}
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Sitemap");

View file

@ -15,18 +15,18 @@ class SourceHistory extends Extension
return 40;
}
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_int("history_limit", -1);
}
public function onAdminBuilding(AdminBuildingEvent $event)
public function onAdminBuilding(AdminBuildingEvent $event): void
{
$this->theme->display_admin_block();
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user;
@ -51,12 +51,12 @@ class SourceHistory extends Extension
}
}
public function onRobotsBuilding(RobotsBuildingEvent $event)
public function onRobotsBuilding(RobotsBuildingEvent $event): void
{
$event->add_disallow("source_history");
}
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event): void
{
$event->add_part("
<form action='".make_link("source_history/{$event->image->id}")."' method='GET'>
@ -78,12 +78,12 @@ class SourceHistory extends Extension
}
*/
public function onSourceSet(SourceSetEvent $event)
public function onSourceSet(SourceSetEvent $event): void
{
$this->add_source_history($event->image, $event->source);
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
global $user;
if ($event->parent === "system") {
@ -93,7 +93,7 @@ class SourceHistory extends Extension
}
}
public function onUserBlockBuilding(UserBlockBuildingEvent $event)
public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::BULK_EDIT_IMAGE_TAG)) {
@ -101,7 +101,7 @@ class SourceHistory extends Extension
}
}
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;

View file

@ -21,7 +21,7 @@ class RobotsBuildingEvent extends Event
class StaticFiles extends Extension
{
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $config, $page;

View file

@ -25,7 +25,7 @@ class StatsDInterface extends Extension
StatsDInterface::$stats["shimmie.$type.cache-misses"] = $cache->get("__etc_cache_misses", -1)."|c";
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
$this->_stats("overall");
@ -49,22 +49,22 @@ class StatsDInterface extends Extension
StatsDInterface::$stats = [];
}
public function onUserCreation(UserCreationEvent $event)
public function onUserCreation(UserCreationEvent $event): void
{
StatsDInterface::$stats["shimmie_events.user_creations"] = "1|c";
}
public function onDataUpload(DataUploadEvent $event)
public function onDataUpload(DataUploadEvent $event): void
{
StatsDInterface::$stats["shimmie_events.uploads"] = "1|c";
}
public function onCommentPosting(CommentPostingEvent $event)
public function onCommentPosting(CommentPostingEvent $event): void
{
StatsDInterface::$stats["shimmie_events.comments"] = "1|c";
}
public function onImageInfoSet(ImageInfoSetEvent $event)
public function onImageInfoSet(ImageInfoSetEvent $event): void
{
StatsDInterface::$stats["shimmie_events.info-sets"] = "1|c";
}

View file

@ -6,7 +6,7 @@ namespace Shimmie2;
class System extends Extension
{
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $page;
@ -19,7 +19,7 @@ class System extends Extension
$page->set_mode(PageMode::REDIRECT);
}
}
public function onPageNavBuilding(PageNavBuildingEvent $event)
public function onPageNavBuilding(PageNavBuildingEvent $event): void
{
$event->add_nav_link("system", new Link('system'), "System");
}

View file

@ -11,7 +11,7 @@ class TagCategories extends Extension
/** @var TagCategoriesTheme */
protected Themelet $theme;
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
global $config;
@ -20,7 +20,7 @@ class TagCategories extends Extension
$config->set_default_bool(TagCategoriesConfig::SPLIT_ON_VIEW, true);
}
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;
@ -58,14 +58,14 @@ class TagCategories extends Extension
}
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
if ($event->parent == "tags") {
$event->add_nav_link("tag_categories", new Link('tags/categories'), "Tag Categories", NavLink::is_active(["tag_categories"]));
}
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user;
@ -77,7 +77,7 @@ class TagCategories extends Extension
}
}
public function onSearchTermParse(SearchTermParseEvent $event)
public function onSearchTermParse(SearchTermParseEvent $event): void
{
if (is_null($event->term)) {
return;
@ -106,7 +106,7 @@ class TagCategories extends Extension
}
}
public function onHelpPageBuilding(HelpPageBuildingEvent $event)
public function onHelpPageBuilding(HelpPageBuildingEvent $event): void
{
if ($event->key === HelpPages::SEARCH) {
$block = new Block();

View file

@ -140,7 +140,7 @@ class TagEdit extends Extension
/** @var TagEditTheme */
protected Themelet $theme;
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $user, $page;
if ($event->page_matches("tag_edit")) {
@ -163,7 +163,7 @@ class TagEdit extends Extension
}
}
public function onCliGen(CliGenEvent $event)
public function onCliGen(CliGenEvent $event): void
{
$event->app->register('tag-replace')
->addArgument('old_tag', InputArgument::REQUIRED)
@ -178,7 +178,7 @@ class TagEdit extends Extension
});
}
// public function onPostListBuilding(PostListBuildingEvent $event)
// public function onPostListBuilding(PostListBuildingEvent $event): void
// {
// global $user;
// if ($user->can(UserAbilities::BULK_EDIT_IMAGE_SOURCE) && !empty($event->search_terms)) {
@ -186,7 +186,7 @@ class TagEdit extends Extension
// }
// }
public function onImageAddition(ImageAdditionEvent $event)
public function onImageAddition(ImageAdditionEvent $event): void
{
if(!empty($event->metadata['tags'])) {
send_event(new TagSetEvent($event->image, $event->metadata['tags']));
@ -199,7 +199,7 @@ class TagEdit extends Extension
}
}
public function onImageInfoSet(ImageInfoSetEvent $event)
public function onImageInfoSet(ImageInfoSetEvent $event): void
{
global $page, $user;
if ($user->can(Permissions::EDIT_IMAGE_OWNER) && isset($_POST['tag_edit__owner'])) {
@ -232,7 +232,7 @@ class TagEdit extends Extension
}
}
public function onOwnerSet(OwnerSetEvent $event)
public function onOwnerSet(OwnerSetEvent $event): void
{
global $user;
if ($user->can(Permissions::EDIT_IMAGE_OWNER) && (!$event->image->is_locked() || $user->can(Permissions::EDIT_IMAGE_LOCK))) {
@ -240,7 +240,7 @@ class TagEdit extends Extension
}
}
public function onTagSet(TagSetEvent $event)
public function onTagSet(TagSetEvent $event): void
{
global $user;
if ($user->can(Permissions::EDIT_IMAGE_TAG) && (!$event->image->is_locked() || $user->can(Permissions::EDIT_IMAGE_LOCK))) {
@ -251,7 +251,7 @@ class TagEdit extends Extension
}
}
public function onSourceSet(SourceSetEvent $event)
public function onSourceSet(SourceSetEvent $event): void
{
global $user;
if ($user->can(Permissions::EDIT_IMAGE_SOURCE) && (!$event->image->is_locked() || $user->can(Permissions::EDIT_IMAGE_LOCK))) {
@ -259,7 +259,7 @@ class TagEdit extends Extension
}
}
public function onLockSet(LockSetEvent $event)
public function onLockSet(LockSetEvent $event): void
{
global $user;
if ($user->can(Permissions::EDIT_IMAGE_LOCK)) {
@ -267,17 +267,17 @@ class TagEdit extends Extension
}
}
public function onImageDeletion(ImageDeletionEvent $event)
public function onImageDeletion(ImageDeletionEvent $event): void
{
$event->image->delete_tags_from_image();
}
public function onAdminBuilding(AdminBuildingEvent $event)
public function onAdminBuilding(AdminBuildingEvent $event): void
{
$this->theme->display_mass_editor();
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
if ($event->parent == "tags") {
$event->add_nav_link("tags_help", new Link('ext_doc/tag_edit'), "Help");
@ -287,12 +287,12 @@ class TagEdit extends Extension
/**
* When an alias is added, oldtag becomes inaccessible.
*/
public function onAddAlias(AddAliasEvent $event)
public function onAddAlias(AddAliasEvent $event): void
{
$this->mass_tag_edit($event->oldtag, $event->newtag, false);
}
public function onImageInfoBoxBuilding(ImageInfoBoxBuildingEvent $event)
public function onImageInfoBoxBuilding(ImageInfoBoxBuildingEvent $event): void
{
$event->add_part($this->theme->get_user_editor_html($event->image), 39);
$event->add_part($this->theme->get_tag_editor_html($event->image), 40);
@ -300,14 +300,14 @@ class TagEdit extends Extension
$event->add_part($this->theme->get_lock_editor_html($event->image), 42);
}
public function onTagTermCheck(TagTermCheckEvent $event)
public function onTagTermCheck(TagTermCheckEvent $event): void
{
if (preg_match("/^source[=|:](.*)$/i", $event->term)) {
$event->metatag = true;
}
}
public function onTagTermParse(TagTermParseEvent $event)
public function onTagTermParse(TagTermParseEvent $event): void
{
if (preg_match("/^source[=|:](.*)$/i", $event->term, $matches)) {
$source = ($matches[1] !== "none" ? $matches[1] : null);
@ -315,7 +315,7 @@ class TagEdit extends Extension
}
}
public function onParseLinkTemplate(ParseLinkTemplateEvent $event)
public function onParseLinkTemplate(ParseLinkTemplateEvent $event): void
{
$tags = $event->image->get_tag_list();
$tags = str_replace("/", "", $tags);

View file

@ -14,7 +14,7 @@ use function MicroHTML\rawHTML;
*/
class TagEditCloud extends Extension
{
public function onImageInfoBoxBuilding(ImageInfoBoxBuildingEvent $event)
public function onImageInfoBoxBuilding(ImageInfoBoxBuildingEvent $event): void
{
global $config;
@ -26,7 +26,7 @@ class TagEditCloud extends Extension
}
}
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_bool("tageditcloud_disable", false);
@ -38,7 +38,7 @@ class TagEditCloud extends Extension
$config->set_default_string("tageditcloud_ignoretags", 'tagme');
}
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sort_by = ['Alphabetical' => 'a','Popularity' => 'p','Relevance' => 'r','Categories' => 'c'];

View file

@ -9,18 +9,18 @@ class TagHistory extends Extension
/** @var TagHistoryTheme */
protected Themelet $theme;
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_int("history_limit", -1);
}
public function onAdminBuilding(AdminBuildingEvent $event)
public function onAdminBuilding(AdminBuildingEvent $event): void
{
$this->theme->display_admin_block();
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user;
@ -45,12 +45,12 @@ class TagHistory extends Extension
}
}
public function onRobotsBuilding(RobotsBuildingEvent $event)
public function onRobotsBuilding(RobotsBuildingEvent $event): void
{
$event->add_disallow("tag_history");
}
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event): void
{
$event->add_part("
<form action='".make_link("tag_history/{$event->image->id}")."' method='GET'>
@ -72,7 +72,7 @@ class TagHistory extends Extension
}
*/
public function onTagSet(TagSetEvent $event)
public function onTagSet(TagSetEvent $event): void
{
global $database, $config, $user;
@ -134,7 +134,7 @@ class TagHistory extends Extension
}
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
global $user;
if ($event->parent === "system") {
@ -145,7 +145,7 @@ class TagHistory extends Extension
}
public function onUserBlockBuilding(UserBlockBuildingEvent $event)
public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::BULK_EDIT_IMAGE_TAG)) {
@ -153,7 +153,7 @@ class TagHistory extends Extension
}
}
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;

View file

@ -13,7 +13,7 @@ class TagList extends Extension
private $tagcategories = null;
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_int(TagListConfig::LENGTH, 15);
@ -27,7 +27,7 @@ class TagList extends Extension
$config->set_default_bool(TagListConfig::PAGES, false);
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $page;
@ -57,7 +57,7 @@ class TagList extends Extension
}
}
public function onPostListBuilding(PostListBuildingEvent $event)
public function onPostListBuilding(PostListBuildingEvent $event): void
{
global $config, $page;
if ($config->get_int(TagListConfig::LENGTH) > 0) {
@ -69,12 +69,12 @@ class TagList extends Extension
}
}
public function onPageNavBuilding(PageNavBuildingEvent $event)
public function onPageNavBuilding(PageNavBuildingEvent $event): void
{
$event->add_nav_link("tags", new Link('tags/map'), "Tags");
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
if ($event->parent == "tags") {
$event->add_nav_link("tags_map", new Link('tags/map'), "Map");
@ -83,7 +83,7 @@ class TagList extends Extension
}
}
public function onDisplayingImage(DisplayingImageEvent $event)
public function onDisplayingImage(DisplayingImageEvent $event): void
{
global $config, $page;
if ($config->get_int(TagListConfig::LENGTH) > 0) {
@ -101,7 +101,7 @@ class TagList extends Extension
}
}
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Tag Map Options");
$sb->add_int_option(TagListConfig::TAGS_MIN, "Only show tags used at least ");

View file

@ -10,12 +10,12 @@ class TagTools extends Extension
/** @var TagToolsTheme */
protected Themelet $theme;
public function onAdminBuilding(AdminBuildingEvent $event)
public function onAdminBuilding(AdminBuildingEvent $event): void
{
$this->theme->display_form();
}
public function onAdminAction(AdminActionEvent $event)
public function onAdminAction(AdminActionEvent $event): void
{
$action = $event->action;
if (method_exists($this, $action)) {

View file

@ -12,7 +12,7 @@ class TaggerXML extends Extension
return 10;
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
if ($event->page_matches("tagger/tags")) {
global $page;

View file

@ -34,7 +34,7 @@ class Tips extends Extension
/** @var TipsTheme */
protected Themelet $theme;
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;
@ -61,7 +61,7 @@ class Tips extends Extension
}
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user;
@ -98,7 +98,7 @@ class Tips extends Extension
}
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
global $user;
if ($event->parent === "system") {
@ -108,7 +108,7 @@ class Tips extends Extension
}
}
public function onUserBlockBuilding(UserBlockBuildingEvent $event)
public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::TIPS_ADMIN)) {
@ -134,7 +134,7 @@ class Tips extends Extension
$this->theme->manageTips($url, $images);
}
public function onCreateTip(CreateTipEvent $event)
public function onCreateTip(CreateTipEvent $event): void
{
global $database;
$database->execute(
@ -188,7 +188,7 @@ class Tips extends Extension
$database->execute("UPDATE tips SET enable = :enable WHERE id = :id", ["enable" => $enable, "id" => $tipID]);
}
public function onDeleteTip(DeleteTipEvent $event)
public function onDeleteTip(DeleteTipEvent $event): void
{
global $database;
$database->execute("DELETE FROM tips WHERE id = :id", ["id" => $event->tip_id]);

View file

@ -50,7 +50,7 @@ class TranscodeImage extends Extension
}
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_bool(TranscodeConfig::ENABLED, true);
@ -95,7 +95,7 @@ class TranscodeImage extends Extension
return $output;
}
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
if ($this->get_version(TranscodeConfig::VERSION) < 1) {
$old_extensions = [];
@ -126,7 +126,7 @@ class TranscodeImage extends Extension
}
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event): void
{
global $user, $config;
@ -139,7 +139,7 @@ class TranscodeImage extends Extension
}
}
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
global $config;
@ -163,7 +163,7 @@ class TranscodeImage extends Extension
$sb->end_table();
}
public function onDataUpload(DataUploadEvent $event)
public function onDataUpload(DataUploadEvent $event): void
{
global $config;
@ -203,7 +203,7 @@ class TranscodeImage extends Extension
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user;
@ -232,7 +232,7 @@ class TranscodeImage extends Extension
}
}
public function onImageDownloading(ImageDownloadingEvent $event)
public function onImageDownloading(ImageDownloadingEvent $event): void
{
global $config, $user;
@ -268,7 +268,7 @@ class TranscodeImage extends Extension
}
}
public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event)
public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event): void
{
global $user, $config;
@ -279,7 +279,7 @@ class TranscodeImage extends Extension
}
}
public function onBulkAction(BulkActionEvent $event)
public function onBulkAction(BulkActionEvent $event): void
{
global $user, $database, $page;

View file

@ -36,7 +36,7 @@ class TranscodeVideo extends Extension
}
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_bool(TranscodeVideoConfig::ENABLED, true);
@ -44,7 +44,7 @@ class TranscodeVideo extends Extension
$config->set_default_bool(TranscodeVideoConfig::UPLOAD_TO_NATIVE_CONTAINER, false);
}
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event): void
{
global $user;
@ -56,7 +56,7 @@ class TranscodeVideo extends Extension
}
}
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Video Transcode");
$sb->start_table();
@ -66,7 +66,7 @@ class TranscodeVideo extends Extension
}
/*
public function onDataUpload(DataUploadEvent $event)
public function onDataUpload(DataUploadEvent $event): void
{
global $config;
@ -97,7 +97,7 @@ class TranscodeVideo extends Extension
}
*/
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user;
@ -126,7 +126,7 @@ class TranscodeVideo extends Extension
}
}
public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event)
public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event): void
{
global $user;
@ -141,7 +141,7 @@ class TranscodeVideo extends Extension
}
}
public function onBulkAction(BulkActionEvent $event)
public function onBulkAction(BulkActionEvent $event): void
{
global $user, $database, $page;

View file

@ -20,12 +20,12 @@ class Trash extends Extension
return 10;
}
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
Image::$bool_props[] = "trash";
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $page, $user;
@ -55,7 +55,7 @@ class Trash extends Extension
return true;
}
public function onImageDownloading(ImageDownloadingEvent $event)
public function onImageDownloading(ImageDownloadingEvent $event): void
{
/**
* Deny images upon insufficient permissions.
@ -65,7 +65,7 @@ class Trash extends Extension
}
}
public function onDisplayingImage(DisplayingImageEvent $event)
public function onDisplayingImage(DisplayingImageEvent $event): void
{
global $page;
@ -75,7 +75,7 @@ class Trash extends Extension
}
}
public function onImageDeletion(ImageDeletionEvent $event)
public function onImageDeletion(ImageDeletionEvent $event): void
{
if ($event->force !== true && $event->image->trash !== true) {
self::set_trash($event->image->id, true);
@ -83,7 +83,7 @@ class Trash extends Extension
}
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
global $user;
if ($event->parent == "posts") {
@ -93,7 +93,7 @@ class Trash extends Extension
}
}
public function onUserBlockBuilding(UserBlockBuildingEvent $event)
public function onUserBlockBuilding(UserBlockBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::VIEW_TRASH)) {
@ -102,7 +102,7 @@ class Trash extends Extension
}
public const SEARCH_REGEXP = "/^in:trash$/";
public function onSearchTermParse(SearchTermParseEvent $event)
public function onSearchTermParse(SearchTermParseEvent $event): void
{
global $user;
@ -122,7 +122,7 @@ class Trash extends Extension
}
}
public function onHelpPageBuilding(HelpPageBuildingEvent $event)
public function onHelpPageBuilding(HelpPageBuildingEvent $event): void
{
global $user;
if ($event->key === HelpPages::SEARCH) {
@ -154,7 +154,7 @@ class Trash extends Extension
["trash" => $trash,"id" => $image_id]
);
}
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event): void
{
global $user;
if ($event->image->trash === true && $user->can(Permissions::VIEW_TRASH)) {
@ -162,7 +162,7 @@ class Trash extends Extension
}
}
public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event)
public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event): void
{
global $user;
@ -171,7 +171,7 @@ class Trash extends Extension
}
}
public function onBulkAction(BulkActionEvent $event)
public function onBulkAction(BulkActionEvent $event): void
{
global $page, $user;
@ -189,7 +189,7 @@ class Trash extends Extension
}
}
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $database;

View file

@ -9,7 +9,7 @@ class Update extends Extension
/** @var UpdateTheme */
protected Themelet $theme;
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_string("update_guserrepo", "shish/shimmie2");
@ -17,13 +17,13 @@ class Update extends Extension
$config->set_default_string("update_time", "01/01/1970");
}
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Update");
$sb->add_text_option("update_guserrepo", "User/Repo: ");
}
public function onAdminBuilding(AdminBuildingEvent $event)
public function onAdminBuilding(AdminBuildingEvent $event): void
{
global $config;
if ($config->get_string(UploadConfig::TRANSLOAD_ENGINE) !== "none") {
@ -31,7 +31,7 @@ class Update extends Extension
}
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $user, $page;
if ($user->can(Permissions::EDIT_FILES) && isset($_GET['sha'])) {

View file

@ -10,7 +10,7 @@ use Symfony\Component\Console\Output\OutputInterface;
class Upgrade extends Extension
{
public function onCliGen(CliGenEvent $event)
public function onCliGen(CliGenEvent $event): void
{
$event->app->register('db-upgrade')
->setDescription('Run DB schema updates, if automatic updates are disabled')
@ -23,7 +23,7 @@ class Upgrade extends Extension
});
}
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event): void
{
global $config, $database;

View file

@ -105,7 +105,7 @@ class Upload extends Extension
return 40;
}
public function onInitExt(InitExtEvent $event)
public function onInitExt(InitExtEvent $event): void
{
global $config;
$config->set_default_int(UploadConfig::COUNT, 3);
@ -134,7 +134,7 @@ class Upload extends Extension
);
}
public function onSetupBuilding(SetupBuildingEvent $event)
public function onSetupBuilding(SetupBuildingEvent $event): void
{
$tes = [];
$tes["Disabled"] = "none";
@ -169,7 +169,7 @@ class Upload extends Extension
return $output;
}
public function onPageNavBuilding(PageNavBuildingEvent $event)
public function onPageNavBuilding(PageNavBuildingEvent $event): void
{
global $user;
if ($user->can(Permissions::CREATE_IMAGE)) {
@ -177,7 +177,7 @@ class Upload extends Extension
}
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event): void
{
if ($event->parent == "upload") {
if (class_exists("Shimmie2\Wiki")) {
@ -186,7 +186,7 @@ class Upload extends Extension
}
}
public function onDataUpload(DataUploadEvent $event)
public function onDataUpload(DataUploadEvent $event): void
{
global $config;
if ($this->is_full) {
@ -199,7 +199,7 @@ class Upload extends Extension
}
}
public function onPageRequest(PageRequestEvent $event)
public function onPageRequest(PageRequestEvent $event): void
{
global $cache, $page, $user;

Some files were not shown because too many files have changed in this diff Show more