Skip to content

Commit

Permalink
Added maintenance link
Browse files Browse the repository at this point in the history
  • Loading branch information
L3RAZ committed Aug 1, 2023
1 parent fc3579f commit 276813b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/Adapter/LinkAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,14 @@ public function __construct(\Link $link = null)
public function getAdminLink($controller, $withToken = true, $sfRouteParams = [], $params = [])
{
if ((new ShopContext())->isShop17()) {
return $this->link->getAdminLink($controller, $withToken, $sfRouteParams, $params);
$adminLink = $this->link->getAdminLink($controller, $withToken, $sfRouteParams, $params);
// We have problems with links in our zoid application, since some links generated don't have domain they redirect to CDN domain
// Routes that use new symfony router are returned without the domain
if (strpos($adminLink, 'http') !== 0) {
return \Tools::getShopDomainSsl(true) . $adminLink;
}

return $adminLink;
}

$paramsAsString = '';
Expand Down
3 changes: 2 additions & 1 deletion src/Presenter/Store/Modules/ContextModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public function present()
'shopsTree' => $this->getShopsTree(),
'faq' => $this->getFaq(),
'language' => $this->psContext->getLanguage(),
'prestashopCheckoutAjax' => (new LinkAdapter($this->psContext->getLink()))->getAdminLink('AdminAjaxPrestashopCheckout'),
'prestashopCheckoutAjax' => $this->getGeneratedLink('AdminAjaxPrestashopCheckout'),
'translations' => $this->translations->getTranslations(),
'readmeUrl' => $this->getReadme(),
'cguUrl' => $this->getCgu(),
Expand All @@ -170,6 +170,7 @@ public function present()
'countriesLink' => $this->getGeneratedLink('AdminCountries'),
'currenciesLink' => $this->getGeneratedLink('AdminCurrencies'),
'paymentPreferencesLink' => $this->getGeneratedLink($this->shopContext->isShop17() ? 'AdminPaymentPreferences' : 'AdminPayment'),
'maintenanceLink' => $this->getGeneratedLink('AdminMaintenance'),
'overridesExist' => $this->overridesExist(),
'submitIdeaLink' => $this->getSubmitIdeaLink(),
'orderTotal' => (new OrderRepository())->count($this->psContext->getShopId()),
Expand Down

0 comments on commit 276813b

Please sign in to comment.