Skip to content

Commit

Permalink
Rewrites timezone display fix in more readable way
Browse files Browse the repository at this point in the history
  • Loading branch information
evertton committed Sep 30, 2024
1 parent 49bd6b0 commit c89d270
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions pages/profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -399,15 +399,16 @@
<label class="col-sm-10 control-label"><?php echo $lang->get('timezone_selection');?></label>
<div class="col-sm-10">
<select class="form-control" id="profile-user-timezone">
<?php
foreach ($zones as $key => $zone) {
echo '
<option value="' . $key . '"',
$session->has('user-timezone') && $session->get('user-timezone') === $key ? ' selected' :
(($session->has('user-timezone') && $session->get('user-timezone') === 'not_defined') && isset($SETTINGS['timezone']) && $SETTINGS['timezone'] === $key ? ' selected' : ''),
'>' . $zone . '</option>';
}
?>
<?php foreach ($zones as $key => $zone): ?>
<option value="<?php echo $key; ?>"<?php
if ($session->has('user-timezone'))
if($session->get('user-timezone') === $key)
echo ' selected';
elseif ($session->get('user-timezone') === 'not_defined')
if (isset($SETTINGS['timezone']) && $SETTINGS['timezone'] === $key)
echo ' selected';
?>><?php echo $zone; ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
Expand Down

0 comments on commit c89d270

Please sign in to comment.