![]() 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/ConfigBundle/Event/ |
<?php namespace Mautic\ConfigBundle\Event; use Mautic\CoreBundle\Helper\BundleHelper; use Symfony\Contracts\EventDispatcher\Event; class ConfigBuilderEvent extends Event { /** * @var mixed[] */ private array $forms = []; /** * @var string[] */ private array $formThemes = [ '@MauticConfig/FormTheme/_config_file_row.html.twig', '@MauticConfig/FormTheme/dsn_row.html.twig', ]; /** * @var string[] */ protected array $encodedFields = []; public function __construct( private BundleHelper $bundleHelper ) { } /** * Set new form to the forms array. * * @return $this */ public function addForm(array $form) { if (isset($form['formTheme'])) { $this->formThemes[] = $form['formTheme']; } $this->forms[$form['formAlias']] = $form; return $this; } /** * Remove a form to the forms array. * * @param string $formAlias */ public function removeForm($formAlias): bool { if (isset($this->forms[$formAlias])) { unset($this->forms[$formAlias]); return true; } return false; } /** * Returns the forms array. * * @return array */ public function getForms() { return $this->forms; } /** * Returns the formThemes array. * * @return array */ public function getFormThemes() { return $this->formThemes; } /** * Get default parameters from config defined in bundles. * * @return array */ public function getParametersFromConfig($bundle) { static $allBundles; if (empty($allBundles)) { $allBundles = $this->bundleHelper->getMauticBundles(true); } if (isset($allBundles[$bundle]) && $allBundles[$bundle]['config']['parameters']) { return $allBundles[$bundle]['config']['parameters']; } else { return []; } } /** * @return $this */ public function addFileFields($fields) { $this->encodedFields = array_merge($this->encodedFields, (array) $fields); return $this; } /** * @return array */ public function getFileFields() { return $this->encodedFields; } }