You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

settings-admin.php 7.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <?php
  2. /**
  3. *
  4. *
  5. * @author Bjoern Schiessle <bjoern@schiessle.org>
  6. * @author Jan-Christoph Borchardt <hey@jancborchardt.net>
  7. * @author Lukas Reschke <lukas@statuscode.ch>
  8. *
  9. * @license GNU AGPL version 3 or any later version
  10. *
  11. * This program is free software: you can redistribute it and/or modify
  12. * it under the terms of the GNU Affero General Public License as
  13. * published by the Free Software Foundation, either version 3 of the
  14. * License, or (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU Affero General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU Affero General Public License
  22. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  23. *
  24. */
  25. script('theming', 'settings-admin');
  26. script('theming', '3rdparty/jscolor/jscolor');
  27. style('theming', 'settings-admin');
  28. ?>
  29. <div id="theming" class="section">
  30. <h2 class="inlineblock"><?php p($l->t('Theming')); ?></h2>
  31. <a target="_blank" rel="noreferrer" class="icon-info" title="<?php p($l->t('Open documentation'));?>" href="<?php p(link_to_docs('admin-theming')); ?>"></a>
  32. <p class="settings-hint"><?php p($l->t('Theming makes it possible to easily customize the look and feel of your instance and supported clients. This will be visible for all users.')); ?></p>
  33. <div id="theming_settings_status">
  34. <div id="theming_settings_loading" class="icon-loading-small" style="display: none;"></div>
  35. <span id="theming_settings_msg" class="msg success" style="display: none;">Saved</span>
  36. </div>
  37. <?php if ($_['themable'] === false) { ?>
  38. <p>
  39. <?php p($_['errorMessage']) ?>
  40. </p>
  41. <?php } ?>
  42. <div>
  43. <label>
  44. <span><?php p($l->t('Name')) ?></span>
  45. <input id="theming-name" type="text" placeholder="<?php p($l->t('Name')); ?>" value="<?php p($_['name']) ?>" maxlength="250" />
  46. <div data-setting="name" data-toggle="tooltip" data-original-title="<?php p($l->t('Reset to default')); ?>" class="theme-undo icon icon-history"></div>
  47. </label>
  48. </div>
  49. <div>
  50. <label>
  51. <span><?php p($l->t('Web link')) ?></span>
  52. <input id="theming-url" type="url" placeholder="<?php p($l->t('https://…')); ?>" value="<?php p($_['url']) ?>" maxlength="500" />
  53. <div data-setting="url" data-toggle="tooltip" data-original-title="<?php p($l->t('Reset to default')); ?>" class="theme-undo icon icon-history"></div>
  54. </label>
  55. </div>
  56. <div>
  57. <label>
  58. <span><?php p($l->t('Slogan')) ?></span>
  59. <input id="theming-slogan" type="text" placeholder="<?php p($l->t('Slogan')); ?>" value="<?php p($_['slogan']) ?>" maxlength="500" />
  60. <div data-setting="slogan" data-toggle="tooltip" data-original-title="<?php p($l->t('Reset to default')); ?>" class="theme-undo icon icon-history"></div>
  61. </label>
  62. </div>
  63. <div>
  64. <label>
  65. <span><?php p($l->t('Color')) ?></span>
  66. <input id="theming-color" type="text" maxlength="7" value="<?php p($_['color']) ?>" />
  67. <div data-setting="color" data-toggle="tooltip" data-original-title="<?php p($l->t('Reset to default')); ?>" class="theme-undo icon icon-history"></div>
  68. </label>
  69. </div>
  70. <div>
  71. <form class="uploadButton" method="post" action="<?php p($_['uploadLogoRoute']) ?>" data-image-key="logo">
  72. <input type="hidden" id="theming-logoMime" value="<?php p($_['images']['logo']['mime']); ?>" />
  73. <input type="hidden" name="key" value="logo" />
  74. <label for="uploadlogo"><span><?php p($l->t('Logo')) ?></span></label>
  75. <input id="uploadlogo" class="fileupload" name="image" type="file" />
  76. <label for="uploadlogo" class="button icon-upload svg" id="uploadlogo" title="<?php p($l->t('Upload new logo')) ?>"></label>
  77. <div data-setting="logoMime" data-toggle="tooltip" data-original-title="<?php p($l->t('Reset to default')); ?>" class="theme-undo icon icon-history"></div>
  78. </form>
  79. </div>
  80. <div>
  81. <form class="uploadButton" method="post" action="<?php p($_['uploadLogoRoute']) ?>" data-image-key="background">
  82. <input type="hidden" id="theming-backgroundMime" value="<?php p($_['images']['background']['mime']); ?>" />
  83. <input type="hidden" name="key" value="background" />
  84. <label for="upload-login-background"><span><?php p($l->t('Login image')) ?></span></label>
  85. <input id="upload-login-background" class="fileupload" name="image" type="file">
  86. <label for="upload-login-background" class="button icon-upload svg" id="upload-login-background" title="<?php p($l->t("Upload new login background")) ?>"></label>
  87. <div data-setting="backgroundMime" data-toggle="tooltip" data-original-title="<?php p($l->t('Reset to default')); ?>" class="theme-undo icon icon-history"></div>
  88. <div class="theme-remove-bg icon icon-delete" data-toggle="tooltip" data-original-title="<?php p($l->t('Remove background image')); ?>"></div>
  89. </form>
  90. </div>
  91. <div id="theming-preview">
  92. <div id="theming-preview-logo"></div>
  93. </div>
  94. <h3 class="inlineblock"><?php p($l->t('Advanced options')); ?></h3>
  95. <div class="advanced-options">
  96. <div>
  97. <label>
  98. <span><?php p($l->t('Legal notice link')) ?></span>
  99. <input id="theming-imprintUrl" type="url" placeholder="<?php p($l->t('https://…')); ?>" value="<?php p($_['imprintUrl']) ?>" maxlength="500" />
  100. <div data-setting="imprintUrl" data-toggle="tooltip" data-original-title="<?php p($l->t('Reset to default')); ?>" class="theme-undo icon icon-history"></div>
  101. </label>
  102. </div>
  103. <div>
  104. <label>
  105. <span><?php p($l->t('Privacy policy link')) ?></span>
  106. <input id="theming-privacyUrl" type="url" placeholder="<?php p($l->t('https://…')); ?>" value="<?php p($_['privacyUrl']) ?>" maxlength="500" />
  107. <div data-setting="privacyUrl" data-toggle="tooltip" data-original-title="<?php p($l->t('Reset to default')); ?>" class="theme-undo icon icon-history"></div>
  108. </label>
  109. </div>
  110. <div class="advanced-option-logoheader">
  111. <form class="uploadButton" method="post" action="<?php p($_['uploadLogoRoute']) ?>" data-image-key="logoheader">
  112. <input type="hidden" id="theming-logoheaderMime" value="<?php p($_['images']['logoheader']['mime']); ?>" />
  113. <input type="hidden" name="key" value="logoheader" />
  114. <label for="upload-login-logoheader"><span><?php p($l->t('Header logo')) ?></span></label>
  115. <input id="upload-login-logoheader" class="fileupload" name="image" type="file">
  116. <label for="upload-login-logoheader" class="button icon-upload svg" id="upload-login-logoheader" title="<?php p($l->t("Upload new header logo")) ?>"></label>
  117. <div class="image-preview"></div>
  118. <div data-setting="logoheaderMime" data-toggle="tooltip" data-original-title="<?php p($l->t('Reset to default')); ?>" class="theme-undo icon icon-history"></div>
  119. </form>
  120. </div>
  121. <div class="advanced-option-favicon">
  122. <form class="uploadButton" method="post" action="<?php p($_['uploadLogoRoute']) ?>" data-image-key="favicon">
  123. <input type="hidden" id="theming-faviconMime" value="<?php p($_['images']['favicon']['mime']); ?>" />
  124. <input type="hidden" name="key" value="favicon" />
  125. <label for="upload-login-favicon"><span><?php p($l->t('Favicon')) ?></span></label>
  126. <input id="upload-login-favicon" class="fileupload" name="image" type="file">
  127. <label for="upload-login-favicon" class="button icon-upload svg" id="upload-login-favicon" title="<?php p($l->t("Upload new favicon")) ?>"></label>
  128. <div class="image-preview"></div>
  129. <div data-setting="faviconMime" data-toggle="tooltip" data-original-title="<?php p($l->t('Reset to default')); ?>" class="theme-undo icon icon-history"></div>
  130. </form>
  131. </div>
  132. </div>
  133. <div class="theming-hints">
  134. <?php if (!$_['canThemeIcons']) { ?>
  135. <p class="info">
  136. <a href="<?php p($_['iconDocs']); ?> target="_blank" rel="noreferrer noopener">
  137. <em>
  138. <?php p($l->t('Install the Imagemagick PHP extension with support for SVG images to automatically generate favicons based on the uploaded logo and color.')); ?> ↗
  139. </em>
  140. </a>
  141. </p>
  142. <?php } ?>
  143. </div>
  144. </div>