PluginProbe
ERP: Complete HR, Accounting & CRM Suite Built for WooCommerce / 1.6.9
ERP: Complete HR, Accounting & CRM Suite Built for WooCommerce v1.6.9
1.17.9 1.17.8 1.17.7 1.17.6 1.17.5 1.17.4 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.3.0 1.3.1 1.3.11 1.3.12 1.3.13 1.3.14 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 All 143 releases
erp / includes / framework / settings / license.php

license.php in ERP: Complete HR, Accounting & CRM Suite Built for WooCommerce 1.6.9, at includes/framework/settings/license.php

117 lines 4.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 use WeDevs\ERP\Framework\ERP_Settings_Page;
4
5 /**
6 * Integration class
7 */
8 class ERP_License_Settings extends ERP_Settings_Page {
9
10 /**
11 * Class constructor
12 */
13 public function __construct() {
14 $this->id = 'erp-license';
15 $this->label = __( 'Licenses', 'erp' );
16
17 add_action( 'erp_admin_field_licenses', [ $this, 'integrations' ] );
18 }
19
20 /**
21 * Get settings array.
22 *
23 * @return array
24 */
25 public function get_settings() {
26 $fields = [
27 [
28 'title' => __( 'License Manager', 'erp' ),
29 'desc' => sprintf( __( 'Enter your extension license keys here to receive updates for purchased extensions. Visit <a href="%s" target="_blank">your account</a> page.', 'erp' ), 'https://wperp.com/my-account/' ),
30 'type' => 'title',
31 'id' => 'integration_settings',
32 ],
33
34 [ 'type' => 'licenses' ],
35 [ 'type' => 'sectionend', 'id' => 'script_styling_options' ],
36 ]; // End general settings
37
38 return apply_filters( 'erp_integration_settings', $fields );
39 }
40
41 /**
42 * Display integrations settings.
43 *
44 * @return void
45 */
46 public function integrations() {
47 $licenses = erp_addon_licenses(); ?>
48 <tr valign="top">
49 <td class="erp-settings-table-wrapper" colspan="2">
50 <table class="erp-settings-table widefat" cellspacing="0">
51 <thead>
52 <tr>
53 <?php
54 $columns = apply_filters( 'erp_license_setting_columns', [
55 'name' => __( 'Extension', 'erp' ),
56 'version' => __( 'Version', 'erp' ),
57 'license' => __( 'License Key', 'erp' ),
58 ] );
59
60 foreach ( $columns as $key => $column ) {
61 echo '<th class="erp-settings-table-' . esc_attr( $key ) . '">' . esc_html( $column ) . '</th>';
62 } ?>
63 </tr>
64 </thead>
65 <tbody>
66 <?php
67 foreach ( $licenses as $addon ) {
68 echo '<tr>';
69
70 foreach ( $columns as $key => $column ) {
71 switch ( $key ) {
72 case 'name':
73 echo '<td class="erp-settings-table-' . esc_attr( $key ) . '">
74 <strong>' . esc_html( $addon['name'] ) . '</strong>
75 </td>';
76 break;
77
78 case 'version':
79 echo '<td class="erp-settings-table-' . esc_attr( $key ) . '">
80 ' . esc_html( $addon['version'] ) . '
81 </td>';
82 break;
83
84 case 'license':
85 echo '<td class="erp-settings-table-' . esc_attr( $key ) . '">
86 <input type="text" name="' . esc_attr( $addon['id'] ) . '" value="' . esc_attr( $addon['license'] ) . '" class="regular-text" />';
87 echo wp_kses_post( erp_get_license_status( $addon ) );
88 echo '</td>';
89 break;
90 }
91 }
92 } ?>
93 </tbody>
94 </table>
95 </td>
96 </tr>
97 <style>
98 table.erp-settings-table th.erp-settings-table-name, table.erp-settings-table td.erp-settings-table-name {
99 width: 35%;
100 }
101 </style>
102 <?php
103 }
104
105 /**
106 * Save the settings.
107 *
108 * @param bool $section (optional)
109 *
110 * @return void
111 */
112 public function save( $section = false ) {
113 }
114 }
115
116 return new ERP_License_Settings();
117