integration.phtml 4.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. /** @var FreshRSS_View $this */
  3. $this->partial('aside_configure');
  4. ?>
  5. <main class="post">
  6. <div class="link-back-wrapper">
  7. <a class="link-back" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
  8. </div>
  9. <h1><?= _t('conf.sharing') ?></h1>
  10. <form method="post" action="<?= _url('configure', 'integration') ?>"
  11. data-simple='<div class="form-group" id="group-share-##key##"><label class="group-name">##label##</label><div class="group-controls"><div class="stick">
  12. <input type="text" id="share_##key##_name" name="share[##key##][name]" class="extend" value="##label##" placeholder="<?= _t('conf.sharing.share_name') ?>" size="64" />
  13. <input type="url" id="share_##key##_url" name="share[##key##][url]" class="extend" value="" placeholder="<?= _t('gen.short.not_applicable') ?>" size="64" disabled="disabled" />
  14. <a href="#" class="remove btn btn-attention"><?= _i('close') ?></a></div>
  15. <input type="hidden" id="share_##key##_type" name="share[##key##][type]" value="##type##" /></div></div>'
  16. data-advanced='<div class="form-group" id="group-share-##key##"><label class="group-name">##label##</label><div class="group-controls">
  17. <input type="hidden" id="share_##key##_type" name="share[##key##][type]" value="##type##" />
  18. <input type="hidden" id="share_##key##_method" name="share[##key##][method]" value="##method##" />
  19. <input type="hidden" id="share_##key##_field" name="share[##key##][field]" value="##field##" />
  20. <div class="stick">
  21. <input type="text" id="share_##key##_name" name="share[##key##][name]" class="extend" value="" placeholder="<?= _t('conf.sharing.share_name') ?>" size="64" />
  22. <input type="url" id="share_##key##_url" name="share[##key##][url]" class="extend" value="" placeholder="<?= _t('conf.sharing.share_url') ?>" size="64" />
  23. <a href="#" class="remove btn btn-attention" title="<?= _t('conf.sharing.remove') ?>"><?= _i('close') ?></a></div>
  24. <a target="_blank" rel="noreferrer" class="btn" title="<?= _t('conf.sharing.more_information') ?>" href="##help##"><?= _i('help') ?></a>
  25. </div></div>' class="draggableList">
  26. <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
  27. <?php
  28. foreach (FreshRSS_Context::$user_conf->sharing as $key => $share_options) {
  29. $share = FreshRSS_Share::get($share_options['type']);
  30. $share->update($share_options);
  31. ?>
  32. <div class="form-group group-share" id="group-share-<?= $key ?>" draggable="true">
  33. <label class="group-name">
  34. <?= $share->name(true) ?>
  35. </label>
  36. <div class="group-controls">
  37. <input type='hidden' id='share_<?= $key ?>_type' name="share[<?= $key ?>][type]" value='<?= $share->type() ?>' />
  38. <input type='hidden' id='share_<?= $key ?>_method' name="share[<?= $key ?>][method]" value='<?= $share->method() ?>' />
  39. <input type='hidden' id='share_<?= $key ?>_field' name="share[<?= $key ?>][field]" value='<?= $share->field() ?>' />
  40. <div class="stick">
  41. <input type="text" id="share_<?= $key ?>_name" name="share[<?= $key ?>][name]" class="extend" value="<?= $share->name() ?>"
  42. placeholder="<?= _t('conf.sharing.share_name') ?>" size="64" data-leave-validation="<?= $share->name() ?>"/>
  43. <?php if ($share->formType() === 'advanced') { ?>
  44. <input type="url" id="share_<?= $key ?>_url" name="share[<?= $key ?>][url]" class="extend" value="<?= $share->baseUrl() ?>"
  45. placeholder="<?= _t('conf.sharing.share_url') ?>" size="64" data-leave-validation="<?= $share->baseUrl() ?>"/>
  46. <?php } else { ?>
  47. <input type="url" id="share_<?= $key ?>_url" name="share[<?= $key ?>][url]" class="extend" value="<?= $share->baseUrl() ?>"
  48. placeholder="<?= _t('gen.short.not_applicable') ?>" size="64" disabled="disabled" />
  49. <?php } ?>
  50. <a href='#' class='remove btn btn-attention' title="<?= _t('conf.sharing.remove') ?>"><?= _i('close') ?></a>
  51. </div>
  52. <?php if ($share->formType() === 'advanced') { ?>
  53. <a target="_blank" rel="noreferrer" class="btn" title="<?= _t('conf.sharing.more_information') ?>" href="<?= $share->help() ?>"><?= _i('help') ?></a>
  54. <?php } ?>
  55. </div>
  56. </div>
  57. <?php } ?>
  58. <div class="form-group">
  59. <div class="group-controls">
  60. <select>
  61. <?php foreach (FreshRSS_Share::enum() as $share) { ?>
  62. <option value='<?= $share->type() ?>' data-form='<?= $share->formType() ?>' data-help='<?= $share->help() ?>'
  63. data-method='<?= $share->method() ?>' data-field='<?= $share->field() ?>'>
  64. <?= $share->name(true) ?>
  65. </option>
  66. <?php } ?>
  67. </select>
  68. <a href='#' class='share add btn' title="<?= _t('conf.sharing.add') ?>"><?= _i('add') ?></a>
  69. </div>
  70. </div>
  71. <div class="form-group form-actions">
  72. <div class="group-controls">
  73. <button type="submit" class="btn btn-important"><?= _t('gen.action.submit') ?></button>
  74. </div>
  75. </div>
  76. </form>
  77. </main>