| Current Path : /var/www/administrator/components/com_qf3/src/model/ |
| Current File : /var/www/administrator/components/com_qf3/src/model/shop.php |
<?php
/**
* @Copyright ((c) plasma-web.ru
* @license GPLv2 or later
*/
namespace QuickForm;
\defined('QF3_VERSION') or die;
class shopModel extends baseModel
{
public function __construct()
{
$this->closelink = 'projects';
$this->config = new qf_config();
}
public function getItems() {
return $this->config->getItems($this->config->shopsettingsFile);
}
public function save() {
$data = filter_input(INPUT_POST, 'qffield', FILTER_SANITIZE_FULL_SPECIAL_CHARS , FILTER_REQUIRE_ARRAY);
if(!empty($data)){
foreach ($data as $k => &$v) {
$v = stripslashes($v);
}
$cod = '<?php return \''.json_encode($data, (JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_NUMERIC_CHECK)) . '\';';
file_put_contents($this->config->shopsettingsFile, $cod);
}
else $this->errors[] = 'empty data';
}
}