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,13 +348,23 @@ $page->navigation();
|
|||
<label><?= __('Advertisements') ?></label>
|
||||
|
||||
<div class="ui toggle checkbox advertisements">
|
||||
<?php if (true === $user->getAdvertisements()) { ?>
|
||||
<input type="checkbox" name="enable-advertisements" checked="checked" />
|
||||
<?php } else { ?>
|
||||
<input type="checkbox" name="enable-advertisements" />
|
||||
<?php } ?>
|
||||
<?php
|
||||
$wishthis_hosts = [
|
||||
'wishthis.localhost',
|
||||
'wishthis.online',
|
||||
'rc.wishthis.online',
|
||||
'dev.wishthis.online',
|
||||
];
|
||||
|
||||
<label><?= __('Enable advertisements') ?></label>
|
||||
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" />
|
||||
<?php } else { ?>
|
||||
<input type="checkbox" name="enable-advertisements" />
|
||||
<?php } ?>
|
||||
|
||||
<label><?= __('Enable advertisements') ?></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in a new issue