edit.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php declare(strict_types=1); ?>
  2. <form method="post">
  3. <label for="domain"><?= _('Zone to be changed') ?></label>
  4. <br>
  5. <select required="" name="domain" id="domain">
  6. <option value="" disabled="" selected="">-</option>
  7. <?php
  8. foreach (nsListUserZones() as $domain)
  9. echo ' <option value="' . $domain . '">' . $domain . '</option>' . LF;
  10. ?>
  11. </select>
  12. <br>
  13. <input type="submit" value="<?= _('Display') ?>">
  14. </form>
  15. <?php
  16. if (isset($data['records'])) { // Display zone
  17. ?>
  18. <form method="post">
  19. <input type="hidden" name="domain" value="<?= $_POST['domain'] ?>">
  20. <label for="zone-content"><?= sprintf(_('Authoritative records for %s'), '<code><strong>' . $_POST['domain'] . '</strong></code>') ?></label>
  21. <br>
  22. <textarea id="records" name="records" wrap="off" rows="<?= substr_count($data['records'], LF) + 1 ?>"><?= htmlspecialchars($data['records']) ?></textarea>
  23. <br>
  24. <input type="submit" value="<?= _('Replace') ?>">
  25. </form>
  26. <?php
  27. }
  28. displayFinalMessage($data);
  29. ?>
  30. <h2><?= _('Default values') ?></h2>
  31. <p><?= sprintf(_('If the TTL is omitted, it will default to %s seconds.'), '<code><time datetime="PT' . NS_DEFAULT_TTL . 'S">' . NS_DEFAULT_TTL . '</time></code>') ?></p>
  32. <p><?= _('Precising the class (<code>IN</code>) is optional.') ?></p>
  33. <h2><?= _('Allowed values') ?></h2>
  34. <p><?= sprintf(_('Submitted field content is limited to %s characters.'), NS_TEXTAREA_MAX_CHARACTERS) ?></p>
  35. <p><?= sprintf(_('TTLs must last between %1$s and %2$s seconds.'), '<code><time datetime="PT' . NS_MIN_TTL . 'S">' . NS_MIN_TTL . '</time></code>', '<code><time datetime="PT' . NS_MAX_TTL . 'S">' . NS_MAX_TTL . '</time></code>') ?></p>
  36. <p><?= _('The only types that can be defined here are:') ?></p>
  37. <ul>
  38. <?php
  39. foreach (NS_ALLOWED_TYPES as $allowed_type)
  40. echo ' <li><code>' . $allowed_type . '</code></li>';
  41. ?>
  42. </ul>