antispam
3 years ago
fullscreen
3 years ago
revisions
3 years ago
help.php
3 years ago
templates-item.php
3 years ago
help.php
146 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Form Builder Help Screen template. |
| 4 | * |
| 5 | * @since 1.6.3 |
| 6 | * |
| 7 | * @var array $settings Help Screen settings. |
| 8 | */ |
| 9 | |
| 10 | if ( ! defined( 'ABSPATH' ) ) { |
| 11 | exit; |
| 12 | } |
| 13 | |
| 14 | $times_svg = '<svg width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1490 1322q0 40-28 68l-136 136q-28 28-68 28t-68-28l-294-294-294 294q-28 28-68 28t-68-28l-136-136q-28-28-28-68t28-68l294-294-294-294q-28-28-28-68t28-68l136-136q28-28 68-28t68 28l294 294 294-294q28-28 68-28t68 28l136 136q28 28 28 68t-28 68l-294 294 294 294q28 28 28 68z"/></svg>'; |
| 15 | $url_parameters = add_query_arg( |
| 16 | [ |
| 17 | 'utm_campaign' => wpforms()->is_pro() ? 'plugin' : 'liteplugin', |
| 18 | 'utm_source' => 'WordPress', |
| 19 | 'utm_medium' => rawurlencode( 'Builder Help Modal' ), |
| 20 | 'utm_content' => '', |
| 21 | ], |
| 22 | '' |
| 23 | ); |
| 24 | |
| 25 | $links_utm_medium = 'Builder Help Modal'; |
| 26 | |
| 27 | ?> |
| 28 | <div id="wpforms-builder-help" style="display: none; opacity: 0;" class="wpforms-admin-page"> |
| 29 | |
| 30 | <img id="wpforms-builder-help-logo" |
| 31 | src="<?php echo esc_url( WPFORMS_PLUGIN_URL . 'assets/images/sullie-alt.png' ); ?>" |
| 32 | title="<?php esc_attr_e( 'Sullie the WPForms mascot', 'wpforms-lite' ); ?>" |
| 33 | alt="WPForms Logo"> |
| 34 | |
| 35 | <div id="wpforms-builder-help-close" title="<?php esc_attr_e( 'Close', 'wpforms-lite' ); ?>"> |
| 36 | <?php echo $times_svg; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
| 37 | </div> |
| 38 | |
| 39 | <div id="wpforms-builder-help-content"> |
| 40 | |
| 41 | <div id="wpforms-builder-help-search"> |
| 42 | <input type="text" placeholder="<?php esc_attr_e( 'Ask a question or search the docs...', 'wpforms-lite' ); ?>"> |
| 43 | <div id="wpforms-builder-help-search-clear" title="<?php esc_attr_e( 'Clear', 'wpforms-lite' ); ?>"> |
| 44 | <?php echo $times_svg; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
| 45 | </div> |
| 46 | </div> |
| 47 | |
| 48 | <div id="wpforms-builder-help-no-result" style="display: none;"> |
| 49 | <ul class="wpforms-builder-help-docs"> |
| 50 | <li> |
| 51 | <i class="fa fa-info-circle"></i><span><?php esc_html_e( 'No docs found', 'wpforms-lite' ); ?></span> |
| 52 | </li> |
| 53 | </ul> |
| 54 | </div> |
| 55 | <div id="wpforms-builder-help-result"></div> |
| 56 | <div id="wpforms-builder-help-categories"></div> |
| 57 | |
| 58 | <div id="wpforms-builder-help-footer"> |
| 59 | |
| 60 | <div class="wpforms-builder-help-footer-block"> |
| 61 | <i class="fa fa-file-text-o"></i> |
| 62 | <h3><?php esc_html_e( 'View Documentation', 'wpforms-lite' ); ?></h3> |
| 63 | <p><?php esc_html_e( 'Browse documentation, reference material, and tutorials for WPForms.', 'wpforms-lite' ); ?></p> |
| 64 | <a href="<?php echo esc_url( wpforms_utm_link( $settings['docs_url'], $links_utm_medium, 'View Documentation' ) ); ?>" |
| 65 | class="wpforms-btn wpforms-btn-md wpforms-btn-light-grey" |
| 66 | rel="noopener noreferrer" |
| 67 | target="_blank"> |
| 68 | <?php esc_html_e( 'View All Documentation', 'wpforms-lite' ); ?> |
| 69 | </a> |
| 70 | </div> |
| 71 | |
| 72 | <div class="wpforms-builder-help-footer-block"> |
| 73 | <i class="fa fa-support"></i> |
| 74 | <h3><?php esc_html_e( 'Get Support', 'wpforms-lite' ); ?></h3> |
| 75 | |
| 76 | <?php if ( wpforms()->is_pro() ) { ?> |
| 77 | <p><?php esc_html_e( 'Submit a ticket and our world class support team will be in touch soon.', 'wpforms-lite' ); ?></p> |
| 78 | <a href="<?php echo esc_url( wpforms_utm_link( $settings['support_ticket_url'], $links_utm_medium, 'Contact Support' ) ); ?>" |
| 79 | class="wpforms-btn wpforms-btn-md wpforms-btn-light-grey" |
| 80 | rel="noopener noreferrer" |
| 81 | target="_blank"> |
| 82 | <?php esc_html_e( 'Submit a Support Ticket', 'wpforms-lite' ); ?> |
| 83 | </a> |
| 84 | |
| 85 | <?php } else { ?> |
| 86 | <p><?php esc_html_e( 'Upgrade to WPForms Pro to access our world class customer support.', 'wpforms-lite' ); ?></p> |
| 87 | <a href="<?php echo esc_url( wpforms_utm_link( $settings['upgrade_url'], $links_utm_medium, 'Upgrade For Support' ) ); ?>" |
| 88 | class="wpforms-btn wpforms-btn-md wpforms-btn-orange" |
| 89 | rel="noopener noreferrer" |
| 90 | target="_blank"> |
| 91 | <?php esc_html_e( 'Upgrade to WPForms Pro', 'wpforms-lite' ); ?> |
| 92 | </a> |
| 93 | |
| 94 | <?php } ?> |
| 95 | </div> |
| 96 | |
| 97 | </div> |
| 98 | </div> |
| 99 | </div> |
| 100 | |
| 101 | <script type="text/html" id="tmpl-wpforms-builder-help-categories"> |
| 102 | <ul class="wpforms-builder-help-categories-toggle"> |
| 103 | <# _.each( data.categories, function( categoryTitle, categorySlug ) { #> |
| 104 | <li class="wpforms-builder-help-category"> |
| 105 | <header> |
| 106 | <i class="fa fa-folder-open-o wpforms-folder"></i> |
| 107 | <span>{{{ categoryTitle }}}</span> |
| 108 | <i class="fa fa-angle-right wpforms-arrow"></i> |
| 109 | </header> |
| 110 | <ul class="wpforms-builder-help-docs" style="display: none;"> |
| 111 | <# _.each( data.docs[ categorySlug ], function( doc, index ) { |
| 112 | utmContent = encodeURIComponent( doc.title ); #> |
| 113 | <li> |
| 114 | <i class="fa fa-file-text-o"></i><a href="{{ doc.url }}<?php echo esc_url( $url_parameters ); ?>={{ utmContent }}" rel="noopener noreferrer" target="_blank">{{{ doc.title }}}</a> |
| 115 | </li> |
| 116 | <# if ( index === 4 && data.docs[ categorySlug ].length > 4 ) { #> |
| 117 | <div style="display: none;"> |
| 118 | <# } #> |
| 119 | <# } ) #> |
| 120 | <# if ( data.docs[ categorySlug ].length > 4 ) { #> |
| 121 | </div> |
| 122 | <button class="wpforms-btn wpforms-btn-md wpforms-btn-light-grey viewall" type="button"><?php esc_html_e( 'View All', 'wpforms-lite' ); ?> {{{ categoryTitle }}} <?php esc_html_e( 'Docs', 'wpforms-lite' ); ?></button> |
| 123 | <# } #> |
| 124 | </ul> |
| 125 | </li> |
| 126 | <# } ) #> |
| 127 | </ul> |
| 128 | </script> |
| 129 | |
| 130 | <script type="text/html" id="tmpl-wpforms-builder-help-categories-error"> |
| 131 | <h4 class="wpforms-builder-help-error"> |
| 132 | <?php esc_html_e( 'Unfortunately the error occurred while downloading help data.', 'wpforms-lite' ); ?> |
| 133 | </h4> |
| 134 | </script> |
| 135 | |
| 136 | <script type="text/html" id="tmpl-wpforms-builder-help-docs"> |
| 137 | <ul class="wpforms-builder-help-docs"> |
| 138 | <# _.each( data.docs, function( doc, index ) { |
| 139 | utmContent = encodeURIComponent( doc.title ); #> |
| 140 | <li> |
| 141 | <i class="fa fa-file-text-o"></i><a href="{{ doc.url }}<?php echo esc_url( $url_parameters ); ?>={{ utmContent }}" rel="noopener noreferrer" target="_blank">{{{ doc.title }}}</a> |
| 142 | </li> |
| 143 | <# } ) #> |
| 144 | </ul> |
| 145 | </script> |
| 146 |