diff --git a/plugins/af_psql_trgm/init.php b/plugins/af_psql_trgm/init.php index f41455f83..263851144 100644 --- a/plugins/af_psql_trgm/init.php +++ b/plugins/af_psql_trgm/init.php @@ -12,6 +12,7 @@ class Af_Psql_Trgm extends Plugin { function save() { $similarity = (float) db_escape_string($_POST["similarity"]); $min_title_length = (int) db_escape_string($_POST["min_title_length"]); + $enable_globally = checkbox_to_sql_bool($_POST["enable_globally"]) == "true"; if ($similarity < 0) $similarity = 0; if ($similarity > 1) $similarity = 1; @@ -22,8 +23,9 @@ class Af_Psql_Trgm extends Plugin { $this->host->set($this, "similarity", $similarity); $this->host->set($this, "min_title_length", $min_title_length); + $this->host->set($this, "enable_globally", $enable_globally); - echo T_sprintf("Data saved (%s)", $similarity); + echo T_sprintf("Data saved (%s, %d)", $similarity, $enable_globally); } function init($host) { @@ -127,10 +129,13 @@ class Af_Psql_Trgm extends Plugin { $similarity = $this->host->get($this, "similarity"); $min_title_length = $this->host->get($this, "min_title_length"); + $enable_globally = $this->host->get($this, "enable_globally"); if (!$similarity) $similarity = '0.75'; if (!$min_title_length) $min_title_length = '32'; + $enable_globally_checked = $enable_globally ? "checked" : ""; + print "
"; print "