summaryrefslogtreecommitdiff
path: root/app/Template/user_notifications.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Template/user_notifications.php')
-rw-r--r--app/Template/user_notifications.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/app/Template/user_notifications.php b/app/Template/user_notifications.php
index 13dd9809..4a32a41d 100644
--- a/app/Template/user_notifications.php
+++ b/app/Template/user_notifications.php
@@ -8,13 +8,16 @@
<?= Helper\form_checkbox('notifications_enabled', t('Enable email notifications'), '1', $notifications['notifications_enabled'] == 1) ?><br/>
- <p><?= t('I want to receive notifications only for those projects:') ?><br/><br/></p>
+ <?php if (! empty($projects)): ?>
+ <p><?= t('I want to receive notifications only for those projects:') ?><br/><br/></p>
+
+ <div class="form-checkbox-group">
+ <?php foreach ($projects as $project_id => $project_name): ?>
+ <?= Helper\form_checkbox('projects['.$project_id.']', $project_name, '1', isset($notifications['project_'.$project_id])) ?>
+ <?php endforeach ?>
+ </div>
+ <?php endif ?>
- <div class="form-checkbox-group">
- <?php foreach ($projects as $project_id => $project_name): ?>
- <?= Helper\form_checkbox('projects['.$project_id.']', $project_name, '1', isset($notifications['project_'.$project_id])) ?>
- <?php endforeach ?>
- </div>
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
<?= t('or') ?> <a href="?controller=user&amp;action=show&amp;user_id=<?= $user['id'] ?>"><?= t('cancel') ?></a>