]> _ Git - physioassist-wordpress.git/blob
f02b8342bd73d5dbb1e7af2f9312567e9566a40e
[physioassist-wordpress.git] /
1 <?php if((!$this->repository_has_subscription($repository_id) && $match = $this->get_matching_cp($repository)) && $match['exp']): ?>
2 <p class="alignright installer_highlight"><strong><?php printf('Price offers available until %s', date_i18n(get_option( 'date_format' ), $match['exp'])) ?></strong></p>
3 <?php endif; ?>
4
5 <h3 id="repository-<?php echo $repository_id ?>"><?php echo $repository['data']['name'] ?></h3>
6 <?php
7 $getWhenSubscriptionExpires = function ( $repository ) { return $repository['subscription']['data']->expires; };
8 $model                      = (object) [
9         'repoId'                => $repository_id,
10         'productName'           => $repository['data']['product-name'],
11         'productUrl'            => $repository['data']['url'],
12         'siteUrl'               => $this->get_installer_site_url( $repository_id ),
13         'siteKeysManagementUrl' => $repository['data']['site_keys_management_url'],
14         'updateSiteKeyNonce'    => wp_create_nonce( 'update_site_key_' . $repository_id ),
15         'saveSiteKeyNonce'      => wp_create_nonce( 'save_site_key_' . $repository_id ),
16         'removeSiteKeyNonce'    => wp_create_nonce( 'remove_site_key_' . $repository_id ),
17         'findAccountNonce'      => wp_create_nonce( 'find_account_' . $repository_id ),
18         'whenExpires'           => \OTGS\Installer\FP\partial( $getWhenSubscriptionExpires, $repository ),
19         'expired'               => false,
20         'siteKey'               => WP_Installer_API::get_site_key( $repository_id ),
21         'endUserRenewalUrl'     => $this->get_end_user_renewal_url( $repository_id ),
22 ];
23 ?>
24 <table class="widefat otgs_wp_installer_table" id="installer_repo_<?php echo $repository_id ?>">
25
26     <tr>
27         <td class="otgsi_register_product_wrap" colspan="2">
28                 <?php
29                         if ( ! $this->repository_has_subscription( $repository_id ) ) {
30                                 \OTGS\Installer\Templates\Repository\Register::render( $model );
31                                 $site_key = false;
32                         } else {
33                                 $site_key          = $repository['subscription']['key'];
34                                 $subscription_type = $this->get_subscription_type_for_repository( $repository_id );
35                                 $upgrade_options   = $this->get_upgrade_options( $repository_id );
36
37                                 if ( $this->repository_has_expired_subscription( $repository_id ) ) {
38                                         $model->expired = true;
39                                         \OTGS\Installer\Templates\Repository\Expired::render( $model );
40                                 } else if ( $this->repository_has_refunded_subscription( $repository_id ) ) {
41                                         $model->expired = true;
42                                         $model->shouldDisplayUnregisterLink = $this->should_display_unregister_link_on_refund_notice();
43                                         \OTGS\Installer\Templates\Repository\Refunded::render( $model );
44                                 } else {
45                                         $this->show_subscription_renew_warning( $repository_id, $subscription_type );
46                                         \OTGS\Installer\Templates\Repository\Registered::render( $model );
47                                 }
48
49                         }
50                         ?>
51
52             <div class="installer-error-box hidden"></div>
53
54         </td>
55     </tr>
56
57     <?php
58
59     $subscription_type = isset($subscription_type) ? $subscription_type : null;
60     $upgrade_options = isset($upgrade_options) ? $upgrade_options : null;
61     $packages = $this->_render_product_packages($repository['data']['packages'], $subscription_type, $model->expired, $upgrade_options, $repository_id);
62     if(empty($subscription_type) || $model->expired){
63         $subpackages_expandable = true;
64     }else{
65         $subpackages_expandable = false;
66     }
67
68     ?>
69
70     <?php foreach($packages as $package): ?>
71     <tr id="repository-<?php echo $repository_id ?>_<?php echo $package['id'] ?>">
72         <td class="installer-repository-image"><img width="140" src="<?php echo $package['image_url'] ?>" /></td>
73                 <?php if ( ! $model->expired ): ?>
74                         <td>
75                                 <p><strong><?php echo $package['name'] ?></strong></p>
76                                 <p><?php echo $package['description'] ?></p>
77
78                                 <?php if($package['products']): ?>
79                                         <?php foreach($package['products'] as $product): ?>
80                                         <ul class="installer-products-list" style="display:inline">
81                                                 <li>
82                                                         <a class="button-secondary" href="<?php echo $product['url'] ?>"><?php echo $product['label'] ?></a>
83                                                 </li>
84                                         </ul>
85                                         <?php endforeach; ?>
86                                 <?php endif; ?>
87
88                                 <?php
89                                 if ( $package['downloads'] ) {
90                                         WP_Installer_Channels()->load_channel_selector( $repository_id, $package['downloads'] );
91                                         include $this->plugin_path() . '/templates/downloads-list.php';
92                                 }
93                                 ?>
94
95                                 <?php if(!empty($package['sub-packages'])): ?>
96
97                                         <?php $subpackages = $this->_render_product_packages($package['sub-packages'], $subscription_type, $model->expired, $upgrade_options, $repository_id); ?>
98
99                                         <?php if($subpackages): ?>
100
101                                         <?php if($subpackages_expandable): ?>
102                                         <h5><a class="installer_expand_button" href="#" title="<?php esc_attr_e('Click to see individual components options.', 'installer') ?>"><?php _e('Individual components', 'installer') ?></a></h5>
103                                         <?php endif; ?>
104
105                                         <table class="otgs_wp_installer_subtable" style="<?php if($subpackages_expandable) echo 'display:none' ?>">
106                                         <?php foreach($subpackages as $package): ?>
107                                                 <tr id="repository-<?php echo $repository_id ?>_<?php echo $package['id'] ?>">
108                                                         <td><img width="70" height="70" src="<?php echo $package['image_url'] ?>" /></td>
109                                                         <td>
110                                                                 <p><strong><?php echo $package['name'] ?></strong></p>
111                                                                 <p><?php echo $package['description'] ?></p>
112
113                                                                 <?php if($package['products']): ?>
114                                                                         <?php foreach($package['products'] as $product): ?>
115                                                                                 <ul class="installer-products-list" style="display:inline">
116                                                                                         <li>
117                                                                                                 <a class="button-secondary" href="<?php echo $product['url'] ?>"><?php echo $product['label'] ?></a>
118                                                                                         </li>
119                                                                                 </ul>
120                                                                         <?php endforeach; ?>
121                                                                 <?php endif; ?>
122
123                                                                 <?php if($package['downloads']): ?>
124                                                                         <?php include $this->plugin_path() . '/templates/downloads-list.php'; ?>
125                                                                 <?php endif; ?>
126                                                         </td>
127                                                 </tr>
128                                         <?php endforeach; ?>
129                                         </table>
130                                         <?php endif; ?>
131
132                                 <?php endif;  ?>
133
134
135                         </td>
136                 <?php endif; ?>
137     </tr>
138
139     <?php endforeach; ?>
140
141 </table>
142
143
144 <p><i><?php printf(__('This page lets you install plugins and update existing plugins. To remove any of these plugins, go to the %splugins%s page and if you have the permission to remove plugins you should be able to do this.', 'installer'), '<a href="' . admin_url('plugins.php') . '">' , '</a>'); ?></i></p>
145
146
147
148 <br />