PageRenderTime 41ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-content/plugins/sitepress-multilingual-cms/inc/installer/templates/products-compact.php

https://bitbucket.org/acipriani/madeinapulia.com
PHP | 115 lines | 82 code | 32 blank | 1 comment | 18 complexity | f0a2287a9161249d2a55e73b296b7e29 MD5 | raw file
Possible License(s): GPL-3.0, MIT, BSD-3-Clause, LGPL-2.1, GPL-2.0, Apache-2.0
  1. <h3><?php echo $args['box_title'] ?></h3>
  2. <?php
  3. if(empty($args['repository']) || empty($args['package']) || empty($args['product'])){
  4. echo __('Incorrect setup', 'installer');
  5. return;
  6. }
  7. if(isset($this->settings['repositories'][$repository_id]['data']['packages'][$args['package']]['products'][$args['product']])){
  8. $product = $this->settings['repositories'][$repository_id]['data']['packages'][$args['package']]['products'][$args['product']];
  9. }else{
  10. echo __('Invalid product', 'installer');
  11. return;
  12. }
  13. if(isset($this->settings['repositories'][$repository_id])){
  14. if(isset($this->settings['repositories'][$repository_id]['subscription']['key'])){
  15. $site_key = $this->settings['repositories'][$repository_id]['subscription']['key'];
  16. }else{
  17. $site_key = false;
  18. }
  19. }else{
  20. echo __('Unknonw repository', 'installer');
  21. return;
  22. }
  23. $subscription_type = $this->get_subscription_type_for_repository($repository_id);
  24. $expired = false;
  25. if($subscription_type != $product['subscription_type'] && !$this->have_supperior_subscription($subscription_type, $product) && $site_key){
  26. $subscription_no_match = sprintf(__(' Your current site key (%s) does not match the selected product (%s).', 'installer'), $site_key, $product['name']);
  27. }
  28. if(!isset($args['product_name'])) $args['product_name'] = $product['name'];
  29. ?>
  30. <div class="otgs_wp_installer_table otgs_wp_installer_table_compact">
  31. <p><?php echo $args['box_description'] ?></p>
  32. <?php if(!$this->repository_has_subscription($repository_id) || !empty($subscription_no_match)): ?>
  33. <?php if(!empty($subscription_no_match)): ?>
  34. <div class="installer-warn-box">
  35. <?php echo $subscription_no_match; ?>
  36. </div>
  37. <br />
  38. <?php endif; ?>
  39. <a class="button-primary" href="<?php echo $this->append_parameters_to_buy_url($product['url']) ?>"><?php printf(__('Buy %s', 'installer'), $args['product_name']) ?></a>
  40. <div>
  41. <br />
  42. <?php printf(__('Already bought %s?', 'installer'), $args['product_name']) ?>
  43. <a class="enter_site_key_js" href="#"><?php _e('Enter site key', 'installer') ?></a>&nbsp;&nbsp;
  44. <form class="otgsi_site_key_form" method="post">
  45. <input type="hidden" name="action" value="save_site_key" />
  46. <input type="hidden" name="nonce" value="<?php echo wp_create_nonce('save_site_key_' . $repository_id) ?>" />
  47. <input type="hidden" name="repository_id" value="<?php echo $repository_id ?>">
  48. <input type="text" size="10" name="site_key_<?php echo $repository_id ?>" />
  49. <input class="button-secondary" type="submit" value="<?php esc_attr_e('Add', 'installer') ?>" />
  50. </form>
  51. </div>
  52. <?php else: ?>
  53. <?php if($this->repository_has_expired_subscription($repository_id)): $expired = true; ?>
  54. <div><p class="installer-warn-box"><?php _e('Subscription is expired.', 'installer') ?></p></div>
  55. <?php else: ?>
  56. <?php if($this->show_subscription_renew_warning($repository_id, $subscription_type)): ?>
  57. <ul class="installer-products-list">
  58. <?php foreach($product['renewals'] as $renewal): ?>
  59. <li>
  60. <a href="<?php echo $this->append_parameters_to_buy_url($renewal['url']) ?>"><?php printf(__('Renew %s', 'installer'), $args['product_name']) ?></a>
  61. </li>
  62. <?php endforeach; ?>
  63. </ul>
  64. <?php endif; ?>
  65. <?php endif; ?>
  66. <center>
  67. <a class="remove_site_key_js" href="#" data-repository=<?php echo $repository_id ?> data-confirmation="<?php esc_attr_e('Are you sure you want to remove this site key?', 'installer') ?>" data-nonce="<?php echo wp_create_nonce('remove_site_key_' . $repository_id) ?>"><?php printf(__("Remove current site key (%s)", 'installer'), $site_key) ?></a>
  68. </center>
  69. <br />
  70. <?php include $this->plugin_path() . '/templates/downloads-list-compact.php'; ?>
  71. <?php endif; ?>
  72. <?php
  73. if( isset( $args[ 'name' ] ) ):
  74. $support_link = $this->get_support_tag_by_name($args['name'], $args['repository']); ?>
  75. <?php if($support_link): ?>
  76. <p><a href="<?php echo $support_link ?>" target="_blank"><?php printf(__('%s support on wpml.org', 'installer'), $args['name'] ) ?></a></p>
  77. <?php endif; ?>
  78. <?php
  79. // compatibility for installer 1.1
  80. elseif( isset( $args[ 'support_link' ] ) ): ?>
  81. <p><?php echo $args[ 'support_link' ]; ?></p>
  82. <?php endif; ?>
  83. </div>