mirror of
https://github.com/getnamingo/registry.git
synced 2025-07-20 01:25:56 +02:00
Domain transfer further preparation
This commit is contained in:
parent
423f570235
commit
a07f3fb504
1 changed files with 36 additions and 2 deletions
|
@ -1495,12 +1495,26 @@ class DomainsController extends Controller
|
||||||
$yearsUntilExpiration = $expirationYear - $currentYear;
|
$yearsUntilExpiration = $expirationYear - $currentYear;
|
||||||
$maxYears = 10 - $yearsUntilExpiration;
|
$maxYears = 10 - $yearsUntilExpiration;
|
||||||
|
|
||||||
|
$locale = (isset($_SESSION['_lang']) && !empty($_SESSION['_lang'])) ? $_SESSION['_lang'] : 'en_US';
|
||||||
|
$currency = $_SESSION['_currency'] ?? 'USD'; // Default to USD if not set
|
||||||
|
|
||||||
|
$formatter = new \NumberFormatter($locale, \NumberFormatter::CURRENCY);
|
||||||
|
$formatter->setTextAttribute(\NumberFormatter::CURRENCY_CODE, $currency);
|
||||||
|
|
||||||
|
$symbol = $formatter->getSymbol(\NumberFormatter::CURRENCY_SYMBOL);
|
||||||
|
$pattern = $formatter->getPattern();
|
||||||
|
|
||||||
|
// Determine currency position (before or after)
|
||||||
|
$position = (strpos($pattern, '¤') < strpos($pattern, '#')) ? 'before' : 'after';
|
||||||
|
|
||||||
return view($response,'admin/domains/renewDomain.twig', [
|
return view($response,'admin/domains/renewDomain.twig', [
|
||||||
'domain' => $domain,
|
'domain' => $domain,
|
||||||
'domainStatus' => $domainStatus,
|
'domainStatus' => $domainStatus,
|
||||||
'registrar' => $registrars,
|
'registrar' => $registrars,
|
||||||
'maxYears' => $maxYears,
|
'maxYears' => $maxYears,
|
||||||
'currentUri' => $uri
|
'currentUri' => $uri,
|
||||||
|
'currencySymbol' => $symbol,
|
||||||
|
'currencyPosition' => $position
|
||||||
]);
|
]);
|
||||||
} else {
|
} else {
|
||||||
// Domain does not exist, redirect to the domains view
|
// Domain does not exist, redirect to the domains view
|
||||||
|
@ -1827,7 +1841,27 @@ class DomainsController extends Controller
|
||||||
|
|
||||||
public function requestTransfer(Request $request, Response $response)
|
public function requestTransfer(Request $request, Response $response)
|
||||||
{
|
{
|
||||||
return view($response,'admin/domains/requestTransfer.twig');
|
$db = $this->container->get('db');
|
||||||
|
$registrars = $db->select("SELECT id, clid, name FROM registrar");
|
||||||
|
|
||||||
|
$locale = (isset($_SESSION['_lang']) && !empty($_SESSION['_lang'])) ? $_SESSION['_lang'] : 'en_US';
|
||||||
|
$currency = $_SESSION['_currency'] ?? 'USD'; // Default to USD if not set
|
||||||
|
|
||||||
|
$formatter = new \NumberFormatter($locale, \NumberFormatter::CURRENCY);
|
||||||
|
$formatter->setTextAttribute(\NumberFormatter::CURRENCY_CODE, $currency);
|
||||||
|
|
||||||
|
$symbol = $formatter->getSymbol(\NumberFormatter::CURRENCY_SYMBOL);
|
||||||
|
$pattern = $formatter->getPattern();
|
||||||
|
|
||||||
|
// Determine currency position (before or after)
|
||||||
|
$position = (strpos($pattern, '¤') < strpos($pattern, '#')) ? 'before' : 'after';
|
||||||
|
|
||||||
|
// Default view for GET requests or if POST data is not set
|
||||||
|
return view($response,'admin/domains/requestTransfer.twig', [
|
||||||
|
'registrars' => $registrars,
|
||||||
|
'currencySymbol' => $symbol,
|
||||||
|
'currencyPosition' => $position,
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function approveTransfer(Request $request, Response $response)
|
public function approveTransfer(Request $request, Response $response)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue