header.php 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <?php
  2. ini_set('display_errors', 1);
  3. error_reporting(E_ALL);
  4. include("language.php");
  5. ?>
  6. <!DOCTYPE HTML>
  7. <html lang="en">
  8. <head>
  9. <meta charset="utf-8">
  10. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  11. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  12. <title>Halcyon</title>
  13. <link rel="shortcut icon" href="/assets/images/favicon.ico">
  14. <link rel="gettext" type="text/x-gettext-translation" href="/locale/<?=$locale?>/LC_MESSAGES/messages.po">
  15. <link rel="stylesheet" href="/assets/css/style.css" media="all">
  16. <?php
  17. if(array_key_exists('darktheme',$_COOKIE)) {
  18. if($_COOKIE['darktheme'] == "true") echo '<link rel="stylesheet" href="/assets/css/dark.css" media="all">';
  19. else if($_COOKIE['darktheme'] == "unset") {
  20. ?>
  21. <script>
  22. if(window.matchMedia("prefers-color-scheme:dark").matches)
  23. document.write('<link rel="stylesheet" href="/assets/css/dark.css" media="all">');
  24. </script>
  25. <?php }} ?>
  26. <link rel="stylesheet" href="/assets/css/fontawesome.min.css" media="all">
  27. <link rel="stylesheet" href="/assets/css/emojipicker.css" media="all">
  28. <script src="/assets/js/jquery/jquery.min.js"></script>
  29. <script src="/assets/js/halcyon/halcyonFunctions.js"></script>
  30. <script src="/assets/js/mastodon.js/mastodon.js"></script><!-- thx @kirschn -->
  31. <script src="/assets/js/jquery-cookie/src/jquery.cookie.js"></script>
  32. <script src="/assets/js/autosize/autosize.js"></script>
  33. <script src="/assets/js/autocomplete/textarea.js"></script>
  34. <script src="/assets/js/shortcut.js"></script>
  35. <script src="/assets/js/replace_emoji.js"></script>
  36. <script src="/assets/js/emojipicker/emojidata.js"></script>
  37. <script src="/assets/js/emojipicker/emojipicker.js"></script>
  38. <script src="/assets/js/halcyon/halcyonTemplates.js"></script>
  39. <script src="/assets/js/halcyon/halcyonUI.js"></script>
  40. <script src="/assets/js/autocomplete/search.js"></script>
  41. <script src="/assets/js/pomo/pomo.js"></script>
  42. <script src="/assets/js/twemoji/twemoji.min.js"></script>
  43. <script src="/assets/js/clipboard.js/clipboard.min.js"></script>
  44. <script src="/assets/js/player/soundmanager.js"></script>
  45. <script src="/assets/js/player/audio.js"></script>
  46. <script>
  47. if(!localStorage.getItem("current_id") | !localStorage.getItem("current_instance") | !localStorage.getItem("current_authtoken")) {
  48. location.href = "/login";
  49. }
  50. else {
  51. Pomo.domain = 'messages';
  52. Pomo.returnStrings = true;
  53. Pomo.unescapeStrings = true;
  54. var pomo_def = Pomo.load(null,{
  55. format:'po',
  56. mode:'link',
  57. translation_domain:'messages'
  58. });
  59. var __ = (function(){
  60. var _ = !!window.Pomo? window.Pomo : (!!window.__Pomo? window.__Pomo: false);
  61. var gettext_wrap = function(word, options){return _.getText(word, options)};
  62. gettext_wrap = !!_? gettext_wrap: false;
  63. if(!gettext_wrap){
  64. throw new "Pomo can't be found";
  65. }
  66. return gettext_wrap;
  67. })();
  68. if($.cookie("session") === "true") {
  69. refreshApp();
  70. }
  71. else if($.cookie("session") === undefined) {
  72. resetApp();
  73. }
  74. }
  75. server_setting_youplay = <?=$config["Media"]["youplay"] ? "true" : "false"?>;
  76. server_setting_vimeo = <?=$config["Media"]["vimeo"] ? "true" : "false"?>;
  77. </script>
  78. </head>
  79. <body>
  80. <header id="header">
  81. <div class="header_nav_wrap">
  82. <nav class="header_left_box">
  83. <ul class="header_nav_list">
  84. <li id="header_nav_item_home" class="header_nav_item">
  85. <a href="/" id="home_nav">
  86. <i class="fa fa-fw fa-home"></i>
  87. <span><?=_('Home')?></span>
  88. </a>
  89. <div class="home_badge nav_badge invisible"></div>
  90. </li>
  91. <li id="header_nav_item_local" class="header_nav_item local_nav">
  92. <a href="/local" id="local_nav">
  93. <i class="fa fa-fw fa-users"></i>
  94. <span><?=_('Local')?></span>
  95. </a>
  96. <div class="local_badge nav_badge invisible"></div>
  97. </li>
  98. <li id="header_nav_item_federated" class="header_nav_item federated_nav">
  99. <a href="/federated" id="federated_nav">
  100. <i class="fa fa-fw fa-globe"></i>
  101. <span><?=_('Federated')?></span>
  102. </a>
  103. <div class="federated_badge nav_badge invisible"></div>
  104. </li>
  105. <li id="header_nav_item_notifications" class="header_nav_item notifications_nav">
  106. <a href="/notifications" id="notifications_nav">
  107. <i class="fa fa-fw fa-bell"></i>
  108. <span><?=_('Notifications')?></span>
  109. </a>
  110. <div class="notification_badge nav_badge invisible"></div>
  111. </li>
  112. <li id="header_nav_item_lists" class="header_nav_item lists_nav">
  113. <a href="/lists" id="lists_nav">
  114. <i class="fa fa-fw fa-list"></i>
  115. <span><?=_('Lists')?></span>
  116. </a>
  117. <div class="lists_badge nav_badge invisible"></div>
  118. </li>
  119. </ul>
  120. </nav>
  121. <nav class="header_right_box">
  122. <ul class="header_nav_list">
  123. <li class="header_nav_item search_form_wrap">
  124. <form class="search_form" action="/search" method="GET">
  125. <input id="search_form" class="search_form_input" placeholder="<?=_('Search Mastodon')?>" type="text" name="q" accesskey="/">
  126. <span class="search_form_submit">
  127. <button type="submit">
  128. <i class="fa fa-fw fa-search"></i>
  129. </button>
  130. </span>
  131. </form>
  132. <nav class="header_search_suggestions invisible"></nav>
  133. </li>
  134. <li class="header_nav_item my_account_wrap">
  135. <button class="header_account_avatar">
  136. <div class="my_account">
  137. <img class="js_current_profile_image">
  138. </div>
  139. </button>
  140. <nav class="header_my_account_nav invisible">
  141. <ul>
  142. <li>
  143. <a class="js_current_profile_link emoji_poss">
  144. <span class="js_current_profile_displayname display_name"></span>
  145. <span><?=_('View profile')?></span>
  146. </a>
  147. </li>
  148. </ul>
  149. <ul>
  150. <li>
  151. <a href="/direct"><?=_('Direct')?></a>
  152. </li>
  153. <li>
  154. <a href="/settings"><?=_('Settings')?></a>
  155. </li>
  156. <li>
  157. <a href="/logout"><?=_('Log out')?></a>
  158. </li>
  159. </ul>
  160. </nav>
  161. </li>
  162. <li class="header_nav_item toot_button_wrap">
  163. <button id="creat_status" class="toot_button" accesskey="n">
  164. <div class="toot_button_label">
  165. <i class="fa fa-fw fa-pencil-square-o"></i>
  166. <span><?=_('Toot')?></span>
  167. </div>
  168. </button>
  169. </li>
  170. </ul>
  171. </nav>
  172. </div>
  173. </header>