Initial commit: CloudOps infrastructure platform

This commit is contained in:
root
2026-04-09 19:58:57 +02:00
commit 1166a52f26
7762 changed files with 839452 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
<?php
declare(strict_types=1);
namespace Mautic\LeadBundle\Twig\Extension;
use Mautic\LeadBundle\Exception\UnknownDncReasonException;
use Mautic\LeadBundle\Twig\Helper\DncReasonHelper;
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;
class DncReasonExtension extends AbstractExtension
{
public function __construct(
protected DncReasonHelper $helper,
) {
}
/**
* @see Twig_Extension::getFunctions()
*/
public function getFunctions()
{
return [
new TwigFunction('dncReasonToText', [$this, 'toText']),
];
}
/**
* Convert DNC reason ID to text.
*
* @throws UnknownDncReasonException
*/
public function toText(int $reasonId): string
{
return $this->helper->toText($reasonId);
}
}

View File

@@ -0,0 +1,33 @@
<?php
declare(strict_types=1);
namespace Mautic\LeadBundle\Twig\Extension;
use Mautic\LeadBundle\Helper\FormFieldHelper;
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;
final class FormFieldExtension extends AbstractExtension
{
public function getFunctions()
{
return [
new TwigFunction('leadFieldCountryChoices', [FormFieldHelper::class, 'getCountryChoices']),
new TwigFunction('leadFieldRegionChoices', [FormFieldHelper::class, 'getRegionChoices']),
new TwigFunction('leadFieldTimezonesChoices', [FormFieldHelper::class, 'getTimezonesChoices']),
new TwigFunction('leadFieldLocaleChoices', [$this, 'getLeadFieldLocaleChoices']),
new TwigFunction('leadFormFieldParseListForChoices', [FormFieldHelper::class, 'parseListForChoices']),
];
}
/**
* Get locale choices with proper key=>value.
*
* @return array<string, string>
*/
public function getLeadFieldLocaleChoices(): array
{
return array_flip(FormFieldHelper::getLocaleChoices());
}
}

View File

@@ -0,0 +1,38 @@
<?php
declare(strict_types=1);
namespace Mautic\LeadBundle\Twig\Extension;
use Mautic\LeadBundle\Entity\Lead;
use Mautic\LeadBundle\Twig\Helper\AvatarHelper;
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;
class LeadExtension extends AbstractExtension
{
public function __construct(
protected AvatarHelper $avatarHelper,
) {
}
/**
* @see Twig_Extension::getFunctions()
*/
public function getFunctions()
{
return [
new TwigFunction('leadGetAvatar', [$this, 'getAvatar']),
];
}
/**
* @see AvatarHelper::getAvatar
*
* @return mixed
*/
public function getAvatar(Lead $lead)
{
return $this->avatarHelper->getAvatar($lead);
}
}