[ Index ]

PHP Cross Reference of BBPress

title

Body

[close]

/src/templates/default/bbpress/ -> form-topic-split.php (source)

   1  <?php
   2  
   3  /**
   4   * Split Topic
   5   *
   6   * @package bbPress
   7   * @subpackage Theme
   8   */
   9  
  10  // Exit if accessed directly
  11  defined( 'ABSPATH' ) || exit;
  12  
  13  ?>
  14  
  15  <div id="bbpress-forums" class="bbpress-wrapper">
  16  
  17      <?php bbp_breadcrumb(); ?>
  18  
  19      <?php if ( is_user_logged_in() && current_user_can( 'edit_topic', bbp_get_topic_id() ) ) : ?>
  20  
  21          <div id="split-topic-<?php bbp_topic_id(); ?>" class="bbp-topic-split">
  22  
  23              <form id="split_topic" name="split_topic" method="post">
  24  
  25                  <fieldset class="bbp-form">
  26  
  27                      <legend><?php printf( esc_html__( 'Split topic "%s"', 'bbpress' ), bbp_get_topic_title() ); ?></legend>
  28  
  29                      <div>
  30  
  31                          <div class="bbp-template-notice info">
  32                              <ul>
  33                                  <li><?php esc_html_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' ); ?></li>
  34                              </ul>
  35                          </div>
  36  
  37                          <div class="bbp-template-notice">
  38                              <ul>
  39                                  <li><?php esc_html_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' ); ?></li>
  40                              </ul>
  41                          </div>
  42  
  43                          <fieldset class="bbp-form">
  44                              <legend><?php esc_html_e( 'Split Method', 'bbpress' ); ?></legend>
  45  
  46                              <div>
  47                                  <input name="bbp_topic_split_option" id="bbp_topic_split_option_reply" type="radio" checked="checked" value="reply" />
  48                                  <label for="bbp_topic_split_option_reply"><?php printf( esc_html__( 'New topic in %s titled:', 'bbpress' ), bbp_get_forum_title( bbp_get_topic_forum_id( bbp_get_topic_id() ) ) ); ?></label>
  49                                  <input type="text" id="bbp_topic_split_destination_title" value="<?php printf( esc_html__( 'Split: %s', 'bbpress' ), bbp_get_topic_title() ); ?>" size="35" name="bbp_topic_split_destination_title" />
  50                              </div>
  51  
  52                              <?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() ) ) ) ) : ?>
  53  
  54                                  <div>
  55                                      <input name="bbp_topic_split_option" id="bbp_topic_split_option_existing" type="radio" value="existing" />
  56                                      <label for="bbp_topic_split_option_existing"><?php esc_html_e( 'Use an existing topic in this forum:', 'bbpress' ); ?></label>
  57  
  58                                      <?php
  59                                          bbp_dropdown( array(
  60                                              'post_type'   => bbp_get_topic_post_type(),
  61                                              'post_parent' => bbp_get_topic_forum_id( bbp_get_topic_id() ),
  62                                              'post_status' => bbp_get_public_topic_statuses(),
  63                                              'selected'    => -1,
  64                                              'exclude'     => bbp_get_topic_id(),
  65                                              'select_id'   => 'bbp_destination_topic'
  66                                          ) );
  67                                      ?>
  68  
  69                                  </div>
  70  
  71                              <?php endif; ?>
  72  
  73                          </fieldset>
  74  
  75                          <fieldset class="bbp-form">
  76                              <legend><?php esc_html_e( 'Topic Extras', 'bbpress' ); ?></legend>
  77  
  78                              <div>
  79  
  80                                  <?php if ( bbp_is_subscriptions_active() ) : ?>
  81  
  82                                      <input name="bbp_topic_subscribers" id="bbp_topic_subscribers" type="checkbox" value="1" checked="checked" />
  83                                      <label for="bbp_topic_subscribers"><?php esc_html_e( 'Copy subscribers to the new topic', 'bbpress' ); ?></label><br />
  84  
  85                                  <?php endif; ?>
  86  
  87                                  <input name="bbp_topic_favoriters" id="bbp_topic_favoriters" type="checkbox" value="1" checked="checked" />
  88                                  <label for="bbp_topic_favoriters"><?php esc_html_e( 'Copy favoriters to the new topic', 'bbpress' ); ?></label><br />
  89  
  90                                  <?php if ( bbp_allow_topic_tags() ) : ?>
  91  
  92                                      <input name="bbp_topic_tags" id="bbp_topic_tags" type="checkbox" value="1" checked="checked" />
  93                                      <label for="bbp_topic_tags"><?php esc_html_e( 'Copy topic tags to the new topic', 'bbpress' ); ?></label><br />
  94  
  95                                  <?php endif; ?>
  96  
  97                              </div>
  98                          </fieldset>
  99  
 100                          <div class="bbp-template-notice error" role="alert" tabindex="-1">
 101                              <ul>
 102                                  <li><?php esc_html_e( 'This process cannot be undone.', 'bbpress' ); ?></li>
 103                              </ul>
 104                          </div>
 105  
 106                          <div class="bbp-submit-wrapper">
 107                              <button type="submit" id="bbp_merge_topic_submit" name="bbp_merge_topic_submit" class="button submit"><?php esc_html_e( 'Submit', 'bbpress' ); ?></button>
 108                          </div>
 109                      </div>
 110  
 111                      <?php bbp_split_topic_form_fields(); ?>
 112  
 113                  </fieldset>
 114              </form>
 115          </div>
 116  
 117      <?php else : ?>
 118  
 119          <div id="no-topic-<?php bbp_topic_id(); ?>" class="bbp-no-topic">
 120              <div class="entry-content"><?php is_user_logged_in()
 121                  ? esc_html_e( 'You do not have permission to edit this topic.', 'bbpress' )
 122                  : esc_html_e( 'You cannot edit this topic.',                    'bbpress' );
 123              ?></div>
 124          </div>
 125  
 126      <?php endif; ?>
 127  
 128  </div>


Generated: Mon Sep 16 01:01:26 2019 Cross-referenced by PHPXref 0.7.1