public function getList() { $res = new responseCsp(); if ($count = $this->getModel()->getCount()) { $list = $this->getModel()->getList(reqCsp::get('post')); $res->addData('list', $list); $res->addData('count', $count); $res->addMessage(langCsp::_('Done')); } else { $res->pushError($this->getModel()->getErrors()); } return $res->ajaxExec(); }
public function deleteUser() { $res = new responseCsp(); if (($delUserData = $this->getModel()->deleteElement(reqCsp::get('post'))) !== false) { $res->addMessage(langCsp::_('User removed')); $res->addData($delUserData); } else { $res->pushError($this->getModel('access')->getErrors()); } return $res->ajaxExec(); }
public function setTplDefault() { $res = new responseCsp(); $newOptValue = $this->getModel()->setTplAnyDefault(reqCsp::get('post')); if ($newOptValue !== false) { $res->addMessage(langCsp::_('Done')); $res->addData('newOptValue', $newOptValue); } else { $res->pushError($this->getModel('options')->getErrors()); } return $res->ajaxExec(); }