summaryrefslogtreecommitdiff
path: root/app/Template/header.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-02-21 19:58:44 -0500
committerFrederic Guillot <fred@kanboard.net>2016-02-21 19:58:44 -0500
commitdbef8d389e39799d3ebe1c2b3772968c2f435c0c (patch)
treea7c7e4a21e2c3dd57bc41520e1552ed805efd075 /app/Template/header.php
parent16fdf792fbd6176933ab55f914dae2f88737d5be (diff)
Do not show empty dropdown when private projects are disabled
Diffstat (limited to 'app/Template/header.php')
-rw-r--r--app/Template/header.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/Template/header.php b/app/Template/header.php
index a945411e..e646012a 100644
--- a/app/Template/header.php
+++ b/app/Template/header.php
@@ -38,19 +38,24 @@
</span>
<?php endif ?>
+ <?php $has_project_creation_access = $this->user->hasAccess('ProjectCreation', 'create'); ?>
+ <?php $is_private_project_enabled = $this->app->config('disable_private_project', 0) == 0; ?>
+
+ <?php if ($has_project_creation_access || (!$has_project_creation_access && $is_private_project_enabled)): ?>
<div class="dropdown">
<a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-plus fa-fw"></i><i class="fa fa-caret-down"></i></a>
<ul>
- <?php if ($this->user->hasAccess('ProjectCreation', 'create')): ?>
+ <?php if ($has_project_creation_access): ?>
<li><i class="fa fa-plus fa-fw"></i><?= $this->url->link(t('New project'), 'ProjectCreation', 'create', array(), false, 'popover') ?></li>
<?php endif ?>
- <?php if ($this->app->config('disable_private_project', 0) == 0): ?>
+ <?php if ($is_private_project_enabled): ?>
<li>
<i class="fa fa-lock fa-fw"></i><?= $this->url->link(t('New private project'), 'ProjectCreation', 'createPrivate', array(), false, 'popover') ?>
</li>
<?php endif ?>
</ul>
</div>
+ <?php endif ?>
<div class="dropdown">
<a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-user fa-fw"></i><i class="fa fa-caret-down"></i></a>