/** * @param MauticFactory $factory */ public function __construct(MauticFactory $factory) { $this->translator = $factory->getTranslator(); $this->validator = $factory->getValidator(); $this->apiMode = $factory->getRequest()->get('api_mode', $factory->getSession()->get('mautic.client.filter.api_mode', 'oauth1a')); $this->router = $factory->getRouter(); }
/** * Gets the URL for the built in oauth callback * * @return string */ public function getAuthCallbackUrl() { $defaultUrl = $this->factory->getRouter()->generate('mautic_integration_auth_callback', array('integration' => $this->getName()), true); /** @var PluginIntegrationAuthCallbackUrlEvent $event */ $event = $this->dispatcher->dispatch(PluginEvents::PLUGIN_ON_INTEGRATION_GET_AUTH_CALLBACK_URL, new PluginIntegrationAuthCallbackUrlEvent($this, $defaultUrl)); return $event->getCallbackUrl(); }
/** * @param MauticFactory $factory */ public function __construct(MauticFactory $factory) { $this->em = $factory->getEntityManager(); $this->translator = $factory->getTranslator(); $this->model = $factory->getModel('category'); $this->router = $factory->getRouter(); }
/** * Get tokens * * @return array */ public function getTokens() { $tokens = array_merge($this->globalTokens, $this->eventTokens); // Include the tracking pixel token as it's auto appended to the body if ($this->appendTrackingPixel) { $tokens['{tracking_pixel}'] = $this->factory->getRouter()->generate('mautic_email_tracker', array('idHash' => $this->idHash), true); } else { $tokens['{tracking_pixel}'] = self::getBlankPixel(); } return $tokens; }
/** * @param $route * @param array $routeParams * @param bool $absolute * @param array $clickthrough * @param bool $shortenUrl * * @return string */ public function buildUrl($route, $routeParams = array(), $absolute = true, $clickthrough = array(), $shortenUrl = false) { $url = $this->factory->getRouter()->generate($route, $routeParams, $absolute); $url .= !empty($clickthrough) ? '?ct=' . $this->encodeArrayForUrl($clickthrough) : ''; if ($shortenUrl) { /** @var UrlHelper $urlHelper */ $urlHelper = $this->factory->getHelper('url'); return $urlHelper->buildShortUrl($url); } return $url; }
/** * @param MauticFactory $factory */ public function __construct(MauticFactory $factory) { $this->factory = $factory; $this->templating = $factory->getTemplating(); $this->request = $factory->getRequest(); $this->security = $factory->getSecurity(); $this->serializer = $factory->getSerializer(); $this->params = $factory->getSystemParameters(); $this->dispatcher = $factory->getDispatcher(); $this->translator = $factory->getTranslator(); $this->em = $factory->getEntityManager(); $this->router = $factory->getRouter(); $this->init(); }
/** * @param $route * @param array $routeParams * @param bool $absolute * @param array $clickthrough * * @return string */ public function buildUrl($route, $routeParams = array(), $absolute = true, $clickthrough = array()) { $url = $this->factory->getRouter()->generate($route, $routeParams, $absolute); $url .= !empty($clickthrough) ? '?ct=' . $this->encodeArrayForUrl($clickthrough) : ''; return $url; }
/** * Gets the URL for the built in oauth callback * * @return string */ public function getAuthCallbackUrl() { return $this->factory->getRouter()->generate('mautic_integration_auth_callback', array('integration' => $this->getName()), true); }