settings-admin.php 7.7 KB

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