summaryrefslogtreecommitdiff
path: root/app/Template/header/creation_dropdown.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Template/header/creation_dropdown.php')
-rw-r--r--app/Template/header/creation_dropdown.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/app/Template/header/creation_dropdown.php b/app/Template/header/creation_dropdown.php
new file mode 100644
index 00000000..d3b9e7cb
--- /dev/null
+++ b/app/Template/header/creation_dropdown.php
@@ -0,0 +1,22 @@
+<?php $has_project_creation_access = $this->user->hasAccess('ProjectCreationController', '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 ($has_project_creation_access): ?>
+ <li><i class="fa fa-plus fa-fw"></i>
+ <?= $this->url->link(t('New project'), 'ProjectCreationController', 'create', array(), false, 'popover') ?>
+ </li>
+ <?php endif ?>
+ <?php if ($is_private_project_enabled): ?>
+ <li>
+ <i class="fa fa-lock fa-fw"></i>
+ <?= $this->url->link(t('New private project'), 'ProjectCreationController', 'createPrivate', array(), false, 'popover') ?>
+ </li>
+ <?php endif ?>
+ <?= $this->hook->render('template:header:creation-dropdown') ?>
+ </ul>
+ </div>
+<?php endif ?>