admin.php
135 lines
| 1 | <div class="wrap siteorigin-installer-wrap"> |
| 2 | <div class="siteorigin-installer-header"> |
| 3 | <h1 class="siteorigin-logo"> |
| 4 | <img src="<?php echo esc_url( plugin_dir_url( __FILE__ ) ) . '../img/siteorigin.svg'; ?>" /> |
| 5 | <?php esc_html_e( 'SiteOrigin Installer', 'so-css' ); ?> |
| 6 | </h1> |
| 7 | |
| 8 | <ul class="page-sections"> |
| 9 | <li><a href="#" data-section="plugins"><?php esc_html_e( 'Plugins', 'so-css' ); ?></a></li> |
| 10 | <li><a href="#" data-section="themes"><?php esc_html_e( 'Themes', 'so-css' ); ?></a></li> |
| 11 | <li class="active-section"><a href="#" data-section="all"><?php esc_html_e( 'All', 'so-css' ); ?></a></li> |
| 12 | </ul> |
| 13 | </div> |
| 14 | |
| 15 | <ul class="siteorigin-products"> |
| 16 | <?php |
| 17 | foreach ( $products as $slug => $item ) { |
| 18 | $classes = array(); |
| 19 | $classes[] = $slug == 'siteorigin-premium' || empty( $item['status'] ) ? 'active' : 'inactive'; |
| 20 | |
| 21 | if ( ! empty( $highlight ) && $slug == $highlight ) { |
| 22 | $classes[] = 'highlight-item'; |
| 23 | } |
| 24 | ?> |
| 25 | <li class="siteorigin-installer-item siteorigin-<?php echo esc_attr( $item['type'] ); ?> siteorigin-installer-item-<?php echo sanitize_html_class( implode( ' ', $classes ) ); ?>"> |
| 26 | <div |
| 27 | class="siteorigin-installer-item-body" |
| 28 | data-slug="<?php echo esc_attr( $slug ); ?>" |
| 29 | data-version="<?php echo esc_attr( $item['version'] ); ?>" |
| 30 | > |
| 31 | <?php if ( ! empty( $item['screenshot'] ) ) { ?> |
| 32 | <img class="siteorigin-installer-item-banner" src="<?php echo esc_url( $item['screenshot'] ); ?>" /> |
| 33 | <?php } ?> |
| 34 | |
| 35 | <div class="siteorigin-product-content"> |
| 36 | |
| 37 | <h3> |
| 38 | <?php echo esc_html( $item['name'] ); ?> |
| 39 | </h3> |
| 40 | <p class="so-description"> |
| 41 | <?php |
| 42 | if ( ! empty( $highlight ) && $slug == $highlight ) { |
| 43 | echo '<span class="siteorigin-required">'; |
| 44 | printf( |
| 45 | esc_html__( 'Required %s', 'so-css' ), |
| 46 | $item['type'] == 'plugins' ? esc_html__( 'Plugin', 'so-css' ) : esc_html__( 'Theme', 'so-css' ) |
| 47 | ); |
| 48 | echo '</span>'; |
| 49 | } |
| 50 | echo esc_html( $item['description'] ); |
| 51 | ?> |
| 52 | </p> |
| 53 | |
| 54 | <div class="so-type-indicator"> |
| 55 | <?php |
| 56 | if ( $item['type'] == 'plugins' ) { |
| 57 | esc_html_e( 'Plugin', 'so-css' ); |
| 58 | } else { |
| 59 | esc_html_e( 'Theme', 'so-css' ); |
| 60 | } |
| 61 | ?> |
| 62 | </div> |
| 63 | |
| 64 | <div class="so-buttons <?php |
| 65 | echo $slug != 'siteorigin-premium' && ! empty( $item['status'] ) && ! empty( $item['update'] ) ? 'so-buttons-force-wrap' : ''; ?>"> |
| 66 | <?php |
| 67 | if ( |
| 68 | $slug == 'siteorigin-premium' || |
| 69 | ! empty( $item['status'] ) || |
| 70 | ! empty( $item['update'] ) || |
| 71 | $item['type'] == 'themes' |
| 72 | ) { |
| 73 | $text = ''; |
| 74 | if ( ! empty( $item['status'] ) || $item['type'] == 'themes' ) { |
| 75 | if ( $item['status'] == 'install' ) { |
| 76 | |
| 77 | |
| 78 | if ( $slug == 'siteorigin-premium' ) { |
| 79 | $premium_url = 'https://siteorigin.com/downloads/premium/'; |
| 80 | $affiliate_id = apply_filters( 'siteorigin_premium_affiliate_id', '' ); |
| 81 | if ( $affiliate_id && is_numeric( $affiliate_id ) ) { |
| 82 | $premium_url = add_query_arg( 'ref', urlencode( $affiliate_id ), $premium_url ); |
| 83 | } |
| 84 | ?> |
| 85 | <a href="<?php echo esc_url( $premium_url ); ?>" target="_blank" rel="noopener noreferrer" class="button-primary"> |
| 86 | <?php esc_html_e( 'Get SiteOrigin Premium', 'so-css' ); ?> |
| 87 | </a> |
| 88 | <?php |
| 89 | } else { |
| 90 | |
| 91 | $text = __( 'Install', 'so-css' ); |
| 92 | } |
| 93 | } else { |
| 94 | $text = __( 'Activate', 'so-css' ); |
| 95 | } |
| 96 | |
| 97 | if ( ! empty( $text ) ) { |
| 98 | require 'action-btn.php'; |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | if ( ! empty( $item['update'] ) ) { |
| 103 | $text = __( 'Update', 'so-css' ); |
| 104 | $item['status'] = 'update'; |
| 105 | require 'action-btn.php'; |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | |
| 110 | if ( |
| 111 | $item['type'] == 'themes' && |
| 112 | ! empty( $item['demo'] ) |
| 113 | ) { |
| 114 | ?> |
| 115 | <a href="<?php echo esc_url( $item['demo'] ); ?>" target="_blank" rel="noopener noreferrer" class="siteorigin-demo"> |
| 116 | <?php esc_html_e( 'Demo', 'so-css' ); ?> |
| 117 | </a> |
| 118 | <?php } ?> |
| 119 | |
| 120 | <?php if ( ! empty( $item['documentation'] ) ) { ?> |
| 121 | <a href="<?php echo esc_url( $item['documentation'] ); ?>" target="_blank" rel="noopener noreferrer" class="siteorigin-docs"> |
| 122 | <?php esc_html_e( 'Documentation', 'so-css' ); ?> |
| 123 | </a> |
| 124 | <?php } ?> |
| 125 | </div> |
| 126 | </div> |
| 127 | </div> |
| 128 | </li> |
| 129 | <?php |
| 130 | } |
| 131 | ?> |
| 132 | </ul> |
| 133 | |
| 134 | </div> |
| 135 |