set theme classes
This commit is contained in:
parent
81cd320928
commit
e46b319295
35 changed files with 103 additions and 2 deletions
|
@ -2,6 +2,9 @@
|
|||
|
||||
class AutoComplete extends Extension
|
||||
{
|
||||
/** @var AutoCompleteTheme */
|
||||
protected $theme;
|
||||
|
||||
public function get_priority(): int
|
||||
{
|
||||
return 30;
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
class Blocks extends Extension
|
||||
{
|
||||
/** @var BlocksTheme */
|
||||
protected $theme;
|
||||
|
||||
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
|
||||
{
|
||||
global $database;
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
class Blotter extends Extension
|
||||
{
|
||||
/** @var BlotterTheme */
|
||||
protected $theme;
|
||||
|
||||
public function onInitExt(InitExtEvent $event)
|
||||
{
|
||||
global $config;
|
||||
|
|
|
@ -50,6 +50,9 @@ class BulkActionEvent extends Event
|
|||
|
||||
class BulkActions extends Extension
|
||||
{
|
||||
/** @var BulkActionsTheme */
|
||||
protected $theme;
|
||||
|
||||
public function onPostListBuilding(PostListBuildingEvent $event)
|
||||
{
|
||||
global $page, $user;
|
||||
|
|
|
@ -15,6 +15,9 @@ class BulkAddEvent extends Event
|
|||
|
||||
class BulkAdd extends Extension
|
||||
{
|
||||
/** @var BulkAddTheme */
|
||||
protected $theme;
|
||||
|
||||
public function onPageRequest(PageRequestEvent $event)
|
||||
{
|
||||
global $page, $user;
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
class BulkAddCSV extends Extension
|
||||
{
|
||||
/** @var BulkAddCSVTheme */
|
||||
protected $theme;
|
||||
|
||||
public function onPageRequest(PageRequestEvent $event)
|
||||
{
|
||||
global $page, $user;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
class Downtime extends Extension
|
||||
{
|
||||
/** @var DowntimeTheme */
|
||||
protected $theme;
|
||||
|
||||
public function get_priority(): int
|
||||
{
|
||||
return 10;
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
*/
|
||||
class EmoticonList extends Extension
|
||||
{
|
||||
/** @var EmoticonListTheme */
|
||||
protected $theme;
|
||||
|
||||
public function onPageRequest(PageRequestEvent $event)
|
||||
{
|
||||
if ($event->page_matches("emote/list")) {
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
class Featured extends Extension
|
||||
{
|
||||
/** @var FeaturedTheme */
|
||||
protected $theme;
|
||||
|
||||
public function onInitExt(InitExtEvent $event)
|
||||
{
|
||||
global $config;
|
||||
|
|
|
@ -3,6 +3,9 @@ use enshrined\svgSanitize\Sanitizer;
|
|||
|
||||
class SVGFileHandler extends DataHandlerExtension
|
||||
{
|
||||
/** @var SVGFileHandlerTheme */
|
||||
protected $theme;
|
||||
|
||||
public function onMediaCheckProperties(MediaCheckPropertiesEvent $event)
|
||||
{
|
||||
switch ($event->ext) {
|
||||
|
|
|
@ -32,6 +32,9 @@ class HelpPageBuildingEvent extends Event
|
|||
|
||||
class HelpPages extends Extension
|
||||
{
|
||||
/** @var HelpPagesTheme */
|
||||
protected $theme;
|
||||
|
||||
public const SEARCH = "search";
|
||||
|
||||
private $pages;
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
class Holiday extends Extension
|
||||
{
|
||||
/** @var HolidayTheme */
|
||||
protected $theme;
|
||||
|
||||
public function onInitExt(InitExtEvent $event)
|
||||
{
|
||||
global $config;
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -17,6 +17,9 @@ class NumericScoreSetEvent extends Event
|
|||
|
||||
class NumericScore extends Extension
|
||||
{
|
||||
/** @var NumericScoreTheme */
|
||||
protected $theme;
|
||||
|
||||
public function onDisplayingImage(DisplayingImageEvent $event)
|
||||
{
|
||||
global $user;
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
class Oekaki extends Extension
|
||||
{
|
||||
/** @var OekakiTheme */
|
||||
protected $theme;
|
||||
|
||||
public function onPageRequest(PageRequestEvent $event)
|
||||
{
|
||||
global $user, $page;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)));
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
class RandomImage extends Extension
|
||||
{
|
||||
/** @var RandomImageTheme */
|
||||
protected $theme;
|
||||
|
||||
public function onPageRequest(PageRequestEvent $event)
|
||||
{
|
||||
global $page;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -43,6 +43,9 @@ class ImageReport
|
|||
|
||||
class ReportImage extends Extension
|
||||
{
|
||||
/** @var ReportImageTheme */
|
||||
protected $theme;
|
||||
|
||||
public function onPageRequest(PageRequestEvent $event)
|
||||
{
|
||||
global $page, $user;
|
||||
|
|
|
@ -14,6 +14,9 @@ abstract class ResizeConfig
|
|||
*/
|
||||
class ResizeImage extends Extension
|
||||
{
|
||||
/** @var ResizeImageTheme */
|
||||
protected $theme;
|
||||
|
||||
/**
|
||||
* Needs to be after the data processing extensions
|
||||
*/
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -23,6 +23,9 @@ class ConfigSaveEvent extends Event
|
|||
*/
|
||||
class SetupBuildingEvent extends Event
|
||||
{
|
||||
/** @var SetupTheme */
|
||||
protected $theme;
|
||||
|
||||
/** @var SetupPanel */
|
||||
public $panel;
|
||||
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -5,6 +5,9 @@ require_once "config.php";
|
|||
|
||||
class TagCategories extends Extension
|
||||
{
|
||||
/** @var TagCategoriesTheme */
|
||||
protected $theme;
|
||||
|
||||
public function onInitExt(InitExtEvent $event)
|
||||
{
|
||||
global $config;
|
||||
|
|
|
@ -126,6 +126,9 @@ class TagTermParseEvent extends Event
|
|||
|
||||
class TagEdit extends Extension
|
||||
{
|
||||
/** @var TagEditTheme */
|
||||
protected $theme;
|
||||
|
||||
public function onPageRequest(PageRequestEvent $event)
|
||||
{
|
||||
global $user, $page;
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
class Tagger extends Extension
|
||||
{
|
||||
/** @var TaggerTheme */
|
||||
protected $theme;
|
||||
|
||||
public function onDisplayingImage(DisplayingImageEvent $event)
|
||||
{
|
||||
global $page, $user;
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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 = [
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
class Update extends Extension
|
||||
{
|
||||
/** @var UpdateTheme */
|
||||
protected $theme;
|
||||
|
||||
public function onInitExt(InitExtEvent $event)
|
||||
{
|
||||
global $config;
|
||||
|
|
Reference in a new issue