settings-admin.php 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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 } else { ?>
  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="text" placeholder="<?php p($l->t('Web address 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" class="jscolor" data-jscolor="{hash:true}" 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']) ?>">
  70. <input type="hidden" id="current-logoMime" name="current-logoMime" value="<?php p($_['logoMime']); ?>" />
  71. <label for="uploadlogo"><span><?php p($l->t('Logo')) ?></span></label>
  72. <input id="uploadlogo" class="upload-logo-field" name="uploadlogo" type="file" />
  73. <label for="uploadlogo" class="button icon-upload svg" id="uploadlogo" title="<?php p($l->t('Upload new logo')) ?>"></label>
  74. <div data-setting="logoMime" data-toggle="tooltip" data-original-title="<?php p($l->t('Reset to default')); ?>" class="theme-undo icon icon-history"></div>
  75. </form>
  76. </div>
  77. <div>
  78. <form class="uploadButton" method="post" action="<?php p($_['uploadLogoRoute']) ?>">
  79. <input type="hidden" id="current-backgroundMime" name="current-backgroundMime" value="<?php p($_['backgroundMime']); ?>" />
  80. <label for="upload-login-background"><span><?php p($l->t('Login image')) ?></span></label>
  81. <input id="upload-login-background" class="upload-logo-field" name="upload-login-background" type="file">
  82. <label for="upload-login-background" class="button icon-upload svg" id="upload-login-background" title="<?php p($l->t("Upload new login background")) ?>"></label>
  83. <div data-setting="backgroundMime" data-toggle="tooltip" data-original-title="<?php p($l->t('Reset to default')); ?>" class="theme-undo icon icon-history"></div>
  84. <div class="theme-remove-bg icon icon-delete" data-toggle="tooltip" data-original-title="<?php p($l->t('Remove background image')); ?>"></div>
  85. </form>
  86. </div>
  87. <div id="theming-preview">
  88. <img src="<?php p($_['logo']); ?>" id="theming-preview-logo" />
  89. </div>
  90. <div>
  91. <label>
  92. <span><?php p($l->t('Legal notice link')) ?></span>
  93. <input id="theming-imprintUrl" type="text" placeholder="<?php p($l->t('https://…')); ?>" value="<?php p($_['imprintUrl']) ?>" maxlength="500" />
  94. <div data-setting="imprintUrl" data-toggle="tooltip" data-original-title="<?php p($l->t('Reset to default')); ?>" class="theme-undo icon icon-history"></div>
  95. </label>
  96. </div>
  97. <div>
  98. <label>
  99. <span><?php p($l->t('Privacy policy link')) ?></span>
  100. <input id="theming-privacyUrl" type="text" placeholder="<?php p($l->t('https://…')); ?>" value="<?php p($_['privacyUrl']) ?>" maxlength="500" />
  101. <div data-setting="privacyUrl" data-toggle="tooltip" data-original-title="<?php p($l->t('Reset to default')); ?>" class="theme-undo icon icon-history"></div>
  102. </label>
  103. </div>
  104. <div class="theming-hints">
  105. <?php if (!$_['canThemeIcons']) { ?>
  106. <p class="info">
  107. <a href="<?php p($_['iconDocs']); ?>">
  108. <em>
  109. <?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.')); ?> ↗
  110. </em>
  111. </a>
  112. </p>
  113. <?php } ?>
  114. </div>
  115. <?php } ?>
  116. </div>