[themes] void return type for display_* functions

This commit is contained in:
Shish 2024-01-15 14:23:00 +00:00
parent 9c742b56b8
commit a1f22ef67c
71 changed files with 143 additions and 143 deletions

View file

@ -107,7 +107,7 @@ class BaseThemelet
);
}
public function display_paginator(Page $page, string $base, ?string $query, int $page_number, int $total_pages, bool $show_random = false)
public function display_paginator(Page $page, string $base, ?string $query, int $page_number, int $total_pages, bool $show_random = false): void
{
if ($total_pages == 0) {
$total_pages = 1;

View file

@ -9,7 +9,7 @@ class AdminPageTheme extends Themelet
/*
* Show the basics of a page, for other extensions to add to
*/
public function display_page()
public function display_page(): void
{
global $page;

View file

@ -40,13 +40,13 @@ class ApprovalTheme extends Themelet
);
}
public function display_admin_block(SetupBuildingEvent $event)
public function display_admin_block(SetupBuildingEvent $event): void
{
$sb = $event->panel->create_new_block("Approval");
$sb->add_bool_option(ApprovalConfig::IMAGES, "Posts: ");
}
public function display_admin_form()
public function display_admin_form(): void
{
global $page;

View file

@ -8,12 +8,12 @@ use function MicroHTML\TEXTAREA;
class BiographyTheme extends Themelet
{
public function display_biography(Page $page, string $bio)
public function display_biography(Page $page, string $bio): void
{
$page->add_block(new Block("About Me", format_text($bio), "main", 30, "about-me"));
}
public function display_composer(Page $page, string $bio)
public function display_composer(Page $page, string $bio): void
{
$html = SHM_SIMPLE_FORM(
make_link("biography"),

View file

@ -16,7 +16,7 @@ use function MicroHTML\OPTION;
class BlocksTheme extends Themelet
{
public function display_blocks($blocks)
public function display_blocks($blocks): void
{
global $page;

View file

@ -6,7 +6,7 @@ namespace Shimmie2;
class BlotterTheme extends Themelet
{
public function display_editor($entries)
public function display_editor($entries): void
{
global $page;
$html = $this->get_html_for_blotter_editor($entries);
@ -16,7 +16,7 @@ class BlotterTheme extends Themelet
$page->add_block(new Block("Navigation", "<a href='".make_link()."'>Index</a>", "left", 0));
}
public function display_blotter_page($entries)
public function display_blotter_page($entries): void
{
global $page;
$html = $this->get_html_for_blotter_page($entries);

View file

@ -6,7 +6,7 @@ namespace Shimmie2;
class BulkActionsTheme extends Themelet
{
public function display_selector(Page $page, array $actions, string $query)
public function display_selector(Page $page, array $actions, string $query): void
{
$body = "<input type='hidden' name='bulk_selected_ids' id='bulk_selected_ids' />
<input id='bulk_selector_activate' type='button' onclick='activate_bulk_selector();' value='Activate (M)anual Select' accesskey='m'/>

View file

@ -13,7 +13,7 @@ class BulkAddTheme extends Themelet
*
* @param UploadResult[] $results
*/
public function display_upload_results(Page $page, array $results)
public function display_upload_results(Page $page, array $results): void
{
$page->set_title("Adding folder");
$page->set_heading("Adding folder");
@ -34,7 +34,7 @@ class BulkAddTheme extends Themelet
* links to bulk_add with POST[dir] set to the name of a server-side
* directory full of images
*/
public function display_admin_block()
public function display_admin_block(): void
{
global $page;
$html = "

View file

@ -11,7 +11,7 @@ class BulkAddCSVTheme extends Themelet
/*
* Show a standard page for results to be put into
*/
public function display_upload_results(Page $page)
public function display_upload_results(Page $page): void
{
$page->set_title("Adding posts from csv");
$page->set_heading("Adding posts from csv");
@ -26,7 +26,7 @@ class BulkAddCSVTheme extends Themelet
* links to bulk_add_csv with POST[csv] set to the name of a server-side
* csv file
*/
public function display_admin_block()
public function display_admin_block(): void
{
global $page;
$html = "

View file

@ -13,7 +13,7 @@ class CommentListTheme extends Themelet
/**
* Display a page with a list of images, and for each image, the image's comments.
*/
public function display_comment_list(array $images, int $page_number, int $total_pages, bool $can_post)
public function display_comment_list(array $images, int $page_number, int $total_pages, bool $can_post): void
{
global $config, $page, $user;
@ -91,7 +91,7 @@ class CommentListTheme extends Themelet
}
}
public function display_admin_block()
public function display_admin_block(): void
{
global $page;
@ -113,7 +113,7 @@ class CommentListTheme extends Themelet
*
* @param Comment[] $comments An array of Comment objects to be shown
*/
public function display_recent_comments(array $comments)
public function display_recent_comments(array $comments): void
{
global $page;
$this->show_anon_id = false;
@ -130,7 +130,7 @@ class CommentListTheme extends Themelet
*
* @param Comment[] $comments
*/
public function display_image_comments(Image $image, array $comments, bool $postbox)
public function display_image_comments(Image $image, array $comments, bool $postbox): void
{
global $page;
$this->show_anon_id = true;
@ -149,7 +149,7 @@ class CommentListTheme extends Themelet
*
* @param Comment[] $comments
*/
public function display_recent_user_comments(array $comments, User $user)
public function display_recent_user_comments(array $comments, User $user): void
{
global $page;
$html = "";
@ -164,7 +164,7 @@ class CommentListTheme extends Themelet
$page->add_block(new Block("Comments", $html, "left", 70, "comment-list-user"));
}
public function display_all_user_comments(array $comments, int $page_number, int $total_pages, User $user)
public function display_all_user_comments(array $comments, int $page_number, int $total_pages, User $user): void
{
global $page;

View file

@ -159,7 +159,7 @@ class CronUploaderTheme extends Themelet
return (string)$html;
}
public function display_form(array $failed_dirs)
public function display_form(array $failed_dirs): void
{
global $page;

View file

@ -9,7 +9,7 @@ class DowntimeTheme extends Themelet
/**
* Show the admin that downtime mode is enabled
*/
public function display_notification(Page $page)
public function display_notification(Page $page): void
{
$page->add_block(new Block(
"Downtime",
@ -22,7 +22,7 @@ class DowntimeTheme extends Themelet
/**
* Display $message and exit
*/
public function display_message(string $message)
public function display_message(string $message): void
{
global $config, $user, $page;
$theme_name = $config->get_string(SetupConfig::THEME);

View file

@ -6,7 +6,7 @@ namespace Shimmie2;
class EmoticonListTheme extends Themelet
{
public function display_emotes(array $list)
public function display_emotes(array $list): void
{
global $page;
$data_href = get_base_href();

View file

@ -16,7 +16,7 @@ class ETTheme extends Themelet
*
* $info = an array of ($name => $value)
*/
public function display_info_page($yaml)
public function display_info_page($yaml): void
{
global $page;

View file

@ -27,7 +27,7 @@ class ExtManagerTheme extends Themelet
/**
* @param ExtensionInfo[] $extensions
*/
public function display_table(Page $page, array $extensions, bool $editable)
public function display_table(Page $page, array $extensions, bool $editable): void
{
$tbody = TBODY();
@ -104,7 +104,7 @@ class ExtManagerTheme extends Themelet
$page->add_block(new Block("Extension Manager", $form));
}
public function display_doc(Page $page, ExtensionInfo $info)
public function display_doc(Page $page, ExtensionInfo $info): void
{
$author = emptyHTML();
if (count($info->authors) > 0) {

View file

@ -10,7 +10,7 @@ use function MicroHTML\{INPUT, LABEL, SMALL, TEXTAREA, TR, TD, TABLE, TH, TBODY,
class ForumTheme extends Themelet
{
public function display_thread_list(Page $page, $threads, $showAdminOptions, $pageNumber, $totalPages)
public function display_thread_list(Page $page, $threads, $showAdminOptions, $pageNumber, $totalPages): void
{
if (count($threads) == 0) {
$html = "There are no threads to show.";
@ -27,7 +27,7 @@ class ForumTheme extends Themelet
public function display_new_thread_composer(Page $page, $threadText = null, $threadTitle = null)
public function display_new_thread_composer(Page $page, $threadText = null, $threadTitle = null): void
{
global $config, $user;
$max_characters = $config->get_int('forumMaxCharsPerPost');
@ -75,7 +75,7 @@ class ForumTheme extends Themelet
public function display_new_post_composer(Page $page, $threadID)
public function display_new_post_composer(Page $page, $threadID): void
{
global $config;
@ -109,7 +109,7 @@ class ForumTheme extends Themelet
public function display_thread($posts, $showAdminOptions, $threadTitle, $threadID, $pageNumber, $totalPages)
public function display_thread($posts, $showAdminOptions, $threadTitle, $threadID, $pageNumber, $totalPages): void
{
global $config, $page/*, $user*/;

View file

@ -6,7 +6,7 @@ namespace Shimmie2;
class CBZFileHandlerTheme extends Themelet
{
public function display_image(Image $image)
public function display_image(Image $image): void
{
global $page;
$data_href = get_base_href();

View file

@ -6,7 +6,7 @@ namespace Shimmie2;
class IcoFileHandlerTheme extends Themelet
{
public function display_image(Image $image)
public function display_image(Image $image): void
{
global $page;
$ilink = $image->get_image_link();

View file

@ -6,7 +6,7 @@ namespace Shimmie2;
class MP3FileHandlerTheme extends Themelet
{
public function display_image(Image $image)
public function display_image(Image $image): void
{
global $page;
$data_href = get_base_href();

View file

@ -8,7 +8,7 @@ use function MicroHTML\IMG;
class PixelFileHandlerTheme extends Themelet
{
public function display_image(Image $image)
public function display_image(Image $image): void
{
global $config, $page;
@ -25,7 +25,7 @@ class PixelFileHandlerTheme extends Themelet
$page->add_block(new Block("Image", $html, "main", 10));
}
public function display_metadata(Image $image)
public function display_metadata(Image $image): void
{
global $page;

View file

@ -6,7 +6,7 @@ namespace Shimmie2;
class SVGFileHandlerTheme extends Themelet
{
public function display_image(Image $image)
public function display_image(Image $image): void
{
global $page;
$ilink = make_link("get_svg/{$image->id}/{$image->id}.svg");

View file

@ -8,7 +8,7 @@ use function MicroHTML\{A, BR, VIDEO, SOURCE, emptyHTML};
class VideoFileHandlerTheme extends Themelet
{
public function display_image(Image $image)
public function display_image(Image $image): void
{
global $config, $page;

View file

@ -6,7 +6,7 @@ namespace Shimmie2;
class HelpPagesTheme extends Themelet
{
public function display_list_page(array $pages)
public function display_list_page(array $pages): void
{
global $page;
@ -23,7 +23,7 @@ class HelpPagesTheme extends Themelet
$page->add_block(new Block("Help Pages", "See list of pages to left"));
}
public function display_help_page(string $title)
public function display_help_page(string $title): void
{
global $page;

View file

@ -6,7 +6,7 @@ namespace Shimmie2;
class HolidayTheme extends Themelet
{
public function display_holiday(?string $holiday)
public function display_holiday(?string $holiday): void
{
global $page;
if ($holiday) {

View file

@ -22,7 +22,7 @@ class IndexTheme extends Themelet
$this->search_terms = $search_terms;
}
public function display_intro(Page $page)
public function display_intro(Page $page): void
{
$text = "
<div style='text-align: left;'>
@ -44,7 +44,7 @@ and of course start organising your images :-)
/**
* @param Image[] $images
*/
public function display_page(Page $page, array $images)
public function display_page(Page $page, array $images): void
{
$this->display_shortwiki($page);
@ -63,7 +63,7 @@ and of course start organising your images :-)
/**
* @param string[] $parts
*/
public function display_admin_block(array $parts)
public function display_admin_block(array $parts): void
{
global $page;
$page->add_block(new Block("List Controls", join("<br>", $parts), "left", 50));

View file

@ -6,7 +6,7 @@ namespace Shimmie2;
class IPBanTheme extends Themelet
{
public function display_bans(Page $page, $table, $paginator)
public function display_bans(Page $page, $table, $paginator): void
{
$html = "
<a href='".make_link("ip_ban/list", "r__size=1000000")."'>Show All Active</a> /

View file

@ -6,7 +6,7 @@ namespace Shimmie2;
class LogDatabaseTheme extends Themelet
{
public function display_events($table, $paginator)
public function display_events($table, $paginator): void
{
global $page;
$page->set_title("Event Log");

View file

@ -6,7 +6,7 @@ namespace Shimmie2;
class NotATagTheme extends Themelet
{
public function display_untags(Page $page, $table, $paginator)
public function display_untags(Page $page, $table, $paginator): void
{
$page->set_title("UnTags");
$page->set_heading("UnTags");

View file

@ -74,7 +74,7 @@ class NotesTheme extends Themelet
}
public function display_note_list($images, $pageNumber, $totalPages)
public function display_note_list($images, $pageNumber, $totalPages): void
{
global $page;
$pool_images = '';
@ -94,7 +94,7 @@ class NotesTheme extends Themelet
$page->add_block(new Block("Notes", $pool_images, "main", 20));
}
public function display_note_requests($images, $pageNumber, $totalPages)
public function display_note_requests($images, $pageNumber, $totalPages): void
{
global $page;
@ -157,7 +157,7 @@ class NotesTheme extends Themelet
return $html;
}
public function display_histories($histories, $pageNumber, $totalPages)
public function display_histories($histories, $pageNumber, $totalPages): void
{
global $page;
@ -170,7 +170,7 @@ class NotesTheme extends Themelet
$this->display_paginator($page, "note/updated", null, $pageNumber, $totalPages);
}
public function display_history($histories, $pageNumber, $totalPages)
public function display_history($histories, $pageNumber, $totalPages): void
{
global $page;

View file

@ -6,7 +6,7 @@ namespace Shimmie2;
class PrivMsgTheme extends Themelet
{
public function display_pms(Page $page, $pms)
public function display_pms(Page $page, $pms): void
{
global $user;
@ -58,7 +58,7 @@ class PrivMsgTheme extends Themelet
$page->add_block(new Block("Private Messages", $html, "main", 40, "private-messages"));
}
public function display_composer(Page $page, User $from, User $to, $subject = "")
public function display_composer(Page $page, User $from, User $to, $subject = ""): void
{
global $user;
$post_url = make_link("pm/send");
@ -79,7 +79,7 @@ EOD;
$page->add_block(new Block("Write a PM", $html, "main", 50));
}
public function display_message(Page $page, User $from, User $to, PM $pm)
public function display_message(Page $page, User $from, User $to, PM $pm): void
{
$page->set_title("Private Message");
$page->set_heading(html_escape($pm->subject));

View file

@ -10,7 +10,7 @@ use function MicroHTML\IMG;
class RandomImageTheme extends Themelet
{
public function display_random(Page $page, Image $image)
public function display_random(Page $page, Image $image): void
{
$page->add_block(new Block("Random Post", $this->build_random_html($image), "left", 8));
}

View file

@ -19,7 +19,7 @@ class RandomListTheme extends Themelet
/**
* @param Image[] $images
*/
public function display_page(Page $page, array $images)
public function display_page(Page $page, array $images): void
{
$page->title = "Random Posts";

View file

@ -25,7 +25,7 @@ class RatingsTheme extends Themelet
);
}
public function display_form(array $current_ratings)
public function display_form(array $current_ratings): void
{
global $page;

View file

@ -23,7 +23,7 @@ class RegenThumbTheme extends Themelet
/**
* Show a link to the new thumbnail.
*/
public function display_results(Page $page, Image $image)
public function display_results(Page $page, Image $image): void
{
$page->set_title("Thumbnail Regenerated");
$page->set_heading("Thumbnail Regenerated");

View file

@ -16,7 +16,7 @@ class ReplaceFileTheme extends Themelet
/**
* Only allows 1 file to be uploaded - for replacing another image file.
*/
public function display_replace_page(Page $page, int $image_id)
public function display_replace_page(Page $page, int $image_id): void
{
global $config, $page;
$tl_enabled = ($config->get_string(UploadConfig::TRANSLOAD_ENGINE, "none") != "none");

View file

@ -8,7 +8,7 @@ use function MicroHTML\INPUT;
class ReportImageTheme extends Themelet
{
public function display_reported_images(Page $page, array $reports)
public function display_reported_images(Page $page, array $reports): void
{
global $config, $user;
@ -58,7 +58,7 @@ class ReportImageTheme extends Themelet
/**
* @param ImageReport[] $reports
*/
public function display_image_banner(Image $image, array $reports)
public function display_image_banner(Image $image, array $reports): void
{
global $config, $page;

View file

@ -38,7 +38,7 @@ class ResizeImageTheme extends Themelet
return $html;
}
public function display_resize_error(Page $page, string $title, string $message)
public function display_resize_error(Page $page, string $title, string $message): void
{
$page->set_title("Resize Image");
$page->set_heading("Resize Image");

View file

@ -24,7 +24,7 @@ class RotateImageTheme extends Themelet
/**
* Display the error.
*/
public function display_rotate_error(Page $page, string $title, string $message)
public function display_rotate_error(Page $page, string $title, string $message): void
{
$page->set_title("Rotate Image");
$page->set_heading("Rotate Image");

View file

@ -17,7 +17,7 @@ class SetupTheme extends Themelet
*
* The page should wrap all the options in a form which links to setup_save
*/
public function display_page(Page $page, SetupPanel $panel)
public function display_page(Page $page, SetupPanel $panel): void
{
usort($panel->blocks, "Shimmie2\blockcmp");
@ -43,7 +43,7 @@ class SetupTheme extends Themelet
$page->add_block(new Block("Setup", $table));
}
public function display_advanced(Page $page, $options)
public function display_advanced(Page $page, $options): void
{
$h_rows = "";
ksort($options);

View file

@ -14,7 +14,7 @@ class SourceHistoryTheme extends Themelet
{
private array $messages = [];
public function display_history_page(Page $page, int $image_id, array $history)
public function display_history_page(Page $page, int $image_id, array $history): void
{
$history_html = $this->history_list($history, true);
@ -24,7 +24,7 @@ class SourceHistoryTheme extends Themelet
$page->add_block(new Block("Source History", $history_html, "main", 10));
}
public function display_global_page(Page $page, array $history, int $page_number)
public function display_global_page(Page $page, array $history, int $page_number): void
{
$history_html = $this->history_list($history, false);
@ -44,7 +44,7 @@ class SourceHistoryTheme extends Themelet
/**
* Add a section to the admin page.
*/
public function display_admin_block(string $validation_msg = '')
public function display_admin_block(string $validation_msg = ''): void
{
global $page;
@ -71,7 +71,7 @@ class SourceHistoryTheme extends Themelet
/*
* Show a standard page for results to be put into
*/
public function display_revert_ip_results()
public function display_revert_ip_results(): void
{
global $page;
$html = implode("\n", $this->messages);

View file

@ -14,7 +14,7 @@ class TagEditTheme extends Themelet
* Display a form which links to tag_edit/replace with POST[search]
* and POST[replace] set appropriately
*/
public function display_mass_editor()
public function display_mass_editor(): void
{
global $page;
$html = "

View file

@ -15,7 +15,7 @@ class TagHistoryTheme extends Themelet
{
private array $messages = [];
public function display_history_page(Page $page, int $image_id, array $history)
public function display_history_page(Page $page, int $image_id, array $history): void
{
$history_html = $this->history_list($history, true);
@ -25,7 +25,7 @@ class TagHistoryTheme extends Themelet
$page->add_block(new Block("Tag History", $history_html, "main", 10));
}
public function display_global_page(Page $page, array $history, int $page_number)
public function display_global_page(Page $page, array $history, int $page_number): void
{
$history_html = $this->history_list($history, false);
@ -45,7 +45,7 @@ class TagHistoryTheme extends Themelet
/**
* Add a section to the admin page.
*/
public function display_admin_block(string $validation_msg = '')
public function display_admin_block(string $validation_msg = ''): void
{
global $page;
@ -72,7 +72,7 @@ class TagHistoryTheme extends Themelet
/*
* Show a standard page for results to be put into
*/
public function display_revert_ip_results()
public function display_revert_ip_results(): void
{
global $page;
$html = implode("\n", $this->messages);

View file

@ -26,7 +26,7 @@ class TagListTheme extends Themelet
$this->navigation = $nav;
}
public function display_page(Page $page)
public function display_page(Page $page): void
{
$page->set_title("Tag List");
$page->set_heading($this->heading);
@ -66,7 +66,7 @@ class TagListTheme extends Themelet
* ...
* )
*/
public function display_split_related_block(Page $page, $tag_infos)
public function display_split_related_block(Page $page, $tag_infos): void
{
global $config;
@ -162,7 +162,7 @@ class TagListTheme extends Themelet
* ...
* )
*/
public function display_related_block(Page $page, $tag_infos, $block_name)
public function display_related_block(Page $page, $tag_infos, $block_name): void
{
global $config;
@ -181,7 +181,7 @@ class TagListTheme extends Themelet
* ...
* )
*/
public function display_popular_block(Page $page, $tag_infos)
public function display_popular_block(Page $page, $tag_infos): void
{
global $config;
@ -201,7 +201,7 @@ class TagListTheme extends Themelet
* )
* $search = the current array of tags being searched for
*/
public function display_refine_block(Page $page, $tag_infos, $search)
public function display_refine_block(Page $page, $tag_infos, $search): void
{
global $config;

View file

@ -28,7 +28,7 @@ class TagToolsTheme extends Themelet
* 'recount tag use'
* etc
*/
public function display_form()
public function display_form(): void
{
global $page;

View file

@ -6,7 +6,7 @@ namespace Shimmie2;
class UpdateTheme extends Themelet
{
public function display_admin_block()
public function display_admin_block(): void
{
global $page, $config;

View file

@ -25,7 +25,7 @@ use function MicroHTML\OPTION;
class UserPageTheme extends Themelet
{
public function display_login_page(Page $page)
public function display_login_page(Page $page): void
{
$page->set_title("Login");
$page->set_heading("Login");
@ -36,7 +36,7 @@ class UserPageTheme extends Themelet
));
}
public function display_user_list(Page $page, $table, $paginator)
public function display_user_list(Page $page, $table, $paginator): void
{
$page->set_title("User List");
$page->set_heading("User List");
@ -44,12 +44,12 @@ class UserPageTheme extends Themelet
$page->add_block(new Block("Users", $table . $paginator));
}
public function display_user_links(Page $page, User $user, $parts)
public function display_user_links(Page $page, User $user, $parts): void
{
# $page->add_block(new Block("User Links", join(", ", $parts), "main", 10));
}
public function display_user_block(Page $page, User $user, $parts)
public function display_user_block(Page $page, User $user, $parts): void
{
$html = emptyHTML('Logged in as ', $user->name);
foreach ($parts as $part) {
@ -61,7 +61,7 @@ class UserPageTheme extends Themelet
$page->add_block($b);
}
public function display_signup_page(Page $page)
public function display_signup_page(Page $page): void
{
global $config, $user;
$tac = $config->get_string("login_tac", "");
@ -117,7 +117,7 @@ class UserPageTheme extends Themelet
$page->add_block(new Block("Signup", $html));
}
public function display_user_creator()
public function display_user_creator(): void
{
global $page;
@ -154,7 +154,7 @@ class UserPageTheme extends Themelet
$page->add_block(new Block("Create User", (string)$form, "main", 75));
}
public function display_signups_disabled(Page $page)
public function display_signups_disabled(Page $page): void
{
$page->set_title("Signups Disabled");
$page->set_heading("Signups Disabled");
@ -165,7 +165,7 @@ class UserPageTheme extends Themelet
));
}
public function display_login_block(Page $page)
public function display_login_block(Page $page): void
{
$page->add_block(new Block("Login", $this->create_login_block(), "left", 90));
}
@ -218,7 +218,7 @@ class UserPageTheme extends Themelet
return $td;
}
public function display_ip_list(Page $page, array $uploads, array $comments, array $events)
public function display_ip_list(Page $page, array $uploads, array $comments, array $events): void
{
$html = TABLE(
["id" => "ip-history"],
@ -235,7 +235,7 @@ class UserPageTheme extends Themelet
$page->add_block(new Block("IPs", $html, "main", 70));
}
public function display_user_page(User $duser, $stats)
public function display_user_page(User $duser, $stats): void
{
global $page;
assert(is_array($stats));

View file

@ -39,7 +39,7 @@ class UserConfigTheme extends Themelet
*
* The page should wrap all the options in a form which links to setup_save
*/
public function display_user_config_page(Page $page, User $user, SetupPanel $panel)
public function display_user_config_page(Page $page, User $user, SetupPanel $panel): void
{
usort($panel->blocks, "Shimmie2\blockcmp");

View file

@ -10,7 +10,7 @@ use function MicroHTML\{A, joinHTML, TABLE, TR, TD, INPUT, emptyHTML};
class ViewPostTheme extends Themelet
{
public function display_meta_headers(Image $image)
public function display_meta_headers(Image $image): void
{
global $page;
@ -25,7 +25,7 @@ class ViewPostTheme extends Themelet
/*
* Build a page showing $image and some info about it
*/
public function display_page(Image $image, $editor_parts)
public function display_page(Image $image, $editor_parts): void
{
global $page;
$page->set_title("Post {$image->id}: ".$image->get_tag_list());
@ -41,7 +41,7 @@ class ViewPostTheme extends Themelet
}
}
public function display_admin_block(Page $page, $parts)
public function display_admin_block(Page $page, $parts): void
{
if (count($parts) > 0) {
$page->add_block(new Block("Post Controls", join("<br>", $parts), "left", 50));

View file

@ -12,7 +12,7 @@ class WikiTheme extends Themelet
* $wiki_page The wiki page, has ->title and ->body
* $nav_page A wiki page object with navigation, has ->body
*/
public function display_page(Page $page, WikiPage $wiki_page, ?WikiPage $nav_page = null)
public function display_page(Page $page, WikiPage $wiki_page, ?WikiPage $nav_page = null): void
{
global $user;
@ -47,7 +47,7 @@ class WikiTheme extends Themelet
$page->add_block(new Block($title_html, $this->create_display_html($wiki_page)));
}
public function display_page_history(Page $page, string $title, array $history)
public function display_page_history(Page $page, string $title, array $history): void
{
$html = "<table class='zebra'>";
foreach ($history as $row) {
@ -61,7 +61,7 @@ class WikiTheme extends Themelet
$page->add_block(new Block(html_escape($title), $html));
}
public function display_page_editor(Page $page, WikiPage $wiki_page)
public function display_page_editor(Page $page, WikiPage $wiki_page): void
{
$page->set_title(html_escape($wiki_page->title));
$page->set_heading(html_escape($wiki_page->title));

View file

@ -6,7 +6,7 @@ namespace Shimmie2;
class CustomCommentListTheme extends CommentListTheme
{
public function display_comment_list(array $images, int $page_number, int $total_pages, bool $can_post)
public function display_comment_list(array $images, int $page_number, int $total_pages, bool $can_post): void
{
global $config, $page, $user;
@ -85,7 +85,7 @@ class CustomCommentListTheme extends CommentListTheme
}
}
public function display_recent_comments(array $comments)
public function display_recent_comments(array $comments): void
{
// no recent comments in this theme
}

View file

@ -9,7 +9,7 @@ class CustomIndexTheme extends IndexTheme
/**
* @param Image[] $images
*/
public function display_page(Page $page, array $images)
public function display_page(Page $page, array $images): void
{
$this->display_shortwiki($page);

View file

@ -6,7 +6,7 @@ namespace Shimmie2;
class CustomTagListTheme extends TagListTheme
{
public function display_page(Page $page)
public function display_page(Page $page): void
{
$page->disable_left();
parent::display_page($page);

View file

@ -10,7 +10,7 @@ use function MicroHTML\{A, B, DIV, joinHTML};
class Themelet extends BaseThemelet
{
public function display_paginator(Page $page, string $base, ?string $query, int $page_number, int $total_pages, bool $show_random = false)
public function display_paginator(Page $page, string $base, ?string $query, int $page_number, int $total_pages, bool $show_random = false): void
{
if ($total_pages == 0) {
$total_pages = 1;

View file

@ -6,7 +6,7 @@ namespace Shimmie2;
class CustomUserPageTheme extends UserPageTheme
{
public function display_login_page(Page $page)
public function display_login_page(Page $page): void
{
global $config;
$page->set_title("Login");
@ -33,16 +33,16 @@ class CustomUserPageTheme extends UserPageTheme
$page->add_block(new Block("Login", $html, "main", 90));
}
public function display_user_links(Page $page, User $user, $parts)
public function display_user_links(Page $page, User $user, $parts): void
{
// no block in this theme
}
public function display_login_block(Page $page)
public function display_login_block(Page $page): void
{
// no block in this theme
}
public function display_user_block(Page $page, User $user, $parts)
public function display_user_block(Page $page, User $user, $parts): void
{
$html = "";
$blocked = ["Pools", "Pool Changes", "Alias Editor", "My Profile"];
@ -57,7 +57,7 @@ class CustomUserPageTheme extends UserPageTheme
$page->add_block($b);
}
public function display_signup_page(Page $page)
public function display_signup_page(Page $page): void
{
global $config;
$tac = $config->get_string("login_tac", "");
@ -91,7 +91,7 @@ class CustomUserPageTheme extends UserPageTheme
$page->add_block(new Block("Signup", $html));
}
public function display_ip_list(Page $page, array $uploads, array $comments, array $events)
public function display_ip_list(Page $page, array $uploads, array $comments, array $events): void
{
$html = "<table id='ip-history' style='width: 400px;'>";
$html .= "<tr><td>Uploaded from: ";
@ -108,7 +108,7 @@ class CustomUserPageTheme extends UserPageTheme
$page->add_block(new Block("IPs", $html));
}
public function display_user_page(User $duser, $stats)
public function display_user_page(User $duser, $stats): void
{
global $page;
$page->disable_left();

View file

@ -6,7 +6,7 @@ namespace Shimmie2;
class CustomViewPostTheme extends ViewPostTheme
{
public function display_page(Image $image, $editor_parts)
public function display_page(Image $image, $editor_parts): void
{
global $page;
$page->set_heading(html_escape($image->get_tag_list()));

View file

@ -6,7 +6,7 @@ namespace Shimmie2;
class CustomAdminPageTheme extends AdminPageTheme
{
public function display_page()
public function display_page(): void
{
global $page;
$page->disable_left();

View file

@ -6,7 +6,7 @@ namespace Shimmie2;
class CustomCommentListTheme extends CommentListTheme
{
public function display_comment_list(array $images, int $page_number, int $total_pages, bool $can_post)
public function display_comment_list(array $images, int $page_number, int $total_pages, bool $can_post): void
{
global $config, $page, $user;
@ -85,7 +85,7 @@ class CustomCommentListTheme extends CommentListTheme
}
}
public function display_recent_comments(array $comments)
public function display_recent_comments(array $comments): void
{
// no recent comments in this theme
}

View file

@ -6,13 +6,13 @@ namespace Shimmie2;
class CustomExtManagerTheme extends ExtManagerTheme
{
public function display_table(Page $page, array $extensions, bool $editable)
public function display_table(Page $page, array $extensions, bool $editable): void
{
$page->disable_left();
parent::display_table($page, $extensions, $editable);
}
public function display_doc(Page $page, ExtensionInfo $info)
public function display_doc(Page $page, ExtensionInfo $info): void
{
$page->disable_left();
parent::display_doc($page, $info);

View file

@ -9,7 +9,7 @@ class CustomIndexTheme extends IndexTheme
/**
* @param Image[] $images
*/
public function display_page(Page $page, array $images)
public function display_page(Page $page, array $images): void
{
$this->display_shortwiki($page);

View file

@ -6,7 +6,7 @@ namespace Shimmie2;
class CustomTagListTheme extends TagListTheme
{
public function display_page(Page $page)
public function display_page(Page $page): void
{
$page->disable_left();
parent::display_page($page);

View file

@ -10,7 +10,7 @@ use function MicroHTML\{A,B,DIV,joinHTML};
class Themelet extends BaseThemelet
{
public function display_paginator(Page $page, string $base, ?string $query, int $page_number, int $total_pages, bool $show_random = false)
public function display_paginator(Page $page, string $base, ?string $query, int $page_number, int $total_pages, bool $show_random = false): void
{
if ($total_pages == 0) {
$total_pages = 1;

View file

@ -6,7 +6,7 @@ namespace Shimmie2;
class CustomUserPageTheme extends UserPageTheme
{
public function display_login_page(Page $page)
public function display_login_page(Page $page): void
{
global $config;
$page->set_title("Login");
@ -33,16 +33,16 @@ class CustomUserPageTheme extends UserPageTheme
$page->add_block(new Block("Login", $html, "main", 90));
}
public function display_user_links(Page $page, User $user, $parts)
public function display_user_links(Page $page, User $user, $parts): void
{
// no block in this theme
}
public function display_login_block(Page $page)
public function display_login_block(Page $page): void
{
// no block in this theme
}
public function display_user_block(Page $page, User $user, $parts)
public function display_user_block(Page $page, User $user, $parts): void
{
$html = "";
$blocked = ["Pools", "Pool Changes", "Alias Editor", "My Profile"];
@ -57,7 +57,7 @@ class CustomUserPageTheme extends UserPageTheme
$page->add_block($b);
}
public function display_signup_page(Page $page)
public function display_signup_page(Page $page): void
{
global $config;
$tac = $config->get_string("login_tac", "");
@ -91,7 +91,7 @@ class CustomUserPageTheme extends UserPageTheme
$page->add_block(new Block("Signup", $html));
}
public function display_ip_list(Page $page, array $uploads, array $comments, array $events)
public function display_ip_list(Page $page, array $uploads, array $comments, array $events): void
{
$html = "<table id='ip-history' style='width: 400px;'>";
$html .= "<tr><td>Uploaded from: ";
@ -108,7 +108,7 @@ class CustomUserPageTheme extends UserPageTheme
$page->add_block(new Block("IPs", $html));
}
public function display_user_page(User $duser, $stats)
public function display_user_page(User $duser, $stats): void
{
global $page;
$page->disable_left();

View file

@ -6,7 +6,7 @@ namespace Shimmie2;
class CustomViewPostTheme extends ViewPostTheme
{
public function display_page(Image $image, $editor_parts)
public function display_page(Image $image, $editor_parts): void
{
global $page;
$page->set_heading(html_escape($image->get_tag_list()));

View file

@ -9,7 +9,7 @@ class Themelet extends BaseThemelet
/**
* Add a generic paginator.
*/
public function display_paginator(Page $page, string $base, ?string $query, int $page_number, int $total_pages, bool $show_random = false)
public function display_paginator(Page $page, string $base, ?string $query, int $page_number, int $total_pages, bool $show_random = false): void
{
if ($total_pages == 0) {
$total_pages = 1;

View file

@ -6,7 +6,7 @@ namespace Shimmie2;
class CustomViewPostTheme extends ViewPostTheme
{
public function display_page(Image $image, $editor_parts)
public function display_page(Image $image, $editor_parts): void
{
global $page;
$page->set_heading(html_escape($image->get_tag_list()));

View file

@ -10,7 +10,7 @@ use function MicroHTML\{A,DIV,SPAN,joinHTML};
class Themelet extends BaseThemelet
{
public function display_paginator(Page $page, string $base, ?string $query, int $page_number, int $total_pages, bool $show_random = false)
public function display_paginator(Page $page, string $base, ?string $query, int $page_number, int $total_pages, bool $show_random = false): void
{
if ($total_pages == 0) {
$total_pages = 1;

View file

@ -6,7 +6,7 @@ namespace Shimmie2;
class CustomUserPageTheme extends UserPageTheme
{
public function display_login_page(Page $page)
public function display_login_page(Page $page): void
{
global $config;
$page->set_title("Login");
@ -33,16 +33,16 @@ class CustomUserPageTheme extends UserPageTheme
$page->add_block(new Block("Login", $html, "main", 90));
}
public function display_user_links(Page $page, User $user, $parts)
public function display_user_links(Page $page, User $user, $parts): void
{
// no block in this theme
}
public function display_login_block(Page $page)
public function display_login_block(Page $page): void
{
// no block in this theme
}
public function display_user_block(Page $page, User $user, $parts)
public function display_user_block(Page $page, User $user, $parts): void
{
$html = "";
$blocked = ["Pools", "Pool Changes", "Alias Editor", "My Profile"];
@ -57,13 +57,13 @@ class CustomUserPageTheme extends UserPageTheme
$page->add_block($b);
}
public function display_signup_page(Page $page)
public function display_signup_page(Page $page): void
{
$page->disable_left();
parent::display_signup_page($page);
}
public function display_ip_list(Page $page, array $uploads, array $comments, array $events)
public function display_ip_list(Page $page, array $uploads, array $comments, array $events): void
{
$html = "<table id='ip-history' style='width: 400px;'>";
$html .= "<tr><td>Uploaded from: ";
@ -80,7 +80,7 @@ class CustomUserPageTheme extends UserPageTheme
$page->add_block(new Block("IPs", $html));
}
public function display_user_page(User $duser, $stats)
public function display_user_page(User $duser, $stats): void
{
global $page;
$page->disable_left();

View file

@ -6,7 +6,7 @@ namespace Shimmie2;
class CustomViewPostTheme extends ViewPostTheme
{
public function display_page(Image $image, $editor_parts)
public function display_page(Image $image, $editor_parts): void
{
global $page;
$page->set_title("Post {$image->id}: ".$image->get_tag_list());

View file

@ -26,7 +26,7 @@ class CustomIndexTheme extends IndexTheme
}
// Override to add a custom error message
public function display_page(Page $page, $images)
public function display_page(Page $page, $images): void
{
$this->display_page_header($page, $images);

View file

@ -27,7 +27,7 @@ class CustomUserPageTheme extends UserPageTheme
// (with css media queries deciding which one is visible), and also
// to switch between new-line and inline display depending on the
// number of links.
public function display_user_block(Page $page, User $user, $parts)
public function display_user_block(Page $page, User $user, $parts): void
{
$h_name = html_escape($user->name);
$lines = [];
@ -48,7 +48,7 @@ class CustomUserPageTheme extends UserPageTheme
// Override to display login block in the head and in the left column
// (with css media queries deciding which one is visible)
public function display_login_block(Page $page)
public function display_login_block(Page $page): void
{
$page->add_block(new Block("Login", $this->create_login_block(), "head", 90));
$page->add_block(new Block("Login", $this->create_login_block(), "left", 15));

View file

@ -6,7 +6,7 @@ namespace Shimmie2;
class CustomUserPageTheme extends UserPageTheme
{
public function display_user_block(Page $page, User $user, $parts)
public function display_user_block(Page $page, User $user, $parts): void
{
$h_name = html_escape($user->name);
$html = " | ";
@ -16,7 +16,7 @@ class CustomUserPageTheme extends UserPageTheme
$page->add_block(new Block("Logged in as $h_name", $html, "head", 90));
}
public function display_login_block(Page $page)
public function display_login_block(Page $page): void
{
global $config;
$html = "