feat(profile): disable ads toggle on certain domains
Introduced a condition to disable the advertisements toggle for specific domains, enhancing user experience by clearly distinguishing environments where ad configurations are not applicable. By explicitly disabling the toggle on unsupported domains, it guides users towards intended interactions within the application, reducing potential support inquiries and user frustration related to advertisement settings in non-production environments.
This commit is contained in:
parent
8b99a1faa1
commit
368c8767f0
1 changed files with 16 additions and 6 deletions
|
@ -348,7 +348,17 @@ $page->navigation();
|
||||||
<label><?= __('Advertisements') ?></label>
|
<label><?= __('Advertisements') ?></label>
|
||||||
|
|
||||||
<div class="ui toggle checkbox advertisements">
|
<div class="ui toggle checkbox advertisements">
|
||||||
<?php if (true === $user->getAdvertisements()) { ?>
|
<?php
|
||||||
|
$wishthis_hosts = [
|
||||||
|
'wishthis.localhost',
|
||||||
|
'wishthis.online',
|
||||||
|
'rc.wishthis.online',
|
||||||
|
'dev.wishthis.online',
|
||||||
|
];
|
||||||
|
|
||||||
|
if (!in_array($_SERVER['HTTP_HOST'], $wishthis_hosts, true)) { ?>
|
||||||
|
<input type="checkbox" name="enable-advertisements" disabled="disabled" />
|
||||||
|
<?php } elseif (true === $user->getAdvertisements()) { ?>
|
||||||
<input type="checkbox" name="enable-advertisements" checked="checked" />
|
<input type="checkbox" name="enable-advertisements" checked="checked" />
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
<input type="checkbox" name="enable-advertisements" />
|
<input type="checkbox" name="enable-advertisements" />
|
||||||
|
|
Loading…
Reference in a new issue