PageRenderTime 515ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/bbpress/form-topic-split.php

https://bitbucket.org/mym2webdesign/mym2webdesign-v4
PHP | 116 lines | 72 code | 38 blank | 6 comment | 6 complexity | 4a3f2309e401ae7b6c069a9995c441be MD5 | raw file
  1. <?php
  2. /**
  3. * Split Topic
  4. *
  5. * @package bbPress
  6. * @subpackage Theme
  7. */
  8. ?>
  9. <div id="bbpress-forums">
  10. <?php bbp_breadcrumb(); ?>
  11. <?php if ( is_user_logged_in() && current_user_can( 'edit_topic', bbp_get_topic_id() ) ) : ?>
  12. <div id="split-topic-<?php bbp_topic_id(); ?>" class="bbp-topic-split">
  13. <form id="split_topic" name="split_topic" method="post" action="<?php the_permalink(); ?>">
  14. <fieldset class="bbp-form">
  15. <legend><?php printf( __( 'Split topic "%s"', 'bbpress' ), bbp_get_topic_title() ); ?></legend>
  16. <div>
  17. <div class="bbp-template-notice info">
  18. <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>
  19. </div>
  20. <div class="bbp-template-notice">
  21. <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>
  22. </div>
  23. <fieldset class="bbp-form">
  24. <legend><?php _e( 'Split Method', 'bbpress' ); ?></legend>
  25. <div>
  26. <input name="bbp_topic_split_option" id="bbp_topic_split_option_reply" type="radio" checked="checked" value="reply" tabindex="<?php bbp_tab_index(); ?>" />
  27. <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>
  28. <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" />
  29. </div>
  30. <?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() ) ) ) ) : ?>
  31. <div>
  32. <input name="bbp_topic_split_option" id="bbp_topic_split_option_existing" type="radio" value="existing" tabindex="<?php bbp_tab_index(); ?>" />
  33. <label for="bbp_topic_split_option_existing"><?php _e( 'Use an existing topic in this forum:', 'bbpress' ); ?></label>
  34. <?php
  35. bbp_dropdown( array(
  36. 'post_type' => bbp_get_topic_post_type(),
  37. 'post_parent' => bbp_get_topic_forum_id( bbp_get_topic_id() ),
  38. 'selected' => -1,
  39. 'exclude' => bbp_get_topic_id(),
  40. 'select_id' => 'bbp_destination_topic',
  41. 'none_found' => __( 'No other topics found!', 'bbpress' )
  42. ) );
  43. ?>
  44. </div>
  45. <?php endif; ?>
  46. </fieldset>
  47. <fieldset class="bbp-form">
  48. <legend><?php _e( 'Topic Extras', 'bbpress' ); ?></legend>
  49. <div>
  50. <?php if ( bbp_is_subscriptions_active() ) : ?>
  51. <input name="bbp_topic_subscribers" id="bbp_topic_subscribers" type="checkbox" value="1" checked="checked" tabindex="<?php bbp_tab_index(); ?>" />
  52. <label for="bbp_topic_subscribers"><?php _e( 'Copy subscribers to the new topic', 'bbpress' ); ?></label><br />
  53. <?php endif; ?>
  54. <input name="bbp_topic_favoriters" id="bbp_topic_favoriters" type="checkbox" value="1" checked="checked" tabindex="<?php bbp_tab_index(); ?>" />
  55. <label for="bbp_topic_favoriters"><?php _e( 'Copy favoriters to the new topic', 'bbpress' ); ?></label><br />
  56. <?php if ( bbp_allow_topic_tags() ) : ?>
  57. <input name="bbp_topic_tags" id="bbp_topic_tags" type="checkbox" value="1" checked="checked" tabindex="<?php bbp_tab_index(); ?>" />
  58. <label for="bbp_topic_tags"><?php _e( 'Copy topic tags to the new topic', 'bbpress' ); ?></label><br />
  59. <?php endif; ?>
  60. </div>
  61. </fieldset>
  62. <div class="bbp-template-notice error">
  63. <p><?php _e( '<strong>WARNING:</strong> This process cannot be undone.', 'bbpress' ); ?></p>
  64. </div>
  65. <div class="bbp-submit-wrapper">
  66. <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>
  67. </div>
  68. </div>
  69. <?php bbp_split_topic_form_fields(); ?>
  70. </fieldset>
  71. </form>
  72. </div>
  73. <?php else : ?>
  74. <div id="no-topic-<?php bbp_topic_id(); ?>" class="bbp-no-topic">
  75. <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>
  76. </div>
  77. <?php endif; ?>
  78. </div>