php
10 months ago
channel-selector.php
5 years ago
downloads-list-compact.php
3 years ago
downloads-list.php
1 year ago
products-compact.php
1 month ago
repository-end-users.php
5 years ago
repository-expired.php
4 years ago
repository-legacy-free.php
1 year ago
repository-listing.php
2 years ago
repository-refunded.php
5 years ago
repository-register.php
1 month ago
repository-registered-buttons.php
3 years ago
repository-registered.php
1 month ago
products-compact.php
146 lines
| 1 | <h3><?php echo $args['box_title'] ?></h3> |
| 2 | |
| 3 | <?php |
| 4 | if(empty($args['repository']) || empty($args['package']) || empty($args['product'])){ |
| 5 | echo __('Incorrect setup', 'installer'); |
| 6 | return; |
| 7 | } |
| 8 | |
| 9 | $product = false; |
| 10 | foreach($this->settings['repositories'][$repository_id]['data']['packages'] as $package_idx => $package){ |
| 11 | |
| 12 | if(!isset($package['id'])){ |
| 13 | $package['id'] = sanitize_title_with_dashes($package['name']); |
| 14 | } |
| 15 | |
| 16 | if($package['id'] == $args['package']){ |
| 17 | $product = $this->settings['repositories'][$repository_id]['data']['packages'][$package_idx]['products'][$args['product']]; |
| 18 | break; |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | |
| 23 | if(!$product){ |
| 24 | echo __('Invalid product', 'installer'); |
| 25 | return; |
| 26 | } |
| 27 | |
| 28 | if(isset($this->settings['repositories'][$repository_id])){ |
| 29 | if(isset($this->settings['repositories'][$repository_id]['subscription']['key'])){ |
| 30 | $site_key = $this->settings['repositories'][$repository_id]['subscription']['key']; |
| 31 | }else{ |
| 32 | $site_key = false; |
| 33 | } |
| 34 | }else{ |
| 35 | echo __('Unknown repository', 'installer'); |
| 36 | return; |
| 37 | } |
| 38 | |
| 39 | $subscription_type = $this->get_subscription_type_for_repository($repository_id); |
| 40 | $expired = false; |
| 41 | |
| 42 | if($subscription_type != $product['subscription_type'] && !$this->have_superior_subscription($subscription_type, $product) && $site_key){ |
| 43 | $subscription_no_match = sprintf(__(' Your current site key (%s) does not match the selected product (%s).', 'installer'), $site_key, $product['name']); |
| 44 | } |
| 45 | |
| 46 | if(!isset($args['product_name'])) $args['product_name'] = $product['name']; |
| 47 | |
| 48 | ?> |
| 49 | |
| 50 | <div class="otgs_wp_installer_table otgs_wp_installer_table_compact"> |
| 51 | |
| 52 | <p><?php echo $args['box_description'] ?></p> |
| 53 | |
| 54 | |
| 55 | <?php if(!$this->repository_has_subscription($repository_id) || !empty($subscription_no_match)): ?> |
| 56 | |
| 57 | <?php if(!empty($subscription_no_match)): ?> |
| 58 | <div class="installer-warn-box"> |
| 59 | <?php echo $subscription_no_match; ?> |
| 60 | </div> |
| 61 | <br /> |
| 62 | <?php endif; ?> |
| 63 | |
| 64 | <a class="button-primary" href="<?php echo $this->append_parameters_to_buy_url($product['url'], $repository_id, $args) ?>"><?php printf(__('Buy %s', 'installer'), $args['product_name']) ?></a> |
| 65 | |
| 66 | <div> |
| 67 | <br /> |
| 68 | <?php printf(__('Already bought %s?', 'installer'), $args['product_name']) ?> |
| 69 | <a class="enter_site_key_js<?php if( WP_Installer::get_repository_hardcoded_site_key( $repository_id ) ): ?> disabled<?php endif ?>" href="#" |
| 70 | <?php if( WP_Installer::get_repository_hardcoded_site_key( $repository_id ) ): ?> |
| 71 | style="cursor: help" |
| 72 | disabled="disabled" |
| 73 | title="<?php printf( esc_attr__("Site-key was set by %s, most likely in wp-config.php. Please remove the constant before attempting to register.", 'installer'), 'OTGS_INSTALLER_SITE_KEY_' . strtoupper($repository_id) ) ?>" |
| 74 | <?php endif; ?> |
| 75 | > |
| 76 | <?php _e('Enter site key', 'installer') ?> |
| 77 | </a> |
| 78 | |
| 79 | <form class="otgsi_site_key_form" method="post"> |
| 80 | <input type="hidden" name="action" value="save_site_key" /> |
| 81 | <input type="hidden" name="nonce" value="<?php echo wp_create_nonce('save_site_key_' . $repository_id) ?>" /> |
| 82 | <input type="hidden" name="repository_id" value="<?php echo $repository_id ?>"> |
| 83 | <input type="text" size="10" name="site_key_<?php echo $repository_id ?>" /> |
| 84 | <input class="button-secondary" type="submit" value="<?php esc_attr_e('Add', 'installer') ?>" /> |
| 85 | </form> |
| 86 | <div class="installer-error-box hidden" style="margin-top:10px;"></div> |
| 87 | </div> |
| 88 | |
| 89 | <?php else: ?> |
| 90 | |
| 91 | <?php if($this->repository_has_expired_subscription($repository_id)): $expired = true; ?> |
| 92 | |
| 93 | <div><p class="installer-warn-box"><?php _e('Subscription is expired.', 'installer') ?></p></div> |
| 94 | |
| 95 | <?php else: ?> |
| 96 | |
| 97 | <?php if($this->show_subscription_renew_warning($repository_id, $subscription_type)): ?> |
| 98 | |
| 99 | <ul class="installer-products-list"> |
| 100 | <?php foreach($product['renewals'] as $renewal): ?> |
| 101 | <li> |
| 102 | <a href="<?php echo $this->append_parameters_to_buy_url($renewal['url'], $repository_id, $args) ?>"><?php printf(__('Renew %s', 'installer'), $args['product_name']) ?></a> |
| 103 | </li> |
| 104 | <?php endforeach; ?> |
| 105 | </ul> |
| 106 | |
| 107 | <?php endif; ?> |
| 108 | |
| 109 | <?php endif; ?> |
| 110 | |
| 111 | <center> |
| 112 | <a class="remove_site_key_js" href="#" data-repository=<?php echo $repository_id ?> |
| 113 | data-confirmation="<?php esc_attr_e('Are you sure you want to remove this site key?', 'installer') ?>" |
| 114 | data-nonce="<?php echo wp_create_nonce('remove_site_key_' . $repository_id) ?>" |
| 115 | <?php if( WP_Installer::get_repository_hardcoded_site_key( $repository_id ) ): ?> |
| 116 | style="cursor: help;color:#999999" |
| 117 | disabled="disabled" |
| 118 | title="<?php printf( esc_attr__("Site-key was set by %s, most likely in wp-config.php. Please remove the constant before attempting to unregister.", 'installer'), 'OTGS_INSTALLER_SITE_KEY_' . strtoupper($repository_id) ) ?>" |
| 119 | <?php endif; ?> |
| 120 | > |
| 121 | <?php printf(__("Remove current site key (%s)", 'installer'), $site_key) ?> |
| 122 | </a> |
| 123 | </center> |
| 124 | <br /> |
| 125 | |
| 126 | <?php include $this->plugin_path() . '/templates/downloads-list-compact.php'; ?> |
| 127 | |
| 128 | |
| 129 | |
| 130 | <?php endif; ?> |
| 131 | |
| 132 | <?php |
| 133 | if( isset( $args[ 'name' ] ) ): |
| 134 | $support_link = $this->get_support_tag_by_name($args['name'], $args['repository']); ?> |
| 135 | |
| 136 | <?php if($support_link): ?> |
| 137 | <p><a href="<?php echo $support_link ?>" target="_blank"><?php printf(__('%s support on wpml.org', 'installer'), $args['name'] ) ?></a></p> |
| 138 | |
| 139 | <?php endif; ?> |
| 140 | <?php |
| 141 | elseif( isset( $args[ 'support_link' ] ) ): ?> |
| 142 | <p><?php echo $args[ 'support_link' ]; ?></p> |
| 143 | <?php endif; ?> |
| 144 | |
| 145 | </div> |
| 146 |