3
1

header.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. header{
  21. background-color:<?= $branding['background_color'] ?>;
  22. }
  23. .project-header{
  24. background-color:<?= $branding['second_background_color'] ?>;
  25. }
  26. h1 {
  27. color:<?= $branding['foreground_color'] ?>;
  28. background-color:<?= $branding['background_color'] ?>;
  29. }
  30. span.logo a{
  31. vertical-align: middle;
  32. margin-right:5px;
  33. opacity:1;
  34. }
  35. </style>
  36. <?php endif ?>
  37. <header>
  38. <div class="title-container">
  39. <h1>
  40. <span class="logo">
  41. <?php if (isset($branding["enabled"]) && $branding["enabled"] == 1 && !empty($branding["logo_url"])): ?>
  42. <a href="<?= $this->url->to('DashboardController', 'show') ?>">
  43. <img src="<?= $branding['logo_url'] ?>" alt="<?= t('Logo') ?>" height="32">
  44. </a>
  45. <?php else: ?>
  46. <?= $this->url->link('K<span>B</span>', 'DashboardController', 'show', array(), false, '', t('Dashboard')) ?>
  47. <?php endif ?>
  48. </span>
  49. <span class="title">
  50. <?php if (! empty($project) && ! empty($task)): ?>
  51. <?= $this->url->link($this->text->e($project['name']), 'BoardViewController', 'show', array('project_id' => $project['id'])) ?>
  52. <?php else: ?>
  53. <?= $this->text->e($title) ?>
  54. <?php if (! empty($project) && $project['task_limit'] && array_key_exists('nb_active_tasks', $project)): ?>
  55. (<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>)
  56. <?php endif ?>
  57. <?php endif ?>
  58. </span>
  59. <?php if (! empty($description)): ?>
  60. <?= $this->app->tooltipHTML($description) ?>
  61. <?php endif ?>
  62. </h1>
  63. </div>
  64. <div class="board-selector-container">
  65. <?php if (! empty($board_selector)): ?>
  66. <?= $this->render("header/board_selector", ["board_selector" => $board_selector]) ?>
  67. <?php endif ?>
  68. </div>
  69. <div class="menus-container">
  70. <?= $_top_right_corner ?>
  71. </div>
  72. </header>