diff options
author | Andrew Dolgov <[email protected]> | 2020-08-19 10:33:03 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2020-08-19 10:33:03 +0300 |
commit | 883dfa98031e96dd6c0460d807d0b9859917ae64 (patch) | |
tree | 47514f0d12eee359d07c26a31863ffdd5b5148c7 | |
parent | 048f5071383815be3b426784a7182aaa7e94138b (diff) |
handle enclosures in web ui
-rw-r--r-- | init.php | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -29,6 +29,7 @@ class Api_Resize_Media extends Plugin { $host->add_hook($host::HOOK_PREFS_TAB, $this); $host->add_hook($host::HOOK_RENDER_ARTICLE_CDM, $this, 999); $host->add_hook($host::HOOK_RENDER_ARTICLE, $this, 999); + $host->add_hook($host::HOOK_ENCLOSURE_ENTRY, $this, 999); } private function make_thumbnail($input_filename, $output_filename, $dim_max_x = 600, $dim_max_y = 600, @@ -320,6 +321,15 @@ class Api_Resize_Media extends Plugin { } /** @noinspection PhpUnused */ + function hook_enclosure_entry($enc) { + $force_width = (int) $this->host->get($this, "force_width", 0); + + $enc["content_url"] = $this->rewrite_url_if_needed($enc["content_url"], $force_width); + + return $enc; + } + + /** @noinspection PhpUnused */ function hook_render_article_cdm($row) { $force_width = (int) $this->host->get($this, "force_width", 0); |