[image] set thumb width / height as CSS varibles, see #938
This commit is contained in:
parent
49d2760ab6
commit
61b28c5031
1 changed files with 6 additions and 1 deletions
|
@ -79,7 +79,12 @@ class ImageIO extends Extension
|
||||||
|
|
||||||
public function onPageRequest(PageRequestEvent $event)
|
public function onPageRequest(PageRequestEvent $event)
|
||||||
{
|
{
|
||||||
global $config;
|
global $config, $page;
|
||||||
|
|
||||||
|
$thumb_width = $config->get_int(ImageConfig::THUMB_WIDTH, 192);
|
||||||
|
$thumb_height = $config->get_int(ImageConfig::THUMB_HEIGHT, 192);
|
||||||
|
$page->add_html_header("<style>:root {--thumb-width: {$thumb_width}px; --thumb-height: {$thumb_height}px;}</style>");
|
||||||
|
|
||||||
if ($event->page_matches("image/delete")) {
|
if ($event->page_matches("image/delete")) {
|
||||||
global $page, $user;
|
global $page, $user;
|
||||||
if ($user->can(Permissions::DELETE_IMAGE) && isset($_POST['image_id']) && $user->check_auth_token()) {
|
if ($user->can(Permissions::DELETE_IMAGE) && isset($_POST['image_id']) && $user->check_auth_token()) {
|
||||||
|
|
Reference in a new issue