-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModAjax.php
44 lines (31 loc) · 882 Bytes
/
ModAjax.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
use Core2\Mod\Proxy;
require_once DOC_ROOT . "core2/inc/ajax.func.php";
/**
* Class ModAjax
*/
class ModAjax extends ajaxFunc {
/**
* @param array $data
* @return xajaxResponse
* @throws Zend_Db_Adapter_Exception
* @throws Exception
*/
public function axSaveProducts(array $data): xajaxResponse {
$fields = [
'section' => 'req',
'category' => 'req',
'title' => 'req',
];
if ($this->ajaxValidate($data, $fields)) {
return $this->response;
}
$this->saveData($data);
if (empty($this->error)) {
$this->response->script("CoreUI.notice.create('Сохранено');");
$this->response->script("load('index.php?module=products');");
}
$this->done($data);
return $this->response;
}
}