- Timestamp:
- 04/29/2022 08:00:56 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/10.0/src/bp-templates/bp-nouveau/includes/messages/functions.php
r13036 r13275 4 4 * 5 5 * @since 3.0.0 6 * @version 10. 0.06 * @version 10.3.0 7 7 */ 8 8 … … 91 91 } 92 92 93 $bp = buddypress(); 94 $slug = bp_nouveau_get_component_slug( 'messages' ); 95 96 // Use the primary nav to get potential custom slugs. 97 $primary_nav = $bp->members->nav->get( $slug ); 98 if ( isset( $primary_nav->link ) && $primary_nav->link ) { 99 $root_url = $primary_nav->link; 100 101 // Make sure to use the displayed user domain. 102 if ( bp_loggedin_user_domain() ) { 103 $root_url = str_replace( bp_loggedin_user_domain(), bp_displayed_user_domain(), $root_url ); 104 } 105 } else { 106 $root_url = trailingslashit( bp_displayed_user_domain() . $slug ); 107 } 108 109 // Build default routes list. 110 $routes = array( 111 'inbox' => 'inbox', 112 'sentbox' => 'sentbox', 113 'compose' => 'compose', 114 ); 115 116 if ( bp_is_active( 'messages', 'star' ) ) { 117 $routes['starred'] = 'starred'; 118 } 119 120 // Use the secondary nav to get potential custom slugs. 121 $secondary_nav = $bp->members->nav->get_secondary( array( 'parent_slug' => $slug ), false ); 122 123 // Resets the routes list using link slugs. 124 if ( $secondary_nav ) { 125 foreach ( $secondary_nav as $subnav_item ) { 126 $routes[ $subnav_item->slug ] = trim( str_replace( $root_url, '', $subnav_item->link ), '/' ); 127 128 if ( ! $routes[ $subnav_item->slug ] ) { 129 $routes[ $subnav_item->slug ] = $subnav_item->slug; 130 } 131 } 132 } 133 93 134 $params['messages'] = array( 94 'errors' => array(135 'errors' => array( 95 136 'send_to' => __( 'Please add at least one recipient.', 'buddypress' ), 96 137 'subject' => __( 'Please add a subject to your message.', 'buddypress' ), 97 138 'message_content' => __( 'Please add some content to your message.', 'buddypress' ), 98 139 ), 99 'nonces' => array(140 'nonces' => array( 100 141 'send' => wp_create_nonce( 'messages_send_message' ), 101 142 ), 102 'loading' => __( 'Loading messages. Please wait.', 'buddypress' ),103 'doingAction' => array(143 'loading' => __( 'Loading messages. Please wait.', 'buddypress' ), 144 'doingAction' => array( 104 145 'read' => __( 'Marking messages as read. Please wait.', 'buddypress' ), 105 146 'unread' => __( 'Marking messages as unread. Please wait.', 'buddypress' ), … … 108 149 'unstar' => __( 'Unstarring messages. Please wait.', 'buddypress' ), 109 150 ), 110 'bulk_actions' => bp_nouveau_messages_get_bulk_actions(),111 'howto' => __( 'Click on the message title to preview it in the Active conversation box below.', 'buddypress' ),112 'howtoBulk' => __( 'Use the select box to define your bulk action and click on the ✓ button to apply.', 'buddypress' ),113 'toOthers' => array(151 'bulk_actions' => bp_nouveau_messages_get_bulk_actions(), 152 'howto' => __( 'Click on the message title to preview it in the Active conversation box below.', 'buddypress' ), 153 'howtoBulk' => __( 'Use the select box to define your bulk action and click on the ✓ button to apply.', 'buddypress' ), 154 'toOthers' => array( 114 155 'one' => __( '(and 1 other)', 'buddypress' ), 115 156 … … 117 158 'more' => __( '(and %d others)', 'buddypress' ), 118 159 ), 119 'rootUrl' => parse_url( trailingslashit( bp_displayed_user_domain() . bp_nouveau_get_component_slug( 'messages' ) ), PHP_URL_PATH ), 160 'rootUrl' => parse_url( $root_url, PHP_URL_PATH ), 161 'supportedRoutes' => $routes, 120 162 ); 121 163
Note: See TracChangeset
for help on using the changeset viewer.