Следуйте инструкциям в видео ниже, чтобы узнать, как установить наш сайт как веб-приложение на главный экран вашего устройства.
Примечание: Эта функция может быть недоступна в некоторых браузерах.
не нулл у самого есть )Посмотрел, очень много заглушек, лицензия получается с сайта разработчика
не нашел, видно удалил за ненужностью (Скиньте свои наработки, будет время, сделаем нулл
А чем вы нуллите?не нашел, видно удалил за ненужностью (
в каком смысле чем ? головой и руками )А чем вы нуллите?
Неточно написал, согласен. Чем IonCube декодите. Деобфускацию то понятно.в каком смысле чем ? головой и руками )
делал easytoyou, сейчас нечем, там оплату с россии не принимают (
<?php
class ModelExtensionDreamFilter extends Model
{
protected $module = "dreamfilter";
protected $version = "2.5";
protected $license_server = "http://projects.redream.ru/api/license";
protected $pluginpath = "view/javascript/jquery/dream-filter/";
private $_errors = [];
private $_route = NULL;
private $_token = NULL;
public $cachePath = NULL;
public function __construct($registry)
{
parent::__construct($registry);
$this->cachePath = DIR_CACHE . "../rdr-cache";
$this->_route = version_compare(VERSION, "2.3", ">=") ? "extension/module/dream_filter" : "module/dream_filter";
$this->_token = version_compare(VERSION, "3", ">=") ? "user_token" : "token";
}
public function getErrors()
{
return $this->_errors;
}
public function getVersion()
{
return $this->version;
}
public function saveModule($data, $module_id = NULL)
{
$this->load->model("setting/setting");
$config = $this->_obfuscated_FFB6878796AE8EA3B9ADAC8DA58CB9BCB7AA95B5949691_($data);
unset($data["config"]);
if (version_compare(VERSION, "3", ">=")) {
$this->load->model("setting/module");
if ($module_id === NULL) {
$this->model_setting_module->addModule("dream_filter", $data);
$module_id = $this->db->getLastId();
}
$data = $this->_obfuscated_FFB7BB90BEBDBEA9AD8DB7A3A6879CB88B9B88BD95AAA1_($data, $module_id);
$this->model_setting_module->editModule($module_id, $data);
} else {
if (version_compare(VERSION, "2", "<")) {
$setting = $this->model_setting_setting->getSetting("dream_filter");
$modules = !empty($setting["dream_filter_module"]) ? $setting["dream_filter_module"] : [];
if ($module_id === NULL) {
if ($modules) {
end($modules);
$module_id = key($modules) + 1;
} else {
$module_id = 1;
}
}
$data = $this->_obfuscated_FFB7BB90BEBDBEA9AD8DB7A3A6879CB88B9B88BD95AAA1_($data, $module_id);
$modules[$module_id] = $data;
$this->model_setting_setting->editSetting("dream_filter", ["dream_filter_module" => $modules]);
} else {
$this->load->model("extension/module");
if ($module_id === NULL) {
$this->model_extension_module->addModule("dream_filter", $data);
$module_id = $this->db->getLastId();
}
$data = $this->_obfuscated_FFB7BB90BEBDBEA9AD8DB7A3A6879CB88B9B88BD95AAA1_($data, $module_id);
$this->model_extension_module->editModule($module_id, $data);
}
}
foreach ($config as $store_id => $store_config) {
$this->model_setting_setting->editSetting("rdrf", $store_config, $store_id);
}
$this->_obfuscated_FFBEA589B085A8AB8CA6A59891A8939B858BBEADBBB1B1_();
$this->cleanCache();
}
private function _obfuscated_FFBEA589B085A8AB8CA6A59891A8939B858BBEADBBB1B1_()
{
if (version_compare(VERSION, "3", ">=")) {
$modules = $this->model_setting_module->getModulesByCode("dream_filter");
} else {
if (version_compare(VERSION, "2", "<")) {
$setting = $this->model_setting_setting->getSetting("dream_filter");
$modules = !empty($setting["dream_filter_module"]) ? $setting["dream_filter_module"] : [];
} else {
$modules = $this->model_extension_module->getModulesByCode("dream_filter");
}
}
$_obfuscated_0D3C291E223D221A020D23342E19012826270E2D060332_ = [];
foreach ($modules as $module) {
if (!empty($module["filters"])) {
$_obfuscated_0D3C291E223D221A020D23342E19012826270E2D060332_ = array_merge($_obfuscated_0D3C291E223D221A020D23342E19012826270E2D060332_, $module["filters"]);
}
}
if (!empty($_obfuscated_0D3C291E223D221A020D23342E19012826270E2D060332_)) {
$_obfuscated_0D1C301C1409390C2D09111F031436131A071D021D1522_ = [];
foreach ($_obfuscated_0D3C291E223D221A020D23342E19012826270E2D060332_ as $_obfuscated_0D04371210063B23142E04051706132728230C0B0A1C22_) {
if (!isset($_obfuscated_0D1C301C1409390C2D09111F031436131A071D021D1522_[$_obfuscated_0D04371210063B23142E04051706132728230C0B0A1C22_["filter_by"]])) {
$_obfuscated_0D1C301C1409390C2D09111F031436131A071D021D1522_[$_obfuscated_0D04371210063B23142E04051706132728230C0B0A1C22_["filter_by"]] = "";
}
}
$this->_obfuscated_FFA1A7848183918DA1A4B088A9B39A9691A58D89B4AAB1_($_obfuscated_0D1C301C1409390C2D09111F031436131A071D021D1522_);
$this->_obfuscated_FF8192B1BABAA18793B6969F9FB8A8B6A9BEA187B5A491_($_obfuscated_0D1C301C1409390C2D09111F031436131A071D021D1522_);
}
}
private function _obfuscated_FFA1A7848183918DA1A4B088A9B39A9691A58D89B4AAB1_($properties)
{
$_obfuscated_0D3F09042F24123D3E053839221F255C405C3B1A141911_ = ["price" => "price", "special" => "price", "manufacturers" => "manufacturer_id", "stock" => "quantity", "length" => "length", "width" => "width", "height" => "height", "weight" => "weight", "novelty" => "date_added"];
$_obfuscated_0D0F0D0B3C272E101F04293B2501175B0D372218351D32_ = array_intersect_key($_obfuscated_0D3F09042F24123D3E053839221F255C405C3B1A141911_, $_obfuscated_0D1C301C1409390C2D09111F031436131A071D021D1522_);
foreach ($_obfuscated_0D3F09042F24123D3E053839221F255C405C3B1A141911_ as $k => $_obfuscated_0D233F171105382D041619120F2938361C050730053932_) {
$_obfuscated_0D152536370F0A0F0D01042C260928213C015C1C063832_ = "rdrf_" . $_obfuscated_0D233F171105382D041619120F2938361C050730053932_;
$_obfuscated_0D252B01213D2A341B2C351836011F131E2D181E2F0822_ = $this->db->query("SHOW KEYS FROM `" . DB_PREFIX . "product` WHERE Key_name='" . $_obfuscated_0D152536370F0A0F0D01042C260928213C015C1C063832_ . "'");
if (!empty($_obfuscated_0D252B01213D2A341B2C351836011F131E2D181E2F0822_->row)) {
if (!isset($_obfuscated_0D0F0D0B3C272E101F04293B2501175B0D372218351D32_[$k])) {
$this->db->query("ALTER TABLE `" . DB_PREFIX . "product` DROP INDEX `" . $_obfuscated_0D152536370F0A0F0D01042C260928213C015C1C063832_ . "`");
}
} else {
if (isset($_obfuscated_0D0F0D0B3C272E101F04293B2501175B0D372218351D32_[$k])) {
$this->db->query("ALTER TABLE `" . DB_PREFIX . "product` ADD INDEX `" . $_obfuscated_0D152536370F0A0F0D01042C260928213C015C1C063832_ . "` (" . $_obfuscated_0D233F171105382D041619120F2938361C050730053932_ . ", `product_id`)");
}
}
}
}
private function _obfuscated_FF8192B1BABAA18793B6969F9FB8A8B6A9BEA187B5A491_($properties)
{
$_obfuscated_0D152536370F0A0F0D01042C260928213C015C1C063832_ = "rdrf_option";
$_obfuscated_0D252B01213D2A341B2C351836011F131E2D181E2F0822_ = $this->db->query("SHOW KEYS FROM `" . DB_PREFIX . "product_option_value` WHERE Key_name='" . $_obfuscated_0D152536370F0A0F0D01042C260928213C015C1C063832_ . "'");
if (!empty($_obfuscated_0D252B01213D2A341B2C351836011F131E2D181E2F0822_->row)) {
if (!isset($_obfuscated_0D1C301C1409390C2D09111F031436131A071D021D1522_["options"])) {
$this->db->query("ALTER TABLE `" . DB_PREFIX . "product_option_value` DROP INDEX `" . $_obfuscated_0D152536370F0A0F0D01042C260928213C015C1C063832_ . "`");
}
} else {
if (isset($_obfuscated_0D1C301C1409390C2D09111F031436131A071D021D1522_["options"])) {
$this->db->query("ALTER TABLE `" . DB_PREFIX . "product_option_value` ADD INDEX `" . $_obfuscated_0D152536370F0A0F0D01042C260928213C015C1C063832_ . "` (`option_id`, `product_id`, `option_value_id`)");
}
}
}
private function _obfuscated_FFB7BB90BEBDBEA9AD8DB7A3A6879CB88B9B88BD95AAA1_($data, $module_id)
{
$data["settings"]["module_id"] = $module_id;
if (!empty($data["filters"])) {
$_obfuscated_0D161A373E0B5B1E3B2C342F0D2C29230D3E22050D1B01_ = [];
$_obfuscated_0D3C291E223D221A020D23342E19012826270E2D060332_ = [];
foreach ($data["filters"] as $_obfuscated_0D04371210063B23142E04051706132728230C0B0A1C22_) {
$key = isset($_obfuscated_0D04371210063B23142E04051706132728230C0B0A1C22_["item_id"]) ? $_obfuscated_0D04371210063B23142E04051706132728230C0B0A1C22_["filter_by"] . "-" . $_obfuscated_0D04371210063B23142E04051706132728230C0B0A1C22_["item_id"] : $_obfuscated_0D04371210063B23142E04051706132728230C0B0A1C22_["filter_by"];
if (!isset($_obfuscated_0D161A373E0B5B1E3B2C342F0D2C29230D3E22050D1B01_[$key])) {
$_obfuscated_0D161A373E0B5B1E3B2C342F0D2C29230D3E22050D1B01_[$key] = true;
$_obfuscated_0D3C291E223D221A020D23342E19012826270E2D060332_[] = $_obfuscated_0D04371210063B23142E04051706132728230C0B0A1C22_;
}
}
$data["filters"] = $_obfuscated_0D3C291E223D221A020D23342E19012826270E2D060332_;
}
$data["view"]["truncate_height"] = (int) $data["view"]["truncate_height"];
$data["view"]["truncate_elements"] = (int) $data["view"]["truncate_elements"];
if ($data["view"]["template"] === "horizontal") {
$_obfuscated_0D27270F3E24221612155C3E021B03213C385B5B401632_ = $data["view"]["truncate_hrz_mode"];
$_obfuscated_0D0C0932212E4025285B025C3438095C363F190D371701_ = $_obfuscated_0D27270F3E24221612155C3E021B03213C385B5B401632_ === "width" ? $data["view"]["truncate_hrz_view"] : false;
$_obfuscated_0D2611291908372330133F2728030A225C38362B291511_ = $_obfuscated_0D27270F3E24221612155C3E021B03213C385B5B401632_ === "width" && $_obfuscated_0D0C0932212E4025285B025C3438095C363F190D371701_ === "scrollbar";
} else {
$_obfuscated_0D27270F3E24221612155C3E021B03213C385B5B401632_ = $data["view"]["truncate_mode"];
$_obfuscated_0D0C0932212E4025285B025C3438095C363F190D371701_ = $_obfuscated_0D27270F3E24221612155C3E021B03213C385B5B401632_ === "height" ? $data["view"]["truncate_view"] : false;
$_obfuscated_0D2611291908372330133F2728030A225C38362B291511_ = $_obfuscated_0D27270F3E24221612155C3E021B03213C385B5B401632_ === "height" && $_obfuscated_0D0C0932212E4025285B025C3438095C363F190D371701_ === "scrollbar";
}
$data["view"]["truncate"] = ["mode" => $_obfuscated_0D27270F3E24221612155C3E021B03213C385B5B401632_, "view" => $_obfuscated_0D0C0932212E4025285B025C3438095C363F190D371701_, "scrollbar" => $_obfuscated_0D2611291908372330133F2728030A225C38362B291511_, "height" => $_obfuscated_0D27270F3E24221612155C3E021B03213C385B5B401632_ === "height" ? (int) $data["view"]["truncate_height"] . "px" : false, "elements" => $_obfuscated_0D27270F3E24221612155C3E021B03213C385B5B401632_ === "element" ? $data["view"]["truncate_elements"] : false];
$_obfuscated_0D184036313925352E2B240F112934181F0F3534133001_ = $data["settings"]["mode"] === "ajax";
$data["settings"]["ajax"] = ["enable" => $_obfuscated_0D184036313925352E2B240F112934181F0F3534133001_, "selector" => htmlspecialchars_decode($data["settings"]["selector"]), "pagination" => $_obfuscated_0D184036313925352E2B240F112934181F0F3534133001_ && $data["settings"]["ajax_pagination"] ? htmlspecialchars_decode($data["settings"]["pagination_selector"]) : false, "sorter" => $_obfuscated_0D184036313925352E2B240F112934181F0F3534133001_ && $data["settings"]["ajax_sorter"] ? htmlspecialchars_decode($data["settings"]["sorter_selector"]) : false, "sorter_type" => $data["settings"]["sorter_type"], "limit" => $_obfuscated_0D184036313925352E2B240F112934181F0F3534133001_ && $data["settings"]["ajax_limit"] ? htmlspecialchars_decode($data["settings"]["limit_selector"]) : false, "limit_type" => $data["settings"]["limit_type"], "pushstate" => $_obfuscated_0D184036313925352E2B240F112934181F0F3534133001_ ? (int) $data["settings"]["pushstate"] : false, "scroll" => $_obfuscated_0D184036313925352E2B240F112934181F0F3534133001_ ? (int) $data["settings"]["ajax_scroll"] : false, "offset" => $_obfuscated_0D184036313925352E2B240F112934181F0F3534133001_ && $data["settings"]["ajax_scroll"] ? (int) $data["settings"]["scroll_offset"] : false];
if (!empty($data["categories"]) && !empty($data["excluded_categories"])) {
foreach ($data["categories"] as $i => $_obfuscated_0D1A162A16212E053D2F380E2B21332F1F2E28120F3B01_) {
if (in_array($_obfuscated_0D1A162A16212E053D2F380E2B21332F1F2E28120F3B01_, $data["excluded_categories"])) {
unset($data["categories"][$i]);
}
}
}
$data["view"]["mobile"] = array_merge($data["view"]["mobile"], ["autoclose" => isset($data["view"]["mobile"]["autoclose"]) ? (int) $data["view"]["mobile"]["autoclose"] : false, "width" => isset($data["view"]["mobile"]["width"]) ? (int) $data["view"]["mobile"]["width"] : NULL, "indenting_top" => isset($data["view"]["mobile"]["width"]) ? (int) $data["view"]["mobile"]["indenting_top"] : 0, "indenting_bottom" => isset($data["view"]["mobile"]["width"]) ? (int) $data["view"]["mobile"]["indenting_bottom"] : 0, "backdrop" => isset($data["view"]["mobile"]["backdrop"]) ? (int) $data["view"]["mobile"]["backdrop"] : false]);
return $data;
}
private function _obfuscated_FFB6878796AE8EA3B9ADAC8DA58CB9BCB7AA95B5949691_($data)
{
$config = isset($data["config"]) ? $data["config"] : [];
foreach ($config as $store_id => $store_config) {
$setting = $this->model_setting_setting->getSetting("rdrf", $store_id);
$store_config = array_merge($setting, $store_config);
if (!empty($data["filters"])) {
foreach ($data["filters"] as $_obfuscated_0D04371210063B23142E04051706132728230C0B0A1C22_) {
if ($_obfuscated_0D04371210063B23142E04051706132728230C0B0A1C22_["filter_by"] === "attributes") {
$_obfuscated_0D3D24401C0A28310A2C07163422033D263317170A1732_ = (int) $_obfuscated_0D04371210063B23142E04051706132728230C0B0A1C22_["item_id"];
if (!empty($_obfuscated_0D04371210063B23142E04051706132728230C0B0A1C22_["add"]["divider"])) {
$store_config["rdrf_attr_dividers"][$_obfuscated_0D3D24401C0A28310A2C07163422033D263317170A1732_] = trim($_obfuscated_0D04371210063B23142E04051706132728230C0B0A1C22_["add"]["divider"]);
} else {
if (isset($store_config["rdrf_attr_dividers"][$_obfuscated_0D3D24401C0A28310A2C07163422033D263317170A1732_])) {
unset($store_config["rdrf_attr_dividers"][$_obfuscated_0D3D24401C0A28310A2C07163422033D263317170A1732_]);
}
}
}
}
}
$config[$store_id] = $store_config;
}
return $config;
}
public function getParams($language)
{
$params = ["name" => ["label" => $language["by_name"], "name" => $language["name_name"], "types" => ["field" => $language["type_field"]]], "price" => ["label" => $language["by_price"], "name" => $language["name_price"], "types" => ["slider" => $language["type_slider"]]], "stock" => ["label" => $language["by_stock"], "name" => $language["name_stock"], "types" => ["type_single" => $language["type_single"], "checkbox" => $language["type_checkbox"], "radio" => $language["type_radio"], "select" => $language["type_select"]], "sort_types" => ["count" => $language["sort_count"], "string_asc" => $language["sort_string_asc"], "string_desc" => $language["sort_string_desc"], "numeric_asc" => $language["sort_numeric_asc"], "numeric_desc" => $language["sort_numeric_desc"]]], "novelty" => ["label" => $language["by_novelty"], "name" => $language["name_novelty"], "types" => ["type_single" => $language["type_single"], "checkbox" => $language["type_checkbox"], "radio" => $language["type_radio"], "select" => $language["type_select"]], "additional" => [["type" => "number", "name" => "days_new", "label" => $language["entry_novelty_days"], "default" => 30]]], "special" => ["label" => $language["by_special"], "name" => $language["name_special"], "types" => ["type_single" => $language["type_single"], "checkbox" => $language["type_checkbox"], "radio" => $language["type_radio"], "select" => $language["type_select"], "slider" => $language["type_slider"]], "sort_types" => ["numeric_asc" => $language["sort_numeric_asc"], "numeric_desc" => $language["sort_numeric_desc"], "count" => $language["sort_count"]]], "length" => ["label" => $language["by_length"], "name" => $language["name_length"], "types" => ["checkbox" => $language["type_checkbox"], "radio" => $language["type_radio"], "select" => $language["type_select"], "slider" => $language["type_slider"]], "sort_types" => ["numeric_asc" => $language["sort_numeric_asc"], "numeric_desc" => $language["sort_numeric_desc"], "count" => $language["sort_count"]], "additional" => [["type" => "number", "name" => "decimal_place", "label" => $language["entry_decimal"], "default" => 2]]], "width" => ["label" => $language["by_width"], "name" => $language["name_width"], "types" => ["checkbox" => $language["type_checkbox"], "radio" => $language["type_radio"], "select" => $language["type_select"], "slider" => $language["type_slider"]], "sort_types" => ["numeric_asc" => $language["sort_numeric_asc"], "numeric_desc" => $language["sort_numeric_desc"], "count" => $language["sort_count"]], "additional" => [["type" => "number", "name" => "decimal_place", "label" => $language["entry_decimal"], "default" => 2]]], "height" => ["label" => $language["by_height"], "name" => $language["name_height"], "types" => ["checkbox" => $language["type_checkbox"], "radio" => $language["type_radio"], "select" => $language["type_select"], "slider" => $language["type_slider"]], "sort_types" => ["numeric_asc" => $language["sort_numeric_asc"], "numeric_desc" => $language["sort_numeric_desc"], "count" => $language["sort_count"]], "additional" => [["type" => "number", "name" => "decimal_place", "label" => $language["entry_decimal"], "default" => 2]]], "weight" => ["label" => $language["by_weight"], "name" => $language["name_weight"], "types" => ["checkbox" => $language["type_checkbox"], "radio" => $language["type_radio"], "select" => $language["type_select"], "slider" => $language["type_slider"]], "sort_types" => ["numeric_asc" => $language["sort_numeric_asc"], "numeric_desc" => $language["sort_numeric_desc"], "count" => $language["sort_count"]], "additional" => [["type" => "number", "name" => "decimal_place", "label" => $language["entry_decimal"], "default" => 2]]], "rating" => ["label" => $language["by_rating"], "name" => $language["name_rating"], "types" => ["checkbox" => $language["type_checkbox"], "radio" => $language["type_radio"], "select" => $language["type_select"], "slider" => $language["type_slider"]]], "tags" => ["label" => $language["by_tags"], "name" => $language["name_tags"], "types" => ["field" => $language["type_field"], "checkbox" => $language["type_checkbox"], "radio" => $language["type_radio"], "select" => $language["type_select"]], "sort_types" => ["default" => $language["sort_default"], "count" => $language["sort_count"], "string_asc" => $language["sort_string_asc"], "string_desc" => $language["sort_string_desc"], "numeric_asc" => $language["sort_numeric_asc"], "numeric_desc" => $language["sort_numeric_desc"]]], "model" => ["label" => $language["by_model"], "name" => $language["name_model"], "types" => ["field" => $language["type_field"], "checkbox" => $language["type_checkbox"], "radio" => $language["type_radio"], "select" => $language["type_select"]], "sort_types" => ["count" => $language["sort_count"], "string_asc" => $language["sort_string_asc"], "string_desc" => $language["sort_string_desc"], "numeric_asc" => $language["sort_numeric_asc"], "numeric_desc" => $language["sort_numeric_desc"]]], "sku" => ["label" => $language["by_sku"], "name" => $language["name_sku"], "types" => ["checkbox" => $language["type_checkbox"], "radio" => $language["type_radio"], "select" => $language["type_select"]], "sort_types" => ["count" => $language["sort_count"], "string_asc" => $language["sort_string_asc"], "string_desc" => $language["sort_string_desc"], "numeric_asc" => $language["sort_numeric_asc"], "numeric_desc" => $language["sort_numeric_desc"]]], "upc" => ["label" => $language["by_upc"], "name" => $language["name_upc"], "types" => ["checkbox" => $language["type_checkbox"], "radio" => $language["type_radio"], "select" => $language["type_select"]], "sort_types" => ["count" => $language["sort_count"], "string_asc" => $language["sort_string_asc"], "string_desc" => $language["sort_string_desc"], "numeric_asc" => $language["sort_numeric_asc"], "numeric_desc" => $language["sort_numeric_desc"]]], "ean" => ["label" => $language["by_ean"], "name" => $language["name_ean"], "types" => ["checkbox" => $language["type_checkbox"], "radio" => $language["type_radio"], "select" => $language["type_select"]], "sort_types" => ["count" => $language["sort_count"], "string_asc" => $language["sort_string_asc"], "string_desc" => $language["sort_string_desc"], "numeric_asc" => $language["sort_numeric_asc"], "numeric_desc" => $language["sort_numeric_desc"]]], "jan" => ["label" => $language["by_jan"], "name" => $language["name_jan"], "types" => ["checkbox" => $language["type_checkbox"], "radio" => $language["type_radio"], "select" => $language["type_select"]], "sort_types" => ["count" => $language["sort_count"], "string_asc" => $language["sort_string_asc"], "string_desc" => $language["sort_string_desc"], "numeric_asc" => $language["sort_numeric_asc"], "numeric_desc" => $language["sort_numeric_desc"]]], "isbn" => ["label" => $language["by_isbn"], "name" => $language["name_isbn"], "types" => ["checkbox" => $language["type_checkbox"], "radio" => $language["type_radio"], "select" => $language["type_select"]], "sort_types" => ["count" => $language["sort_count"], "string_asc" => $language["sort_string_asc"], "string_desc" => $language["sort_string_desc"], "numeric_asc" => $language["sort_numeric_asc"], "numeric_desc" => $language["sort_numeric_desc"]]], "mpn" => ["label" => $language["by_mpn"], "name" => $language["name_mpn"], "types" => ["checkbox" => $language["type_checkbox"], "radio" => $language["type_radio"], "select" => $language["type_select"]], "sort_types" => ["count" => $language["sort_count"], "string_asc" => $language["sort_string_asc"], "string_desc" => $language["sort_string_desc"], "numeric_asc" => $language["sort_numeric_asc"], "numeric_desc" => $language["sort_numeric_desc"]]], "manufacturers" => ["label" => $language["by_manufacturers"], "name" => $language["name_manufacturers"], "types" => ["checkbox" => $language["type_checkbox"], "radio" => $language["type_radio"], "select" => $language["type_select"], "image" => $language["type_image"], "multiimage" => $language["type_multi_image"], "slider" => $language["type_slider"]], "sort_types" => ["default" => $language["sort_default"], "count" => $language["sort_count"], "string_asc" => $language["sort_string_asc"], "string_desc" => $language["sort_string_desc"], "numeric_asc" => $language["sort_numeric_asc"], "numeric_desc" => $language["sort_numeric_desc"]]], "categories" => ["label" => $language["by_categories"], "name" => $language["name_category"], "types" => ["checkbox" => $language["type_checkbox"], "radio" => $language["type_radio"], "select" => $language["type_select"], "image" => $language["type_image"], "multiimage" => $language["type_multi_image"], "slider" => $language["type_slider"]], "sort_types" => ["default" => $language["sort_default"], "count" => $language["sort_count"], "string_asc" => $language["sort_string_asc"], "string_desc" => $language["sort_string_desc"], "numeric_asc" => $language["sort_numeric_asc"], "numeric_desc" => $language["sort_numeric_desc"]], "additional" => [["type" => "number", "name" => "nesting", "label" => $language["entry_categories_level"], "default" => 1]]], "attributes" => ["label" => $language["by_attributes"], "name" => "", "types" => ["checkbox" => $language["type_checkbox"], "radio" => $language["type_radio"], "select" => $language["type_select"], "slider" => $language["type_slider"]], "autocomplete" => ["url" => "index.php?route=" . $this->_route . "/autocomplete&type=attribute&" . $this->_token . "=" . $this->session->data[$this->_token], "category" => "attribute_group", "label" => $language["entry_attribute"]], "additional" => [["type" => "text", "name" => "divider", "label" => $language["entry_divider"], "default" => ""]], "sort_types" => ["count" => $language["sort_count"], "string_asc" => $language["sort_string_asc"], "string_desc" => $language["sort_string_desc"], "numeric_asc" => $language["sort_numeric_asc"], "numeric_desc" => $language["sort_numeric_desc"]]], "options" => ["label" => $language["by_options"], "name" => "", "types" => ["checkbox" => $language["type_checkbox"], "radio" => $language["type_radio"], "select" => $language["type_select"], "image" => $language["type_image"], "multiimage" => $language["type_multi_image"], "slider" => $language["type_slider"]], "autocomplete" => ["url" => "index.php?route=" . $this->_route . "/autocomplete&type=option&" . $this->_token . "=" . $this->session->data[$this->_token], "category" => "category", "label" => $language["entry_option"]], "sort_types" => ["default" => $language["sort_default"], "count" => $language["sort_count"], "string_asc" => $language["sort_string_asc"], "string_desc" => $language["sort_string_desc"], "numeric_asc" => $language["sort_numeric_asc"], "numeric_desc" => $language["sort_numeric_desc"]]]];
if (version_compare(VERSION, "1.5.5", ">=")) {
$params["filters"] = ["label" => $language["by_filters"], "name" => "", "types" => ["checkbox" => $language["type_checkbox"], "radio" => $language["type_radio"], "select" => $language["type_select"], "slider" => $language["type_slider"]], "autocomplete" => ["url" => "index.php?route=" . $this->_route . "/autocomplete&type=filter&" . $this->_token . "=" . $this->session->data[$this->_token], "label" => $language["entry_filter_group"]], "sort_types" => ["default" => $language["sort_default"], "count" => $language["sort_count"], "string_asc" => $language["sort_string_asc"], "string_desc" => $language["sort_string_desc"], "numeric_asc" => $language["sort_numeric_asc"], "numeric_desc" => $language["sort_numeric_desc"]]];
}
return $params;
}
public function checkLicense()
{
$license = $this->config->get("rdrf_license");
$domain = preg_replace("/^(https?:\\/\\/)?(www\\.)?([a-zA-Z0-9\\-\\.]{1,61}).*?\$/i", "\\3", HTTP_CATALOG);
if ($license && isset($license["license_type"]) && isset($license["domain"]) && isset($license["ver"]) && $license["domain"] === $domain && $license["ver"] === $this->version) {
switch ($license["license_type"]) {
case "temporary":
$expired = strtotime($license["expired"]);
if (time() < $expired) {
return true;
}
$this->_errors[] = $this->language->get("error_term_expired");
break;
case "unlimited":
return true;
break;
}
}
return false;
}
public function getLicense($store_id = 0)
{
$this->load->language("module/dream_filter");
$this->load->model("setting/setting");
$serial = false;
$note = "";
$domain = HTTP_CATALOG;
if ($store_id !== 0) {
$this->load->model("setting/store");
$store = $this->model_setting_store->getStore($store_id);
if (!empty($store["url"])) {
$domain = $store["url"];
}
}
$post = ["domain" => $domain, "module" => $this->module, "version" => $this->version, "template" => $this->config->get(version_compare(VERSION, "2.2", ">=") ? "config_theme" : "config_template"), "oc_version" => VERSION, "lang" => $this->config->get("config_language")];
try {
$crl = curl_init($this->license_server . "/get-license");
curl_setopt($crl, CURLOPT_CONNECTTIMEOUT, 25);
curl_setopt($crl, CURLOPT_POST, true);
curl_setopt($crl, CURLOPT_POSTFIELDS, http_build_query($post));
curl_setopt($crl, CURLOPT_RETURNTRANSFER, true);
$json = [];
$response = curl_exec($crl);
if ($response === false) {
$this->_errors[] = "cURL error: " . curl_error($crl);
} else {
$json = json_decode($response, true);
}
if (!empty($json["errors"])) {
$this->_errors = $json["errors"];
} else {
if (!empty($json["serial"])) {
$json["domain"] = preg_replace("/^(https?:\\/\\/)?(www\\.)?([a-zA-Z0-9\\-\\.]{1,61}).*?\$/i", "\\3", $domain);
$json["ver"] = $this->version;
$serial = $json["serial"];
if (!empty($json["note"])) {
$note = $json["note"];
}
$setting = $this->model_setting_setting->getSetting("rdrf", $store_id);
$setting["rdrf_license"] = $json;
$this->model_setting_setting->editSetting("rdrf", $setting, $store_id);
} else {
$this->_errors[] = $this->language->get("error_license_server") . (isset($json["status"]) ? " (" . $json["status"] . ")" : "");
if (isset($json["message"])) {
$this->_errors[] = $json["message"];
}
}
}
curl_close($crl);
} catch (Exception $e) {
$this->_errors[] = $e->_obfuscated_FF90AFA3879BAA9B84BDB884A68C89B187A69F87A1AAA1_();
return ["result" => $serial ? $note : false, "errors" => $this->_errors];
}
}
public function getUpdates()
{
$this->load->language("module/dream_filter");
$result = false;
$post = ["domain" => HTTP_CATALOG, "module" => $this->module, "version" => $this->version, "oc_version" => VERSION, "lang" => $this->config->get("config_language")];
try {
$crl = curl_init($this->license_server . "/get-updates");
curl_setopt($crl, CURLOPT_CONNECTTIMEOUT, 25);
curl_setopt($crl, CURLOPT_POST, true);
curl_setopt($crl, CURLOPT_POSTFIELDS, http_build_query($post));
curl_setopt($crl, CURLOPT_RETURNTRANSFER, true);
$response = json_decode(curl_exec($crl), true);
if (!empty($response["updates"])) {
$result = $response["updates"];
}
curl_close($crl);
} catch (Exception $e) {
$this->_errors[] = $e->_obfuscated_FF90AFA3879BAA9B84BDB884A68C89B187A69F87A1AAA1_();
return ["result" => $result, "errors" => $this->_errors];
}
}
public function resetLicense($store_id = 0)
{
$this->load->model("setting/setting");
$config = $this->model_setting_setting->getSetting("rdrf", $store_id);
$config["rdrf_license"] = NULL;
$this->model_setting_setting->editSetting("rdrf", $config, $store_id);
}
public function cleanCache($store_id = 0)
{
$i = 0;
if (is_dir($this->cachePath)) {
$files = scandir($this->cachePath);
foreach ($files as $file) {
if (!($file === "." || $file === "..")) {
$cacheFile = $this->cachePath . "/" . $file;
@unlink($cacheFile);
$i++;
}
}
}
return $i;
}
public function getLayouts($module_id = NULL, $module_code = "dream_filter")
{
if (version_compare(VERSION, "2", "<")) {
$layouts = [];
$modules = $this->config->get($module_code . "_module");
if ($modules) {
foreach ($modules as $id => $module) {
if ($id == $module_id) {
$layouts[] = ["layout_id" => $module["layout_id"], "position" => $module["position"], "status" => $module["status"], "sort_order" => $module["sort_order"]];
}
}
}
return $layouts;
} else {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "layout_module WHERE code = '" . $module_code . ($module_id ? "." . $module_id : "") . "'");
return $query->rows;
}
}
public function getFilterGroups($data = [])
{
$sql = "SELECT * FROM `" . DB_PREFIX . "filter_group` fg LEFT JOIN " . DB_PREFIX . "filter_group_description fgd ON (fg.filter_group_id = fgd.filter_group_id) WHERE fgd.language_id = '" . (int) $this->config->get("config_language_id") . "'";
if (!empty($data["filter_name"])) {
$sql .= " AND fgd.name LIKE '" . $this->db->escape($data["filter_name"]) . "%'";
}
$sort_data = ["fgd.name", "fg.sort_order"];
if (isset($data["sort"]) && in_array($data["sort"], $sort_data)) {
$sql .= " ORDER BY " . $data["sort"];
} else {
$sql .= " ORDER BY fgd.name";
}
if (isset($data["order"]) && $data["order"] === "DESC") {
$sql .= " DESC";
} else {
$sql .= " ASC";
}
if (isset($data["start"]) || isset($data["limit"])) {
if ($data["start"] < 0) {
$data["start"] = 0;
}
if ($data["limit"] < 1) {
$data["limit"] = 20;
}
$sql .= " LIMIT " . (int) $data["start"] . "," . (int) $data["limit"];
}
$query = $this->db->query($sql);
return $query->rows;
}
}
?>
Многовато заглушек obfuscated_