Moved lib/API to lib/Router

- renamed lib/API/API.php to lib/Router/Front.php
- updated namespaces in various file to account for namespace change
This commit is contained in:
Jonathan Labreuille
2016-07-28 16:57:36 +02:00
parent d0fb94b3f8
commit 008fdb94c5
10 changed files with 42 additions and 35 deletions

View File

@ -1,8 +1,8 @@
<?php
namespace MailPoet\Newsletter\Links;
use MailPoet\API\API;
use MailPoet\API\Endpoints\Track as TrackAPI;
use MailPoet\Router\Front as FrontRouter;
use MailPoet\Router\Track as TrackEndpoint;
use MailPoet\Models\NewsletterLink;
use MailPoet\Newsletter\Shortcodes\Shortcodes;
use MailPoet\Util\Security;
@ -115,12 +115,12 @@ class Links {
'queue' => $queue_id,
'hash' => $hash
);
$API_action = ($matches[2][$index] === self::DATA_TAG_CLICK) ?
TrackAPI::ACTION_CLICK :
TrackAPI::ACTION_OPEN;
$link = API::buildRequest(
TrackAPI::ENDPOINT,
$API_action,
$router_action = ($matches[2][$index] === self::DATA_TAG_CLICK) ?
TrackEndpoint::ACTION_CLICK :
TrackEndpoint::ACTION_OPEN;
$link = FrontRouter::buildRequest(
TrackEndpoint::ENDPOINT,
$router_action,
$data
);
$content = str_replace($match, $link, $content);