set theme classes

This commit is contained in:
Shish 2020-02-04 00:46:36 +00:00
parent 81cd320928
commit e46b319295
35 changed files with 103 additions and 2 deletions

View file

@ -2,6 +2,9 @@
class AutoComplete extends Extension
{
/** @var AutoCompleteTheme */
protected $theme;
public function get_priority(): int
{
return 30;

View file

@ -2,6 +2,9 @@
class Blocks extends Extension
{
/** @var BlocksTheme */
protected $theme;
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
{
global $database;

View file

@ -2,6 +2,9 @@
class Blotter extends Extension
{
/** @var BlotterTheme */
protected $theme;
public function onInitExt(InitExtEvent $event)
{
global $config;

View file

@ -50,6 +50,9 @@ class BulkActionEvent extends Event
class BulkActions extends Extension
{
/** @var BulkActionsTheme */
protected $theme;
public function onPostListBuilding(PostListBuildingEvent $event)
{
global $page, $user;

View file

@ -15,6 +15,9 @@ class BulkAddEvent extends Event
class BulkAdd extends Extension
{
/** @var BulkAddTheme */
protected $theme;
public function onPageRequest(PageRequestEvent $event)
{
global $page, $user;

View file

@ -2,6 +2,9 @@
class BulkAddCSV extends Extension
{
/** @var BulkAddCSVTheme */
protected $theme;
public function onPageRequest(PageRequestEvent $event)
{
global $page, $user;

View file

@ -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

View file

@ -2,6 +2,9 @@
class Downtime extends Extension
{
/** @var DowntimeTheme */
protected $theme;
public function get_priority(): int
{
return 10;

View file

@ -5,6 +5,9 @@
*/
class EmoticonList extends Extension
{
/** @var EmoticonListTheme */
protected $theme;
public function onPageRequest(PageRequestEvent $event)
{
if ($event->page_matches("emote/list")) {

View file

@ -2,6 +2,9 @@
class Featured extends Extension
{
/** @var FeaturedTheme */
protected $theme;
public function onInitExt(InitExtEvent $event)
{
global $config;

View file

@ -3,6 +3,9 @@ use enshrined\svgSanitize\Sanitizer;
class SVGFileHandler extends DataHandlerExtension
{
/** @var SVGFileHandlerTheme */
protected $theme;
public function onMediaCheckProperties(MediaCheckPropertiesEvent $event)
{
switch ($event->ext) {

View file

@ -32,6 +32,9 @@ class HelpPageBuildingEvent extends Event
class HelpPages extends Extension
{
/** @var HelpPagesTheme */
protected $theme;
public const SEARCH = "search";
private $pages;

View file

@ -2,6 +2,9 @@
class Holiday extends Extension
{
/** @var HolidayTheme */
protected $theme;
public function onInitExt(InitExtEvent $event)
{
global $config;

View file

@ -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";

View file

@ -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";

View file

@ -17,6 +17,9 @@ class NumericScoreSetEvent extends Event
class NumericScore extends Extension
{
/** @var NumericScoreTheme */
protected $theme;
public function onDisplayingImage(DisplayingImageEvent $event)
{
global $user;

View file

@ -2,6 +2,9 @@
class Oekaki extends Extension
{
/** @var OekakiTheme */
protected $theme;
public function onPageRequest(PageRequestEvent $event)
{
global $user, $page;

View file

@ -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;

View file

@ -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)));

View file

@ -2,6 +2,9 @@
class RandomImage extends Extension
{
/** @var RandomImageTheme */
protected $theme;
public function onPageRequest(PageRequestEvent $event)
{
global $page;

View file

@ -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)

View file

@ -43,6 +43,9 @@ class ImageReport
class ReportImage extends Extension
{
/** @var ReportImageTheme */
protected $theme;
public function onPageRequest(PageRequestEvent $event)
{
global $page, $user;

View file

@ -14,6 +14,9 @@ abstract class ResizeConfig
*/
class ResizeImage extends Extension
{
/** @var ResizeImageTheme */
protected $theme;
/**
* Needs to be after the data processing extensions
*/

View file

@ -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)

View file

@ -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;

View file

@ -23,6 +23,9 @@ class ConfigSaveEvent extends Event
*/
class SetupBuildingEvent extends Event
{
/** @var SetupTheme */
protected $theme;
/** @var SetupPanel */
public $panel;

View file

@ -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");

View file

@ -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
{

View file

@ -5,6 +5,9 @@ require_once "config.php";
class TagCategories extends Extension
{
/** @var TagCategoriesTheme */
protected $theme;
public function onInitExt(InitExtEvent $event)
{
global $config;

View file

@ -126,6 +126,9 @@ class TagTermParseEvent extends Event
class TagEdit extends Extension
{
/** @var TagEditTheme */
protected $theme;
public function onPageRequest(PageRequestEvent $event)
{
global $user, $page;

View file

@ -2,6 +2,9 @@
class Tagger extends Extension
{
/** @var TaggerTheme */
protected $theme;
public function onDisplayingImage(DisplayingImageEvent $event)
{
global $page, $user;

View file

@ -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();

View file

@ -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 = [

View file

@ -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

View file

@ -2,6 +2,9 @@
class Update extends Extension
{
/** @var UpdateTheme */
protected $theme;
public function onInitExt(InitExtEvent $event)
{
global $config;