summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-04-09 14:02:44 +0300
committerAndrew Dolgov <[email protected]>2021-04-09 14:02:44 +0300
commit4942b25ab2b9a9c42f1048eca9f9b0891210d389 (patch)
treee6864f01aec0ff934c6000372d2028bb26501eeb
parentf999a5df1c85678ce70c5c7c9f82565aade52229 (diff)
set force_width to current profile only
-rw-r--r--init.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/init.php b/init.php
index 07d44f3..9fc4970 100644
--- a/init.php
+++ b/init.php
@@ -312,7 +312,7 @@ class Api_Resize_Media extends Plugin {
}
function hook_enclosure_entry($enc) {
- $force_width = (int) $this->host->get($this, "force_width", 0);
+ $force_width = (int) $this->host->profile_get($this, "force_width", 0);
$enc["content_url"] = $this->rewrite_url_if_needed($enc["content_url"], $force_width);
@@ -320,13 +320,13 @@ class Api_Resize_Media extends Plugin {
}
function hook_render_article_cdm($row) {
- $force_width = (int) $this->host->get($this, "force_width", 0);
+ $force_width = (int) $this->host->profile_get($this, "force_width", 0);
return $this->process_article(["article" => $row], $force_width);
}
function hook_render_article($row) {
- $force_width = (int) $this->host->get($this, "force_width", 0);
+ $force_width = (int) $this->host->profile_get($this, "force_width", 0);
return $this->process_article(["article" => $row], $force_width);
}
@@ -371,7 +371,7 @@ class Api_Resize_Media extends Plugin {
function hook_prefs_tab($args) {
if ($args != "prefFeeds") return;
- $force_width = (int) $this->host->get($this, "force_width", 0);
+ $force_width = (int) $this->host->profile_get($this, "force_width", 0);
?>
<div dojoType='dijit.layout.AccordionPane'
@@ -393,6 +393,7 @@ class Api_Resize_Media extends Plugin {
<fieldset>
<label><?= $this->__( "Also resize in web UI (width, 0 - disables)") ?></label>
<input dojoType='dijit.form.NumberSpinner'
+ title="<?= $this->__("This setting is local to current preference profile.") ?>"
required='1' name='force_width' id='api_resize_force_width' value="<?= $force_width ?>"> <?= $this->__('pixels') ?>
</fieldset>
@@ -408,7 +409,7 @@ class Api_Resize_Media extends Plugin {
function save() {
$force_width = (int) $_POST["force_width"];
- $this->host->set($this, "force_width", $force_width);
+ $this->host->profile_set($this, "force_width", $force_width);
echo $this->T_sprintf("Data saved (%d)", $force_width);
}