sharing.phtml 4.4 KB

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