PageRenderTime 47ms CodeModel.GetById 23ms RepoModel.GetById 1ms app.codeStats 0ms

/skeleton/bbpress/form-topic-split.php

https://github.com/gellybeans/skeleton_wp
PHP | 108 lines | 68 code | 34 blank | 6 comment | 5 complexity | be3b1afbecad392917f74309c0a33fa4 MD5 | raw file
Possible License(s): AGPL-1.0
  1. <?php
  2. /**
  3. * Split Topic
  4. *
  5. * @package bbPress
  6. * @subpackage Theme
  7. */
  8. ?>
  9. <?php bbp_breadcrumb(); ?>
  10. <?php if ( is_user_logged_in() && current_user_can( 'edit_topic', bbp_get_topic_id() ) ) : ?>
  11. <div id="split-topic-<?php bbp_topic_id(); ?>" class="bbp-topic-split">
  12. <form id="split_topic" name="split_topic" method="post" action="">
  13. <fieldset class="bbp-form">
  14. <legend><?php printf( __( 'Split topic "%s"', 'bbpress' ), bbp_get_topic_title() ); ?></legend>
  15. <div>
  16. <div class="bbp-template-notice info">
  17. <p><?php _e( 'When you split a topic, you are slicing it in half starting with the reply you just selected. Choose to use that reply as a new topic with a new title, or merge those replies into an existing topic.', 'bbpress' ); ?></p>
  18. </div>
  19. <div class="bbp-template-notice">
  20. <p><?php _e( 'If you use the existing topic option, replies within both topics will be merged chronologically. The order of the merged replies is based on the time and date they were posted.', 'bbpress' ); ?></p>
  21. </div>
  22. <fieldset class="bbp-form">
  23. <legend><?php _e( 'Split Method', 'bbpress' ); ?></legend>
  24. <div>
  25. <input name="bbp_topic_split_option" id="bbp_topic_split_option_reply" type="radio" checked="checked" value="reply" tabindex="<?php bbp_tab_index(); ?>" />
  26. <label for="bbp_topic_split_option_reply"><?php printf( __( 'New topic in <strong>%s</strong> titled:', 'bbpress' ), bbp_get_forum_title( bbp_get_topic_forum_id( bbp_get_topic_id() ) ) ); ?></label>
  27. <input type="text" id="bbp_topic_split_destination_title" value="<?php printf( __( 'Split: %s', 'bbpress' ), bbp_get_topic_title() ); ?>" tabindex="<?php bbp_tab_index(); ?>" size="35" name="bbp_topic_split_destination_title" />
  28. </div>
  29. <?php if ( bbp_has_topics( array( 'show_stickies' => false, 'post_parent' => bbp_get_topic_forum_id( bbp_get_topic_id() ), 'post__not_in' => array( bbp_get_topic_id() ) ) ) ) : ?>
  30. <div>
  31. <input name="bbp_topic_split_option" id="bbp_topic_split_option_existing" type="radio" value="existing" tabindex="<?php bbp_tab_index(); ?>" />
  32. <label for="bbp_topic_split_option_existing"><?php _e( 'Use an existing topic in this forum:', 'bbpress' ); ?></label>
  33. <?php
  34. bbp_dropdown( array(
  35. 'post_type' => bbp_get_topic_post_type(),
  36. 'post_parent' => bbp_get_topic_forum_id( bbp_get_topic_id() ),
  37. 'selected' => -1,
  38. 'exclude' => bbp_get_topic_id(),
  39. 'select_id' => 'bbp_destination_topic',
  40. 'none_found' => __( 'No other topics found!', 'bbpress' )
  41. ) );
  42. ?>
  43. </div>
  44. <?php endif; ?>
  45. </fieldset>
  46. <fieldset class="bbp-form">
  47. <legend><?php _e( 'Topic Extras', 'bbpress' ); ?></legend>
  48. <div>
  49. <?php if ( bbp_is_subscriptions_active() ) : ?>
  50. <input name="bbp_topic_subscribers" id="bbp_topic_subscribers" type="checkbox" value="1" checked="checked" tabindex="<?php bbp_tab_index(); ?>" />
  51. <label for="bbp_topic_subscribers"><?php _e( 'Copy subscribers to the new topic', 'bbpress' ); ?></label><br />
  52. <?php endif; ?>
  53. <input name="bbp_topic_favoriters" id="bbp_topic_favoriters" type="checkbox" value="1" checked="checked" tabindex="<?php bbp_tab_index(); ?>" />
  54. <label for="bbp_topic_favoriters"><?php _e( 'Copy favoriters to the new topic', 'bbpress' ); ?></label><br />
  55. <input name="bbp_topic_tags" id="bbp_topic_tags" type="checkbox" value="1" checked="checked" tabindex="<?php bbp_tab_index(); ?>" />
  56. <label for="bbp_topic_tags"><?php _e( 'Copy topic tags to the new topic', 'bbpress' ); ?></label><br />
  57. </div>
  58. </fieldset>
  59. <div class="bbp-template-notice error">
  60. <p><?php _e( '<strong>WARNING:</strong> This process cannot be undone.', 'bbpress' ); ?></p>
  61. </div>
  62. <div class="bbp-submit-wrapper">
  63. <button type="submit" tabindex="<?php bbp_tab_index(); ?>" id="bbp_merge_topic_submit" name="bbp_merge_topic_submit" class="button submit"><?php _e( 'Submit', 'bbpress' ); ?></button>
  64. </div>
  65. </div>
  66. <?php bbp_split_topic_form_fields(); ?>
  67. </fieldset>
  68. </form>
  69. </div>
  70. <?php else : ?>
  71. <div id="no-topic-<?php bbp_topic_id(); ?>" class="bbp-no-topic">
  72. <div class="entry-content"><?php is_user_logged_in() ? _e( 'You do not have the permissions to edit this topic!', 'bbpress' ) : _e( 'You cannot edit this topic.', 'bbpress' ); ?></div>
  73. </div>
  74. <?php endif; ?>