admin.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. script('updatenotification', 'admin');
  3. /** @var array $_ */
  4. /** @var bool $isNewVersionAvailable */
  5. $isNewVersionAvailable = $_['isNewVersionAvailable'];
  6. /** @var string $newVersionString */
  7. $newVersionString = $_['newVersionString'];
  8. /** @var string $lastCheckedDate */
  9. $lastCheckedDate = $_['lastChecked'];
  10. /** @var array $channels */
  11. $channels = $_['channels'];
  12. /** @var string $currentChannel */
  13. $currentChannel = $_['currentChannel'];
  14. ?>
  15. <form id="oca_updatenotification_section" class="followupsection">
  16. <?php if($isNewVersionAvailable === true) { ?>
  17. <strong><?php p($l->t('A new version is available: %s', [$newVersionString])); ?></strong>
  18. <?php if ($_['updaterEnabled']) { ?>
  19. <input type="button" id="oca_updatenotification_button" value="<?php p($l->t('Open updater')) ?>">
  20. <?php } ?>
  21. <?php if (!empty($_['downloadLink'])) { ?>
  22. <a href="<?php p($_['downloadLink']); ?>" class="button<?php if ($_['updaterEnabled']) { p(' hidden'); } ?>"><?php p($l->t('Download now')) ?></a>
  23. <?php } ?>
  24. <?php } else { ?>
  25. <strong><?php print_unescaped($l->t('Your version is up to date.')); ?></strong>
  26. <span class="icon-info svg" title="<?php p($l->t('Checked on %s', [$lastCheckedDate])) ?>"></span>
  27. <?php } ?>
  28. <p>
  29. <label for="release-channel"><?php p($l->t('Update channel:')) ?></label>
  30. <select id="release-channel">
  31. <option value="<?php p($currentChannel); ?>"><?php p($currentChannel); ?></option>
  32. <?php foreach ($channels as $channel => $channelTitle){ ?>
  33. <option value="<?php p($channelTitle) ?>">
  34. <?php p($channelTitle) ?>
  35. </option>
  36. <?php } ?>
  37. </select>
  38. <span id="channel_save_msg" class="msg"></span>
  39. </p>
  40. <p>
  41. <em><?php p($l->t('You can always update to a newer version / experimental channel. But you can never downgrade to a more stable channel.')); ?></em>
  42. </p>
  43. <p id="oca_updatenotification_groups">
  44. <br />
  45. <?php p($l->t('Notify members of the following groups about available updates:')); ?>
  46. <input name="oca_updatenotification_groups_list" type="hidden" id="oca_updatenotification_groups_list" value="<?php p($_['notify_groups']) ?>" style="width: 400px">
  47. <em class="<?php if (!in_array($currentChannel, ['daily', 'git'])) p('hidden'); ?>">
  48. <br />
  49. <?php p($l->t('Only notification for app updates are available.')); ?>
  50. <?php if ($currentChannel === 'daily') p($l->t('The selected update channel makes dedicated notifications for the server obsolete.')); ?>
  51. <?php if ($currentChannel === 'git') p($l->t('The selected update channel does not support updates of the server.')); ?>
  52. </em>
  53. </p>
  54. </form>