WPCF7_Help_Tabs

The Contact Form 7 WPCF7 Help Tabs class.

Defined (1)

The class is defined in the following location(s).

/admin/includes/help-tabs.php  
  1. class WPCF7_Help_Tabs { 
  2.  
  3. private $screen; 
  4.  
  5. public function __construct( WP_Screen $screen ) { 
  6. $this->screen = $screen; 
  7.  
  8. public function set_help_tabs( $type ) { 
  9. switch ( $type ) { 
  10. case 'list': 
  11. $this->screen->add_help_tab( array( 
  12. 'id' => 'list_overview',  
  13. 'title' => __( 'Overview', 'contact-form-7' ),  
  14. 'content' => $this->content( 'list_overview' ) ) ); 
  15.  
  16. $this->screen->add_help_tab( array( 
  17. 'id' => 'list_available_actions',  
  18. 'title' => __( 'Available Actions', 'contact-form-7' ),  
  19. 'content' => $this->content( 'list_available_actions' ) ) ); 
  20.  
  21. $this->sidebar(); 
  22.  
  23. return; 
  24. case 'edit': 
  25. $this->screen->add_help_tab( array( 
  26. 'id' => 'edit_overview',  
  27. 'title' => __( 'Overview', 'contact-form-7' ),  
  28. 'content' => $this->content( 'edit_overview' ) ) ); 
  29.  
  30. $this->screen->add_help_tab( array( 
  31. 'id' => 'edit_form_tags',  
  32. 'title' => __( 'Form-tags', 'contact-form-7' ),  
  33. 'content' => $this->content( 'edit_form_tags' ) ) ); 
  34.  
  35. $this->screen->add_help_tab( array( 
  36. 'id' => 'edit_mail_tags',  
  37. 'title' => __( 'Mail-tags', 'contact-form-7' ),  
  38. 'content' => $this->content( 'edit_mail_tags' ) ) ); 
  39.  
  40. $this->sidebar(); 
  41.  
  42. return; 
  43. case 'integration': 
  44. $this->screen->add_help_tab( array( 
  45. 'id' => 'integration_overview',  
  46. 'title' => __( 'Overview', 'contact-form-7' ),  
  47. 'content' => $this->content( 'integration_overview' ) ) ); 
  48.  
  49. $this->sidebar(); 
  50.  
  51. return; 
  52.  
  53. private function content( $name ) { 
  54. $content = array(); 
  55.  
  56. $content['list_overview'] = '<p>' . __( "On this screen, you can manage contact forms provided by Contact Form 7. You can manage an unlimited number of contact forms. Each contact form has a unique ID and Contact Form 7 shortcode ([contact-form-7 ...]). To insert a contact form into a post or a text widget, insert the shortcode into the target.", 'contact-form-7' ) . '</p>'; 
  57.  
  58. $content['list_available_actions'] = '<p>' . __( "Hovering over a row in the contact forms list will display action links that allow you to manage your contact form. You can perform the following actions:", 'contact-form-7' ) . '</p>'; 
  59. $content['list_available_actions'] .= '<p>' . __( "<strong>Edit</strong> - Navigates to the editing screen for that contact form. You can also reach that screen by clicking on the contact form title.", 'contact-form-7' ) . '</p>'; 
  60. $content['list_available_actions'] .= '<p>' . __( "<strong>Duplicate</strong> - Clones that contact form. A cloned contact form inherits all content from the original, but has a different ID.", 'contact-form-7' ) . '</p>'; 
  61.  
  62. $content['edit_overview'] = '<p>' . __( "On this screen, you can edit a contact form. A contact form is comprised of the following components:", 'contact-form-7' ) . '</p>'; 
  63. $content['edit_overview'] .= '<p>' . __( "<strong>Title</strong> is the title of a contact form. This title is only used for labeling a contact form, and can be edited.", 'contact-form-7' ) . '</p>'; 
  64. $content['edit_overview'] .= '<p>' . __( "<strong>Form</strong> is a content of HTML form. You can use arbitrary HTML, which is allowed inside a form element. You can also use Contact Form 7’s form-tags here.", 'contact-form-7' ) . '</p>'; 
  65. $content['edit_overview'] .= '<p>' . __( "<strong>Mail</strong> manages a mail template (headers and message body) that this contact form will send when users submit it. You can use Contact Form 7’s mail-tags here.", 'contact-form-7' ) . '</p>'; 
  66. $content['edit_overview'] .= '<p>' . __( "<strong>Mail (2)</strong> is an additional mail template that works similar to Mail. Mail (2) is different in that it is sent only when Mail has been sent successfully.", 'contact-form-7' ) . '</p>'; 
  67. $content['edit_overview'] .= '<p>' . __( "In <strong>Messages</strong>, you can edit various types of messages used for this contact form. These messages are relatively short messages, like a validation error message you see when you leave a required field blank.", 'contact-form-7' ) . '</p>'; 
  68. $content['edit_overview'] .= '<p>' . __( "<strong>Additional Settings</strong> provides a place where you can customize the behavior of this contact form by adding code snippets.", 'contact-form-7' ) . '</p>'; 
  69.  
  70. $content['edit_form_tags'] = '<p>' . __( "A form-tag is a short code enclosed in square brackets used in a form content. A form-tag generally represents an input field, and its components can be separated into four parts: type, name, options, and values. Contact Form 7 supports several types of form-tags including text fields, number fields, date fields, checkboxes, radio buttons, menus, file-uploading fields, CAPTCHAs, and quiz fields.", 'contact-form-7' ) . '</p>'; 
  71. $content['edit_form_tags'] .= '<p>' . __( "While form-tags have a comparatively complex syntax, you don’t need to know the syntax to add form-tags because you can use the straightforward tag generator (<strong>Generate Tag</strong> button on this screen).", 'contact-form-7' ) . '</p>'; 
  72.  
  73. $content['edit_mail_tags'] = '<p>' . __( "A mail-tag is also a short code enclosed in square brackets that you can use in every Mail and Mail (2) field. A mail-tag represents a user input value through an input field of a corresponding form-tag.", 'contact-form-7' ) . '</p>'; 
  74. $content['edit_mail_tags'] .= '<p>' . __( "There are also special mail-tags that have specific names, but don’t have corresponding form-tags. They are used to represent meta information of form submissions like the submitter’s IP address or the URL of the page.", 'contact-form-7' ) . '</p>'; 
  75.  
  76. $content['integration_overview'] = '<p>' . __( "On this screen, you can manage services that are available through Contact Form 7. Using API will allow you to collaborate with any services that are available.", 'contact-form-7' ) . '</p>'; 
  77. $content['integration_overview'] .= '<p>' . __( "You may need to first sign up for an account with the service that you plan to use. When you do so, you would need to authorize Contact Form 7 to access the service with your account.", 'contact-form-7' ) . '</p>'; 
  78. $content['integration_overview'] .= '<p>' . __( "Any information you provide will not be shared with service providers without your authorization.", 'contact-form-7' ) . '</p>'; 
  79.  
  80. if ( ! empty( $content[$name] ) ) { 
  81. return $content[$name]; 
  82.  
  83. public function sidebar() { 
  84. $content = '<p><strong>' . __( 'For more information:', 'contact-form-7' ) . '</strong></p>'; 
  85. $content .= '<p>' . wpcf7_link( __( 'https://contactform7.com/docs/', 'contact-form-7' ), __( 'Docs', 'contact-form-7' ) ) . '</p>'; 
  86. $content .= '<p>' . wpcf7_link( __( 'https://contactform7.com/faq/', 'contact-form-7' ), __( 'FAQ', 'contact-form-7' ) ) . '</p>'; 
  87. $content .= '<p>' . wpcf7_link( __( 'https://contactform7.com/support/', 'contact-form-7' ), __( 'Support', 'contact-form-7' ) ) . '</p>'; 
  88.  
  89. $this->screen->set_help_sidebar( $content );