Changeset 11900
- Timestamp:
- 03/18/2018 10:51:34 PM (8 years ago)
- Location:
- trunk/src/bp-templates/bp-nouveau
- Files:
-
- 14 edited
-
buddypress-functions.php (modified) (7 diffs)
-
includes/activity/functions.php (modified) (3 diffs)
-
includes/activity/widgets.php (modified) (1 diff)
-
includes/classes.php (modified) (4 diffs)
-
includes/functions.php (modified) (3 diffs)
-
includes/groups/functions.php (modified) (13 diffs)
-
includes/groups/template-tags.php (modified) (4 diffs)
-
includes/members/functions.php (modified) (1 diff)
-
includes/notifications/functions.php (modified) (3 diffs)
-
includes/template-tags.php (modified) (11 diffs)
-
includes/xprofile/functions.php (modified) (1 diff)
-
includes/xprofile/loader.php (modified) (2 diffs)
-
includes/xprofile/template-tags.php (modified) (1 diff)
-
js/buddypress-messages.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-templates/bp-nouveau/buddypress-functions.php
r11899 r11900 38 38 protected static $instance = null; 39 39 40 /** Functions *************************************************************/41 42 40 /** 43 41 * Return the instance of this class. … … 46 44 */ 47 45 public static function get_instance() { 48 49 // If the single instance hasn't been set, set it now.50 46 if ( null === self::$instance ) { 51 47 self::$instance = new self; … … 63 59 parent::start(); 64 60 65 // Include needed files66 61 $this->includes(); 67 68 // Setup features support69 62 $this->setup_support(); 70 63 } … … 83 76 84 77 $this->includes_dir = trailingslashit( $this->dir ) . 'includes/'; 85 $this->lang_dir = trailingslashit( $this->dir ) . 'languages';86 $this->domain = 'bp-nouveau';87 78 $this->directory_nav = new BP_Core_Nav(); 88 79 } … … 175 166 add_action( 'bp_actions', array( $this, 'neutralize_core_template_notices' ), 6 ); 176 167 177 /** Scripts ***********************************************************/ 178 168 // Scripts 179 169 add_action( 'bp_enqueue_scripts', array( $this, 'register_scripts' ), 2 ); // Register theme JS 180 181 // We won't use this.182 170 remove_action( 'bp_enqueue_scripts', 'bp_core_confirmation_js' ); 183 184 171 add_action( 'bp_enqueue_scripts', array( $this, 'enqueue_styles' ) ); // Enqueue theme CSS 185 172 add_action( 'bp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); // Enqueue theme JS 186 173 add_filter( 'bp_enqueue_scripts', array( $this, 'localize_scripts' ) ); // Enqueue theme script localization 187 174 188 /** Body no-js Class **************************************************/ 189 175 // Body no-js class 190 176 add_filter( 'body_class', array( $this, 'add_nojs_body_class' ), 20, 1 ); 191 177 … … 367 353 * 368 354 * @param array $classes Array of classes to append to body tag. 355 * 369 356 * @return array $classes 370 357 */ … … 549 536 * @see bp_buffer_template_part() 550 537 * 551 * @param string $retval Current template part contents. 538 * @param string $retval Current template part contents. 539 * 552 540 * @return string 553 541 */ -
trunk/src/bp-templates/bp-nouveau/includes/activity/functions.php
r11899 r11900 280 280 * @since 3.0.0 281 281 * 282 * @param array $nav_items The list of the activity directory nav items.282 * @param array $nav_items The list of the activity directory nav items. 283 283 */ 284 284 return apply_filters( 'bp_nouveau_get_activity_directory_nav_items', $nav_items ); … … 291 291 * @since 3.0.0 292 292 * 293 * @param string $output string HTML output 294 * @param 'directory' see comment below 293 * @param string $output HTML output 294 * @param array $filters Optional. 295 * @param string $context 295 296 * 296 297 * @return array … … 430 431 * @since 3.0.0 431 432 */ 432 433 433 function bp_nouveau_activity_time_since( $time_since, $activity = null ) { 434 434 if ( ! isset( $activity->date_recorded ) ) { -
trunk/src/bp-templates/bp-nouveau/includes/activity/widgets.php
r11899 r11900 46 46 * @since 3.0.0 47 47 * 48 * @param array $args Widget arguments.49 * @param array $instance Widget settings, as saved by the user.48 * @param array $args Widget arguments. 49 * @param array $instance Widget settings, as saved by the user. 50 50 */ 51 51 public function widget( $args, $instance ) { -
trunk/src/bp-templates/bp-nouveau/includes/classes.php
r11899 r11900 95 95 * @since 3.0.0 96 96 * 97 * @param array the list of buttons to sort. 97 * @param array the list of buttons to sort. 98 * 98 99 * @return array the list of buttons sorted. 99 100 */ … … 114 115 do { 115 116 $position += 1; 116 } while ( in_array( $position, $sorted_keys ) );117 } while ( in_array( $position, $sorted_keys, true ) ); 117 118 } 118 119 … … 129 130 * @since 3.0.0 130 131 * 131 * @param bool $sort whether to sort the buttons or not. 132 * @param bool $sort whether to sort the buttons or not. 133 * 132 134 * @return array An array of HTML links. 133 135 */ … … 161 163 * @since 3.0.0 162 164 * 163 * @param array $args See the __constructor for a description of this argument.165 * @param array $args Optional. See the __constructor for a description of this argument. 164 166 */ 165 167 public function update( $args = array() ) { 166 if ( empty( $args ) ) {167 return false;168 }169 170 168 foreach ( $args as $id => $params ) { 171 169 if ( isset( $this->group[ $id ] ) ) { -
trunk/src/bp-templates/bp-nouveau/includes/functions.php
r11899 r11900 607 607 * @since 3.0.0 608 608 * 609 * @param string $hook The hook to fire.610 * @param string $component The component nav belongs to.611 * @param int $position The position of the nav item.609 * @param string $hook The hook to fire. 610 * @param string $component The component nav belongs to. 611 * @param int $position The position of the nav item. 612 612 * 613 613 * @return array A list of component's dir nav items … … 771 771 * @since 3.0.0 772 772 * 773 * @param string $option the index of the setting to get. 774 * @param mixed $retval the value to use as default. 775 * @return mixed the value for the requested option. 773 * @param string $option the index of the setting to get. 774 * @param mixed $retval the value to use as default. 775 * 776 * @return mixed The value for the requested option. 776 777 */ 777 778 function bp_nouveau_get_temporary_setting( $option = '', $retval = false ) { … … 942 943 943 944 $cover_image = isset( $params['cover_image'] ) ? 'background-image: url( ' . $params['cover_image'] . ' );' : ''; 944 945 945 $hide_avatar_style = ''; 946 946 -
trunk/src/bp-templates/bp-nouveau/includes/groups/functions.php
r11899 r11900 12 12 * Provide a convenience function to add markup wrapper for message strings 13 13 * 14 * @param $message: The message text string 15 * $type: the message type - 'error, 'info', 'warning', success' 14 * @param string $message The message text string 15 * @param string $type The message type - 'error, 'info', 'warning', success' 16 * 16 17 * @return string 17 18 * … … 19 20 */ 20 21 function bp_nouveau_message_markup_wrapper( $message, $type ) { 21 22 22 if ( ! $message ) { 23 23 return false; … … 34 34 * @since 3.0.0 35 35 * 36 * @param array $scripts The array of scripts to register 37 * @return array The same array with the specific groups scripts. 36 * @param array $scripts Optional. The array of scripts to register. 37 * 38 * @return array The same array with the specific groups scripts. 38 39 */ 39 40 function bp_nouveau_groups_register_scripts( $scripts = array() ) { … … 674 675 * @since 3.0.0 675 676 * 676 * @param array $settings the settings to add.677 * @param array $settings Optional. The settings to add. 677 678 * 678 679 * @return array the settings to add. … … 751 752 * @since 3.0.0 752 753 * 753 * @param array $controls the controls to add.754 * @param array $controls Optional. The controls to add. 754 755 * 755 756 * @return array the controls to add. … … 821 822 * @since 3.0.0 822 823 * 823 * @param array $templates The list of templates for the front.php template part.824 * @param BP_Groups_Group The group object.824 * @param array $templates Optional. The list of templates for the front.php template part. 825 * @param BP_Groups_Group $group Optional. The group object. 825 826 * 826 827 * @return array The same list with the default front template if needed. … … 850 851 * @since 3.0.0 851 852 * 852 * @param string $template The template part to get (eg: activity, members...).853 * @param string $template Optional. The template part to get (eg: activity, members...). 853 854 * 854 855 * @return string The located template. … … 903 904 * @since 3.0.0 904 905 * 905 * @param string $template The template part to get (eg: activity, members...).906 * @param string $template Optional. The template part to get (eg: activity, members...). 906 907 * 907 908 * @return string HTML output. … … 944 945 * @since 3.0.0 945 946 * 946 * @param array $args The Activities Template arguments.947 * @param array $args Optional. The Activities Template arguments. 947 948 * 948 949 * @return array The Activities Template arguments. … … 960 961 * @since 3.0.0 961 962 * 962 * @param array $args The Groups Template arguments.963 * @param array $args Optional. The Groups Template arguments. 963 964 * 964 965 * @return array The Groups Template arguments. … … 975 976 * @since 3.0.0 976 977 * 977 * @param array $args The Members Template arguments.978 * @param array $args Optional. The Members Template arguments. 978 979 * 979 980 * @return array The Members Template arguments. … … 1022 1023 * @since 3.0.0 1023 1024 * 1024 * @param string $id The screen id1025 * @param string $id Optional. The screen id 1025 1026 * 1026 1027 * @return mixed An array containing the hook dynamic part, the nonce, and eventually a specific template. … … 1049 1050 * @since 3.0.0 1050 1051 * 1051 * @param string $id The screen id1052 * @param string $id Optional. The screen id 1052 1053 * 1053 1054 * @return mixed An array containing the hook dynamic part and the nonce. -
trunk/src/bp-templates/bp-nouveau/includes/groups/template-tags.php
r11899 r11900 1288 1288 * @since 3.0.0 1289 1289 * 1290 * @param object $group Optional. The group being referenced. 1291 * Defaults to the group currently being 1292 * iterated on in the groups loop. 1293 * @param int $length Optional. Length of returned string, including ellipsis. 1294 * Default: 100. 1290 * @param object $group Optional. The group being referenced. 1291 * Defaults to the group currently being iterated on in the groups loop. 1292 * @param int $length Optional. Length of returned string, including ellipsis. Default: 100. 1295 1293 * 1296 1294 * @return string Excerpt. … … 1301 1299 1302 1300 /** 1303 * Filters the excerpt of a group description.1301 * Filters the excerpt of a group description. 1304 1302 * 1305 1303 * Checks if the group loop is set as a 'Grid' layout and returns a reduced excerpt. … … 1307 1305 * @since 3.0.0 1308 1306 * 1309 * @param object $group Optional. The group being referenced. 1310 * Defaults to the group currently being 1311 * iterated on in the groups loop. 1312 * @param int $length Optional. Length of returned string, including ellipsis. 1313 * Default: 100. 1307 * @param object $group Optional. The group being referenced. Defaults to the group currently being 1308 * iterated on in the groups loop. 1309 * @param int $length Optional. Length of returned string, including ellipsis. Default: 100. 1314 1310 * 1315 1311 * @return string Excerpt. … … 1323 1319 1324 1320 /** 1325 * If this is a grid layout but no length is passed in set a shorter1326 * default value otherwise use the passed in value.1327 * If not a grid then the BP core default is used or passed in value.1328 */1321 * If this is a grid layout but no length is passed in set a shorter 1322 * default value otherwise use the passed in value. 1323 * If not a grid then the BP core default is used or passed in value. 1324 */ 1329 1325 if ( bp_nouveau_loop_is_grid() && 'groups' === bp_current_component() ) { 1330 1326 if ( ! $length ) { -
trunk/src/bp-templates/bp-nouveau/includes/members/functions.php
r11899 r11900 423 423 * @since 3.0.0 424 424 * 425 * @param WP_User $user The user object. Optional. 426 * @return array The list of WP Profile fields 425 * @param WP_User $user The user object. Optional. 426 * 427 * @return array The list of WP Profile fields 427 428 */ 428 429 function bp_nouveau_get_wp_profile_fields( $user = null ) { -
trunk/src/bp-templates/bp-nouveau/includes/notifications/functions.php
r11899 r11900 122 122 return $bp_nouveau->notifications->filters[ $id ]; 123 123 124 // Oops nothing found!125 124 } else { 126 125 return false; … … 144 143 145 144 foreach ( $filters as $filter ) { 146 // Default position147 145 $position = 99; 148 146 … … 157 155 do { 158 156 $position += 1; 159 } while ( in_array( $position, $sorted_keys ) );157 } while ( in_array( $position, $sorted_keys, true ) ); 160 158 } 161 159 -
trunk/src/bp-templates/bp-nouveau/includes/template-tags.php
r11899 r11900 132 132 * Checks if the template notice/feedback message needs a dismiss button 133 133 * 134 *135 134 * @todo Dismiss button re-worked to try and prevent buttons on general 136 * BP template notices - Nouveau user_feedback key needs review. 137 * 135 * BP template notices - Nouveau user_feedback key needs review. 138 136 * 139 137 * @since 3.0.0 … … 149 147 } 150 148 151 // Test for isset as value may be bool or string i.e 'clear'149 // Test for isset as value can be falsey. 152 150 if ( isset( $bp_nouveau->user_feedback['dismiss'] ) ) { 153 151 return true; … … 159 157 /** 160 158 * Ouptut the dismiss type. 159 * 161 160 * $type is used to set the data-attr for the button. 162 161 * 'clear' is tested for & used to remove cookies, if set, in buddypress-nouveau.js. … … 237 236 238 237 // Adds a 'dimiss' (button) key to array - set true/false. 239 // defaulting to false.240 238 $template_message['dismiss'] = false; 241 239 … … 359 357 */ 360 358 function bp_nouveau_pagination( $position ) { 361 $component = bp_current_component();362 363 // @TODO: How is this ever going to occur?364 if ( ! bp_is_active( $component ) ) {365 return;366 }367 368 359 $screen = 'dir'; 369 $pagination_type = $component;360 $pagination_type = bp_current_component(); 370 361 371 362 if ( bp_is_user() ) { … … 616 607 /** 617 608 * Return a bool check for component directory layout. 618 * Checks if activity, members, groups, blogs has the vert nav layout selected 619 * 620 * @since 3.0.0 621 * 622 * @return bool. 609 * 610 * Checks if activity, members, groups, blogs has the vert nav layout selected. 611 * 612 * @since 3.0.0 613 * 614 * @return bool 623 615 */ 624 616 function bp_dir_is_vert_layout() { 625 $bp_nouveau = bp_nouveau();626 $component = sanitize_key( bp_current_component() );627 628 return (bool) $bp_nouveau->{$component}->directory_vertical_layout;617 $bp_nouveau = bp_nouveau(); 618 $component = sanitize_key( bp_current_component() ); 619 620 return (bool) $bp_nouveau->{$component}->directory_vertical_layout; 629 621 } 630 622 … … 748 740 $nav = $user_nav->get_primary( $args ); 749 741 } 742 750 743 } elseif ( ! empty( $bp_nouveau->object_nav ) ) { 751 752 744 $bp_nouveau->displayed_nav = $bp_nouveau->object_nav; 753 745 … … 1302 1294 * 1303 1295 * @since 3.0.0 1296 * 1297 * @return string 1304 1298 */ 1305 1299 function bp_nouveau_get_directory_list_class() { … … 1340 1334 1341 1335 1342 / ** Template tags for the single item navs ***********************************/1336 // Template tags for the single item navs. 1343 1337 1344 1338 /** … … 1526 1520 */ 1527 1521 function bp_nouveau_get_single_item_subnav_classes() { 1528 $classes = array( 'bp-navs', 'bp-subnavs', 'no-ajax' );1522 $classes = array( 'bp-navs', 'bp-subnavs', 'no-ajax' ); 1529 1523 1530 1524 // Set user or group class string … … 1777 1771 1778 1772 1779 / ** Template tags for the directory & user/group screen filters **********************************/1773 // Template tags for the directory & user/group screen filters. 1780 1774 1781 1775 /** -
trunk/src/bp-templates/bp-nouveau/includes/xprofile/functions.php
r11899 r11900 14 14 * @since 3.0.0 15 15 * 16 * @param array $scriptsThe array of scripts to register16 * @param array $scripts The array of scripts to register 17 17 * 18 18 * @return array The same array with the specific groups scripts. -
trunk/src/bp-templates/bp-nouveau/includes/xprofile/loader.php
r11899 r11900 52 52 */ 53 53 protected function setup_actions() { 54 // Enqueue the scripts55 54 add_action( 'bp_nouveau_enqueue_scripts', 'bp_nouveau_xprofile_enqueue_scripts' ); 56 55 } … … 62 61 */ 63 62 protected function setup_filters() { 64 // Register xprofile scripts65 63 add_filter( 'bp_nouveau_register_scripts', 'bp_nouveau_xprofile_register_scripts', 10, 1 ); 66 64 } -
trunk/src/bp-templates/bp-nouveau/includes/xprofile/template-tags.php
r11899 r11900 33 33 bp_nouveau_hook( $hook ); 34 34 } 35 36 35 37 36 /** -
trunk/src/bp-templates/bp-nouveau/js/buddypress-messages.js
r11686 r11900 401 401 return bp.ajax.send( options ); 402 402 } 403 404 /*if ( 'delete' === method ) {405 options.data = _.extend( options.data, {406 action : 'groups_delete_group_invite',407 '_wpnonce' : BP_Nouveau.group_invites.nonces.uninvite408 } );409 410 if ( model ) {411 options.data.user = model;412 }413 414 return bp.ajax.send( options );415 }*/416 403 }, 417 404
Note: See TracChangeset
for help on using the changeset viewer.