Ticket #787: x-profile.patch.1.0.1.2.diff
File x-profile.patch.1.0.1.2.diff, 7.0 KB (added by , 9 years ago) |
---|
-
src/bp-xprofile/admin/css/admin-rtl.css
284 284 display: none; 285 285 visibility: hidden; 286 286 } 287 288 .bp-help-tooltip { 289 border: 1px solid #DFDFDF; 290 background-color: #FAFAFA; 291 display: inline-block; 292 color: #888; 293 border-radius: 50%; 294 width: 17px; 295 height: 17px; 296 text-align: center; 297 vertical-align: middle; 298 line-height: 17px; 299 margin-right: 3px; 300 } 301 302 .ui-tooltip { 303 padding: 8px; 304 position: absolute; 305 z-index: 9999; 306 max-width: 300px; 307 -webkit-box-shadow: 0 0 5px #aaa; 308 box-shadow: 0 0 5px #aaa; 309 background-color: #fff; 310 } 311 body .ui-tooltip { 312 border-width: 2px; 313 } 314 No newline at end of file -
src/bp-xprofile/admin/css/admin.css
284 284 display: none; 285 285 visibility: hidden; 286 286 } 287 288 .bp-help-tooltip { 289 border: 1px solid #DFDFDF; 290 background-color: #FAFAFA; 291 display: inline-block; 292 color: #888; 293 border-radius: 50%; 294 width: 17px; 295 height: 17px; 296 text-align: center; 297 vertical-align: middle; 298 line-height: 17px; 299 margin-left: 3px; 300 } 301 302 .ui-tooltip { 303 padding: 8px; 304 position: absolute; 305 z-index: 9999; 306 max-width: 300px; 307 -webkit-box-shadow: 0 0 5px #aaa; 308 box-shadow: 0 0 5px #aaa; 309 background-color: #fff; 310 } 311 body .ui-tooltip { 312 border-width: 2px; 313 } 314 No newline at end of file -
src/bp-xprofile/admin/js/admin.js
82 82 83 83 if ( XProfileAdmin.supports_options_field_types.indexOf( forWhat ) >= 0 ) { 84 84 document.getElementById( forWhat ).style.display = ''; 85 document.getElementById( 'create_search_link' ).checked = true; 86 } else { 87 document.getElementById( 'create_search_link' ).checked = false; 85 88 } 86 89 } 87 90 … … 180 183 // Set focus in Field Title, if we're on the right page 181 184 jQuery( '#bp-xprofile-add-field #title' ).focus(); 182 185 186 jQuery( '.bp-help-tooltip' ).tooltip(); 187 183 188 // Set up the notice that shows when no member types are selected for a field. 184 189 toggle_no_member_type_notice(); 185 190 jQuery( 'input.member-type-selector' ).on( 'change', function() { -
src/bp-xprofile/bp-xprofile-admin.php
412 412 bp_xprofile_delete_meta( $field_id, 'field', 'signup_position' ); 413 413 } 414 414 415 // Save create_search_link. 416 if ( 1 != $field_id ) { 417 if ( isset( $_POST['create_search_link'] ) && $_POST['create_search_link'] == '1') { 418 bp_xprofile_update_field_meta( $field_id, 'create_search_link', $_POST['create_search_link'] ); 419 } else { 420 bp_xprofile_update_field_meta( $field_id, 'create_search_link', '0' ); 421 } 422 } 423 415 424 /** 416 425 * Fires at the end of the process to save a field for a user, if successful. 417 426 * -
src/bp-xprofile/bp-xprofile-cssjs.php
41 41 wp_enqueue_script( 'jquery-ui-draggable' ); 42 42 wp_enqueue_script( 'jquery-ui-droppable' ); 43 43 wp_enqueue_script( 'jquery-ui-sortable' ); 44 wp_enqueue_script( 'jquery-ui-tooltip' ); 44 45 45 46 $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; 46 47 wp_enqueue_script( 'xprofile-admin-js', buddypress()->plugin_url . "bp-xprofile/admin/js/admin{$min}.js", array( 'jquery', 'jquery-ui-sortable' ), bp_get_version() ); -
src/bp-xprofile/bp-xprofile-filters.php
339 339 * @return string 340 340 */ 341 341 function xprofile_filter_link_profile_data( $field_value, $field_type = 'textbox' ) { 342 global $field; 342 343 344 if( !$field->need_create_search_link() ) { 345 return $field_value; 346 } 347 343 348 if ( 'datebox' === $field_type ) { 344 349 return $field_value; 345 350 } -
src/bp-xprofile/classes/class-bp-xprofile-field.php
140 140 protected $allow_custom_visibility; 141 141 142 142 /** 143 * Create search link for field. 144 * 145 * @since 1.9.0 146 * @since 2.4.0 Property marked protected. Now accessible by magic method or by `get_default_visibility()`. 147 * 148 * @var string Default field data visibility. 149 */ 150 public $create_search_link; 151 152 /** 143 153 * Field type option. 144 154 * 145 155 * @since 2.0.0 … … 272 284 273 285 // Create the field type and store a reference back to this object. 274 286 $this->type_obj = bp_xprofile_create_field_type( $this->type ); 275 $this->type_obj->field_obj = $this; ;287 $this->type_obj->field_obj = $this; 276 288 } 277 289 278 290 /** … … 808 820 return $this->allow_custom_visibility; 809 821 } 810 822 823 /** 824 * Get fieleld create_search_link option 825 * 826 * Lazy-loaded to reduce overhead. 827 * 828 * Defaults to true for multi and default fields. false for single fields 829 * 830 * @since Patch 1.0.1 831 * 832 * @author Lenlay 833 * 834 * @return bool. 835 */ 836 public function need_create_search_link() { 837 838 if ( ! isset( $this->create_search_link ) ) { 839 $is_multi_field = !empty( $this->get_children( true ) )? true : false; 840 841 $create_search_link = bp_xprofile_get_meta( $this->id, 'field', 'create_search_link' ); 842 843 if( $create_search_link !== '' ){ 844 845 if ( '0' === $create_search_link ) { 846 $this->create_search_link = false; 847 } else { 848 $this->create_search_link = true; 849 } 850 851 } else { 852 853 $this->create_search_link = $is_multi_field || $this->is_default_field(); 854 855 } 856 } 857 858 return apply_filters( 'bp_xprofile_field_need_search_link', $this->create_search_link, $this->id ); 859 } 860 811 861 /** Static Methods ********************************************************/ 812 862 813 863 public static function get_type( $field_id = 0 ) { … … 1455 1505 1456 1506 $this->render_admin_form_children(); ?> 1457 1507 1508 <p> 1509 <label> 1510 <input type="checkbox" name="create_search_link" id="create_search_link" value="1" <?php checked( $this->need_create_search_link(), true ); ?> /> 1511 <?php esc_html_e( 'Create search links', 'buddypress'); ?> 1512 <span class="bp-help-tooltip" title="<?php esc_html_e( 'If selected then the value on member profile tab is a link, clicking on which searches for profiles of other members with the same response.', 'buddypress'); ?>">?</span> 1513 </label> 1514 </p> 1458 1515 </div> 1459 1516 </div> 1460 1517