/deprecated/includes/admin/edit-field/help.php

  1. <?php if ( ! defined( 'ABSPATH' ) ) exit; 
  2. add_action('init', 'ninja_forms_register_edit_field_help'); 
  3. function ninja_forms_register_edit_field_help() { 
  4. add_action('ninja_forms_edit_field_after_registered', 'ninja_forms_edit_field_help', 10, 2 ); 
  5.  
  6. function ninja_forms_edit_field_help( $field_id, $field_data ) { 
  7. global $ninja_forms_fields; 
  8. $field_row = ninja_forms_get_field_by_id($field_id); 
  9. $field_type = $field_row['type']; 
  10. $reg_field = $ninja_forms_fields[$field_type]; 
  11. $edit_help = $reg_field['edit_help']; 
  12. if($edit_help) { 
  13. if(isset($field_data['help_text'])) { 
  14. $help_text = $field_data['help_text']; 
  15. }else{ 
  16. $help_text = ''; 
  17.  
  18. if(isset($field_data['show_help'])) { 
  19. $show_help = $field_data['show_help']; 
  20. }else{ 
  21. $show_help = ''; 
  22.  
  23. if( $show_help == 1 ) { 
  24. $display_span = ''; 
  25. }else{ 
  26. $display_span = 'display:none;'; 
  27.  
  28. $help_desc = sprintf( __( 'If "help text" is enabled, there will be a question mark %s placed next to the input field. Hovering over this question mark will show the help text.', 'ninja-forms' ), '<img src="'.NINJA_FORMS_URL.'images/question-ico.gif">') ; 
  29. ninja_forms_edit_field_el_output($field_id, 'checkbox', __( 'Show Help Text', 'ninja-forms' ), 'show_help', $show_help, 'wide', '', 'ninja-forms-show-help'); 
  30. ?> 
  31. <span id="ninja_forms_field_<?php echo $field_id;?>_help_span" style="<?php echo $display_span;?>"> 
  32. <?php 
  33. ninja_forms_edit_field_el_output($field_id, 'textarea', __( 'Help Text', 'ninja-forms' ), 'help_text', $help_text, 'wide', '', 'widefat'); 
  34. ninja_forms_edit_field_el_output($field_id, 'desc', $help_desc, 'help_desc'); 
  35. ?> 
  36. </span> 
  37. <?php 
.