3
1

header.php 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php
  2. $_title = $this->render("header/title", [
  3. "project" => isset($project) ? $project : null,
  4. "task" => isset($task) ? $task : null,
  5. "description" => isset($description) ? $description : null,
  6. "title" => $title,
  7. ]);
  8. $_top_right_corner = implode("&nbsp;", [
  9. $this->render("header/user_notifications"),
  10. $this->render("header/creation_dropdown"),
  11. $this->render("header/user_dropdown")
  12. ]);
  13. $branding = null;
  14. if (isset($project) && isset($project["id"])) {
  15. $branding = $this->projectBrandingHelper->getBrandingByProjectId($project["id"]);
  16. }
  17. ?>
  18. <?php if (isset($branding["enabled"]) && $branding["enabled"] == 1 && !empty($branding["logo_url"])): ?>
  19. <style>
  20. h1 {
  21. color:<?= $branding['accent_color'] ?>;
  22. }
  23. span.logo a{
  24. vertical-align: middle;
  25. margin-right:5px;
  26. opacity:1;
  27. }
  28. </style>
  29. <?php endif ?>
  30. <header>
  31. <div class="title-container">
  32. <h1>
  33. <span class="logo">
  34. <?php if (isset($branding["enabled"]) && $branding["enabled"] == 1 && !empty($branding["logo_url"])): ?>
  35. <a href="<?= $this->url->to('DashboardController', 'show') ?>">
  36. <img src="<?= $branding['logo_url'] ?>" alt="<?= t('Logo') ?>" height="32">
  37. </a>
  38. <?php else: ?>
  39. <?= $this->url->link('K<span>B</span>', 'DashboardController', 'show', array(), false, '', t('Dashboard')) ?>
  40. <?php endif ?>
  41. </span>
  42. <span class="title">
  43. <?php if (! empty($project) && ! empty($task)): ?>
  44. <?= $this->url->link($this->text->e($project['name']), 'BoardViewController', 'show', array('project_id' => $project['id'])) ?>
  45. <?php else: ?>
  46. <?= $this->text->e($title) ?>
  47. <?php if (! empty($project) && $project['task_limit'] && array_key_exists('nb_active_tasks', $project)): ?>
  48. (<span><?= intval($project['nb_active_tasks']) ?></span> / <span title="<?= t('Task limit') ?>"><span class="ui-helper-hidden-accessible"><?= t('Task limit') ?> </span><?= $this->text->e($project['task_limit']) ?></span>)
  49. <?php endif ?>
  50. <?php endif ?>
  51. </span>
  52. <?php if (! empty($description)): ?>
  53. <?= $this->app->tooltipHTML($description) ?>
  54. <?php endif ?>
  55. </h1>
  56. </div>
  57. <div class="board-selector-container">
  58. <?php if (! empty($board_selector)): ?>
  59. <?= $this->render("header/board_selector", ["board_selector" => $board_selector]) ?>
  60. <?php endif ?>
  61. </div>
  62. <div class="menus-container">
  63. <?= $_top_right_corner ?>
  64. </div>
  65. </header>