Created
October 27, 2017 11:24
-
-
Save steepzero-old/44f15e529457356504f925b705754c41 to your computer and use it in GitHub Desktop.
$request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?require_once($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/main/include/prolog_before.php'); | |
use \Bitrix\Main\Loader; | |
use \Bitrix\Main\Web\Json; | |
use \Bitrix\Main\Application; | |
use \F5Studio\Application\Application as App; | |
$request = Application::getInstance()->getContext()->getRequest(); | |
if($request->isAjaxRequest() && check_bitrix_sessid()){ | |
if($request->getPost('ID')){ | |
Loader::includeModule('iblock'); | |
try { | |
App::cancel($request->getPost('ID')); | |
echo Json::encode(array( | |
'status' => true, | |
)); | |
}catch (\Exception $e){ | |
echo Json::encode(array( | |
'status' => false, | |
'message' => $e->getMessage() | |
)); | |
} | |
exit; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment