14Loc::loadMessages(__FILE__);
47 $this->request = Context::getCurrent()->getRequest();
65 protected function end()
68 \CMain::finalActions();
88 $this->sendJsonErrorResponse();
118 'controller' => $this,
124 foreach(
$event->getResults() as $eventResult)
126 if($eventResult->getType() != EventResult::SUCCESS)
155 if(!defined(
'PUBLIC_AJAX_MODE'))
157 define(
'PUBLIC_AJAX_MODE',
true);
163 if(!empty(
$params[
'http_status']) &&
$params[
'http_status'] == 403)
165 header(
'HTTP/1.0 403 Forbidden',
true, 403);
167 if(!empty(
$params[
'http_status']) &&
$params[
'http_status'] == 500)
169 header(
'HTTP/1.0 500 Internal Server Error',
true, 500);
171 if(!empty(
$params[
'http_status']) &&
$params[
'http_status'] == 510)
173 header(
'HTTP/1.0 510 Not Extended',
true, 510);
176 header(
'Content-Type:application/json; charset=UTF-8');
186 protected function sendJsonErrorResponse()
193 'message' =>
$error->getMessage(),
194 'code' =>
$error->getCode(),
198 $this->sendJsonResponse(
array(
199 'status' => self::STATUS_ERROR,
212 'status' => self::STATUS_DENIED,
225 'status' => self::STATUS_INVALID_SIGN,
237 $response[
'status'] = self::STATUS_SUCCESS;
263 return $this->errorCollection->toArray();
273 return $this->errorCollection->getErrorByCode(
$code);
284 $action = mb_strtolower($this->action);
286 if(!isset($listOfActions[
$action]))
288 $this->errorCollection->add(
array(
new Error(Loc::getMessage(
'REPORT_CONTROLLER_ERROR_UNKNOWN_ACTION',
289 array(
'#ACTION#' =>
$action)), self::ERROR_UNKNOWN_ACTION)));
293 $this->realActionName =
$action;
309 $normalized =
array();
323 return array_change_key_case($normalized, CASE_LOWER);
347 'method' =>
array(
'GET'),
349 'check_csrf_token' =>
false,
350 'redirect_on_auth' =>
true,
351 'close_session' =>
false,
377 if($this->errorCollection->count())
379 $this->sendJsonErrorResponse();
399 ($this->request->isPost() && !isset(
$description[
'check_csrf_token'])))
408 if(!in_array($this->request->getRequestMethod(),
$description[
'method']))
466 return $this->actionDescription;
526 session_write_close();
528 $actionMethod =
'processAction' . $this->
getAction();
530 return $this->$actionMethod();
541 $this->errorCollection->add(
array(
new Error($e->getMessage())));
542 $this->sendJsonErrorResponse();
582 foreach ($required as $item)
584 if(!isset($inputParams[$item]) || (!$inputParams[$item] &&
585 !(is_string($inputParams[$item]) && mb_strlen($inputParams[$item]))))
588 Loc::getMessage(
'REPORT_CONTROLLER_ERROR_REQUIRED_PARAMETER',
589 array(
'#PARAM#' => $item)), self::ERROR_REQUIRED_PARAMETER)));
606 foreach($required as $item)
608 $params[$item] = $this->request->getPost($item);
624 foreach($required as $item)
626 $params[$item] = $this->request->getQuery($item);
642 foreach($required as $item)
644 $params[$item] = $this->request->getFile($item);
657 return $this->request->isAjaxRequest();
sendJsonSuccessResponse(array $response=array())
const STATUS_INVALID_SIGN
runProcessingIfUserNotAuthorized()
const EVENT_ON_BEFORE_ACTION
sendJsonInvalidSignResponse($message='')
triggerOnBeforeAction($action)
const ERROR_REQUIRED_PARAMETER
processBeforeAction($actionName)
checkRequiredFilesParams(array $required)
setAction($action, array $description)
const ERROR_UNKNOWN_ACTION
runProcessingException(\Exception $e)
sendJsonResponse($response, $params=null)
normalizeActionDescription($action, $description)
checkRequiredPostParams(array $required)
checkRequiredGetParams(array $required)
runProcessingIfInvalidCsrfToken()
normalizeListOfAction(array $listOfActions)
checkRequiredInputParams(array $inputParams, array $required)
sendJsonAccessDeniedResponse($message='')
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
if(Loader::includeModule( 'bitrix24')) elseif(Loader::includeModule('intranet') &&CIntranetUtils::getPortalZone() !=='ru') $description
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
const SITE_DIR(!defined('LANG'))
check_bitrix_sessid($varname='sessid')
LocalRedirect($url, $skip_security_check=false, $status="302 Found")
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']