integration.phtml 4.8 KB

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