[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-templates/bp-nouveau/buddypress/common/js-templates/messages/ -> index.php (source)

   1  <?php
   2  /**
   3   * BP Nouveau Messages main template.
   4   *
   5   * This template is used to inject the BuddyPress Backbone views
   6   * dealing with user's private messages.
   7   *
   8   * @since 3.0.0
   9   * @version 3.1.0
  10   */
  11  ?>
  12  <div class="subnav-filters filters user-subnav bp-messages-filters" id="subsubnav"></div>
  13  
  14  <div class="bp-messages-feedback"></div>
  15  <div class="bp-messages-content"></div>
  16  
  17  <script type="text/html" id="tmpl-bp-messages-feedback">
  18      <div class="bp-feedback {{data.type}}">
  19          <span class="bp-icon" aria-hidden="true"></span>
  20          <p>{{{data.message}}}</p>
  21      </div>
  22  </script>
  23  
  24  <?php
  25  /**
  26   * This view is used to inject hooks buffer
  27   */
  28  ?>
  29  <script type="text/html" id="tmpl-bp-messages-hook">
  30      {{{data.extraContent}}}
  31  </script>
  32  
  33  <script type="text/html" id="tmpl-bp-messages-form">
  34      <?php bp_nouveau_messages_hook( 'before', 'compose_content' ); ?>
  35  
  36      <label for="send-to-input"><?php esc_html_e( 'Send @Username', 'buddypress' ); ?></label>
  37      <input type="text" name="send_to" class="send-to-input" id="send-to-input" />
  38  
  39      <label for="subject"><?php _e( 'Subject', 'buddypress' ); ?></label>
  40      <input type="text" name="subject" id="subject"/>
  41  
  42      <div id="bp-message-content"></div>
  43  
  44      <?php bp_nouveau_messages_hook( 'after', 'compose_content' ); ?>
  45  
  46      <div class="submit">
  47          <input type="button" id="bp-messages-send" class="button bp-primary-action" value="<?php echo esc_attr_x( 'Send', 'button', 'buddypress' ); ?>"/>
  48          <input type="button" id="bp-messages-reset" class="text-button small bp-secondary-action" value="<?php echo esc_attr_x( 'Reset', 'form reset button', 'buddypress' ); ?>"/>
  49      </div>
  50  </script>
  51  
  52  <script type="text/html" id="tmpl-bp-messages-editor">
  53      <?php
  54      // Add a temporary filter on editor buttons
  55      add_filter( 'mce_buttons', 'bp_nouveau_messages_mce_buttons', 10, 1 );
  56  
  57      wp_editor(
  58          '',
  59          'message_content',
  60          array(
  61              'textarea_name' => 'message_content',
  62              'teeny'         => false,
  63              'media_buttons' => false,
  64              'dfw'           => false,
  65              'tinymce'       => true,
  66              'quicktags'     => false,
  67              'tabindex'      => '3',
  68              'textarea_rows' => 5,
  69          )
  70      );
  71  
  72      // Remove the temporary filter on editor buttons
  73      remove_filter( 'mce_buttons', 'bp_nouveau_messages_mce_buttons', 10, 1 );
  74      ?>
  75  </script>
  76  
  77  <script type="text/html" id="tmpl-bp-messages-paginate">
  78      <# if ( 1 !== data.page ) { #>
  79          <button id="bp-messages-prev-page"class="button messages-button">
  80              <span class="dashicons dashicons-arrow-left"></span>
  81              <span class="bp-screen-reader-text"><?php echo esc_html_x( 'Previous page', 'link', 'buddypress' ); ?></span>
  82          </button>
  83      <# } #>
  84  
  85      <# if ( data.total_page !== data.page ) { #>
  86          <button id="bp-messages-next-page"class="button messages-button">
  87              <span class="dashicons dashicons-arrow-right"></span>
  88              <span class="bp-screen-reader-text"><?php echo esc_html_x( 'Next page', 'link', 'buddypress' ); ?></span>
  89          </button>
  90      <# } #>
  91  </script>
  92  
  93  <script type="text/html" id="tmpl-bp-messages-filters">
  94      <li class="user-messages-search" role="search" data-bp-search="{{data.box}}">
  95          <div class="bp-search messages-search">
  96              <?php bp_nouveau_message_search_form(); ?>
  97          </div>
  98      </li>
  99      <li class="user-messages-bulk-actions"></li>
 100  </script>
 101  
 102  <script type="text/html" id="tmpl-bp-bulk-actions">
 103      <input type="checkbox" id="user_messages_select_all" value="1"/>
 104      <label for="user_messages_select_all"><?php esc_html_e( 'All Messages', 'buddypress' ); ?></label>
 105      <div class="bulk-actions-wrap bp-hide">
 106          <div class="bulk-actions select-wrap">
 107              <label for="user-messages-bulk-actions" class="bp-screen-reader-text">
 108                  <?php esc_html_e( 'Select bulk action', 'buddypress' ); ?>
 109              </label>
 110              <select id="user-messages-bulk-actions">
 111                  <# for ( i in data ) { #>
 112                      <option value="{{data[i].value}}">{{data[i].label}}</option>
 113                  <# } #>
 114              </select>
 115              <span class="select-arrow" aria-hidden="true"></span>
 116          </div>
 117          <button class="messages-button bulk-apply bp-tooltip" type="submit" data-bp-tooltip="<?php echo esc_attr_x( 'Apply', 'button', 'buddypress' ); ?>">
 118              <span class="dashicons dashicons-yes" aria-hidden="true"></span>
 119              <span class="bp-screen-reader-text"><?php echo esc_html_x( 'Apply', 'button', 'buddypress' ); ?></span>
 120          </button>
 121      </div>
 122  </script>
 123  
 124  <script type="text/html" id="tmpl-bp-messages-thread">
 125      <div class="thread-cb">
 126          <input class="message-check" type="checkbox" name="message_ids[]" id="bp-message-thread-{{data.id}}" value="{{data.id}}">
 127          <label for="bp-message-thread-{{data.id}}" class="bp-screen-reader-text"><?php esc_html_e( 'Select message:', 'buddypress' ); ?> {{data.subject}}</label>
 128      </div>
 129  
 130      <# if ( ! data.recipientsCount ) { #>
 131          <div class="thread-from">
 132              <a class="user-link" href="{{data.sender_link}}">
 133                  <img class="avatar" src="{{data.sender_avatar}}" alt="" />
 134                  <span class="bp-screen-reader-text"><?php esc_html_e( 'From:', 'buddypress' ); ?></span>
 135                  <span class="user-name">{{data.sender_name}}</span>
 136              </a>
 137          </div>
 138      <# } else {
 139          var recipient = _.first( data.recipients );
 140          #>
 141          <div class="thread-to">
 142              <a class="user-link" href="{{recipient.user_link}}">
 143                  <img class="avatar" src="{{recipient.avatar}}" alt="" />
 144                  <span class="bp-screen-reader-text"><?php esc_html_e( 'To:', 'buddypress' ); ?></span>
 145                  <span class="user-name">{{recipient.user_name}}</span>
 146              </a>
 147  
 148              <# if ( data.toOthers ) { #>
 149                  <span class="num-recipients">{{data.toOthers}}</span>
 150              <# } #>
 151          </div>
 152      <# } #>
 153  
 154      <div class="thread-content" data-thread-id="{{data.id}}">
 155          <div class="thread-subject">
 156              <span class="thread-count">({{data.count}})</span>
 157              <a class="subject" href="../view/{{data.id}}/">{{data.subject}}</a>
 158          </div>
 159          <p class="excerpt">{{data.excerpt}}</p>
 160      </div>
 161      <div class="thread-date">
 162          <time datetime="{{data.date.toISOString()}}">{{data.display_date}}</time>
 163      </div>
 164  </script>
 165  
 166  <script type="text/html" id="tmpl-bp-messages-preview">
 167      <# if ( undefined !== data.content ) { #>
 168  
 169          <h2 class="message-title preview-thread-title"><?php esc_html_e( 'Active conversation:', 'buddypress' ); ?><span class="messages-title">{{{data.subject}}}</span></h2>
 170          <div class="preview-content">
 171              <header class="preview-pane-header">
 172  
 173                  <# if ( undefined !== data.recipients ) { #>
 174                      <dl class="thread-participants">
 175                          <dt><?php esc_html_e( 'Participants:', 'buddypress' ); ?></dt>
 176                          <dd>
 177                              <ul class="participants-list">
 178                                  <# for ( i in data.recipients ) { #>
 179                                      <li><a href="{{data.recipients[i].user_link}}" class="bp-tooltip" data-bp-tooltip="{{data.recipients[i].user_name}}"><img class="avatar mini" src="{{data.recipients[i].avatar}}" alt="{{data.recipients[i].user_name}}" /></a></li>
 180                                  <# } #>
 181                              </ul>
 182                          </dd>
 183                      </dl>
 184                  <# } #>
 185  
 186                  <div class="actions">
 187  
 188                      <button type="button" class="message-action-delete bp-tooltip bp-icons" data-bp-action="delete" data-bp-tooltip="<?php esc_attr_e( 'Delete conversation.', 'buddypress' ); ?>">
 189                          <span class="bp-screen-reader-text"><?php esc_html_e( 'Delete conversation.', 'buddypress' ); ?></span>
 190                      </button>
 191  
 192                      <# if ( undefined !== data.star_link ) { #>
 193  
 194                          <# if ( false !== data.is_starred ) { #>
 195                              <a role="button" class="message-action-unstar bp-tooltip bp-icons" href="{{data.star_link}}" data-bp-action="unstar" aria-pressed="true" data-bp-tooltip="<?php esc_attr_e( 'Unstar Conversation', 'buddypress' ); ?>">
 196                                  <span class="bp-screen-reader-text"><?php esc_html_e( 'Unstar Conversation', 'buddypress' ); ?></span>
 197                              </a>
 198                          <# } else { #>
 199                              <a role="button" class="message-action-star bp-tooltip bp-icons" href="{{data.star_link}}" data-bp-action="star" aria-pressed="false" data-bp-tooltip="<?php esc_attr_e( 'Star Conversation', 'buddypress' ); ?>">
 200                                  <span class="bp-screen-reader-text"><?php esc_html_e( 'Star Conversation', 'buddypress' ); ?></span>
 201                              </a>
 202                          <# } #>
 203  
 204                      <# } #>
 205  
 206                      <a href="../view/{{data.id}}/" class="message-action-view bp-tooltip bp-icons" data-bp-action="view" data-bp-tooltip="<?php esc_attr_e( 'View full conversation and reply.', 'buddypress' ); ?>">
 207                          <span class="bp-screen-reader-text"><?php esc_html_e( 'View full conversation and reply.', 'buddypress' ); ?></span>
 208                      </a>
 209  
 210                      <# if ( data.threadOptions ) { #>
 211                          <span class="bp-messages-hook thread-options">
 212                              {{{data.threadOptions}}}
 213                          </span>
 214                      <# } #>
 215                  </div>
 216              </header>
 217  
 218              <div class='preview-message'>
 219                  {{{data.content}}}
 220              </div>
 221  
 222              <# if ( data.inboxListItem ) { #>
 223                  <table class="bp-messages-hook inbox-list-item">
 224                      <tbody>
 225                          <tr>{{{data.inboxListItem}}}</tr>
 226                      </tbody>
 227                  </table>
 228              <# } #>
 229          </div>
 230      <# } #>
 231  </script>
 232  
 233  <script type="text/html" id="tmpl-bp-messages-single-header">
 234      <h2 id="message-subject" class="message-title single-thread-title">{{{data.subject}}}</h2>
 235      <header class="single-message-thread-header">
 236          <# if ( undefined !== data.recipients ) { #>
 237              <dl class="thread-participants">
 238                  <dt><?php esc_html_e( 'Participants:', 'buddypress' ); ?></dt>
 239                  <dd>
 240                      <ul class="participants-list">
 241                          <# for ( i in data.recipients ) { #>
 242                              <li><a href="{{data.recipients[i].user_link}}" class="bp-tooltip" data-bp-tooltip="{{data.recipients[i].user_name}}"><img class="avatar mini" src="{{data.recipients[i].avatar}}" alt="{{data.recipients[i].user_name}}" /></a></li>
 243                          <# } #>
 244                      </ul>
 245                  </dd>
 246              </dl>
 247          <# } #>
 248  
 249          <div class="actions">
 250              <button type="button" class="message-action-delete bp-tooltip bp-icons" data-bp-action="delete" data-bp-tooltip="<?php esc_attr_e( 'Delete conversation.', 'buddypress' ); ?>">
 251                  <span class="bp-screen-reader-text"><?php esc_html_e( 'Delete conversation.', 'buddypress' ); ?></span>
 252              </button>
 253          </div>
 254      </header>
 255  </script>
 256  
 257  <script type="text/html" id="tmpl-bp-messages-single-list">
 258      <div class="message-metadata">
 259          <# if ( data.beforeMeta ) { #>
 260              <div class="bp-messages-hook before-message-meta">{{{data.beforeMeta}}}</div>
 261          <# } #>
 262  
 263          <a href="{{data.sender_link}}" class="user-link">
 264              <img class="avatar" src="{{data.sender_avatar}}" alt="" />
 265              <strong>{{data.sender_name}}</strong>
 266          </a>
 267  
 268          <time datetime="{{data.date.toISOString()}}" class="activity">{{data.display_date}}</time>
 269  
 270          <div class="actions">
 271              <# if ( undefined !== data.star_link ) { #>
 272  
 273                  <button type="button" class="message-action-unstar bp-tooltip bp-icons <# if ( false === data.is_starred ) { #>bp-hide<# } #>" data-bp-star-link="{{data.star_link}}" data-bp-action="unstar" data-bp-tooltip="<?php esc_attr_e( 'Unstar Message', 'buddypress' ); ?>">
 274                      <span class="bp-screen-reader-text"><?php esc_html_e( 'Unstar Message', 'buddypress' ); ?></span>
 275                  </button>
 276  
 277                  <button type="button" class="message-action-star bp-tooltip bp-icons <# if ( false !== data.is_starred ) { #>bp-hide<# } #>" data-bp-star-link="{{data.star_link}}" data-bp-action="star" data-bp-tooltip="<?php esc_attr_e( 'Star Message', 'buddypress' ); ?>">
 278                      <span class="bp-screen-reader-text"><?php esc_html_e( 'Star Message', 'buddypress' ); ?></span>
 279                  </button>
 280  
 281              <# } #>
 282          </div>
 283  
 284          <# if ( data.afterMeta ) { #>
 285              <div class="bp-messages-hook after-message-meta">{{{data.afterMeta}}}</div>
 286          <# } #>
 287      </div>
 288  
 289      <# if ( data.beforeContent ) { #>
 290          <div class="bp-messages-hook before-message-content">{{{data.beforeContent}}}</div>
 291      <# } #>
 292  
 293      <div class="message-content">{{{data.content}}}</div>
 294  
 295      <# if ( data.afterContent ) { #>
 296          <div class="bp-messages-hook after-message-content">{{{data.afterContent}}}</div>
 297      <# } #>
 298  
 299  </script>
 300  
 301  <script type="text/html" id="tmpl-bp-messages-single">
 302      <?php bp_nouveau_messages_hook( 'before', 'thread_content' ); ?>
 303  
 304      <div id="bp-message-thread-header" class="message-thread-header"></div>
 305  
 306      <?php bp_nouveau_messages_hook( 'before', 'thread_list' ); ?>
 307  
 308      <ul id="bp-message-thread-list"></ul>
 309  
 310      <?php bp_nouveau_messages_hook( 'after', 'thread_list' ); ?>
 311  
 312      <?php bp_nouveau_messages_hook( 'before', 'thread_reply' ); ?>
 313  
 314      <form id="send-reply" class="standard-form send-reply">
 315          <div class="message-box">
 316              <div class="message-metadata">
 317  
 318                  <?php bp_nouveau_messages_hook( 'before', 'reply_meta' ); ?>
 319  
 320                  <div class="avatar-box">
 321                      <?php bp_loggedin_user_avatar( 'type=thumb&height=30&width=30' ); ?>
 322  
 323                      <strong><?php esc_html_e( 'Send a Reply', 'buddypress' ); ?></strong>
 324                  </div>
 325  
 326                  <?php bp_nouveau_messages_hook( 'after', 'reply_meta' ); ?>
 327  
 328              </div><!-- .message-metadata -->
 329  
 330              <div class="message-content">
 331  
 332                  <?php bp_nouveau_messages_hook( 'before', 'reply_box' ); ?>
 333  
 334                  <label for="message_content" class="bp-screen-reader-text"><?php _e( 'Reply to Message', 'buddypress' ); ?></label>
 335                  <div id="bp-message-content"></div>
 336  
 337                  <?php bp_nouveau_messages_hook( 'after', 'reply_box' ); ?>
 338  
 339                  <div class="submit">
 340                      <input type="submit" name="send" value="<?php echo esc_attr_x( 'Send Reply', 'button', 'buddypress' ); ?>" id="send_reply_button"/>
 341                  </div>
 342  
 343              </div><!-- .message-content -->
 344  
 345          </div><!-- .message-box -->
 346      </form>
 347  
 348      <?php bp_nouveau_messages_hook( 'after', 'thread_reply' ); ?>
 349  
 350      <?php bp_nouveau_messages_hook( 'after', 'thread_content' ); ?>
 351  </script>


Generated: Wed Jul 24 01:01:43 2019 Cross-referenced by PHPXref 0.7.1