Initial commit: CloudOps infrastructure platform
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace Mautic\PageBundle\Event;
|
||||
|
||||
use Mautic\CoreBundle\Event\BuilderEvent;
|
||||
use Mautic\PageBundle\Entity\Page;
|
||||
|
||||
class PageBuilderEvent extends BuilderEvent
|
||||
{
|
||||
/**
|
||||
* @return Page|null
|
||||
*/
|
||||
public function getPage()
|
||||
{
|
||||
return $this->entity;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
namespace Mautic\PageBundle\Event;
|
||||
|
||||
use Mautic\LeadBundle\Entity\Lead;
|
||||
use Mautic\PageBundle\Entity\Page;
|
||||
use Symfony\Contracts\EventDispatcher\Event;
|
||||
|
||||
class PageDisplayEvent extends Event
|
||||
{
|
||||
/**
|
||||
* Preferred lead to be used in listeners.
|
||||
*/
|
||||
private ?Lead $lead = null;
|
||||
|
||||
public function __construct(
|
||||
private string $content,
|
||||
private Page $page,
|
||||
private array $params = [],
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Page entity.
|
||||
*
|
||||
* @return Page
|
||||
*/
|
||||
public function getPage()
|
||||
{
|
||||
return $this->page;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get page content.
|
||||
*/
|
||||
public function getContent(): string
|
||||
{
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set page content.
|
||||
*
|
||||
* @param string $content
|
||||
*/
|
||||
public function setContent($content): void
|
||||
{
|
||||
$this->content = $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get params.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getParams()
|
||||
{
|
||||
return $this->params;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set params.
|
||||
*
|
||||
* @param array $params
|
||||
*/
|
||||
public function setParams($params): void
|
||||
{
|
||||
$this->params = $params;
|
||||
}
|
||||
|
||||
public function getLead(): ?Lead
|
||||
{
|
||||
return $this->lead;
|
||||
}
|
||||
|
||||
public function setLead(Lead $lead): void
|
||||
{
|
||||
$this->lead = $lead;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Mautic\PageBundle\Event;
|
||||
|
||||
use Mautic\CoreBundle\Event\CommonEvent;
|
||||
use Mautic\PageBundle\Entity\Page;
|
||||
|
||||
final class PageEditSubmitEvent extends CommonEvent
|
||||
{
|
||||
public function __construct(
|
||||
private Page $previousPage,
|
||||
private Page $currentPage,
|
||||
private bool $saveAndClose,
|
||||
private bool $apply,
|
||||
private bool $saveAsDraft,
|
||||
private bool $applyDraft,
|
||||
private bool $discardDraft,
|
||||
) {
|
||||
}
|
||||
|
||||
public function getPreviousPage(): Page
|
||||
{
|
||||
return $this->previousPage;
|
||||
}
|
||||
|
||||
public function getCurrentPage(): Page
|
||||
{
|
||||
return $this->currentPage;
|
||||
}
|
||||
|
||||
public function isSaveAndClose(): bool
|
||||
{
|
||||
return $this->saveAndClose;
|
||||
}
|
||||
|
||||
public function isApply(): bool
|
||||
{
|
||||
return $this->apply;
|
||||
}
|
||||
|
||||
public function isSaveAsDraft(): bool
|
||||
{
|
||||
return $this->saveAsDraft;
|
||||
}
|
||||
|
||||
public function isApplyDraft(): bool
|
||||
{
|
||||
return $this->applyDraft;
|
||||
}
|
||||
|
||||
public function isDiscardDraft(): bool
|
||||
{
|
||||
return $this->discardDraft;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace Mautic\PageBundle\Event;
|
||||
|
||||
use Mautic\CoreBundle\Event\CommonEvent;
|
||||
use Mautic\PageBundle\Entity\Page;
|
||||
|
||||
class PageEvent extends CommonEvent
|
||||
{
|
||||
/**
|
||||
* @param bool $isNew
|
||||
*/
|
||||
public function __construct(Page $page, $isNew = false)
|
||||
{
|
||||
$this->entity = $page;
|
||||
$this->isNew = $isNew;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Page entity.
|
||||
*
|
||||
* @return Page
|
||||
*/
|
||||
public function getPage()
|
||||
{
|
||||
return $this->entity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the Page entity.
|
||||
*/
|
||||
public function setPage(Page $page): void
|
||||
{
|
||||
$this->entity = $page;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
namespace Mautic\PageBundle\Event;
|
||||
|
||||
use Mautic\CoreBundle\Event\CommonEvent;
|
||||
use Mautic\PageBundle\Entity\Hit;
|
||||
use Mautic\PageBundle\Entity\Page;
|
||||
|
||||
class PageHitEvent extends CommonEvent
|
||||
{
|
||||
protected ?Page $page = null;
|
||||
|
||||
/**
|
||||
* @param mixed[] $clickthroughData
|
||||
* @param bool $unique
|
||||
*/
|
||||
public function __construct(
|
||||
Hit $hit,
|
||||
protected $request,
|
||||
protected $code,
|
||||
protected $clickthroughData = [],
|
||||
protected $unique = false,
|
||||
) {
|
||||
$this->entity = $hit;
|
||||
$this->page = $hit->getPage();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Page entity.
|
||||
*
|
||||
* @return Page
|
||||
*/
|
||||
public function getPage()
|
||||
{
|
||||
return $this->page;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get page request.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getRequest()
|
||||
{
|
||||
return $this->request;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get HTML code.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getCode()
|
||||
{
|
||||
return $this->code;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Hit
|
||||
*/
|
||||
public function getHit()
|
||||
{
|
||||
return $this->entity;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getClickthroughData()
|
||||
{
|
||||
return $this->clickthroughData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if this page hit is unique.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isUnique()
|
||||
{
|
||||
return $this->unique;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace Mautic\PageBundle\Event;
|
||||
|
||||
use Mautic\CoreBundle\Event\CommonEvent;
|
||||
use Mautic\PageBundle\Entity\Redirect;
|
||||
|
||||
class RedirectGenerationEvent extends CommonEvent
|
||||
{
|
||||
public function __construct(
|
||||
private Redirect $redirect,
|
||||
private array $clickthrough,
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set or overwrite a value in the clickthrough.
|
||||
*
|
||||
* @param string $key
|
||||
* @param mixed $value
|
||||
*/
|
||||
public function setInClickthrough($key, $value): void
|
||||
{
|
||||
$this->clickthrough[$key] = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the redirect from the event.
|
||||
*
|
||||
* @return Redirect
|
||||
*/
|
||||
public function getRedirect()
|
||||
{
|
||||
return $this->redirect;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the modified clickthrough from the event.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getClickthrough()
|
||||
{
|
||||
return $this->clickthrough;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Mautic\PageBundle\Event;
|
||||
|
||||
use Mautic\LeadBundle\Entity\Lead;
|
||||
use Symfony\Component\HttpFoundation\ParameterBag;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Contracts\EventDispatcher\Event;
|
||||
|
||||
class TrackingEvent extends Event
|
||||
{
|
||||
private ParameterBag $response;
|
||||
|
||||
public function __construct(
|
||||
private Lead $contact,
|
||||
private Request $request,
|
||||
array $mtcSessionResponses,
|
||||
) {
|
||||
$this->response = new ParameterBag($mtcSessionResponses);
|
||||
}
|
||||
|
||||
public function getContact(): Lead
|
||||
{
|
||||
return $this->contact;
|
||||
}
|
||||
|
||||
public function getRequest(): Request
|
||||
{
|
||||
return $this->request;
|
||||
}
|
||||
|
||||
public function getResponse(): ParameterBag
|
||||
{
|
||||
return $this->response;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace Mautic\PageBundle\Event;
|
||||
|
||||
use Symfony\Contracts\EventDispatcher\Event;
|
||||
|
||||
class UntrackableUrlsEvent extends Event
|
||||
{
|
||||
/**
|
||||
* @var string[]
|
||||
*/
|
||||
private array $doNotTrack = [
|
||||
'{webview_url}',
|
||||
'{resubscribe_url}',
|
||||
'{unsubscribe_url}',
|
||||
'{dnc_url}',
|
||||
'{trackable=(.*?)}',
|
||||
];
|
||||
|
||||
/**
|
||||
* @param mixed $content
|
||||
*/
|
||||
public function __construct(
|
||||
private $content,
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* set a URL or token to not convert to trackables.
|
||||
*/
|
||||
public function addNonTrackable($url): void
|
||||
{
|
||||
$this->doNotTrack[] = $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get array of non-trackables.
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getDoNotTrackList(): array
|
||||
{
|
||||
return $this->doNotTrack;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getContent()
|
||||
{
|
||||
return $this->content;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace Mautic\PageBundle\Event;
|
||||
|
||||
use Mautic\CoreBundle\Event\CommonEvent;
|
||||
use Mautic\PageBundle\Entity\VideoHit;
|
||||
|
||||
class VideoHitEvent extends CommonEvent
|
||||
{
|
||||
public function __construct(
|
||||
VideoHit $hit,
|
||||
protected $request,
|
||||
protected $code,
|
||||
) {
|
||||
$this->entity = $hit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get page request.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getRequest()
|
||||
{
|
||||
return $this->request;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get HTML code.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getCode()
|
||||
{
|
||||
return $this->code;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return VideoHit
|
||||
*/
|
||||
public function getHit()
|
||||
{
|
||||
return $this->entity;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user