diff --git a/ext/autocomplete/main.php b/ext/autocomplete/main.php index 418ba726..843c8536 100644 --- a/ext/autocomplete/main.php +++ b/ext/autocomplete/main.php @@ -2,6 +2,9 @@ class AutoComplete extends Extension { + /** @var AutoCompleteTheme */ + protected $theme; + public function get_priority(): int { return 30; diff --git a/ext/blocks/main.php b/ext/blocks/main.php index b4da27da..c07ea893 100644 --- a/ext/blocks/main.php +++ b/ext/blocks/main.php @@ -2,6 +2,9 @@ class Blocks extends Extension { + /** @var BlocksTheme */ + protected $theme; + public function onDatabaseUpgrade(DatabaseUpgradeEvent $event) { global $database; diff --git a/ext/blotter/main.php b/ext/blotter/main.php index 15c3476f..22c6dfb7 100644 --- a/ext/blotter/main.php +++ b/ext/blotter/main.php @@ -2,6 +2,9 @@ class Blotter extends Extension { + /** @var BlotterTheme */ + protected $theme; + public function onInitExt(InitExtEvent $event) { global $config; diff --git a/ext/bulk_actions/main.php b/ext/bulk_actions/main.php index 1516baae..493ded3c 100644 --- a/ext/bulk_actions/main.php +++ b/ext/bulk_actions/main.php @@ -50,6 +50,9 @@ class BulkActionEvent extends Event class BulkActions extends Extension { + /** @var BulkActionsTheme */ + protected $theme; + public function onPostListBuilding(PostListBuildingEvent $event) { global $page, $user; diff --git a/ext/bulk_add/main.php b/ext/bulk_add/main.php index cdcefe90..022589b6 100644 --- a/ext/bulk_add/main.php +++ b/ext/bulk_add/main.php @@ -15,6 +15,9 @@ class BulkAddEvent extends Event class BulkAdd extends Extension { + /** @var BulkAddTheme */ + protected $theme; + public function onPageRequest(PageRequestEvent $event) { global $page, $user; diff --git a/ext/bulk_add_csv/main.php b/ext/bulk_add_csv/main.php index e7cbfa95..5816dded 100644 --- a/ext/bulk_add_csv/main.php +++ b/ext/bulk_add_csv/main.php @@ -2,6 +2,9 @@ class BulkAddCSV extends Extension { + /** @var BulkAddCSVTheme */ + protected $theme; + public function onPageRequest(PageRequestEvent $event) { global $page, $user; diff --git a/ext/cron_uploader/main.php b/ext/cron_uploader/main.php index 67785fd6..a8d2c585 100644 --- a/ext/cron_uploader/main.php +++ b/ext/cron_uploader/main.php @@ -4,6 +4,9 @@ require_once "config.php"; class CronUploader extends Extension { + /** @var CronUploaderTheme */ + protected $theme; + public const NAME = "cron_uploader"; // TODO: Checkbox option to only allow localhost + a list of additional IP addresses that can be set in /cron_upload diff --git a/ext/downtime/main.php b/ext/downtime/main.php index c978a22c..29507e69 100644 --- a/ext/downtime/main.php +++ b/ext/downtime/main.php @@ -2,6 +2,9 @@ class Downtime extends Extension { + /** @var DowntimeTheme */ + protected $theme; + public function get_priority(): int { return 10; diff --git a/ext/emoticons_list/main.php b/ext/emoticons_list/main.php index 40efaf8c..14120548 100644 --- a/ext/emoticons_list/main.php +++ b/ext/emoticons_list/main.php @@ -5,6 +5,9 @@ */ class EmoticonList extends Extension { + /** @var EmoticonListTheme */ + protected $theme; + public function onPageRequest(PageRequestEvent $event) { if ($event->page_matches("emote/list")) { diff --git a/ext/featured/main.php b/ext/featured/main.php index bcb46971..5979ba21 100644 --- a/ext/featured/main.php +++ b/ext/featured/main.php @@ -2,6 +2,9 @@ class Featured extends Extension { + /** @var FeaturedTheme */ + protected $theme; + public function onInitExt(InitExtEvent $event) { global $config; diff --git a/ext/handle_svg/main.php b/ext/handle_svg/main.php index 2cb48578..73dee3d6 100644 --- a/ext/handle_svg/main.php +++ b/ext/handle_svg/main.php @@ -3,6 +3,9 @@ use enshrined\svgSanitize\Sanitizer; class SVGFileHandler extends DataHandlerExtension { + /** @var SVGFileHandlerTheme */ + protected $theme; + public function onMediaCheckProperties(MediaCheckPropertiesEvent $event) { switch ($event->ext) { diff --git a/ext/help_pages/main.php b/ext/help_pages/main.php index c3db0d86..69043ba6 100644 --- a/ext/help_pages/main.php +++ b/ext/help_pages/main.php @@ -32,6 +32,9 @@ class HelpPageBuildingEvent extends Event class HelpPages extends Extension { + /** @var HelpPagesTheme */ + protected $theme; + public const SEARCH = "search"; private $pages; diff --git a/ext/holiday/main.php b/ext/holiday/main.php index 3a15dc7c..9c722fd9 100644 --- a/ext/holiday/main.php +++ b/ext/holiday/main.php @@ -2,6 +2,9 @@ class Holiday extends Extension { + /** @var HolidayTheme */ + protected $theme; + public function onInitExt(InitExtEvent $event) { global $config; diff --git a/ext/image/main.php b/ext/image/main.php index e6ef995b..7f60eb04 100644 --- a/ext/image/main.php +++ b/ext/image/main.php @@ -7,6 +7,9 @@ require_once "config.php"; */ class ImageIO extends Extension { + /** @var ImageIOTheme */ + protected $theme; + const COLLISION_OPTIONS = ['Error'=>ImageConfig::COLLISION_ERROR, 'Merge'=>ImageConfig::COLLISION_MERGE]; const EXIF_READ_FUNCTION = "exif_read_data"; diff --git a/ext/media/main.php b/ext/media/main.php index cc2202a8..980e85f4 100644 --- a/ext/media/main.php +++ b/ext/media/main.php @@ -13,6 +13,9 @@ class MediaException extends SCoreException class Media extends Extension { + /** @var MediaTheme */ + protected $theme; + const WEBP_LOSSY = "webp-lossy"; const WEBP_LOSSLESS = "webp-lossless"; diff --git a/ext/numeric_score/main.php b/ext/numeric_score/main.php index 2592388a..f6e1b315 100644 --- a/ext/numeric_score/main.php +++ b/ext/numeric_score/main.php @@ -17,6 +17,9 @@ class NumericScoreSetEvent extends Event class NumericScore extends Extension { + /** @var NumericScoreTheme */ + protected $theme; + public function onDisplayingImage(DisplayingImageEvent $event) { global $user; diff --git a/ext/oekaki/main.php b/ext/oekaki/main.php index fef3e9cb..8ff5eb49 100644 --- a/ext/oekaki/main.php +++ b/ext/oekaki/main.php @@ -2,6 +2,9 @@ class Oekaki extends Extension { + /** @var OekakiTheme */ + protected $theme; + public function onPageRequest(PageRequestEvent $event) { global $user, $page; diff --git a/ext/post_titles/main.php b/ext/post_titles/main.php index c810336c..66789762 100644 --- a/ext/post_titles/main.php +++ b/ext/post_titles/main.php @@ -5,6 +5,9 @@ require_once "events/post_title_set_event.php"; class PostTitles extends Extension { + /** @var PostTitlesTheme */ + protected $theme; + public function get_priority(): int { return 60; diff --git a/ext/qr_code/main.php b/ext/qr_code/main.php index 1c6e2d8f..76b3db56 100644 --- a/ext/qr_code/main.php +++ b/ext/qr_code/main.php @@ -2,6 +2,9 @@ class QRImage extends Extension { + /** @var QRImageTheme */ + protected $theme; + public function onDisplayingImage(DisplayingImageEvent $event) { $this->theme->links_block(make_http(make_link('image/'.$event->image->id.'.'.$event->image->ext))); diff --git a/ext/random_image/main.php b/ext/random_image/main.php index 516ad037..b33fe4b8 100644 --- a/ext/random_image/main.php +++ b/ext/random_image/main.php @@ -2,6 +2,9 @@ class RandomImage extends Extension { + /** @var RandomImageTheme */ + protected $theme; + public function onPageRequest(PageRequestEvent $event) { global $page; diff --git a/ext/relationships/main.php b/ext/relationships/main.php index ecd7d72b..42220db1 100644 --- a/ext/relationships/main.php +++ b/ext/relationships/main.php @@ -16,6 +16,9 @@ class ImageRelationshipSetEvent extends Event class Relationships extends Extension { + /** @var RelationshipsTheme */ + protected $theme; + public const NAME = "Relationships"; public function onInitExt(InitExtEvent $event) diff --git a/ext/report_image/main.php b/ext/report_image/main.php index ca406ec2..32f38767 100644 --- a/ext/report_image/main.php +++ b/ext/report_image/main.php @@ -43,6 +43,9 @@ class ImageReport class ReportImage extends Extension { + /** @var ReportImageTheme */ + protected $theme; + public function onPageRequest(PageRequestEvent $event) { global $page, $user; diff --git a/ext/resize/main.php b/ext/resize/main.php index 472a5d21..234f65e7 100644 --- a/ext/resize/main.php +++ b/ext/resize/main.php @@ -14,6 +14,9 @@ abstract class ResizeConfig */ class ResizeImage extends Extension { + /** @var ResizeImageTheme */ + protected $theme; + /** * Needs to be after the data processing extensions */ diff --git a/ext/rotate/main.php b/ext/rotate/main.php index eefa90be..42ce6304 100644 --- a/ext/rotate/main.php +++ b/ext/rotate/main.php @@ -12,6 +12,9 @@ class ImageRotateException extends SCoreException */ class RotateImage extends Extension { + /** @var RotateImageTheme */ + protected $theme; + const SUPPORTED_EXT = ["jpg","jpeg","png","gif","webp"]; public function onInitExt(InitExtEvent $event) diff --git a/ext/rule34/main.php b/ext/rule34/main.php index 7edd82c3..cdc33380 100644 --- a/ext/rule34/main.php +++ b/ext/rule34/main.php @@ -10,6 +10,9 @@ if ( // kill these glitched requests immediately class Rule34 extends Extension { + /** @var Rule34Theme */ + protected $theme; + public function onImageDeletion(ImageDeletionEvent $event) { global $database; diff --git a/ext/setup/main.php b/ext/setup/main.php index 0171e6de..02bc95d4 100644 --- a/ext/setup/main.php +++ b/ext/setup/main.php @@ -23,6 +23,9 @@ class ConfigSaveEvent extends Event */ class SetupBuildingEvent extends Event { + /** @var SetupTheme */ + protected $theme; + /** @var SetupPanel */ public $panel; diff --git a/ext/sitemap/main.php b/ext/sitemap/main.php index 4fa686a2..3598f2b1 100644 --- a/ext/sitemap/main.php +++ b/ext/sitemap/main.php @@ -86,11 +86,13 @@ class XMLSitemap extends Extension /* --- Add latest images to sitemap with higher priority --- */ $latestimages = Image::find_images(0, 50, []); $latestimages_urllist = []; + $latest_image = null; foreach ($latestimages as $arrayid => $image) { // create url from image id's $latestimages_urllist[$arrayid] = "post/view/$image->id"; + $latest_image = $image; } - $this->add_sitemap_queue($latestimages_urllist, "monthly", "0.8", date("Y-m-d", strtotime($image->posted))); + $this->add_sitemap_queue($latestimages_urllist, "monthly", "0.8", date("Y-m-d", strtotime($latest_image->posted))); /* --- Add other tags --- */ $other_tags = $database->get_all("SELECT tag, count FROM tags ORDER BY `count` DESC LIMIT 21,10000000"); diff --git a/ext/source_history/main.php b/ext/source_history/main.php index 602bd14f..5b52a781 100644 --- a/ext/source_history/main.php +++ b/ext/source_history/main.php @@ -2,6 +2,9 @@ class SourceHistory extends Extension { + /** @var SourceHistoryTheme */ + protected $theme; + // in before source are actually set, so that "get current source" works public function get_priority(): int { diff --git a/ext/tag_categories/main.php b/ext/tag_categories/main.php index d22a0b5e..0ca1a7c9 100644 --- a/ext/tag_categories/main.php +++ b/ext/tag_categories/main.php @@ -5,6 +5,9 @@ require_once "config.php"; class TagCategories extends Extension { + /** @var TagCategoriesTheme */ + protected $theme; + public function onInitExt(InitExtEvent $event) { global $config; diff --git a/ext/tag_edit/main.php b/ext/tag_edit/main.php index fd0b1db4..4df7d297 100644 --- a/ext/tag_edit/main.php +++ b/ext/tag_edit/main.php @@ -126,6 +126,9 @@ class TagTermParseEvent extends Event class TagEdit extends Extension { + /** @var TagEditTheme */ + protected $theme; + public function onPageRequest(PageRequestEvent $event) { global $user, $page; diff --git a/ext/tagger/main.php b/ext/tagger/main.php index eacbbc50..645d3a19 100644 --- a/ext/tagger/main.php +++ b/ext/tagger/main.php @@ -2,6 +2,9 @@ class Tagger extends Extension { + /** @var TaggerTheme */ + protected $theme; + public function onDisplayingImage(DisplayingImageEvent $event) { global $page, $user; diff --git a/ext/tagger/theme.php b/ext/tagger/theme.php index 815b11fc..a8fa9407 100644 --- a/ext/tagger/theme.php +++ b/ext/tagger/theme.php @@ -11,7 +11,7 @@ use function MicroHTML\INPUT; class TaggerTheme extends Themelet { - public function build_tagger(Page $page, $event) + public function build_tagger(Page $page, DisplayingImageEvent $event) { // Initialization code $base_href = get_base_href(); diff --git a/ext/transcode/main.php b/ext/transcode/main.php index adcc5619..e0a66b35 100644 --- a/ext/transcode/main.php +++ b/ext/transcode/main.php @@ -11,6 +11,9 @@ class ImageTranscodeException extends SCoreException class TranscodeImage extends Extension { + /** @var TranscodeImageTheme */ + protected $theme; + const ACTION_BULK_TRANSCODE = "bulk_transcode"; const INPUT_FORMATS = [ diff --git a/ext/trash/main.php b/ext/trash/main.php index d39ab965..afeccb3e 100644 --- a/ext/trash/main.php +++ b/ext/trash/main.php @@ -7,6 +7,9 @@ abstract class TrashConfig class Trash extends Extension { + /** @var TrashTheme */ + protected $theme; + public function get_priority(): int { // Needs to be early to intercept delete events diff --git a/ext/update/main.php b/ext/update/main.php index fa3b9c33..15ea9434 100644 --- a/ext/update/main.php +++ b/ext/update/main.php @@ -2,6 +2,9 @@ class Update extends Extension { + /** @var UpdateTheme */ + protected $theme; + public function onInitExt(InitExtEvent $event) { global $config;