final-integration-form-delete.php
6 years ago
migrate-dismiss-confirmation.php
6 years ago
modal-integration.php
5 years ago
modal-migrate-aweber.php
5 years ago
modal-migrate-ctct.php
6 years ago
modal-preview.php
5 years ago
remove-active-integration.php
6 years ago
modal-preview.php
124 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Module's preview container. |
| 4 | * |
| 5 | * @package Hustle |
| 6 | * @since 4.3.1 |
| 7 | */ |
| 8 | |
| 9 | $url = add_query_arg( |
| 10 | array( |
| 11 | 'hustle_preview' => 1, |
| 12 | 'preview' => 1, |
| 13 | ), |
| 14 | site_url() |
| 15 | ); |
| 16 | /** |
| 17 | * Filters the URL to be used for the preview. |
| 18 | * |
| 19 | * @since 4.3.1 |
| 20 | */ |
| 21 | $url = apply_filters( 'hustle_preview_url', $url ); |
| 22 | |
| 23 | ob_start(); |
| 24 | ?> |
| 25 | |
| 26 | <div class="hui-preview"> |
| 27 | |
| 28 | <button |
| 29 | class="sui-button-icon hustle-modal-close sui-tooltip sui-tooltip-bottom" |
| 30 | data-tooltip="<?php esc_html_e( 'Close', 'hustle' ); ?>" |
| 31 | data-modal-close |
| 32 | > |
| 33 | <span class="sui-icon-close sui-md" aria-hidden="true"></span> |
| 34 | <span class="sui-screen-reader-text"><?php esc_html_e( 'Close this dialog window', 'hustle' ); ?></span> |
| 35 | </button> |
| 36 | |
| 37 | <div class="hui-preview-header"> |
| 38 | |
| 39 | <div class="hui-left"> |
| 40 | |
| 41 | <h3 id="hustle-dialog--preview-title" class="hui-preview-title"><?php esc_html_e( 'Preview', 'hustle' ); ?></h3> |
| 42 | |
| 43 | <p id="hustle-dialog--preview-description" class="hui-preview-description"></p> |
| 44 | |
| 45 | </div> |
| 46 | |
| 47 | <div class="hui-center"> |
| 48 | <button |
| 49 | class="hustle-preview-device-button hui-preview-button-left sui-tooltip sui-tooltip-bottom sui-active" |
| 50 | aria-label="<?php esc_html_e( 'Preview on desktop', 'hustle' ); ?>" |
| 51 | data-device="desktop" |
| 52 | data-selected="<?php esc_html_e( 'Desktop preview enabled', 'hustle' ); ?>" |
| 53 | data-tooltip="<?php esc_html_e( 'Desktop', 'hustle' ); ?>" |
| 54 | > |
| 55 | <svg width="16" height="16" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true"><defs><path id="a" d="M0 0h16v16H0z"/></defs><g fill="none" fill-rule="evenodd"><path d="M11.234 15a.246.246 0 00.188-.085.313.313 0 00.078-.22v-.324a.313.313 0 00-.078-.22.246.246 0 00-.188-.085h-1.5V12.45h5.282c.27 0 .502-.104.695-.314.16-.174.254-.379.281-.612L16 11.38v-9.31c0-.295-.096-.547-.29-.757A.912.912 0 0015.017 1H.984a.912.912 0 00-.695.314C.096 1.524 0 1.776 0 2.07v9.311c0 .295.096.544.29.748a.923.923 0 00.694.305h5.282v1.632H4.625a.27.27 0 00-.195.084.297.297 0 00-.086.221v.323a.297.297 0 00.21.297l.071.009h6.61zm3.016-4.451H1.75V2.886h12.5v7.663z" fill="#888" fill-rule="nonzero"/></g></svg> |
| 56 | <span class="sui-screen-reader-text"><?php esc_html_e( 'Preview on desktop', 'hustle' ); ?></span> |
| 57 | </button> |
| 58 | <button |
| 59 | class="hustle-preview-device-button hui-preview-button-right sui-tooltip sui-tooltip-bottom" |
| 60 | aria-label="<?php esc_html_e( 'Preview on mobile', 'hustle' ); ?>" |
| 61 | data-device="mobile" |
| 62 | data-selected="<?php esc_html_e( 'Mobile preview enabled', 'hustle' ); ?>" |
| 63 | data-tooltip="<?php esc_html_e( 'Mobile', 'hustle' ); ?>" |
| 64 | > |
| 65 | <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" aria-hidden="true"><defs><path id="a" d="M0 0h16v16H0z"/></defs><g fill="none" fill-rule="evenodd"><path fill="#888" fill-rule="nonzero" d="M13.42 16a.57.57 0 00.58-.578V.578A.57.57 0 0013.42 0H2.547A.57.57 0 002 .563v14.874a.57.57 0 00.548.563H13.42zm-1.355-1.86H3.919V1.86h8.146v12.28zm-4.081 1.391a.464.464 0 01-.347-.14.455.455 0 01-.137-.329c0-.124.046-.234.137-.328a.464.464 0 01.347-.14c.129 0 .24.047.33.14a.455.455 0 01.138.329.455.455 0 01-.137.328.445.445 0 01-.331.14z"/></g></svg> |
| 66 | <span class="sui-screen-reader-text"><?php esc_html_e( 'Preview on mobile', 'hustle' ); ?></span> |
| 67 | </button> |
| 68 | </div> |
| 69 | |
| 70 | <div tabindex="-1" class="hui-right"> |
| 71 | <button |
| 72 | id="hustle-preview-reload-module-button" |
| 73 | class="sui-button-icon sui-tooltip sui-tooltip-bottom" |
| 74 | aria-label="<?php esc_html_e( 'Reload Preview', 'hustle' ); ?>" |
| 75 | data-tooltip="<?php esc_html_e( 'Reload', 'hustle' ); ?>" |
| 76 | > |
| 77 | <span class="sui-icon-refresh sui-md" aria-hidden="true"></span> |
| 78 | <span class="sui-screen-reader-text"><?php esc_html_e( 'Reload Preview', 'hustle' ); ?></span> |
| 79 | </button> |
| 80 | <span class="hui-button-space" aria-hidden="true"></span> |
| 81 | </div> |
| 82 | |
| 83 | </div> |
| 84 | |
| 85 | <div class="hui-preview-body"> |
| 86 | |
| 87 | <div id="hustle-preview-loader" class="hui-preview-loader"> |
| 88 | <span class="sui-icon-loader sui-loading" aria-hidden="true"></span> |
| 89 | </div> |
| 90 | |
| 91 | <div id="hustle-preview-iframe-container" class="hui-preview-iframe" style="display: none;" aria-hidden="true"> |
| 92 | <p id="hustle-sr-text-preview-selected-device" role="alert" class="sui-screen-reader-text" aria-live="polite"></p> |
| 93 | |
| 94 | <?php /* translators: Module type capitalized in singular, "Module" when used in the Dashboard page */ ?> |
| 95 | <p id="hustle-sr-text-preview-loaded" role="alert" class="sui-screen-reader-text" aria-live="polite"><?php printf( esc_html__( '%s preview finished loading.', 'hustle' ), esc_html( $module_type ) ); ?></p> |
| 96 | |
| 97 | <iframe |
| 98 | id="hustle-preview-iframe" |
| 99 | title="<?php esc_html_e( 'A preview of your module', 'hustle' ); ?>" |
| 100 | data-src="<?php echo esc_url( $url ); ?>" |
| 101 | sandbox="allow-same-origin allow-scripts" |
| 102 | ></iframe> |
| 103 | </div> |
| 104 | |
| 105 | </div> |
| 106 | |
| 107 | </div> |
| 108 | |
| 109 | <?php |
| 110 | $content = ob_get_clean(); |
| 111 | |
| 112 | $attributes = array( |
| 113 | 'modal_id' => 'preview', |
| 114 | 'modal_class' => 'hui-modal-preview', |
| 115 | 'modal_size' => '', |
| 116 | 'no_wrapper' => true, |
| 117 | 'has_description' => true, |
| 118 | 'body' => array( |
| 119 | 'content' => $content, |
| 120 | ), |
| 121 | ); |
| 122 | |
| 123 | $this->render_modal( $attributes ); |
| 124 |