![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/mautic.corals.io/app/bundles/StageBundle/Controller/ |
<?php namespace Mautic\StageBundle\Controller; use Mautic\CoreBundle\Controller\AjaxController as CommonAjaxController; use Mautic\CoreBundle\Helper\InputHelper; use Mautic\StageBundle\Form\Type\StageActionType; use Symfony\Component\Form\FormFactoryInterface; use Symfony\Component\HttpFoundation\Request; class AjaxController extends CommonAjaxController { public function getActionFormAction(Request $request, FormFactoryInterface $formFactory): \Symfony\Component\HttpFoundation\JsonResponse { $dataArray = [ 'success' => 0, 'html' => '', ]; $type = InputHelper::clean($request->request->get('actionType')); if (!empty($type)) { // get the HTML for the form /** @var \Mautic\StageBundle\Model\StageModel $model */ $model = $this->getModel('stage'); $actions = $model->getStageActions(); if (isset($actions['actions'][$type])) { $themes = ['MauticStageBundle:FormTheme\Action']; if (!empty($actions['actions'][$type]['formTheme'])) { $themes[] = $actions['actions'][$type]['formTheme']; } $formType = (!empty($actions['actions'][$type]['formType'])) ? $actions['actions'][$type]['formType'] : 'genericstage_settings'; $formTypeOptions = (!empty($actions['actions'][$type]['formTypeOptions'])) ? $actions['actions'][$type]['formTypeOptions'] : []; $form = $formFactory->create(StageActionType::class, [], ['formType' => $formType, 'formTypeOptions' => $formTypeOptions]); $html = $this->renderView('@MauticStage/Stage/actionform.html.twig', [ 'form' => $this->setFormTheme($form, '@MauticStage/Stage/actionform.html.twig', $themes), ]); $html = str_replace('stageaction', 'stage', $html); $dataArray['html'] = $html; $dataArray['success'] = 1; } } return $this->sendJsonResponse($dataArray); } }