configure.phtml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. declare(strict_types=1);
  3. /** @var FreshRSS_View $this */
  4. if (!Minz_Request::paramBoolean('ajax')) {
  5. $this->partial('aside_configure');
  6. }
  7. if ($this->extension === null) {
  8. throw new FreshRSS_Context_Exception('Extension not initialised!');
  9. }
  10. ?>
  11. <div class="post">
  12. <h2>
  13. <?= $this->extension->getName() ?> (<?= $this->extension->getVersion() ?>) —
  14. <?= $this->extension->isEnabled() ? _t('admin.extensions.enabled') : _t('admin.extensions.disabled') ?>
  15. </h2>
  16. <p class="alert alert-warn"><?= $this->extension->getDescription() ?> — <?= _t('gen.short.by_author'), ' ', $this->extension->getAuthor() ?></p>
  17. <?php if (FreshRSS_Auth::hasAccess('admin')) { ?>
  18. <form id="form-extension" method="post">
  19. <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
  20. <div class="form-group form-actions">
  21. <div class="group-controls">
  22. <button class="btn btn-attention confirm" form="form-extension" formaction="<?= _url('extension', 'remove', 'e', urlencode($this->extension->getName())) ?>"><?= _t('gen.action.remove') ?></button>
  23. </div>
  24. </div>
  25. </form>
  26. <?php } ?>
  27. <h2><?= _t('gen.action.manage') ?></h2>
  28. <?php
  29. $configure_view = $this->extension->getConfigureView();
  30. if ($configure_view !== false) {
  31. echo $configure_view;
  32. } else {
  33. ?>
  34. <p class="alert alert-warn"><?= _t('admin.extensions.no_configure_view') ?></p>
  35. <?php } ?>
  36. </div>