Download Monitor - Version 4.5.5

Version Description

Download this release

Release Info

Developer raldea89
Plugin Icon 128x128 Download Monitor
Version 4.5.5
Comparing to
See all releases

Code changes from version 4.5.4 to 4.5.5

Files changed (168) hide show
  1. assets/blocks/src/blocks.js +165 -165
  2. assets/blocks/src/components/DownloadButton/index.js +67 -67
  3. assets/blocks/src/components/DownloadInput/index.js +33 -33
  4. assets/blocks/src/components/TemplateInput/index.js +22 -22
  5. assets/blocks/src/components/VersionInput/index.js +53 -53
  6. assets/css/admin.css +1 -1
  7. assets/css/admin.less +4 -0
  8. assets/css/cart.less +87 -87
  9. assets/css/checkout.less +205 -205
  10. assets/css/frontend.less +198 -198
  11. assets/css/gb-editor.less +10 -10
  12. assets/css/menu.less +76 -76
  13. assets/css/preview.less +18 -18
  14. assets/js/blockui.js +615 -615
  15. assets/js/chosen/chosen.css +413 -413
  16. assets/js/chosen/chosen.jquery.js +1090 -1090
  17. assets/js/chosen/chosen.jquery.min.js +9 -9
  18. assets/js/dlm-uninstall.js +69 -69
  19. assets/js/edit-download.js +2 -0
  20. assets/js/edit-download.min.js +1 -1
  21. assets/js/extensions.js +41 -41
  22. assets/js/insert-download.js +8 -8
  23. assets/js/legacy-upgrader/build/style.css +1 -1
  24. assets/js/legacy-upgrader/package.json +101 -101
  25. assets/js/legacy-upgrader/src/components/app.js +69 -69
  26. assets/js/legacy-upgrader/src/components/content/QueueItem.js +13 -13
  27. assets/js/legacy-upgrader/src/components/content/index.js +149 -149
  28. assets/js/legacy-upgrader/src/components/content/style.less +49 -49
  29. assets/js/legacy-upgrader/src/components/done/index.js +36 -36
  30. assets/js/legacy-upgrader/src/components/done/style.less +5 -5
  31. assets/js/legacy-upgrader/src/components/downloads/QueueItem.js +12 -12
  32. assets/js/legacy-upgrader/src/components/downloads/index.js +145 -145
  33. assets/js/legacy-upgrader/src/components/downloads/style.less +49 -49
  34. assets/js/legacy-upgrader/src/components/welcome/index.js +16 -16
  35. assets/js/legacy-upgrader/src/components/welcome/style.less +5 -5
  36. assets/js/legacy-upgrader/src/config.json +3 -3
  37. assets/js/legacy-upgrader/src/index.ejs +408 -408
  38. assets/js/legacy-upgrader/src/index.js +20 -20
  39. assets/js/legacy-upgrader/src/style/helpers.less +19 -19
  40. assets/js/legacy-upgrader/src/style/index.less +6 -6
  41. assets/js/legacy-upgrader/src/style/mixins.less +18 -18
  42. assets/js/legacy-upgrader/src/style/variables.less +5 -5
  43. assets/js/legacy-upgrader/webpack.config.babel.js +184 -184
  44. assets/js/notices.js +20 -20
  45. assets/js/onboarding.js +69 -69
  46. assets/js/overview-download.js +38 -38
  47. assets/js/select2/select2.min.css +1 -1
  48. assets/js/shop/admin-order-details.js +45 -45
  49. assets/js/shop/checkout.js +127 -127
  50. assets/js/shop/edit-product.js +2 -2
  51. assets/js/upload-file.js +53 -60
  52. assets/js/upload-file.min.js +1 -1
  53. assets/views/meta-box/version.php +1 -1
  54. assets/views/notice-lu-upgrade.php +12 -12
  55. changelog.txt +9 -0
  56. download-monitor.php +2 -2
  57. includes/admin/uninstall/class-dlm-uninstall.php +60 -8
  58. includes/bootstrap.php +45 -45
  59. includes/deprecated.php +37 -37
  60. includes/download-functions.php +15 -15
  61. includes/installer-functions.php +91 -91
  62. includes/php-too-low.php +43 -43
  63. readme.txt +1 -1
  64. src/Admin/AdminScripts.php +15 -9
  65. src/Admin/CategoryWalker.php +52 -52
  66. src/Admin/CustomColumns.php +7 -2
  67. src/Admin/CustomLabels.php +59 -59
  68. src/Admin/Dashboard.php +68 -32
  69. src/Admin/MediaBrowser.php +121 -121
  70. src/Admin/OptionsUpsells.php +95 -95
  71. src/Admin/Settings/Fields/ActionButton.php +55 -55
  72. src/Admin/Settings/Fields/Desc.php +13 -13
  73. src/Admin/Settings/Fields/FieldFactory.php +3 -0
  74. src/Admin/Settings/Fields/HtaccessStatus.php +92 -0
  75. src/Admin/Settings/Fields/Title.php +29 -29
  76. src/Admin/Settings/Page.php +142 -1
  77. src/Admin/ViewManager.php +32 -32
  78. src/Ajax/Ajax.php +32 -32
  79. src/Ajax/GetDownloads.php +40 -40
  80. src/Ajax/GetVersions.php +53 -53
  81. src/Ajax/Manager.php +84 -84
  82. src/AjaxHandler.php +286 -286
  83. src/Constants.php +15 -15
  84. src/DebugLogger.php +49 -49
  85. src/Dependencies/PayPal/Api/Agreement.php +0 -647
  86. src/Dependencies/PayPal/Api/AgreementDetails.php +0 -209
  87. src/Dependencies/PayPal/Api/AgreementStateDescriptor.php +0 -65
  88. src/Dependencies/PayPal/Api/AgreementTransaction.php +0 -257
  89. src/Dependencies/PayPal/Api/AgreementTransactions.php +0 -71
  90. src/Dependencies/PayPal/Api/AlternatePayment.php +0 -91
  91. src/Dependencies/PayPal/Api/Authorization.php +0 -507
  92. src/Dependencies/PayPal/Api/BankAccount.php +0 -629
  93. src/Dependencies/PayPal/Api/BankAccountsList.php +0 -119
  94. src/Dependencies/PayPal/Api/BankToken.php +0 -89
  95. src/Dependencies/PayPal/Api/Billing.php +0 -43
  96. src/Dependencies/PayPal/Api/BillingAgreementToken.php +0 -17
  97. src/Dependencies/PayPal/Api/BillingInfo.php +0 -235
  98. src/Dependencies/PayPal/Api/CancelNotification.php +0 -167
  99. src/Dependencies/PayPal/Api/Capture.php +0 -341
  100. src/Dependencies/PayPal/Api/CarrierAccountToken.php +0 -65
  101. src/Dependencies/PayPal/Api/ChargeModel.php +0 -89
  102. src/Dependencies/PayPal/Api/Cost.php +0 -69
  103. src/Dependencies/PayPal/Api/CountryCode.php +0 -41
  104. src/Dependencies/PayPal/Api/CreateProfileResponse.php +0 -40
  105. src/Dependencies/PayPal/Api/Credit.php +0 -66
  106. src/Dependencies/PayPal/Api/CreditCard.php +0 -560
  107. src/Dependencies/PayPal/Api/CreditCardHistory.php +0 -91
  108. src/Dependencies/PayPal/Api/CreditCardList.php +0 -120
  109. src/Dependencies/PayPal/Api/CreditCardToken.php +0 -161
  110. src/Dependencies/PayPal/Api/CreditFinancingOffered.php +0 -161
  111. src/Dependencies/PayPal/Api/Currency.php +0 -69
  112. src/Dependencies/PayPal/Api/CurrencyConversion.php +0 -266
  113. src/Dependencies/PayPal/Api/CustomAmount.php +0 -65
  114. src/Dependencies/PayPal/Api/DetailedRefund.php +0 -160
  115. src/Dependencies/PayPal/Api/Error.php +0 -320
  116. src/Dependencies/PayPal/Api/ErrorDetails.php +0 -111
  117. src/Dependencies/PayPal/Api/ExtendedBankAccount.php +0 -38
  118. src/Dependencies/PayPal/Api/ExternalFunding.php +0 -161
  119. src/Dependencies/PayPal/Api/FileAttachment.php +0 -67
  120. src/Dependencies/PayPal/Api/FlowConfig.php +0 -115
  121. src/Dependencies/PayPal/Api/FmfDetails.php +0 -115
  122. src/Dependencies/PayPal/Api/FundingDetail.php +0 -114
  123. src/Dependencies/PayPal/Api/FundingInstrument.php +0 -321
  124. src/Dependencies/PayPal/Api/FundingOption.php +0 -221
  125. src/Dependencies/PayPal/Api/FundingSource.php +0 -292
  126. src/Dependencies/PayPal/Api/FuturePayment.php +0 -59
  127. src/Dependencies/PayPal/Api/HyperSchema.php +0 -191
  128. src/Dependencies/PayPal/Api/Image.php +0 -56
  129. src/Dependencies/PayPal/Api/Incentive.php +0 -236
  130. src/Dependencies/PayPal/Api/InputFields.php +0 -89
  131. src/Dependencies/PayPal/Api/InstallmentInfo.php +0 -144
  132. src/Dependencies/PayPal/Api/InstallmentOption.php +0 -113
  133. src/Dependencies/PayPal/Api/Invoice.php +0 -1340
  134. src/Dependencies/PayPal/Api/InvoiceAddress.php +0 -39
  135. src/Dependencies/PayPal/Api/InvoiceItem.php +0 -239
  136. src/Dependencies/PayPal/Api/InvoiceNumber.php +0 -38
  137. src/Dependencies/PayPal/Api/InvoiceSearchResponse.php +0 -95
  138. src/Dependencies/PayPal/Api/Links.php +0 -161
  139. src/Dependencies/PayPal/Api/Measurement.php +0 -65
  140. src/Dependencies/PayPal/Api/MerchantInfo.php +0 -281
  141. src/Dependencies/PayPal/Api/MerchantPreferences.php +0 -261
  142. src/Dependencies/PayPal/Api/Metadata.php +0 -259
  143. src/Dependencies/PayPal/Api/NameValuePair.php +0 -65
  144. src/Dependencies/PayPal/Api/Notification.php +0 -143
  145. src/Dependencies/PayPal/Api/OpenIdAddress.php +0 -133
  146. src/Dependencies/PayPal/Api/OpenIdError.php +0 -85
  147. src/Dependencies/PayPal/Api/OpenIdSession.php +0 -107
  148. src/Dependencies/PayPal/Api/OpenIdTokeninfo.php +0 -255
  149. src/Dependencies/PayPal/Api/Order.php +0 -464
  150. src/Dependencies/PayPal/Api/OverrideChargeModel.php +0 -65
  151. src/Dependencies/PayPal/Api/Participant.php +0 -233
  152. src/Dependencies/PayPal/Api/Patch.php +0 -114
  153. src/Dependencies/PayPal/Api/PatchRequest.php +0 -86
  154. src/Dependencies/PayPal/Api/Payee.php +0 -157
  155. src/Dependencies/PayPal/Api/Payment.php +0 -691
  156. src/Dependencies/PayPal/Api/PaymentCard.php +0 -482
  157. src/Dependencies/PayPal/Api/PaymentCardToken.php +0 -162
  158. src/Dependencies/PayPal/Api/PaymentDefinition.php +0 -239
  159. src/Dependencies/PayPal/Api/PaymentDetail.php +0 -188
  160. src/Dependencies/PayPal/Api/PaymentExecution.php +0 -118
  161. src/Dependencies/PayPal/Api/PaymentHistory.php +0 -119
  162. src/Dependencies/PayPal/Api/PaymentInstruction.php +0 -190
  163. src/Dependencies/PayPal/Api/PaymentOptions.php +0 -88
  164. src/Dependencies/PayPal/Api/PaymentSummary.php +0 -65
  165. src/Dependencies/PayPal/Api/PaymentTerm.php +0 -66
  166. src/Dependencies/PayPal/Api/Payout.php +0 -166
  167. src/Dependencies/PayPal/Api/PayoutBatch.php +0 -120
  168. src/Dependencies/PayPal/Api/PayoutBatchHeader.php +0 -20
assets/blocks/src/blocks.js CHANGED
@@ -1,165 +1,165 @@
1
- //import 'whatwg-fetch';
2
- import Select from 'react-select';
3
-
4
- import { __ } from '@wordpress/i18n';
5
- import { registerBlockType } from '@wordpress/blocks';
6
- import { InspectorControls } from '@wordpress/block-editor';
7
- import { PanelBody } from '@wordpress/components';
8
- import { Fragment } from '@wordpress/element';
9
-
10
- import DownloadButton from './components/DownloadButton';
11
- import DownloadInput from './components/DownloadInput';
12
- import VersionInput from './components/VersionInput';
13
- import TemplateInput from './components/TemplateInput';
14
-
15
- //setLocaleData( window.gutenberg_dlm_blocks.localeData, 'download-monitor' );
16
-
17
- registerBlockType( 'download-monitor/download-button', {
18
- title: __( 'Download Button', 'download-monitor' ),
19
- icon: 'download',
20
- keywords: [
21
- __( 'download', 'download-monitor' ),
22
- 'download monitor',
23
- __( 'file', 'download-monitor' ),
24
- ],
25
- category: 'common',
26
- attributes: {
27
- download_id: {
28
- type: 'number',
29
- default: 0,
30
- },
31
- version_id: {
32
- type: 'number',
33
- default: 0,
34
- },
35
- template: {
36
- type: 'string',
37
- default: 'settings',
38
- },
39
- custom_template: {
40
- type: 'string',
41
- default: '',
42
- },
43
- autop: {
44
- type: 'number',
45
- default: 0,
46
- },
47
- },
48
- edit: ( props ) => {
49
- const {
50
- attributes: {
51
- download_id,
52
- version_id,
53
- template,
54
- custom_template,
55
- autop,
56
- },
57
- setAttributes,
58
- } = props;
59
-
60
- const valueFromId = ( opts, id ) =>
61
- opts.find( ( o ) => o.value === id );
62
- const autoPOptions = [
63
- { value: 0, label: 'No' },
64
- { value: 1, label: 'Yes' },
65
- ];
66
-
67
- return (
68
- <Fragment>
69
- <InspectorControls>
70
- <PanelBody
71
- title={ __(
72
- 'Download Information',
73
- 'download-monitor'
74
- ) }
75
- >
76
- <div className="components-base-control">
77
- <span className="components-base-control__label">
78
- { __( 'Download', 'download-monitor' ) }
79
- </span>
80
- <DownloadInput
81
- onChange={ ( v ) =>
82
- setAttributes( { download_id: v } )
83
- }
84
- selectedDownloadId={ download_id }
85
- />
86
- </div>
87
-
88
- <div className="components-base-control">
89
- <span className="components-base-control__label">
90
- { __( 'Version', 'download-monitor' ) }
91
- </span>
92
- <VersionInput
93
- onChange={ ( v ) =>
94
- setAttributes( { version_id: v } )
95
- }
96
- selectedVersionId={ version_id }
97
- downloadId={ download_id }
98
- />
99
- </div>
100
- </PanelBody>
101
-
102
- <PanelBody title={ __( 'Template', 'download-monitor' ) }>
103
- <div className="components-base-control dlmGbEditorTemplateWrapper">
104
- <span className="components-base-control__label">
105
- { __( 'Template', 'download-monitor' ) }
106
- </span>
107
- <TemplateInput
108
- onChange={ ( v ) =>
109
- setAttributes( { template: v } )
110
- }
111
- selectedTemplate={ template }
112
- templatesStr={ window.dlmBlocks.templates }
113
- />
114
- </div>
115
- { template === 'custom' && (
116
- <div className="components-base-control">
117
- <span className="components-base-control__label">
118
- { __(
119
- 'Custom Template',
120
- 'download-monitor'
121
- ) }
122
- </span>
123
- <input
124
- className="components-text-control__input"
125
- onChange={ ( e ) =>
126
- setAttributes( {
127
- custom_template: e.target.value,
128
- } )
129
- }
130
- value={ custom_template }
131
- />
132
- </div>
133
- ) }
134
- <div className="components-base-control dlmGbEditorTemplateWrapper">
135
- <span className="components-base-control__label">
136
- { __(
137
- 'Wrap in paragraph tag (<p>)?',
138
- 'download-monitor'
139
- ) }
140
- </span>
141
- <Select
142
- value={ valueFromId( autoPOptions, autop ) }
143
- onChange={ ( selectedOption ) => {
144
- setAttributes( {
145
- autop: selectedOption.value,
146
- } );
147
- } }
148
- options={ autoPOptions }
149
- isSearchable="false"
150
- />
151
- </div>
152
- </PanelBody>
153
- </InspectorControls>
154
-
155
- <DownloadButton
156
- download_id={ download_id }
157
- version_id={ version_id }
158
- template={ template }
159
- custom_template={ custom_template }
160
- />
161
- </Fragment>
162
- );
163
- },
164
- save: () => null,
165
- } );
1
+ //import 'whatwg-fetch';
2
+ import Select from 'react-select';
3
+
4
+ import { __ } from '@wordpress/i18n';
5
+ import { registerBlockType } from '@wordpress/blocks';
6
+ import { InspectorControls } from '@wordpress/block-editor';
7
+ import { PanelBody } from '@wordpress/components';
8
+ import { Fragment } from '@wordpress/element';
9
+
10
+ import DownloadButton from './components/DownloadButton';
11
+ import DownloadInput from './components/DownloadInput';
12
+ import VersionInput from './components/VersionInput';
13
+ import TemplateInput from './components/TemplateInput';
14
+
15
+ //setLocaleData( window.gutenberg_dlm_blocks.localeData, 'download-monitor' );
16
+
17
+ registerBlockType( 'download-monitor/download-button', {
18
+ title: __( 'Download Button', 'download-monitor' ),
19
+ icon: 'download',
20
+ keywords: [
21
+ __( 'download', 'download-monitor' ),
22
+ 'download monitor',
23
+ __( 'file', 'download-monitor' ),
24
+ ],
25
+ category: 'common',
26
+ attributes: {
27
+ download_id: {
28
+ type: 'number',
29
+ default: 0,
30
+ },
31
+ version_id: {
32
+ type: 'number',
33
+ default: 0,
34
+ },
35
+ template: {
36
+ type: 'string',
37
+ default: 'settings',
38
+ },
39
+ custom_template: {
40
+ type: 'string',
41
+ default: '',
42
+ },
43
+ autop: {
44
+ type: 'number',
45
+ default: 0,
46
+ },
47
+ },
48
+ edit: ( props ) => {
49
+ const {
50
+ attributes: {
51
+ download_id,
52
+ version_id,
53
+ template,
54
+ custom_template,
55
+ autop,
56
+ },
57
+ setAttributes,
58
+ } = props;
59
+
60
+ const valueFromId = ( opts, id ) =>
61
+ opts.find( ( o ) => o.value === id );
62
+ const autoPOptions = [
63
+ { value: 0, label: 'No' },
64
+ { value: 1, label: 'Yes' },
65
+ ];
66
+
67
+ return (
68
+ <Fragment>
69
+ <InspectorControls>
70
+ <PanelBody
71
+ title={ __(
72
+ 'Download Information',
73
+ 'download-monitor'
74
+ ) }
75
+ >
76
+ <div className="components-base-control">
77
+ <span className="components-base-control__label">
78
+ { __( 'Download', 'download-monitor' ) }
79
+ </span>
80
+ <DownloadInput
81
+ onChange={ ( v ) =>
82
+ setAttributes( { download_id: v } )
83
+ }
84
+ selectedDownloadId={ download_id }
85
+ />
86
+ </div>
87
+
88
+ <div className="components-base-control">
89
+ <span className="components-base-control__label">
90
+ { __( 'Version', 'download-monitor' ) }
91
+ </span>
92
+ <VersionInput
93
+ onChange={ ( v ) =>
94
+ setAttributes( { version_id: v } )
95
+ }
96
+ selectedVersionId={ version_id }
97
+ downloadId={ download_id }
98
+ />
99
+ </div>
100
+ </PanelBody>
101
+
102
+ <PanelBody title={ __( 'Template', 'download-monitor' ) }>
103
+ <div className="components-base-control dlmGbEditorTemplateWrapper">
104
+ <span className="components-base-control__label">
105
+ { __( 'Template', 'download-monitor' ) }
106
+ </span>
107
+ <TemplateInput
108
+ onChange={ ( v ) =>
109
+ setAttributes( { template: v } )
110
+ }
111
+ selectedTemplate={ template }
112
+ templatesStr={ window.dlmBlocks.templates }
113
+ />
114
+ </div>
115
+ { template === 'custom' && (
116
+ <div className="components-base-control">
117
+ <span className="components-base-control__label">
118
+ { __(
119
+ 'Custom Template',
120
+ 'download-monitor'
121
+ ) }
122
+ </span>
123
+ <input
124
+ className="components-text-control__input"
125
+ onChange={ ( e ) =>
126
+ setAttributes( {
127
+ custom_template: e.target.value,
128
+ } )
129
+ }
130
+ value={ custom_template }
131
+ />
132
+ </div>
133
+ ) }
134
+ <div className="components-base-control dlmGbEditorTemplateWrapper">
135
+ <span className="components-base-control__label">
136
+ { __(
137
+ 'Wrap in paragraph tag (<p>)?',
138
+ 'download-monitor'
139
+ ) }
140
+ </span>
141
+ <Select
142
+ value={ valueFromId( autoPOptions, autop ) }
143
+ onChange={ ( selectedOption ) => {
144
+ setAttributes( {
145
+ autop: selectedOption.value,
146
+ } );
147
+ } }
148
+ options={ autoPOptions }
149
+ isSearchable="false"
150
+ />
151
+ </div>
152
+ </PanelBody>
153
+ </InspectorControls>
154
+
155
+ <DownloadButton
156
+ download_id={ download_id }
157
+ version_id={ version_id }
158
+ template={ template }
159
+ custom_template={ custom_template }
160
+ />
161
+ </Fragment>
162
+ );
163
+ },
164
+ save: () => null,
165
+ } );
assets/blocks/src/components/DownloadButton/index.js CHANGED
@@ -1,67 +1,67 @@
1
- import { useState } from '@wordpress/element';
2
-
3
- const DownloadButton = ( {
4
- download_id,
5
- version_id,
6
- template,
7
- custom_template,
8
- } ) => {
9
- const [ calculatedHeight, setCalculatedHeight ] = useState( {
10
- cacheKey: '',
11
- height: 100,
12
- } );
13
-
14
- const getIframeUrl = () => {
15
- let iframeURL = window.dlmBlocks.urlButtonPreview;
16
-
17
- if ( download_id !== 0 ) {
18
- iframeURL += '&download_id=' + download_id;
19
- }
20
-
21
- if ( version_id !== 0 ) {
22
- iframeURL += '&version_id=' + version_id;
23
- }
24
-
25
- if ( template !== '' ) {
26
- iframeURL += '&template=' + template;
27
- }
28
-
29
- if ( custom_template !== '' ) {
30
- iframeURL += '&custom_template=' + custom_template;
31
- }
32
-
33
- return iframeURL;
34
- };
35
-
36
- const updateHeight = ( target ) => {
37
- const cacheKey = encodeURI( getIframeUrl() );
38
-
39
- // check if we need to reset height to new URL
40
- if ( calculatedHeight.chacheKey !== cacheKey ) {
41
- setCalculatedHeight( {
42
- cacheKey,
43
- height: target.contentDocument.getElementById(
44
- 'dlmPreviewContainer'
45
- ).scrollHeight,
46
- } );
47
- }
48
- };
49
-
50
- const iframeURL = getIframeUrl();
51
- const frameHeight = calculatedHeight.height + 'px';
52
-
53
- return (
54
- <div className="dlmPreviewButton">
55
- <iframe
56
- src={ iframeURL }
57
- width="100%"
58
- height={ frameHeight }
59
- onLoad={ ( e ) => {
60
- updateHeight( e.target );
61
- } }
62
- ></iframe>
63
- </div>
64
- );
65
- };
66
-
67
- export default DownloadButton;
1
+ import { useState } from '@wordpress/element';
2
+
3
+ const DownloadButton = ( {
4
+ download_id,
5
+ version_id,
6
+ template,
7
+ custom_template,
8
+ } ) => {
9
+ const [ calculatedHeight, setCalculatedHeight ] = useState( {
10
+ cacheKey: '',
11
+ height: 100,
12
+ } );
13
+
14
+ const getIframeUrl = () => {
15
+ let iframeURL = window.dlmBlocks.urlButtonPreview;
16
+
17
+ if ( download_id !== 0 ) {
18
+ iframeURL += '&download_id=' + download_id;
19
+ }
20
+
21
+ if ( version_id !== 0 ) {
22
+ iframeURL += '&version_id=' + version_id;
23
+ }
24
+
25
+ if ( template !== '' ) {
26
+ iframeURL += '&template=' + template;
27
+ }
28
+
29
+ if ( custom_template !== '' ) {
30
+ iframeURL += '&custom_template=' + custom_template;
31
+ }
32
+
33
+ return iframeURL;
34
+ };
35
+
36
+ const updateHeight = ( target ) => {
37
+ const cacheKey = encodeURI( getIframeUrl() );
38
+
39
+ // check if we need to reset height to new URL
40
+ if ( calculatedHeight.chacheKey !== cacheKey ) {
41
+ setCalculatedHeight( {
42
+ cacheKey,
43
+ height: target.contentDocument.getElementById(
44
+ 'dlmPreviewContainer'
45
+ ).scrollHeight,
46
+ } );
47
+ }
48
+ };
49
+
50
+ const iframeURL = getIframeUrl();
51
+ const frameHeight = calculatedHeight.height + 'px';
52
+
53
+ return (
54
+ <div className="dlmPreviewButton">
55
+ <iframe
56
+ src={ iframeURL }
57
+ width="100%"
58
+ height={ frameHeight }
59
+ onLoad={ ( e ) => {
60
+ updateHeight( e.target );
61
+ } }
62
+ ></iframe>
63
+ </div>
64
+ );
65
+ };
66
+
67
+ export default DownloadButton;
assets/blocks/src/components/DownloadInput/index.js CHANGED
@@ -1,33 +1,33 @@
1
- import Select from 'react-select';
2
-
3
- import { useEffect, useState } from '@wordpress/element';
4
- import apiFetch from '@wordpress/api-fetch';
5
-
6
- const DownloadInput = ( { selectedDownloadId, onChange } ) => {
7
- const [ downloads, setDownloads ] = useState( [] );
8
-
9
- useEffect( () => {
10
- apiFetch( { url: window.dlmBlocks.ajax_getDownloads } ).then(
11
- ( results ) => {
12
- setDownloads( results );
13
- }
14
- );
15
- }, [] );
16
-
17
- const valueFromId = ( opts, id ) => opts.find( ( o ) => o.value === id );
18
-
19
- return (
20
- <div>
21
- <Select
22
- value={ valueFromId( downloads, selectedDownloadId ) }
23
- onChange={ ( selectedOption ) =>
24
- onChange( selectedOption.value )
25
- }
26
- options={ downloads }
27
- isSearchable="true"
28
- />
29
- </div>
30
- );
31
- };
32
-
33
- export default DownloadInput;
1
+ import Select from 'react-select';
2
+
3
+ import { useEffect, useState } from '@wordpress/element';
4
+ import apiFetch from '@wordpress/api-fetch';
5
+
6
+ const DownloadInput = ( { selectedDownloadId, onChange } ) => {
7
+ const [ downloads, setDownloads ] = useState( [] );
8
+
9
+ useEffect( () => {
10
+ apiFetch( { url: window.dlmBlocks.ajax_getDownloads } ).then(
11
+ ( results ) => {
12
+ setDownloads( results );
13
+ }
14
+ );
15
+ }, [] );
16
+
17
+ const valueFromId = ( opts, id ) => opts.find( ( o ) => o.value === id );
18
+
19
+ return (
20
+ <div>
21
+ <Select
22
+ value={ valueFromId( downloads, selectedDownloadId ) }
23
+ onChange={ ( selectedOption ) =>
24
+ onChange( selectedOption.value )
25
+ }
26
+ options={ downloads }
27
+ isSearchable="true"
28
+ />
29
+ </div>
30
+ );
31
+ };
32
+
33
+ export default DownloadInput;
assets/blocks/src/components/TemplateInput/index.js CHANGED
@@ -1,22 +1,22 @@
1
- import Select from 'react-select';
2
-
3
- const TemplateInput = ( { templatesStr, selectedTemplate, onChange } ) => {
4
- const templates = JSON.parse( templatesStr );
5
-
6
- const valueFromId = ( opts, id ) => opts.find( ( o ) => o.value === id );
7
-
8
- return (
9
- <div>
10
- <Select
11
- value={ valueFromId( templates, selectedTemplate ) }
12
- onChange={ ( selectedOption ) =>
13
- onChange( selectedOption.value )
14
- }
15
- options={ templates }
16
- isSearchable="true"
17
- />
18
- </div>
19
- );
20
- };
21
-
22
- export default TemplateInput;
1
+ import Select from 'react-select';
2
+
3
+ const TemplateInput = ( { templatesStr, selectedTemplate, onChange } ) => {
4
+ const templates = JSON.parse( templatesStr );
5
+
6
+ const valueFromId = ( opts, id ) => opts.find( ( o ) => o.value === id );
7
+
8
+ return (
9
+ <div>
10
+ <Select
11
+ value={ valueFromId( templates, selectedTemplate ) }
12
+ onChange={ ( selectedOption ) =>
13
+ onChange( selectedOption.value )
14
+ }
15
+ options={ templates }
16
+ isSearchable="true"
17
+ />
18
+ </div>
19
+ );
20
+ };
21
+
22
+ export default TemplateInput;
assets/blocks/src/components/VersionInput/index.js CHANGED
@@ -1,53 +1,53 @@
1
- import Select from 'react-select';
2
-
3
- import { __ } from '@wordpress/i18n';
4
- import { useEffect, useState } from '@wordpress/element';
5
- import apiFetch from '@wordpress/api-fetch';
6
-
7
- const VersionInput = ( { downloadId, selectedVersionId, onChange } ) => {
8
- const [ versions, setVersions ] = useState( [] );
9
- const [ currentDownloadId, setCurrentDownloadId ] = useState( downloadId );
10
-
11
- useEffect( () => fetchVersions( downloadId ), [] );
12
-
13
- useEffect( () => fetchVersions( downloadId ), [ downloadId ] );
14
-
15
- const fetchVersions = ( downloadId ) => {
16
- if (
17
- typeof downloadId !== 'undefined' &&
18
- downloadId !== currentDownloadId
19
- ) {
20
- apiFetch( {
21
- url:
22
- window.dlmBlocks.ajax_getVersions +
23
- '&download_id=' +
24
- downloadId,
25
- } ).then( ( results ) => {
26
- results.unshift( {
27
- value: 0,
28
- label: __( 'Latest version', 'download-monitor' ),
29
- } );
30
- setVersions( results );
31
- setCurrentDownloadId( downloadId );
32
- } );
33
- }
34
- };
35
-
36
- const valueFromId = ( opts, id ) => opts.find( ( o ) => o.value === id );
37
-
38
- return (
39
- <div>
40
- <Select
41
- value={ valueFromId( versions, selectedVersionId ) }
42
- onChange={ ( selectedOption ) =>
43
- onChange( selectedOption.value )
44
- }
45
- options={ versions }
46
- isSearchable="true"
47
- isDisabled={ typeof downloadId === 'undefined' }
48
- />
49
- </div>
50
- );
51
- };
52
-
53
- export default VersionInput;
1
+ import Select from 'react-select';
2
+
3
+ import { __ } from '@wordpress/i18n';
4
+ import { useEffect, useState } from '@wordpress/element';
5
+ import apiFetch from '@wordpress/api-fetch';
6
+
7
+ const VersionInput = ( { downloadId, selectedVersionId, onChange } ) => {
8
+ const [ versions, setVersions ] = useState( [] );
9
+ const [ currentDownloadId, setCurrentDownloadId ] = useState( downloadId );
10
+
11
+ useEffect( () => fetchVersions( downloadId ), [] );
12
+
13
+ useEffect( () => fetchVersions( downloadId ), [ downloadId ] );
14
+
15
+ const fetchVersions = ( downloadId ) => {
16
+ if (
17
+ typeof downloadId !== 'undefined' &&
18
+ downloadId !== currentDownloadId
19
+ ) {
20
+ apiFetch( {
21
+ url:
22
+ window.dlmBlocks.ajax_getVersions +
23
+ '&download_id=' +
24
+ downloadId,
25
+ } ).then( ( results ) => {
26
+ results.unshift( {
27
+ value: 0,
28
+ label: __( 'Latest version', 'download-monitor' ),
29
+ } );
30
+ setVersions( results );
31
+ setCurrentDownloadId( downloadId );
32
+ } );
33
+ }
34
+ };
35
+
36
+ const valueFromId = ( opts, id ) => opts.find( ( o ) => o.value === id );
37
+
38
+ return (
39
+ <div>
40
+ <Select
41
+ value={ valueFromId( versions, selectedVersionId ) }
42
+ onChange={ ( selectedOption ) =>
43
+ onChange( selectedOption.value )
44
+ }
45
+ options={ versions }
46
+ isSearchable="true"
47
+ isDisabled={ typeof downloadId === 'undefined' }
48
+ />
49
+ </div>
50
+ );
51
+ };
52
+
53
+ export default VersionInput;
assets/css/admin.css CHANGED
@@ -1 +1 @@
1
- .post-type-dlm_download h1 a.dlm-delete-logs{color:#a00}.post-type-dlm_download h1 a.dlm-delete-logs:hover{color:#fff;background:#a00;border-color:#7c0900}.post-type-dlm_download .dlm-page-header{border-bottom:1px solid #ccc;padding:15px 20px;display:flex;justify-content:space-between;background:#fff;width:calc(100% + 20px);box-sizing:border-box;margin-left:-20px}.post-type-dlm_download .dlm-page-header .dlm-header-links{margin-left:-20px}.post-type-dlm_download .dlm-page-header .dlm-header-links a span{vertical-align:middle;position:relative;top:-2px;padding-right:10px}.post-type-dlm_download .dlm-page-header .dlm-header-logo img{max-height:35px}#dlm_logs td{padding:7px 7px;vertical-align:middle}#dlm_logs .check-column{width:1%;padding:0;vertical-align:middle}#dlm_logs .column-status{width:2%}#dlm_logs td.column-status{font-size:10px;vertical-align:middle;text-align:center}#dlm_logs td.column-status span{color:#fff;font-weight:400;-moz-border-radius:50%;-webkit-border-radius:50%;border-radius:50%;height:18px;line-height:18px;width:18px;display:inline-block;background:url(../images/log-status-icons.png) top left no-repeat}#dlm_logs td.column-status .completed{background-color:#6cc644}#dlm_logs td.column-status .failed{background-color:#bd2c00;background-position-y:-18px}#dlm_logs td.column-status .redirected{background-color:#1c769b;background-position-y:-36px}#dlm_logs td.column-user_agent,#dlm_logs td.column-user_ip{font-family:monospace;font-weight:400}#dlm_logs span.dlm-description{font-weight:400}#dlm_logs .column-download,#dlm_logs .column-file,#dlm_logs .column-user,#dlm_logs .column-user_ua{width:16%!important}#dlm_logs .column-date,#dlm_logs .column-user_ip{width:6%!important}.post-type-dlm_download .inline-edit-row .inline-edit-col-dlm .inline-edit-col-dlm-inner{margin-top:10px}.dlm-settings-sub-nav{margin:0 0 10px 0;width:100%;border-bottom:1px solid #ccc;box-shadow:0 1px 1px rgba(0,0,0,.04)}.dlm-settings-sub-nav li{margin-right:10px;margin-bottom:-2px}.dlm-settings-sub-nav a{padding:13px;display:block}.dlm-settings-sub-nav .active-section{margin-bottom:-2px}.dlm-settings-sub-nav .active-section a{border-bottom:4px solid #000;padding-bottom:9px;margin-bottom:-2px;font-weight:600}.admin-color-blue .dlm-settings-sub-nav .active-section a{border-bottom-color:#096484}.admin-color-coffee .dlm-settings-sub-nav .active-section a{border-bottom-color:#c7a589}.admin-color-ectoplasm .dlm-settings-sub-nav .active-section a{border-bottom-color:#a3b745}.admin-color-midnight .dlm-settings-sub-nav .active-section a{border-bottom-color:#e14d43}.admin-color-ocean .dlm-settings-sub-nav .active-section a{border-bottom-color:#627c83}.admin-color-sunrise .dlm-settings-sub-nav .active-section a{border-bottom-color:#be3631}.admin-color-light .dlm-settings-sub-nav .active-section a{border-bottom-color:#888}.admin-color-evergreen .dlm-settings-sub-nav .active-section a{border-bottom-color:#36533f}.admin-color-mint .dlm-settings-sub-nav .active-section a{border-bottom-color:#4f6d59}.admin-color-modern .dlm-settings-sub-nav .active-section a{border-bottom-color:#3858e9}.dlm-admin-settings #setting-dlm_decimal_separator,.dlm-admin-settings #setting-dlm_thousand_separator{width:50px}.dlm-admin-settings table td{padding:15px 0}.dlm-admin-settings h3{margin:2em 0 0}ul.download_monitor_file_browser{list-style:none outside;margin:0;border:1px solid #ddd;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background:#f9f9f9;padding:5px 5px;-moz-box-shadow:inset 0 0 0 1px #fff;-webkit-box-shadow:inset 0 0 0 1px #fff;box-shadow:inset 0 0 0 1px #fff}ul.download_monitor_file_browser li{padding:0;margin:0}ul.download_monitor_file_browser li a{color:#21759b;display:block;padding:4px 0 4px 4px;text-decoration:none}ul.download_monitor_file_browser li a:hover{background-color:#eaf2fa}ul.download_monitor_file_browser li a:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f123";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}ul.download_monitor_file_browser li a.folder:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f318";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}ul.download_monitor_file_browser li a.filetype-3g2:before,ul.download_monitor_file_browser li a.filetype-3gp:before,ul.download_monitor_file_browser li a.filetype-asf:before,ul.download_monitor_file_browser li a.filetype-asx:before,ul.download_monitor_file_browser li a.filetype-avi:before,ul.download_monitor_file_browser li a.filetype-mov:before,ul.download_monitor_file_browser li a.filetype-mp4:before,ul.download_monitor_file_browser li a.filetype-mpg:before,ul.download_monitor_file_browser li a.filetype-rm:before,ul.download_monitor_file_browser li a.filetype-srt:before,ul.download_monitor_file_browser li a.filetype-vob:before,ul.download_monitor_file_browser li a.filetype-wmv:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f126";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}ul.download_monitor_file_browser li a.filetype-aif:before,ul.download_monitor_file_browser li a.filetype-iff:before,ul.download_monitor_file_browser li a.filetype-m3u:before,ul.download_monitor_file_browser li a.filetype-m4a:before,ul.download_monitor_file_browser li a.filetype-mid:before,ul.download_monitor_file_browser li a.filetype-midi:before,ul.download_monitor_file_browser li a.filetype-mp3:before,ul.download_monitor_file_browser li a.filetype-mpa:before,ul.download_monitor_file_browser li a.filetype-ra:before,ul.download_monitor_file_browser li a.filetype-wav:before,ul.download_monitor_file_browser li a.filetype-wma:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f127";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}ul.download_monitor_file_browser li a.filetype-ai:before,ul.download_monitor_file_browser li a.filetype-bmp:before,ul.download_monitor_file_browser li a.filetype-dds:before,ul.download_monitor_file_browser li a.filetype-eps:before,ul.download_monitor_file_browser li a.filetype-gif:before,ul.download_monitor_file_browser li a.filetype-ico:before,ul.download_monitor_file_browser li a.filetype-jpeg:before,ul.download_monitor_file_browser li a.filetype-jpg:before,ul.download_monitor_file_browser li a.filetype-png:before,ul.download_monitor_file_browser li a.filetype-ps:before,ul.download_monitor_file_browser li a.filetype-psd:before,ul.download_monitor_file_browser li a.filetype-pspimage:before,ul.download_monitor_file_browser li a.filetype-svg:before,ul.download_monitor_file_browser li a.filetype-tga:before,ul.download_monitor_file_browser li a.filetype-thm:before,ul.download_monitor_file_browser li a.filetype-tif:before,ul.download_monitor_file_browser li a.filetype-yuv:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f128";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}ul.download_monitor_file_browser li.nofiles{color:#999;font-style:italic;padding:4px 0}ul.download_monitor_file_browser li ul{list-style:none outside;margin:0;padding:0 0 0 28px}ul.download_monitor_file_browser li ul.loading{background:url(../images/ajax-loader.gif) no-repeat 24px 0;height:32px}table.wp-list-table .column-thumb{width:44px;text-align:center;white-space:nowrap}table.wp-list-table .column-dlm_download_cat,table.wp-list-table .column-dlm_download_tag,table.wp-list-table .column-file{width:11%!important}table.wp-list-table .column-file,table.wp-list-table .column-title{width:17%!important}table.wp-list-table .column-download_id,table.wp-list-table .column-version{width:5em}table.wp-list-table th.column-download_count span:first-child,table.wp-list-table th.column-featured span:first-child,table.wp-list-table th.column-members_only span:first-child,table.wp-list-table th.column-redirect_only span:first-child,table.wp-list-table th.column-thumb span:first-child{float:none;display:inline-block;width:1em;height:1em;line-height:1em;padding:2px 0 0 0;overflow:hidden}table.wp-list-table th.column-download_count .sorting-indicator,table.wp-list-table th.column-featured .sorting-indicator,table.wp-list-table th.column-members_only .sorting-indicator,table.wp-list-table th.column-redirect_only .sorting-indicator,table.wp-list-table th.column-thumb .sorting-indicator{float:right}table.wp-list-table th.column-thumb{width:52px;text-align:center}table.wp-list-table th.column-thumb span:first-child:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f128";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}table.wp-list-table th.column-download_count{width:5em}table.wp-list-table th.column-download_count span:first-child:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f346";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}table.wp-list-table th.column-members_only{width:3.5em}table.wp-list-table th.column-members_only span:first-child:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f338";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}table.wp-list-table th.column-redirect_only{width:3.5em}table.wp-list-table th.column-redirect_only span:first-child:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f103";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}table.wp-list-table th.column-featured{width:3.5em}table.wp-list-table th.column-featured span:first-child:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f155";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}table.wp-list-table td.column-download_count,table.wp-list-table td.column-featured,table.wp-list-table td.column-members_only,table.wp-list-table td.column-redirect_only{text-align:left;padding-left:11px}table.wp-list-table td.column-download_count span.na,table.wp-list-table td.column-featured span.na,table.wp-list-table td.column-members_only span.na,table.wp-list-table td.column-redirect_only span.na{color:#999;width:1em;height:1em;line-height:1em;display:inline-block;overflow:hidden;vertical-align:middle}table.wp-list-table td.column-download_count span.na:before,table.wp-list-table td.column-featured span.na:before,table.wp-list-table td.column-members_only span.na:before,table.wp-list-table td.column-redirect_only span.na:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f460";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}table.wp-list-table td.column-download_count span.yes,table.wp-list-table td.column-featured span.yes,table.wp-list-table td.column-members_only span.yes,table.wp-list-table td.column-redirect_only span.yes{width:1em;height:1em;line-height:1em;display:inline-block;overflow:hidden;vertical-align:middle}table.wp-list-table td.column-download_count span.yes:before,table.wp-list-table td.column-featured span.yes:before,table.wp-list-table td.column-members_only span.yes:before,table.wp-list-table td.column-redirect_only span.yes:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f147";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}table.wp-list-table .column-thumb img{padding:2px;margin:0;border:1px solid #dfdfdf;vertical-align:middle;width:32px;height:32px}#download-monitor-file .inside{padding:0;margin:0}#download-monitor-file .dlm-metaboxes-wrapper .close_all,#download-monitor-file .dlm-metaboxes-wrapper .expand_all{float:right;margin-left:1em;line-height:22px;text-decoration:none}#download-monitor-file .dlm-metaboxes-wrapper .expand_all:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f168";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}#download-monitor-file .dlm-metaboxes-wrapper .close_all:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f460";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}#download-monitor-file .dlm-metaboxes-wrapper p.toolbar{margin:0!important;border-top:1px solid #fff;border-bottom:1px solid #dfdfdf;padding:7px 12px!important;overflow:hidden;zoom:1}#download-monitor-file .dlm-metaboxes-wrapper p.toolbar a.button{float:left;margin:0}#download-monitor-file .dlm-metaboxes-wrapper .fr,#download-monitor-file .dlm-metaboxes-wrapper button.add_attribute,#download-monitor-file .dlm-metaboxes-wrapper button.add_variable_attribute,#download-monitor-file .dlm-metaboxes-wrapper select.attribute_taxonomy{float:right;margin:0 0 0 6px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metaboxes{padding:0 12px 0}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox-sortable-placeholder{border-color:#bbb;background-color:#f5f5f5;margin:9px 0;border-width:1px;border-style:dashed}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox{background:#ececec;border:1px solid #ececec;margin:9px 0!important}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox h3{margin:0!important;padding:6px!important;font-size:1em!important;overflow:hidden;zoom:1;cursor:move}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox h3 button{float:right}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox h3 strong{line-height:24px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox h3 select{font-family:sans-serif}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox h3 .handlediv{background-position:6px 5px!important;display:none!important;height:24px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox:hover h3 .handlediv{display:block}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table{width:100%;position:relative;background:#fff;padding:3px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td{text-align:left;padding:6px 6px;vertical-align:top;border:0;line-height:26px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td label{text-align:left;display:block;line-height:21px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input{float:left;min-width:200px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input,#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td textarea{width:100%;margin:0;display:block;font-size:14px;padding:4px;color:#555}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td textarea{height:7.5em}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td select{width:100%}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input.short{width:200px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input.checkbox{width:auto;min-width:inherit;vertical-align:middle;display:inline;float:none}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input.date-picker-field{width:50%;min-width:inherit;float:none;display:inline}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input.hour,#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input.minute{width:2em;min-width:inherit;float:none;display:inline}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td.attribute_name{width:200px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table .minus,#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table .plus{margin-top:6px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table .fl{float:left}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table .fr{float:right}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox:first-child h3{background-color:#fafafa;border-bottom:1px solid #dcdcde}#download-monitor-file .dlm-metaboxes-wrapper .plus:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f132";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}#download-monitor-file .dlm-metaboxes-wrapper .minus:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f460";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}#download-monitor-file .dlm-metaboxes-wrapper .dlm_upload_file:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f317";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}#download-monitor-file .dlm-metaboxes-wrapper .dlm_media_library:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f104";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}#download-monitor-file .dlm-metaboxes-wrapper .dlm_browse_for_file{float:right}#download-monitor-file .dlm-metaboxes-wrapper .dlm_browse_for_file:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f322";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}#download-monitor-information .dlm_information_panel div p{overflow:hidden;width:100%;font-weight:700;box-sizing:border-box;line-height:28px;margin-bottom:5px}#download-monitor-information .dlm_information_panel input{margin:0;border-top-right-radius:0;border-bottom-right-radius:0;flex-grow:1;width:calc(100% - 45px)}#download-monitor-options .inside{padding:0;margin:0}#download-monitor-options .form-field-checkbox label{display:inline;padding:0 0 4px}#download-monitor-options .form-field-checkbox input{display:inline-block;width:auto;vertical-align:middle}#download-monitor-options .form-field-checkbox .dlm-description{padding:4px 0 0 0;display:block}#download-monitor-options .access_permissions{margin:0!important;border-top:1px solid #fff;border-bottom:1px solid #dfdfdf;padding:7px 12px!important;overflow:hidden;zoom:1}#download-monitor-options .access_permissions h4{margin-bottom:.5em;margin:0 0 .5em}#download-monitor-options .access_permissions ul{background:#fff;border:1px solid #dfdfdf;height:110px;overflow:auto;padding:.5em .9em;margin:0}#download-monitor-options p{margin:0!important;border-top:1px solid #fff;border-bottom:1px solid #dfdfdf;padding:7px 12px!important;overflow:hidden;zoom:1}#download-monitor-options p.not-active{opacity:.7}#download-monitor-options .options_upsell_link{color:unset;text-decoration:none}#download-monitor-options .dlm-upsell-badge{font-size:10px;background:#f4daa4;padding:2px 5px;display:inline-block;margin-left:5px;border-radius:10px}#insert-download{padding:20px 20px}#insert-download #drag-drop-area,#insert-download #insert-shortcode{margin:1em 0}#insert-download .error,#insert-download .updated{margin-left:0;margin-right:0}#insert-download h2{margin-top:0}#insert-download label{margin:0 0 .25em 0;display:block;font-size:1.1em}#insert-download span.description{display:block}#insert-download input.input{margin:0 0 .25em 0;display:block;width:100%;font-size:1.1em}#insert-download .add_link{float:right}#insert-download ul.page-numbers{overflow:hidden;zoom:1;margin:0 auto;padding:0;text-align:center}#insert-download ul.page-numbers li{display:inline-block;margin:0;list-style:none outside;line-height:1em}#insert-download ul.page-numbers li a,#insert-download ul.page-numbers li span{text-decoration:none;border:1px solid #ddd;-webkit-border-radius:4px;border-radius:4px;padding:8px;display:block}#insert-download ul.page-numbers li span{border-color:#eee}#insert-download legend{font-weight:700;display:block;margin:0 0 1em}#insert-download fieldset label{display:block;margin:0 0 .5em}.dlm-code-nginx-rules{display:block}.settings_panel .form-table td{padding-left:0}.settings_panel .dlm-lazy-select-loader{display:inline-block;vertical-align:middle;padding:0 0 0 3px}.settings_panel .dlm-lazy-select-loader img{display:inline-block;height:25px;width:25px;margin-top:1px}.dlm-reports h1 .dlm-reports-actions{float:right}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector,.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-period,.dlm-reports h1 .dlm-reports-actions a.dlm-reports-header-chart-switcher{margin:0 5px;float:left}.dlm-reports h1 .dlm-reports-actions>:last-child{margin-right:0}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector{position:relative;font-size:14px;padding:0 .5em 0 1em;background:#fff;border:1px solid #ccc;border-radius:3px;user-select:none;cursor:pointer}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm-arrow:before{font-family:dashicons!important;content:"\f140";font-style:normal;font-weight:400;speak:none;display:inline-block;text-decoration:inherit;width:1em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;font-size:1.6em;vertical-align:middle;margin-top:-2px}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay{display:block;width:466px;padding:10px;background:#fff;border:1px solid #ccc;position:absolute;top:30px;right:0;z-index:10;overflow:hidden}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay .dlm_rdrs_date{font-size:70%;margin-right:5px;float:left;z-index:11}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay .dlm_rdrs_date .ui-datepicker-inline{border:0}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay .dlm_rdrs_date .ui-datepicker-inline .ui-state-highlight{background:#e6e6e6 url(../images/jquery-ui/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;color:#555;border:1px solid #d3d3d3}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay .dlm_rdrs_date .ui-datepicker-inline .ui-state-active{border:1px solid #aaa;background:#fff url(../images/jquery-ui/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay .dlm_rdrs_date .ui-datepicker-inline td,.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay .dlm_rdrs_date .ui-datepicker-inline th{padding:0;margin:0;line-height:2em}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay .dlm_rdrs_date .ui-datepicker-inline td a,.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay .dlm_rdrs_date .ui-datepicker-inline th a{text-align:center!important}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay .dlm_rdrs_actions{width:70px;padding-left:10px;text-align:center;float:left}.dlm-reports h1 .dlm-reports-actions a.dlm-reports-header-chart-switcher{display:block;margin-top:1px;padding-top:4px;color:#23282d;text-decoration:none}.dlm-reports h1 .dlm-reports-actions a.dlm-reports-header-chart-switcher:before{font-family:dashicons!important;font-style:normal;font-weight:400;speak:none;display:inline-block;text-decoration:inherit;width:1em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;font-size:1.4em}.dlm-reports h1 .dlm-reports-actions a.dlm-reports-header-chart-switcher.dlm-line:before{content:"\f238"}.dlm-reports h1 .dlm-reports-actions a.dlm-reports-header-chart-switcher.dlm-bar:before{content:"\f185"}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-period a{border-color:#ccc!important}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-period a:first-child{border-bottom-right-radius:0;border-top-right-radius:0;border-right:0}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-period a:last-child{border-bottom-left-radius:0;border-top-left-radius:0;border-left:0}.dlm-reports .dlm_reports_loader{position:absolute;width:32px;height:32px;top:50%;left:50%;margin:-16px 0 0 -16px}.dlm-reports .dlm-reports-block-chart{width:100%;height:300px;margin-top:20px;background:#fff;border:1px solid #e5e5e5;overflow:hidden}.dlm-reports .dlm-reports-block-chart .chart-container h6{display:none}.dlm-reports .dlm-reports-block-summary #popular span{line-height:1em}.dlm-reports .dlm-reports-block{position:relative;box-sizing:border-box;width:100%;padding:20px 10px;margin-top:20px;background:#fff;border:1px solid #e5e5e5;overflow:hidden;float:left}.dlm-reports .dlm-reports-block.dlm-reports-block-half{width:49%;margin-right:1%}.dlm-reports .dlm-reports-block.dlm-reports-block-half-right{width:49%;margin-left:1%}.dlm-reports .dlm-reports-block .dlm-reports-placeholder-no-data{display:inline-block;width:100%;font-size:1.5em;color:#b4b9be;font-style:italic;text-align:center}.dlm-reports .dlm-reports-block ul{box-sizing:border-box;width:100%;padding:0;margin:0}.dlm-reports .dlm-reports-block ul li{display:inline-block;width:33%;padding:5px 0}.dlm-reports .dlm-reports-block ul li label,.dlm-reports .dlm-reports-block ul li span{display:block;width:100%;text-align:center}.dlm-reports .dlm-reports-block ul li span{font-size:2.5em;font-weight:700;padding:.5em 0 0}.dlm-reports .dlm-reports-block table{width:100%}.dlm-reports .dlm-reports-block table td,.dlm-reports .dlm-reports-block table th{text-align:center;padding:10px 0;border-bottom:1px solid #e5e5e5}.dlm-reports .dlm-reports-block table td:first-child,.dlm-reports .dlm-reports-block table th:first-child{text-align:left}.dlm-reports .dlm-reports-block table th{padding-bottom:20px}.dlm-reports-block-summary{background:#333!important;color:#fff}.post-type-dlm_product table.wp-list-table .column-title{width:65%!important}.dlm_mb_shop_product_information .dlm_shop_field_row{width:100%;overflow:hidden}.dlm_mb_shop_product_information .dlm_shop_field_row label.dlm_shop_field_label{display:inline-block;width:20%;height:100%;line-height:2.2em;float:left}.dlm_mb_shop_product_information .dlm_shop_field_row span.dlm_shop_field_input{display:inline-block;width:50%;float:left}.dlm_mb_shop_product_information .dlm_shop_field_row span.dlm_shop_field_input .dlm_shop_input{width:100%;padding:5px 7px}.dlm_mb_shop_product_information .dlm_shop_field_row span.dlm_shop_field_input .select2-selection--multiple{border:1px solid #ddd}.dlm_mb_shop_product_information .dlm_shop_field_row span.dlm_shop_field_input .select2-search,.dlm_mb_shop_product_information .dlm_shop_field_row span.dlm_shop_field_input .select2-selection__choice{margin-bottom:0}.dlm_mb_shop_product_information .dlm_shop_field_row span.dlm_shop_field_input .select2-search__field{padding-top:3px}.dlm-order-overview #dlm_empty_trash{margin-left:3px}.dlm-order-overview .wp-list-table td .column-id{width:25%}.dlm-order-details{max-width:1250px;margin-left:auto;margin-right:auto;padding-right:20px}.dlm-order-details h1{padding-bottom:25px}.dlm-order-details .dlm-order-details-main,.dlm-order-details .dlm-order-details-side{width:100%;float:left}.dlm-order-details .dlm-order-details-block{padding:0;margin-bottom:20px;line-height:1;border:1px solid #e5e5e5;background:#fff;box-shadow:0 1px 1px rgba(0,0,0,.04)}.dlm-order-details .dlm-order-details-block h2.dlm-order-details-block-title{font-size:14px;padding:8px 12px;margin:0;line-height:1.4;border-bottom:1px solid #eee}.dlm-order-details .dlm-order-details-block .dlm-order-details-block-inside{margin:6px 0 0 0;padding:6px 12px 12px;line-height:1.4em;font-size:13px}.dlm-order-details .dlm-order-details-block .dlm-order-details-block-inside label{display:block;font-weight:700;padding-bottom:6px}.dlm-order-details .dlm-order-details-block .dlm-order-details-block-inside p{padding:0;margin:0}.dlm-order-details .dlm-order-details-block .dlm-order-details-block-inside ul,.dlm-order-details .dlm-order-details-block .dlm-order-details-block-inside ul li{list-style:none;padding:0;margin:0}.dlm-order-details .dlm-order-details-block .dlm-order-details-block-inside ul li{padding:6px 0}.dlm-order-details .dlm-order-details-block .dlm-order-details-block-inside .dlm-order-details-current-state{width:70%;height:30px}.dlm-order-details .dlm-order-details-block.dlm-order-details-customer .dlm-order-details-customer-image{float:right}.dlm-order-details .dlm-order-details-block.dlm-order-details-customer ul li{margin-bottom:4px;padding:0}.dlm-order-details .dlm-order-details-block.dlm-order-details-customer ul li:first-child{font-weight:700}.dlm-order-details .dlm-order-details-block.dlm-order-details-order-items{overflow:hidden}.dlm-order-details .dlm-order-details-block.dlm-order-details-order-items .dlm-order-details-overview{width:25%;float:right}.dlm-order-details .dlm-order-details-block.dlm-order-details-order-items .dlm-order-details-overview td,.dlm-order-details .dlm-order-details-block.dlm-order-details-order-items .dlm-order-details-overview th{padding-top:1.5em;padding-bottom:1.5em;text-align:right}.dlm-order-details .dlm-order-details-block.dlm-order-details-order-items .dlm-order-details-overview th{width:50%;font-weight:400}.dlm-order-details .dlm-order-details-block.dlm-order-details-order-items .dlm-order-details-overview td{padding-right:1em;font-weight:700}.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table{width:100%}.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table td,.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table th{text-align:center}.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table td:first-child,.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table th:first-child{text-align:left;padding-left:.5em}.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table th{padding-top:.5em;padding-bottom:.5em;border-bottom:2px solid #c3c1bc}.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table td{padding-top:1.5em;padding-bottom:1.5em;border-bottom:1px solid #c3c1bc}.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table td.dlm-order-details-order-items-item-total,.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table th.dlm-order-details-order-items-item-total{text-align:right;padding-right:1em}.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table td.dlm-order-transaction-processor-id,.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table th.dlm-order-transaction-processor-id{display:none}.dlm-order-details .dlm-order-details-block .dlm-order-details-update-successful{font-size:2em;padding:.2em .3em;color:#46b450}@media (min-width:768px){.dlm-order-details .dlm-order-details-main{width:62%;float:left}.dlm-order-details .dlm-order-details-side{width:35%;float:right}.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table td.dlm-order-transaction-processor-id,.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table th.dlm-order-transaction-processor-id{display:table-cell}}.dlm-onboarding .dlm-onboarding-section.dlm-onboarding-section-one-col{margin:0 auto;max-width:680px}.dlm-onboarding .dlm-onboarding-section.dlm-onboarding-section-cta{margin-top:40px;text-align:center}.dlm-onboarding .dlm-onboarding-section.dlm-onboarding-section-three-col{max-width:680px;margin:40px auto 0;overflow:hidden;display:flex;justify-content:space-between;flex-wrap:wrap}.dlm-onboarding .dlm-onboarding-section.dlm-onboarding-section-three-col .dlm-onboarding-col{padding-top:2.5em;flex:1;align-self:flex-start;min-width:100%;max-width:100%}.dlm-onboarding .dlm-onboarding-section.dlm-onboarding-section-three-col .dlm-onboarding-col img{width:100%}.dlm-onboarding .dlm-onboarding-section h2{margin:60px 0 .6em;font-size:2.7em;line-height:1.3;font-weight:300;text-align:center}.dlm-onboarding .dlm-onboarding-section p{max-width:55em;margin:.6em auto 0 auto}.dlm-onboarding .dlm-onboarding-section a.button-hero{height:46px;font-size:14px;line-height:44px;padding:0 36px;font-weight:700;text-align:center}.dlm-onboarding .dlm-onboarding-pages{max-width:55em;margin:0 auto;padding:2em 0 0}.dlm-onboarding .dlm-onboarding-pages a.button-hero{width:170px}.dlm-onboarding .dlm-onboarding-pages a.button-hero.dlm-page-exists{background:#46b450;border-color:#46b450 #4a8442 #467a3f;box-shadow:0 2px 0 #467a3f;text-shadow:0 -1px 1px #4a8442,1px 0 1px #4a8442,0 1px 1px #4a8442,-1px 0 1px #4a8442}.dlm-onboarding .dlm-onboarding-pages a.button-hero.dlm-page-exists:active{box-shadow:0 2px 0 #467a3f}.dlm-onboarding .dlm-onboarding-pages td,.dlm-onboarding .dlm-onboarding-pages th{padding:1em 0;border-bottom:1px solid #ccc}.dlm-onboarding .dlm-onboarding-pages th{width:13%;min-width:6em;text-align:left}.dlm-onboarding .dlm-onboarding-pages td{padding-right:.5em;padding-left:.5em}.dlm-onboarding .dlm-onboarding-pages td.dlm-onboarding-pages-page-title{font-weight:700}@media (min-width:768px){.dlm-onboarding .dlm-onboarding-section .dlm-onboarding-pages{width:55em}.dlm-onboarding .dlm-onboarding-section.dlm-onboarding-section-three-col .dlm-onboarding-col{padding-top:0;min-width:31%;max-width:31%}}.dlm_extensions_wrap a.dlm-reload-button{float:right;position:relative;top:-40px}.dlm_extensions_wrap #available-extensions{clear:both}.dlm_extensions_wrap .dlm_extensions{padding:15px 0;overflow:hidden}.dlm_extensions_wrap .dlm_extensions .dlm_extension{background-color:#fff;width:calc(20% - 15px);margin:0 15px 15px 0;display:inline-block;vertical-align:top}.dlm_extensions_wrap .dlm_extensions .dlm_extension p{margin:0}.dlm_extensions_wrap .dlm_extensions .dlm_extension a{color:#444;text-decoration:none}.dlm_extensions_wrap .dlm_extensions .dlm_extension .dlm_extension_img_wrapper{width:100%;background:#419ccb;text-align:center}.dlm_extensions_wrap .dlm_extensions .dlm_extension .dlm_extension_img_wrapper img{max-width:100%;margin:0 auto}.dlm_extensions_wrap .dlm_extensions .dlm_extension h3{padding:0 20px}.dlm_extensions_wrap .dlm_extensions .dlm_extension div.extension-desc{min-height:120px;padding:0 20px}.dlm_extensions_wrap .dlm_extensions .dlm_extension .product_footer{padding:15px 15px 15px 0;text-align:right;background-color:#fafafa;border-top:1px solid #dcdcde}.dlm_extensions_wrap .dlm_extensions .dlm_extension .product_footer .loop_price{font-weight:700}.dlm_extensions_wrap .dlm_extensions .dlm_extension .product_footer .loop_price.sale{color:green}.dlm_extensions_wrap .dlm_extensions .dlm_extension .product_footer .loop_price.sale strike{color:#444}.dlm_extensions_wrap .dlm_extensions .dlm_extension .product_footer .button .dashicons{vertical-align:middle;font-size:16px}.dlm_extensions_wrap .dlm_extensions .dlm_extension .extension_license{padding:0 20px 20px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.dlm_extensions_wrap .dlm_extensions .dlm_extension .extension_license div.dlm_license_error{padding:.5em;margin-bottom:15px;background:#ffffe0}.dlm_extensions_wrap .dlm_extensions .dlm_extension .extension_license div.dlm_license_error a{color:#00f;text-decoration:underline}.dlm_extensions_wrap .dlm_extensions .dlm_extension .extension_license p.license-status{padding:5px 0;margin:5px 0;background:red;font-weight:700;font-size:1.2em;color:#fff;text-align:center}.dlm_extensions_wrap .dlm_extensions .dlm_extension .extension_license p.license-status.active{background:green}.dlm_extensions_wrap .dlm_extensions .dlm_extension .extension_license input{width:100%;margin:7px 0;padding:7px}.dlm_extensions_wrap .dlm_extensions .dlm_extension .extension_license a.button-primary{width:100%;margin:5px auto 0;color:#fff;text-align:center}#ui-datepicker-div{display:none}.wpchill-upsell{background:#fff;border:0;padding:15px;margin-top:30px}.wpchill-upsell .wpchill-upsell-features{text-align:left;display:flex;flex-wrap:wrap;padding:20px 0}.wpchill-upsell .wpchill-upsell-features li{width:33%}.wpchill-upsell a:first-child{margin-right:10px}.wpchill-upsells-wrapper{width:100%}.wrap.dlm-admin-settings .form-table{width:65%;float:left}.wrap.dlm-admin-settings .form-table+.wpchill-upsells-wrapper{width:30%;float:right}.wrap.dlm-admin-settings .dlm-upsell-badge{font-size:10px;background:#f4daa4;padding:2px 5px;display:inline-block;margin-left:10px;border-radius:10px}#total_downloads_browser_table a.nav-tab{text-transform:capitalize}#dlm-amazon-s3-upsell .inside,#dlm-buttons-upsell .inside,#dlm-download-page-upsell .inside,#dlm-google-drive-upsell .inside{display:flex;flex-wrap:wrap;background:#f1f1f1}#dlm-amazon-s3-upsell .inside .wpchill-upsell,#dlm-buttons-upsell .inside .wpchill-upsell,#dlm-download-page-upsell .inside .wpchill-upsell,#dlm-google-drive-upsell .inside .wpchill-upsell{background:0 0;text-align:center;width:100%;margin-top:0}#dlm-amazon-s3-upsell .inside,#dlm-buttons-upsell .inside,#dlm-download-page-upsell .inside,#dlm-google-drive-upsell .inside{margin:0;padding:0}.upsells-columns{display:flex;flex-wrap:wrap;align-items:center;align-content:center}.upsells-columns .upsells-columns-2{width:50%;text-align:center;display:flex;align-items:center;align-content:center}.upsells-columns .upsells-column{width:100%;text-align:center;display:flex;align-items:center;align-content:center}.upsells-columns .upsells-column>*{display:inline-block;align-content:center;vertical-align:middle;margin:0 15px;padding:10px 0}.upsells-columns .upsells-column>.wpchill-upsell{position:relative;float:none;flex-grow:1;display:flex;align-items:center}.upsells-columns .upsells-column>.wpchill-upsell .wpchill-upsell-description{margin:0 auto}.upsells-columns .upsells-column h3{line-height:1.3em}.upsells-columns .upsells-column:last-child{border-top:1px solid #c3c4c7;border-bottom:1px solid #c3c4c7}.upsells-columns .wpchill-upsell{margin-top:0}.dlm_download_page_dlm-extensions .theme.dlm_extension{background-color:#fff}#menu-posts-dlm_download ul.wp-submenu a[href$=dlm-lite-vs-pro]{color:gold}body.rsvp_page_rsvp-upgrade-to-pro #wpcontent .wrap{margin-left:0;max-width:85%}.rsvp-lite-vs-premium,.rsvp-lite-vs-premium p{font-size:14px;margin:0}.rsvp-lite-vs-premium>.wpchill-plans-table.wpchill-highlight>.wpchill-pricing-package{background:#fefff0;box-shadow:0 0 15px rgb(208 219 219)}.rsvp-lite-vs-premium .wp-badge{display:inline-block;vertical-align:middle;position:relative;margin-right:2.5%}.rsvp-lite-vs-premium h3{display:block;position:relative;font-size:16px;margin:0}.rsvp-lite-vs-premium .wpchill-plans-table{display:flex}.rsvp-lite-vs-premium .wpchill-plans-table.table-header{margin-top:50px;border-top:0}.rsvp-lite-vs-premium .wpchill-plans-table.table-header .wpchill-pricing-package{border:0}.rsvp-lite-vs-premium .wpchill-plans-table.table-header .wpchill-pricing-package.wpchill-title.wpchill-highlight::before,.rsvp-lite-vs-premium .wpchill-plans-table.table-header .wpchill-pricing-package:not(.wpchill-modula-lite):last-child:before{content:'';width:auto;display:inline-block;opacity:1;position:absolute;top:-1px;background:#41495b;text-align:center;left:0;right:0;color:#fff;font-size:15px;text-transform:uppercase;padding:10px 5px;transform:translateY(-100%)}.rsvp-lite-vs-premium.table-footer .wpchill-pricing-package:last-child{border:0}.rsvp-lite-vs-premium .wpchill-pricing-package{text-align:center;line-height:1.5;padding:10px 15px;display:flex;align-content:center;align-items:center;justify-content:center;background:#fff;border-top:1px solid #ccc;width:32%}.rsvp-lite-vs-premium .wpchill-pricing-package:not(:first-child){max-width:300px}.rsvp-lite-vs-premium .wpchill-pricing-package.wpchill-title{font-weight:400;color:#666;font-size:1.25rem;height:auto;-ms-flex-direction:column;flex-direction:column;padding-top:30px;padding-bottom:30px;justify-content:space-between;position:relative}.rsvp-lite-vs-premium .wpchill-pricing-package.wpchill-title .wpchill-name{margin:0;font-size:36px}.rsvp-lite-vs-premium .wpchill-pricing-package.wpchill-title.wpchill-modula-lite{justify-content:center}.rsvp-lite-vs-premium .wpchill-pricing-package.wpchill-title p.description{font-style:italic;font-size:13px;margin-bottom:40px}.rsvp-lite-vs-premium .wpchill-pricing-package.wpchill-title .wpchill-price p:last-child{font-size:30px;margin:0 0 40px 0}.rsvp-lite-vs-premium .wpchill-pricing-package.wpchill-title .wpchill-price p.old-price{margin:0;position:relative}.rsvp-lite-vs-premium .wpchill-pricing-package.wpchill-title .wpchill-price p.old-price:after{content:"";height:2px;width:60px;background:red;display:block;position:absolute;left:50%;top:52%;transform:translate(-50%,-50%)}.rsvp-lite-vs-premium .wpchill-pricing-package.wpchill-title .wpchill-price sup{top:2px;position:relative;font-size:15px}.rsvp-lite-vs-premium .wpchill-pricing-package.wpchill-empty{background:0 0;border-color:transparent}.rsvp-lite-vs-premium .wpchill-pricing-package.feature-name{justify-content:space-between;font-weight:400;text-align:left;font-size:13px;display:block;background:0 0}.rsvp-lite-vs-premium .wpchill-pricing-package .dashicons-saved{color:green}.rsvp-lite-vs-premium .wpchill-pricing-package .dashicons{width:30px;height:30px;font-size:30px}.rsvp-lite-vs-premium .wpchill-pricing-package .dashicons-no-alt{color:#ff3439}.rsvp-lite-vs-premium .wpchill-pricing-package:last-child{background:#fefff0}.rsvp-lite-vs-premium .button .dashicons{font-size:16px;vertical-align:middle;line-height:26px}
1
+ .post-type-dlm_download h1 a.dlm-delete-logs{color:#a00}.post-type-dlm_download h1 a.dlm-delete-logs:hover{color:#fff;background:#a00;border-color:#7c0900}.post-type-dlm_download .dlm-page-header{border-bottom:1px solid #ccc;padding:15px 20px;display:flex;justify-content:space-between;background:#fff;width:calc(100% + 20px);box-sizing:border-box;margin-left:-20px}.post-type-dlm_download .dlm-page-header .dlm-header-links{margin-left:-20px}.post-type-dlm_download .dlm-page-header .dlm-header-links a span{vertical-align:middle;position:relative;top:-2px;padding-right:10px}.post-type-dlm_download .dlm-page-header .dlm-header-logo img{max-height:35px}#dlm_logs td{padding:7px 7px;vertical-align:middle}#dlm_logs .check-column{width:1%;padding:0;vertical-align:middle}#dlm_logs .column-status{width:2%}#dlm_logs td.column-status{font-size:10px;vertical-align:middle;text-align:center}#dlm_logs td.column-status span{color:#fff;font-weight:400;-moz-border-radius:50%;-webkit-border-radius:50%;border-radius:50%;height:18px;line-height:18px;width:18px;display:inline-block;background:url(../images/log-status-icons.png) top left no-repeat}#dlm_logs td.column-status .completed{background-color:#6cc644}#dlm_logs td.column-status .failed{background-color:#bd2c00;background-position-y:-18px}#dlm_logs td.column-status .redirected{background-color:#1c769b;background-position-y:-36px}#dlm_logs td.column-user_agent,#dlm_logs td.column-user_ip{font-family:monospace;font-weight:400}#dlm_logs span.dlm-description{font-weight:400}#dlm_logs .column-download,#dlm_logs .column-file,#dlm_logs .column-user,#dlm_logs .column-user_ua{width:16%!important}#dlm_logs .column-date,#dlm_logs .column-user_ip{width:6%!important}.post-type-dlm_download .inline-edit-row .inline-edit-col-dlm .inline-edit-col-dlm-inner{margin-top:10px}.dlm-settings-sub-nav{margin:0 0 10px 0;width:100%;border-bottom:1px solid #ccc;box-shadow:0 1px 1px rgba(0,0,0,.04)}.dlm-settings-sub-nav li{margin-right:10px;margin-bottom:-2px}.dlm-settings-sub-nav a{padding:13px;display:block}.dlm-settings-sub-nav .active-section{margin-bottom:-2px}.dlm-settings-sub-nav .active-section a{border-bottom:4px solid #000;padding-bottom:9px;margin-bottom:-2px;font-weight:600}.admin-color-blue .dlm-settings-sub-nav .active-section a{border-bottom-color:#096484}.admin-color-coffee .dlm-settings-sub-nav .active-section a{border-bottom-color:#c7a589}.admin-color-ectoplasm .dlm-settings-sub-nav .active-section a{border-bottom-color:#a3b745}.admin-color-midnight .dlm-settings-sub-nav .active-section a{border-bottom-color:#e14d43}.admin-color-ocean .dlm-settings-sub-nav .active-section a{border-bottom-color:#627c83}.admin-color-sunrise .dlm-settings-sub-nav .active-section a{border-bottom-color:#be3631}.admin-color-light .dlm-settings-sub-nav .active-section a{border-bottom-color:#888}.admin-color-evergreen .dlm-settings-sub-nav .active-section a{border-bottom-color:#36533f}.admin-color-mint .dlm-settings-sub-nav .active-section a{border-bottom-color:#4f6d59}.admin-color-modern .dlm-settings-sub-nav .active-section a{border-bottom-color:#3858e9}.dlm-admin-settings #setting-dlm_decimal_separator,.dlm-admin-settings #setting-dlm_thousand_separator{width:50px}.dlm-admin-settings table td{padding:15px 0}.dlm-admin-settings h3{margin:2em 0 0}ul.download_monitor_file_browser{list-style:none outside;margin:0;border:1px solid #ddd;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background:#f9f9f9;padding:5px 5px;-moz-box-shadow:inset 0 0 0 1px #fff;-webkit-box-shadow:inset 0 0 0 1px #fff;box-shadow:inset 0 0 0 1px #fff}ul.download_monitor_file_browser li{padding:0;margin:0}ul.download_monitor_file_browser li a{color:#21759b;display:block;padding:4px 0 4px 4px;text-decoration:none}ul.download_monitor_file_browser li a:hover{background-color:#eaf2fa}ul.download_monitor_file_browser li a:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f123";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}ul.download_monitor_file_browser li a.folder:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f318";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}ul.download_monitor_file_browser li a.filetype-3g2:before,ul.download_monitor_file_browser li a.filetype-3gp:before,ul.download_monitor_file_browser li a.filetype-asf:before,ul.download_monitor_file_browser li a.filetype-asx:before,ul.download_monitor_file_browser li a.filetype-avi:before,ul.download_monitor_file_browser li a.filetype-mov:before,ul.download_monitor_file_browser li a.filetype-mp4:before,ul.download_monitor_file_browser li a.filetype-mpg:before,ul.download_monitor_file_browser li a.filetype-rm:before,ul.download_monitor_file_browser li a.filetype-srt:before,ul.download_monitor_file_browser li a.filetype-vob:before,ul.download_monitor_file_browser li a.filetype-wmv:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f126";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}ul.download_monitor_file_browser li a.filetype-aif:before,ul.download_monitor_file_browser li a.filetype-iff:before,ul.download_monitor_file_browser li a.filetype-m3u:before,ul.download_monitor_file_browser li a.filetype-m4a:before,ul.download_monitor_file_browser li a.filetype-mid:before,ul.download_monitor_file_browser li a.filetype-midi:before,ul.download_monitor_file_browser li a.filetype-mp3:before,ul.download_monitor_file_browser li a.filetype-mpa:before,ul.download_monitor_file_browser li a.filetype-ra:before,ul.download_monitor_file_browser li a.filetype-wav:before,ul.download_monitor_file_browser li a.filetype-wma:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f127";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}ul.download_monitor_file_browser li a.filetype-ai:before,ul.download_monitor_file_browser li a.filetype-bmp:before,ul.download_monitor_file_browser li a.filetype-dds:before,ul.download_monitor_file_browser li a.filetype-eps:before,ul.download_monitor_file_browser li a.filetype-gif:before,ul.download_monitor_file_browser li a.filetype-ico:before,ul.download_monitor_file_browser li a.filetype-jpeg:before,ul.download_monitor_file_browser li a.filetype-jpg:before,ul.download_monitor_file_browser li a.filetype-png:before,ul.download_monitor_file_browser li a.filetype-ps:before,ul.download_monitor_file_browser li a.filetype-psd:before,ul.download_monitor_file_browser li a.filetype-pspimage:before,ul.download_monitor_file_browser li a.filetype-svg:before,ul.download_monitor_file_browser li a.filetype-tga:before,ul.download_monitor_file_browser li a.filetype-thm:before,ul.download_monitor_file_browser li a.filetype-tif:before,ul.download_monitor_file_browser li a.filetype-yuv:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f128";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}ul.download_monitor_file_browser li.nofiles{color:#999;font-style:italic;padding:4px 0}ul.download_monitor_file_browser li ul{list-style:none outside;margin:0;padding:0 0 0 28px}ul.download_monitor_file_browser li ul.loading{background:url(../images/ajax-loader.gif) no-repeat 24px 0;height:32px}table.wp-list-table .column-thumb{width:44px;text-align:center;white-space:nowrap}table.wp-list-table .column-dlm_download_cat,table.wp-list-table .column-dlm_download_tag,table.wp-list-table .column-file{width:11%!important}table.wp-list-table .column-file,table.wp-list-table .column-title{width:17%!important}table.wp-list-table .column-download_id,table.wp-list-table .column-version{width:5em}table.wp-list-table th.column-download_count span:first-child,table.wp-list-table th.column-featured span:first-child,table.wp-list-table th.column-members_only span:first-child,table.wp-list-table th.column-redirect_only span:first-child,table.wp-list-table th.column-thumb span:first-child{float:none;display:inline-block;width:1em;height:1em;line-height:1em;padding:2px 0 0 0;overflow:hidden}table.wp-list-table th.column-download_count .sorting-indicator,table.wp-list-table th.column-featured .sorting-indicator,table.wp-list-table th.column-members_only .sorting-indicator,table.wp-list-table th.column-redirect_only .sorting-indicator,table.wp-list-table th.column-thumb .sorting-indicator{float:right}table.wp-list-table th.column-thumb{width:52px;text-align:center}table.wp-list-table th.column-thumb span:first-child:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f128";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}table.wp-list-table th.column-download_count{width:5em}table.wp-list-table th.column-download_count span:first-child:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f346";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}table.wp-list-table th.column-members_only{width:3.5em}table.wp-list-table th.column-members_only span:first-child:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f338";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}table.wp-list-table th.column-redirect_only{width:3.5em}table.wp-list-table th.column-redirect_only span:first-child:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f103";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}table.wp-list-table th.column-featured{width:3.5em}table.wp-list-table th.column-featured span:first-child:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f155";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}table.wp-list-table td.column-download_count,table.wp-list-table td.column-featured,table.wp-list-table td.column-members_only,table.wp-list-table td.column-redirect_only{text-align:left;padding-left:11px}table.wp-list-table td.column-download_count span.na,table.wp-list-table td.column-featured span.na,table.wp-list-table td.column-members_only span.na,table.wp-list-table td.column-redirect_only span.na{color:#999;width:1em;height:1em;line-height:1em;display:inline-block;overflow:hidden;vertical-align:middle}table.wp-list-table td.column-download_count span.na:before,table.wp-list-table td.column-featured span.na:before,table.wp-list-table td.column-members_only span.na:before,table.wp-list-table td.column-redirect_only span.na:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f460";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}table.wp-list-table td.column-download_count span.yes,table.wp-list-table td.column-featured span.yes,table.wp-list-table td.column-members_only span.yes,table.wp-list-table td.column-redirect_only span.yes{width:1em;height:1em;line-height:1em;display:inline-block;overflow:hidden;vertical-align:middle}table.wp-list-table td.column-download_count span.yes:before,table.wp-list-table td.column-featured span.yes:before,table.wp-list-table td.column-members_only span.yes:before,table.wp-list-table td.column-redirect_only span.yes:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f147";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}table.wp-list-table .column-thumb img{padding:2px;margin:0;border:1px solid #dfdfdf;vertical-align:middle;width:32px;height:32px}#download-monitor-file .inside{padding:0;margin:0}#download-monitor-file .dlm-metaboxes-wrapper .close_all,#download-monitor-file .dlm-metaboxes-wrapper .expand_all{float:right;margin-left:1em;line-height:22px;text-decoration:none}#download-monitor-file .dlm-metaboxes-wrapper .expand_all:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f168";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}#download-monitor-file .dlm-metaboxes-wrapper .close_all:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f460";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}#download-monitor-file .dlm-metaboxes-wrapper p.toolbar{margin:0!important;border-top:1px solid #fff;border-bottom:1px solid #dfdfdf;padding:7px 12px!important;overflow:hidden;zoom:1}#download-monitor-file .dlm-metaboxes-wrapper p.toolbar a.button{float:left;margin:0}#download-monitor-file .dlm-metaboxes-wrapper .fr,#download-monitor-file .dlm-metaboxes-wrapper button.add_attribute,#download-monitor-file .dlm-metaboxes-wrapper button.add_variable_attribute,#download-monitor-file .dlm-metaboxes-wrapper select.attribute_taxonomy{float:right;margin:0 0 0 6px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metaboxes{padding:0 12px 0}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox-sortable-placeholder{border-color:#bbb;background-color:#f5f5f5;margin:9px 0;border-width:1px;border-style:dashed}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox{background:#ececec;border:1px solid #ececec;margin:9px 0!important}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox h3{margin:0!important;padding:6px!important;font-size:1em!important;overflow:hidden;zoom:1;cursor:move}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox h3 button{float:right}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox h3 strong{line-height:24px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox h3 select{font-family:sans-serif}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox h3 .handlediv{background-position:6px 5px!important;display:none!important;height:24px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox:hover h3 .handlediv{display:block}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table{width:100%;position:relative;background:#fff;padding:3px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td{text-align:left;padding:6px 6px;vertical-align:top;border:0;line-height:26px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td label{text-align:left;display:block;line-height:21px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input{float:left;min-width:200px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input,#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td textarea{width:100%;margin:0;display:block;font-size:14px;padding:4px;color:#555}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td textarea{height:7.5em}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td select{width:100%}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input.short{width:200px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input.checkbox{width:auto;min-width:inherit;vertical-align:middle;display:inline;float:none}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input.date-picker-field{width:50%;min-width:inherit;float:none;display:inline}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input.hour,#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input.minute{width:2em;min-width:inherit;float:none;display:inline}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td.attribute_name{width:200px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table .minus,#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table .plus{margin-top:6px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table .fl{float:left}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table .fr{float:right}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox:first-child h3{background-color:#fafafa;border-bottom:1px solid #dcdcde}#download-monitor-file .dlm-metaboxes-wrapper .plus:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f132";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}#download-monitor-file .dlm-metaboxes-wrapper .minus:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f460";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}#download-monitor-file .dlm-metaboxes-wrapper .dlm_upload_file:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f317";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}#download-monitor-file .dlm-metaboxes-wrapper .dlm_media_library:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f104";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}#download-monitor-file .dlm-metaboxes-wrapper .dlm_browse_for_file{float:right}#download-monitor-file .dlm-metaboxes-wrapper .dlm_browse_for_file:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\f322";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top}#download-monitor-information .dlm_information_panel div p{overflow:hidden;width:100%;font-weight:700;box-sizing:border-box;line-height:28px;margin-bottom:5px}#download-monitor-information .dlm_information_panel input{margin:0;border-top-right-radius:0;border-bottom-right-radius:0;flex-grow:1;width:calc(100% - 45px)}#download-monitor-options .inside{padding:0;margin:0}#download-monitor-options .form-field-checkbox label{display:inline;padding:0 0 4px}#download-monitor-options .form-field-checkbox input{display:inline-block;width:auto;vertical-align:middle}#download-monitor-options .form-field-checkbox .dlm-description{padding:4px 0 0 0;display:block}#download-monitor-options .access_permissions{margin:0!important;border-top:1px solid #fff;border-bottom:1px solid #dfdfdf;padding:7px 12px!important;overflow:hidden;zoom:1}#download-monitor-options .access_permissions h4{margin-bottom:.5em;margin:0 0 .5em}#download-monitor-options .access_permissions ul{background:#fff;border:1px solid #dfdfdf;height:110px;overflow:auto;padding:.5em .9em;margin:0}#download-monitor-options p{margin:0!important;border-top:1px solid #fff;border-bottom:1px solid #dfdfdf;padding:7px 12px!important;overflow:hidden;zoom:1}#download-monitor-options p.not-active{opacity:.7}#download-monitor-options .options_upsell_link{color:unset;text-decoration:none}#download-monitor-options .dlm-upsell-badge{font-size:10px;background:#f4daa4;padding:2px 5px;display:inline-block;margin-left:5px;border-radius:10px}#insert-download{padding:20px 20px}#insert-download #drag-drop-area,#insert-download #insert-shortcode{margin:1em 0}#insert-download .error,#insert-download .updated{margin-left:0;margin-right:0}#insert-download h2{margin-top:0}#insert-download label{margin:0 0 .25em 0;display:block;font-size:1.1em}#insert-download span.description{display:block}#insert-download input.input{margin:0 0 .25em 0;display:block;width:100%;font-size:1.1em}#insert-download .add_link{float:right}#insert-download ul.page-numbers{overflow:hidden;zoom:1;margin:0 auto;padding:0;text-align:center}#insert-download ul.page-numbers li{display:inline-block;margin:0;list-style:none outside;line-height:1em}#insert-download ul.page-numbers li a,#insert-download ul.page-numbers li span{text-decoration:none;border:1px solid #ddd;-webkit-border-radius:4px;border-radius:4px;padding:8px;display:block}#insert-download ul.page-numbers li span{border-color:#eee}#insert-download legend{font-weight:700;display:block;margin:0 0 1em}#insert-download fieldset label{display:block;margin:0 0 .5em}.dlm-code-nginx-rules{display:block}.settings_panel .form-table td{padding-left:0}.settings_panel .dlm-lazy-select-loader{display:inline-block;vertical-align:middle;padding:0 0 0 3px}.settings_panel .dlm-lazy-select-loader img{display:inline-block;height:25px;width:25px;margin-top:1px}.dlm-reports h1 .dlm-reports-actions{float:right}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector,.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-period,.dlm-reports h1 .dlm-reports-actions a.dlm-reports-header-chart-switcher{margin:0 5px;float:left}.dlm-reports h1 .dlm-reports-actions>:last-child{margin-right:0}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector{position:relative;font-size:14px;padding:0 .5em 0 1em;background:#fff;border:1px solid #ccc;border-radius:3px;user-select:none;cursor:pointer}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm-arrow:before{font-family:dashicons!important;content:"\f140";font-style:normal;font-weight:400;speak:none;display:inline-block;text-decoration:inherit;width:1em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;font-size:1.6em;vertical-align:middle;margin-top:-2px}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay{display:block;width:466px;padding:10px;background:#fff;border:1px solid #ccc;position:absolute;top:30px;right:0;z-index:10;overflow:hidden}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay .dlm_rdrs_date{font-size:70%;margin-right:5px;float:left;z-index:11}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay .dlm_rdrs_date .ui-datepicker-inline{border:0}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay .dlm_rdrs_date .ui-datepicker-inline .ui-state-highlight{background:#e6e6e6 url(../images/jquery-ui/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;color:#555;border:1px solid #d3d3d3}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay .dlm_rdrs_date .ui-datepicker-inline .ui-state-active{border:1px solid #aaa;background:#fff url(../images/jquery-ui/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay .dlm_rdrs_date .ui-datepicker-inline td,.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay .dlm_rdrs_date .ui-datepicker-inline th{padding:0;margin:0;line-height:2em}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay .dlm_rdrs_date .ui-datepicker-inline td a,.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay .dlm_rdrs_date .ui-datepicker-inline th a{text-align:center!important}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-date-selector .dlm_rdrs_overlay .dlm_rdrs_actions{width:70px;padding-left:10px;text-align:center;float:left}.dlm-reports h1 .dlm-reports-actions a.dlm-reports-header-chart-switcher{display:block;margin-top:1px;padding-top:4px;color:#23282d;text-decoration:none}.dlm-reports h1 .dlm-reports-actions a.dlm-reports-header-chart-switcher:before{font-family:dashicons!important;font-style:normal;font-weight:400;speak:none;display:inline-block;text-decoration:inherit;width:1em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;font-size:1.4em}.dlm-reports h1 .dlm-reports-actions a.dlm-reports-header-chart-switcher.dlm-line:before{content:"\f238"}.dlm-reports h1 .dlm-reports-actions a.dlm-reports-header-chart-switcher.dlm-bar:before{content:"\f185"}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-period a{border-color:#ccc!important}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-period a:first-child{border-bottom-right-radius:0;border-top-right-radius:0;border-right:0}.dlm-reports h1 .dlm-reports-actions .dlm-reports-header-period a:last-child{border-bottom-left-radius:0;border-top-left-radius:0;border-left:0}.dlm-reports .dlm_reports_loader{position:absolute;width:32px;height:32px;top:50%;left:50%;margin:-16px 0 0 -16px}.dlm-reports .dlm-reports-block-chart{width:100%;height:300px;margin-top:20px;background:#fff;border:1px solid #e5e5e5;overflow:hidden}.dlm-reports .dlm-reports-block-chart .chart-container h6{display:none}.dlm-reports .dlm-reports-block-summary #popular span{line-height:1em}.dlm-reports .dlm-reports-block{position:relative;box-sizing:border-box;width:100%;padding:20px 10px;margin-top:20px;background:#fff;border:1px solid #e5e5e5;overflow:hidden;float:left}.dlm-reports .dlm-reports-block.dlm-reports-block-half{width:49%;margin-right:1%}.dlm-reports .dlm-reports-block.dlm-reports-block-half-right{width:49%;margin-left:1%}.dlm-reports .dlm-reports-block .dlm-reports-placeholder-no-data{display:inline-block;width:100%;font-size:1.5em;color:#b4b9be;font-style:italic;text-align:center}.dlm-reports .dlm-reports-block ul{box-sizing:border-box;width:100%;padding:0;margin:0}.dlm-reports .dlm-reports-block ul li{display:inline-block;width:33%;padding:5px 0}.dlm-reports .dlm-reports-block ul li label,.dlm-reports .dlm-reports-block ul li span{display:block;width:100%;text-align:center}.dlm-reports .dlm-reports-block ul li span{font-size:2.5em;font-weight:700;padding:.5em 0 0}.dlm-reports .dlm-reports-block table{width:100%}.dlm-reports .dlm-reports-block table td,.dlm-reports .dlm-reports-block table th{text-align:center;padding:10px 0;border-bottom:1px solid #e5e5e5}.dlm-reports .dlm-reports-block table td:first-child,.dlm-reports .dlm-reports-block table th:first-child{text-align:left}.dlm-reports .dlm-reports-block table th{padding-bottom:20px}.dlm-reports-block-summary{background:#333!important;color:#fff}.post-type-dlm_product table.wp-list-table .column-title{width:65%!important}.dlm_mb_shop_product_information .dlm_shop_field_row{width:100%;overflow:hidden}.dlm_mb_shop_product_information .dlm_shop_field_row label.dlm_shop_field_label{display:inline-block;width:20%;height:100%;line-height:2.2em;float:left}.dlm_mb_shop_product_information .dlm_shop_field_row span.dlm_shop_field_input{display:inline-block;width:50%;float:left}.dlm_mb_shop_product_information .dlm_shop_field_row span.dlm_shop_field_input .dlm_shop_input{width:100%;padding:5px 7px}.dlm_mb_shop_product_information .dlm_shop_field_row span.dlm_shop_field_input .select2-selection--multiple{border:1px solid #ddd}.dlm_mb_shop_product_information .dlm_shop_field_row span.dlm_shop_field_input .select2-search,.dlm_mb_shop_product_information .dlm_shop_field_row span.dlm_shop_field_input .select2-selection__choice{margin-bottom:0}.dlm_mb_shop_product_information .dlm_shop_field_row span.dlm_shop_field_input .select2-search__field{padding-top:3px}.dlm-order-overview #dlm_empty_trash{margin-left:3px}.dlm-order-overview .wp-list-table td .column-id{width:25%}.dlm-order-details{max-width:1250px;margin-left:auto;margin-right:auto;padding-right:20px}.dlm-order-details h1{padding-bottom:25px}.dlm-order-details .dlm-order-details-main,.dlm-order-details .dlm-order-details-side{width:100%;float:left}.dlm-order-details .dlm-order-details-block{padding:0;margin-bottom:20px;line-height:1;border:1px solid #e5e5e5;background:#fff;box-shadow:0 1px 1px rgba(0,0,0,.04)}.dlm-order-details .dlm-order-details-block h2.dlm-order-details-block-title{font-size:14px;padding:8px 12px;margin:0;line-height:1.4;border-bottom:1px solid #eee}.dlm-order-details .dlm-order-details-block .dlm-order-details-block-inside{margin:6px 0 0 0;padding:6px 12px 12px;line-height:1.4em;font-size:13px}.dlm-order-details .dlm-order-details-block .dlm-order-details-block-inside label{display:block;font-weight:700;padding-bottom:6px}.dlm-order-details .dlm-order-details-block .dlm-order-details-block-inside p{padding:0;margin:0}.dlm-order-details .dlm-order-details-block .dlm-order-details-block-inside ul,.dlm-order-details .dlm-order-details-block .dlm-order-details-block-inside ul li{list-style:none;padding:0;margin:0}.dlm-order-details .dlm-order-details-block .dlm-order-details-block-inside ul li{padding:6px 0}.dlm-order-details .dlm-order-details-block .dlm-order-details-block-inside .dlm-order-details-current-state{width:70%;height:30px}.dlm-order-details .dlm-order-details-block.dlm-order-details-customer .dlm-order-details-customer-image{float:right}.dlm-order-details .dlm-order-details-block.dlm-order-details-customer ul li{margin-bottom:4px;padding:0}.dlm-order-details .dlm-order-details-block.dlm-order-details-customer ul li:first-child{font-weight:700}.dlm-order-details .dlm-order-details-block.dlm-order-details-order-items{overflow:hidden}.dlm-order-details .dlm-order-details-block.dlm-order-details-order-items .dlm-order-details-overview{width:25%;float:right}.dlm-order-details .dlm-order-details-block.dlm-order-details-order-items .dlm-order-details-overview td,.dlm-order-details .dlm-order-details-block.dlm-order-details-order-items .dlm-order-details-overview th{padding-top:1.5em;padding-bottom:1.5em;text-align:right}.dlm-order-details .dlm-order-details-block.dlm-order-details-order-items .dlm-order-details-overview th{width:50%;font-weight:400}.dlm-order-details .dlm-order-details-block.dlm-order-details-order-items .dlm-order-details-overview td{padding-right:1em;font-weight:700}.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table{width:100%}.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table td,.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table th{text-align:center}.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table td:first-child,.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table th:first-child{text-align:left;padding-left:.5em}.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table th{padding-top:.5em;padding-bottom:.5em;border-bottom:2px solid #c3c1bc}.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table td{padding-top:1.5em;padding-bottom:1.5em;border-bottom:1px solid #c3c1bc}.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table td.dlm-order-details-order-items-item-total,.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table th.dlm-order-details-order-items-item-total{text-align:right;padding-right:1em}.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table td.dlm-order-transaction-processor-id,.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table th.dlm-order-transaction-processor-id{display:none}.dlm-order-details .dlm-order-details-block .dlm-order-details-update-successful{font-size:2em;padding:.2em .3em;color:#46b450}@media (min-width:768px){.dlm-order-details .dlm-order-details-main{width:62%;float:left}.dlm-order-details .dlm-order-details-side{width:35%;float:right}.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table td.dlm-order-transaction-processor-id,.dlm-order-details .dlm-order-details-block table.dlm-order-details-data-table th.dlm-order-transaction-processor-id{display:table-cell}}.dlm-onboarding .dlm-onboarding-section.dlm-onboarding-section-one-col{margin:0 auto;max-width:680px}.dlm-onboarding .dlm-onboarding-section.dlm-onboarding-section-cta{margin-top:40px;text-align:center}.dlm-onboarding .dlm-onboarding-section.dlm-onboarding-section-three-col{max-width:680px;margin:40px auto 0;overflow:hidden;display:flex;justify-content:space-between;flex-wrap:wrap}.dlm-onboarding .dlm-onboarding-section.dlm-onboarding-section-three-col .dlm-onboarding-col{padding-top:2.5em;flex:1;align-self:flex-start;min-width:100%;max-width:100%}.dlm-onboarding .dlm-onboarding-section.dlm-onboarding-section-three-col .dlm-onboarding-col img{width:100%}.dlm-onboarding .dlm-onboarding-section h2{margin:60px 0 .6em;font-size:2.7em;line-height:1.3;font-weight:300;text-align:center}.dlm-onboarding .dlm-onboarding-section p{max-width:55em;margin:.6em auto 0 auto}.dlm-onboarding .dlm-onboarding-section a.button-hero{height:46px;font-size:14px;line-height:44px;padding:0 36px;font-weight:700;text-align:center}.dlm-onboarding .dlm-onboarding-pages{max-width:55em;margin:0 auto;padding:2em 0 0}.dlm-onboarding .dlm-onboarding-pages a.button-hero{width:170px}.dlm-onboarding .dlm-onboarding-pages a.button-hero.dlm-page-exists{background:#46b450;border-color:#46b450 #4a8442 #467a3f;box-shadow:0 2px 0 #467a3f;text-shadow:0 -1px 1px #4a8442,1px 0 1px #4a8442,0 1px 1px #4a8442,-1px 0 1px #4a8442}.dlm-onboarding .dlm-onboarding-pages a.button-hero.dlm-page-exists:active{box-shadow:0 2px 0 #467a3f}.dlm-onboarding .dlm-onboarding-pages td,.dlm-onboarding .dlm-onboarding-pages th{padding:1em 0;border-bottom:1px solid #ccc}.dlm-onboarding .dlm-onboarding-pages th{width:13%;min-width:6em;text-align:left}.dlm-onboarding .dlm-onboarding-pages td{padding-right:.5em;padding-left:.5em}.dlm-onboarding .dlm-onboarding-pages td.dlm-onboarding-pages-page-title{font-weight:700}@media (min-width:768px){.dlm-onboarding .dlm-onboarding-section .dlm-onboarding-pages{width:55em}.dlm-onboarding .dlm-onboarding-section.dlm-onboarding-section-three-col .dlm-onboarding-col{padding-top:0;min-width:31%;max-width:31%}}.dlm_extensions_wrap a.dlm-reload-button{float:right;position:relative;top:-40px}.dlm_extensions_wrap #available-extensions{clear:both}.dlm_extensions_wrap .dlm_extensions{padding:15px 0;overflow:hidden}.dlm_extensions_wrap .dlm_extensions .dlm_extension{background-color:#fff;width:calc(20% - 15px);margin:0 15px 15px 0;display:inline-block;vertical-align:top}.dlm_extensions_wrap .dlm_extensions .dlm_extension p{margin:0}.dlm_extensions_wrap .dlm_extensions .dlm_extension a{color:#444;text-decoration:none}.dlm_extensions_wrap .dlm_extensions .dlm_extension .dlm_extension_img_wrapper{width:100%;background:#419ccb;text-align:center}.dlm_extensions_wrap .dlm_extensions .dlm_extension .dlm_extension_img_wrapper img{max-width:100%;margin:0 auto}.dlm_extensions_wrap .dlm_extensions .dlm_extension h3{padding:0 20px}.dlm_extensions_wrap .dlm_extensions .dlm_extension div.extension-desc{min-height:120px;padding:0 20px}.dlm_extensions_wrap .dlm_extensions .dlm_extension .product_footer{padding:15px 15px 15px 0;text-align:right;background-color:#fafafa;border-top:1px solid #dcdcde}.dlm_extensions_wrap .dlm_extensions .dlm_extension .product_footer .loop_price{font-weight:700}.dlm_extensions_wrap .dlm_extensions .dlm_extension .product_footer .loop_price.sale{color:green}.dlm_extensions_wrap .dlm_extensions .dlm_extension .product_footer .loop_price.sale strike{color:#444}.dlm_extensions_wrap .dlm_extensions .dlm_extension .product_footer .button .dashicons{vertical-align:middle;font-size:16px}.dlm_extensions_wrap .dlm_extensions .dlm_extension .extension_license{padding:0 20px 20px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.dlm_extensions_wrap .dlm_extensions .dlm_extension .extension_license div.dlm_license_error{padding:.5em;margin-bottom:15px;background:#ffffe0}.dlm_extensions_wrap .dlm_extensions .dlm_extension .extension_license div.dlm_license_error a{color:#00f;text-decoration:underline}.dlm_extensions_wrap .dlm_extensions .dlm_extension .extension_license p.license-status{padding:5px 0;margin:5px 0;background:red;font-weight:700;font-size:1.2em;color:#fff;text-align:center}.dlm_extensions_wrap .dlm_extensions .dlm_extension .extension_license p.license-status.active{background:green}.dlm_extensions_wrap .dlm_extensions .dlm_extension .extension_license input{width:100%;margin:7px 0;padding:7px}.dlm_extensions_wrap .dlm_extensions .dlm_extension .extension_license a.button-primary{width:100%;margin:5px auto 0;color:#fff;text-align:center}#ui-datepicker-div{display:none}.wpchill-upsell{background:#fff;border:0;padding:15px;margin-top:30px}.wpchill-upsell .wpchill-upsell-features{text-align:left;display:flex;flex-wrap:wrap;padding:20px 0}.wpchill-upsell .wpchill-upsell-features li{width:33%}.wpchill-upsell a:first-child{margin-right:10px}.wpchill-upsells-wrapper{width:100%}.wrap.dlm-admin-settings .form-table{width:65%;float:left}.wrap.dlm-admin-settings .form-table+.wpchill-upsells-wrapper{width:30%;float:right}.wrap.dlm-admin-settings .form-table .dlm_htaccess_notice{margin-bottom:5px}.wrap.dlm-admin-settings .dlm-upsell-badge{font-size:10px;background:#f4daa4;padding:2px 5px;display:inline-block;margin-left:10px;border-radius:10px}#total_downloads_browser_table a.nav-tab{text-transform:capitalize}#dlm-amazon-s3-upsell .inside,#dlm-buttons-upsell .inside,#dlm-download-page-upsell .inside,#dlm-google-drive-upsell .inside{display:flex;flex-wrap:wrap;background:#f1f1f1}#dlm-amazon-s3-upsell .inside .wpchill-upsell,#dlm-buttons-upsell .inside .wpchill-upsell,#dlm-download-page-upsell .inside .wpchill-upsell,#dlm-google-drive-upsell .inside .wpchill-upsell{background:0 0;text-align:center;width:100%;margin-top:0}#dlm-amazon-s3-upsell .inside,#dlm-buttons-upsell .inside,#dlm-download-page-upsell .inside,#dlm-google-drive-upsell .inside{margin:0;padding:0}.upsells-columns{display:flex;flex-wrap:wrap;align-items:center;align-content:center}.upsells-columns .upsells-columns-2{width:50%;text-align:center;display:flex;align-items:center;align-content:center}.upsells-columns .upsells-column{width:100%;text-align:center;display:flex;align-items:center;align-content:center}.upsells-columns .upsells-column>*{display:inline-block;align-content:center;vertical-align:middle;margin:0 15px;padding:10px 0}.upsells-columns .upsells-column>.wpchill-upsell{position:relative;float:none;flex-grow:1;display:flex;align-items:center}.upsells-columns .upsells-column>.wpchill-upsell .wpchill-upsell-description{margin:0 auto}.upsells-columns .upsells-column h3{line-height:1.3em}.upsells-columns .upsells-column:last-child{border-top:1px solid #c3c4c7;border-bottom:1px solid #c3c4c7}.upsells-columns .wpchill-upsell{margin-top:0}.dlm_download_page_dlm-extensions .theme.dlm_extension{background-color:#fff}#menu-posts-dlm_download ul.wp-submenu a[href$=dlm-lite-vs-pro]{color:gold}body.rsvp_page_rsvp-upgrade-to-pro #wpcontent .wrap{margin-left:0;max-width:85%}.rsvp-lite-vs-premium,.rsvp-lite-vs-premium p{font-size:14px;margin:0}.rsvp-lite-vs-premium>.wpchill-plans-table.wpchill-highlight>.wpchill-pricing-package{background:#fefff0;box-shadow:0 0 15px rgb(208 219 219)}.rsvp-lite-vs-premium .wp-badge{display:inline-block;vertical-align:middle;position:relative;margin-right:2.5%}.rsvp-lite-vs-premium h3{display:block;position:relative;font-size:16px;margin:0}.rsvp-lite-vs-premium .wpchill-plans-table{display:flex}.rsvp-lite-vs-premium .wpchill-plans-table.table-header{margin-top:50px;border-top:0}.rsvp-lite-vs-premium .wpchill-plans-table.table-header .wpchill-pricing-package{border:0}.rsvp-lite-vs-premium .wpchill-plans-table.table-header .wpchill-pricing-package.wpchill-title.wpchill-highlight::before,.rsvp-lite-vs-premium .wpchill-plans-table.table-header .wpchill-pricing-package:not(.wpchill-modula-lite):last-child:before{content:'';width:auto;display:inline-block;opacity:1;position:absolute;top:-1px;background:#41495b;text-align:center;left:0;right:0;color:#fff;font-size:15px;text-transform:uppercase;padding:10px 5px;transform:translateY(-100%)}.rsvp-lite-vs-premium.table-footer .wpchill-pricing-package:last-child{border:0}.rsvp-lite-vs-premium .wpchill-pricing-package{text-align:center;line-height:1.5;padding:10px 15px;display:flex;align-content:center;align-items:center;justify-content:center;background:#fff;border-top:1px solid #ccc;width:32%}.rsvp-lite-vs-premium .wpchill-pricing-package:not(:first-child){max-width:300px}.rsvp-lite-vs-premium .wpchill-pricing-package.wpchill-title{font-weight:400;color:#666;font-size:1.25rem;height:auto;-ms-flex-direction:column;flex-direction:column;padding-top:30px;padding-bottom:30px;justify-content:space-between;position:relative}.rsvp-lite-vs-premium .wpchill-pricing-package.wpchill-title .wpchill-name{margin:0;font-size:36px}.rsvp-lite-vs-premium .wpchill-pricing-package.wpchill-title.wpchill-modula-lite{justify-content:center}.rsvp-lite-vs-premium .wpchill-pricing-package.wpchill-title p.description{font-style:italic;font-size:13px;margin-bottom:40px}.rsvp-lite-vs-premium .wpchill-pricing-package.wpchill-title .wpchill-price p:last-child{font-size:30px;margin:0 0 40px 0}.rsvp-lite-vs-premium .wpchill-pricing-package.wpchill-title .wpchill-price p.old-price{margin:0;position:relative}.rsvp-lite-vs-premium .wpchill-pricing-package.wpchill-title .wpchill-price p.old-price:after{content:"";height:2px;width:60px;background:red;display:block;position:absolute;left:50%;top:52%;transform:translate(-50%,-50%)}.rsvp-lite-vs-premium .wpchill-pricing-package.wpchill-title .wpchill-price sup{top:2px;position:relative;font-size:15px}.rsvp-lite-vs-premium .wpchill-pricing-package.wpchill-empty{background:0 0;border-color:transparent}.rsvp-lite-vs-premium .wpchill-pricing-package.feature-name{justify-content:space-between;font-weight:400;text-align:left;font-size:13px;display:block;background:0 0}.rsvp-lite-vs-premium .wpchill-pricing-package .dashicons-saved{color:green}.rsvp-lite-vs-premium .wpchill-pricing-package .dashicons{width:30px;height:30px;font-size:30px}.rsvp-lite-vs-premium .wpchill-pricing-package .dashicons-no-alt{color:#ff3439}.rsvp-lite-vs-premium .wpchill-pricing-package:last-child{background:#fefff0}.rsvp-lite-vs-premium .button .dashicons{font-size:16px;vertical-align:middle;line-height:26px}
assets/css/admin.less CHANGED
@@ -1803,6 +1803,10 @@ table.wp-list-table {
1803
  width: 30%;
1804
  float: right;
1805
  }
 
 
 
 
1806
  }
1807
 
1808
  .dlm-upsell-badge {
1803
  width: 30%;
1804
  float: right;
1805
  }
1806
+
1807
+ .dlm_htaccess_notice{
1808
+ margin-bottom:5px;
1809
+ }
1810
  }
1811
 
1812
  .dlm-upsell-badge {
assets/css/cart.less CHANGED
@@ -1,88 +1,88 @@
1
- @cart_bottom_bg: #f8f8f8;
2
-
3
- .dlm-cart {
4
-
5
- .dlm-cart-table-items {
6
- table {
7
- tr {
8
- th, td {
9
- background: none;
10
- padding: 1em;
11
- }
12
- th {
13
- font-size: 1.1em;
14
- padding-top: 0.5em;
15
- padding-bottom: 0.5em;
16
- border-bottom: 2px solid #c3c1bc;
17
- }
18
- td {
19
- padding-top: 1.5em;
20
- padding-bottom: 1.5em;
21
- border-bottom: 1px solid #c3c1bc;
22
-
23
- .dlm-cart-remove-item {
24
- display: inline-block;
25
- width: 18px;
26
- height: 18px;
27
- line-height: 14px;
28
- font-size: 15px;
29
- color: #000;
30
- text-align: center;
31
- border: 1px solid #000;
32
- -webkit-border-radius: 100%;
33
- -moz-border-radius: 100%;
34
- border-radius: 100%;
35
- }
36
- }
37
- }
38
- }
39
- }
40
-
41
- .dlm-cart-bottom {
42
- background: @cart_bottom_bg;
43
- padding: 1em;
44
- overflow: hidden;
45
-
46
- .dlm-cart-coupons {
47
- width: 40%;
48
- float: left;
49
- }
50
-
51
- .dlm-cart-bottom-right {
52
- width: 40%;
53
- float: right;
54
-
55
- .dlm-cart-totals {
56
- h2 {
57
- font-size: 1.6em;
58
- }
59
-
60
- table {
61
- tr {
62
- th, td {
63
- padding: .75em .5em;
64
- background: @cart_bottom_bg;
65
- }
66
- }
67
- tr.dlm-totals-last-row {
68
- th, td {
69
- border-top: 1px solid #c3c1bc;
70
- }
71
- }
72
- }
73
- }
74
-
75
- .dlm-proceed-to-checkout {
76
- a.dlm-button-checkout {
77
- display: block;
78
- color: #000;
79
- padding: 1em 2em;
80
- border: 2px solid #000;
81
- text-align: center;
82
- font-weight: 800;
83
- box-shadow: none !important;
84
- }
85
- }
86
- }
87
- }
88
  }
1
+ @cart_bottom_bg: #f8f8f8;
2
+
3
+ .dlm-cart {
4
+
5
+ .dlm-cart-table-items {
6
+ table {
7
+ tr {
8
+ th, td {
9
+ background: none;
10
+ padding: 1em;
11
+ }
12
+ th {
13
+ font-size: 1.1em;
14
+ padding-top: 0.5em;
15
+ padding-bottom: 0.5em;
16
+ border-bottom: 2px solid #c3c1bc;
17
+ }
18
+ td {
19
+ padding-top: 1.5em;
20
+ padding-bottom: 1.5em;
21
+ border-bottom: 1px solid #c3c1bc;
22
+
23
+ .dlm-cart-remove-item {
24
+ display: inline-block;
25
+ width: 18px;
26
+ height: 18px;
27
+ line-height: 14px;
28
+ font-size: 15px;
29
+ color: #000;
30
+ text-align: center;
31
+ border: 1px solid #000;
32
+ -webkit-border-radius: 100%;
33
+ -moz-border-radius: 100%;
34
+ border-radius: 100%;
35
+ }
36
+ }
37
+ }
38
+ }
39
+ }
40
+
41
+ .dlm-cart-bottom {
42
+ background: @cart_bottom_bg;
43
+ padding: 1em;
44
+ overflow: hidden;
45
+
46
+ .dlm-cart-coupons {
47
+ width: 40%;
48
+ float: left;
49
+ }
50
+
51
+ .dlm-cart-bottom-right {
52
+ width: 40%;
53
+ float: right;
54
+
55
+ .dlm-cart-totals {
56
+ h2 {
57
+ font-size: 1.6em;
58
+ }
59
+
60
+ table {
61
+ tr {
62
+ th, td {
63
+ padding: .75em .5em;
64
+ background: @cart_bottom_bg;
65
+ }
66
+ }
67
+ tr.dlm-totals-last-row {
68
+ th, td {
69
+ border-top: 1px solid #c3c1bc;
70
+ }
71
+ }
72
+ }
73
+ }
74
+
75
+ .dlm-proceed-to-checkout {
76
+ a.dlm-button-checkout {
77
+ display: block;
78
+ color: #000;
79
+ padding: 1em 2em;
80
+ border: 2px solid #000;
81
+ text-align: center;
82
+ font-weight: 800;
83
+ box-shadow: none !important;
84
+ }
85
+ }
86
+ }
87
+ }
88
  }
assets/css/checkout.less CHANGED
@@ -1,206 +1,206 @@
1
- @cart_bottom_bg: #f8f8f8;
2
-
3
- .dlm-checkout {
4
-
5
- width: 100% !important;
6
- max-width: 100% !important;
7
- overflow: hidden;
8
-
9
- .dlm-checkout-error {
10
- padding: 1em;
11
- margin-bottom: 15px;
12
- background: #dc3232;
13
- box-shadow: 0 1px 1px 0 rgba( 0, 0, 0, 0.1 );
14
-
15
- .dlm-checkout-error-icon {
16
- display: inline-block;
17
- width: 25px;
18
- color: #fff;
19
- vertical-align: middle;
20
- margin-right: 10px;
21
- }
22
-
23
- p {
24
- display: inline-block;
25
- color: #fff;
26
- font-weight: bold;
27
- padding: 0;
28
- margin: 0;
29
- }
30
- }
31
-
32
- form {
33
- padding: 0;
34
- margin: 0;
35
- }
36
-
37
- .dlm-checkout-billing {
38
- width: 55%;
39
- float: left;
40
- }
41
-
42
- .dlm-checkout-order-review {
43
- width: 40%;
44
- float: right;
45
-
46
- table {
47
- th {
48
- text-align: left;
49
- }
50
- }
51
- }
52
-
53
- .dlm-checkout-row {
54
- width: 100%;
55
- padding: 5px 0;
56
-
57
- label {
58
- display: inline-block;
59
- width: 100%;
60
- .dlm-checkout-required {
61
- padding: 0 5px;
62
- color: #ff0000;
63
- }
64
- }
65
-
66
- .dlm-checkout-input-wrapper {
67
- display: inline-block;
68
- width: 100%;
69
- padding: 5px 0;
70
-
71
- input, select {
72
- width: 100%;
73
- }
74
- select {
75
- padding: 5px;
76
- }
77
-
78
- .dlm-checkout-field {
79
- &.dlm-checkout-field-error {
80
- border: 1px solid #dc3232;
81
- }
82
- }
83
-
84
- }
85
- }
86
-
87
- .dlm-checkout-row-half {
88
- width: 45%;
89
- float: left;
90
- }
91
-
92
- .dlm-checkout-row-last {
93
- float: right;
94
- }
95
-
96
- .dlm-checkout-payment {
97
- ul, li {
98
- padding: 0;
99
- margin: 0;
100
- list-style: none;
101
- }
102
- ul {
103
- li {
104
- background: #fbfbfb;
105
- margin-bottom: 20px;
106
- label {
107
- display: inline-block;
108
- width: 100%;
109
- padding: 15px 25px;
110
- background: #f8f8f8;
111
- cursor: pointer;
112
-
113
- input {
114
- margin-right: 10px;
115
- }
116
- }
117
- .dlm_gateway_details {
118
- padding: 15px 25px;
119
-
120
- p {
121
- padding: 0;
122
- margin: 0;
123
- }
124
- }
125
- }
126
- }
127
- }
128
-
129
- }
130
-
131
- .dlm-checkout-complete {
132
-
133
- table {
134
- th {
135
- text-align: left;
136
- }
137
- }
138
-
139
- .dlm-checkout-download-button {
140
- display: inline-block;
141
- padding: 1em 1.5em;
142
- background-color: #eeeeee;
143
- border-color: #eeeeee;
144
- color: #333333;
145
- }
146
- }
147
-
148
- .dlm-checkout-overlay-bg {
149
- position: fixed;
150
- top: 0;
151
- left: 0;
152
- width: 100%;
153
- height:100%;
154
- background: #000;
155
- opacity: 0.5;
156
- z-index: 9998;
157
-
158
- display: none;
159
- }
160
-
161
- .dlm-checkout-overlay {
162
- box-sizing: border-box;
163
- position: fixed;
164
- top: 50%;
165
- left: 50%;
166
- width: 350px;
167
- height:150px;
168
- margin-top: -75px;
169
- margin-left: -175px;
170
- padding: 25px;
171
- background: #fff;
172
- border-radius: 8px;
173
- box-shadow: 1px 2px;
174
- z-index: 9999;
175
- text-align: center;
176
- display: none;
177
-
178
- h2 {
179
- padding: 0;
180
- margin: 0;
181
- font-size: 26px;
182
- font-weight: 400;
183
- text-align: center;
184
-
185
- &:before {
186
- content:"";
187
- display: none;
188
- }
189
- }
190
-
191
- span {
192
- font-size: 16px;
193
- display: inline-block;
194
- width: 100%;
195
- padding: 10px 0 20px;
196
- text-align: center;
197
- }
198
-
199
- img {
200
- position: absolute;
201
- bottom: 25px;
202
- left: 50%;
203
- margin-left: -22px;
204
- }
205
-
206
  }
1
+ @cart_bottom_bg: #f8f8f8;
2
+
3
+ .dlm-checkout {
4
+
5
+ width: 100% !important;
6
+ max-width: 100% !important;
7
+ overflow: hidden;
8
+
9
+ .dlm-checkout-error {
10
+ padding: 1em;
11
+ margin-bottom: 15px;
12
+ background: #dc3232;
13
+ box-shadow: 0 1px 1px 0 rgba( 0, 0, 0, 0.1 );
14
+
15
+ .dlm-checkout-error-icon {
16
+ display: inline-block;
17
+ width: 25px;
18
+ color: #fff;
19
+ vertical-align: middle;
20
+ margin-right: 10px;
21
+ }
22
+
23
+ p {
24
+ display: inline-block;
25
+ color: #fff;
26
+ font-weight: bold;
27
+ padding: 0;
28
+ margin: 0;
29
+ }
30
+ }
31
+
32
+ form {
33
+ padding: 0;
34
+ margin: 0;
35
+ }
36
+
37
+ .dlm-checkout-billing {
38
+ width: 55%;
39
+ float: left;
40
+ }
41
+
42
+ .dlm-checkout-order-review {
43
+ width: 40%;
44
+ float: right;
45
+
46
+ table {
47
+ th {
48
+ text-align: left;
49
+ }
50
+ }
51
+ }
52
+
53
+ .dlm-checkout-row {
54
+ width: 100%;
55
+ padding: 5px 0;
56
+
57
+ label {
58
+ display: inline-block;
59
+ width: 100%;
60
+ .dlm-checkout-required {
61
+ padding: 0 5px;
62
+ color: #ff0000;
63
+ }
64
+ }
65
+
66
+ .dlm-checkout-input-wrapper {
67
+ display: inline-block;
68
+ width: 100%;
69
+ padding: 5px 0;
70
+
71
+ input, select {
72
+ width: 100%;
73
+ }
74
+ select {
75
+ padding: 5px;
76
+ }
77
+
78
+ .dlm-checkout-field {
79
+ &.dlm-checkout-field-error {
80
+ border: 1px solid #dc3232;
81
+ }
82
+ }
83
+
84
+ }
85
+ }
86
+
87
+ .dlm-checkout-row-half {
88
+ width: 45%;
89
+ float: left;
90
+ }
91
+
92
+ .dlm-checkout-row-last {
93
+ float: right;
94
+ }
95
+
96
+ .dlm-checkout-payment {
97
+ ul, li {
98
+ padding: 0;
99
+ margin: 0;
100
+ list-style: none;
101
+ }
102
+ ul {
103
+ li {
104
+ background: #fbfbfb;
105
+ margin-bottom: 20px;
106
+ label {
107
+ display: inline-block;
108
+ width: 100%;
109
+ padding: 15px 25px;
110
+ background: #f8f8f8;
111
+ cursor: pointer;
112
+
113
+ input {
114
+ margin-right: 10px;
115
+ }
116
+ }
117
+ .dlm_gateway_details {
118
+ padding: 15px 25px;
119
+
120
+ p {
121
+ padding: 0;
122
+ margin: 0;
123
+ }
124
+ }
125
+ }
126
+ }
127
+ }
128
+
129
+ }
130
+
131
+ .dlm-checkout-complete {
132
+
133
+ table {
134
+ th {
135
+ text-align: left;
136
+ }
137
+ }
138
+
139
+ .dlm-checkout-download-button {
140
+ display: inline-block;
141
+ padding: 1em 1.5em;
142
+ background-color: #eeeeee;
143
+ border-color: #eeeeee;
144
+ color: #333333;
145
+ }
146
+ }
147
+
148
+ .dlm-checkout-overlay-bg {
149
+ position: fixed;
150
+ top: 0;
151
+ left: 0;
152
+ width: 100%;
153
+ height:100%;
154
+ background: #000;
155
+ opacity: 0.5;
156
+ z-index: 9998;
157
+
158
+ display: none;
159
+ }
160
+
161
+ .dlm-checkout-overlay {
162
+ box-sizing: border-box;
163
+ position: fixed;
164
+ top: 50%;
165
+ left: 50%;
166
+ width: 350px;
167
+ height:150px;
168
+ margin-top: -75px;
169
+ margin-left: -175px;
170
+ padding: 25px;
171
+ background: #fff;
172
+ border-radius: 8px;
173
+ box-shadow: 1px 2px;
174
+ z-index: 9999;
175
+ text-align: center;
176
+ display: none;
177
+
178
+ h2 {
179
+ padding: 0;
180
+ margin: 0;
181
+ font-size: 26px;
182
+ font-weight: 400;
183
+ text-align: center;
184
+
185
+ &:before {
186
+ content:"";
187
+ display: none;
188
+ }
189
+ }
190
+
191
+ span {
192
+ font-size: 16px;
193
+ display: inline-block;
194
+ width: 100%;
195
+ padding: 10px 0 20px;
196
+ text-align: center;
197
+ }
198
+
199
+ img {
200
+ position: absolute;
201
+ bottom: 25px;
202
+ left: 50%;
203
+ margin-left: -22px;
204
+ }
205
+
206
  }
assets/css/frontend.less CHANGED
@@ -1,199 +1,199 @@
1
- .download-box {
2
- width: 250px;
3
- border: 1px solid #ccc;
4
- -moz-border-radius: 4px;
5
- -webkit-border-radius: 4px;
6
- border-radius: 4px;
7
- text-align: center;
8
- position: relative;
9
- margin: 1em auto;
10
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.4);
11
-
12
- h1 {
13
- margin: 0.5em 0 !important;
14
- }
15
-
16
- img.wp-post-image {
17
- margin: 0;
18
- padding: 0;
19
- display: block;
20
- width: 100%;
21
- -moz-border-radius: 0;
22
- -webkit-border-radius: 0;
23
- -moz-border-top-left-radius: 3px;
24
- -moz-border-top-right-radius: 3px;
25
- -webkit-border-top-left-radius: 3px;
26
- -webkit-border-top-right-radius: 3px;
27
- border-radius: 0;
28
- border-top-left-radius: 3px;
29
- border-top-right-radius: 3px;
30
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
31
- }
32
-
33
- .download-box-content {
34
- padding: 0 1em 1em;
35
- }
36
-
37
- .download-count {
38
- -moz-border-radius: 1em;
39
- -webkit-border-radius: 1em;
40
- border-radius: 1em;
41
- color: #777;
42
- text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
43
- background: #ddd;
44
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.4);
45
- position: absolute;
46
- top: 0;
47
- right: 0;
48
- padding: .6em;
49
- width: auto;
50
- min-width: 1em;
51
- font-size: 1em;
52
- text-align: center;
53
- vertical-align: middle;
54
- line-height: 1em;
55
- border: 1px solid #bbb;
56
- margin: -.5em -.5em 0 0;
57
- }
58
- }
59
-
60
- .download-button {
61
- text-align: center;
62
- text-decoration: none !important;
63
- padding: 0.75em 1em;
64
- color: #fff;
65
- display: block;
66
- font-size: 1.2em;
67
- line-height: 1.5em;
68
- background-color: #0099cc;
69
- background-image: -webkit-linear-gradient(#009fd4, #0099cc, #0086b2);
70
- background-image: -moz-linear-gradient(#009fd4, #0099cc, #0086b2);
71
- -moz-border-radius: 4px;
72
- -webkit-border-radius: 4px;
73
- border-radius: 4px;
74
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.5);
75
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.4);
76
- border: 1px solid #0086b2;
77
- cursor: pointer;
78
-
79
- &:hover {
80
- color: #fff;
81
- background-color: #0099cc;
82
- background-image: -webkit-linear-gradient(#0099cc, #0086b2);
83
- background-image: -moz-linear-gradient(#0099cc, #0086b2);
84
- }
85
-
86
- &:visited {
87
- color: #fff;
88
- text-decoration: none;
89
- }
90
-
91
-
92
- small {
93
- font-size: 0.8em;
94
- opacity: 0.8;
95
- display: block;
96
- }
97
- }
98
-
99
- .filetype-icon {
100
- padding-left: 19px;
101
- background-repeat: no-repeat;
102
- background-position: left;
103
- background-image: url(../images/filetypes/document.png);
104
- }
105
-
106
- .filetype-pdf {
107
- background-image: url(../images/filetypes/document-pdf.png);
108
- }
109
-
110
- .filetype-m4r, .filetype-au, .filetype-snd, .filetype-mid, .filetype-midi, .filetype-kar, .filetype-mpga, .filetype-mp2, .filetype-mp3, .filetype-aif, .filetype-aiff, .filetype-aifc, .filetype-m3u, .filetype-ram, .filetype-rm, .filetype-rpm, .filetype-ra, .filetype-wav, .filetype-wave {
111
- background-image: url(../images/filetypes/document-music.png);
112
- }
113
-
114
- .filetype-mpeg, .filetype-mpg, .filetype-mpe, .filetype-qt, .filetype-mov, .filetype-mxu, .filetype-avi, .filetype-movie, .filetype-mp4, .filetype-divx, .filetype-wmv {
115
- background-image: url(../images/filetypes/document-film.png);
116
- }
117
-
118
- .filetype-zip, .filetype-gz, .filetype-rar, .filetype-sit, .filetype-tar, .filetype-7z {
119
- background-image: url(../images/filetypes/document-zipper.png);
120
- }
121
-
122
- .filetype-xls, .filetype-tsv, .filetype-csv, .filetype-xlsx {
123
- background-image: url(../images/filetypes/document-excel.png);
124
- }
125
-
126
- .filetype-doc, .filetype-docx {
127
- background-image: url(../images/filetypes/document-word-text.png);
128
- }
129
-
130
- .filetype-ai {
131
- background-image: url(../images/filetypes/document-illustrator.png);
132
- }
133
-
134
- .filetype-swf {
135
- background-image: url(../images/filetypes/document-flash-movie.png);
136
- }
137
-
138
- .filetype-eps, .filetype-ps, .filetype-bmp, .filetype-gif, .filetype-ief, .filetype-jpeg, .filetype-jpg, .filetype-jpe, .filetype-png, .filetype-tiff, .filetype-tif, .filetype-djv, .filetype-wbmp, .filetype-ras, .filetype-pnm, .filetype-pbm, .filetype-pgm, .filetype-ppm, .filetype-rgb, .filetype-xbm, .filetype-xpm, .filetype-xwd {
139
- background-image: url(../images/filetypes/document-image.png);
140
- }
141
-
142
- .filetype-psd {
143
- background-image: url(../images/filetypes/document-photoshop.png);
144
- }
145
-
146
- .filetype-ppt, .filetype-pptx {
147
- background-image: url(../images/filetypes/document-powerpoint.png);
148
- }
149
-
150
- .filetype-js, .filetype-css, .filetype-as, .filetype-htm, .filetype-htaccess, .filetype-sql, .filetype-html, .filetype-php, .filetype-xml, .filetype-xsl {
151
- background-image: url(../images/filetypes/document-code.png);
152
- }
153
-
154
- .filetype-rtx, .filetype-rtf {
155
- background-image: url(../images/filetypes/document-text-image.png);
156
- }
157
-
158
- .filetype-txt {
159
- background-image: url(../images/filetypes/document-text.png);
160
- }
161
-
162
- nav.download-monitor-pagination, #content nav.download-monitor-pagination {
163
- text-align: center;
164
- ul {
165
- display: inline-block;
166
- white-space: nowrap;
167
- padding: 0;
168
- clear: both;
169
- border: 1px solid #eee;
170
- border-right: 0;
171
- margin: 1px;
172
- li {
173
- border-right: 1px solid #eee;
174
- padding: 0;
175
- margin: 0;
176
- float: left;
177
- display: inline;
178
- overflow: hidden;
179
- a, span {
180
- margin: 0;
181
- text-decoration: none;
182
- padding: 0;
183
- line-height: 1em;
184
- font-size: 1em;
185
- font-weight: normal;
186
- padding: .5em;
187
- min-width: 1em;
188
- display: block;
189
- }
190
- span.current, a:hover, a:focus {
191
- background: #eee;
192
- color: darken(#eee, 40);
193
- }
194
- }
195
- }
196
- }
197
- .dlm_widget_downloads ul, .dlm_widget_downloads ul li {
198
- list-style: none;
199
  }
1
+ .download-box {
2
+ width: 250px;
3
+ border: 1px solid #ccc;
4
+ -moz-border-radius: 4px;
5
+ -webkit-border-radius: 4px;
6
+ border-radius: 4px;
7
+ text-align: center;
8
+ position: relative;
9
+ margin: 1em auto;
10
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.4);
11
+
12
+ h1 {
13
+ margin: 0.5em 0 !important;
14
+ }
15
+
16
+ img.wp-post-image {
17
+ margin: 0;
18
+ padding: 0;
19
+ display: block;
20
+ width: 100%;
21
+ -moz-border-radius: 0;
22
+ -webkit-border-radius: 0;
23
+ -moz-border-top-left-radius: 3px;
24
+ -moz-border-top-right-radius: 3px;
25
+ -webkit-border-top-left-radius: 3px;
26
+ -webkit-border-top-right-radius: 3px;
27
+ border-radius: 0;
28
+ border-top-left-radius: 3px;
29
+ border-top-right-radius: 3px;
30
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
31
+ }
32
+
33
+ .download-box-content {
34
+ padding: 0 1em 1em;
35
+ }
36
+
37
+ .download-count {
38
+ -moz-border-radius: 1em;
39
+ -webkit-border-radius: 1em;
40
+ border-radius: 1em;
41
+ color: #777;
42
+ text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
43
+ background: #ddd;
44
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.4);
45
+ position: absolute;
46
+ top: 0;
47
+ right: 0;
48
+ padding: .6em;
49
+ width: auto;
50
+ min-width: 1em;
51
+ font-size: 1em;
52
+ text-align: center;
53
+ vertical-align: middle;
54
+ line-height: 1em;
55
+ border: 1px solid #bbb;
56
+ margin: -.5em -.5em 0 0;
57
+ }
58
+ }
59
+
60
+ .download-button {
61
+ text-align: center;
62
+ text-decoration: none !important;
63
+ padding: 0.75em 1em;
64
+ color: #fff;
65
+ display: block;
66
+ font-size: 1.2em;
67
+ line-height: 1.5em;
68
+ background-color: #0099cc;
69
+ background-image: -webkit-linear-gradient(#009fd4, #0099cc, #0086b2);
70
+ background-image: -moz-linear-gradient(#009fd4, #0099cc, #0086b2);
71
+ -moz-border-radius: 4px;
72
+ -webkit-border-radius: 4px;
73
+ border-radius: 4px;
74
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.5);
75
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.4);
76
+ border: 1px solid #0086b2;
77
+ cursor: pointer;
78
+
79
+ &:hover {
80
+ color: #fff;
81
+ background-color: #0099cc;
82
+ background-image: -webkit-linear-gradient(#0099cc, #0086b2);
83
+ background-image: -moz-linear-gradient(#0099cc, #0086b2);
84
+ }
85
+
86
+ &:visited {
87
+ color: #fff;
88
+ text-decoration: none;
89
+ }
90
+
91
+
92
+ small {
93
+ font-size: 0.8em;
94
+ opacity: 0.8;
95
+ display: block;
96
+ }
97
+ }
98
+
99
+ .filetype-icon {
100
+ padding-left: 19px;
101
+ background-repeat: no-repeat;
102
+ background-position: left;
103
+ background-image: url(../images/filetypes/document.png);
104
+ }
105
+
106
+ .filetype-pdf {
107
+ background-image: url(../images/filetypes/document-pdf.png);
108
+ }
109
+
110
+ .filetype-m4r, .filetype-au, .filetype-snd, .filetype-mid, .filetype-midi, .filetype-kar, .filetype-mpga, .filetype-mp2, .filetype-mp3, .filetype-aif, .filetype-aiff, .filetype-aifc, .filetype-m3u, .filetype-ram, .filetype-rm, .filetype-rpm, .filetype-ra, .filetype-wav, .filetype-wave {
111
+ background-image: url(../images/filetypes/document-music.png);
112
+ }
113
+
114
+ .filetype-mpeg, .filetype-mpg, .filetype-mpe, .filetype-qt, .filetype-mov, .filetype-mxu, .filetype-avi, .filetype-movie, .filetype-mp4, .filetype-divx, .filetype-wmv {
115
+ background-image: url(../images/filetypes/document-film.png);
116
+ }
117
+
118
+ .filetype-zip, .filetype-gz, .filetype-rar, .filetype-sit, .filetype-tar, .filetype-7z {
119
+ background-image: url(../images/filetypes/document-zipper.png);
120
+ }
121
+
122
+ .filetype-xls, .filetype-tsv, .filetype-csv, .filetype-xlsx {
123
+ background-image: url(../images/filetypes/document-excel.png);
124
+ }
125
+
126
+ .filetype-doc, .filetype-docx {
127
+ background-image: url(../images/filetypes/document-word-text.png);
128
+ }
129
+
130
+ .filetype-ai {
131
+ background-image: url(../images/filetypes/document-illustrator.png);
132
+ }
133
+
134
+ .filetype-swf {
135
+ background-image: url(../images/filetypes/document-flash-movie.png);
136
+ }
137
+
138
+ .filetype-eps, .filetype-ps, .filetype-bmp, .filetype-gif, .filetype-ief, .filetype-jpeg, .filetype-jpg, .filetype-jpe, .filetype-png, .filetype-tiff, .filetype-tif, .filetype-djv, .filetype-wbmp, .filetype-ras, .filetype-pnm, .filetype-pbm, .filetype-pgm, .filetype-ppm, .filetype-rgb, .filetype-xbm, .filetype-xpm, .filetype-xwd {
139
+ background-image: url(../images/filetypes/document-image.png);
140
+ }
141
+
142
+ .filetype-psd {
143
+ background-image: url(../images/filetypes/document-photoshop.png);
144
+ }
145
+
146
+ .filetype-ppt, .filetype-pptx {
147
+ background-image: url(../images/filetypes/document-powerpoint.png);
148
+ }
149
+
150
+ .filetype-js, .filetype-css, .filetype-as, .filetype-htm, .filetype-htaccess, .filetype-sql, .filetype-html, .filetype-php, .filetype-xml, .filetype-xsl {
151
+ background-image: url(../images/filetypes/document-code.png);
152
+ }
153
+
154
+ .filetype-rtx, .filetype-rtf {
155
+ background-image: url(../images/filetypes/document-text-image.png);
156
+ }
157
+
158
+ .filetype-txt {
159
+ background-image: url(../images/filetypes/document-text.png);
160
+ }
161
+
162
+ nav.download-monitor-pagination, #content nav.download-monitor-pagination {
163
+ text-align: center;
164
+ ul {
165
+ display: inline-block;
166
+ white-space: nowrap;
167
+ padding: 0;
168
+ clear: both;
169
+ border: 1px solid #eee;
170
+ border-right: 0;
171
+ margin: 1px;
172
+ li {
173
+ border-right: 1px solid #eee;
174
+ padding: 0;
175
+ margin: 0;
176
+ float: left;
177
+ display: inline;
178
+ overflow: hidden;
179
+ a, span {
180
+ margin: 0;
181
+ text-decoration: none;
182
+ padding: 0;
183
+ line-height: 1em;
184
+ font-size: 1em;
185
+ font-weight: normal;
186
+ padding: .5em;
187
+ min-width: 1em;
188
+ display: block;
189
+ }
190
+ span.current, a:hover, a:focus {
191
+ background: #eee;
192
+ color: darken(#eee, 40);
193
+ }
194
+ }
195
+ }
196
+ }
197
+ .dlm_widget_downloads ul, .dlm_widget_downloads ul li {
198
+ list-style: none;
199
  }
assets/css/gb-editor.less CHANGED
@@ -1,11 +1,11 @@
1
- .dlmPreviewButton {
2
- border: 2px dashed #419ccb;
3
- color: #fff;
4
- padding: 1em;
5
- overflow: hidden;
6
-
7
- iframe {
8
- overflow: hidden;
9
- float: left;
10
- }
11
  }
1
+ .dlmPreviewButton {
2
+ border: 2px dashed #419ccb;
3
+ color: #fff;
4
+ padding: 1em;
5
+ overflow: hidden;
6
+
7
+ iframe {
8
+ overflow: hidden;
9
+ float: left;
10
+ }
11
  }
assets/css/menu.less CHANGED
@@ -1,77 +1,77 @@
1
- /* Menu */
2
- #adminmenu {
3
- #menu-posts-dlm_download {
4
- .wp-menu-image:before {
5
- content: "\f316";
6
- font-family: "dashicons" !important;
7
- font-style: normal;
8
- font-weight: normal;
9
- speak: none;
10
-
11
- display: inline-block;
12
- text-decoration: inherit;
13
- width: 1em;
14
- text-align: center;
15
-
16
- /* For safety - reset parent styles, that can break glyph codes*/
17
- font-variant: normal;
18
- text-transform: none;
19
-
20
- /* fix buttons height, for twitter bootstrap */
21
- line-height: 1em;
22
- }
23
- }
24
- }
25
-
26
- /* LU upgrade notice */
27
- .dlm-lu-upgrade-notice {
28
- position: relative;
29
- padding: 1em;
30
- margin: 3em 1em 1em 0;
31
- color: #fff;
32
- background: #419ccb;
33
- box-shadow: 2px 2px 1px grey;
34
-
35
- h3, a {
36
- color: #fff;
37
- }
38
- h3 {
39
- margin-top: 0;
40
- }
41
-
42
- p {
43
- font-size: 1.05em;
44
- a {
45
- font-weight: bold;
46
- }
47
- }
48
- a.dlm-lu-upgrade-notice-hide {
49
- position: absolute;
50
- top: 10px;
51
- right: 10px;
52
- text-decoration: none;
53
- font-size: 0.95em;
54
- }
55
- }
56
-
57
- .dlm-onboarding-notice {
58
- border-left-color: #419ccb;
59
-
60
- &:before {
61
- display: inline-block;
62
- position:absolute;
63
- top:0;
64
- left:0;
65
- width: 35px;
66
- height: 100%;
67
- content:"";
68
- background-color: #419ccb;
69
- background-image: url('../images/logo.png');
70
- background-size: 29px 28px;
71
- background-position: 1px center;
72
- background-repeat: no-repeat;
73
- }
74
- p {
75
- padding-left: 33px;
76
- }
77
  }
1
+ /* Menu */
2
+ #adminmenu {
3
+ #menu-posts-dlm_download {
4
+ .wp-menu-image:before {
5
+ content: "\f316";
6
+ font-family: "dashicons" !important;
7
+ font-style: normal;
8
+ font-weight: normal;
9
+ speak: none;
10
+
11
+ display: inline-block;
12
+ text-decoration: inherit;
13
+ width: 1em;
14
+ text-align: center;
15
+
16
+ /* For safety - reset parent styles, that can break glyph codes*/
17
+ font-variant: normal;
18
+ text-transform: none;
19
+
20
+ /* fix buttons height, for twitter bootstrap */
21
+ line-height: 1em;
22
+ }
23
+ }
24
+ }
25
+
26
+ /* LU upgrade notice */
27
+ .dlm-lu-upgrade-notice {
28
+ position: relative;
29
+ padding: 1em;
30
+ margin: 3em 1em 1em 0;
31
+ color: #fff;
32
+ background: #419ccb;
33
+ box-shadow: 2px 2px 1px grey;
34
+
35
+ h3, a {
36
+ color: #fff;
37
+ }
38
+ h3 {
39
+ margin-top: 0;
40
+ }
41
+
42
+ p {
43
+ font-size: 1.05em;
44
+ a {
45
+ font-weight: bold;
46
+ }
47
+ }
48
+ a.dlm-lu-upgrade-notice-hide {
49
+ position: absolute;
50
+ top: 10px;
51
+ right: 10px;
52
+ text-decoration: none;
53
+ font-size: 0.95em;
54
+ }
55
+ }
56
+
57
+ .dlm-onboarding-notice {
58
+ border-left-color: #419ccb;
59
+
60
+ &:before {
61
+ display: inline-block;
62
+ position:absolute;
63
+ top:0;
64
+ left:0;
65
+ width: 35px;
66
+ height: 100%;
67
+ content:"";
68
+ background-color: #419ccb;
69
+ background-image: url('../images/logo.png');
70
+ background-size: 29px 28px;
71
+ background-position: 1px center;
72
+ background-repeat: no-repeat;
73
+ }
74
+ p {
75
+ padding-left: 33px;
76
+ }
77
  }
assets/css/preview.less CHANGED
@@ -1,19 +1,19 @@
1
- html,body {
2
- padding: 0;
3
- margin: 0;
4
- overflow: hidden !important;
5
- }
6
-
7
- table,tr,td {
8
- padding: 0 !important;
9
- margin: 0 !important;
10
- }
11
-
12
- p {
13
- padding: 0 !important;
14
- margin: 0 !important;
15
- }
16
-
17
- .dlmPreviewContainer {
18
- overflow: hidden;
19
  }
1
+ html,body {
2
+ padding: 0;
3
+ margin: 0;
4
+ overflow: hidden !important;
5
+ }
6
+
7
+ table,tr,td {
8
+ padding: 0 !important;
9
+ margin: 0 !important;
10
+ }
11
+
12
+ p {
13
+ padding: 0 !important;
14
+ margin: 0 !important;
15
+ }
16
+
17
+ .dlmPreviewContainer {
18
+ overflow: hidden;
19
  }
assets/js/blockui.js CHANGED
@@ -1,616 +1,616 @@
1
- /*!
2
- * jQuery blockUI plugin
3
- * Version 2.61.0-2013.06.06
4
- * @requires jQuery v1.7 or later
5
- *
6
- * Examples at: http://malsup.com/jquery/block/
7
- * Copyright (c) 2007-2013 M. Alsup
8
- * Dual licensed under the MIT and GPL licenses:
9
- * http://www.opensource.org/licenses/mit-license.php
10
- * http://www.gnu.org/licenses/gpl.html
11
- *
12
- * Thanks to Amir-Hossein Sobhi for some excellent contributions!
13
- */
14
-
15
- ;(function() {
16
- /*jshint eqeqeq:false curly:false latedef:false */
17
- "use strict";
18
-
19
- function setup($) {
20
- $.fn._fadeIn = $.fn.fadeIn;
21
-
22
- var noOp = $.noop || function() {};
23
-
24
- // this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle
25
- // retarded userAgent strings on Vista)
26
- var msie = /MSIE/.test(navigator.userAgent);
27
- var ie6 = /MSIE 6.0/.test(navigator.userAgent) && ! /MSIE 8.0/.test(navigator.userAgent);
28
- var mode = document.documentMode || 0;
29
- var setExpr = $.isFunction( document.createElement('div').style.setExpression );
30
-
31
- // global $ methods for blocking/unblocking the entire page
32
- $.blockUI = function(opts) { install(window, opts); };
33
- $.unblockUI = function(opts) { remove(window, opts); };
34
-
35
- // convenience method for quick growl-like notifications (http://www.google.com/search?q=growl)
36
- $.growlUI = function(title, message, timeout, onClose) {
37
- var $m = $('<div class="growlUI"></div>');
38
- if (title) $m.append('<h1>'+title+'</h1>');
39
- if (message) $m.append('<h2>'+message+'</h2>');
40
- if (timeout === undefined) timeout = 3000;
41
-
42
- // Added by konapun: Set timeout to 30 seconds if this growl is moused over, like normal toast notifications
43
- var callBlock = function(opts) {
44
- opts = opts || {};
45
-
46
- $.blockUI({
47
- message: $m,
48
- fadeIn : typeof opts.fadeIn !== 'undefined' ? opts.fadeIn : 700,
49
- fadeOut: typeof opts.fadeOut !== 'undefined' ? opts.fadeOut : 1000,
50
- timeout: typeof opts.timeout !== 'undefined' ? opts.timeout : timeout,
51
- centerY: false,
52
- showOverlay: false,
53
- onUnblock: onClose,
54
- css: $.blockUI.defaults.growlCSS
55
- });
56
- };
57
-
58
- callBlock();
59
- var nonmousedOpacity = $m.css('opacity');
60
- $m.mouseover(function() {
61
- callBlock({
62
- fadeIn: 0,
63
- timeout: 30000
64
- });
65
-
66
- var displayBlock = $('.blockMsg');
67
- displayBlock.stop(); // cancel fadeout if it has started
68
- displayBlock.fadeTo(300, 1); // make it easier to read the message by removing transparency
69
- }).mouseout(function() {
70
- $('.blockMsg').fadeOut(1000);
71
- });
72
- // End konapun additions
73
- };
74
-
75
- // plugin method for blocking element content
76
- $.fn.block = function(opts) {
77
- if ( this[0] === window ) {
78
- $.blockUI( opts );
79
- return this;
80
- }
81
- var fullOpts = $.extend({}, $.blockUI.defaults, opts || {});
82
- this.each(function() {
83
- var $el = $(this);
84
- if (fullOpts.ignoreIfBlocked && $el.data('blockUI.isBlocked'))
85
- return;
86
- $el.unblock({ fadeOut: 0 });
87
- });
88
-
89
- return this.each(function() {
90
- if ($.css(this,'position') == 'static') {
91
- this.style.position = 'relative';
92
- $(this).data('blockUI.static', true);
93
- }
94
- this.style.zoom = 1; // force 'hasLayout' in ie
95
- install(this, opts);
96
- });
97
- };
98
-
99
- // plugin method for unblocking element content
100
- $.fn.unblock = function(opts) {
101
- if ( this[0] === window ) {
102
- $.unblockUI( opts );
103
- return this;
104
- }
105
- return this.each(function() {
106
- remove(this, opts);
107
- });
108
- };
109
-
110
- $.blockUI.version = 2.60; // 2nd generation blocking at no extra cost!
111
-
112
- // override these in your code to change the default behavior and style
113
- $.blockUI.defaults = {
114
- // message displayed when blocking (use null for no message)
115
- message: '<h1>Please wait...</h1>',
116
-
117
- title: null, // title string; only used when theme == true
118
- draggable: true, // only used when theme == true (requires jquery-ui.js to be loaded)
119
-
120
- theme: false, // set to true to use with jQuery UI themes
121
-
122
- // styles for the message when blocking; if you wish to disable
123
- // these and use an external stylesheet then do this in your code:
124
- // $.blockUI.defaults.css = {};
125
- css: {
126
- padding: 0,
127
- margin: 0,
128
- width: '30%',
129
- top: '40%',
130
- left: '35%',
131
- textAlign: 'center',
132
- color: '#000',
133
- border: '3px solid #aaa',
134
- backgroundColor:'#fff',
135
- cursor: 'wait'
136
- },
137
-
138
- // minimal style set used when themes are used
139
- themedCSS: {
140
- width: '30%',
141
- top: '40%',
142
- left: '35%'
143
- },
144
-
145
- // styles for the overlay
146
- overlayCSS: {
147
- backgroundColor: '#000',
148
- opacity: 0.6,
149
- cursor: 'wait'
150
- },
151
-
152
- // style to replace wait cursor before unblocking to correct issue
153
- // of lingering wait cursor
154
- cursorReset: 'default',
155
-
156
- // styles applied when using $.growlUI
157
- growlCSS: {
158
- width: '350px',
159
- top: '10px',
160
- left: '',
161
- right: '10px',
162
- border: 'none',
163
- padding: '5px',
164
- opacity: 0.6,
165
- cursor: 'default',
166
- color: '#fff',
167
- backgroundColor: '#000',
168
- '-webkit-border-radius':'10px',
169
- '-moz-border-radius': '10px',
170
- 'border-radius': '10px'
171
- },
172
-
173
- // IE issues: 'about:blank' fails on HTTPS and javascript:false is s-l-o-w
174
- // (hat tip to Jorge H. N. de Vasconcelos)
175
- /*jshint scripturl:true */
176
- iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank',
177
-
178
- // force usage of iframe in non-IE browsers (handy for blocking applets)
179
- forceIframe: false,
180
-
181
- // z-index for the blocking overlay
182
- baseZ: 1000,
183
-
184
- // set these to true to have the message automatically centered
185
- centerX: true, // <-- only effects element blocking (page block controlled via css above)
186
- centerY: true,
187
-
188
- // allow body element to be stetched in ie6; this makes blocking look better
189
- // on "short" pages. disable if you wish to prevent changes to the body height
190
- allowBodyStretch: true,
191
-
192
- // enable if you want key and mouse events to be disabled for content that is blocked
193
- bindEvents: true,
194
-
195
- // be default blockUI will supress tab navigation from leaving blocking content
196
- // (if bindEvents is true)
197
- constrainTabKey: true,
198
-
199
- // fadeIn time in millis; set to 0 to disable fadeIn on block
200
- fadeIn: 200,
201
-
202
- // fadeOut time in millis; set to 0 to disable fadeOut on unblock
203
- fadeOut: 400,
204
-
205
- // time in millis to wait before auto-unblocking; set to 0 to disable auto-unblock
206
- timeout: 0,
207
-
208
- // disable if you don't want to show the overlay
209
- showOverlay: true,
210
-
211
- // if true, focus will be placed in the first available input field when
212
- // page blocking
213
- focusInput: true,
214
-
215
- // elements that can receive focus
216
- focusableElements: ':input:enabled:visible',
217
-
218
- // suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity)
219
- // no longer needed in 2012
220
- // applyPlatformOpacityRules: true,
221
-
222
- // callback method invoked when fadeIn has completed and blocking message is visible
223
- onBlock: null,
224
-
225
- // callback method invoked when unblocking has completed; the callback is
226
- // passed the element that has been unblocked (which is the window object for page
227
- // blocks) and the options that were passed to the unblock call:
228
- // onUnblock(element, options)
229
- onUnblock: null,
230
-
231
- // callback method invoked when the overlay area is clicked.
232
- // setting this will turn the cursor to a pointer, otherwise cursor defined in overlayCss will be used.
233
- onOverlayClick: null,
234
-
235
- // don't ask; if you really must know: http://groups.google.com/group/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493
236
- quirksmodeOffsetHack: 4,
237
-
238
- // class name of the message block
239
- blockMsgClass: 'blockMsg',
240
-
241
- // if it is already blocked, then ignore it (don't unblock and reblock)
242
- ignoreIfBlocked: false
243
- };
244
-
245
- // private data and functions follow...
246
-
247
- var pageBlock = null;
248
- var pageBlockEls = [];
249
-
250
- function install(el, opts) {
251
- var css, themedCSS;
252
- var full = (el == window);
253
- var msg = (opts && opts.message !== undefined ? opts.message : undefined);
254
- opts = $.extend({}, $.blockUI.defaults, opts || {});
255
-
256
- if (opts.ignoreIfBlocked && $(el).data('blockUI.isBlocked'))
257
- return;
258
-
259
- opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {});
260
- css = $.extend({}, $.blockUI.defaults.css, opts.css || {});
261
- if (opts.onOverlayClick)
262
- opts.overlayCSS.cursor = 'pointer';
263
-
264
- themedCSS = $.extend({}, $.blockUI.defaults.themedCSS, opts.themedCSS || {});
265
- msg = msg === undefined ? opts.message : msg;
266
-
267
- // remove the current block (if there is one)
268
- if (full && pageBlock)
269
- remove(window, {fadeOut:0});
270
-
271
- // if an existing element is being used as the blocking content then we capture
272
- // its current place in the DOM (and current display style) so we can restore
273
- // it when we unblock
274
- if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) {
275
- var node = msg.jquery ? msg[0] : msg;
276
- var data = {};
277
- $(el).data('blockUI.history', data);
278
- data.el = node;
279
- data.parent = node.parentNode;
280
- data.display = node.style.display;
281
- data.position = node.style.position;
282
- if (data.parent)
283
- data.parent.removeChild(node);
284
- }
285
-
286
- $(el).data('blockUI.onUnblock', opts.onUnblock);
287
- var z = opts.baseZ;
288
-
289
- // blockUI uses 3 layers for blocking, for simplicity they are all used on every platform;
290
- // layer1 is the iframe layer which is used to supress bleed through of underlying content
291
- // layer2 is the overlay layer which has opacity and a wait cursor (by default)
292
- // layer3 is the message content that is displayed while blocking
293
- var lyr1, lyr2, lyr3, s;
294
- if (msie || opts.forceIframe)
295
- lyr1 = $('<iframe class="blockUI" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+opts.iframeSrc+'"></iframe>');
296
- else
297
- lyr1 = $('<div class="blockUI" style="display:none"></div>');
298
-
299
- if (opts.theme)
300
- lyr2 = $('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:'+ (z++) +';display:none"></div>');
301
- else
302
- lyr2 = $('<div class="blockUI blockOverlay" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');
303
-
304
- if (opts.theme && full) {
305
- s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:fixed">';
306
- if ( opts.title ) {
307
- s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || '&nbsp;')+'</div>';
308
- }
309
- s += '<div class="ui-widget-content ui-dialog-content"></div>';
310
- s += '</div>';
311
- }
312
- else if (opts.theme) {
313
- s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:absolute">';
314
- if ( opts.title ) {
315
- s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || '&nbsp;')+'</div>';
316
- }
317
- s += '<div class="ui-widget-content ui-dialog-content"></div>';
318
- s += '</div>';
319
- }
320
- else if (full) {
321
- s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage" style="z-index:'+(z+10)+';display:none;position:fixed"></div>';
322
- }
323
- else {
324
- s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement" style="z-index:'+(z+10)+';display:none;position:absolute"></div>';
325
- }
326
- lyr3 = $(s);
327
-
328
- // if we have a message, style it
329
- if (msg) {
330
- if (opts.theme) {
331
- lyr3.css(themedCSS);
332
- lyr3.addClass('ui-widget-content');
333
- }
334
- else
335
- lyr3.css(css);
336
- }
337
-
338
- // style the overlay
339
- if (!opts.theme /*&& (!opts.applyPlatformOpacityRules)*/)
340
- lyr2.css(opts.overlayCSS);
341
- lyr2.css('position', full ? 'fixed' : 'absolute');
342
-
343
- // make iframe layer transparent in IE
344
- if (msie || opts.forceIframe)
345
- lyr1.css('opacity',0.0);
346
-
347
- //$([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el);
348
- var layers = [lyr1,lyr2,lyr3], $par = full ? $('body') : $(el);
349
- $.each(layers, function() {
350
- this.appendTo($par);
351
- });
352
-
353
- if (opts.theme && opts.draggable && $.fn.draggable) {
354
- lyr3.draggable({
355
- handle: '.ui-dialog-titlebar',
356
- cancel: 'li'
357
- });
358
- }
359
-
360
- // ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling)
361
- var expr = setExpr && (!$.support.boxModel || $('object,embed', full ? null : el).length > 0);
362
- if (ie6 || expr) {
363
- // give body 100% height
364
- if (full && opts.allowBodyStretch && $.support.boxModel)
365
- $('html,body').css('height','100%');
366
-
367
- // fix ie6 issue when blocked element has a border width
368
- if ((ie6 || !$.support.boxModel) && !full) {
369
- var t = sz(el,'borderTopWidth'), l = sz(el,'borderLeftWidth');
370
- var fixT = t ? '(0 - '+t+')' : 0;
371
- var fixL = l ? '(0 - '+l+')' : 0;
372
- }
373
-
374
- // simulate fixed position
375
- $.each(layers, function(i,o) {
376
- var s = o[0].style;
377
- s.position = 'absolute';
378
- if (i < 2) {
379
- if (full)
380
- s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"');
381
- else
382
- s.setExpression('height','this.parentNode.offsetHeight + "px"');
383
- if (full)
384
- s.setExpression('width','jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"');
385
- else
386
- s.setExpression('width','this.parentNode.offsetWidth + "px"');
387
- if (fixL) s.setExpression('left', fixL);
388
- if (fixT) s.setExpression('top', fixT);
389
- }
390
- else if (opts.centerY) {
391
- if (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');
392
- s.marginTop = 0;
393
- }
394
- else if (!opts.centerY && full) {
395
- var top = (opts.css && opts.css.top) ? parseInt(opts.css.top, 10) : 0;
396
- var expression = '((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"';
397
- s.setExpression('top',expression);
398
- }
399
- });
400
- }
401
-
402
- // show the message
403
- if (msg) {
404
- if (opts.theme)
405
- lyr3.find('.ui-widget-content').append(msg);
406
- else
407
- lyr3.append(msg);
408
- if (msg.jquery || msg.nodeType)
409
- $(msg).show();
410
- }
411
-
412
- if ((msie || opts.forceIframe) && opts.showOverlay)
413
- lyr1.show(); // opacity is zero
414
- if (opts.fadeIn) {
415
- var cb = opts.onBlock ? opts.onBlock : noOp;
416
- var cb1 = (opts.showOverlay && !msg) ? cb : noOp;
417
- var cb2 = msg ? cb : noOp;
418
- if (opts.showOverlay)
419
- lyr2._fadeIn(opts.fadeIn, cb1);
420
- if (msg)
421
- lyr3._fadeIn(opts.fadeIn, cb2);
422
- }
423
- else {
424
- if (opts.showOverlay)
425
- lyr2.show();
426
- if (msg)
427
- lyr3.show();
428
- if (opts.onBlock)
429
- opts.onBlock();
430
- }
431
-
432
- // bind key and mouse events
433
- bind(1, el, opts);
434
-
435
- if (full) {
436
- pageBlock = lyr3[0];
437
- pageBlockEls = $(opts.focusableElements,pageBlock);
438
- if (opts.focusInput)
439
- setTimeout(focus, 20);
440
- }
441
- else
442
- center(lyr3[0], opts.centerX, opts.centerY);
443
-
444
- if (opts.timeout) {
445
- // auto-unblock
446
- var to = setTimeout(function() {
447
- if (full)
448
- $.unblockUI(opts);
449
- else
450
- $(el).unblock(opts);
451
- }, opts.timeout);
452
- $(el).data('blockUI.timeout', to);
453
- }
454
- }
455
-
456
- // remove the block
457
- function remove(el, opts) {
458
- var count;
459
- var full = (el == window);
460
- var $el = $(el);
461
- var data = $el.data('blockUI.history');
462
- var to = $el.data('blockUI.timeout');
463
- if (to) {
464
- clearTimeout(to);
465
- $el.removeData('blockUI.timeout');
466
- }
467
- opts = $.extend({}, $.blockUI.defaults, opts || {});
468
- bind(0, el, opts); // unbind events
469
-
470
- if (opts.onUnblock === null) {
471
- opts.onUnblock = $el.data('blockUI.onUnblock');
472
- $el.removeData('blockUI.onUnblock');
473
- }
474
-
475
- var els;
476
- if (full) // crazy selector to handle odd field errors in ie6/7
477
- els = $('body').children().filter('.blockUI').add('body > .blockUI');
478
- else
479
- els = $el.find('>.blockUI');
480
-
481
- // fix cursor issue
482
- if ( opts.cursorReset ) {
483
- if ( els.length > 1 )
484
- els[1].style.cursor = opts.cursorReset;
485
- if ( els.length > 2 )
486
- els[2].style.cursor = opts.cursorReset;
487
- }
488
-
489
- if (full)
490
- pageBlock = pageBlockEls = null;
491
-
492
- if (opts.fadeOut) {
493
- count = els.length;
494
- els.fadeOut(opts.fadeOut, function() {
495
- if ( --count === 0)
496
- reset(els,data,opts,el);
497
- });
498
- }
499
- else
500
- reset(els, data, opts, el);
501
- }
502
-
503
- // move blocking element back into the DOM where it started
504
- function reset(els,data,opts,el) {
505
- var $el = $(el);
506
- els.each(function(i,o) {
507
- // remove via DOM calls so we don't lose event handlers
508
- if (this.parentNode)
509
- this.parentNode.removeChild(this);
510
- });
511
-
512
- if (data && data.el) {
513
- data.el.style.display = data.display;
514
- data.el.style.position = data.position;
515
- if (data.parent)
516
- data.parent.appendChild(data.el);
517
- $el.removeData('blockUI.history');
518
- }
519
-
520
- if ($el.data('blockUI.static')) {
521
- $el.css('position', 'static'); // #22
522
- }
523
-
524
- if (typeof opts.onUnblock == 'function')
525
- opts.onUnblock(el,opts);
526
-
527
- // fix issue in Safari 6 where block artifacts remain until reflow
528
- var body = $(document.body), w = body.width(), cssW = body[0].style.width;
529
- body.width(w-1).width(w);
530
- body[0].style.width = cssW;
531
- }
532
-
533
- // bind/unbind the handler
534
- function bind(b, el, opts) {
535
- var full = el == window, $el = $(el);
536
-
537
- // don't bother unbinding if there is nothing to unbind
538
- if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked')))
539
- return;
540
-
541
- $el.data('blockUI.isBlocked', b);
542
-
543
- // don't bind events when overlay is not in use or if bindEvents is false
544
- if (!full || !opts.bindEvents || (b && !opts.showOverlay))
545
- return;
546
-
547
- // bind anchors and inputs for mouse and key events
548
- var events = 'mousedown mouseup keydown keypress keyup touchstart touchend touchmove';
549
- if (b)
550
- $(document).bind(events, opts, handler);
551
- else
552
- $(document).unbind(events, handler);
553
-
554
- // former impl...
555
- // var $e = $('a,:input');
556
- // b ? $e.bind(events, opts, handler) : $e.unbind(events, handler);
557
- }
558
-
559
- // event handler to suppress keyboard/mouse events when blocking
560
- function handler(e) {
561
- // allow tab navigation (conditionally)
562
- if (e.keyCode && e.keyCode == 9) {
563
- if (pageBlock && e.data.constrainTabKey) {
564
- var els = pageBlockEls;
565
- var fwd = !e.shiftKey && e.target === els[els.length-1];
566
- var back = e.shiftKey && e.target === els[0];
567
- if (fwd || back) {
568
- setTimeout(function(){focus(back);},10);
569
- return false;
570
- }
571
- }
572
- }
573
- var opts = e.data;
574
- var target = $(e.target);
575
- if (target.hasClass('blockOverlay') && opts.onOverlayClick)
576
- opts.onOverlayClick();
577
-
578
- // allow events within the message content
579
- if (target.parents('div.' + opts.blockMsgClass).length > 0)
580
- return true;
581
-
582
- // allow events for content that is not being blocked
583
- return target.parents().children().filter('div.blockUI').length === 0;
584
- }
585
-
586
- function focus(back) {
587
- if (!pageBlockEls)
588
- return;
589
- var e = pageBlockEls[back===true ? pageBlockEls.length-1 : 0];
590
- if (e)
591
- e.focus();
592
- }
593
-
594
- function center(el, x, y) {
595
- var p = el.parentNode, s = el.style;
596
- var l = ((p.offsetWidth - el.offsetWidth)/2) - sz(p,'borderLeftWidth');
597
- var t = ((p.offsetHeight - el.offsetHeight)/2) - sz(p,'borderTopWidth');
598
- if (x) s.left = l > 0 ? (l+'px') : '0';
599
- if (y) s.top = t > 0 ? (t+'px') : '0';
600
- }
601
-
602
- function sz(el, p) {
603
- return parseInt($.css(el,p),10)||0;
604
- }
605
-
606
- }
607
-
608
-
609
- /*global define:true */
610
- if (typeof define === 'function' && define.amd && define.amd.jQuery) {
611
- define(['jquery'], setup);
612
- } else {
613
- setup(jQuery);
614
- }
615
-
616
  })();
1
+ /*!
2
+ * jQuery blockUI plugin
3
+ * Version 2.61.0-2013.06.06
4
+ * @requires jQuery v1.7 or later
5
+ *
6
+ * Examples at: http://malsup.com/jquery/block/
7
+ * Copyright (c) 2007-2013 M. Alsup
8
+ * Dual licensed under the MIT and GPL licenses:
9
+ * http://www.opensource.org/licenses/mit-license.php
10
+ * http://www.gnu.org/licenses/gpl.html
11
+ *
12
+ * Thanks to Amir-Hossein Sobhi for some excellent contributions!
13
+ */
14
+
15
+ ;(function() {
16
+ /*jshint eqeqeq:false curly:false latedef:false */
17
+ "use strict";
18
+
19
+ function setup($) {
20
+ $.fn._fadeIn = $.fn.fadeIn;
21
+
22
+ var noOp = $.noop || function() {};
23
+
24
+ // this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle
25
+ // retarded userAgent strings on Vista)
26
+ var msie = /MSIE/.test(navigator.userAgent);
27
+ var ie6 = /MSIE 6.0/.test(navigator.userAgent) && ! /MSIE 8.0/.test(navigator.userAgent);
28
+ var mode = document.documentMode || 0;
29
+ var setExpr = $.isFunction( document.createElement('div').style.setExpression );
30
+
31
+ // global $ methods for blocking/unblocking the entire page
32
+ $.blockUI = function(opts) { install(window, opts); };
33
+ $.unblockUI = function(opts) { remove(window, opts); };
34
+
35
+ // convenience method for quick growl-like notifications (http://www.google.com/search?q=growl)
36
+ $.growlUI = function(title, message, timeout, onClose) {
37
+ var $m = $('<div class="growlUI"></div>');
38
+ if (title) $m.append('<h1>'+title+'</h1>');
39
+ if (message) $m.append('<h2>'+message+'</h2>');
40
+ if (timeout === undefined) timeout = 3000;
41
+
42
+ // Added by konapun: Set timeout to 30 seconds if this growl is moused over, like normal toast notifications
43
+ var callBlock = function(opts) {
44
+ opts = opts || {};
45
+
46
+ $.blockUI({
47
+ message: $m,
48
+ fadeIn : typeof opts.fadeIn !== 'undefined' ? opts.fadeIn : 700,
49
+ fadeOut: typeof opts.fadeOut !== 'undefined' ? opts.fadeOut : 1000,
50
+ timeout: typeof opts.timeout !== 'undefined' ? opts.timeout : timeout,
51
+ centerY: false,
52
+ showOverlay: false,
53
+ onUnblock: onClose,
54
+ css: $.blockUI.defaults.growlCSS
55
+ });
56
+ };
57
+
58
+ callBlock();
59
+ var nonmousedOpacity = $m.css('opacity');
60
+ $m.mouseover(function() {
61
+ callBlock({
62
+ fadeIn: 0,
63
+ timeout: 30000
64
+ });
65
+
66
+ var displayBlock = $('.blockMsg');
67
+ displayBlock.stop(); // cancel fadeout if it has started
68
+ displayBlock.fadeTo(300, 1); // make it easier to read the message by removing transparency
69
+ }).mouseout(function() {
70
+ $('.blockMsg').fadeOut(1000);
71
+ });
72
+ // End konapun additions
73
+ };
74
+
75
+ // plugin method for blocking element content
76
+ $.fn.block = function(opts) {
77
+ if ( this[0] === window ) {
78
+ $.blockUI( opts );
79
+ return this;
80
+ }
81
+ var fullOpts = $.extend({}, $.blockUI.defaults, opts || {});
82
+ this.each(function() {
83
+ var $el = $(this);
84
+ if (fullOpts.ignoreIfBlocked && $el.data('blockUI.isBlocked'))
85
+ return;
86
+ $el.unblock({ fadeOut: 0 });
87
+ });
88
+
89
+ return this.each(function() {
90
+ if ($.css(this,'position') == 'static') {
91
+ this.style.position = 'relative';
92
+ $(this).data('blockUI.static', true);
93
+ }
94
+ this.style.zoom = 1; // force 'hasLayout' in ie
95
+ install(this, opts);
96
+ });
97
+ };
98
+
99
+ // plugin method for unblocking element content
100
+ $.fn.unblock = function(opts) {
101
+ if ( this[0] === window ) {
102
+ $.unblockUI( opts );
103
+ return this;
104
+ }
105
+ return this.each(function() {
106
+ remove(this, opts);
107
+ });
108
+ };
109
+
110
+ $.blockUI.version = 2.60; // 2nd generation blocking at no extra cost!
111
+
112
+ // override these in your code to change the default behavior and style
113
+ $.blockUI.defaults = {
114
+ // message displayed when blocking (use null for no message)
115
+ message: '<h1>Please wait...</h1>',
116
+
117
+ title: null, // title string; only used when theme == true
118
+ draggable: true, // only used when theme == true (requires jquery-ui.js to be loaded)
119
+
120
+ theme: false, // set to true to use with jQuery UI themes
121
+
122
+ // styles for the message when blocking; if you wish to disable
123
+ // these and use an external stylesheet then do this in your code:
124
+ // $.blockUI.defaults.css = {};
125
+ css: {
126
+ padding: 0,
127
+ margin: 0,
128
+ width: '30%',
129
+ top: '40%',
130
+ left: '35%',
131
+ textAlign: 'center',
132
+ color: '#000',
133
+ border: '3px solid #aaa',
134
+ backgroundColor:'#fff',
135
+ cursor: 'wait'
136
+ },
137
+
138
+ // minimal style set used when themes are used
139
+ themedCSS: {
140
+ width: '30%',
141
+ top: '40%',
142
+ left: '35%'
143
+ },
144
+
145
+ // styles for the overlay
146
+ overlayCSS: {
147
+ backgroundColor: '#000',
148
+ opacity: 0.6,
149
+ cursor: 'wait'
150
+ },
151
+
152
+ // style to replace wait cursor before unblocking to correct issue
153
+ // of lingering wait cursor
154
+ cursorReset: 'default',
155
+
156
+ // styles applied when using $.growlUI
157
+ growlCSS: {
158
+ width: '350px',
159
+ top: '10px',
160
+ left: '',
161
+ right: '10px',
162
+ border: 'none',
163
+ padding: '5px',
164
+ opacity: 0.6,
165
+ cursor: 'default',
166
+ color: '#fff',
167
+ backgroundColor: '#000',
168
+ '-webkit-border-radius':'10px',
169
+ '-moz-border-radius': '10px',
170
+ 'border-radius': '10px'
171
+ },
172
+
173
+ // IE issues: 'about:blank' fails on HTTPS and javascript:false is s-l-o-w
174
+ // (hat tip to Jorge H. N. de Vasconcelos)
175
+ /*jshint scripturl:true */
176
+ iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank',
177
+
178
+ // force usage of iframe in non-IE browsers (handy for blocking applets)
179
+ forceIframe: false,
180
+
181
+ // z-index for the blocking overlay
182
+ baseZ: 1000,
183
+
184
+ // set these to true to have the message automatically centered
185
+ centerX: true, // <-- only effects element blocking (page block controlled via css above)
186
+ centerY: true,
187
+
188
+ // allow body element to be stetched in ie6; this makes blocking look better
189
+ // on "short" pages. disable if you wish to prevent changes to the body height
190
+ allowBodyStretch: true,
191
+
192
+ // enable if you want key and mouse events to be disabled for content that is blocked
193
+ bindEvents: true,
194
+
195
+ // be default blockUI will supress tab navigation from leaving blocking content
196
+ // (if bindEvents is true)
197
+ constrainTabKey: true,
198
+
199
+ // fadeIn time in millis; set to 0 to disable fadeIn on block
200
+ fadeIn: 200,
201
+
202
+ // fadeOut time in millis; set to 0 to disable fadeOut on unblock
203
+ fadeOut: 400,
204
+
205
+ // time in millis to wait before auto-unblocking; set to 0 to disable auto-unblock
206
+ timeout: 0,
207
+
208
+ // disable if you don't want to show the overlay
209
+ showOverlay: true,
210
+
211
+ // if true, focus will be placed in the first available input field when
212
+ // page blocking
213
+ focusInput: true,
214
+
215
+ // elements that can receive focus
216
+ focusableElements: ':input:enabled:visible',
217
+
218
+ // suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity)
219
+ // no longer needed in 2012
220
+ // applyPlatformOpacityRules: true,
221
+
222
+ // callback method invoked when fadeIn has completed and blocking message is visible
223
+ onBlock: null,
224
+
225
+ // callback method invoked when unblocking has completed; the callback is
226
+ // passed the element that has been unblocked (which is the window object for page
227
+ // blocks) and the options that were passed to the unblock call:
228
+ // onUnblock(element, options)
229
+ onUnblock: null,
230
+
231
+ // callback method invoked when the overlay area is clicked.
232
+ // setting this will turn the cursor to a pointer, otherwise cursor defined in overlayCss will be used.
233
+ onOverlayClick: null,
234
+
235
+ // don't ask; if you really must know: http://groups.google.com/group/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493
236
+ quirksmodeOffsetHack: 4,
237
+
238
+ // class name of the message block
239
+ blockMsgClass: 'blockMsg',
240
+
241
+ // if it is already blocked, then ignore it (don't unblock and reblock)
242
+ ignoreIfBlocked: false
243
+ };
244
+
245
+ // private data and functions follow...
246
+
247
+ var pageBlock = null;
248
+ var pageBlockEls = [];
249
+
250
+ function install(el, opts) {
251
+ var css, themedCSS;
252
+ var full = (el == window);
253
+ var msg = (opts && opts.message !== undefined ? opts.message : undefined);
254
+ opts = $.extend({}, $.blockUI.defaults, opts || {});
255
+
256
+ if (opts.ignoreIfBlocked && $(el).data('blockUI.isBlocked'))
257
+ return;
258
+
259
+ opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {});
260
+ css = $.extend({}, $.blockUI.defaults.css, opts.css || {});
261
+ if (opts.onOverlayClick)
262
+ opts.overlayCSS.cursor = 'pointer';
263
+
264
+ themedCSS = $.extend({}, $.blockUI.defaults.themedCSS, opts.themedCSS || {});
265
+ msg = msg === undefined ? opts.message : msg;
266
+
267
+ // remove the current block (if there is one)
268
+ if (full && pageBlock)
269
+ remove(window, {fadeOut:0});
270
+
271
+ // if an existing element is being used as the blocking content then we capture
272
+ // its current place in the DOM (and current display style) so we can restore
273
+ // it when we unblock
274
+ if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) {
275
+ var node = msg.jquery ? msg[0] : msg;
276
+ var data = {};
277
+ $(el).data('blockUI.history', data);
278
+ data.el = node;
279
+ data.parent = node.parentNode;
280
+ data.display = node.style.display;
281
+ data.position = node.style.position;
282
+ if (data.parent)
283
+ data.parent.removeChild(node);
284
+ }
285
+
286
+ $(el).data('blockUI.onUnblock', opts.onUnblock);
287
+ var z = opts.baseZ;
288
+
289
+ // blockUI uses 3 layers for blocking, for simplicity they are all used on every platform;
290
+ // layer1 is the iframe layer which is used to supress bleed through of underlying content
291
+ // layer2 is the overlay layer which has opacity and a wait cursor (by default)
292
+ // layer3 is the message content that is displayed while blocking
293
+ var lyr1, lyr2, lyr3, s;
294
+ if (msie || opts.forceIframe)
295
+ lyr1 = $('<iframe class="blockUI" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+opts.iframeSrc+'"></iframe>');
296
+ else
297
+ lyr1 = $('<div class="blockUI" style="display:none"></div>');
298
+
299
+ if (opts.theme)
300
+ lyr2 = $('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:'+ (z++) +';display:none"></div>');
301
+ else
302
+ lyr2 = $('<div class="blockUI blockOverlay" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');
303
+
304
+ if (opts.theme && full) {
305
+ s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:fixed">';
306
+ if ( opts.title ) {
307
+ s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || '&nbsp;')+'</div>';
308
+ }
309
+ s += '<div class="ui-widget-content ui-dialog-content"></div>';
310
+ s += '</div>';
311
+ }
312
+ else if (opts.theme) {
313
+ s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:absolute">';
314
+ if ( opts.title ) {
315
+ s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || '&nbsp;')+'</div>';
316
+ }
317
+ s += '<div class="ui-widget-content ui-dialog-content"></div>';
318
+ s += '</div>';
319
+ }
320
+ else if (full) {
321
+ s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage" style="z-index:'+(z+10)+';display:none;position:fixed"></div>';
322
+ }
323
+ else {
324
+ s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement" style="z-index:'+(z+10)+';display:none;position:absolute"></div>';
325
+ }
326
+ lyr3 = $(s);
327
+
328
+ // if we have a message, style it
329
+ if (msg) {
330
+ if (opts.theme) {
331
+ lyr3.css(themedCSS);
332
+ lyr3.addClass('ui-widget-content');
333
+ }
334
+ else
335
+ lyr3.css(css);
336
+ }
337
+
338
+ // style the overlay
339
+ if (!opts.theme /*&& (!opts.applyPlatformOpacityRules)*/)
340
+ lyr2.css(opts.overlayCSS);
341
+ lyr2.css('position', full ? 'fixed' : 'absolute');
342
+
343
+ // make iframe layer transparent in IE
344
+ if (msie || opts.forceIframe)
345
+ lyr1.css('opacity',0.0);
346
+
347
+ //$([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el);
348
+ var layers = [lyr1,lyr2,lyr3], $par = full ? $('body') : $(el);
349
+ $.each(layers, function() {
350
+ this.appendTo($par);
351
+ });
352
+
353
+ if (opts.theme && opts.draggable && $.fn.draggable) {
354
+ lyr3.draggable({
355
+ handle: '.ui-dialog-titlebar',
356
+ cancel: 'li'
357
+ });
358
+ }
359
+
360
+ // ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling)
361
+ var expr = setExpr && (!$.support.boxModel || $('object,embed', full ? null : el).length > 0);
362
+ if (ie6 || expr) {
363
+ // give body 100% height
364
+ if (full && opts.allowBodyStretch && $.support.boxModel)
365
+ $('html,body').css('height','100%');
366
+
367
+ // fix ie6 issue when blocked element has a border width
368
+ if ((ie6 || !$.support.boxModel) && !full) {
369
+ var t = sz(el,'borderTopWidth'), l = sz(el,'borderLeftWidth');
370
+ var fixT = t ? '(0 - '+t+')' : 0;
371
+ var fixL = l ? '(0 - '+l+')' : 0;
372
+ }
373
+
374
+ // simulate fixed position
375
+ $.each(layers, function(i,o) {
376
+ var s = o[0].style;
377
+ s.position = 'absolute';
378
+ if (i < 2) {
379
+ if (full)
380
+ s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"');
381
+ else
382
+ s.setExpression('height','this.parentNode.offsetHeight + "px"');
383
+ if (full)
384
+ s.setExpression('width','jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"');
385
+ else
386
+ s.setExpression('width','this.parentNode.offsetWidth + "px"');
387
+ if (fixL) s.setExpression('left', fixL);
388
+ if (fixT) s.setExpression('top', fixT);
389
+ }
390
+ else if (opts.centerY) {
391
+ if (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');
392
+ s.marginTop = 0;
393
+ }
394
+ else if (!opts.centerY && full) {
395
+ var top = (opts.css && opts.css.top) ? parseInt(opts.css.top, 10) : 0;
396
+ var expression = '((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"';
397
+ s.setExpression('top',expression);
398
+ }
399
+ });
400
+ }
401
+
402
+ // show the message
403
+ if (msg) {
404
+ if (opts.theme)
405
+ lyr3.find('.ui-widget-content').append(msg);
406
+ else
407
+ lyr3.append(msg);
408
+ if (msg.jquery || msg.nodeType)
409
+ $(msg).show();
410
+ }
411
+
412
+ if ((msie || opts.forceIframe) && opts.showOverlay)
413
+ lyr1.show(); // opacity is zero
414
+ if (opts.fadeIn) {
415
+ var cb = opts.onBlock ? opts.onBlock : noOp;
416
+ var cb1 = (opts.showOverlay && !msg) ? cb : noOp;
417
+ var cb2 = msg ? cb : noOp;
418
+ if (opts.showOverlay)
419
+ lyr2._fadeIn(opts.fadeIn, cb1);
420
+ if (msg)
421
+ lyr3._fadeIn(opts.fadeIn, cb2);
422
+ }
423
+ else {
424
+ if (opts.showOverlay)
425
+ lyr2.show();
426
+ if (msg)
427
+ lyr3.show();
428
+ if (opts.onBlock)
429
+ opts.onBlock();
430
+ }
431
+
432
+ // bind key and mouse events
433
+ bind(1, el, opts);
434
+
435
+ if (full) {
436
+ pageBlock = lyr3[0];
437
+ pageBlockEls = $(opts.focusableElements,pageBlock);
438
+ if (opts.focusInput)
439
+ setTimeout(focus, 20);
440
+ }
441
+ else
442
+ center(lyr3[0], opts.centerX, opts.centerY);
443
+
444
+ if (opts.timeout) {
445
+ // auto-unblock
446
+ var to = setTimeout(function() {
447
+ if (full)
448
+ $.unblockUI(opts);
449
+ else
450
+ $(el).unblock(opts);
451
+ }, opts.timeout);
452
+ $(el).data('blockUI.timeout', to);
453
+ }
454
+ }
455
+
456
+ // remove the block
457
+ function remove(el, opts) {
458
+ var count;
459
+ var full = (el == window);
460
+ var $el = $(el);
461
+ var data = $el.data('blockUI.history');
462
+ var to = $el.data('blockUI.timeout');
463
+ if (to) {
464
+ clearTimeout(to);
465
+ $el.removeData('blockUI.timeout');
466
+ }
467
+ opts = $.extend({}, $.blockUI.defaults, opts || {});
468
+ bind(0, el, opts); // unbind events
469
+
470
+ if (opts.onUnblock === null) {
471
+ opts.onUnblock = $el.data('blockUI.onUnblock');
472
+ $el.removeData('blockUI.onUnblock');
473
+ }
474
+
475
+ var els;
476
+ if (full) // crazy selector to handle odd field errors in ie6/7
477
+ els = $('body').children().filter('.blockUI').add('body > .blockUI');
478
+ else
479
+ els = $el.find('>.blockUI');
480
+
481
+ // fix cursor issue
482
+ if ( opts.cursorReset ) {
483
+ if ( els.length > 1 )
484
+ els[1].style.cursor = opts.cursorReset;
485
+ if ( els.length > 2 )
486
+ els[2].style.cursor = opts.cursorReset;
487
+ }
488
+
489
+ if (full)
490
+ pageBlock = pageBlockEls = null;
491
+
492
+ if (opts.fadeOut) {
493
+ count = els.length;
494
+ els.fadeOut(opts.fadeOut, function() {
495
+ if ( --count === 0)
496
+ reset(els,data,opts,el);
497
+ });
498
+ }
499
+ else
500
+ reset(els, data, opts, el);
501
+ }
502
+
503
+ // move blocking element back into the DOM where it started
504
+ function reset(els,data,opts,el) {
505
+ var $el = $(el);
506
+ els.each(function(i,o) {
507
+ // remove via DOM calls so we don't lose event handlers
508
+ if (this.parentNode)
509
+ this.parentNode.removeChild(this);
510
+ });
511
+
512
+ if (data && data.el) {
513
+ data.el.style.display = data.display;
514
+ data.el.style.position = data.position;
515
+ if (data.parent)
516
+ data.parent.appendChild(data.el);
517
+ $el.removeData('blockUI.history');
518
+ }
519
+
520
+ if ($el.data('blockUI.static')) {
521
+ $el.css('position', 'static'); // #22
522
+ }
523
+
524
+ if (typeof opts.onUnblock == 'function')
525
+ opts.onUnblock(el,opts);
526
+
527
+ // fix issue in Safari 6 where block artifacts remain until reflow
528
+ var body = $(document.body), w = body.width(), cssW = body[0].style.width;
529
+ body.width(w-1).width(w);
530
+ body[0].style.width = cssW;
531
+ }
532
+
533
+ // bind/unbind the handler
534
+ function bind(b, el, opts) {
535
+ var full = el == window, $el = $(el);
536
+
537
+ // don't bother unbinding if there is nothing to unbind
538
+ if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked')))
539
+ return;
540
+
541
+ $el.data('blockUI.isBlocked', b);
542
+
543
+ // don't bind events when overlay is not in use or if bindEvents is false
544
+ if (!full || !opts.bindEvents || (b && !opts.showOverlay))
545
+ return;
546
+
547
+ // bind anchors and inputs for mouse and key events
548
+ var events = 'mousedown mouseup keydown keypress keyup touchstart touchend touchmove';
549
+ if (b)
550
+ $(document).bind(events, opts, handler);
551
+ else
552
+ $(document).unbind(events, handler);
553
+
554
+ // former impl...
555
+ // var $e = $('a,:input');
556
+ // b ? $e.bind(events, opts, handler) : $e.unbind(events, handler);
557
+ }
558
+
559
+ // event handler to suppress keyboard/mouse events when blocking
560
+ function handler(e) {
561
+ // allow tab navigation (conditionally)
562
+ if (e.keyCode && e.keyCode == 9) {
563
+ if (pageBlock && e.data.constrainTabKey) {
564
+ var els = pageBlockEls;
565
+ var fwd = !e.shiftKey && e.target === els[els.length-1];
566
+ var back = e.shiftKey && e.target === els[0];
567
+ if (fwd || back) {
568
+ setTimeout(function(){focus(back);},10);
569
+ return false;
570
+ }
571
+ }
572
+ }
573
+ var opts = e.data;
574
+ var target = $(e.target);
575
+ if (target.hasClass('blockOverlay') && opts.onOverlayClick)
576
+ opts.onOverlayClick();
577
+
578
+ // allow events within the message content
579
+ if (target.parents('div.' + opts.blockMsgClass).length > 0)
580
+ return true;
581
+
582
+ // allow events for content that is not being blocked
583
+ return target.parents().children().filter('div.blockUI').length === 0;
584
+ }
585
+
586
+ function focus(back) {
587
+ if (!pageBlockEls)
588
+ return;
589
+ var e = pageBlockEls[back===true ? pageBlockEls.length-1 : 0];
590
+ if (e)
591
+ e.focus();
592
+ }
593
+
594
+ function center(el, x, y) {
595
+ var p = el.parentNode, s = el.style;
596
+ var l = ((p.offsetWidth - el.offsetWidth)/2) - sz(p,'borderLeftWidth');
597
+ var t = ((p.offsetHeight - el.offsetHeight)/2) - sz(p,'borderTopWidth');
598
+ if (x) s.left = l > 0 ? (l+'px') : '0';
599
+ if (y) s.top = t > 0 ? (t+'px') : '0';
600
+ }
601
+
602
+ function sz(el, p) {
603
+ return parseInt($.css(el,p),10)||0;
604
+ }
605
+
606
+ }
607
+
608
+
609
+ /*global define:true */
610
+ if (typeof define === 'function' && define.amd && define.amd.jQuery) {
611
+ define(['jquery'], setup);
612
+ } else {
613
+ setup(jQuery);
614
+ }
615
+
616
  })();
assets/js/chosen/chosen.css CHANGED
@@ -1,413 +1,413 @@
1
- /* @group Base */
2
- .chzn-container {
3
- font-size: 13px;
4
- position: relative;
5
- display: inline-block;
6
- zoom: 1;
7
- *display: inline;
8
- }
9
- .chzn-container .chzn-drop {
10
- background: #fff;
11
- border: 1px solid #aaa;
12
- border-top: 0;
13
- position: absolute;
14
- top: 29px;
15
- left: 0;
16
- -webkit-box-shadow: 0 4px 5px rgba(0,0,0,.15);
17
- -moz-box-shadow : 0 4px 5px rgba(0,0,0,.15);
18
- box-shadow : 0 4px 5px rgba(0,0,0,.15);
19
- z-index: 1010;
20
- }
21
- /* @end */
22
-
23
- /* @group Single Chosen */
24
- .chzn-container-single .chzn-single {
25
- background-color: #ffffff;
26
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0 );
27
- background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(20%, #ffffff), color-stop(50%, #f6f6f6), color-stop(52%, #eeeeee), color-stop(100%, #f4f4f4));
28
- background-image: -webkit-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
29
- background-image: -moz-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
30
- background-image: -o-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
31
- background-image: linear-gradient(#ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
32
- -webkit-border-radius: 5px;
33
- -moz-border-radius : 5px;
34
- border-radius : 5px;
35
- -moz-background-clip : padding;
36
- -webkit-background-clip: padding-box;
37
- background-clip : padding-box;
38
- border: 1px solid #aaaaaa;
39
- -webkit-box-shadow: 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1);
40
- -moz-box-shadow : 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1);
41
- box-shadow : 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1);
42
- display: block;
43
- overflow: hidden;
44
- white-space: nowrap;
45
- position: relative;
46
- height: 23px;
47
- line-height: 24px;
48
- padding: 0 0 0 8px;
49
- color: #444444;
50
- text-decoration: none;
51
- }
52
- .chzn-container-single .chzn-default {
53
- color: #999;
54
- }
55
- .chzn-container-single .chzn-single span {
56
- margin-right: 26px;
57
- display: block;
58
- overflow: hidden;
59
- white-space: nowrap;
60
- -o-text-overflow: ellipsis;
61
- -ms-text-overflow: ellipsis;
62
- text-overflow: ellipsis;
63
- }
64
- .chzn-container-single .chzn-single abbr {
65
- display: block;
66
- position: absolute;
67
- right: 26px;
68
- top: 6px;
69
- width: 12px;
70
- height: 12px;
71
- font-size: 1px;
72
- background: url('chosen-sprite.png') -42px 1px no-repeat;
73
- }
74
- .chzn-container-single .chzn-single abbr:hover {
75
- background-position: -42px -10px;
76
- }
77
- .chzn-container-single.chzn-disabled .chzn-single abbr:hover {
78
- background-position: -42px -10px;
79
- }
80
- .chzn-container-single .chzn-single div {
81
- position: absolute;
82
- right: 0;
83
- top: 0;
84
- display: block;
85
- height: 100%;
86
- width: 18px;
87
- }
88
- .chzn-container-single .chzn-single div b {
89
- background: url('chosen-sprite.png') no-repeat 0px 2px;
90
- display: block;
91
- width: 100%;
92
- height: 100%;
93
- }
94
- .chzn-container-single .chzn-search {
95
- padding: 3px 4px;
96
- position: relative;
97
- margin: 0;
98
- white-space: nowrap;
99
- z-index: 1010;
100
- }
101
- .chzn-container-single .chzn-search input {
102
- background: #fff url('chosen-sprite.png') no-repeat 100% -20px;
103
- background: url('chosen-sprite.png') no-repeat 100% -20px, -webkit-gradient(linear, 0 0, 0 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
104
- background: url('chosen-sprite.png') no-repeat 100% -20px, -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
105
- background: url('chosen-sprite.png') no-repeat 100% -20px, -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
106
- background: url('chosen-sprite.png') no-repeat 100% -20px, -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
107
- background: url('chosen-sprite.png') no-repeat 100% -20px, linear-gradient(#eeeeee 1%, #ffffff 15%);
108
- margin: 1px 0;
109
- padding: 4px 20px 4px 5px;
110
- outline: 0;
111
- border: 1px solid #aaa;
112
- font-family: sans-serif;
113
- font-size: 1em;
114
- }
115
- .chzn-container-single .chzn-drop {
116
- -webkit-border-radius: 0 0 4px 4px;
117
- -moz-border-radius : 0 0 4px 4px;
118
- border-radius : 0 0 4px 4px;
119
- -moz-background-clip : padding;
120
- -webkit-background-clip: padding-box;
121
- background-clip : padding-box;
122
- }
123
- /* @end */
124
-
125
- .chzn-container-single-nosearch .chzn-search input {
126
- position: absolute;
127
- left: -9000px;
128
- }
129
-
130
- /* @group Multi Chosen */
131
- .chzn-container-multi .chzn-choices {
132
- background-color: #fff;
133
- background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
134
- background-image: -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
135
- background-image: -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
136
- background-image: -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
137
- background-image: linear-gradient(#eeeeee 1%, #ffffff 15%);
138
- border: 1px solid #aaa;
139
- margin: 0;
140
- padding: 0;
141
- cursor: text;
142
- overflow: hidden;
143
- height: auto !important;
144
- height: 1%;
145
- position: relative;
146
- }
147
- .chzn-container-multi .chzn-choices li {
148
- float: left;
149
- list-style: none;
150
- }
151
- .chzn-container-multi .chzn-choices .search-field {
152
- white-space: nowrap;
153
- margin: 0;
154
- padding: 0;
155
- }
156
- .chzn-container-multi .chzn-choices .search-field input {
157
- color: #666;
158
- background: transparent !important;
159
- border: 0 !important;
160
- font-family: sans-serif;
161
- font-size: 100%;
162
- height: 15px;
163
- padding: 5px;
164
- margin: 1px 0;
165
- outline: 0;
166
- -webkit-box-shadow: none;
167
- -moz-box-shadow : none;
168
- box-shadow : none;
169
- }
170
- .chzn-container-multi .chzn-choices .search-field .default {
171
- color: #999;
172
- }
173
- .chzn-container-multi .chzn-choices .search-choice {
174
- -webkit-border-radius: 3px;
175
- -moz-border-radius : 3px;
176
- border-radius : 3px;
177
- -moz-background-clip : padding;
178
- -webkit-background-clip: padding-box;
179
- background-clip : padding-box;
180
- background-color: #e4e4e4;
181
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f4f4', endColorstr='#eeeeee', GradientType=0 );
182
- background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
183
- background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
184
- background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
185
- background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
186
- background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
187
- -webkit-box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
188
- -moz-box-shadow : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
189
- box-shadow : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
190
- color: #333;
191
- border: 1px solid #aaaaaa;
192
- line-height: 13px;
193
- padding: 3px 20px 3px 5px;
194
- margin: 3px 0 3px 5px;
195
- position: relative;
196
- cursor: default;
197
- }
198
- .chzn-container-multi .chzn-choices .search-choice.search-choice-disabled {
199
- background-color: #e4e4e4;
200
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f4f4', endColorstr='#eeeeee', GradientType=0 );
201
- background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
202
- background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
203
- background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
204
- background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
205
- background-image: -ms-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
206
- background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
207
- color: #666;
208
- border: 1px solid #cccccc;
209
- padding-right: 5px;
210
- }
211
- .chzn-container-multi .chzn-choices .search-choice-focus {
212
- background: #d4d4d4;
213
- }
214
- .chzn-container-multi .chzn-choices .search-choice .search-choice-close {
215
- display: block;
216
- position: absolute;
217
- right: 3px;
218
- top: 4px;
219
- width: 12px;
220
- height: 12px;
221
- font-size: 1px;
222
- background: url('chosen-sprite.png') -42px 1px no-repeat;
223
- }
224
- .chzn-container-multi .chzn-choices .search-choice .search-choice-close:hover {
225
- background-position: -42px -10px;
226
- }
227
- .chzn-container-multi .chzn-choices .search-choice-focus .search-choice-close {
228
- background-position: -42px -10px;
229
- }
230
- /* @end */
231
-
232
- /* @group Results */
233
- .chzn-container .chzn-results {
234
- margin: 0 4px 4px 0;
235
- max-height: 240px;
236
- padding: 0 0 0 4px;
237
- position: relative;
238
- overflow-x: hidden;
239
- overflow-y: auto;
240
- -webkit-overflow-scrolling: touch;
241
- }
242
- .chzn-container-multi .chzn-results {
243
- margin: -1px 0 0;
244
- padding: 0;
245
- }
246
- .chzn-container .chzn-results li {
247
- display: none;
248
- line-height: 15px;
249
- padding: 5px 6px;
250
- margin: 0;
251
- list-style: none;
252
- }
253
- .chzn-container .chzn-results .active-result {
254
- cursor: pointer;
255
- display: list-item;
256
- }
257
- .chzn-container .chzn-results .highlighted {
258
- background-color: #3875d7;
259
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3875d7', endColorstr='#2a62bc', GradientType=0 );
260
- background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(20%, #3875d7), color-stop(90%, #2a62bc));
261
- background-image: -webkit-linear-gradient(top, #3875d7 20%, #2a62bc 90%);
262
- background-image: -moz-linear-gradient(top, #3875d7 20%, #2a62bc 90%);
263
- background-image: -o-linear-gradient(top, #3875d7 20%, #2a62bc 90%);
264
- background-image: linear-gradient(#3875d7 20%, #2a62bc 90%);
265
- color: #fff;
266
- }
267
- .chzn-container .chzn-results li em {
268
- background: #feffde;
269
- font-style: normal;
270
- }
271
- .chzn-container .chzn-results .highlighted em {
272
- background: transparent;
273
- }
274
- .chzn-container .chzn-results .no-results {
275
- background: #f4f4f4;
276
- display: list-item;
277
- }
278
- .chzn-container .chzn-results .group-result {
279
- cursor: default;
280
- color: #999;
281
- font-weight: bold;
282
- }
283
- .chzn-container .chzn-results .group-option {
284
- padding-left: 15px;
285
- }
286
- .chzn-container-multi .chzn-drop .result-selected {
287
- display: none;
288
- }
289
- .chzn-container .chzn-results-scroll {
290
- background: white;
291
- margin: 0 4px;
292
- position: absolute;
293
- text-align: center;
294
- width: 321px; /* This should by dynamic with js */
295
- z-index: 1;
296
- }
297
- .chzn-container .chzn-results-scroll span {
298
- display: inline-block;
299
- height: 17px;
300
- text-indent: -5000px;
301
- width: 9px;
302
- }
303
- .chzn-container .chzn-results-scroll-down {
304
- bottom: 0;
305
- }
306
- .chzn-container .chzn-results-scroll-down span {
307
- background: url('chosen-sprite.png') no-repeat -4px -3px;
308
- }
309
- .chzn-container .chzn-results-scroll-up span {
310
- background: url('chosen-sprite.png') no-repeat -22px -3px;
311
- }
312
- /* @end */
313
-
314
- /* @group Active */
315
- .chzn-container-active .chzn-single {
316
- -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
317
- -moz-box-shadow : 0 0 5px rgba(0,0,0,.3);
318
- box-shadow : 0 0 5px rgba(0,0,0,.3);
319
- border: 1px solid #5897fb;
320
- }
321
- .chzn-container-active .chzn-single-with-drop {
322
- border: 1px solid #aaa;
323
- -webkit-box-shadow: 0 1px 0 #fff inset;
324
- -moz-box-shadow : 0 1px 0 #fff inset;
325
- box-shadow : 0 1px 0 #fff inset;
326
- background-color: #eee;
327
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0 );
328
- background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(20%, #eeeeee), color-stop(80%, #ffffff));
329
- background-image: -webkit-linear-gradient(top, #eeeeee 20%, #ffffff 80%);
330
- background-image: -moz-linear-gradient(top, #eeeeee 20%, #ffffff 80%);
331
- background-image: -o-linear-gradient(top, #eeeeee 20%, #ffffff 80%);
332
- background-image: linear-gradient(#eeeeee 20%, #ffffff 80%);
333
- -webkit-border-bottom-left-radius : 0;
334
- -webkit-border-bottom-right-radius: 0;
335
- -moz-border-radius-bottomleft : 0;
336
- -moz-border-radius-bottomright: 0;
337
- border-bottom-left-radius : 0;
338
- border-bottom-right-radius: 0;
339
- }
340
- .chzn-container-active .chzn-single-with-drop div {
341
- background: transparent;
342
- border-left: none;
343
- }
344
- .chzn-container-active .chzn-single-with-drop div b {
345
- background-position: -18px 2px;
346
- }
347
- .chzn-container-active .chzn-choices {
348
- -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
349
- -moz-box-shadow : 0 0 5px rgba(0,0,0,.3);
350
- box-shadow : 0 0 5px rgba(0,0,0,.3);
351
- border: 1px solid #5897fb;
352
- }
353
- .chzn-container-active .chzn-choices .search-field input {
354
- color: #111 !important;
355
- }
356
- /* @end */
357
-
358
- /* @group Disabled Support */
359
- .chzn-disabled {
360
- cursor: default;
361
- opacity:0.5 !important;
362
- }
363
- .chzn-disabled .chzn-single {
364
- cursor: default;
365
- }
366
- .chzn-disabled .chzn-choices .search-choice .search-choice-close {
367
- cursor: default;
368
- }
369
-
370
- /* @group Right to Left */
371
- .chzn-rtl { text-align: right; }
372
- .chzn-rtl .chzn-single { padding: 0 8px 0 0; overflow: visible; }
373
- .chzn-rtl .chzn-single span { margin-left: 26px; margin-right: 0; direction: rtl; }
374
-
375
- .chzn-rtl .chzn-single div { left: 3px; right: auto; }
376
- .chzn-rtl .chzn-single abbr {
377
- left: 26px;
378
- right: auto;
379
- }
380
- .chzn-rtl .chzn-choices .search-field input { direction: rtl; }
381
- .chzn-rtl .chzn-choices li { float: right; }
382
- .chzn-rtl .chzn-choices .search-choice { padding: 3px 5px 3px 19px; margin: 3px 5px 3px 0; }
383
- .chzn-rtl .chzn-choices .search-choice .search-choice-close { left: 4px; right: auto; }
384
- .chzn-rtl.chzn-container-single .chzn-results { margin: 0 0 4px 4px; padding: 0 4px 0 0; }
385
- .chzn-rtl .chzn-results .group-option { padding-left: 0; padding-right: 15px; }
386
- .chzn-rtl.chzn-container-active .chzn-single-with-drop div { border-right: none; }
387
- .chzn-rtl .chzn-search input {
388
- background: #fff url('chosen-sprite.png') no-repeat -30px -20px;
389
- background: url('chosen-sprite.png') no-repeat -30px -20px, -webkit-gradient(linear, 0 0, 0 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
390
- background: url('chosen-sprite.png') no-repeat -30px -20px, -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
391
- background: url('chosen-sprite.png') no-repeat -30px -20px, -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
392
- background: url('chosen-sprite.png') no-repeat -30px -20px, -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
393
- background: url('chosen-sprite.png') no-repeat -30px -20px, linear-gradient(#eeeeee 1%, #ffffff 15%);
394
- padding: 4px 5px 4px 20px;
395
- direction: rtl;
396
- }
397
- .chzn-container-single.chzn-rtl .chzn-single div b {
398
- background-position: 6px 2px;
399
- }
400
- .chzn-container-single.chzn-rtl .chzn-single-with-drop div b {
401
- background-position: -12px 2px;
402
- }
403
- /* @end */
404
-
405
- /* @group Retina compatibility */
406
- @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-resolution: 144dpi) {
407
- .chzn-rtl .chzn-search input, .chzn-container-single .chzn-single abbr, .chzn-container-single .chzn-single div b, .chzn-container-single .chzn-search input, .chzn-container-multi .chzn-choices .search-choice .search-choice-close, .chzn-container .chzn-results-scroll-down span, .chzn-container .chzn-results-scroll-up span {
408
- background-image: url('chosen-sprite@2x.png') !important;
409
- background-repeat: no-repeat !important;
410
- background-size: 52px 37px !important;
411
- }
412
- }
413
- /* @end */
1
+ /* @group Base */
2
+ .chzn-container {
3
+ font-size: 13px;
4
+ position: relative;
5
+ display: inline-block;
6
+ zoom: 1;
7
+ *display: inline;
8
+ }
9
+ .chzn-container .chzn-drop {
10
+ background: #fff;
11
+ border: 1px solid #aaa;
12
+ border-top: 0;
13
+ position: absolute;
14
+ top: 29px;
15
+ left: 0;
16
+ -webkit-box-shadow: 0 4px 5px rgba(0,0,0,.15);
17
+ -moz-box-shadow : 0 4px 5px rgba(0,0,0,.15);
18
+ box-shadow : 0 4px 5px rgba(0,0,0,.15);
19
+ z-index: 1010;
20
+ }
21
+ /* @end */
22
+
23
+ /* @group Single Chosen */
24
+ .chzn-container-single .chzn-single {
25
+ background-color: #ffffff;
26
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0 );
27
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(20%, #ffffff), color-stop(50%, #f6f6f6), color-stop(52%, #eeeeee), color-stop(100%, #f4f4f4));
28
+ background-image: -webkit-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
29
+ background-image: -moz-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
30
+ background-image: -o-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
31
+ background-image: linear-gradient(#ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
32
+ -webkit-border-radius: 5px;
33
+ -moz-border-radius : 5px;
34
+ border-radius : 5px;
35
+ -moz-background-clip : padding;
36
+ -webkit-background-clip: padding-box;
37
+ background-clip : padding-box;
38
+ border: 1px solid #aaaaaa;
39
+ -webkit-box-shadow: 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1);
40
+ -moz-box-shadow : 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1);
41
+ box-shadow : 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1);
42
+ display: block;
43
+ overflow: hidden;
44
+ white-space: nowrap;
45
+ position: relative;
46
+ height: 23px;
47
+ line-height: 24px;
48
+ padding: 0 0 0 8px;
49
+ color: #444444;
50
+ text-decoration: none;
51
+ }
52
+ .chzn-container-single .chzn-default {
53
+ color: #999;
54
+ }
55
+ .chzn-container-single .chzn-single span {
56
+ margin-right: 26px;
57
+ display: block;
58
+ overflow: hidden;
59
+ white-space: nowrap;
60
+ -o-text-overflow: ellipsis;
61
+ -ms-text-overflow: ellipsis;
62
+ text-overflow: ellipsis;
63
+ }
64
+ .chzn-container-single .chzn-single abbr {
65
+ display: block;
66
+ position: absolute;
67
+ right: 26px;
68
+ top: 6px;
69
+ width: 12px;
70
+ height: 12px;
71
+ font-size: 1px;
72
+ background: url('chosen-sprite.png') -42px 1px no-repeat;
73
+ }
74
+ .chzn-container-single .chzn-single abbr:hover {
75
+ background-position: -42px -10px;
76
+ }
77
+ .chzn-container-single.chzn-disabled .chzn-single abbr:hover {
78
+ background-position: -42px -10px;
79
+ }
80
+ .chzn-container-single .chzn-single div {
81
+ position: absolute;
82
+ right: 0;
83
+ top: 0;
84
+ display: block;
85
+ height: 100%;
86
+ width: 18px;
87
+ }
88
+ .chzn-container-single .chzn-single div b {
89
+ background: url('chosen-sprite.png') no-repeat 0px 2px;
90
+ display: block;
91
+ width: 100%;
92
+ height: 100%;
93
+ }
94
+ .chzn-container-single .chzn-search {
95
+ padding: 3px 4px;
96
+ position: relative;
97
+ margin: 0;
98
+ white-space: nowrap;
99
+ z-index: 1010;
100
+ }
101
+ .chzn-container-single .chzn-search input {
102
+ background: #fff url('chosen-sprite.png') no-repeat 100% -20px;
103
+ background: url('chosen-sprite.png') no-repeat 100% -20px, -webkit-gradient(linear, 0 0, 0 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
104
+ background: url('chosen-sprite.png') no-repeat 100% -20px, -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
105
+ background: url('chosen-sprite.png') no-repeat 100% -20px, -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
106
+ background: url('chosen-sprite.png') no-repeat 100% -20px, -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
107
+ background: url('chosen-sprite.png') no-repeat 100% -20px, linear-gradient(#eeeeee 1%, #ffffff 15%);
108
+ margin: 1px 0;
109
+ padding: 4px 20px 4px 5px;
110
+ outline: 0;
111
+ border: 1px solid #aaa;
112
+ font-family: sans-serif;
113
+ font-size: 1em;
114
+ }
115
+ .chzn-container-single .chzn-drop {
116
+ -webkit-border-radius: 0 0 4px 4px;
117
+ -moz-border-radius : 0 0 4px 4px;
118
+ border-radius : 0 0 4px 4px;
119
+ -moz-background-clip : padding;
120
+ -webkit-background-clip: padding-box;
121
+ background-clip : padding-box;
122
+ }
123
+ /* @end */
124
+
125
+ .chzn-container-single-nosearch .chzn-search input {
126
+ position: absolute;
127
+ left: -9000px;
128
+ }
129
+
130
+ /* @group Multi Chosen */
131
+ .chzn-container-multi .chzn-choices {
132
+ background-color: #fff;
133
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
134
+ background-image: -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
135
+ background-image: -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
136
+ background-image: -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
137
+ background-image: linear-gradient(#eeeeee 1%, #ffffff 15%);
138
+ border: 1px solid #aaa;
139
+ margin: 0;
140
+ padding: 0;
141
+ cursor: text;
142
+ overflow: hidden;
143
+ height: auto !important;
144
+ height: 1%;
145
+ position: relative;
146
+ }
147
+ .chzn-container-multi .chzn-choices li {
148
+ float: left;
149
+ list-style: none;
150
+ }
151
+ .chzn-container-multi .chzn-choices .search-field {
152
+ white-space: nowrap;
153
+ margin: 0;
154
+ padding: 0;
155
+ }
156
+ .chzn-container-multi .chzn-choices .search-field input {
157
+ color: #666;
158
+ background: transparent !important;
159
+ border: 0 !important;
160
+ font-family: sans-serif;
161
+ font-size: 100%;
162
+ height: 15px;
163
+ padding: 5px;
164
+ margin: 1px 0;
165
+ outline: 0;
166
+ -webkit-box-shadow: none;
167
+ -moz-box-shadow : none;
168
+ box-shadow : none;
169
+ }
170
+ .chzn-container-multi .chzn-choices .search-field .default {
171
+ color: #999;
172
+ }
173
+ .chzn-container-multi .chzn-choices .search-choice {
174
+ -webkit-border-radius: 3px;
175
+ -moz-border-radius : 3px;
176
+ border-radius : 3px;
177
+ -moz-background-clip : padding;
178
+ -webkit-background-clip: padding-box;
179
+ background-clip : padding-box;
180
+ background-color: #e4e4e4;
181
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f4f4', endColorstr='#eeeeee', GradientType=0 );
182
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
183
+ background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
184
+ background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
185
+ background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
186
+ background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
187
+ -webkit-box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
188
+ -moz-box-shadow : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
189
+ box-shadow : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
190
+ color: #333;
191
+ border: 1px solid #aaaaaa;
192
+ line-height: 13px;
193
+ padding: 3px 20px 3px 5px;
194
+ margin: 3px 0 3px 5px;
195
+ position: relative;
196
+ cursor: default;
197
+ }
198
+ .chzn-container-multi .chzn-choices .search-choice.search-choice-disabled {
199
+ background-color: #e4e4e4;
200
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f4f4', endColorstr='#eeeeee', GradientType=0 );
201
+ background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
202
+ background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
203
+ background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
204
+ background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
205
+ background-image: -ms-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
206
+ background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
207
+ color: #666;
208
+ border: 1px solid #cccccc;
209
+ padding-right: 5px;
210
+ }
211
+ .chzn-container-multi .chzn-choices .search-choice-focus {
212
+ background: #d4d4d4;
213
+ }
214
+ .chzn-container-multi .chzn-choices .search-choice .search-choice-close {
215
+ display: block;
216
+ position: absolute;
217
+ right: 3px;
218
+ top: 4px;
219
+ width: 12px;
220
+ height: 12px;
221
+ font-size: 1px;
222
+ background: url('chosen-sprite.png') -42px 1px no-repeat;
223
+ }
224
+ .chzn-container-multi .chzn-choices .search-choice .search-choice-close:hover {
225
+ background-position: -42px -10px;
226
+ }
227
+ .chzn-container-multi .chzn-choices .search-choice-focus .search-choice-close {
228
+ background-position: -42px -10px;
229
+ }
230
+ /* @end */
231
+
232
+ /* @group Results */
233
+ .chzn-container .chzn-results {
234
+ margin: 0 4px 4px 0;
235
+ max-height: 240px;
236
+ padding: 0 0 0 4px;
237
+ position: relative;
238
+ overflow-x: hidden;
239
+ overflow-y: auto;
240
+ -webkit-overflow-scrolling: touch;
241
+ }
242
+ .chzn-container-multi .chzn-results {
243
+ margin: -1px 0 0;
244
+ padding: 0;
245
+ }
246
+ .chzn-container .chzn-results li {
247
+ display: none;
248
+ line-height: 15px;
249
+ padding: 5px 6px;
250
+ margin: 0;
251
+ list-style: none;
252
+ }
253
+ .chzn-container .chzn-results .active-result {
254
+ cursor: pointer;
255
+ display: list-item;
256
+ }
257
+ .chzn-container .chzn-results .highlighted {
258
+ background-color: #3875d7;
259
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3875d7', endColorstr='#2a62bc', GradientType=0 );
260
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(20%, #3875d7), color-stop(90%, #2a62bc));
261
+ background-image: -webkit-linear-gradient(top, #3875d7 20%, #2a62bc 90%);
262
+ background-image: -moz-linear-gradient(top, #3875d7 20%, #2a62bc 90%);
263
+ background-image: -o-linear-gradient(top, #3875d7 20%, #2a62bc 90%);
264
+ background-image: linear-gradient(#3875d7 20%, #2a62bc 90%);
265
+ color: #fff;
266
+ }
267
+ .chzn-container .chzn-results li em {
268
+ background: #feffde;
269
+ font-style: normal;
270
+ }
271
+ .chzn-container .chzn-results .highlighted em {
272
+ background: transparent;
273
+ }
274
+ .chzn-container .chzn-results .no-results {
275
+ background: #f4f4f4;
276
+ display: list-item;
277
+ }
278
+ .chzn-container .chzn-results .group-result {
279
+ cursor: default;
280
+ color: #999;
281
+ font-weight: bold;
282
+ }
283
+ .chzn-container .chzn-results .group-option {
284
+ padding-left: 15px;
285
+ }
286
+ .chzn-container-multi .chzn-drop .result-selected {
287
+ display: none;
288
+ }
289
+ .chzn-container .chzn-results-scroll {
290
+ background: white;
291
+ margin: 0 4px;
292
+ position: absolute;
293
+ text-align: center;
294
+ width: 321px; /* This should by dynamic with js */
295
+ z-index: 1;
296
+ }
297
+ .chzn-container .chzn-results-scroll span {
298
+ display: inline-block;
299
+ height: 17px;
300
+ text-indent: -5000px;
301
+ width: 9px;
302
+ }
303
+ .chzn-container .chzn-results-scroll-down {
304
+ bottom: 0;
305
+ }
306
+ .chzn-container .chzn-results-scroll-down span {
307
+ background: url('chosen-sprite.png') no-repeat -4px -3px;
308
+ }
309
+ .chzn-container .chzn-results-scroll-up span {
310
+ background: url('chosen-sprite.png') no-repeat -22px -3px;
311
+ }
312
+ /* @end */
313
+
314
+ /* @group Active */
315
+ .chzn-container-active .chzn-single {
316
+ -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
317
+ -moz-box-shadow : 0 0 5px rgba(0,0,0,.3);
318
+ box-shadow : 0 0 5px rgba(0,0,0,.3);
319
+ border: 1px solid #5897fb;
320
+ }
321
+ .chzn-container-active .chzn-single-with-drop {
322
+ border: 1px solid #aaa;
323
+ -webkit-box-shadow: 0 1px 0 #fff inset;
324
+ -moz-box-shadow : 0 1px 0 #fff inset;
325
+ box-shadow : 0 1px 0 #fff inset;
326
+ background-color: #eee;
327
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0 );
328
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(20%, #eeeeee), color-stop(80%, #ffffff));
329
+ background-image: -webkit-linear-gradient(top, #eeeeee 20%, #ffffff 80%);
330
+ background-image: -moz-linear-gradient(top, #eeeeee 20%, #ffffff 80%);
331
+ background-image: -o-linear-gradient(top, #eeeeee 20%, #ffffff 80%);
332
+ background-image: linear-gradient(#eeeeee 20%, #ffffff 80%);
333
+ -webkit-border-bottom-left-radius : 0;
334
+ -webkit-border-bottom-right-radius: 0;
335
+ -moz-border-radius-bottomleft : 0;
336
+ -moz-border-radius-bottomright: 0;
337
+ border-bottom-left-radius : 0;
338
+ border-bottom-right-radius: 0;
339
+ }
340
+ .chzn-container-active .chzn-single-with-drop div {
341
+ background: transparent;
342
+ border-left: none;
343
+ }
344
+ .chzn-container-active .chzn-single-with-drop div b {
345
+ background-position: -18px 2px;
346
+ }
347
+ .chzn-container-active .chzn-choices {
348
+ -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
349
+ -moz-box-shadow : 0 0 5px rgba(0,0,0,.3);
350
+ box-shadow : 0 0 5px rgba(0,0,0,.3);
351
+ border: 1px solid #5897fb;
352
+ }
353
+ .chzn-container-active .chzn-choices .search-field input {
354
+ color: #111 !important;
355
+ }
356
+ /* @end */
357
+
358
+ /* @group Disabled Support */
359
+ .chzn-disabled {
360
+ cursor: default;
361
+ opacity:0.5 !important;
362
+ }
363
+ .chzn-disabled .chzn-single {
364
+ cursor: default;
365
+ }
366
+ .chzn-disabled .chzn-choices .search-choice .search-choice-close {
367
+ cursor: default;
368
+ }
369
+
370
+ /* @group Right to Left */
371
+ .chzn-rtl { text-align: right; }
372
+ .chzn-rtl .chzn-single { padding: 0 8px 0 0; overflow: visible; }
373
+ .chzn-rtl .chzn-single span { margin-left: 26px; margin-right: 0; direction: rtl; }
374
+
375
+ .chzn-rtl .chzn-single div { left: 3px; right: auto; }
376
+ .chzn-rtl .chzn-single abbr {
377
+ left: 26px;
378
+ right: auto;
379
+ }
380
+ .chzn-rtl .chzn-choices .search-field input { direction: rtl; }
381
+ .chzn-rtl .chzn-choices li { float: right; }
382
+ .chzn-rtl .chzn-choices .search-choice { padding: 3px 5px 3px 19px; margin: 3px 5px 3px 0; }
383
+ .chzn-rtl .chzn-choices .search-choice .search-choice-close { left: 4px; right: auto; }
384
+ .chzn-rtl.chzn-container-single .chzn-results { margin: 0 0 4px 4px; padding: 0 4px 0 0; }
385
+ .chzn-rtl .chzn-results .group-option { padding-left: 0; padding-right: 15px; }
386
+ .chzn-rtl.chzn-container-active .chzn-single-with-drop div { border-right: none; }
387
+ .chzn-rtl .chzn-search input {
388
+ background: #fff url('chosen-sprite.png') no-repeat -30px -20px;
389
+ background: url('chosen-sprite.png') no-repeat -30px -20px, -webkit-gradient(linear, 0 0, 0 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
390
+ background: url('chosen-sprite.png') no-repeat -30px -20px, -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
391
+ background: url('chosen-sprite.png') no-repeat -30px -20px, -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
392
+ background: url('chosen-sprite.png') no-repeat -30px -20px, -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
393
+ background: url('chosen-sprite.png') no-repeat -30px -20px, linear-gradient(#eeeeee 1%, #ffffff 15%);
394
+ padding: 4px 5px 4px 20px;
395
+ direction: rtl;
396
+ }
397
+ .chzn-container-single.chzn-rtl .chzn-single div b {
398
+ background-position: 6px 2px;
399
+ }
400
+ .chzn-container-single.chzn-rtl .chzn-single-with-drop div b {
401
+ background-position: -12px 2px;
402
+ }
403
+ /* @end */
404
+
405
+ /* @group Retina compatibility */
406
+ @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-resolution: 144dpi) {
407
+ .chzn-rtl .chzn-search input, .chzn-container-single .chzn-single abbr, .chzn-container-single .chzn-single div b, .chzn-container-single .chzn-search input, .chzn-container-multi .chzn-choices .search-choice .search-choice-close, .chzn-container .chzn-results-scroll-down span, .chzn-container .chzn-results-scroll-up span {
408
+ background-image: url('chosen-sprite@2x.png') !important;
409
+ background-repeat: no-repeat !important;
410
+ background-size: 52px 37px !important;
411
+ }
412
+ }
413
+ /* @end */
assets/js/chosen/chosen.jquery.js CHANGED
@@ -1,1090 +1,1090 @@
1
- // Chosen, a Select Box Enhancer for jQuery and Protoype
2
- // by Patrick Filler for Harvest, http://getharvest.com
3
- //
4
- // Version 0.9.12
5
- // Full source at https://github.com/harvesthq/chosen
6
- // Copyright (c) 2011 Harvest http://getharvest.com
7
-
8
- // MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
9
- // This file is generated by `cake build`, do not edit it by hand.
10
- (function() {
11
- var SelectParser;
12
-
13
- SelectParser = (function() {
14
-
15
- function SelectParser() {
16
- this.options_index = 0;
17
- this.parsed = [];
18
- }
19
-
20
- SelectParser.prototype.add_node = function(child) {
21
- if (child.nodeName.toUpperCase() === "OPTGROUP") {
22
- return this.add_group(child);
23
- } else {
24
- return this.add_option(child);
25
- }
26
- };
27
-
28
- SelectParser.prototype.add_group = function(group) {
29
- var group_position, option, _i, _len, _ref, _results;
30
- group_position = this.parsed.length;
31
- this.parsed.push({
32
- array_index: group_position,
33
- group: true,
34
- label: group.label,
35
- children: 0,
36
- disabled: group.disabled
37
- });
38
- _ref = group.childNodes;
39
- _results = [];
40
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
41
- option = _ref[_i];
42
- _results.push(this.add_option(option, group_position, group.disabled));
43
- }
44
- return _results;
45
- };
46
-
47
- SelectParser.prototype.add_option = function(option, group_position, group_disabled) {
48
- if (option.nodeName.toUpperCase() === "OPTION") {
49
- if (option.text !== "") {
50
- if (group_position != null) {
51
- this.parsed[group_position].children += 1;
52
- }
53
- this.parsed.push({
54
- array_index: this.parsed.length,
55
- options_index: this.options_index,
56
- value: option.value,
57
- text: option.text,
58
- html: option.innerHTML,
59
- selected: option.selected,
60
- disabled: group_disabled === true ? group_disabled : option.disabled,
61
- group_array_index: group_position,
62
- classes: option.className,
63
- style: option.style.cssText
64
- });
65
- } else {
66
- this.parsed.push({
67
- array_index: this.parsed.length,
68
- options_index: this.options_index,
69
- empty: true
70
- });
71
- }
72
- return this.options_index += 1;
73
- }
74
- };
75
-
76
- return SelectParser;
77
-
78
- })();
79
-
80
- SelectParser.select_to_array = function(select) {
81
- var child, parser, _i, _len, _ref;
82
- parser = new SelectParser();
83
- _ref = select.childNodes;
84
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
85
- child = _ref[_i];
86
- parser.add_node(child);
87
- }
88
- return parser.parsed;
89
- };
90
-
91
- this.SelectParser = SelectParser;
92
-
93
- }).call(this);
94
-
95
- /*
96
- Chosen source: generate output using 'cake build'
97
- Copyright (c) 2011 by Harvest
98
- */
99
-
100
-
101
- (function() {
102
- var AbstractChosen, root;
103
-
104
- root = this;
105
-
106
- AbstractChosen = (function() {
107
-
108
- function AbstractChosen(form_field, options) {
109
- this.form_field = form_field;
110
- this.options = options != null ? options : {};
111
- this.is_multiple = this.form_field.multiple;
112
- this.set_default_text();
113
- this.set_default_values();
114
- this.setup();
115
- this.set_up_html();
116
- this.register_observers();
117
- this.finish_setup();
118
- }
119
-
120
- AbstractChosen.prototype.set_default_values = function() {
121
- var _this = this;
122
- this.click_test_action = function(evt) {
123
- return _this.test_active_click(evt);
124
- };
125
- this.activate_action = function(evt) {
126
- return _this.activate_field(evt);
127
- };
128
- this.active_field = false;
129
- this.mouse_on_container = false;
130
- this.results_showing = false;
131
- this.result_highlighted = null;
132
- this.result_single_selected = null;
133
- this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
134
- this.disable_search_threshold = this.options.disable_search_threshold || 0;
135
- this.disable_search = this.options.disable_search || false;
136
- this.enable_split_word_search = this.options.enable_split_word_search != null ? this.options.enable_split_word_search : true;
137
- this.search_contains = this.options.search_contains || false;
138
- this.choices = 0;
139
- this.single_backstroke_delete = this.options.single_backstroke_delete || false;
140
- this.max_selected_options = this.options.max_selected_options || Infinity;
141
- return this.inherit_select_classes = this.options.inherit_select_classes || false;
142
- };
143
-
144
- AbstractChosen.prototype.set_default_text = function() {
145
- if (this.form_field.getAttribute("data-placeholder")) {
146
- this.default_text = this.form_field.getAttribute("data-placeholder");
147
- } else if (this.is_multiple) {
148
- this.default_text = this.options.placeholder_text_multiple || this.options.placeholder_text || "Select Some Options";
149
- } else {
150
- this.default_text = this.options.placeholder_text_single || this.options.placeholder_text || "Select an Option";
151
- }
152
- return this.results_none_found = this.form_field.getAttribute("data-no_results_text") || this.options.no_results_text || "No results match";
153
- };
154
-
155
- AbstractChosen.prototype.mouse_enter = function() {
156
- return this.mouse_on_container = true;
157
- };
158
-
159
- AbstractChosen.prototype.mouse_leave = function() {
160
- return this.mouse_on_container = false;
161
- };
162
-
163
- AbstractChosen.prototype.input_focus = function(evt) {
164
- var _this = this;
165
- if (this.is_multiple) {
166
- if (!this.active_field) {
167
- return setTimeout((function() {
168
- return _this.container_mousedown();
169
- }), 50);
170
- }
171
- } else {
172
- if (!this.active_field) {
173
- return this.activate_field();
174
- }
175
- }
176
- };
177
-
178
- AbstractChosen.prototype.input_blur = function(evt) {
179
- var _this = this;
180
- if (!this.mouse_on_container) {
181
- this.active_field = false;
182
- return setTimeout((function() {
183
- return _this.blur_test();
184
- }), 100);
185
- }
186
- };
187
-
188
- AbstractChosen.prototype.result_add_option = function(option) {
189
- var classes, style;
190
- if (!option.disabled) {
191
- option.dom_id = this.container_id + "_o_" + option.array_index;
192
- classes = option.selected && this.is_multiple ? [] : ["active-result"];
193
- if (option.selected) {
194
- classes.push("result-selected");
195
- }
196
- if (option.group_array_index != null) {
197
- classes.push("group-option");
198
- }
199
- if (option.classes !== "") {
200
- classes.push(option.classes);
201
- }
202
- style = option.style.cssText !== "" ? " style=\"" + option.style + "\"" : "";
203
- return '<li id="' + option.dom_id + '" class="' + classes.join(' ') + '"' + style + '>' + option.html + '</li>';
204
- } else {
205
- return "";
206
- }
207
- };
208
-
209
- AbstractChosen.prototype.results_update_field = function() {
210
- this.set_default_text();
211
- if (!this.is_multiple) {
212
- this.results_reset_cleanup();
213
- }
214
- this.result_clear_highlight();
215
- this.result_single_selected = null;
216
- return this.results_build();
217
- };
218
-
219
- AbstractChosen.prototype.results_toggle = function() {
220
- if (this.results_showing) {
221
- return this.results_hide();
222
- } else {
223
- return this.results_show();
224
- }
225
- };
226
-
227
- AbstractChosen.prototype.results_search = function(evt) {
228
- if (this.results_showing) {
229
- return this.winnow_results();
230
- } else {
231
- return this.results_show();
232
- }
233
- };
234
-
235
- AbstractChosen.prototype.keyup_checker = function(evt) {
236
- var stroke, _ref;
237
- stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
238
- this.search_field_scale();
239
- switch (stroke) {
240
- case 8:
241
- if (this.is_multiple && this.backstroke_length < 1 && this.choices > 0) {
242
- return this.keydown_backstroke();
243
- } else if (!this.pending_backstroke) {
244
- this.result_clear_highlight();
245
- return this.results_search();
246
- }
247
- break;
248
- case 13:
249
- evt.preventDefault();
250
- if (this.results_showing) {
251
- return this.result_select(evt);
252
- }
253
- break;
254
- case 27:
255
- if (this.results_showing) {
256
- this.results_hide();
257
- }
258
- return true;
259
- case 9:
260
- case 38:
261
- case 40:
262
- case 16:
263
- case 91:
264
- case 17:
265
- break;
266
- default:
267
- return this.results_search();
268
- }
269
- };
270
-
271
- AbstractChosen.prototype.generate_field_id = function() {
272
- var new_id;
273
- new_id = this.generate_random_id();
274
- this.form_field.id = new_id;
275
- return new_id;
276
- };
277
-
278
- AbstractChosen.prototype.generate_random_char = function() {
279
- var chars, newchar, rand;
280
- chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
281
- rand = Math.floor(Math.random() * chars.length);
282
- return newchar = chars.substring(rand, rand + 1);
283
- };
284
-
285
- return AbstractChosen;
286
-
287
- })();
288
-
289
- root.AbstractChosen = AbstractChosen;
290
-
291
- }).call(this);
292
-
293
- /*
294
- Chosen source: generate output using 'cake build'
295
- Copyright (c) 2011 by Harvest
296
- */
297
-
298
-
299
- (function() {
300
- var $, Chosen, get_side_border_padding, root,
301
- __hasProp = {}.hasOwnProperty,
302
- __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
303
-
304
- root = this;
305
-
306
- $ = jQuery;
307
-
308
- $.fn.extend({
309
- chosen: function(options) {
310
- var browser, match, ua;
311
- ua = navigator.userAgent.toLowerCase();
312
- match = /(msie) ([\w.]+)/.exec(ua) || [];
313
- browser = {
314
- name: match[1] || "",
315
- version: match[2] || "0"
316
- };
317
- if (browser.name === "msie" && (browser.version === "6.0" || (browser.version === "7.0" && document.documentMode === 7))) {
318
- return this;
319
- }
320
- return this.each(function(input_field) {
321
- var $this;
322
- $this = $(this);
323
- if (!$this.hasClass("chzn-done")) {
324
- return $this.data('chosen', new Chosen(this, options));
325
- }
326
- });
327
- }
328
- });
329
-
330
- Chosen = (function(_super) {
331
-
332
- __extends(Chosen, _super);
333
-
334
- function Chosen() {
335
- return Chosen.__super__.constructor.apply(this, arguments);
336
- }
337
-
338
- Chosen.prototype.setup = function() {
339
- this.form_field_jq = $(this.form_field);
340
- this.current_value = this.form_field_jq.val();
341
- return this.is_rtl = this.form_field_jq.hasClass("chzn-rtl");
342
- };
343
-
344
- Chosen.prototype.finish_setup = function() {
345
- return this.form_field_jq.addClass("chzn-done");
346
- };
347
-
348
- Chosen.prototype.set_up_html = function() {
349
- var container_classes, container_div, container_props, dd_top, dd_width, sf_width;
350
- this.container_id = this.form_field.id.length ? this.form_field.id.replace(/[^\w]/g, '_') : this.generate_field_id();
351
- this.container_id += "_chzn";
352
- container_classes = ["chzn-container"];
353
- container_classes.push("chzn-container-" + (this.is_multiple ? "multi" : "single"));
354
- if (this.inherit_select_classes && this.form_field.className) {
355
- container_classes.push(this.form_field.className);
356
- }
357
- if (this.is_rtl) {
358
- container_classes.push("chzn-rtl");
359
- }
360
- this.f_width = this.form_field_jq.outerWidth();
361
- container_props = {
362
- id: this.container_id,
363
- "class": container_classes.join(' '),
364
- style: 'width: ' + this.f_width + 'px;',
365
- title: this.form_field.title
366
- };
367
- container_div = $("<div />", container_props);
368
- if (this.is_multiple) {
369
- container_div.html('<ul class="chzn-choices"><li class="search-field"><input type="text" value="' + this.default_text + '" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chzn-drop" style="left:-9000px;"><ul class="chzn-results"></ul></div>');
370
- } else {
371
- container_div.html('<a href="javascript:void(0)" class="chzn-single chzn-default" tabindex="-1"><span>' + this.default_text + '</span><div><b></b></div></a><div class="chzn-drop" style="left:-9000px;"><div class="chzn-search"><input type="text" autocomplete="off" /></div><ul class="chzn-results"></ul></div>');
372
- }
373
- this.form_field_jq.hide().after(container_div);
374
- this.container = $('#' + this.container_id);
375
- this.dropdown = this.container.find('div.chzn-drop').first();
376
- dd_top = this.container.height();
377
- dd_width = this.f_width - get_side_border_padding(this.dropdown);
378
- this.dropdown.css({
379
- "width": dd_width + "px",
380
- "top": dd_top + "px"
381
- });
382
- this.search_field = this.container.find('input').first();
383
- this.search_results = this.container.find('ul.chzn-results').first();
384
- this.search_field_scale();
385
- this.search_no_results = this.container.find('li.no-results').first();
386
- if (this.is_multiple) {
387
- this.search_choices = this.container.find('ul.chzn-choices').first();
388
- this.search_container = this.container.find('li.search-field').first();
389
- } else {
390
- this.search_container = this.container.find('div.chzn-search').first();
391
- this.selected_item = this.container.find('.chzn-single').first();
392
- sf_width = dd_width - get_side_border_padding(this.search_container) - get_side_border_padding(this.search_field);
393
- this.search_field.css({
394
- "width": sf_width + "px"
395
- });
396
- }
397
- this.results_build();
398
- this.set_tab_index();
399
- return this.form_field_jq.trigger("liszt:ready", {
400
- chosen: this
401
- });
402
- };
403
-
404
- Chosen.prototype.register_observers = function() {
405
- var _this = this;
406
- this.container.mousedown(function(evt) {
407
- _this.container_mousedown(evt);
408
- });
409
- this.container.mouseup(function(evt) {
410
- _this.container_mouseup(evt);
411
- });
412
- this.container.mouseenter(function(evt) {
413
- _this.mouse_enter(evt);
414
- });
415
- this.container.mouseleave(function(evt) {
416
- _this.mouse_leave(evt);
417
- });
418
- this.search_results.mouseup(function(evt) {
419
- _this.search_results_mouseup(evt);
420
- });
421
- this.search_results.mouseover(function(evt) {
422
- _this.search_results_mouseover(evt);
423
- });
424
- this.search_results.mouseout(function(evt) {
425
- _this.search_results_mouseout(evt);
426
- });
427
- this.form_field_jq.bind("liszt:updated", function(evt) {
428
- _this.results_update_field(evt);
429
- });
430
- this.form_field_jq.bind("liszt:activate", function(evt) {
431
- _this.activate_field(evt);
432
- });
433
- this.form_field_jq.bind("liszt:open", function(evt) {
434
- _this.container_mousedown(evt);
435
- });
436
- this.search_field.blur(function(evt) {
437
- _this.input_blur(evt);
438
- });
439
- this.search_field.keyup(function(evt) {
440
- _this.keyup_checker(evt);
441
- });
442
- this.search_field.keydown(function(evt) {
443
- _this.keydown_checker(evt);
444
- });
445
- this.search_field.focus(function(evt) {
446
- _this.input_focus(evt);
447
- });
448
- if (this.is_multiple) {
449
- return this.search_choices.click(function(evt) {
450
- _this.choices_click(evt);
451
- });
452
- } else {
453
- return this.container.click(function(evt) {
454
- evt.preventDefault();
455
- });
456
- }
457
- };
458
-
459
- Chosen.prototype.search_field_disabled = function() {
460
- this.is_disabled = this.form_field_jq[0].disabled;
461
- if (this.is_disabled) {
462
- this.container.addClass('chzn-disabled');
463
- this.search_field[0].disabled = true;
464
- if (!this.is_multiple) {
465
- this.selected_item.unbind("focus", this.activate_action);
466
- }
467
- return this.close_field();
468
- } else {
469
- this.container.removeClass('chzn-disabled');
470
- this.search_field[0].disabled = false;
471
- if (!this.is_multiple) {
472
- return this.selected_item.bind("focus", this.activate_action);
473
- }
474
- }
475
- };
476
-
477
- Chosen.prototype.container_mousedown = function(evt) {
478
- var target_closelink;
479
- if (!this.is_disabled) {
480
- target_closelink = evt != null ? ($(evt.target)).hasClass("search-choice-close") : false;
481
- if (evt && evt.type === "mousedown" && !this.results_showing) {
482
- evt.preventDefault();
483
- }
484
- if (!this.pending_destroy_click && !target_closelink) {
485
- if (!this.active_field) {
486
- if (this.is_multiple) {
487
- this.search_field.val("");
488
- }
489
- $(document).click(this.click_test_action);
490
- this.results_show();
491
- } else if (!this.is_multiple && evt && (($(evt.target)[0] === this.selected_item[0]) || $(evt.target).parents("a.chzn-single").length)) {
492
- evt.preventDefault();
493
- this.results_toggle();
494
- }
495
- return this.activate_field();
496
- } else {
497
- return this.pending_destroy_click = false;
498
- }
499
- }
500
- };
501
-
502
- Chosen.prototype.container_mouseup = function(evt) {
503
- if (evt.target.nodeName === "ABBR" && !this.is_disabled) {
504
- return this.results_reset(evt);
505
- }
506
- };
507
-
508
- Chosen.prototype.blur_test = function(evt) {
509
- if (!this.active_field && this.container.hasClass("chzn-container-active")) {
510
- return this.close_field();
511
- }
512
- };
513
-
514
- Chosen.prototype.close_field = function() {
515
- $(document).unbind("click", this.click_test_action);
516
- this.active_field = false;
517
- this.results_hide();
518
- this.container.removeClass("chzn-container-active");
519
- this.winnow_results_clear();
520
- this.clear_backstroke();
521
- this.show_search_field_default();
522
- return this.search_field_scale();
523
- };
524
-
525
- Chosen.prototype.activate_field = function() {
526
- this.container.addClass("chzn-container-active");
527
- this.active_field = true;
528
- this.search_field.val(this.search_field.val());
529
- return this.search_field.focus();
530
- };
531
-
532
- Chosen.prototype.test_active_click = function(evt) {
533
- if ($(evt.target).parents('#' + this.container_id).length) {
534
- return this.active_field = true;
535
- } else {
536
- return this.close_field();
537
- }
538
- };
539
-
540
- Chosen.prototype.results_build = function() {
541
- var content, data, _i, _len, _ref;
542
- this.parsing = true;
543
- this.results_data = root.SelectParser.select_to_array(this.form_field);
544
- if (this.is_multiple && this.choices > 0) {
545
- this.search_choices.find("li.search-choice").remove();
546
- this.choices = 0;
547
- } else if (!this.is_multiple) {
548
- this.selected_item.addClass("chzn-default").find("span").text(this.default_text);
549
- if (this.disable_search || this.form_field.options.length <= this.disable_search_threshold) {
550
- this.container.addClass("chzn-container-single-nosearch");
551
- } else {
552
- this.container.removeClass("chzn-container-single-nosearch");
553
- }
554
- }
555
- content = '';
556
- _ref = this.results_data;
557
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
558
- data = _ref[_i];
559
- if (data.group) {
560
- content += this.result_add_group(data);
561
- } else if (!data.empty) {
562
- content += this.result_add_option(data);
563
- if (data.selected && this.is_multiple) {
564
- this.choice_build(data);
565
- } else if (data.selected && !this.is_multiple) {
566
- this.selected_item.removeClass("chzn-default").find("span").text(data.text);
567
- if (this.allow_single_deselect) {
568
- this.single_deselect_control_build();
569
- }
570
- }
571
- }
572
- }
573
- this.search_field_disabled();
574
- this.show_search_field_default();
575
- this.search_field_scale();
576
- this.search_results.html(content);
577
- return this.parsing = false;
578
- };
579
-
580
- Chosen.prototype.result_add_group = function(group) {
581
- if (!group.disabled) {
582
- group.dom_id = this.container_id + "_g_" + group.array_index;
583
- return '<li id="' + group.dom_id + '" class="group-result">' + $("<div />").text(group.label).html() + '</li>';
584
- } else {
585
- return "";
586
- }
587
- };
588
-
589
- Chosen.prototype.result_do_highlight = function(el) {
590
- var high_bottom, high_top, maxHeight, visible_bottom, visible_top;
591
- if (el.length) {
592
- this.result_clear_highlight();
593
- this.result_highlight = el;
594
- this.result_highlight.addClass("highlighted");
595
- maxHeight = parseInt(this.search_results.css("maxHeight"), 10);
596
- visible_top = this.search_results.scrollTop();
597
- visible_bottom = maxHeight + visible_top;
598
- high_top = this.result_highlight.position().top + this.search_results.scrollTop();
599
- high_bottom = high_top + this.result_highlight.outerHeight();
600
- if (high_bottom >= visible_bottom) {
601
- return this.search_results.scrollTop((high_bottom - maxHeight) > 0 ? high_bottom - maxHeight : 0);
602
- } else if (high_top < visible_top) {
603
- return this.search_results.scrollTop(high_top);
604
- }
605
- }
606
- };
607
-
608
- Chosen.prototype.result_clear_highlight = function() {
609
- if (this.result_highlight) {
610
- this.result_highlight.removeClass("highlighted");
611
- }
612
- return this.result_highlight = null;
613
- };
614
-
615
- Chosen.prototype.results_show = function() {
616
- var dd_top;
617
- if (!this.is_multiple) {
618
- this.selected_item.addClass("chzn-single-with-drop");
619
- if (this.result_single_selected) {
620
- this.result_do_highlight(this.result_single_selected);
621
- }
622
- } else if (this.max_selected_options <= this.choices) {
623
- this.form_field_jq.trigger("liszt:maxselected", {
624
- chosen: this
625
- });
626
- return false;
627
- }
628
- dd_top = this.is_multiple ? this.container.height() : this.container.height() - 1;
629
- this.form_field_jq.trigger("liszt:showing_dropdown", {
630
- chosen: this
631
- });
632
- this.dropdown.css({
633
- "top": dd_top + "px",
634
- "left": 0
635
- });
636
- this.results_showing = true;
637
- this.search_field.focus();
638
- this.search_field.val(this.search_field.val());
639
- return this.winnow_results();
640
- };
641
-
642
- Chosen.prototype.results_hide = function() {
643
- if (!this.is_multiple) {
644
- this.selected_item.removeClass("chzn-single-with-drop");
645
- }
646
- this.result_clear_highlight();
647
- this.form_field_jq.trigger("liszt:hiding_dropdown", {
648
- chosen: this
649
- });
650
- this.dropdown.css({
651
- "left": "-9000px"
652
- });
653
- return this.results_showing = false;
654
- };
655
-
656
- Chosen.prototype.set_tab_index = function(el) {
657
- var ti;
658
- if (this.form_field_jq.attr("tabindex")) {
659
- ti = this.form_field_jq.attr("tabindex");
660
- this.form_field_jq.attr("tabindex", -1);
661
- return this.search_field.attr("tabindex", ti);
662
- }
663
- };
664
-
665
- Chosen.prototype.show_search_field_default = function() {
666
- if (this.is_multiple && this.choices < 1 && !this.active_field) {
667
- this.search_field.val(this.default_text);
668
- return this.search_field.addClass("default");
669
- } else {
670
- this.search_field.val("");
671
- return this.search_field.removeClass("default");
672
- }
673
- };
674
-
675
- Chosen.prototype.search_results_mouseup = function(evt) {
676
- var target;
677
- target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
678
- if (target.length) {
679
- this.result_highlight = target;
680
- this.result_select(evt);
681
- return this.search_field.focus();
682
- }
683
- };
684
-
685
- Chosen.prototype.search_results_mouseover = function(evt) {
686
- var target;
687
- target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
688
- if (target) {
689
- return this.result_do_highlight(target);
690
- }
691
- };
692
-
693
- Chosen.prototype.search_results_mouseout = function(evt) {
694
- if ($(evt.target).hasClass("active-result" || $(evt.target).parents('.active-result').first())) {
695
- return this.result_clear_highlight();
696
- }
697
- };
698
-
699
- Chosen.prototype.choices_click = function(evt) {
700
- evt.preventDefault();
701
- if (this.active_field && !($(evt.target).hasClass("search-choice" || $(evt.target).parents('.search-choice').first)) && !this.results_showing) {
702
- return this.results_show();
703
- }
704
- };
705
-
706
- Chosen.prototype.choice_build = function(item) {
707
- var choice_id, html, link,
708
- _this = this;
709
- if (this.is_multiple && this.max_selected_options <= this.choices) {
710
- this.form_field_jq.trigger("liszt:maxselected", {
711
- chosen: this
712
- });
713
- return false;
714
- }
715
- choice_id = this.container_id + "_c_" + item.array_index;
716
- this.choices += 1;
717
- if (item.disabled) {
718
- html = '<li class="search-choice search-choice-disabled" id="' + choice_id + '"><span>' + item.html + '</span></li>';
719
- } else {
720
- html = '<li class="search-choice" id="' + choice_id + '"><span>' + item.html + '</span><a href="javascript:void(0)" class="search-choice-close" rel="' + item.array_index + '"></a></li>';
721
- }
722
- this.search_container.before(html);
723
- link = $('#' + choice_id).find("a").first();
724
- return link.click(function(evt) {
725
- return _this.choice_destroy_link_click(evt);
726
- });
727
- };
728
-
729
- Chosen.prototype.choice_destroy_link_click = function(evt) {
730
- evt.preventDefault();
731
- if (!this.is_disabled) {
732
- this.pending_destroy_click = true;
733
- return this.choice_destroy($(evt.target));
734
- } else {
735
- return evt.stopPropagation;
736
- }
737
- };
738
-
739
- Chosen.prototype.choice_destroy = function(link) {
740
- if (this.result_deselect(link.attr("rel"))) {
741
- this.choices -= 1;
742
- this.show_search_field_default();
743
- if (this.is_multiple && this.choices > 0 && this.search_field.val().length < 1) {
744
- this.results_hide();
745
- }
746
- link.parents('li').first().remove();
747
- return this.search_field_scale();
748
- }
749
- };
750
-
751
- Chosen.prototype.results_reset = function() {
752
- this.form_field.options[0].selected = true;
753
- this.selected_item.find("span").text(this.default_text);
754
- if (!this.is_multiple) {
755
- this.selected_item.addClass("chzn-default");
756
- }
757
- this.show_search_field_default();
758
- this.results_reset_cleanup();
759
- this.form_field_jq.trigger("change");
760
- if (this.active_field) {
761
- return this.results_hide();
762
- }
763
- };
764
-
765
- Chosen.prototype.results_reset_cleanup = function() {
766
- this.current_value = this.form_field_jq.val();
767
- return this.selected_item.find("abbr").remove();
768
- };
769
-
770
- Chosen.prototype.result_select = function(evt) {
771
- var high, high_id, item, position;
772
- if (this.result_highlight) {
773
- high = this.result_highlight;
774
- high_id = high.attr("id");
775
- this.result_clear_highlight();
776
- if (this.is_multiple) {
777
- this.result_deactivate(high);
778
- } else {
779
- this.search_results.find(".result-selected").removeClass("result-selected");
780
- this.result_single_selected = high;
781
- this.selected_item.removeClass("chzn-default");
782
- }
783
- high.addClass("result-selected");
784
- position = high_id.substr(high_id.lastIndexOf("_") + 1);
785
- item = this.results_data[position];
786
- item.selected = true;
787
- this.form_field.options[item.options_index].selected = true;
788
- if (this.is_multiple) {
789
- this.choice_build(item);
790
- } else {
791
- this.selected_item.find("span").first().text(item.text);
792
- if (this.allow_single_deselect) {
793
- this.single_deselect_control_build();
794
- }
795
- }
796
- if (!((evt.metaKey || evt.ctrlKey) && this.is_multiple)) {
797
- this.results_hide();
798
- }
799
- this.search_field.val("");
800
- if (this.is_multiple || this.form_field_jq.val() !== this.current_value) {
801
- this.form_field_jq.trigger("change", {
802
- 'selected': this.form_field.options[item.options_index].value
803
- });
804
- }
805
- this.current_value = this.form_field_jq.val();
806
- return this.search_field_scale();
807
- }
808
- };
809
-
810
- Chosen.prototype.result_activate = function(el) {
811
- return el.addClass("active-result");
812
- };
813
-
814
- Chosen.prototype.result_deactivate = function(el) {
815
- return el.removeClass("active-result");
816
- };
817
-
818
- Chosen.prototype.result_deselect = function(pos) {
819
- var result, result_data;
820
- result_data = this.results_data[pos];
821
- if (!this.form_field.options[result_data.options_index].disabled) {
822
- result_data.selected = false;
823
- this.form_field.options[result_data.options_index].selected = false;
824
- result = $("#" + this.container_id + "_o_" + pos);
825
- result.removeClass("result-selected").addClass("active-result").show();
826
- this.result_clear_highlight();
827
- this.winnow_results();
828
- this.form_field_jq.trigger("change", {
829
- deselected: this.form_field.options[result_data.options_index].value
830
- });
831
- this.search_field_scale();
832
- return true;
833
- } else {
834
- return false;
835
- }
836
- };
837
-
838
- Chosen.prototype.single_deselect_control_build = function() {
839
- if (this.allow_single_deselect && this.selected_item.find("abbr").length < 1) {
840
- return this.selected_item.find("span").first().after("<abbr class=\"search-choice-close\"></abbr>");
841
- }
842
- };
843
-
844
- Chosen.prototype.winnow_results = function() {
845
- var found, option, part, parts, regex, regexAnchor, result, result_id, results, searchText, startpos, text, zregex, _i, _j, _len, _len1, _ref;
846
- this.no_results_clear();
847
- results = 0;
848
- searchText = this.search_field.val() === this.default_text ? "" : $('<div/>').text($.trim(this.search_field.val())).html();
849
- regexAnchor = this.search_contains ? "" : "^";
850
- regex = new RegExp(regexAnchor + searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i');
851
- zregex = new RegExp(searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i');
852
- _ref = this.results_data;
853
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
854
- option = _ref[_i];
855
- if (!option.disabled && !option.empty) {
856
- if (option.group) {
857
- $('#' + option.dom_id).css('display', 'none');
858
- } else if (!(this.is_multiple && option.selected)) {
859
- found = false;
860
- result_id = option.dom_id;
861
- result = $("#" + result_id);
862
- if (regex.test(option.html)) {
863
- found = true;
864
- results += 1;
865
- } else if (this.enable_split_word_search && (option.html.indexOf(" ") >= 0 || option.html.indexOf("[") === 0)) {
866
- parts = option.html.replace(/\[|\]/g, "").split(" ");
867
- if (parts.length) {
868
- for (_j = 0, _len1 = parts.length; _j < _len1; _j++) {
869
- part = parts[_j];
870
- if (regex.test(part)) {
871
- found = true;
872
- results += 1;
873
- }
874
- }
875
- }
876
- }
877
- if (found) {
878
- if (searchText.length) {
879
- startpos = option.html.search(zregex);
880
- text = option.html.substr(0, startpos + searchText.length) + '</em>' + option.html.substr(startpos + searchText.length);
881
- text = text.substr(0, startpos) + '<em>' + text.substr(startpos);
882
- } else {
883
- text = option.html;
884
- }
885
- result.html(text);
886
- this.result_activate(result);
887
- if (option.group_array_index != null) {
888
- $("#" + this.results_data[option.group_array_index].dom_id).css('display', 'list-item');
889
- }
890
- } else {
891
- if (this.result_highlight && result_id === this.result_highlight.attr('id')) {
892
- this.result_clear_highlight();
893
- }
894
- this.result_deactivate(result);
895
- }
896
- }
897
- }
898
- }
899
- if (results < 1 && searchText.length) {
900
- return this.no_results(searchText);
901
- } else {
902
- return this.winnow_results_set_highlight();
903
- }
904
- };
905
-
906
- Chosen.prototype.winnow_results_clear = function() {
907
- var li, lis, _i, _len, _results;
908
- this.search_field.val("");
909
- lis = this.search_results.find("li");
910
- _results = [];
911
- for (_i = 0, _len = lis.length; _i < _len; _i++) {
912
- li = lis[_i];
913
- li = $(li);
914
- if (li.hasClass("group-result")) {
915
- _results.push(li.css('display', 'auto'));
916
- } else if (!this.is_multiple || !li.hasClass("result-selected")) {
917
- _results.push(this.result_activate(li));
918
- } else {
919
- _results.push(void 0);
920
- }
921
- }
922
- return _results;
923
- };
924
-
925
- Chosen.prototype.winnow_results_set_highlight = function() {
926
- var do_high, selected_results;
927
- if (!this.result_highlight) {
928
- selected_results = !this.is_multiple ? this.search_results.find(".result-selected.active-result") : [];
929
- do_high = selected_results.length ? selected_results.first() : this.search_results.find(".active-result").first();
930
- if (do_high != null) {
931
- return this.result_do_highlight(do_high);
932
- }
933
- }
934
- };
935
-
936
- Chosen.prototype.no_results = function(terms) {
937
- var no_results_html;
938
- no_results_html = $('<li class="no-results">' + this.results_none_found + ' "<span></span>"</li>');
939
- no_results_html.find("span").first().html(terms);
940
- return this.search_results.append(no_results_html);
941
- };
942
-
943
- Chosen.prototype.no_results_clear = function() {
944
- return this.search_results.find(".no-results").remove();
945
- };
946
-
947
- Chosen.prototype.keydown_arrow = function() {
948
- var first_active, next_sib;
949
- if (!this.result_highlight) {
950
- first_active = this.search_results.find("li.active-result").first();
951
- if (first_active) {
952
- this.result_do_highlight($(first_active));
953
- }
954
- } else if (this.results_showing) {
955
- next_sib = this.result_highlight.nextAll("li.active-result").first();
956
- if (next_sib) {
957
- this.result_do_highlight(next_sib);
958
- }
959
- }
960
- if (!this.results_showing) {
961
- return this.results_show();
962
- }
963
- };
964
-
965
- Chosen.prototype.keyup_arrow = function() {
966
- var prev_sibs;
967
- if (!this.results_showing && !this.is_multiple) {
968
- return this.results_show();
969
- } else if (this.result_highlight) {
970
- prev_sibs = this.result_highlight.prevAll("li.active-result");
971
- if (prev_sibs.length) {
972
- return this.result_do_highlight(prev_sibs.first());
973
- } else {
974
- if (this.choices > 0) {
975
- this.results_hide();
976
- }
977
- return this.result_clear_highlight();
978
- }
979
- }
980
- };
981
-
982
- Chosen.prototype.keydown_backstroke = function() {
983
- var next_available_destroy;
984
- if (this.pending_backstroke) {
985
- this.choice_destroy(this.pending_backstroke.find("a").first());
986
- return this.clear_backstroke();
987
- } else {
988
- next_available_destroy = this.search_container.siblings("li.search-choice").last();
989
- if (next_available_destroy.length && !next_available_destroy.hasClass("search-choice-disabled")) {
990
- this.pending_backstroke = next_available_destroy;
991
- if (this.single_backstroke_delete) {
992
- return this.keydown_backstroke();
993
- } else {
994
- return this.pending_backstroke.addClass("search-choice-focus");
995
- }
996
- }
997
- }
998
- };
999
-
1000
- Chosen.prototype.clear_backstroke = function() {
1001
- if (this.pending_backstroke) {
1002
- this.pending_backstroke.removeClass("search-choice-focus");
1003
- }
1004
- return this.pending_backstroke = null;
1005
- };
1006
-
1007
- Chosen.prototype.keydown_checker = function(evt) {
1008
- var stroke, _ref;
1009
- stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
1010
- this.search_field_scale();
1011
- if (stroke !== 8 && this.pending_backstroke) {
1012
- this.clear_backstroke();
1013
- }
1014
- switch (stroke) {
1015
- case 8:
1016
- this.backstroke_length = this.search_field.val().length;
1017
- break;
1018
- case 9:
1019
- if (this.results_showing && !this.is_multiple) {
1020
- this.result_select(evt);
1021
- }
1022
- this.mouse_on_container = false;
1023
- break;
1024
- case 13:
1025
- evt.preventDefault();
1026
- break;
1027
- case 38:
1028
- evt.preventDefault();
1029
- this.keyup_arrow();
1030
- break;
1031
- case 40:
1032
- this.keydown_arrow();
1033
- break;
1034
- }
1035
- };
1036
-
1037
- Chosen.prototype.search_field_scale = function() {
1038
- var dd_top, div, h, style, style_block, styles, w, _i, _len;
1039
- if (this.is_multiple) {
1040
- h = 0;
1041
- w = 0;
1042
- style_block = "position:absolute; left: -1000px; top: -1000px; display:none;";
1043
- styles = ['font-size', 'font-style', 'font-weight', 'font-family', 'line-height', 'text-transform', 'letter-spacing'];
1044
- for (_i = 0, _len = styles.length; _i < _len; _i++) {
1045
- style = styles[_i];
1046
- style_block += style + ":" + this.search_field.css(style) + ";";
1047
- }
1048
- div = $('<div />', {
1049
- 'style': style_block
1050
- });
1051
- div.text(this.search_field.val());
1052
- $('body').append(div);
1053
- w = div.width() + 25;
1054
- div.remove();
1055
- if (w > this.f_width - 10) {
1056
- w = this.f_width - 10;
1057
- }
1058
- this.search_field.css({
1059
- 'width': w + 'px'
1060
- });
1061
- dd_top = this.container.height();
1062
- return this.dropdown.css({
1063
- "top": dd_top + "px"
1064
- });
1065
- }
1066
- };
1067
-
1068
- Chosen.prototype.generate_random_id = function() {
1069
- var string;
1070
- string = "sel" + this.generate_random_char() + this.generate_random_char() + this.generate_random_char();
1071
- while ($("#" + string).length > 0) {
1072
- string += this.generate_random_char();
1073
- }
1074
- return string;
1075
- };
1076
-
1077
- return Chosen;
1078
-
1079
- })(AbstractChosen);
1080
-
1081
- root.Chosen = Chosen;
1082
-
1083
- get_side_border_padding = function(elmt) {
1084
- var side_border_padding;
1085
- return side_border_padding = elmt.outerWidth() - elmt.width();
1086
- };
1087
-
1088
- root.get_side_border_padding = get_side_border_padding;
1089
-
1090
- }).call(this);
1
+ // Chosen, a Select Box Enhancer for jQuery and Protoype
2
+ // by Patrick Filler for Harvest, http://getharvest.com
3
+ //
4
+ // Version 0.9.12
5
+ // Full source at https://github.com/harvesthq/chosen
6
+ // Copyright (c) 2011 Harvest http://getharvest.com
7
+
8
+ // MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
9
+ // This file is generated by `cake build`, do not edit it by hand.
10
+ (function() {
11
+ var SelectParser;
12
+
13
+ SelectParser = (function() {
14
+
15
+ function SelectParser() {
16
+ this.options_index = 0;
17
+ this.parsed = [];
18
+ }
19
+
20
+ SelectParser.prototype.add_node = function(child) {
21
+ if (child.nodeName.toUpperCase() === "OPTGROUP") {
22
+ return this.add_group(child);
23
+ } else {
24
+ return this.add_option(child);
25
+ }
26
+ };
27
+
28
+ SelectParser.prototype.add_group = function(group) {
29
+ var group_position, option, _i, _len, _ref, _results;
30
+ group_position = this.parsed.length;
31
+ this.parsed.push({
32
+ array_index: group_position,
33
+ group: true,
34
+ label: group.label,
35
+ children: 0,
36
+ disabled: group.disabled
37
+ });
38
+ _ref = group.childNodes;
39
+ _results = [];
40
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
41
+ option = _ref[_i];
42
+ _results.push(this.add_option(option, group_position, group.disabled));
43
+ }
44
+ return _results;
45
+ };
46
+
47
+ SelectParser.prototype.add_option = function(option, group_position, group_disabled) {
48
+ if (option.nodeName.toUpperCase() === "OPTION") {
49
+ if (option.text !== "") {
50
+ if (group_position != null) {
51
+ this.parsed[group_position].children += 1;
52
+ }
53
+ this.parsed.push({
54
+ array_index: this.parsed.length,
55
+ options_index: this.options_index,
56
+ value: option.value,
57
+ text: option.text,
58
+ html: option.innerHTML,
59
+ selected: option.selected,
60
+ disabled: group_disabled === true ? group_disabled : option.disabled,
61
+ group_array_index: group_position,
62
+ classes: option.className,
63
+ style: option.style.cssText
64
+ });
65
+ } else {
66
+ this.parsed.push({
67
+ array_index: this.parsed.length,
68
+ options_index: this.options_index,
69
+ empty: true
70
+ });
71
+ }
72
+ return this.options_index += 1;
73
+ }
74
+ };
75
+
76
+ return SelectParser;
77
+
78
+ })();
79
+
80
+ SelectParser.select_to_array = function(select) {
81
+ var child, parser, _i, _len, _ref;
82
+ parser = new SelectParser();
83
+ _ref = select.childNodes;
84
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
85
+ child = _ref[_i];
86
+ parser.add_node(child);
87
+ }
88
+ return parser.parsed;
89
+ };
90
+
91
+ this.SelectParser = SelectParser;
92
+
93
+ }).call(this);
94
+
95
+ /*
96
+ Chosen source: generate output using 'cake build'
97
+ Copyright (c) 2011 by Harvest
98
+ */
99
+
100
+
101
+ (function() {
102
+ var AbstractChosen, root;
103
+
104
+ root = this;
105
+
106
+ AbstractChosen = (function() {
107
+
108
+ function AbstractChosen(form_field, options) {
109
+ this.form_field = form_field;
110
+ this.options = options != null ? options : {};
111
+ this.is_multiple = this.form_field.multiple;
112
+ this.set_default_text();
113
+ this.set_default_values();
114
+ this.setup();
115
+ this.set_up_html();
116
+ this.register_observers();
117
+ this.finish_setup();
118
+ }
119
+
120
+ AbstractChosen.prototype.set_default_values = function() {
121
+ var _this = this;
122
+ this.click_test_action = function(evt) {
123
+ return _this.test_active_click(evt);
124
+ };
125
+ this.activate_action = function(evt) {
126
+ return _this.activate_field(evt);
127
+ };
128
+ this.active_field = false;
129
+ this.mouse_on_container = false;
130
+ this.results_showing = false;
131
+ this.result_highlighted = null;
132
+ this.result_single_selected = null;
133
+ this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
134
+ this.disable_search_threshold = this.options.disable_search_threshold || 0;
135
+ this.disable_search = this.options.disable_search || false;
136
+ this.enable_split_word_search = this.options.enable_split_word_search != null ? this.options.enable_split_word_search : true;
137
+ this.search_contains = this.options.search_contains || false;
138
+ this.choices = 0;
139
+ this.single_backstroke_delete = this.options.single_backstroke_delete || false;
140
+ this.max_selected_options = this.options.max_selected_options || Infinity;
141
+ return this.inherit_select_classes = this.options.inherit_select_classes || false;
142
+ };
143
+
144
+ AbstractChosen.prototype.set_default_text = function() {
145
+ if (this.form_field.getAttribute("data-placeholder")) {
146
+ this.default_text = this.form_field.getAttribute("data-placeholder");
147
+ } else if (this.is_multiple) {
148
+ this.default_text = this.options.placeholder_text_multiple || this.options.placeholder_text || "Select Some Options";
149
+ } else {
150
+ this.default_text = this.options.placeholder_text_single || this.options.placeholder_text || "Select an Option";
151
+ }
152
+ return this.results_none_found = this.form_field.getAttribute("data-no_results_text") || this.options.no_results_text || "No results match";
153
+ };
154
+
155
+ AbstractChosen.prototype.mouse_enter = function() {
156
+ return this.mouse_on_container = true;
157
+ };
158
+
159
+ AbstractChosen.prototype.mouse_leave = function() {
160
+ return this.mouse_on_container = false;
161
+ };
162
+
163
+ AbstractChosen.prototype.input_focus = function(evt) {
164
+ var _this = this;
165
+ if (this.is_multiple) {
166
+ if (!this.active_field) {
167
+ return setTimeout((function() {
168
+ return _this.container_mousedown();
169
+ }), 50);
170
+ }
171
+ } else {
172
+ if (!this.active_field) {
173
+ return this.activate_field();
174
+ }
175
+ }
176
+ };
177
+
178
+ AbstractChosen.prototype.input_blur = function(evt) {
179
+ var _this = this;
180
+ if (!this.mouse_on_container) {
181
+ this.active_field = false;
182
+ return setTimeout((function() {
183
+ return _this.blur_test();
184
+ }), 100);
185
+ }
186
+ };
187
+
188
+ AbstractChosen.prototype.result_add_option = function(option) {
189
+ var classes, style;
190
+ if (!option.disabled) {
191
+ option.dom_id = this.container_id + "_o_" + option.array_index;
192
+ classes = option.selected && this.is_multiple ? [] : ["active-result"];
193
+ if (option.selected) {
194
+ classes.push("result-selected");
195
+ }
196
+ if (option.group_array_index != null) {
197
+ classes.push("group-option");
198
+ }
199
+ if (option.classes !== "") {
200
+ classes.push(option.classes);
201
+ }
202
+ style = option.style.cssText !== "" ? " style=\"" + option.style + "\"" : "";
203
+ return '<li id="' + option.dom_id + '" class="' + classes.join(' ') + '"' + style + '>' + option.html + '</li>';
204
+ } else {
205
+ return "";
206
+ }
207
+ };
208
+
209
+ AbstractChosen.prototype.results_update_field = function() {
210
+ this.set_default_text();
211
+ if (!this.is_multiple) {
212
+ this.results_reset_cleanup();
213
+ }
214
+ this.result_clear_highlight();
215
+ this.result_single_selected = null;
216
+ return this.results_build();
217
+ };
218
+
219
+ AbstractChosen.prototype.results_toggle = function() {
220
+ if (this.results_showing) {
221
+ return this.results_hide();
222
+ } else {
223
+ return this.results_show();
224
+ }
225
+ };
226
+
227
+ AbstractChosen.prototype.results_search = function(evt) {
228
+ if (this.results_showing) {
229
+ return this.winnow_results();
230
+ } else {
231
+ return this.results_show();
232
+ }
233
+ };
234
+
235
+ AbstractChosen.prototype.keyup_checker = function(evt) {
236
+ var stroke, _ref;
237
+ stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
238
+ this.search_field_scale();
239
+ switch (stroke) {
240
+ case 8:
241
+ if (this.is_multiple && this.backstroke_length < 1 && this.choices > 0) {
242
+ return this.keydown_backstroke();
243
+ } else if (!this.pending_backstroke) {
244
+ this.result_clear_highlight();
245
+ return this.results_search();
246
+ }
247
+ break;
248
+ case 13:
249
+ evt.preventDefault();
250
+ if (this.results_showing) {
251
+ return this.result_select(evt);
252
+ }
253
+ break;
254
+ case 27:
255
+ if (this.results_showing) {
256
+ this.results_hide();
257
+ }
258
+ return true;
259
+ case 9:
260
+ case 38:
261
+ case 40:
262
+ case 16:
263
+ case 91:
264
+ case 17:
265
+ break;
266
+ default:
267
+ return this.results_search();
268
+ }
269
+ };
270
+
271
+ AbstractChosen.prototype.generate_field_id = function() {
272
+ var new_id;
273
+ new_id = this.generate_random_id();
274
+ this.form_field.id = new_id;
275
+ return new_id;
276
+ };
277
+
278
+ AbstractChosen.prototype.generate_random_char = function() {
279
+ var chars, newchar, rand;
280
+ chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
281
+ rand = Math.floor(Math.random() * chars.length);
282
+ return newchar = chars.substring(rand, rand + 1);
283
+ };
284
+
285
+ return AbstractChosen;
286
+
287
+ })();
288
+
289
+ root.AbstractChosen = AbstractChosen;
290
+
291
+ }).call(this);
292
+
293
+ /*
294
+ Chosen source: generate output using 'cake build'
295
+ Copyright (c) 2011 by Harvest
296
+ */
297
+
298
+
299
+ (function() {
300
+ var $, Chosen, get_side_border_padding, root,
301
+ __hasProp = {}.hasOwnProperty,
302
+ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
303
+
304
+ root = this;
305
+
306
+ $ = jQuery;
307
+
308
+ $.fn.extend({
309
+ chosen: function(options) {
310
+ var browser, match, ua;
311
+ ua = navigator.userAgent.toLowerCase();
312
+ match = /(msie) ([\w.]+)/.exec(ua) || [];
313
+ browser = {
314
+ name: match[1] || "",
315
+ version: match[2] || "0"
316
+ };
317
+ if (browser.name === "msie" && (browser.version === "6.0" || (browser.version === "7.0" && document.documentMode === 7))) {
318
+ return this;
319
+ }
320
+ return this.each(function(input_field) {
321
+ var $this;
322
+ $this = $(this);
323
+ if (!$this.hasClass("chzn-done")) {
324
+ return $this.data('chosen', new Chosen(this, options));
325
+ }
326
+ });
327
+ }
328
+ });
329
+
330
+ Chosen = (function(_super) {
331
+
332
+ __extends(Chosen, _super);
333
+
334
+ function Chosen() {
335
+ return Chosen.__super__.constructor.apply(this, arguments);
336
+ }
337
+
338
+ Chosen.prototype.setup = function() {
339
+ this.form_field_jq = $(this.form_field);
340
+ this.current_value = this.form_field_jq.val();
341
+ return this.is_rtl = this.form_field_jq.hasClass("chzn-rtl");
342
+ };
343
+
344
+ Chosen.prototype.finish_setup = function() {
345
+ return this.form_field_jq.addClass("chzn-done");
346
+ };
347
+
348
+ Chosen.prototype.set_up_html = function() {
349
+ var container_classes, container_div, container_props, dd_top, dd_width, sf_width;
350
+ this.container_id = this.form_field.id.length ? this.form_field.id.replace(/[^\w]/g, '_') : this.generate_field_id();
351
+ this.container_id += "_chzn";
352
+ container_classes = ["chzn-container"];
353
+ container_classes.push("chzn-container-" + (this.is_multiple ? "multi" : "single"));
354
+ if (this.inherit_select_classes && this.form_field.className) {
355
+ container_classes.push(this.form_field.className);
356
+ }
357
+ if (this.is_rtl) {
358
+ container_classes.push("chzn-rtl");
359
+ }
360
+ this.f_width = this.form_field_jq.outerWidth();
361
+ container_props = {
362
+ id: this.container_id,
363
+ "class": container_classes.join(' '),
364
+ style: 'width: ' + this.f_width + 'px;',
365
+ title: this.form_field.title
366
+ };
367
+ container_div = $("<div />", container_props);
368
+ if (this.is_multiple) {
369
+ container_div.html('<ul class="chzn-choices"><li class="search-field"><input type="text" value="' + this.default_text + '" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chzn-drop" style="left:-9000px;"><ul class="chzn-results"></ul></div>');
370
+ } else {
371
+ container_div.html('<a href="javascript:void(0)" class="chzn-single chzn-default" tabindex="-1"><span>' + this.default_text + '</span><div><b></b></div></a><div class="chzn-drop" style="left:-9000px;"><div class="chzn-search"><input type="text" autocomplete="off" /></div><ul class="chzn-results"></ul></div>');
372
+ }
373
+ this.form_field_jq.hide().after(container_div);
374
+ this.container = $('#' + this.container_id);
375
+ this.dropdown = this.container.find('div.chzn-drop').first();
376
+ dd_top = this.container.height();
377
+ dd_width = this.f_width - get_side_border_padding(this.dropdown);
378
+ this.dropdown.css({
379
+ "width": dd_width + "px",
380
+ "top": dd_top + "px"
381
+ });
382
+ this.search_field = this.container.find('input').first();
383
+ this.search_results = this.container.find('ul.chzn-results').first();
384
+ this.search_field_scale();
385
+ this.search_no_results = this.container.find('li.no-results').first();
386
+ if (this.is_multiple) {
387
+ this.search_choices = this.container.find('ul.chzn-choices').first();
388
+ this.search_container = this.container.find('li.search-field').first();
389
+ } else {
390
+ this.search_container = this.container.find('div.chzn-search').first();
391
+ this.selected_item = this.container.find('.chzn-single').first();
392
+ sf_width = dd_width - get_side_border_padding(this.search_container) - get_side_border_padding(this.search_field);
393
+ this.search_field.css({
394
+ "width": sf_width + "px"
395
+ });
396
+ }
397
+ this.results_build();
398
+ this.set_tab_index();
399
+ return this.form_field_jq.trigger("liszt:ready", {
400
+ chosen: this
401
+ });
402
+ };
403
+
404
+ Chosen.prototype.register_observers = function() {
405
+ var _this = this;
406
+ this.container.mousedown(function(evt) {
407
+ _this.container_mousedown(evt);
408
+ });
409
+ this.container.mouseup(function(evt) {
410
+ _this.container_mouseup(evt);
411
+ });
412
+ this.container.mouseenter(function(evt) {
413
+ _this.mouse_enter(evt);
414
+ });
415
+ this.container.mouseleave(function(evt) {
416
+ _this.mouse_leave(evt);
417
+ });
418
+ this.search_results.mouseup(function(evt) {
419
+ _this.search_results_mouseup(evt);
420
+ });
421
+ this.search_results.mouseover(function(evt) {
422
+ _this.search_results_mouseover(evt);
423
+ });
424
+ this.search_results.mouseout(function(evt) {
425
+ _this.search_results_mouseout(evt);
426
+ });
427
+ this.form_field_jq.bind("liszt:updated", function(evt) {
428
+ _this.results_update_field(evt);
429
+ });
430
+ this.form_field_jq.bind("liszt:activate", function(evt) {
431
+ _this.activate_field(evt);
432
+ });
433
+ this.form_field_jq.bind("liszt:open", function(evt) {
434
+ _this.container_mousedown(evt);
435
+ });
436
+ this.search_field.blur(function(evt) {
437
+ _this.input_blur(evt);
438
+ });
439
+ this.search_field.keyup(function(evt) {
440
+ _this.keyup_checker(evt);
441
+ });
442
+ this.search_field.keydown(function(evt) {
443
+ _this.keydown_checker(evt);
444
+ });
445
+ this.search_field.focus(function(evt) {
446
+ _this.input_focus(evt);
447
+ });
448
+ if (this.is_multiple) {
449
+ return this.search_choices.click(function(evt) {
450
+ _this.choices_click(evt);
451
+ });
452
+ } else {
453
+ return this.container.click(function(evt) {
454
+ evt.preventDefault();
455
+ });
456
+ }
457
+ };
458
+
459
+ Chosen.prototype.search_field_disabled = function() {
460
+ this.is_disabled = this.form_field_jq[0].disabled;
461
+ if (this.is_disabled) {
462
+ this.container.addClass('chzn-disabled');
463
+ this.search_field[0].disabled = true;
464
+ if (!this.is_multiple) {
465
+ this.selected_item.unbind("focus", this.activate_action);
466
+ }
467
+ return this.close_field();
468
+ } else {
469
+ this.container.removeClass('chzn-disabled');
470
+ this.search_field[0].disabled = false;
471
+ if (!this.is_multiple) {
472
+ return this.selected_item.bind("focus", this.activate_action);
473
+ }
474
+ }
475
+ };
476
+
477
+ Chosen.prototype.container_mousedown = function(evt) {
478
+ var target_closelink;
479
+ if (!this.is_disabled) {
480
+ target_closelink = evt != null ? ($(evt.target)).hasClass("search-choice-close") : false;
481
+ if (evt && evt.type === "mousedown" && !this.results_showing) {
482
+ evt.preventDefault();
483
+ }
484
+ if (!this.pending_destroy_click && !target_closelink) {
485
+ if (!this.active_field) {
486
+ if (this.is_multiple) {
487
+ this.search_field.val("");
488
+ }
489
+ $(document).click(this.click_test_action);
490
+ this.results_show();
491
+ } else if (!this.is_multiple && evt && (($(evt.target)[0] === this.selected_item[0]) || $(evt.target).parents("a.chzn-single").length)) {
492
+ evt.preventDefault();
493
+ this.results_toggle();
494
+ }
495
+ return this.activate_field();
496
+ } else {
497
+ return this.pending_destroy_click = false;
498
+ }
499
+ }
500
+ };
501
+
502
+ Chosen.prototype.container_mouseup = function(evt) {
503
+ if (evt.target.nodeName === "ABBR" && !this.is_disabled) {
504
+ return this.results_reset(evt);
505
+ }
506
+ };
507
+
508
+ Chosen.prototype.blur_test = function(evt) {
509
+ if (!this.active_field && this.container.hasClass("chzn-container-active")) {
510
+ return this.close_field();
511
+ }
512
+ };
513
+
514
+ Chosen.prototype.close_field = function() {
515
+ $(document).unbind("click", this.click_test_action);
516
+ this.active_field = false;
517
+ this.results_hide();
518
+ this.container.removeClass("chzn-container-active");
519
+ this.winnow_results_clear();
520
+ this.clear_backstroke();
521
+ this.show_search_field_default();
522
+ return this.search_field_scale();
523
+ };
524
+
525
+ Chosen.prototype.activate_field = function() {
526
+ this.container.addClass("chzn-container-active");
527
+ this.active_field = true;
528
+ this.search_field.val(this.search_field.val());
529
+ return this.search_field.focus();
530
+ };
531
+
532
+ Chosen.prototype.test_active_click = function(evt) {
533
+ if ($(evt.target).parents('#' + this.container_id).length) {
534
+ return this.active_field = true;
535
+ } else {
536
+ return this.close_field();
537
+ }
538
+ };
539
+
540
+ Chosen.prototype.results_build = function() {
541
+ var content, data, _i, _len, _ref;
542
+ this.parsing = true;
543
+ this.results_data = root.SelectParser.select_to_array(this.form_field);
544
+ if (this.is_multiple && this.choices > 0) {
545
+ this.search_choices.find("li.search-choice").remove();
546
+ this.choices = 0;
547
+ } else if (!this.is_multiple) {
548
+ this.selected_item.addClass("chzn-default").find("span").text(this.default_text);
549
+ if (this.disable_search || this.form_field.options.length <= this.disable_search_threshold) {
550
+ this.container.addClass("chzn-container-single-nosearch");
551
+ } else {
552
+ this.container.removeClass("chzn-container-single-nosearch");
553
+ }
554
+ }
555
+ content = '';
556
+ _ref = this.results_data;
557
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
558
+ data = _ref[_i];
559
+ if (data.group) {
560
+ content += this.result_add_group(data);
561
+ } else if (!data.empty) {
562
+ content += this.result_add_option(data);
563
+ if (data.selected && this.is_multiple) {
564
+ this.choice_build(data);
565
+ } else if (data.selected && !this.is_multiple) {
566
+ this.selected_item.removeClass("chzn-default").find("span").text(data.text);
567
+ if (this.allow_single_deselect) {
568
+ this.single_deselect_control_build();
569
+ }
570
+ }
571
+ }
572
+ }
573
+ this.search_field_disabled();
574
+ this.show_search_field_default();
575
+ this.search_field_scale();
576
+ this.search_results.html(content);
577
+ return this.parsing = false;
578
+ };
579
+
580
+ Chosen.prototype.result_add_group = function(group) {
581
+ if (!group.disabled) {
582
+ group.dom_id = this.container_id + "_g_" + group.array_index;
583
+ return '<li id="' + group.dom_id + '" class="group-result">' + $("<div />").text(group.label).html() + '</li>';
584
+ } else {
585
+ return "";
586
+ }
587
+ };
588
+
589
+ Chosen.prototype.result_do_highlight = function(el) {
590
+ var high_bottom, high_top, maxHeight, visible_bottom, visible_top;
591
+ if (el.length) {
592
+ this.result_clear_highlight();
593
+ this.result_highlight = el;
594
+ this.result_highlight.addClass("highlighted");
595
+ maxHeight = parseInt(this.search_results.css("maxHeight"), 10);
596
+ visible_top = this.search_results.scrollTop();
597
+ visible_bottom = maxHeight + visible_top;
598
+ high_top = this.result_highlight.position().top + this.search_results.scrollTop();
599
+ high_bottom = high_top + this.result_highlight.outerHeight();
600
+ if (high_bottom >= visible_bottom) {
601
+ return this.search_results.scrollTop((high_bottom - maxHeight) > 0 ? high_bottom - maxHeight : 0);
602
+ } else if (high_top < visible_top) {
603
+ return this.search_results.scrollTop(high_top);
604
+ }
605
+ }
606
+ };
607
+
608
+ Chosen.prototype.result_clear_highlight = function() {
609
+ if (this.result_highlight) {
610
+ this.result_highlight.removeClass("highlighted");
611
+ }
612
+ return this.result_highlight = null;
613
+ };
614
+
615
+ Chosen.prototype.results_show = function() {
616
+ var dd_top;
617
+ if (!this.is_multiple) {
618
+ this.selected_item.addClass("chzn-single-with-drop");
619
+ if (this.result_single_selected) {
620
+ this.result_do_highlight(this.result_single_selected);
621
+ }
622
+ } else if (this.max_selected_options <= this.choices) {
623
+ this.form_field_jq.trigger("liszt:maxselected", {
624
+ chosen: this
625
+ });
626
+ return false;
627
+ }
628
+ dd_top = this.is_multiple ? this.container.height() : this.container.height() - 1;
629
+ this.form_field_jq.trigger("liszt:showing_dropdown", {
630
+ chosen: this
631
+ });
632
+ this.dropdown.css({
633
+ "top": dd_top + "px",
634
+ "left": 0
635
+ });
636
+ this.results_showing = true;
637
+ this.search_field.focus();
638
+ this.search_field.val(this.search_field.val());
639
+ return this.winnow_results();
640
+ };
641
+
642
+ Chosen.prototype.results_hide = function() {
643
+ if (!this.is_multiple) {
644
+ this.selected_item.removeClass("chzn-single-with-drop");
645
+ }
646
+ this.result_clear_highlight();
647
+ this.form_field_jq.trigger("liszt:hiding_dropdown", {
648
+ chosen: this
649
+ });
650
+ this.dropdown.css({
651
+ "left": "-9000px"
652
+ });
653
+ return this.results_showing = false;
654
+ };
655
+
656
+ Chosen.prototype.set_tab_index = function(el) {
657
+ var ti;
658
+ if (this.form_field_jq.attr("tabindex")) {
659
+ ti = this.form_field_jq.attr("tabindex");
660
+ this.form_field_jq.attr("tabindex", -1);
661
+ return this.search_field.attr("tabindex", ti);
662
+ }
663
+ };
664
+
665
+ Chosen.prototype.show_search_field_default = function() {
666
+ if (this.is_multiple && this.choices < 1 && !this.active_field) {
667
+ this.search_field.val(this.default_text);
668
+ return this.search_field.addClass("default");
669
+ } else {
670
+ this.search_field.val("");
671
+ return this.search_field.removeClass("default");
672
+ }
673
+ };
674
+
675
+ Chosen.prototype.search_results_mouseup = function(evt) {
676
+ var target;
677
+ target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
678
+ if (target.length) {
679
+ this.result_highlight = target;
680
+ this.result_select(evt);
681
+ return this.search_field.focus();
682
+ }
683
+ };
684
+
685
+ Chosen.prototype.search_results_mouseover = function(evt) {
686
+ var target;
687
+ target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
688
+ if (target) {
689
+ return this.result_do_highlight(target);
690
+ }
691
+ };
692
+
693
+ Chosen.prototype.search_results_mouseout = function(evt) {
694
+ if ($(evt.target).hasClass("active-result" || $(evt.target).parents('.active-result').first())) {
695
+ return this.result_clear_highlight();
696
+ }
697
+ };
698
+
699
+ Chosen.prototype.choices_click = function(evt) {
700
+ evt.preventDefault();
701
+ if (this.active_field && !($(evt.target).hasClass("search-choice" || $(evt.target).parents('.search-choice').first)) && !this.results_showing) {
702
+ return this.results_show();
703
+ }
704
+ };
705
+
706
+ Chosen.prototype.choice_build = function(item) {
707
+ var choice_id, html, link,
708
+ _this = this;
709
+ if (this.is_multiple && this.max_selected_options <= this.choices) {
710
+ this.form_field_jq.trigger("liszt:maxselected", {
711
+ chosen: this
712
+ });
713
+ return false;
714
+ }
715
+ choice_id = this.container_id + "_c_" + item.array_index;
716
+ this.choices += 1;
717
+ if (item.disabled) {
718
+ html = '<li class="search-choice search-choice-disabled" id="' + choice_id + '"><span>' + item.html + '</span></li>';
719
+ } else {
720
+ html = '<li class="search-choice" id="' + choice_id + '"><span>' + item.html + '</span><a href="javascript:void(0)" class="search-choice-close" rel="' + item.array_index + '"></a></li>';
721
+ }
722
+ this.search_container.before(html);
723
+ link = $('#' + choice_id).find("a").first();
724
+ return link.click(function(evt) {
725
+ return _this.choice_destroy_link_click(evt);
726
+ });
727
+ };
728
+
729
+ Chosen.prototype.choice_destroy_link_click = function(evt) {
730
+ evt.preventDefault();
731
+ if (!this.is_disabled) {
732
+ this.pending_destroy_click = true;
733
+ return this.choice_destroy($(evt.target));
734
+ } else {
735
+ return evt.stopPropagation;
736
+ }
737
+ };
738
+
739
+ Chosen.prototype.choice_destroy = function(link) {
740
+ if (this.result_deselect(link.attr("rel"))) {
741
+ this.choices -= 1;
742
+ this.show_search_field_default();
743
+ if (this.is_multiple && this.choices > 0 && this.search_field.val().length < 1) {
744
+ this.results_hide();
745
+ }
746
+ link.parents('li').first().remove();
747
+ return this.search_field_scale();
748
+ }
749
+ };
750
+
751
+ Chosen.prototype.results_reset = function() {
752
+ this.form_field.options[0].selected = true;
753
+ this.selected_item.find("span").text(this.default_text);
754
+ if (!this.is_multiple) {
755
+ this.selected_item.addClass("chzn-default");
756
+ }
757
+ this.show_search_field_default();
758
+ this.results_reset_cleanup();
759
+ this.form_field_jq.trigger("change");
760
+ if (this.active_field) {
761
+ return this.results_hide();
762
+ }
763
+ };
764
+
765
+ Chosen.prototype.results_reset_cleanup = function() {
766
+ this.current_value = this.form_field_jq.val();
767
+ return this.selected_item.find("abbr").remove();
768
+ };
769
+
770
+ Chosen.prototype.result_select = function(evt) {
771
+ var high, high_id, item, position;
772
+ if (this.result_highlight) {
773
+ high = this.result_highlight;
774
+ high_id = high.attr("id");
775
+ this.result_clear_highlight();
776
+ if (this.is_multiple) {
777
+ this.result_deactivate(high);
778
+ } else {
779
+ this.search_results.find(".result-selected").removeClass("result-selected");
780
+ this.result_single_selected = high;
781
+ this.selected_item.removeClass("chzn-default");
782
+ }
783
+ high.addClass("result-selected");
784
+ position = high_id.substr(high_id.lastIndexOf("_") + 1);
785
+ item = this.results_data[position];
786
+ item.selected = true;
787
+ this.form_field.options[item.options_index].selected = true;
788
+ if (this.is_multiple) {
789
+ this.choice_build(item);
790
+ } else {
791
+ this.selected_item.find("span").first().text(item.text);
792
+ if (this.allow_single_deselect) {
793
+ this.single_deselect_control_build();
794
+ }
795
+ }
796
+ if (!((evt.metaKey || evt.ctrlKey) && this.is_multiple)) {
797
+ this.results_hide();
798
+ }
799
+ this.search_field.val("");
800
+ if (this.is_multiple || this.form_field_jq.val() !== this.current_value) {
801
+ this.form_field_jq.trigger("change", {
802
+ 'selected': this.form_field.options[item.options_index].value
803
+ });
804
+ }
805
+ this.current_value = this.form_field_jq.val();
806
+ return this.search_field_scale();
807
+ }
808
+ };
809
+
810
+ Chosen.prototype.result_activate = function(el) {
811
+ return el.addClass("active-result");
812
+ };
813
+
814
+ Chosen.prototype.result_deactivate = function(el) {
815
+ return el.removeClass("active-result");
816
+ };
817
+
818
+ Chosen.prototype.result_deselect = function(pos) {
819
+ var result, result_data;
820
+ result_data = this.results_data[pos];
821
+ if (!this.form_field.options[result_data.options_index].disabled) {
822
+ result_data.selected = false;
823
+ this.form_field.options[result_data.options_index].selected = false;
824
+ result = $("#" + this.container_id + "_o_" + pos);
825
+ result.removeClass("result-selected").addClass("active-result").show();
826
+ this.result_clear_highlight();
827
+ this.winnow_results();
828
+ this.form_field_jq.trigger("change", {
829
+ deselected: this.form_field.options[result_data.options_index].value
830
+ });
831
+ this.search_field_scale();
832
+ return true;
833
+ } else {
834
+ return false;
835
+ }
836
+ };
837
+
838
+ Chosen.prototype.single_deselect_control_build = function() {
839
+ if (this.allow_single_deselect && this.selected_item.find("abbr").length < 1) {
840
+ return this.selected_item.find("span").first().after("<abbr class=\"search-choice-close\"></abbr>");
841
+ }
842
+ };
843
+
844
+ Chosen.prototype.winnow_results = function() {
845
+ var found, option, part, parts, regex, regexAnchor, result, result_id, results, searchText, startpos, text, zregex, _i, _j, _len, _len1, _ref;
846
+ this.no_results_clear();
847
+ results = 0;
848
+ searchText = this.search_field.val() === this.default_text ? "" : $('<div/>').text($.trim(this.search_field.val())).html();
849
+ regexAnchor = this.search_contains ? "" : "^";
850
+ regex = new RegExp(regexAnchor + searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i');
851
+ zregex = new RegExp(searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i');
852
+ _ref = this.results_data;
853
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
854
+ option = _ref[_i];
855
+ if (!option.disabled && !option.empty) {
856
+ if (option.group) {
857
+ $('#' + option.dom_id).css('display', 'none');
858
+ } else if (!(this.is_multiple && option.selected)) {
859
+ found = false;
860
+ result_id = option.dom_id;
861
+ result = $("#" + result_id);
862
+ if (regex.test(option.html)) {
863
+ found = true;
864
+ results += 1;
865
+ } else if (this.enable_split_word_search && (option.html.indexOf(" ") >= 0 || option.html.indexOf("[") === 0)) {
866
+ parts = option.html.replace(/\[|\]/g, "").split(" ");
867
+ if (parts.length) {
868
+ for (_j = 0, _len1 = parts.length; _j < _len1; _j++) {
869
+ part = parts[_j];
870
+ if (regex.test(part)) {
871
+ found = true;
872
+ results += 1;
873
+ }
874
+ }
875
+ }
876
+ }
877
+ if (found) {
878
+ if (searchText.length) {
879
+ startpos = option.html.search(zregex);
880
+ text = option.html.substr(0, startpos + searchText.length) + '</em>' + option.html.substr(startpos + searchText.length);
881
+ text = text.substr(0, startpos) + '<em>' + text.substr(startpos);
882
+ } else {
883
+ text = option.html;
884
+ }
885
+ result.html(text);
886
+ this.result_activate(result);
887
+ if (option.group_array_index != null) {
888
+ $("#" + this.results_data[option.group_array_index].dom_id).css('display', 'list-item');
889
+ }
890
+ } else {
891
+ if (this.result_highlight && result_id === this.result_highlight.attr('id')) {
892
+ this.result_clear_highlight();
893
+ }
894
+ this.result_deactivate(result);
895
+ }
896
+ }
897
+ }
898
+ }
899
+ if (results < 1 && searchText.length) {
900
+ return this.no_results(searchText);
901
+ } else {
902
+ return this.winnow_results_set_highlight();
903
+ }
904
+ };
905
+
906
+ Chosen.prototype.winnow_results_clear = function() {
907
+ var li, lis, _i, _len, _results;
908
+ this.search_field.val("");
909
+ lis = this.search_results.find("li");
910
+ _results = [];
911
+ for (_i = 0, _len = lis.length; _i < _len; _i++) {
912
+ li = lis[_i];
913
+ li = $(li);
914
+ if (li.hasClass("group-result")) {
915
+ _results.push(li.css('display', 'auto'));
916
+ } else if (!this.is_multiple || !li.hasClass("result-selected")) {
917
+ _results.push(this.result_activate(li));
918
+ } else {
919
+ _results.push(void 0);
920
+ }
921
+ }
922
+ return _results;
923
+ };
924
+
925
+ Chosen.prototype.winnow_results_set_highlight = function() {
926
+ var do_high, selected_results;
927
+ if (!this.result_highlight) {
928
+ selected_results = !this.is_multiple ? this.search_results.find(".result-selected.active-result") : [];
929
+ do_high = selected_results.length ? selected_results.first() : this.search_results.find(".active-result").first();
930
+ if (do_high != null) {
931
+ return this.result_do_highlight(do_high);
932
+ }
933
+ }
934
+ };
935
+
936
+ Chosen.prototype.no_results = function(terms) {
937
+ var no_results_html;
938
+ no_results_html = $('<li class="no-results">' + this.results_none_found + ' "<span></span>"</li>');
939
+ no_results_html.find("span").first().html(terms);
940
+ return this.search_results.append(no_results_html);
941
+ };
942
+
943
+ Chosen.prototype.no_results_clear = function() {
944
+ return this.search_results.find(".no-results").remove();
945
+ };
946
+
947
+ Chosen.prototype.keydown_arrow = function() {
948
+ var first_active, next_sib;
949
+ if (!this.result_highlight) {
950
+ first_active = this.search_results.find("li.active-result").first();
951
+ if (first_active) {
952
+ this.result_do_highlight($(first_active));
953
+ }
954
+ } else if (this.results_showing) {
955
+ next_sib = this.result_highlight.nextAll("li.active-result").first();
956
+ if (next_sib) {
957
+ this.result_do_highlight(next_sib);
958
+ }
959
+ }
960
+ if (!this.results_showing) {
961
+ return this.results_show();
962
+ }
963
+ };
964
+
965
+ Chosen.prototype.keyup_arrow = function() {
966
+ var prev_sibs;
967
+ if (!this.results_showing && !this.is_multiple) {
968
+ return this.results_show();
969
+ } else if (this.result_highlight) {
970
+ prev_sibs = this.result_highlight.prevAll("li.active-result");
971
+ if (prev_sibs.length) {
972
+ return this.result_do_highlight(prev_sibs.first());
973
+ } else {
974
+ if (this.choices > 0) {
975
+ this.results_hide();
976
+ }
977
+ return this.result_clear_highlight();
978
+ }
979
+ }
980
+ };
981
+
982
+ Chosen.prototype.keydown_backstroke = function() {
983
+ var next_available_destroy;
984
+ if (this.pending_backstroke) {
985
+ this.choice_destroy(this.pending_backstroke.find("a").first());
986
+ return this.clear_backstroke();
987
+ } else {
988
+ next_available_destroy = this.search_container.siblings("li.search-choice").last();
989
+ if (next_available_destroy.length && !next_available_destroy.hasClass("search-choice-disabled")) {
990
+ this.pending_backstroke = next_available_destroy;
991
+ if (this.single_backstroke_delete) {
992
+ return this.keydown_backstroke();
993
+ } else {
994
+ return this.pending_backstroke.addClass("search-choice-focus");
995
+ }
996
+ }
997
+ }
998
+ };
999
+
1000
+ Chosen.prototype.clear_backstroke = function() {
1001
+ if (this.pending_backstroke) {
1002
+ this.pending_backstroke.removeClass("search-choice-focus");
1003
+ }
1004
+ return this.pending_backstroke = null;
1005
+ };
1006
+
1007
+ Chosen.prototype.keydown_checker = function(evt) {
1008
+ var stroke, _ref;
1009
+ stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
1010
+ this.search_field_scale();
1011
+ if (stroke !== 8 && this.pending_backstroke) {
1012
+ this.clear_backstroke();
1013
+ }
1014
+ switch (stroke) {
1015
+ case 8:
1016
+ this.backstroke_length = this.search_field.val().length;
1017
+ break;
1018
+ case 9:
1019
+ if (this.results_showing && !this.is_multiple) {
1020
+ this.result_select(evt);
1021
+ }
1022
+ this.mouse_on_container = false;
1023
+ break;
1024
+ case 13:
1025
+ evt.preventDefault();
1026
+ break;
1027
+ case 38:
1028
+ evt.preventDefault();
1029
+ this.keyup_arrow();
1030
+ break;
1031
+ case 40:
1032
+ this.keydown_arrow();
1033
+ break;
1034
+ }
1035
+ };
1036
+
1037
+ Chosen.prototype.search_field_scale = function() {
1038
+ var dd_top, div, h, style, style_block, styles, w, _i, _len;
1039
+ if (this.is_multiple) {
1040
+ h = 0;
1041
+ w = 0;
1042
+ style_block = "position:absolute; left: -1000px; top: -1000px; display:none;";
1043
+ styles = ['font-size', 'font-style', 'font-weight', 'font-family', 'line-height', 'text-transform', 'letter-spacing'];
1044
+ for (_i = 0, _len = styles.length; _i < _len; _i++) {
1045
+ style = styles[_i];
1046
+ style_block += style + ":" + this.search_field.css(style) + ";";
1047
+ }
1048
+ div = $('<div />', {
1049
+ 'style': style_block
1050
+ });
1051
+ div.text(this.search_field.val());
1052
+ $('body').append(div);
1053
+ w = div.width() + 25;
1054
+ div.remove();
1055
+ if (w > this.f_width - 10) {
1056
+ w = this.f_width - 10;
1057
+ }
1058
+ this.search_field.css({
1059
+ 'width': w + 'px'
1060
+ });
1061
+ dd_top = this.container.height();
1062
+ return this.dropdown.css({
1063
+ "top": dd_top + "px"
1064
+ });
1065
+ }
1066
+ };
1067
+
1068
+ Chosen.prototype.generate_random_id = function() {
1069
+ var string;
1070
+ string = "sel" + this.generate_random_char() + this.generate_random_char() + this.generate_random_char();
1071
+ while ($("#" + string).length > 0) {
1072
+ string += this.generate_random_char();
1073
+ }
1074
+ return string;
1075
+ };
1076
+
1077
+ return Chosen;
1078
+
1079
+ })(AbstractChosen);
1080
+
1081
+ root.Chosen = Chosen;
1082
+
1083
+ get_side_border_padding = function(elmt) {
1084
+ var side_border_padding;
1085
+ return side_border_padding = elmt.outerWidth() - elmt.width();
1086
+ };
1087
+
1088
+ root.get_side_border_padding = get_side_border_padding;
1089
+
1090
+ }).call(this);
assets/js/chosen/chosen.jquery.min.js CHANGED
@@ -1,10 +1,10 @@
1
- // Chosen, a Select Box Enhancer for jQuery and Protoype
2
- // by Patrick Filler for Harvest, http://getharvest.com
3
- //
4
- // Version 0.9.12
5
- // Full source at https://github.com/harvesthq/chosen
6
- // Copyright (c) 2011 Harvest http://getharvest.com
7
-
8
- // MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
9
- // This file is generated by `cake build`, do not edit it by hand.
10
  (function(){var e;e=function(){function e(){this.options_index=0,this.parsed=[]}return e.prototype.add_node=function(e){return e.nodeName.toUpperCase()==="OPTGROUP"?this.add_group(e):this.add_option(e)},e.prototype.add_group=function(e){var t,n,r,i,s,o;t=this.parsed.length,this.parsed.push({array_index:t,group:!0,label:e.label,children:0,disabled:e.disabled}),s=e.childNodes,o=[];for(r=0,i=s.length;r<i;r++)n=s[r],o.push(this.add_option(n,t,e.disabled));return o},e.prototype.add_option=function(e,t,n){if(e.nodeName.toUpperCase()==="OPTION")return e.text!==""?(t!=null&&(this.parsed[t].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:e.value,text:e.text,html:e.innerHTML,selected:e.selected,disabled:n===!0?n:e.disabled,group_array_index:t,classes:e.className,style:e.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1},e}(),e.select_to_array=function(t){var n,r,i,s,o;r=new e,o=t.childNodes;for(i=0,s=o.length;i<s;i++)n=o[i],r.add_node(n);return r.parsed},this.SelectParser=e}).call(this),function(){var e,t;t=this,e=function(){function e(e,t){this.form_field=e,this.options=t!=null?t:{},this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers(),this.finish_setup()}return e.prototype.set_default_values=function(){var e=this;return this.click_test_action=function(t){return e.test_active_click(t)},this.activate_action=function(t){return e.activate_field(t)},this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.result_single_selected=null,this.allow_single_deselect=this.options.allow_single_deselect!=null&&this.form_field.options[0]!=null&&this.form_field.options[0].text===""?this.options.allow_single_deselect:!1,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=this.options.enable_split_word_search!=null?this.options.enable_split_word_search:!0,this.search_contains=this.options.search_contains||!1,this.choices=0,this.single_backstroke_delete=this.options.single_backstroke_delete||!1,this.max_selected_options=this.options.max_selected_options||Infinity,this.inherit_select_classes=this.options.inherit_select_classes||!1},e.prototype.set_default_text=function(){return this.form_field.getAttribute("data-placeholder")?this.default_text=this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||"Select Some Options":this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||"Select an Option",this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||"No results match"},e.prototype.mouse_enter=function(){return this.mouse_on_container=!0},e.prototype.mouse_leave=function(){return this.mouse_on_container=!1},e.prototype.input_focus=function(e){var t=this;if(this.is_multiple){if(!this.active_field)return setTimeout(function(){return t.container_mousedown()},50)}else if(!this.active_field)return this.activate_field()},e.prototype.input_blur=function(e){var t=this;if(!this.mouse_on_container)return this.active_field=!1,setTimeout(function(){return t.blur_test()},100)},e.prototype.result_add_option=function(e){var t,n;return e.disabled?"":(e.dom_id=this.container_id+"_o_"+e.array_index,t=e.selected&&this.is_multiple?[]:["active-result"],e.selected&&t.push("result-selected"),e.group_array_index!=null&&t.push("group-option"),e.classes!==""&&t.push(e.classes),n=e.style.cssText!==""?' style="'+e.style+'"':"",'<li id="'+e.dom_id+'" class="'+t.join(" ")+'"'+n+">"+e.html+"</li>")},e.prototype.results_update_field=function(){return this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.result_single_selected=null,this.results_build()},e.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},e.prototype.results_search=function(e){return this.results_showing?this.winnow_results():this.results_show()},e.prototype.keyup_checker=function(e){var t,n;t=(n=e.which)!=null?n:e.keyCode,this.search_field_scale();switch(t){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:e.preventDefault();if(this.results_showing)return this.result_select(e);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},e.prototype.generate_field_id=function(){var e;return e=this.generate_random_id(),this.form_field.id=e,e},e.prototype.generate_random_char=function(){var e,t,n;return e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",n=Math.floor(Math.random()*e.length),t=e.substring(n,n+1)},e}(),t.AbstractChosen=e}.call(this),function(){var e,t,n,r,i={}.hasOwnProperty,s=function(e,t){function r(){this.constructor=e}for(var n in t)i.call(t,n)&&(e[n]=t[n]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e};r=this,e=jQuery,e.fn.extend({chosen:function(n){var r,i,s;return s=navigator.userAgent.toLowerCase(),i=/(msie) ([\w.]+)/.exec(s)||[],r={name:i[1]||"",version:i[2]||"0"},r.name==="msie"&&(r.version==="6.0"||r.version==="7.0"&&document.documentMode===7)?this:this.each(function(r){var i;i=e(this);if(!i.hasClass("chzn-done"))return i.data("chosen",new t(this,n))})}}),t=function(t){function i(){return i.__super__.constructor.apply(this,arguments)}return s(i,t),i.prototype.setup=function(){return this.form_field_jq=e(this.form_field),this.current_value=this.form_field_jq.val(),this.is_rtl=this.form_field_jq.hasClass("chzn-rtl")},i.prototype.finish_setup=function(){return this.form_field_jq.addClass("chzn-done")},i.prototype.set_up_html=function(){var t,r,i,s,o,u;return this.container_id=this.form_field.id.length?this.form_field.id.replace(/[^\w]/g,"_"):this.generate_field_id(),this.container_id+="_chzn",t=["chzn-container"],t.push("chzn-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&t.push(this.form_field.className),this.is_rtl&&t.push("chzn-rtl"),this.f_width=this.form_field_jq.outerWidth(),i={id:this.container_id,"class":t.join(" "),style:"width: "+this.f_width+"px;",title:this.form_field.title},r=e("<div />",i),this.is_multiple?r.html('<ul class="chzn-choices"><li class="search-field"><input type="text" value="'+this.default_text+'" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chzn-drop" style="left:-9000px;"><ul class="chzn-results"></ul></div>'):r.html('<a href="javascript:void(0)" class="chzn-single chzn-default" tabindex="-1"><span>'+this.default_text+'</span><div><b></b></div></a><div class="chzn-drop" style="left:-9000px;"><div class="chzn-search"><input type="text" autocomplete="off" /></div><ul class="chzn-results"></ul></div>'),this.form_field_jq.hide().after(r),this.container=e("#"+this.container_id),this.dropdown=this.container.find("div.chzn-drop").first(),s=this.container.height(),o=this.f_width-n(this.dropdown),this.dropdown.css({width:o+"px",top:s+"px"}),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chzn-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chzn-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chzn-search").first(),this.selected_item=this.container.find(".chzn-single").first(),u=o-n(this.search_container)-n(this.search_field),this.search_field.css({width:u+"px"})),this.results_build(),this.set_tab_index(),this.form_field_jq.trigger("liszt:ready",{chosen:this})},i.prototype.register_observers=function(){var e=this;return this.container.mousedown(function(t){e.container_mousedown(t)}),this.container.mouseup(function(t){e.container_mouseup(t)}),this.container.mouseenter(function(t){e.mouse_enter(t)}),this.container.mouseleave(function(t){e.mouse_leave(t)}),this.search_results.mouseup(function(t){e.search_results_mouseup(t)}),this.search_results.mouseover(function(t){e.search_results_mouseover(t)}),this.search_results.mouseout(function(t){e.search_results_mouseout(t)}),this.form_field_jq.bind("liszt:updated",function(t){e.results_update_field(t)}),this.form_field_jq.bind("liszt:activate",function(t){e.activate_field(t)}),this.form_field_jq.bind("liszt:open",function(t){e.container_mousedown(t)}),this.search_field.blur(function(t){e.input_blur(t)}),this.search_field.keyup(function(t){e.keyup_checker(t)}),this.search_field.keydown(function(t){e.keydown_checker(t)}),this.search_field.focus(function(t){e.input_focus(t)}),this.is_multiple?this.search_choices.click(function(t){e.choices_click(t)}):this.container.click(function(e){e.preventDefault()})},i.prototype.search_field_disabled=function(){this.is_disabled=this.form_field_jq[0].disabled;if(this.is_disabled)return this.container.addClass("chzn-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus",this.activate_action),this.close_field();this.container.removeClass("chzn-disabled"),this.search_field[0].disabled=!1;if(!this.is_multiple)return this.selected_item.bind("focus",this.activate_action)},i.prototype.container_mousedown=function(t){var n;if(!this.is_disabled)return n=t!=null?e(t.target).hasClass("search-choice-close"):!1,t&&t.type==="mousedown"&&!this.results_showing&&t.preventDefault(),!this.pending_destroy_click&&!n?(this.active_field?!this.is_multiple&&t&&(e(t.target)[0]===this.selected_item[0]||e(t.target).parents("a.chzn-single").length)&&(t.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),e(document).click(this.click_test_action),this.results_show()),this.activate_field()):this.pending_destroy_click=!1},i.prototype.container_mouseup=function(e){if(e.target.nodeName==="ABBR"&&!this.is_disabled)return this.results_reset(e)},i.prototype.blur_test=function(e){if(!this.active_field&&this.container.hasClass("chzn-container-active"))return this.close_field()},i.prototype.close_field=function(){return e(document).unbind("click",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chzn-container-active"),this.winnow_results_clear(),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},i.prototype.activate_field=function(){return this.container.addClass("chzn-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},i.prototype.test_active_click=function(t){return e(t.target).parents("#"+this.container_id).length?this.active_field=!0:this.close_field()},i.prototype.results_build=function(){var e,t,n,i,s;this.parsing=!0,this.results_data=r.SelectParser.select_to_array(this.form_field),this.is_multiple&&this.choices>0?(this.search_choices.find("li.search-choice").remove(),this.choices=0):this.is_multiple||(this.selected_item.addClass("chzn-default").find("span").text(this.default_text),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?this.container.addClass("chzn-container-single-nosearch"):this.container.removeClass("chzn-container-single-nosearch")),e="",s=this.results_data;for(n=0,i=s.length;n<i;n++)t=s[n],t.group?e+=this.result_add_group(t):t.empty||(e+=this.result_add_option(t),t.selected&&this.is_multiple?this.choice_build(t):t.selected&&!this.is_multiple&&(this.selected_item.removeClass("chzn-default").find("span").text(t.text),this.allow_single_deselect&&this.single_deselect_control_build()));return this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.search_results.html(e),this.parsing=!1},i.prototype.result_add_group=function(t){return t.disabled?"":(t.dom_id=this.container_id+"_g_"+t.array_index,'<li id="'+t.dom_id+'" class="group-result">'+e("<div />").text(t.label).html()+"</li>")},i.prototype.result_do_highlight=function(e){var t,n,r,i,s;if(e.length){this.result_clear_highlight(),this.result_highlight=e,this.result_highlight.addClass("highlighted"),r=parseInt(this.search_results.css("maxHeight"),10),s=this.search_results.scrollTop(),i=r+s,n=this.result_highlight.position().top+this.search_results.scrollTop(),t=n+this.result_highlight.outerHeight();if(t>=i)return this.search_results.scrollTop(t-r>0?t-r:0);if(n<s)return this.search_results.scrollTop(n)}},i.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},i.prototype.results_show=function(){var e;if(!this.is_multiple)this.selected_item.addClass("chzn-single-with-drop"),this.result_single_selected&&this.result_do_highlight(this.result_single_selected);else if(this.max_selected_options<=this.choices)return this.form_field_jq.trigger("liszt:maxselected",{chosen:this}),!1;return e=this.is_multiple?this.container.height():this.container.height()-1,this.form_field_jq.trigger("liszt:showing_dropdown",{chosen:this}),this.dropdown.css({top:e+"px",left:0}),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.search_field.val()),this.winnow_results()},i.prototype.results_hide=function(){return this.is_multiple||this.selected_item.removeClass("chzn-single-with-drop"),this.result_clear_highlight(),this.form_field_jq.trigger("liszt:hiding_dropdown",{chosen:this}),this.dropdown.css({left:"-9000px"}),this.results_showing=!1},i.prototype.set_tab_index=function(e){var t;if(this.form_field_jq.attr("tabindex"))return t=this.form_field_jq.attr("tabindex"),this.form_field_jq.attr("tabindex",-1),this.search_field.attr("tabindex",t)},i.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},i.prototype.search_results_mouseup=function(t){var n;n=e(t.target).hasClass("active-result")?e(t.target):e(t.target).parents(".active-result").first();if(n.length)return this.result_highlight=n,this.result_select(t),this.search_field.focus()},i.prototype.search_results_mouseover=function(t){var n;n=e(t.target).hasClass("active-result")?e(t.target):e(t.target).parents(".active-result").first();if(n)return this.result_do_highlight(n)},i.prototype.search_results_mouseout=function(t){if(e(t.target).hasClass("active-result"))return this.result_clear_highlight()},i.prototype.choices_click=function(t){t.preventDefault();if(this.active_field&&!e(t.target).hasClass("search-choice")&&!this.results_showing)return this.results_show()},i.prototype.choice_build=function(t){var n,r,i,s=this;return this.is_multiple&&this.max_selected_options<=this.choices?(this.form_field_jq.trigger("liszt:maxselected",{chosen:this}),!1):(n=this.container_id+"_c_"+t.array_index,this.choices+=1,t.disabled?r='<li class="search-choice search-choice-disabled" id="'+n+'"><span>'+t.html+"</span></li>":r='<li class="search-choice" id="'+n+'"><span>'+t.html+'</span><a href="javascript:void(0)" class="search-choice-close" rel="'+t.array_index+'"></a></li>',this.search_container.before(r),i=e("#"+n).find("a").first(),i.click(function(e){return s.choice_destroy_link_click(e)}))},i.prototype.choice_destroy_link_click=function(t){return t.preventDefault(),this.is_disabled?t.stopPropagation:(this.pending_destroy_click=!0,this.choice_destroy(e(t.target)))},i.prototype.choice_destroy=function(e){if(this.result_deselect(e.attr("rel")))return this.choices-=1,this.show_search_field_default(),this.is_multiple&&this.choices>0&&this.search_field.val().length<1&&this.results_hide(),e.parents("li").first().remove(),this.search_field_scale()},i.prototype.results_reset=function(){this.form_field.options[0].selected=!0,this.selected_item.find("span").text(this.default_text),this.is_multiple||this.selected_item.addClass("chzn-default"),this.show_search_field_default(),this.results_reset_cleanup(),this.form_field_jq.trigger("change");if(this.active_field)return this.results_hide()},i.prototype.results_reset_cleanup=function(){return this.current_value=this.form_field_jq.val(),this.selected_item.find("abbr").remove()},i.prototype.result_select=function(e){var t,n,r,i;if(this.result_highlight)return t=this.result_highlight,n=t.attr("id"),this.result_clear_highlight(),this.is_multiple?this.result_deactivate(t):(this.search_results.find(".result-selected").removeClass("result-selected"),this.result_single_selected=t,this.selected_item.removeClass("chzn-default")),t.addClass("result-selected"),i=n.substr(n.lastIndexOf("_")+1),r=this.results_data[i],r.selected=!0,this.form_field.options[r.options_index].selected=!0,this.is_multiple?this.choice_build(r):(this.selected_item.find("span").first().text(r.text),this.allow_single_deselect&&this.single_deselect_control_build()),(!e.metaKey&&!e.ctrlKey||!this.is_multiple)&&this.results_hide(),this.search_field.val(""),(this.is_multiple||this.form_field_jq.val()!==this.current_value)&&this.form_field_jq.trigger("change",{selected:this.form_field.options[r.options_index].value}),this.current_value=this.form_field_jq.val(),this.search_field_scale()},i.prototype.result_activate=function(e){return e.addClass("active-result")},i.prototype.result_deactivate=function(e){return e.removeClass("active-result")},i.prototype.result_deselect=function(t){var n,r;return r=this.results_data[t],this.form_field.options[r.options_index].disabled?!1:(r.selected=!1,this.form_field.options[r.options_index].selected=!1,n=e("#"+this.container_id+"_o_"+t),n.removeClass("result-selected").addClass("active-result").show(),this.result_clear_highlight(),this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[r.options_index].value}),this.search_field_scale(),!0)},i.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect&&this.selected_item.find("abbr").length<1)return this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>')},i.prototype.winnow_results=function(){var t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y;this.no_results_clear(),f=0,l=this.search_field.val()===this.default_text?"":e("<div/>").text(e.trim(this.search_field.val())).html(),o=this.search_contains?"":"^",s=new RegExp(o+l.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),p=new RegExp(l.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),y=this.results_data;for(d=0,m=y.length;d<m;d++){n=y[d];if(!n.disabled&&!n.empty)if(n.group)e("#"+n.dom_id).css("display","none");else if(!this.is_multiple||!n.selected){t=!1,a=n.dom_id,u=e("#"+a);if(s.test(n.html))t=!0,f+=1;else if(this.enable_split_word_search&&(n.html.indexOf(" ")>=0||n.html.indexOf("[")===0)){i=n.html.replace(/\[|\]/g,"").split(" ");if(i.length)for(v=0,g=i.length;v<g;v++)r=i[v],s.test(r)&&(t=!0,f+=1)}t?(l.length?(c=n.html.search(p),h=n.html.substr(0,c+l.length)+"</em>"+n.html.substr(c+l.length),h=h.substr(0,c)+"<em>"+h.substr(c)):h=n.html,u.html(h),this.result_activate(u),n.group_array_index!=null&&e("#"+this.results_data[n.group_array_index].dom_id).css("display","list-item")):(this.result_highlight&&a===this.result_highlight.attr("id")&&this.result_clear_highlight(),this.result_deactivate(u))}}return f<1&&l.length?this.no_results(l):this.winnow_results_set_highlight()},i.prototype.winnow_results_clear=function(){var t,n,r,i,s;this.search_field.val(""),n=this.search_results.find("li"),s=[];for(r=0,i=n.length;r<i;r++)t=n[r],t=e(t),t.hasClass("group-result")?s.push(t.css("display","auto")):!this.is_multiple||!t.hasClass("result-selected")?s.push(this.result_activate(t)):s.push(void 0);return s},i.prototype.winnow_results_set_highlight=function(){var e,t;if(!this.result_highlight){t=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),e=t.length?t.first():this.search_results.find(".active-result").first();if(e!=null)return this.result_do_highlight(e)}},i.prototype.no_results=function(t){var n;return n=e('<li class="no-results">'+this.results_none_found+' "<span></span>"</li>'),n.find("span").first().html(t),this.search_results.append(n)},i.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},i.prototype.keydown_arrow=function(){var t,n;this.result_highlight?this.results_showing&&(n=this.result_highlight.nextAll("li.active-result").first(),n&&this.result_do_highlight(n)):(t=this.search_results.find("li.active-result").first(),t&&this.result_do_highlight(e(t)));if(!this.results_showing)return this.results_show()},i.prototype.keyup_arrow=function(){var e;if(!this.results_showing&&!this.is_multiple)return this.results_show();if(this.result_highlight)return e=this.result_highlight.prevAll("li.active-result"),e.length?this.result_do_highlight(e.first()):(this.choices>0&&this.results_hide(),this.result_clear_highlight())},i.prototype.keydown_backstroke=function(){var e;if(this.pending_backstroke)return this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke();e=this.search_container.siblings("li.search-choice").last();if(e.length&&!e.hasClass("search-choice-disabled"))return this.pending_backstroke=e,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")},i.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},i.prototype.keydown_checker=function(e){var t,n;t=(n=e.which)!=null?n:e.keyCode,this.search_field_scale(),t!==8&&this.pending_backstroke&&this.clear_backstroke();switch(t){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(e),this.mouse_on_container=!1;break;case 13:e.preventDefault();break;case 38:e.preventDefault(),this.keyup_arrow();break;case 40:this.keydown_arrow()}},i.prototype.search_field_scale=function(){var t,n,r,i,s,o,u,a,f;if(this.is_multiple){r=0,u=0,s="position:absolute; left: -1000px; top: -1000px; display:none;",o=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"];for(a=0,f=o.length;a<f;a++)i=o[a],s+=i+":"+this.search_field.css(i)+";";return n=e("<div />",{style:s}),n.text(this.search_field.val()),e("body").append(n),u=n.width()+25,n.remove(),u>this.f_width-10&&(u=this.f_width-10),this.search_field.css({width:u+"px"}),t=this.container.height(),this.dropdown.css({top:t+"px"})}},i.prototype.generate_random_id=function(){var t;t="sel"+this.generate_random_char()+this.generate_random_char()+this.generate_random_char();while(e("#"+t).length>0)t+=this.generate_random_char();return t},i}(AbstractChosen),r.Chosen=t,n=function(e){var t;return t=e.outerWidth()-e.width()},r.get_side_border_padding=n}.call(this);
1
+ // Chosen, a Select Box Enhancer for jQuery and Protoype
2
+ // by Patrick Filler for Harvest, http://getharvest.com
3
+ //
4
+ // Version 0.9.12
5
+ // Full source at https://github.com/harvesthq/chosen
6
+ // Copyright (c) 2011 Harvest http://getharvest.com
7
+
8
+ // MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
9
+ // This file is generated by `cake build`, do not edit it by hand.
10
  (function(){var e;e=function(){function e(){this.options_index=0,this.parsed=[]}return e.prototype.add_node=function(e){return e.nodeName.toUpperCase()==="OPTGROUP"?this.add_group(e):this.add_option(e)},e.prototype.add_group=function(e){var t,n,r,i,s,o;t=this.parsed.length,this.parsed.push({array_index:t,group:!0,label:e.label,children:0,disabled:e.disabled}),s=e.childNodes,o=[];for(r=0,i=s.length;r<i;r++)n=s[r],o.push(this.add_option(n,t,e.disabled));return o},e.prototype.add_option=function(e,t,n){if(e.nodeName.toUpperCase()==="OPTION")return e.text!==""?(t!=null&&(this.parsed[t].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:e.value,text:e.text,html:e.innerHTML,selected:e.selected,disabled:n===!0?n:e.disabled,group_array_index:t,classes:e.className,style:e.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1},e}(),e.select_to_array=function(t){var n,r,i,s,o;r=new e,o=t.childNodes;for(i=0,s=o.length;i<s;i++)n=o[i],r.add_node(n);return r.parsed},this.SelectParser=e}).call(this),function(){var e,t;t=this,e=function(){function e(e,t){this.form_field=e,this.options=t!=null?t:{},this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers(),this.finish_setup()}return e.prototype.set_default_values=function(){var e=this;return this.click_test_action=function(t){return e.test_active_click(t)},this.activate_action=function(t){return e.activate_field(t)},this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.result_single_selected=null,this.allow_single_deselect=this.options.allow_single_deselect!=null&&this.form_field.options[0]!=null&&this.form_field.options[0].text===""?this.options.allow_single_deselect:!1,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=this.options.enable_split_word_search!=null?this.options.enable_split_word_search:!0,this.search_contains=this.options.search_contains||!1,this.choices=0,this.single_backstroke_delete=this.options.single_backstroke_delete||!1,this.max_selected_options=this.options.max_selected_options||Infinity,this.inherit_select_classes=this.options.inherit_select_classes||!1},e.prototype.set_default_text=function(){return this.form_field.getAttribute("data-placeholder")?this.default_text=this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||"Select Some Options":this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||"Select an Option",this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||"No results match"},e.prototype.mouse_enter=function(){return this.mouse_on_container=!0},e.prototype.mouse_leave=function(){return this.mouse_on_container=!1},e.prototype.input_focus=function(e){var t=this;if(this.is_multiple){if(!this.active_field)return setTimeout(function(){return t.container_mousedown()},50)}else if(!this.active_field)return this.activate_field()},e.prototype.input_blur=function(e){var t=this;if(!this.mouse_on_container)return this.active_field=!1,setTimeout(function(){return t.blur_test()},100)},e.prototype.result_add_option=function(e){var t,n;return e.disabled?"":(e.dom_id=this.container_id+"_o_"+e.array_index,t=e.selected&&this.is_multiple?[]:["active-result"],e.selected&&t.push("result-selected"),e.group_array_index!=null&&t.push("group-option"),e.classes!==""&&t.push(e.classes),n=e.style.cssText!==""?' style="'+e.style+'"':"",'<li id="'+e.dom_id+'" class="'+t.join(" ")+'"'+n+">"+e.html+"</li>")},e.prototype.results_update_field=function(){return this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.result_single_selected=null,this.results_build()},e.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},e.prototype.results_search=function(e){return this.results_showing?this.winnow_results():this.results_show()},e.prototype.keyup_checker=function(e){var t,n;t=(n=e.which)!=null?n:e.keyCode,this.search_field_scale();switch(t){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:e.preventDefault();if(this.results_showing)return this.result_select(e);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},e.prototype.generate_field_id=function(){var e;return e=this.generate_random_id(),this.form_field.id=e,e},e.prototype.generate_random_char=function(){var e,t,n;return e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",n=Math.floor(Math.random()*e.length),t=e.substring(n,n+1)},e}(),t.AbstractChosen=e}.call(this),function(){var e,t,n,r,i={}.hasOwnProperty,s=function(e,t){function r(){this.constructor=e}for(var n in t)i.call(t,n)&&(e[n]=t[n]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e};r=this,e=jQuery,e.fn.extend({chosen:function(n){var r,i,s;return s=navigator.userAgent.toLowerCase(),i=/(msie) ([\w.]+)/.exec(s)||[],r={name:i[1]||"",version:i[2]||"0"},r.name==="msie"&&(r.version==="6.0"||r.version==="7.0"&&document.documentMode===7)?this:this.each(function(r){var i;i=e(this);if(!i.hasClass("chzn-done"))return i.data("chosen",new t(this,n))})}}),t=function(t){function i(){return i.__super__.constructor.apply(this,arguments)}return s(i,t),i.prototype.setup=function(){return this.form_field_jq=e(this.form_field),this.current_value=this.form_field_jq.val(),this.is_rtl=this.form_field_jq.hasClass("chzn-rtl")},i.prototype.finish_setup=function(){return this.form_field_jq.addClass("chzn-done")},i.prototype.set_up_html=function(){var t,r,i,s,o,u;return this.container_id=this.form_field.id.length?this.form_field.id.replace(/[^\w]/g,"_"):this.generate_field_id(),this.container_id+="_chzn",t=["chzn-container"],t.push("chzn-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&t.push(this.form_field.className),this.is_rtl&&t.push("chzn-rtl"),this.f_width=this.form_field_jq.outerWidth(),i={id:this.container_id,"class":t.join(" "),style:"width: "+this.f_width+"px;",title:this.form_field.title},r=e("<div />",i),this.is_multiple?r.html('<ul class="chzn-choices"><li class="search-field"><input type="text" value="'+this.default_text+'" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chzn-drop" style="left:-9000px;"><ul class="chzn-results"></ul></div>'):r.html('<a href="javascript:void(0)" class="chzn-single chzn-default" tabindex="-1"><span>'+this.default_text+'</span><div><b></b></div></a><div class="chzn-drop" style="left:-9000px;"><div class="chzn-search"><input type="text" autocomplete="off" /></div><ul class="chzn-results"></ul></div>'),this.form_field_jq.hide().after(r),this.container=e("#"+this.container_id),this.dropdown=this.container.find("div.chzn-drop").first(),s=this.container.height(),o=this.f_width-n(this.dropdown),this.dropdown.css({width:o+"px",top:s+"px"}),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chzn-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chzn-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chzn-search").first(),this.selected_item=this.container.find(".chzn-single").first(),u=o-n(this.search_container)-n(this.search_field),this.search_field.css({width:u+"px"})),this.results_build(),this.set_tab_index(),this.form_field_jq.trigger("liszt:ready",{chosen:this})},i.prototype.register_observers=function(){var e=this;return this.container.mousedown(function(t){e.container_mousedown(t)}),this.container.mouseup(function(t){e.container_mouseup(t)}),this.container.mouseenter(function(t){e.mouse_enter(t)}),this.container.mouseleave(function(t){e.mouse_leave(t)}),this.search_results.mouseup(function(t){e.search_results_mouseup(t)}),this.search_results.mouseover(function(t){e.search_results_mouseover(t)}),this.search_results.mouseout(function(t){e.search_results_mouseout(t)}),this.form_field_jq.bind("liszt:updated",function(t){e.results_update_field(t)}),this.form_field_jq.bind("liszt:activate",function(t){e.activate_field(t)}),this.form_field_jq.bind("liszt:open",function(t){e.container_mousedown(t)}),this.search_field.blur(function(t){e.input_blur(t)}),this.search_field.keyup(function(t){e.keyup_checker(t)}),this.search_field.keydown(function(t){e.keydown_checker(t)}),this.search_field.focus(function(t){e.input_focus(t)}),this.is_multiple?this.search_choices.click(function(t){e.choices_click(t)}):this.container.click(function(e){e.preventDefault()})},i.prototype.search_field_disabled=function(){this.is_disabled=this.form_field_jq[0].disabled;if(this.is_disabled)return this.container.addClass("chzn-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus",this.activate_action),this.close_field();this.container.removeClass("chzn-disabled"),this.search_field[0].disabled=!1;if(!this.is_multiple)return this.selected_item.bind("focus",this.activate_action)},i.prototype.container_mousedown=function(t){var n;if(!this.is_disabled)return n=t!=null?e(t.target).hasClass("search-choice-close"):!1,t&&t.type==="mousedown"&&!this.results_showing&&t.preventDefault(),!this.pending_destroy_click&&!n?(this.active_field?!this.is_multiple&&t&&(e(t.target)[0]===this.selected_item[0]||e(t.target).parents("a.chzn-single").length)&&(t.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),e(document).click(this.click_test_action),this.results_show()),this.activate_field()):this.pending_destroy_click=!1},i.prototype.container_mouseup=function(e){if(e.target.nodeName==="ABBR"&&!this.is_disabled)return this.results_reset(e)},i.prototype.blur_test=function(e){if(!this.active_field&&this.container.hasClass("chzn-container-active"))return this.close_field()},i.prototype.close_field=function(){return e(document).unbind("click",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chzn-container-active"),this.winnow_results_clear(),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},i.prototype.activate_field=function(){return this.container.addClass("chzn-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},i.prototype.test_active_click=function(t){return e(t.target).parents("#"+this.container_id).length?this.active_field=!0:this.close_field()},i.prototype.results_build=function(){var e,t,n,i,s;this.parsing=!0,this.results_data=r.SelectParser.select_to_array(this.form_field),this.is_multiple&&this.choices>0?(this.search_choices.find("li.search-choice").remove(),this.choices=0):this.is_multiple||(this.selected_item.addClass("chzn-default").find("span").text(this.default_text),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?this.container.addClass("chzn-container-single-nosearch"):this.container.removeClass("chzn-container-single-nosearch")),e="",s=this.results_data;for(n=0,i=s.length;n<i;n++)t=s[n],t.group?e+=this.result_add_group(t):t.empty||(e+=this.result_add_option(t),t.selected&&this.is_multiple?this.choice_build(t):t.selected&&!this.is_multiple&&(this.selected_item.removeClass("chzn-default").find("span").text(t.text),this.allow_single_deselect&&this.single_deselect_control_build()));return this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.search_results.html(e),this.parsing=!1},i.prototype.result_add_group=function(t){return t.disabled?"":(t.dom_id=this.container_id+"_g_"+t.array_index,'<li id="'+t.dom_id+'" class="group-result">'+e("<div />").text(t.label).html()+"</li>")},i.prototype.result_do_highlight=function(e){var t,n,r,i,s;if(e.length){this.result_clear_highlight(),this.result_highlight=e,this.result_highlight.addClass("highlighted"),r=parseInt(this.search_results.css("maxHeight"),10),s=this.search_results.scrollTop(),i=r+s,n=this.result_highlight.position().top+this.search_results.scrollTop(),t=n+this.result_highlight.outerHeight();if(t>=i)return this.search_results.scrollTop(t-r>0?t-r:0);if(n<s)return this.search_results.scrollTop(n)}},i.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},i.prototype.results_show=function(){var e;if(!this.is_multiple)this.selected_item.addClass("chzn-single-with-drop"),this.result_single_selected&&this.result_do_highlight(this.result_single_selected);else if(this.max_selected_options<=this.choices)return this.form_field_jq.trigger("liszt:maxselected",{chosen:this}),!1;return e=this.is_multiple?this.container.height():this.container.height()-1,this.form_field_jq.trigger("liszt:showing_dropdown",{chosen:this}),this.dropdown.css({top:e+"px",left:0}),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.search_field.val()),this.winnow_results()},i.prototype.results_hide=function(){return this.is_multiple||this.selected_item.removeClass("chzn-single-with-drop"),this.result_clear_highlight(),this.form_field_jq.trigger("liszt:hiding_dropdown",{chosen:this}),this.dropdown.css({left:"-9000px"}),this.results_showing=!1},i.prototype.set_tab_index=function(e){var t;if(this.form_field_jq.attr("tabindex"))return t=this.form_field_jq.attr("tabindex"),this.form_field_jq.attr("tabindex",-1),this.search_field.attr("tabindex",t)},i.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},i.prototype.search_results_mouseup=function(t){var n;n=e(t.target).hasClass("active-result")?e(t.target):e(t.target).parents(".active-result").first();if(n.length)return this.result_highlight=n,this.result_select(t),this.search_field.focus()},i.prototype.search_results_mouseover=function(t){var n;n=e(t.target).hasClass("active-result")?e(t.target):e(t.target).parents(".active-result").first();if(n)return this.result_do_highlight(n)},i.prototype.search_results_mouseout=function(t){if(e(t.target).hasClass("active-result"))return this.result_clear_highlight()},i.prototype.choices_click=function(t){t.preventDefault();if(this.active_field&&!e(t.target).hasClass("search-choice")&&!this.results_showing)return this.results_show()},i.prototype.choice_build=function(t){var n,r,i,s=this;return this.is_multiple&&this.max_selected_options<=this.choices?(this.form_field_jq.trigger("liszt:maxselected",{chosen:this}),!1):(n=this.container_id+"_c_"+t.array_index,this.choices+=1,t.disabled?r='<li class="search-choice search-choice-disabled" id="'+n+'"><span>'+t.html+"</span></li>":r='<li class="search-choice" id="'+n+'"><span>'+t.html+'</span><a href="javascript:void(0)" class="search-choice-close" rel="'+t.array_index+'"></a></li>',this.search_container.before(r),i=e("#"+n).find("a").first(),i.click(function(e){return s.choice_destroy_link_click(e)}))},i.prototype.choice_destroy_link_click=function(t){return t.preventDefault(),this.is_disabled?t.stopPropagation:(this.pending_destroy_click=!0,this.choice_destroy(e(t.target)))},i.prototype.choice_destroy=function(e){if(this.result_deselect(e.attr("rel")))return this.choices-=1,this.show_search_field_default(),this.is_multiple&&this.choices>0&&this.search_field.val().length<1&&this.results_hide(),e.parents("li").first().remove(),this.search_field_scale()},i.prototype.results_reset=function(){this.form_field.options[0].selected=!0,this.selected_item.find("span").text(this.default_text),this.is_multiple||this.selected_item.addClass("chzn-default"),this.show_search_field_default(),this.results_reset_cleanup(),this.form_field_jq.trigger("change");if(this.active_field)return this.results_hide()},i.prototype.results_reset_cleanup=function(){return this.current_value=this.form_field_jq.val(),this.selected_item.find("abbr").remove()},i.prototype.result_select=function(e){var t,n,r,i;if(this.result_highlight)return t=this.result_highlight,n=t.attr("id"),this.result_clear_highlight(),this.is_multiple?this.result_deactivate(t):(this.search_results.find(".result-selected").removeClass("result-selected"),this.result_single_selected=t,this.selected_item.removeClass("chzn-default")),t.addClass("result-selected"),i=n.substr(n.lastIndexOf("_")+1),r=this.results_data[i],r.selected=!0,this.form_field.options[r.options_index].selected=!0,this.is_multiple?this.choice_build(r):(this.selected_item.find("span").first().text(r.text),this.allow_single_deselect&&this.single_deselect_control_build()),(!e.metaKey&&!e.ctrlKey||!this.is_multiple)&&this.results_hide(),this.search_field.val(""),(this.is_multiple||this.form_field_jq.val()!==this.current_value)&&this.form_field_jq.trigger("change",{selected:this.form_field.options[r.options_index].value}),this.current_value=this.form_field_jq.val(),this.search_field_scale()},i.prototype.result_activate=function(e){return e.addClass("active-result")},i.prototype.result_deactivate=function(e){return e.removeClass("active-result")},i.prototype.result_deselect=function(t){var n,r;return r=this.results_data[t],this.form_field.options[r.options_index].disabled?!1:(r.selected=!1,this.form_field.options[r.options_index].selected=!1,n=e("#"+this.container_id+"_o_"+t),n.removeClass("result-selected").addClass("active-result").show(),this.result_clear_highlight(),this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[r.options_index].value}),this.search_field_scale(),!0)},i.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect&&this.selected_item.find("abbr").length<1)return this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>')},i.prototype.winnow_results=function(){var t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y;this.no_results_clear(),f=0,l=this.search_field.val()===this.default_text?"":e("<div/>").text(e.trim(this.search_field.val())).html(),o=this.search_contains?"":"^",s=new RegExp(o+l.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),p=new RegExp(l.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),y=this.results_data;for(d=0,m=y.length;d<m;d++){n=y[d];if(!n.disabled&&!n.empty)if(n.group)e("#"+n.dom_id).css("display","none");else if(!this.is_multiple||!n.selected){t=!1,a=n.dom_id,u=e("#"+a);if(s.test(n.html))t=!0,f+=1;else if(this.enable_split_word_search&&(n.html.indexOf(" ")>=0||n.html.indexOf("[")===0)){i=n.html.replace(/\[|\]/g,"").split(" ");if(i.length)for(v=0,g=i.length;v<g;v++)r=i[v],s.test(r)&&(t=!0,f+=1)}t?(l.length?(c=n.html.search(p),h=n.html.substr(0,c+l.length)+"</em>"+n.html.substr(c+l.length),h=h.substr(0,c)+"<em>"+h.substr(c)):h=n.html,u.html(h),this.result_activate(u),n.group_array_index!=null&&e("#"+this.results_data[n.group_array_index].dom_id).css("display","list-item")):(this.result_highlight&&a===this.result_highlight.attr("id")&&this.result_clear_highlight(),this.result_deactivate(u))}}return f<1&&l.length?this.no_results(l):this.winnow_results_set_highlight()},i.prototype.winnow_results_clear=function(){var t,n,r,i,s;this.search_field.val(""),n=this.search_results.find("li"),s=[];for(r=0,i=n.length;r<i;r++)t=n[r],t=e(t),t.hasClass("group-result")?s.push(t.css("display","auto")):!this.is_multiple||!t.hasClass("result-selected")?s.push(this.result_activate(t)):s.push(void 0);return s},i.prototype.winnow_results_set_highlight=function(){var e,t;if(!this.result_highlight){t=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),e=t.length?t.first():this.search_results.find(".active-result").first();if(e!=null)return this.result_do_highlight(e)}},i.prototype.no_results=function(t){var n;return n=e('<li class="no-results">'+this.results_none_found+' "<span></span>"</li>'),n.find("span").first().html(t),this.search_results.append(n)},i.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},i.prototype.keydown_arrow=function(){var t,n;this.result_highlight?this.results_showing&&(n=this.result_highlight.nextAll("li.active-result").first(),n&&this.result_do_highlight(n)):(t=this.search_results.find("li.active-result").first(),t&&this.result_do_highlight(e(t)));if(!this.results_showing)return this.results_show()},i.prototype.keyup_arrow=function(){var e;if(!this.results_showing&&!this.is_multiple)return this.results_show();if(this.result_highlight)return e=this.result_highlight.prevAll("li.active-result"),e.length?this.result_do_highlight(e.first()):(this.choices>0&&this.results_hide(),this.result_clear_highlight())},i.prototype.keydown_backstroke=function(){var e;if(this.pending_backstroke)return this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke();e=this.search_container.siblings("li.search-choice").last();if(e.length&&!e.hasClass("search-choice-disabled"))return this.pending_backstroke=e,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")},i.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},i.prototype.keydown_checker=function(e){var t,n;t=(n=e.which)!=null?n:e.keyCode,this.search_field_scale(),t!==8&&this.pending_backstroke&&this.clear_backstroke();switch(t){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(e),this.mouse_on_container=!1;break;case 13:e.preventDefault();break;case 38:e.preventDefault(),this.keyup_arrow();break;case 40:this.keydown_arrow()}},i.prototype.search_field_scale=function(){var t,n,r,i,s,o,u,a,f;if(this.is_multiple){r=0,u=0,s="position:absolute; left: -1000px; top: -1000px; display:none;",o=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"];for(a=0,f=o.length;a<f;a++)i=o[a],s+=i+":"+this.search_field.css(i)+";";return n=e("<div />",{style:s}),n.text(this.search_field.val()),e("body").append(n),u=n.width()+25,n.remove(),u>this.f_width-10&&(u=this.f_width-10),this.search_field.css({width:u+"px"}),t=this.container.height(),this.dropdown.css({top:t+"px"})}},i.prototype.generate_random_id=function(){var t;t="sel"+this.generate_random_char()+this.generate_random_char()+this.generate_random_char();while(e("#"+t).length>0)t+=this.generate_random_char();return t},i}(AbstractChosen),r.Chosen=t,n=function(e){var t;return t=e.outerWidth()-e.width()},r.get_side_border_padding=n}.call(this);
assets/js/dlm-uninstall.js CHANGED
@@ -1,70 +1,70 @@
1
- jQuery(document).ready(function ($) {
2
-
3
- var uninstall = $("a.uninstall-dlm"),
4
- formContainer = $('#dlm-uninstall-form');
5
-
6
- formContainer.on('click', '#delete_all', function () {
7
- if ( $('#delete_all').is(':checked') ) {
8
- $('#delete_options').prop('checked', true);
9
- $('#delete_transients').prop('checked', true);
10
- $('#delete_cpt').prop('checked', true);
11
- $('#delete_set_tables').prop('checked', true);
12
- } else {
13
- $('#delete_options').prop('checked', false);
14
- $('#delete_transients').prop('checked', false);
15
- $('#delete_cpt').prop('checked', false);
16
- $('#delete_set_tables').prop('checked', false);
17
- }
18
- });
19
-
20
- $(uninstall).on("click", function () {
21
-
22
- $('body').toggleClass('dlm-uninstall-form-active');
23
- formContainer.fadeIn();
24
-
25
- formContainer.on('click', '#dlm-uninstall-submit-form', function (e) {
26
- formContainer.addClass('toggle-spinner');
27
- var selectedOptions = {
28
- delete_options: ($('#delete_options').is(':checked')) ? 1 : 0,
29
- delete_transients: ($('#delete_transients').is(':checked')) ? 1 : 0,
30
- delete_cpt: ($('#delete_cpt').is(':checked')) ? 1 : 0,
31
- delete_set_tables: ($('#delete_set_tables').is(':checked')) ? 1 : 0,
32
- };
33
-
34
- var data = {
35
- 'action': 'dlm_uninstall_plugin',
36
- 'security': wpDLMUninstall.nonce,
37
- 'dataType': "json",
38
- 'options': selectedOptions
39
- };
40
-
41
- $.post(
42
- ajaxurl,
43
- data,
44
- function (response) {
45
- // Redirect to plugins page
46
- window.location.href = wpDLMUninstall.redirect_url;
47
- }
48
- );
49
- });
50
-
51
- // If we click outside the form, the form will close
52
- // Stop propagation from form
53
- formContainer.on('click', function (e) {
54
- e.stopPropagation();
55
- });
56
-
57
- $('.dlm-uninstall-form-wrapper, .close-uninstall-form').on('click', function (e) {
58
- e.stopPropagation();
59
- formContainer.fadeOut();
60
- $('body').removeClass('dlm-uninstall-form-active');
61
- });
62
-
63
- $(document).on("keyup", function (e) {
64
- if ( e.key === "Escape" ) {
65
- formContainer.fadeOut();
66
- $('body').removeClass('dlm-uninstall-form-active');
67
- }
68
- });
69
- });
70
  });
1
+ jQuery(document).ready(function ($) {
2
+
3
+ var uninstall = $("a.uninstall-dlm"),
4
+ formContainer = $('#dlm-uninstall-form');
5
+
6
+ formContainer.on('click', '#delete_all', function () {
7
+ if ( $('#delete_all').is(':checked') ) {
8
+ $('#delete_options').prop('checked', true);
9
+ $('#delete_transients').prop('checked', true);
10
+ $('#delete_cpt').prop('checked', true);
11
+ $('#delete_set_tables').prop('checked', true);
12
+ } else {
13
+ $('#delete_options').prop('checked', false);
14
+ $('#delete_transients').prop('checked', false);
15
+ $('#delete_cpt').prop('checked', false);
16
+ $('#delete_set_tables').prop('checked', false);
17
+ }
18
+ });
19
+
20
+ $(uninstall).on("click", function () {
21
+
22
+ $('body').toggleClass('dlm-uninstall-form-active');
23
+ formContainer.fadeIn();
24
+
25
+ formContainer.on('click', '#dlm-uninstall-submit-form', function (e) {
26
+ formContainer.addClass('toggle-spinner');
27
+ var selectedOptions = {
28
+ delete_options: ($('#delete_options').is(':checked')) ? 1 : 0,
29
+ delete_transients: ($('#delete_transients').is(':checked')) ? 1 : 0,
30
+ delete_cpt: ($('#delete_cpt').is(':checked')) ? 1 : 0,
31
+ delete_set_tables: ($('#delete_set_tables').is(':checked')) ? 1 : 0,
32
+ };
33
+
34
+ var data = {
35
+ 'action': 'dlm_uninstall_plugin',
36
+ 'security': wpDLMUninstall.nonce,
37
+ 'dataType': "json",
38
+ 'options': selectedOptions
39
+ };
40
+
41
+ $.post(
42
+ ajaxurl,
43
+ data,
44
+ function (response) {
45
+ // Redirect to plugins page
46
+ window.location.href = wpDLMUninstall.redirect_url;
47
+ }
48
+ );
49
+ });
50
+
51
+ // If we click outside the form, the form will close
52
+ // Stop propagation from form
53
+ formContainer.on('click', function (e) {
54
+ e.stopPropagation();
55
+ });
56
+
57
+ $('.dlm-uninstall-form-wrapper, .close-uninstall-form').on('click', function (e) {
58
+ e.stopPropagation();
59
+ formContainer.fadeOut();
60
+ $('body').removeClass('dlm-uninstall-form-active');
61
+ });
62
+
63
+ $(document).on("keyup", function (e) {
64
+ if ( e.key === "Escape" ) {
65
+ formContainer.fadeOut();
66
+ $('body').removeClass('dlm-uninstall-form-active');
67
+ }
68
+ });
69
+ });
70
  });
assets/js/edit-download.js CHANGED
@@ -92,6 +92,8 @@ jQuery( function ( $ ) {
92
  numberOfMonths: 1,
93
  showButtonPanel: true
94
  } );
 
 
95
  } );
96
 
97
  return false;
92
  numberOfMonths: 1,
93
  showButtonPanel: true
94
  } );
95
+
96
+ jQuery(document).trigger( 'dlm_new_file_added', [this, response] );
97
  } );
98
 
99
  return false;
assets/js/edit-download.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(function(a){function l(){jQuery(".downloadable_files .downloadable_file").each(function(e,o){jQuery(".file_menu_order",o).val(parseInt(jQuery(o).index(".downloadable_files .downloadable_file")))})}var n;jQuery(".expand_all").click(function(){return jQuery(this).closest(".dlm-metaboxes-wrapper").find(".dlm-metabox table").show(),!1}),jQuery(".close_all").click(function(){return jQuery(this).closest(".dlm-metaboxes-wrapper").find(".dlm-metabox table").hide(),!1}),jQuery(".dlm-metaboxes-wrapper").on("click",".dlm-metabox h3",function(e){jQuery(e.target).filter(":input, option").length||jQuery(this).next(".dlm-metabox-content").toggle()}),jQuery(".dlm-metabox.closed").each(function(){jQuery(this).find(".dlm-metabox-content").hide()}),jQuery(".date-picker-field").datepicker({dateFormat:"yy-mm-dd",numberOfMonths:1,showButtonPanel:!0}),jQuery(".downloadable_files").sortable({items:".downloadable_file",cursor:"move",axis:"y",handle:"h3",scrollSensitivity:40,forcePlaceholderSize:!0,helper:"clone",opacity:.65,placeholder:"dlm-metabox-sortable-placeholder",start:function(e,o){o.item.css("background-color","#f6f6f6")},stop:function(e,o){o.item.removeAttr("style"),l()}}),jQuery(".download_monitor_files").on("click","a.add_file",function(){jQuery(".download_monitor_files").block({message:null,overlayCSS:{background:"#fff url("+a("#dlm-plugin-url").val()+"/assets/images/ajax-loader.gif) no-repeat center",opacity:.6}});var e=jQuery(".downloadable_files .downloadable_file").length,e={action:"download_monitor_add_file",post_id:a("#dlm-post-id").val(),size:e,security:a("#dlm-ajax-nonce-add-file").val()};return jQuery.post(ajaxurl,e,function(e){jQuery(".downloadable_files").prepend(e),l(),jQuery(".download_monitor_files").unblock(),jQuery(".date-picker-field").datepicker({dateFormat:"yy-mm-dd",numberOfMonths:1,showButtonPanel:!0})}),!1}),jQuery(".download_monitor_files").on("click","button.remove_file",function(e){var o;return e.preventDefault(),confirm(dlm_ed_strings.confirm_delete)&&(0<(e=(o=jQuery(this).closest(".downloadable_file")).attr("data-file"))?(jQuery(o).block({message:null,overlayCSS:{background:"#fff url("+a("#dlm-plugin-url").val()+"/assets/images/ajax-loader.gif) no-repeat center",opacity:.6}}),e={action:"download_monitor_remove_file",file_id:e,download_id:a("#dlm-post-id").val(),security:a("#dlm-ajax-nonce-remove-file").val()},jQuery.post(ajaxurl,e,function(e){jQuery(o).fadeOut("300").remove()})):jQuery(o).fadeOut("300").remove()),!1}),jQuery(".download_monitor_files").on("click","a.dlm_browse_for_file",function(e){return downloadable_files_field=jQuery(this).closest(".downloadable_file").find('textarea[name^="downloadable_file_urls"]'),window.send_to_editor=window.send_to_browse_file_url,tb_show(dlm_ed_strings.browse_file,"media-upload.php?post_id="+a("#dlm-post-id").val()+"&amp;type=downloadable_file_browser&amp;from=wpdlm01&amp;TB_iframe=true"),!1}),window.send_to_browse_file_url=function(e){e&&(old=jQuery.trim(jQuery(downloadable_files_field).val()),old&&(old+="\n"),jQuery(downloadable_files_field).val(old+e)),tb_remove(),window.send_to_editor=window.send_to_editor_default},jQuery(document).on("click",".dlm_media_library",function(e){var o=a(this),l=o.parent().parent().find(".downloadable_file_urls"),t=l.val();e.preventDefault(),n&&n.close();e=[new wp.media.controller.Library({library:wp.media.query(),multiple:!0,title:o.data("choose"),priority:20,filterable:"all"})];(n=wp.media.frames.downloadable_file=wp.media({title:o.data("choose"),library:{type:""},button:{text:o.data("update")},multiple:!0,states:e})).on("select",function(){n.state().get("selection").map(function(e){(e=e.toJSON()).url&&(t=t?t+"\n"+e.url:e.url)}),l.val(t)}),n.on("ready",function(){n.uploader.options.uploader.params={type:"dlm_download"}}),n.open()}),a(".copy-dlm-button").click(function(e){e.preventDefault();e=a(this).parent().find("input");e.focus(),e.select(),document.execCommand("copy"),a(this).next("span").text(a(this).data("item")+" copied"),a(".copy-dlm-button").not(a(this)).parent().find("span").text("")})});
1
+ jQuery(function(a){function l(){jQuery(".downloadable_files .downloadable_file").each(function(e,o){jQuery(".file_menu_order",o).val(parseInt(jQuery(o).index(".downloadable_files .downloadable_file")))})}var n;jQuery(".expand_all").click(function(){return jQuery(this).closest(".dlm-metaboxes-wrapper").find(".dlm-metabox table").show(),!1}),jQuery(".close_all").click(function(){return jQuery(this).closest(".dlm-metaboxes-wrapper").find(".dlm-metabox table").hide(),!1}),jQuery(".dlm-metaboxes-wrapper").on("click",".dlm-metabox h3",function(e){jQuery(e.target).filter(":input, option").length||jQuery(this).next(".dlm-metabox-content").toggle()}),jQuery(".dlm-metabox.closed").each(function(){jQuery(this).find(".dlm-metabox-content").hide()}),jQuery(".date-picker-field").datepicker({dateFormat:"yy-mm-dd",numberOfMonths:1,showButtonPanel:!0}),jQuery(".downloadable_files").sortable({items:".downloadable_file",cursor:"move",axis:"y",handle:"h3",scrollSensitivity:40,forcePlaceholderSize:!0,helper:"clone",opacity:.65,placeholder:"dlm-metabox-sortable-placeholder",start:function(e,o){o.item.css("background-color","#f6f6f6")},stop:function(e,o){o.item.removeAttr("style"),l()}}),jQuery(".download_monitor_files").on("click","a.add_file",function(){jQuery(".download_monitor_files").block({message:null,overlayCSS:{background:"#fff url("+a("#dlm-plugin-url").val()+"/assets/images/ajax-loader.gif) no-repeat center",opacity:.6}});var e=jQuery(".downloadable_files .downloadable_file").length,e={action:"download_monitor_add_file",post_id:a("#dlm-post-id").val(),size:e,security:a("#dlm-ajax-nonce-add-file").val()};return jQuery.post(ajaxurl,e,function(e){jQuery(".downloadable_files").prepend(e),l(),jQuery(".download_monitor_files").unblock(),jQuery(".date-picker-field").datepicker({dateFormat:"yy-mm-dd",numberOfMonths:1,showButtonPanel:!0}),jQuery(document).trigger("dlm_new_file_added",[this,e])}),!1}),jQuery(".download_monitor_files").on("click","button.remove_file",function(e){var o;return e.preventDefault(),confirm(dlm_ed_strings.confirm_delete)&&(0<(e=(o=jQuery(this).closest(".downloadable_file")).attr("data-file"))?(jQuery(o).block({message:null,overlayCSS:{background:"#fff url("+a("#dlm-plugin-url").val()+"/assets/images/ajax-loader.gif) no-repeat center",opacity:.6}}),e={action:"download_monitor_remove_file",file_id:e,download_id:a("#dlm-post-id").val(),security:a("#dlm-ajax-nonce-remove-file").val()},jQuery.post(ajaxurl,e,function(e){jQuery(o).fadeOut("300").remove()})):jQuery(o).fadeOut("300").remove()),!1}),jQuery(".download_monitor_files").on("click","a.dlm_browse_for_file",function(e){return downloadable_files_field=jQuery(this).closest(".downloadable_file").find('textarea[name^="downloadable_file_urls"]'),window.send_to_editor=window.send_to_browse_file_url,tb_show(dlm_ed_strings.browse_file,"media-upload.php?post_id="+a("#dlm-post-id").val()+"&amp;type=downloadable_file_browser&amp;from=wpdlm01&amp;TB_iframe=true"),!1}),window.send_to_browse_file_url=function(e){e&&(old=jQuery.trim(jQuery(downloadable_files_field).val()),old&&(old+="\n"),jQuery(downloadable_files_field).val(old+e)),tb_remove(),window.send_to_editor=window.send_to_editor_default},jQuery(document).on("click",".dlm_media_library",function(e){var o=a(this),l=o.parent().parent().find(".downloadable_file_urls"),t=l.val();e.preventDefault(),n&&n.close();e=[new wp.media.controller.Library({library:wp.media.query(),multiple:!0,title:o.data("choose"),priority:20,filterable:"all"})];(n=wp.media.frames.downloadable_file=wp.media({title:o.data("choose"),library:{type:""},button:{text:o.data("update")},multiple:!0,states:e})).on("select",function(){n.state().get("selection").map(function(e){(e=e.toJSON()).url&&(t=t?t+"\n"+e.url:e.url)}),l.val(t)}),n.on("ready",function(){n.uploader.options.uploader.params={type:"dlm_download"}}),n.open()}),a(".copy-dlm-button").click(function(e){e.preventDefault();e=a(this).parent().find("input");e.focus(),e.select(),document.execCommand("copy"),a(this).next("span").text(a(this).data("item")+" copied"),a(".copy-dlm-button").not(a(this)).parent().find("span").text("")})});
assets/js/extensions.js CHANGED
@@ -1,42 +1,42 @@
1
- jQuery( function ( $ ) {
2
-
3
- $.each( $( '.extension_license a' ), function ( k, v ) {
4
- $( v ).click( function () {
5
- var wrap = $( v ).closest( '.extension_license' );
6
-
7
- var ex_ac = (
8
- 'inactive' == $( wrap ).find( '#status' ).val()
9
- ) ? 'activate' : 'deactivate';
10
-
11
- $(wrap).find('.dlm_license_error').remove();
12
-
13
- $.post( ajaxurl, {
14
- action: 'dlm_extension',
15
- nonce: $( '#dlm-ajax-nonce' ).val(),
16
- product_id: $( wrap ).find( '#product_id' ).val(),
17
- key: $( wrap ).find( '#key' ).val(),
18
- email: $( wrap ).find( '#email' ).val(),
19
- extension_action: ex_ac
20
- }, function ( response ) {
21
- if ( response.result == 'failed' ) {
22
- $( wrap ).prepend( $( "<div>" ).addClass( "dlm_license_error" ).html( response.message ) );
23
- } else {
24
- if ( 'activate' == ex_ac ) {
25
- $( wrap ).find( '.license-status' ).addClass( 'active' ).html( 'ACTIVE' );
26
- $( wrap ).find( '.button' ).html( 'Deactivate' );
27
- $( wrap ).find( '#status' ).val( 'active' );
28
- $( wrap ).find( '#key' ).attr( 'disabled', true );
29
- $( wrap ).find( '#email' ).attr( 'disabled', true );
30
- } else {
31
- $( wrap ).find( '.license-status' ).removeClass( 'active' ).html( 'INACTIVE' );
32
- $( wrap ).find( '.button' ).html( 'Activate' );
33
- $( wrap ).find( '#status' ).val( 'inactive' );
34
- $( wrap ).find( '#key' ).attr( 'disabled', false );
35
- $( wrap ).find( '#email' ).attr( 'disabled', false );
36
- }
37
- }
38
- } );
39
-
40
- } );
41
- } );
42
  } );
1
+ jQuery( function ( $ ) {
2
+
3
+ $.each( $( '.extension_license a' ), function ( k, v ) {
4
+ $( v ).click( function () {
5
+ var wrap = $( v ).closest( '.extension_license' );
6
+
7
+ var ex_ac = (
8
+ 'inactive' == $( wrap ).find( '#status' ).val()
9
+ ) ? 'activate' : 'deactivate';
10
+
11
+ $(wrap).find('.dlm_license_error').remove();
12
+
13
+ $.post( ajaxurl, {
14
+ action: 'dlm_extension',
15
+ nonce: $( '#dlm-ajax-nonce' ).val(),
16
+ product_id: $( wrap ).find( '#product_id' ).val(),
17
+ key: $( wrap ).find( '#key' ).val(),
18
+ email: $( wrap ).find( '#email' ).val(),
19
+ extension_action: ex_ac
20
+ }, function ( response ) {
21
+ if ( response.result == 'failed' ) {
22
+ $( wrap ).prepend( $( "<div>" ).addClass( "dlm_license_error" ).html( response.message ) );
23
+ } else {
24
+ if ( 'activate' == ex_ac ) {
25
+ $( wrap ).find( '.license-status' ).addClass( 'active' ).html( 'ACTIVE' );
26
+ $( wrap ).find( '.button' ).html( 'Deactivate' );
27
+ $( wrap ).find( '#status' ).val( 'active' );
28
+ $( wrap ).find( '#key' ).attr( 'disabled', true );
29
+ $( wrap ).find( '#email' ).attr( 'disabled', true );
30
+ } else {
31
+ $( wrap ).find( '.license-status' ).removeClass( 'active' ).html( 'INACTIVE' );
32
+ $( wrap ).find( '.button' ).html( 'Activate' );
33
+ $( wrap ).find( '#status' ).val( 'inactive' );
34
+ $( wrap ).find( '#key' ).attr( 'disabled', false );
35
+ $( wrap ).find( '#email' ).attr( 'disabled', false );
36
+ }
37
+ }
38
+ } );
39
+
40
+ } );
41
+ } );
42
  } );
assets/js/insert-download.js CHANGED
@@ -1,9 +1,9 @@
1
- jQuery( function ($) {
2
- // Browse for file
3
- jQuery( 'body' ).on( 'click', 'a.dlm_insert_download', function () {
4
-
5
- tb_show( dlm_id_strings.insert_download, 'media-upload.php?type=add_download&amp;from=wpdlm01&amp;TB_iframe=true&amp;height=200' );
6
-
7
- return false;
8
- } );
9
  } );
1
+ jQuery( function ($) {
2
+ // Browse for file
3
+ jQuery( 'body' ).on( 'click', 'a.dlm_insert_download', function () {
4
+
5
+ tb_show( dlm_id_strings.insert_download, 'media-upload.php?type=add_download&amp;from=wpdlm01&amp;TB_iframe=true&amp;height=200' );
6
+
7
+ return false;
8
+ } );
9
  } );
assets/js/legacy-upgrader/build/style.css CHANGED
@@ -1,2 +1,2 @@
1
- #dlm_legacy_upgrader_app{height:100%;box-sizing:border-box}._1kijZ35OiZkKapzULElh6m ._2CxVTmzHXSW60xGZZcsG4W{position:relative;background:#419ccb;color:#fff;font-weight:700;padding:10px 10px 10px 35px}._1kijZ35OiZkKapzULElh6m ._2CxVTmzHXSW60xGZZcsG4W img{display:block;position:absolute;left:12px;top:12px;width:15px;height:15px;z-index:10}._1kijZ35OiZkKapzULElh6m ul{width:100%;padding:10px 0}._1kijZ35OiZkKapzULElh6m ul li{display:inline-block;width:50%}._1kijZ35OiZkKapzULElh6m ul li:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\F147";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top;font-size:1.5em}._1kijZ35OiZkKapzULElh6m ul li.zV9Nyt3hQBQicmm04gduY:before{color:#000}._1kijZ35OiZkKapzULElh6m ul li._1AzdgG9aB69nDxpkTig5B9:before{color:green}._5MraKW-sdXoMAncl8aoJ0 ._34ZBh3TYpaRFeMMsfEgz75{position:relative;background:#419ccb;color:#fff;font-weight:700;padding:10px 10px 10px 35px}._5MraKW-sdXoMAncl8aoJ0 ._34ZBh3TYpaRFeMMsfEgz75 img{display:block;position:absolute;left:12px;top:12px;width:15px;height:15px;z-index:10}._5MraKW-sdXoMAncl8aoJ0 ul{width:100%;padding:10px 0}._5MraKW-sdXoMAncl8aoJ0 ul li{display:inline-block;width:50%}._5MraKW-sdXoMAncl8aoJ0 ul li:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\F147";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top;font-size:1.5em}._5MraKW-sdXoMAncl8aoJ0 ul li._34VuGJn3eCzOVIhWxpf3EI:before{color:#000}._5MraKW-sdXoMAncl8aoJ0 ul li._3o3myVBr0p_jZTcVVSWdNC:before{color:green}
2
  /*# sourceMappingURL=style.css.map*/
1
+ #dlm_legacy_upgrader_app{height:100%;box-sizing:border-box}._1kijZ35OiZkKapzULElh6m ._2CxVTmzHXSW60xGZZcsG4W{position:relative;background:#419ccb;color:#fff;font-weight:700;padding:10px 10px 10px 35px}._1kijZ35OiZkKapzULElh6m ._2CxVTmzHXSW60xGZZcsG4W img{display:block;position:absolute;left:12px;top:12px;width:15px;height:15px;z-index:10}._1kijZ35OiZkKapzULElh6m ul{width:100%;padding:10px 0}._1kijZ35OiZkKapzULElh6m ul li{display:inline-block;width:50%}._1kijZ35OiZkKapzULElh6m ul li:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\F147";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top;font-size:1.5em}._1kijZ35OiZkKapzULElh6m ul li.zV9Nyt3hQBQicmm04gduY:before{color:#000}._1kijZ35OiZkKapzULElh6m ul li._1AzdgG9aB69nDxpkTig5B9:before{color:green}._5MraKW-sdXoMAncl8aoJ0 ._34ZBh3TYpaRFeMMsfEgz75{position:relative;background:#419ccb;color:#fff;font-weight:700;padding:10px 10px 10px 35px}._5MraKW-sdXoMAncl8aoJ0 ._34ZBh3TYpaRFeMMsfEgz75 img{display:block;position:absolute;left:12px;top:12px;width:15px;height:15px;z-index:10}._5MraKW-sdXoMAncl8aoJ0 ul{width:100%;padding:10px 0}._5MraKW-sdXoMAncl8aoJ0 ul li{display:inline-block;width:50%}._5MraKW-sdXoMAncl8aoJ0 ul li:before{font-family:dashicons!important;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0 4px 0 0;content:"\F147";top:1px;left:-1px;font-size:1em;line-height:inherit;position:relative;vertical-align:top;font-size:1.5em}._5MraKW-sdXoMAncl8aoJ0 ul li._34VuGJn3eCzOVIhWxpf3EI:before{color:#000}._5MraKW-sdXoMAncl8aoJ0 ul li._3o3myVBr0p_jZTcVVSWdNC:before{color:green}
2
  /*# sourceMappingURL=style.css.map*/
assets/js/legacy-upgrader/package.json CHANGED
@@ -1,101 +1,101 @@
1
- {
2
- "name": "preact-boilerplate",
3
- "version": "6.0.0",
4
- "description": "Ready-to-go Preact starter project powered by webpack.",
5
- "scripts": {
6
- "dev": "cross-env NODE_ENV=development webpack-dev-server --inline --hot --progress",
7
- "start": "serve build -s -c 1",
8
- "prestart": "npm run build",
9
- "build": "cross-env NODE_ENV=production webpack --progress",
10
- "prebuild": "mkdirp build && ncp src/assets build/assets",
11
- "test": "npm run -s lint && jest --coverage",
12
- "test:watch": "npm run -s test -- --watch",
13
- "lint": "eslint src test"
14
- },
15
- "keywords": [
16
- "preact",
17
- "boilerplate",
18
- "webpack"
19
- ],
20
- "license": "MIT",
21
- "author": "Jason Miller <jason@developit.ca>",
22
- "jest": {
23
- "setupFiles": [
24
- "./test/setup.js"
25
- ],
26
- "testURL": "http://localhost:8080",
27
- "moduleFileExtensions": [
28
- "js",
29
- "jsx"
30
- ],
31
- "moduleDirectories": [
32
- "node_modules"
33
- ],
34
- "moduleNameMapper": {
35
- "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/fileMock.js",
36
- "\\.(css|less)$": "identity-obj-proxy",
37
- "^react$": "preact-compat",
38
- "^react-dom$": "preact-compat"
39
- },
40
- "collectCoverageFrom": [
41
- "src/**/*.{js,jsx}"
42
- ]
43
- },
44
- "devDependencies": {
45
- "autoprefixer": "^7.0.1",
46
- "babel": "^6.5.2",
47
- "babel-core": "^6.24.0",
48
- "babel-eslint": "^7.2.2",
49
- "babel-jest": "^20.0.0",
50
- "babel-loader": "^7.0.0",
51
- "babel-plugin-transform-decorators-legacy": "^1.3.4",
52
- "babel-plugin-transform-react-jsx": "^6.8.0",
53
- "babel-preset-es2015": "^6.24.0",
54
- "babel-preset-stage-0": "^6.5.0",
55
- "babel-register": "^6.24.0",
56
- "babel-runtime": "^6.11.6",
57
- "chai": "^4.0.2",
58
- "copy-webpack-plugin": "^4.0.1",
59
- "core-js": "^2.4.1",
60
- "cross-env": "^5.0.1",
61
- "css-loader": "^0.28.0",
62
- "eslint": "^4.1.0",
63
- "eslint-plugin-jest": "^20.0.0",
64
- "eslint-plugin-react": "^7.0.0",
65
- "extract-text-webpack-plugin": "^2.1.0",
66
- "file-loader": "^0.11.1",
67
- "html-webpack-plugin": "^2.28.0",
68
- "identity-obj-proxy": "^3.0.0",
69
- "jest": "^20.0.0",
70
- "json-loader": "^0.5.4",
71
- "less": "^2.7.1",
72
- "less-loader": "^4.0.3",
73
- "mkdirp": "^0.5.1",
74
- "ncp": "^2.0.0",
75
- "offline-plugin": "^4.7.0",
76
- "postcss-loader": "^2.0.3",
77
- "preact-jsx-chai": "^2.2.1",
78
- "raw-loader": "^0.5.1",
79
- "regenerator-runtime": "^0.10.3",
80
- "replace-bundle-webpack-plugin": "^1.0.0",
81
- "script-ext-html-webpack-plugin": "^1.3.4",
82
- "sinon": "^2.1.0",
83
- "sinon-chai": "^2.9.0",
84
- "source-map-loader": "^0.2.1",
85
- "style-loader": "^0.18.1",
86
- "url-loader": "^0.6.1",
87
- "webpack": "^3.0.0",
88
- "webpack-dev-server": "^2.4.4"
89
- },
90
- "dependencies": {
91
- "preact": "^8.1.0",
92
- "preact-compat": "^3.15.0",
93
- "preact-render-to-string": "^3.6.0",
94
- "preact-router": "^2.5.1",
95
- "promise-polyfill": "^6.0.2",
96
- "proptypes": "^1.0.0",
97
- "serve": "^6.0.0",
98
- "react-router-dom": "^4.1.1",
99
- "whatwg-fetch": "^2.0.3"
100
- }
101
- }
1
+ {
2
+ "name": "preact-boilerplate",
3
+ "version": "6.0.0",
4
+ "description": "Ready-to-go Preact starter project powered by webpack.",
5
+ "scripts": {
6
+ "dev": "cross-env NODE_ENV=development webpack-dev-server --inline --hot --progress",
7
+ "start": "serve build -s -c 1",
8
+ "prestart": "npm run build",
9
+ "build": "cross-env NODE_ENV=production webpack --progress",
10
+ "prebuild": "mkdirp build && ncp src/assets build/assets",
11
+ "test": "npm run -s lint && jest --coverage",
12
+ "test:watch": "npm run -s test -- --watch",
13
+ "lint": "eslint src test"
14
+ },
15
+ "keywords": [
16
+ "preact",
17
+ "boilerplate",
18
+ "webpack"
19
+ ],
20
+ "license": "MIT",
21
+ "author": "Jason Miller <jason@developit.ca>",
22
+ "jest": {
23
+ "setupFiles": [
24
+ "./test/setup.js"
25
+ ],
26
+ "testURL": "http://localhost:8080",
27
+ "moduleFileExtensions": [
28
+ "js",
29
+ "jsx"
30
+ ],
31
+ "moduleDirectories": [
32
+ "node_modules"
33
+ ],
34
+ "moduleNameMapper": {
35
+ "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/fileMock.js",
36
+ "\\.(css|less)$": "identity-obj-proxy",
37
+ "^react$": "preact-compat",
38
+ "^react-dom$": "preact-compat"
39
+ },
40
+ "collectCoverageFrom": [
41
+ "src/**/*.{js,jsx}"
42
+ ]
43
+ },
44
+ "devDependencies": {
45
+ "autoprefixer": "^7.0.1",
46
+ "babel": "^6.5.2",
47
+ "babel-core": "^6.24.0",
48
+ "babel-eslint": "^7.2.2",
49
+ "babel-jest": "^20.0.0",
50
+ "babel-loader": "^7.0.0",
51
+ "babel-plugin-transform-decorators-legacy": "^1.3.4",
52
+ "babel-plugin-transform-react-jsx": "^6.8.0",
53
+ "babel-preset-es2015": "^6.24.0",
54
+ "babel-preset-stage-0": "^6.5.0",
55
+ "babel-register": "^6.24.0",
56
+ "babel-runtime": "^6.11.6",
57
+ "chai": "^4.0.2",
58
+ "copy-webpack-plugin": "^4.0.1",
59
+ "core-js": "^2.4.1",
60
+ "cross-env": "^5.0.1",
61
+ "css-loader": "^0.28.0",
62
+ "eslint": "^4.1.0",
63
+ "eslint-plugin-jest": "^20.0.0",
64
+ "eslint-plugin-react": "^7.0.0",
65
+ "extract-text-webpack-plugin": "^2.1.0",
66
+ "file-loader": "^0.11.1",
67
+ "html-webpack-plugin": "^2.28.0",
68
+ "identity-obj-proxy": "^3.0.0",
69
+ "jest": "^20.0.0",
70
+ "json-loader": "^0.5.4",
71
+ "less": "^2.7.1",
72
+ "less-loader": "^4.0.3",
73
+ "mkdirp": "^0.5.1",
74
+ "ncp": "^2.0.0",
75
+ "offline-plugin": "^4.7.0",
76
+ "postcss-loader": "^2.0.3",
77
+ "preact-jsx-chai": "^2.2.1",
78
+ "raw-loader": "^0.5.1",
79
+ "regenerator-runtime": "^0.10.3",
80
+ "replace-bundle-webpack-plugin": "^1.0.0",
81
+ "script-ext-html-webpack-plugin": "^1.3.4",
82
+ "sinon": "^2.1.0",
83
+ "sinon-chai": "^2.9.0",
84
+ "source-map-loader": "^0.2.1",
85
+ "style-loader": "^0.18.1",
86
+ "url-loader": "^0.6.1",
87
+ "webpack": "^3.0.0",
88
+ "webpack-dev-server": "^2.4.4"
89
+ },
90
+ "dependencies": {
91
+ "preact": "^8.1.0",
92
+ "preact-compat": "^3.15.0",
93
+ "preact-render-to-string": "^3.6.0",
94
+ "preact-router": "^2.5.1",
95
+ "promise-polyfill": "^6.0.2",
96
+ "proptypes": "^1.0.0",
97
+ "serve": "^6.0.0",
98
+ "react-router-dom": "^4.1.1",
99
+ "whatwg-fetch": "^2.0.3"
100
+ }
101
+ }
assets/js/legacy-upgrader/src/components/app.js CHANGED
@@ -1,69 +1,69 @@
1
- import { h, Component } from 'preact';
2
- import { HashRouter, Route, Redirect } from 'react-router-dom';
3
-
4
- // polyfill fetch and promise
5
- import 'whatwg-fetch';
6
- import Promise from 'promise-polyfill';
7
- if (!window.Promise) {
8
- window.Promise = Promise;
9
- }
10
-
11
- import Welcome from './welcome';
12
- import Downloads from './downloads';
13
- import Content from './content';
14
- import Done from './done';
15
-
16
- // mock dlm_vars for dev
17
- if(window.dlm_lu_vars == undefined) {
18
- window.dlm_lu_vars = {
19
- nonce: 'noncemock',
20
- assets_path: 'http://lnmp.dev:1337/assets/'
21
- };
22
- }
23
-
24
- export default class App extends Component {
25
-
26
- ROUTES = {
27
- welcome: () => <Welcome />,
28
- downloads: () => <Downloads />,
29
- content: ({match}) => <Content download_amount={match.params.download_amount} />,
30
- done: ({match}) => <Done download_amount={match.params.download_amount} content_amount={match.params.content_amount} />
31
- };
32
-
33
- constructor(props) {
34
- super(props);
35
-
36
- this.state = {
37
- queue: []
38
- };
39
- }
40
-
41
- /**
42
- <Router onChange={this.handleRoute}>
43
-
44
- <Welcome path="" />
45
- <Downloads path="/downloads" />
46
- <Content path="/content/:download_amount" />
47
- <Done path="/done/:download_amount/:content_amount" />
48
- </Router>*/
49
-
50
- render() {
51
-
52
- const ROUTES = this.ROUTES;
53
-
54
- return (
55
- <div id="dlm_legacy_upgrader_app">
56
- <HashRouter>
57
- <div>
58
- <Route path="/welcome" component={ROUTES.welcome} />
59
- <Route path="/downloads" component={ROUTES.downloads} />
60
- <Route path="/content/:download_amount" component={ROUTES.content} />
61
- <Route path="/done/:download_amount/:content_amount" component={ROUTES.done} />
62
- <Redirect from="/" to="/welcome" />
63
- </div>
64
- </HashRouter>
65
-
66
- </div>
67
- );
68
- }
69
- }
1
+ import { h, Component } from 'preact';
2
+ import { HashRouter, Route, Redirect } from 'react-router-dom';
3
+
4
+ // polyfill fetch and promise
5
+ import 'whatwg-fetch';
6
+ import Promise from 'promise-polyfill';
7
+ if (!window.Promise) {
8
+ window.Promise = Promise;
9
+ }
10
+
11
+ import Welcome from './welcome';
12
+ import Downloads from './downloads';
13
+ import Content from './content';
14
+ import Done from './done';
15
+
16
+ // mock dlm_vars for dev
17
+ if(window.dlm_lu_vars == undefined) {
18
+ window.dlm_lu_vars = {
19
+ nonce: 'noncemock',
20
+ assets_path: 'http://lnmp.dev:1337/assets/'
21
+ };
22
+ }
23
+
24
+ export default class App extends Component {
25
+
26
+ ROUTES = {
27
+ welcome: () => <Welcome />,
28
+ downloads: () => <Downloads />,
29
+ content: ({match}) => <Content download_amount={match.params.download_amount} />,
30
+ done: ({match}) => <Done download_amount={match.params.download_amount} content_amount={match.params.content_amount} />
31
+ };
32
+
33
+ constructor(props) {
34
+ super(props);
35
+
36
+ this.state = {
37
+ queue: []
38
+ };
39
+ }
40
+
41
+ /**
42
+ <Router onChange={this.handleRoute}>
43
+
44
+ <Welcome path="" />
45
+ <Downloads path="/downloads" />
46
+ <Content path="/content/:download_amount" />
47
+ <Done path="/done/:download_amount/:content_amount" />
48
+ </Router>*/
49
+
50
+ render() {
51
+
52
+ const ROUTES = this.ROUTES;
53
+
54
+ return (
55
+ <div id="dlm_legacy_upgrader_app">
56
+ <HashRouter>
57
+ <div>
58
+ <Route path="/welcome" component={ROUTES.welcome} />
59
+ <Route path="/downloads" component={ROUTES.downloads} />
60
+ <Route path="/content/:download_amount" component={ROUTES.content} />
61
+ <Route path="/done/:download_amount/:content_amount" component={ROUTES.done} />
62
+ <Redirect from="/" to="/welcome" />
63
+ </div>
64
+ </HashRouter>
65
+
66
+ </div>
67
+ );
68
+ }
69
+ }
assets/js/legacy-upgrader/src/components/content/QueueItem.js CHANGED
@@ -1,13 +1,13 @@
1
- import { h, Component } from 'preact';
2
- import style from './style';
3
-
4
- export default class QueueItem extends Component {
5
-
6
- render() {
7
- var listClass = (this.props.item.done?style.done:style.todo);
8
-
9
- return (
10
- <li class={listClass}>Content ID: {this.props.item.id}</li>
11
- );
12
- }
13
- }
1
+ import { h, Component } from 'preact';
2
+ import style from './style';
3
+
4
+ export default class QueueItem extends Component {
5
+
6
+ render() {
7
+ var listClass = (this.props.item.done?style.done:style.todo);
8
+
9
+ return (
10
+ <li class={listClass}>Content ID: {this.props.item.id}</li>
11
+ );
12
+ }
13
+ }
assets/js/legacy-upgrader/src/components/content/index.js CHANGED
@@ -1,149 +1,149 @@
1
- import {h, Component} from 'preact';
2
- import style from './style.less';
3
- import QueueItem from './QueueItem';
4
- import { Link } from 'react-router-dom';
5
-
6
- export default class Content extends Component {
7
-
8
- state = {
9
- checked: false,
10
- items: [],
11
- upgrading: false
12
- };
13
-
14
- constructor(props) {
15
- super(props);
16
-
17
- this.startUpgrade = this.startUpgrade.bind(this);
18
- this.upgradeNext = this.upgradeNext.bind(this);
19
- this.upgradeItem = this.upgradeItem.bind(this);
20
- }
21
-
22
- // gets called when this route is navigated to
23
- componentDidMount() {
24
- fetch( ajaxurl + "?action=dlm_lu_get_content_queue&nonce="+window.dlm_lu_vars.nonce, {
25
- method: 'GET',
26
- credentials: 'include'
27
- } ).then( ( r ) => {
28
- if ( r.status == 200 ) {
29
- return r.json();
30
- }
31
-
32
- throw "AJAX API OFFLINE";
33
- } ).then( ( j ) => {
34
- var items = [];
35
- for ( var i = 0; i < j.length; i ++ ) {
36
- items.push( {id: j[i], done: false} );
37
- }
38
- this.setState( {checked: true, items: items} );
39
- return;
40
- } ).catch( ( e ) => {
41
- console.log( e );
42
- return;
43
- } );
44
- }
45
-
46
- // gets called just before navigating away from the route
47
- componentWillUnmount() {
48
- // todo clear queue
49
- }
50
-
51
- upgradeNext() {
52
- var upgradeDone = true;
53
- for( var i = 0; i < this.state.items.length; i++ ) {
54
- if( this.state.items[i].done === false ) {
55
- upgradeDone = false;
56
- this.upgradeItem( this.state.items[i] );
57
- break;
58
- }
59
- }
60
-
61
- if( upgradeDone ) {
62
- window.location.hash = "/done/"+this.props.download_amount+"/"+this.state.items.length;
63
- }
64
- }
65
-
66
- upgradeItem( item ) {
67
- fetch( ajaxurl + "?action=dlm_lu_upgrade_content&content_id="+item.id+"&nonce="+window.dlm_lu_vars.nonce, {
68
- method: 'GET',
69
- credentials: 'include'
70
- } ).then( ( r ) => {
71
- if ( r.status == 200 ) {
72
- return r.json();
73
- }
74
-
75
- throw "AJAX API OFFLINE";
76
- } ).then( ( j ) => {
77
- console.log( j );
78
- item.done = true;
79
- this.forceUpdate();
80
- this.upgradeNext();
81
- return;
82
- } ).catch( ( e ) => {
83
- console.log( e );
84
- return;
85
- } );
86
- }
87
-
88
- startUpgrade() {
89
- // check if we're upgrading
90
- if( this.state.upgrading ) {
91
- return;
92
- }
93
-
94
- // set we're upgrading
95
- this.setState( {upgrading: true} );
96
-
97
- // upgrade next download
98
- this.upgradeNext();
99
- }
100
-
101
- render() {
102
-
103
- var loadingImg = window.dlm_lu_vars.assets_path + "loading.gif";
104
-
105
- if ( this.state.checked == false ) {
106
- return (
107
- <div class={style.queue}>
108
- <h2>Posts/Pages Queue</h2>
109
- <p><strong>{this.props.download_amount}</strong> downloads have been upgraded.</p>
110
- <p>We're currently building the posts/pages queue, please wait.</p>
111
- </div>
112
- );
113
- }
114
-
115
- if ( this.state.items.length == 0 ) {
116
- var linkURL = "/done/"+this.props.download_amount+"/0";
117
- return (
118
- <div class={style.queue}>
119
- <p><strong>{this.props.download_amount}</strong> downloads have been upgraded.</p>
120
- <p>No posts/pages found that require upgrading.</p>
121
- <Link to={linkURL} class="button button-primary button-large">Continue to Post/Page upgrade</Link>
122
- </div>
123
- );
124
- }
125
-
126
- return (
127
- <div class={style.queue}>
128
- <h2>Posts/Pages Queue</h2>
129
-
130
- {this.state.upgrading &&
131
- <p class={style.upgrading_notice}><img src={loadingImg} />Currently upgrading your downloads, please wait...</p>
132
- }
133
-
134
- <p><strong>{this.props.download_amount}</strong> downloads have been upgraded.</p>
135
-
136
- <p>The following posts/pages items have been found that need upgrading:</p>
137
-
138
- {this.state.items.length > 0 &&
139
- <ul>
140
- {this.state.items.map( ( o, i ) => <QueueItem item={o}/> )}
141
- </ul>
142
- }
143
-
144
- <a href="javascript:;" class="button button-primary button-large" onClick={() => this.startUpgrade()}>Upgrade Content Items</a>
145
-
146
- </div>
147
- );
148
- }
149
- }
1
+ import {h, Component} from 'preact';
2
+ import style from './style.less';
3
+ import QueueItem from './QueueItem';
4
+ import { Link } from 'react-router-dom';
5
+
6
+ export default class Content extends Component {
7
+
8
+ state = {
9
+ checked: false,
10
+ items: [],
11
+ upgrading: false
12
+ };
13
+
14
+ constructor(props) {
15
+ super(props);
16
+
17
+ this.startUpgrade = this.startUpgrade.bind(this);
18
+ this.upgradeNext = this.upgradeNext.bind(this);
19
+ this.upgradeItem = this.upgradeItem.bind(this);
20
+ }
21
+
22
+ // gets called when this route is navigated to
23
+ componentDidMount() {
24
+ fetch( ajaxurl + "?action=dlm_lu_get_content_queue&nonce="+window.dlm_lu_vars.nonce, {
25
+ method: 'GET',
26
+ credentials: 'include'
27
+ } ).then( ( r ) => {
28
+ if ( r.status == 200 ) {
29
+ return r.json();
30
+ }
31
+
32
+ throw "AJAX API OFFLINE";
33
+ } ).then( ( j ) => {
34
+ var items = [];
35
+ for ( var i = 0; i < j.length; i ++ ) {
36
+ items.push( {id: j[i], done: false} );
37
+ }
38
+ this.setState( {checked: true, items: items} );
39
+ return;
40
+ } ).catch( ( e ) => {
41
+ console.log( e );
42
+ return;
43
+ } );
44
+ }
45
+
46
+ // gets called just before navigating away from the route
47
+ componentWillUnmount() {
48
+ // todo clear queue
49
+ }
50
+
51
+ upgradeNext() {
52
+ var upgradeDone = true;
53
+ for( var i = 0; i < this.state.items.length; i++ ) {
54
+ if( this.state.items[i].done === false ) {
55
+ upgradeDone = false;
56
+ this.upgradeItem( this.state.items[i] );
57
+ break;
58
+ }
59
+ }
60
+
61
+ if( upgradeDone ) {
62
+ window.location.hash = "/done/"+this.props.download_amount+"/"+this.state.items.length;
63
+ }
64
+ }
65
+
66
+ upgradeItem( item ) {
67
+ fetch( ajaxurl + "?action=dlm_lu_upgrade_content&content_id="+item.id+"&nonce="+window.dlm_lu_vars.nonce, {
68
+ method: 'GET',
69
+ credentials: 'include'
70
+ } ).then( ( r ) => {
71
+ if ( r.status == 200 ) {
72
+ return r.json();
73
+ }
74
+
75
+ throw "AJAX API OFFLINE";
76
+ } ).then( ( j ) => {
77
+ console.log( j );
78
+ item.done = true;
79
+ this.forceUpdate();
80
+ this.upgradeNext();
81
+ return;
82
+ } ).catch( ( e ) => {
83
+ console.log( e );
84
+ return;
85
+ } );
86
+ }
87
+
88
+ startUpgrade() {
89
+ // check if we're upgrading
90
+ if( this.state.upgrading ) {
91
+ return;
92
+ }
93
+
94
+ // set we're upgrading
95
+ this.setState( {upgrading: true} );
96
+
97
+ // upgrade next download
98
+ this.upgradeNext();
99
+ }
100
+
101
+ render() {
102
+
103
+ var loadingImg = window.dlm_lu_vars.assets_path + "loading.gif";
104
+
105
+ if ( this.state.checked == false ) {
106
+ return (
107
+ <div class={style.queue}>
108
+ <h2>Posts/Pages Queue</h2>
109
+ <p><strong>{this.props.download_amount}</strong> downloads have been upgraded.</p>
110
+ <p>We're currently building the posts/pages queue, please wait.</p>
111
+ </div>
112
+ );
113
+ }
114
+
115
+ if ( this.state.items.length == 0 ) {
116
+ var linkURL = "/done/"+this.props.download_amount+"/0";
117
+ return (
118
+ <div class={style.queue}>
119
+ <p><strong>{this.props.download_amount}</strong> downloads have been upgraded.</p>
120
+ <p>No posts/pages found that require upgrading.</p>
121
+ <Link to={linkURL} class="button button-primary button-large">Continue to Post/Page upgrade</Link>
122
+ </div>
123
+ );
124
+ }
125
+
126
+ return (
127
+ <div class={style.queue}>
128
+ <h2>Posts/Pages Queue</h2>
129
+
130
+ {this.state.upgrading &&
131
+ <p class={style.upgrading_notice}><img src={loadingImg} />Currently upgrading your downloads, please wait...</p>
132
+ }
133
+
134
+ <p><strong>{this.props.download_amount}</strong> downloads have been upgraded.</p>
135
+
136
+ <p>The following posts/pages items have been found that need upgrading:</p>
137
+
138
+ {this.state.items.length > 0 &&
139
+ <ul>
140
+ {this.state.items.map( ( o, i ) => <QueueItem item={o}/> )}
141
+ </ul>
142
+ }
143
+
144
+ <a href="javascript:;" class="button button-primary button-large" onClick={() => this.startUpgrade()}>Upgrade Content Items</a>
145
+
146
+ </div>
147
+ );
148
+ }
149
+ }
assets/js/legacy-upgrader/src/components/content/style.less CHANGED
@@ -1,49 +1,49 @@
1
- @import '~style/helpers';
2
-
3
- .queue {
4
-
5
- .upgrading_notice {
6
- position: relative;
7
- background: #419ccb;
8
- color: #fff;
9
- font-weight: bold;
10
- padding: 10px 10px 10px 35px;
11
-
12
- img {
13
- display: block;
14
- position: absolute;
15
- left: 12px;
16
- top: 12px;
17
- width: 15px;
18
- height: 15px;
19
- z-index: 10;
20
- }
21
- }
22
-
23
- ul {
24
- width: 100%;
25
- padding: 10px 0;
26
-
27
- li {
28
- display: inline-block;
29
- width: 50%;
30
- &:before {
31
- .iconbefore("\f147");
32
- font-size: 1.5em;
33
- }
34
-
35
- &.todo {
36
- &:before {
37
- color: black;
38
- }
39
- }
40
-
41
- &.done {
42
- &:before {
43
- color: green;
44
- }
45
- }
46
- }
47
-
48
- }
49
- }
1
+ @import '~style/helpers';
2
+
3
+ .queue {
4
+
5
+ .upgrading_notice {
6
+ position: relative;
7
+ background: #419ccb;
8
+ color: #fff;
9
+ font-weight: bold;
10
+ padding: 10px 10px 10px 35px;
11
+
12
+ img {
13
+ display: block;
14
+ position: absolute;
15
+ left: 12px;
16
+ top: 12px;
17
+ width: 15px;
18
+ height: 15px;
19
+ z-index: 10;
20
+ }
21
+ }
22
+
23
+ ul {
24
+ width: 100%;
25
+ padding: 10px 0;
26
+
27
+ li {
28
+ display: inline-block;
29
+ width: 50%;
30
+ &:before {
31
+ .iconbefore("\f147");
32
+ font-size: 1.5em;
33
+ }
34
+
35
+ &.todo {
36
+ &:before {
37
+ color: black;
38
+ }
39
+ }
40
+
41
+ &.done {
42
+ &:before {
43
+ color: green;
44
+ }
45
+ }
46
+ }
47
+
48
+ }
49
+ }
assets/js/legacy-upgrader/src/components/done/index.js CHANGED
@@ -1,36 +1,36 @@
1
- import { h, Component } from 'preact';
2
- import { Link } from 'preact-router';
3
- import style from './style.less';
4
-
5
- export default class Done extends Component {
6
-
7
- // gets called when this route is navigated to
8
- componentDidMount() {
9
- // mark upgrade as completed
10
- fetch( ajaxurl + "?action=dlm_lu_mark_upgrade_done&nonce="+window.dlm_lu_vars.nonce, {
11
- method: 'GET',
12
- credentials: 'include'
13
- } ).then( ( r ) => {
14
- if ( r.status == 200 ) {
15
- return r.json();
16
- }
17
-
18
- throw "AJAX API OFFLINE";
19
- } ).then( ( j ) => {
20
- return;
21
- } ).catch( ( e ) => {
22
- console.log( e );
23
- return;
24
- } );
25
- }
26
-
27
- render() {
28
- return (
29
- <div class={style.welcome}>
30
- <h2>Upgrade Done</h2>
31
- <p><strong>{this.props.download_amount}</strong> downloads have been upgraded.</p>
32
- <p><strong>{this.props.content_amount}</strong> posts/pages have been upgraded.</p>
33
- </div>
34
- );
35
- }
36
- }
1
+ import { h, Component } from 'preact';
2
+ import { Link } from 'preact-router';
3
+ import style from './style.less';
4
+
5
+ export default class Done extends Component {
6
+
7
+ // gets called when this route is navigated to
8
+ componentDidMount() {
9
+ // mark upgrade as completed
10
+ fetch( ajaxurl + "?action=dlm_lu_mark_upgrade_done&nonce="+window.dlm_lu_vars.nonce, {
11
+ method: 'GET',
12
+ credentials: 'include'
13
+ } ).then( ( r ) => {
14
+ if ( r.status == 200 ) {
15
+ return r.json();
16
+ }
17
+
18
+ throw "AJAX API OFFLINE";
19
+ } ).then( ( j ) => {
20
+ return;
21
+ } ).catch( ( e ) => {
22
+ console.log( e );
23
+ return;
24
+ } );
25
+ }
26
+
27
+ render() {
28
+ return (
29
+ <div class={style.welcome}>
30
+ <h2>Upgrade Done</h2>
31
+ <p><strong>{this.props.download_amount}</strong> downloads have been upgraded.</p>
32
+ <p><strong>{this.props.content_amount}</strong> posts/pages have been upgraded.</p>
33
+ </div>
34
+ );
35
+ }
36
+ }
assets/js/legacy-upgrader/src/components/done/style.less CHANGED
@@ -1,5 +1,5 @@
1
- @import '~style/helpers';
2
-
3
- .done {
4
-
5
- }
1
+ @import '~style/helpers';
2
+
3
+ .done {
4
+
5
+ }
assets/js/legacy-upgrader/src/components/downloads/QueueItem.js CHANGED
@@ -1,13 +1,13 @@
1
- import { h, Component } from 'preact';
2
- import style from './style';
3
-
4
- export default class QueueItem extends Component {
5
-
6
- render() {
7
- var listClass = (this.props.item.done?style.done:style.todo);
8
-
9
- return (
10
- <li class={listClass}>Legacy Download ID: {this.props.item.id}</li>
11
- );
12
- }
13
  }
1
+ import { h, Component } from 'preact';
2
+ import style from './style';
3
+
4
+ export default class QueueItem extends Component {
5
+
6
+ render() {
7
+ var listClass = (this.props.item.done?style.done:style.todo);
8
+
9
+ return (
10
+ <li class={listClass}>Legacy Download ID: {this.props.item.id}</li>
11
+ );
12
+ }
13
  }
assets/js/legacy-upgrader/src/components/downloads/index.js CHANGED
@@ -1,145 +1,145 @@
1
- import {h, Component} from 'preact';
2
- import style from './style.less';
3
- import QueueItem from './QueueItem';
4
- import { Link } from 'react-router-dom';
5
-
6
- export default class Downloads extends Component {
7
-
8
- state = {
9
- checked: false,
10
- items: [],
11
- upgrading: false
12
- };
13
-
14
- constructor(props) {
15
- super(props);
16
-
17
- this.startUpgrade = this.startUpgrade.bind(this);
18
- this.upgradeNext = this.upgradeNext.bind(this);
19
- this.upgradeItem = this.upgradeItem.bind(this);
20
- }
21
-
22
- // gets called when this route is navigated to
23
- componentDidMount() {
24
- fetch( ajaxurl + "?action=dlm_lu_get_download_queue&nonce="+window.dlm_lu_vars.nonce, {
25
- method: 'GET',
26
- credentials: 'include'
27
- } ).then( ( r ) => {
28
- if ( r.status == 200 ) {
29
- return r.json();
30
- }
31
-
32
- throw "AJAX API OFFLINE";
33
- } ).then( ( j ) => {
34
- var items = [];
35
- for ( var i = 0; i < j.length; i ++ ) {
36
- items.push( {id: j[i], done: false} );
37
- }
38
- this.setState( {checked: true, items: items} );
39
- return;
40
- } ).catch( ( e ) => {
41
- console.log( e );
42
- return;
43
- } );
44
- }
45
-
46
- // gets called just before navigating away from the route
47
- componentWillUnmount() {
48
- // todo clear queue
49
- }
50
-
51
- upgradeNext() {
52
- var upgradeDone = true;
53
- for( var i = 0; i < this.state.items.length; i++ ) {
54
- if( this.state.items[i].done === false ) {
55
- upgradeDone = false;
56
- this.upgradeItem( this.state.items[i] );
57
- break;
58
- }
59
- }
60
-
61
- if( upgradeDone ) {
62
- window.location.hash = "/content/"+this.state.items.length;
63
- }
64
- }
65
-
66
- upgradeItem( item ) {
67
- fetch( ajaxurl + "?action=dlm_lu_upgrade_download&download_id="+item.id+"&nonce="+window.dlm_lu_vars.nonce, {
68
- method: 'GET',
69
- credentials: 'include'
70
- } ).then( ( r ) => {
71
- if ( r.status == 200 ) {
72
- return r.json();
73
- }
74
-
75
- throw "AJAX API OFFLINE";
76
- } ).then( ( j ) => {
77
- console.log( j );
78
- item.done = true;
79
- this.forceUpdate();
80
- this.upgradeNext();
81
- return;
82
- } ).catch( ( e ) => {
83
- console.log( e );
84
- return;
85
- } );
86
- }
87
-
88
- startUpgrade() {
89
- // check if we're upgrading
90
- if( this.state.upgrading ) {
91
- return;
92
- }
93
-
94
- // set we're upgrading
95
- this.setState( {upgrading: true} );
96
-
97
- // upgrade next download
98
- this.upgradeNext();
99
- }
100
-
101
- render() {
102
-
103
- var loadingImg = window.dlm_lu_vars.assets_path + "loading.gif";
104
-
105
- if ( this.state.checked == false ) {
106
- return (
107
- <div class={style.queue}>
108
- <h2>Downloads Queue</h2>
109
- <p>We're currently building the queue, please wait.</p>
110
- </div>
111
- );
112
- }
113
-
114
- if ( this.state.items.length == 0 ) {
115
- return (
116
- <div class={style.queue}>
117
- <h2>Downloads Queue</h2>
118
- <p>No Downloads found that require upgrading</p>
119
- <Link to="/content/0" class="button button-primary button-large">Continue to Post/Page upgrade</Link>
120
- </div>
121
- );
122
- }
123
-
124
- return (
125
- <div class={style.queue}>
126
- <h2>Downloads Queue</h2>
127
-
128
- {this.state.upgrading &&
129
- <p class={style.upgrading_notice}><img src={loadingImg} />Currently upgrading your downloads, please wait...</p>
130
- }
131
-
132
- <p>The following legacy download ID's have been found that need upgrading:</p>
133
-
134
- {this.state.items.length > 0 &&
135
- <ul>
136
- {this.state.items.map( ( o, i ) => <QueueItem item={o}/> )}
137
- </ul>
138
- }
139
-
140
- <a href="javascript:;" class="button button-primary button-large" onClick={() => this.startUpgrade()}>Upgrade Downloads</a>
141
-
142
- </div>
143
- );
144
- }
145
- }
1
+ import {h, Component} from 'preact';
2
+ import style from './style.less';
3
+ import QueueItem from './QueueItem';
4
+ import { Link } from 'react-router-dom';
5
+
6
+ export default class Downloads extends Component {
7
+
8
+ state = {
9
+ checked: false,
10
+ items: [],
11
+ upgrading: false
12
+ };
13
+
14
+ constructor(props) {
15
+ super(props);
16
+
17
+ this.startUpgrade = this.startUpgrade.bind(this);
18
+ this.upgradeNext = this.upgradeNext.bind(this);
19
+ this.upgradeItem = this.upgradeItem.bind(this);
20
+ }
21
+
22
+ // gets called when this route is navigated to
23
+ componentDidMount() {
24
+ fetch( ajaxurl + "?action=dlm_lu_get_download_queue&nonce="+window.dlm_lu_vars.nonce, {
25
+ method: 'GET',
26
+ credentials: 'include'
27
+ } ).then( ( r ) => {
28
+ if ( r.status == 200 ) {
29
+ return r.json();
30
+ }
31
+
32
+ throw "AJAX API OFFLINE";
33
+ } ).then( ( j ) => {
34
+ var items = [];
35
+ for ( var i = 0; i < j.length; i ++ ) {
36
+ items.push( {id: j[i], done: false} );
37
+ }
38
+ this.setState( {checked: true, items: items} );
39
+ return;
40
+ } ).catch( ( e ) => {
41
+ console.log( e );
42
+ return;
43
+ } );
44
+ }
45
+
46
+ // gets called just before navigating away from the route
47
+ componentWillUnmount() {
48
+ // todo clear queue
49
+ }
50
+
51
+ upgradeNext() {
52
+ var upgradeDone = true;
53
+ for( var i = 0; i < this.state.items.length; i++ ) {
54
+ if( this.state.items[i].done === false ) {
55
+ upgradeDone = false;
56
+ this.upgradeItem( this.state.items[i] );
57
+ break;
58
+ }
59
+ }
60
+
61
+ if( upgradeDone ) {
62
+ window.location.hash = "/content/"+this.state.items.length;
63
+ }
64
+ }
65
+
66
+ upgradeItem( item ) {
67
+ fetch( ajaxurl + "?action=dlm_lu_upgrade_download&download_id="+item.id+"&nonce="+window.dlm_lu_vars.nonce, {
68
+ method: 'GET',
69
+ credentials: 'include'
70
+ } ).then( ( r ) => {
71
+ if ( r.status == 200 ) {
72
+ return r.json();
73
+ }
74
+
75
+ throw "AJAX API OFFLINE";
76
+ } ).then( ( j ) => {
77
+ console.log( j );
78
+ item.done = true;
79
+ this.forceUpdate();
80
+ this.upgradeNext();
81
+ return;
82
+ } ).catch( ( e ) => {
83
+ console.log( e );
84
+ return;
85
+ } );
86
+ }
87
+
88
+ startUpgrade() {
89
+ // check if we're upgrading
90
+ if( this.state.upgrading ) {
91
+ return;
92
+ }
93
+
94
+ // set we're upgrading
95
+ this.setState( {upgrading: true} );
96
+
97
+ // upgrade next download
98
+ this.upgradeNext();
99
+ }
100
+
101
+ render() {
102
+
103
+ var loadingImg = window.dlm_lu_vars.assets_path + "loading.gif";
104
+
105
+ if ( this.state.checked == false ) {
106
+ return (
107
+ <div class={style.queue}>
108
+ <h2>Downloads Queue</h2>
109
+ <p>We're currently building the queue, please wait.</p>
110
+ </div>
111
+ );
112
+ }
113
+
114
+ if ( this.state.items.length == 0 ) {
115
+ return (
116
+ <div class={style.queue}>
117
+ <h2>Downloads Queue</h2>
118
+ <p>No Downloads found that require upgrading</p>
119
+ <Link to="/content/0" class="button button-primary button-large">Continue to Post/Page upgrade</Link>
120
+ </div>
121
+ );
122
+ }
123
+
124
+ return (
125
+ <div class={style.queue}>
126
+ <h2>Downloads Queue</h2>
127
+
128
+ {this.state.upgrading &&
129
+ <p class={style.upgrading_notice}><img src={loadingImg} />Currently upgrading your downloads, please wait...</p>
130
+ }
131
+
132
+ <p>The following legacy download ID's have been found that need upgrading:</p>
133
+
134
+ {this.state.items.length > 0 &&
135
+ <ul>
136
+ {this.state.items.map( ( o, i ) => <QueueItem item={o}/> )}
137
+ </ul>
138
+ }
139
+
140
+ <a href="javascript:;" class="button button-primary button-large" onClick={() => this.startUpgrade()}>Upgrade Downloads</a>
141
+
142
+ </div>
143
+ );
144
+ }
145
+ }
assets/js/legacy-upgrader/src/components/downloads/style.less CHANGED
@@ -1,49 +1,49 @@
1
- @import '~style/helpers';
2
-
3
- .queue {
4
-
5
- .upgrading_notice {
6
- position: relative;
7
- background: #419ccb;
8
- color: #fff;
9
- font-weight: bold;
10
- padding: 10px 10px 10px 35px;
11
-
12
- img {
13
- display: block;
14
- position: absolute;
15
- left: 12px;
16
- top: 12px;
17
- width: 15px;
18
- height: 15px;
19
- z-index: 10;
20
- }
21
- }
22
-
23
- ul {
24
- width: 100%;
25
- padding: 10px 0;
26
-
27
- li {
28
- display: inline-block;
29
- width: 50%;
30
- &:before {
31
- .iconbefore("\f147");
32
- font-size: 1.5em;
33
- }
34
-
35
- &.todo {
36
- &:before {
37
- color: black;
38
- }
39
- }
40
-
41
- &.done {
42
- &:before {
43
- color: green;
44
- }
45
- }
46
- }
47
-
48
- }
49
- }
1
+ @import '~style/helpers';
2
+
3
+ .queue {
4
+
5
+ .upgrading_notice {
6
+ position: relative;
7
+ background: #419ccb;
8
+ color: #fff;
9
+ font-weight: bold;
10
+ padding: 10px 10px 10px 35px;
11
+
12
+ img {
13
+ display: block;
14
+ position: absolute;
15
+ left: 12px;
16
+ top: 12px;
17
+ width: 15px;
18
+ height: 15px;
19
+ z-index: 10;
20
+ }
21
+ }
22
+
23
+ ul {
24
+ width: 100%;
25
+ padding: 10px 0;
26
+
27
+ li {
28
+ display: inline-block;
29
+ width: 50%;
30
+ &:before {
31
+ .iconbefore("\f147");
32
+ font-size: 1.5em;
33
+ }
34
+
35
+ &.todo {
36
+ &:before {
37
+ color: black;
38
+ }
39
+ }
40
+
41
+ &.done {
42
+ &:before {
43
+ color: green;
44
+ }
45
+ }
46
+ }
47
+
48
+ }
49
+ }
assets/js/legacy-upgrader/src/components/welcome/index.js CHANGED
@@ -1,16 +1,16 @@
1
- import { h, Component } from 'preact';
2
- import { Link } from 'react-router-dom';
3
- import style from './style.less';
4
-
5
- export default class Welcome extends Component {
6
- render() {
7
- return (
8
- <div class={style.welcome}>
9
- <h2>Welcome</h2>
10
- <p>Before upgrading your downloads, we'll first scan your database to find your legacy downloads. We will put all found legacy downloads in a queue which you can review before the actual upgrading begins.</p>
11
- <p><strong>PLEASE NOTE: Although thoroughly tested, this process will modify and move your download data. Backup your database before you continue.</strong></p>
12
- <p><Link to="/downloads" class="button button-primary button-large">I have backed up my database, let's go</Link></p>
13
- </div>
14
- );
15
- }
16
- }
1
+ import { h, Component } from 'preact';
2
+ import { Link } from 'react-router-dom';
3
+ import style from './style.less';
4
+
5
+ export default class Welcome extends Component {
6
+ render() {
7
+ return (
8
+ <div class={style.welcome}>
9
+ <h2>Welcome</h2>
10
+ <p>Before upgrading your downloads, we'll first scan your database to find your legacy downloads. We will put all found legacy downloads in a queue which you can review before the actual upgrading begins.</p>
11
+ <p><strong>PLEASE NOTE: Although thoroughly tested, this process will modify and move your download data. Backup your database before you continue.</strong></p>
12
+ <p><Link to="/downloads" class="button button-primary button-large">I have backed up my database, let's go</Link></p>
13
+ </div>
14
+ );
15
+ }
16
+ }
assets/js/legacy-upgrader/src/components/welcome/style.less CHANGED
@@ -1,5 +1,5 @@
1
- @import '~style/helpers';
2
-
3
- .welcome {
4
-
5
- }
1
+ @import '~style/helpers';
2
+
3
+ .welcome {
4
+
5
+ }
assets/js/legacy-upgrader/src/config.json CHANGED
@@ -1,3 +1,3 @@
1
- {
2
- "key": "value"
3
- }
1
+ {
2
+ "key": "value"
3
+ }
assets/js/legacy-upgrader/src/index.ejs CHANGED
@@ -1,408 +1,408 @@
1
- <!DOCTYPE html>
2
- <!--[if IE 8]>
3
- <html xmlns="http://www.w3.org/1999/xhtml" class="ie8 wp-toolbar" lang="en-US">
4
- <![endif]-->
5
- <!--[if !(IE 8) ]><!-->
6
- <html xmlns="http://www.w3.org/1999/xhtml" class="wp-toolbar" lang="en-US">
7
- <!--<![endif]-->
8
- <head>
9
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
10
- <title> &lsaquo; Download Monitor &#8212; WordPress</title>
11
-
12
- <script type="text/javascript">
13
- addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
14
- var ajaxurl = 'http://lnmp.dev/download-monitor/wp-admin/admin-ajax.php',
15
- pagenow = 'admin_page_dlm_legacy_upgrade',
16
- typenow = '',
17
- adminpage = 'admin_page_dlm_legacy_upgrade',
18
- thousandsSeparator = ',',
19
- decimalPoint = '.',
20
- isRtl = 0;
21
- </script>
22
-
23
- <meta name="viewport" content="width=device-width,initial-scale=1.0">
24
- <link rel='dns-prefetch' href='//s.w.org' />
25
- <style type="text/css">
26
- img.wp-smiley,
27
- img.emoji {
28
- display: inline !important;
29
- border: none !important;
30
- box-shadow: none !important;
31
- height: 1em !important;
32
- width: 1em !important;
33
- margin: 0 .07em !important;
34
- vertical-align: -0.1em !important;
35
- background: none !important;
36
- padding: 0 !important;
37
- }
38
- </style>
39
- <link rel='stylesheet' id='dashicons-css' href='http://lnmp.dev/download-monitor/wp-includes/css/dashicons.css?ver=4.9' type='text/css' media='all' />
40
- <link rel='stylesheet' id='admin-bar-css' href='http://lnmp.dev/download-monitor/wp-includes/css/admin-bar.css?ver=4.9' type='text/css' media='all' />
41
- <link rel='stylesheet' id='common-css' href='http://lnmp.dev/download-monitor/wp-admin/css/common.css?ver=4.9' type='text/css' media='all' />
42
- <link rel='stylesheet' id='forms-css' href='http://lnmp.dev/download-monitor/wp-admin/css/forms.css?ver=4.9' type='text/css' media='all' />
43
- <link rel='stylesheet' id='admin-menu-css' href='http://lnmp.dev/download-monitor/wp-admin/css/admin-menu.css?ver=4.9' type='text/css' media='all' />
44
- <link rel='stylesheet' id='dashboard-css' href='http://lnmp.dev/download-monitor/wp-admin/css/dashboard.css?ver=4.9' type='text/css' media='all' />
45
- <link rel='stylesheet' id='list-tables-css' href='http://lnmp.dev/download-monitor/wp-admin/css/list-tables.css?ver=4.9' type='text/css' media='all' />
46
- <link rel='stylesheet' id='edit-css' href='http://lnmp.dev/download-monitor/wp-admin/css/edit.css?ver=4.9' type='text/css' media='all' />
47
- <link rel='stylesheet' id='revisions-css' href='http://lnmp.dev/download-monitor/wp-admin/css/revisions.css?ver=4.9' type='text/css' media='all' />
48
- <link rel='stylesheet' id='media-css' href='http://lnmp.dev/download-monitor/wp-admin/css/media.css?ver=4.9' type='text/css' media='all' />
49
- <link rel='stylesheet' id='themes-css' href='http://lnmp.dev/download-monitor/wp-admin/css/themes.css?ver=4.9' type='text/css' media='all' />
50
- <link rel='stylesheet' id='about-css' href='http://lnmp.dev/download-monitor/wp-admin/css/about.css?ver=4.9' type='text/css' media='all' />
51
- <link rel='stylesheet' id='nav-menus-css' href='http://lnmp.dev/download-monitor/wp-admin/css/nav-menus.css?ver=4.9' type='text/css' media='all' />
52
- <link rel='stylesheet' id='wp-pointer-css' href='http://lnmp.dev/download-monitor/wp-includes/css/wp-pointer.css?ver=4.9' type='text/css' media='all' />
53
- <link rel='stylesheet' id='widgets-css' href='http://lnmp.dev/download-monitor/wp-admin/css/widgets.css?ver=4.9' type='text/css' media='all' />
54
- <link rel='stylesheet' id='site-icon-css' href='http://lnmp.dev/download-monitor/wp-admin/css/site-icon.css?ver=4.9' type='text/css' media='all' />
55
- <link rel='stylesheet' id='l10n-css' href='http://lnmp.dev/download-monitor/wp-admin/css/l10n.css?ver=4.9' type='text/css' media='all' />
56
- <link rel='stylesheet' id='buttons-css' href='http://lnmp.dev/download-monitor/wp-includes/css/buttons.css?ver=4.9' type='text/css' media='all' />
57
- <!--[if lte IE 7]>
58
- <link rel='stylesheet' id='ie-css' href='http://lnmp.dev/download-monitor/wp-admin/css/ie.css?ver=4.9' type='text/css' media='all' />
59
- <![endif]-->
60
- <link rel='stylesheet' id='wp-auth-check-css' href='http://lnmp.dev/download-monitor/wp-includes/css/wp-auth-check.css?ver=4.9' type='text/css' media='all' />
61
- <link rel='stylesheet' id='download_monitor_menu_css-css' href='http://lnmp.dev/download-monitor/wp-content/plugins/_download-monitor-new/assets/css/menu.css?ver=4.9' type='text/css' media='all' />
62
- <script type="text/javascript">
63
- window._wpemojiSettings = {"baseUrl":"https:\/\/s.w.org\/images\/core\/emoji\/2.3\/72x72\/","ext":".png","svgUrl":"https:\/\/s.w.org\/images\/core\/emoji\/2.3\/svg\/","svgExt":".svg","source":{"wpemoji":"http:\/\/lnmp.dev\/download-monitor\/wp-includes\/js\/wp-emoji.js?ver=4.9","twemoji":"http:\/\/lnmp.dev\/download-monitor\/wp-includes\/js\/twemoji.js?ver=4.9"}};
64
- ( function( window, document, settings ) {
65
- var src, ready, ii, tests;
66
-
67
- /*
68
- * Create a canvas element for testing native browser support
69
- * of emoji.
70
- */
71
- var canvas = document.createElement( 'canvas' );
72
- var context = canvas.getContext && canvas.getContext( '2d' );
73
-
74
- /**
75
- * Check if two sets of Emoji characters render the same.
76
- *
77
- * @param set1 array Set of Emoji characters.
78
- * @param set2 array Set of Emoji characters.
79
- * @returns {boolean} True if the two sets render the same.
80
- */
81
- function emojiSetsRenderIdentically( set1, set2 ) {
82
- var stringFromCharCode = String.fromCharCode;
83
-
84
- // Cleanup from previous test.
85
- context.clearRect( 0, 0, canvas.width, canvas.height );
86
- context.fillText( stringFromCharCode.apply( this, set1 ), 0, 0 );
87
- var rendered1 = canvas.toDataURL();
88
-
89
- // Cleanup from previous test.
90
- context.clearRect( 0, 0, canvas.width, canvas.height );
91
- context.fillText( stringFromCharCode.apply( this, set2 ), 0, 0 );
92
- var rendered2 = canvas.toDataURL();
93
-
94
- return rendered1 === rendered2;
95
- }
96
-
97
- /**
98
- * Detect if the browser supports rendering emoji or flag emoji. Flag emoji are a single glyph
99
- * made of two characters, so some browsers (notably, Firefox OS X) don't support them.
100
- *
101
- * @since 4.2.0
102
- *
103
- * @param type {String} Whether to test for support of "flag" or "emoji".
104
- * @return {Boolean} True if the browser can render emoji, false if it cannot.
105
- */
106
- function browserSupportsEmoji( type ) {
107
- var isIdentical;
108
-
109
- if ( ! context || ! context.fillText ) {
110
- return false;
111
- }
112
-
113
- /*
114
- * Chrome on OS X added native emoji rendering in M41. Unfortunately,
115
- * it doesn't work when the font is bolder than 500 weight. So, we
116
- * check for bold rendering support to avoid invisible emoji in Chrome.
117
- */
118
- context.textBaseline = 'top';
119
- context.font = '600 32px Arial';
120
-
121
- switch ( type ) {
122
- case 'flag':
123
- /*
124
- * Test for UN flag compatibility. This is the least supported of the letter locale flags,
125
- * so gives us an easy test for full support.
126
- *
127
- * To test for support, we try to render it, and compare the rendering to how it would look if
128
- * the browser doesn't render it correctly ([U] + [N]).
129
- */
130
- isIdentical = emojiSetsRenderIdentically(
131
- [ 55356, 56826, 55356, 56819 ],
132
- [ 55356, 56826, 8203, 55356, 56819 ]
133
- );
134
-
135
- if ( isIdentical ) {
136
- return false;
137
- }
138
-
139
- /*
140
- * Test for English flag compatibility. England is a country in the United Kingdom, it
141
- * does not have a two letter locale code but rather an five letter sub-division code.
142
- *
143
- * To test for support, we try to render it, and compare the rendering to how it would look if
144
- * the browser doesn't render it correctly (black flag emoji + [G] + [B] + [E] + [N] + [G]).
145
- */
146
- isIdentical = emojiSetsRenderIdentically(
147
- [ 55356, 57332, 56128, 56423, 56128, 56418, 56128, 56421, 56128, 56430, 56128, 56423, 56128, 56447 ],
148
- [ 55356, 57332, 8203, 56128, 56423, 8203, 56128, 56418, 8203, 56128, 56421, 8203, 56128, 56430, 8203, 56128, 56423, 8203, 56128, 56447 ]
149
- );
150
-
151
- return ! isIdentical;
152
- case 'emoji':
153
- /*
154
- * Emoji 5 has fairies of all genders.
155
- *
156
- * To test for support, try to render a new emoji (fairy, male), then compares
157
- * it to how it would look if the browser doesn't render it correctly
158
- * (fairy + male sign).
159
- */
160
- isIdentical = emojiSetsRenderIdentically(
161
- [ 55358, 56794, 8205, 9794, 65039 ],
162
- [ 55358, 56794, 8203, 9794, 65039 ]
163
- );
164
- return ! isIdentical;
165
- }
166
-
167
- return false;
168
- }
169
-
170
- function addScript( src ) {
171
- var script = document.createElement( 'script' );
172
-
173
- script.src = src;
174
- script.defer = script.type = 'text/javascript';
175
- document.getElementsByTagName( 'head' )[0].appendChild( script );
176
- }
177
-
178
- tests = Array( 'flag', 'emoji' );
179
-
180
- settings.supports = {
181
- everything: true,
182
- everythingExceptFlag: true
183
- };
184
-
185
- for( ii = 0; ii < tests.length; ii++ ) {
186
- settings.supports[ tests[ ii ] ] = browserSupportsEmoji( tests[ ii ] );
187
-
188
- settings.supports.everything = settings.supports.everything && settings.supports[ tests[ ii ] ];
189
-
190
- if ( 'flag' !== tests[ ii ] ) {
191
- settings.supports.everythingExceptFlag = settings.supports.everythingExceptFlag && settings.supports[ tests[ ii ] ];
192
- }
193
- }
194
-
195
- settings.supports.everythingExceptFlag = settings.supports.everythingExceptFlag && ! settings.supports.flag;
196
-
197
- settings.DOMReady = false;
198
- settings.readyCallback = function() {
199
- settings.DOMReady = true;
200
- };
201
-
202
- if ( ! settings.supports.everything ) {
203
- ready = function() {
204
- settings.readyCallback();
205
- };
206
-
207
- if ( document.addEventListener ) {
208
- document.addEventListener( 'DOMContentLoaded', ready, false );
209
- window.addEventListener( 'load', ready, false );
210
- } else {
211
- window.attachEvent( 'onload', ready );
212
- document.attachEvent( 'onreadystatechange', function() {
213
- if ( 'complete' === document.readyState ) {
214
- settings.readyCallback();
215
- }
216
- } );
217
- }
218
-
219
- src = settings.source || {};
220
-
221
- if ( src.concatemoji ) {
222
- addScript( src.concatemoji );
223
- } else if ( src.wpemoji && src.twemoji ) {
224
- addScript( src.twemoji );
225
- addScript( src.wpemoji );
226
- }
227
- }
228
-
229
- } )( window, document, window._wpemojiSettings );
230
- </script>
231
- <script type='text/javascript' src='http://lnmp.dev/download-monitor/wp-includes/js/jquery/jquery.js?ver=1.12.4'></script>
232
- <script type='text/javascript' src='http://lnmp.dev/download-monitor/wp-includes/js/jquery/jquery-migrate.js?ver=1.4.1'></script>
233
- <script type='text/javascript'>
234
- /* <![CDATA[ */
235
- var userSettings = {"url":"\/download-monitor\/","uid":"1","time":"1511968878","secure":""};
236
- /* ]]> */
237
- </script>
238
- <script type='text/javascript' src='http://lnmp.dev/download-monitor/wp-includes/js/utils.js?ver=4.9'></script>
239
- <script type='text/javascript'>
240
- /* <![CDATA[ */
241
- var dlm_id_strings = {"insert_download":"Insert Download"};
242
- /* ]]> */
243
- </script>
244
- <script type='text/javascript' src='http://lnmp.dev/download-monitor/wp-content/plugins/_download-monitor-new/assets/js/insert-download.js?ver=4.0.0'></script>
245
- <script type='text/javascript' src='http://lnmp.dev/download-monitor/wp-content/plugins/_download-monitor-new/assets/js/notices.js?ver=4.0.0'></script>
246
- <link id="wp-admin-canonical" rel="canonical" href="http://lnmp.dev/download-monitor/wp-admin/options.php?page=dlm_legacy_upgrade" />
247
- <script>
248
- if ( window.history.replaceState ) {
249
- window.history.replaceState( null, null, document.getElementById( 'wp-admin-canonical' ).href + window.location.hash );
250
- }
251
- </script>
252
- <script type="text/javascript">var _wpColorScheme = {"icons":{"base":"#82878c","focus":"#00a0d2","current":"#fff"}};</script>
253
- <style type="text/css" media="print">#wpadminbar { display:none; }</style>
254
- </head>
255
- <body class="wp-admin wp-core-ui no-js admin_page_dlm_legacy_upgrade auto-fold admin-bar branch-4-9 version-4-9 admin-color-fresh locale-en-us no-customize-support no-svg">
256
- <script type="text/javascript">
257
- document.body.className = document.body.className.replace('no-js','js');
258
- </script>
259
-
260
- <!--[if lte IE 8]>
261
- <script type="text/javascript">
262
- document.body.className = document.body.className.replace( /(^|\s)(no-)?customize-support(?=\s|$)/, '' ) + ' no-customize-support';
263
- </script>
264
- <![endif]-->
265
- <!--[if gte IE 9]><!-->
266
- <script type="text/javascript">
267
- (function() {
268
- var request, b = document.body, c = 'className', cs = 'customize-support', rcs = new RegExp('(^|\\s+)(no-)?'+cs+'(\\s+|$)');
269
-
270
- request = true;
271
-
272
- b[c] = b[c].replace( rcs, ' ' );
273
- // The customizer requires postMessage and CORS (if the site is cross domain)
274
- b[c] += ( window.postMessage && request ? ' ' : ' no-' ) + cs;
275
- }());
276
- </script>
277
- <!--<![endif]-->
278
-
279
- <div id="wpwrap">
280
-
281
- <div id="adminmenumain" role="navigation" aria-label="Main menu">
282
- <a href="#wpbody-content" class="screen-reader-shortcut">Skip to main content</a>
283
- <a href="#wp-toolbar" class="screen-reader-shortcut">Skip to toolbar</a>
284
- <div id="adminmenuback"></div>
285
- <div id="adminmenuwrap">
286
- <ul id="adminmenu">
287
-
288
-
289
- <li class="wp-first-item wp-has-submenu wp-not-current-submenu menu-top menu-top-first menu-icon-dashboard menu-top-last" id="menu-dashboard">
290
- <a href='index.php' class="wp-first-item wp-has-submenu wp-not-current-submenu menu-top menu-top-first menu-icon-dashboard menu-top-last" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-dashboard'><br /></div><div class='wp-menu-name'>Dashboard</div></a>
291
- <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Dashboard</li><li class="wp-first-item"><a href='index.php' class="wp-first-item">Home</a></li><li><a href='update-core.php'>Updates <span class='update-plugins count-5'><span class='update-count'>5</span></span></a></li></ul></li>
292
- <li class="wp-not-current-submenu wp-menu-separator" aria-hidden="true"><div class="separator"></div></li>
293
- <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-post open-if-no-js menu-top-first" id="menu-posts">
294
- <a href='edit.php' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-post open-if-no-js menu-top-first" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-post'><br /></div><div class='wp-menu-name'>Posts</div></a>
295
- <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Posts</li><li class="wp-first-item"><a href='edit.php' class="wp-first-item">All Posts</a></li><li><a href='post-new.php'>Add New</a></li><li><a href='edit-tags.php?taxonomy=category'>Categories</a></li><li><a href='edit-tags.php?taxonomy=post_tag'>Tags</a></li></ul></li>
296
- <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-media" id="menu-media">
297
- <a href='upload.php' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-media" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-media'><br /></div><div class='wp-menu-name'>Media</div></a>
298
- <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Media</li><li class="wp-first-item"><a href='upload.php' class="wp-first-item">Library</a></li><li><a href='media-new.php'>Add New</a></li></ul></li>
299
- <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-page" id="menu-pages">
300
- <a href='edit.php?post_type=page' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-page" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-page'><br /></div><div class='wp-menu-name'>Pages</div></a>
301
- <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Pages</li><li class="wp-first-item"><a href='edit.php?post_type=page' class="wp-first-item">All Pages</a></li><li><a href='post-new.php?post_type=page'>Add New</a></li></ul></li>
302
- <li class="wp-not-current-submenu menu-top menu-icon-comments" id="menu-comments">
303
- <a href='edit-comments.php' class="wp-not-current-submenu menu-top menu-icon-comments" ><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-comments'><br /></div><div class='wp-menu-name'>Comments <span class="awaiting-mod count-0"><span class="pending-count">0</span></span></div></a></li>
304
- <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-dlm_download menu-top-last" id="menu-posts-dlm_download">
305
- <a href='edit.php?post_type=dlm_download' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-dlm_download menu-top-last" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-post'><br /></div><div class='wp-menu-name'>Downloads</div></a>
306
- <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Downloads</li><li class="wp-first-item"><a href='edit.php?post_type=dlm_download' class="wp-first-item">All Downloads</a></li><li><a href='post-new.php?post_type=dlm_download'>Add New</a></li><li><a href='edit-tags.php?taxonomy=dlm_download_category&amp;post_type=dlm_download'>Categories</a></li><li><a href='edit-tags.php?taxonomy=dlm_download_tag&amp;post_type=dlm_download'>Tags</a></li><li><a href='edit.php?post_type=dlm_download&#038;page=download-monitor-settings'>Settings</a></li><li><a href='edit.php?post_type=dlm_download&#038;page=download-monitor-logs'>Logs</a></li><li><a href='edit.php?post_type=dlm_download&#038;page=download-monitor-reports'>Reports</a></li><li><a href='edit.php?post_type=dlm_download&#038;page=dlm-extensions'><span style="color:#419CCB;font-weight:bold;">Extensions</span></a></li></ul></li>
307
- <li class="wp-not-current-submenu wp-menu-separator" aria-hidden="true"><div class="separator"></div></li>
308
- <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-appearance menu-top-first" id="menu-appearance">
309
- <a href='themes.php' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-appearance menu-top-first" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-appearance'><br /></div><div class='wp-menu-name'>Appearance</div></a>
310
- <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Appearance</li><li class="wp-first-item"><a href='themes.php' class="wp-first-item">Themes</a></li><li class="hide-if-no-customize"><a href='customize.php?return=%2Fdownload-monitor%2Fwp-admin%2Foptions.php%3Fpage%3Ddlm_legacy_upgrade' class="hide-if-no-customize">Customize</a></li><li><a href='widgets.php'>Widgets</a></li><li><a href='nav-menus.php'>Menus</a></li><li class="hide-if-no-customize"><a href='customize.php?return=%2Fdownload-monitor%2Fwp-admin%2Foptions.php%3Fpage%3Ddlm_legacy_upgrade&#038;autofocus%5Bcontrol%5D=header_image' class="hide-if-no-customize">Header</a></li><li class="hide-if-no-customize"><a href='customize.php?return=%2Fdownload-monitor%2Fwp-admin%2Foptions.php%3Fpage%3Ddlm_legacy_upgrade&#038;autofocus%5Bcontrol%5D=background_image' class="hide-if-no-customize">Background</a></li><li><a href='themes.php?page=custom-header'>Header</a></li><li><a href='themes.php?page=custom-background'>Background</a></li><li><a href='theme-editor.php'>Editor</a></li></ul></li>
311
- <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-plugins" id="menu-plugins">
312
- <a href='plugins.php' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-plugins" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-plugins'><br /></div><div class='wp-menu-name'>Plugins <span class='update-plugins count-0'><span class='plugin-count'>0</span></span></div></a>
313
- <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Plugins <span class='update-plugins count-0'><span class='plugin-count'>0</span></span></li><li class="wp-first-item"><a href='plugins.php' class="wp-first-item">Installed Plugins</a></li><li><a href='plugin-install.php'>Add New</a></li><li><a href='plugin-editor.php'>Editor</a></li></ul></li>
314
- <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-users" id="menu-users">
315
- <a href='users.php' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-users" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-users'><br /></div><div class='wp-menu-name'>Users</div></a>
316
- <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Users</li><li class="wp-first-item"><a href='users.php' class="wp-first-item">All Users</a></li><li><a href='user-new.php'>Add New</a></li><li><a href='profile.php'>Your Profile</a></li></ul></li>
317
- <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-tools" id="menu-tools">
318
- <a href='tools.php' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-tools" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-tools'><br /></div><div class='wp-menu-name'>Tools</div></a>
319
- <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Tools</li><li class="wp-first-item"><a href='tools.php' class="wp-first-item">Available Tools</a></li><li><a href='import.php'>Import</a></li><li><a href='export.php'>Export</a></li></ul></li>
320
- <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-settings menu-top-last" id="menu-settings">
321
- <a href='options-general.php' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-settings menu-top-last" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-settings'><br /></div><div class='wp-menu-name'>Settings</div></a>
322
- <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Settings</li><li class="wp-first-item"><a href='options-general.php' class="wp-first-item">General</a></li><li><a href='options-writing.php'>Writing</a></li><li><a href='options-reading.php'>Reading</a></li><li><a href='options-discussion.php'>Discussion</a></li><li><a href='options-media.php'>Media</a></li><li><a href='options-permalink.php'>Permalinks</a></li></ul></li><li id="collapse-menu" class="hide-if-no-js"><button type="button" id="collapse-button" aria-label="Collapse Main menu" aria-expanded="true"><span class="collapse-button-icon" aria-hidden="true"></span><span class="collapse-button-label">Collapse menu</span></button></li></ul>
323
- </div>
324
- </div>
325
- <div id="wpcontent">
326
-
327
- <div id="wpadminbar" class="nojq nojs">
328
- <div class="quicklinks" id="wp-toolbar" role="navigation" aria-label="Toolbar" tabindex="0">
329
- <ul id="wp-admin-bar-root-default" class="ab-top-menu">
330
- <li id="wp-admin-bar-menu-toggle"><a class="ab-item" href="#"><span class="ab-icon"></span><span class="screen-reader-text">Menu</span></a> </li>
331
- <li id="wp-admin-bar-wp-logo" class="menupop"><a class="ab-item" aria-haspopup="true" href="http://lnmp.dev/download-monitor/wp-admin/about.php"><span class="ab-icon"></span><span class="screen-reader-text">About WordPress</span></a><div class="ab-sub-wrapper"><ul id="wp-admin-bar-wp-logo-default" class="ab-submenu">
332
- <li id="wp-admin-bar-about"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-admin/about.php">About WordPress</a> </li></ul><ul id="wp-admin-bar-wp-logo-external" class="ab-sub-secondary ab-submenu">
333
- <li id="wp-admin-bar-wporg"><a class="ab-item" href="https://wordpress.org/">WordPress.org</a> </li>
334
- <li id="wp-admin-bar-documentation"><a class="ab-item" href="https://codex.wordpress.org/">Documentation</a> </li>
335
- <li id="wp-admin-bar-support-forums"><a class="ab-item" href="https://wordpress.org/support/">Support Forums</a> </li>
336
- <li id="wp-admin-bar-feedback"><a class="ab-item" href="https://wordpress.org/support/forum/requests-and-feedback">Feedback</a> </li></ul></div> </li>
337
- <li id="wp-admin-bar-site-name" class="menupop"><a class="ab-item" aria-haspopup="true" href="http://lnmp.dev/download-monitor/">Download Monitor</a><div class="ab-sub-wrapper"><ul id="wp-admin-bar-site-name-default" class="ab-submenu">
338
- <li id="wp-admin-bar-view-site"><a class="ab-item" href="http://lnmp.dev/download-monitor/">Visit Site</a> </li></ul></div> </li>
339
- <li id="wp-admin-bar-updates"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-admin/update-core.php" title="4 Theme Updates, Translation Updates"><span class="ab-icon"></span><span class="ab-label">5</span><span class="screen-reader-text">4 Theme Updates, Translation Updates</span></a> </li>
340
- <li id="wp-admin-bar-comments"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-admin/edit-comments.php"><span class="ab-icon"></span><span class="ab-label awaiting-mod pending-count count-0" aria-hidden="true">0</span><span class="screen-reader-text">0 comments awaiting moderation</span></a> </li>
341
- <li id="wp-admin-bar-new-content" class="menupop"><a class="ab-item" aria-haspopup="true" href="http://lnmp.dev/download-monitor/wp-admin/post-new.php"><span class="ab-icon"></span><span class="ab-label">New</span></a><div class="ab-sub-wrapper"><ul id="wp-admin-bar-new-content-default" class="ab-submenu">
342
- <li id="wp-admin-bar-new-post"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-admin/post-new.php">Post</a> </li>
343
- <li id="wp-admin-bar-new-media"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-admin/media-new.php">Media</a> </li>
344
- <li id="wp-admin-bar-new-page"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-admin/post-new.php?post_type=page">Page</a> </li>
345
- <li id="wp-admin-bar-new-dlm_download"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-admin/post-new.php?post_type=dlm_download">Download</a> </li>
346
- <li id="wp-admin-bar-new-user"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-admin/user-new.php">User</a> </li></ul></div> </li></ul><ul id="wp-admin-bar-top-secondary" class="ab-top-secondary ab-top-menu">
347
- <li id="wp-admin-bar-my-account" class="menupop with-avatar"><a class="ab-item" aria-haspopup="true" href="http://lnmp.dev/download-monitor/wp-admin/profile.php">Howdy, <span class="display-name">admin</span><img alt='' src='http://2.gravatar.com/avatar/e16646b416e72c193d5f23b1790343ef?s=26&#038;d=mm&#038;r=g' srcset='http://2.gravatar.com/avatar/e16646b416e72c193d5f23b1790343ef?s=52&#038;d=mm&#038;r=g 2x' class='avatar avatar-26 photo' height='26' width='26' /></a><div class="ab-sub-wrapper"><ul id="wp-admin-bar-user-actions" class="ab-submenu">
348
- <li id="wp-admin-bar-user-info"><a class="ab-item" tabindex="-1" href="http://lnmp.dev/download-monitor/wp-admin/profile.php"><img alt='' src='http://2.gravatar.com/avatar/e16646b416e72c193d5f23b1790343ef?s=64&#038;d=mm&#038;r=g' srcset='http://2.gravatar.com/avatar/e16646b416e72c193d5f23b1790343ef?s=128&#038;d=mm&#038;r=g 2x' class='avatar avatar-64 photo' height='64' width='64' /><span class='display-name'>admin</span></a> </li>
349
- <li id="wp-admin-bar-edit-profile"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-admin/profile.php">Edit My Profile</a> </li>
350
- <li id="wp-admin-bar-logout"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-login.php?action=logout&#038;_wpnonce=73db673a22">Log Out</a> </li></ul></div> </li></ul> </div>
351
- <a class="screen-reader-shortcut" href="http://lnmp.dev/download-monitor/wp-login.php?action=logout&#038;_wpnonce=73db673a22">Log Out</a>
352
- </div>
353
-
354
-
355
- <div id="wpbody" role="main">
356
-
357
- <div id="wpbody-content" aria-label="Main content" tabindex="0">
358
- <div id="screen-meta" class="metabox-prefs">
359
-
360
- <div id="contextual-help-wrap" class="hidden no-sidebar" tabindex="-1" aria-label="Contextual Help Tab">
361
- <div id="contextual-help-back"></div>
362
- <div id="contextual-help-columns">
363
- <div class="contextual-help-tabs">
364
- <ul>
365
- </ul>
366
- </div>
367
-
368
-
369
- <div class="contextual-help-tabs-wrap">
370
- </div>
371
- </div>
372
- </div>
373
- </div>
374
- <div class="wrap">
375
- <h1>Download Monitor - Legacy Upgrade</h1><br/>
376
- <p>Welcome to the Download Monitor Legacy Upgrader. On this page we will upgrade your old Download Monitor (legacy) data so it will work with the latest version. If you're on this page, it should mean that you updated to this version from Download Monitor <strong>3.x</strong>. If you're unsure if this is correct, or you want to read more about the legacy upgrade, we've setup a page that will explain this process in a lot more detail. <a href='https://www.download-monitor.com/kb/legacy-upgrade' target='_blank'>Click here</a> if to view that page.</p>
377
-
378
- <div id="dlm-legacy-upgrade-container" style="position:relative;"></div>
379
- </div>
380
-
381
- <div class="clear"></div></div><!-- wpbody-content -->
382
- <div class="clear"></div></div><!-- wpbody -->
383
- <div class="clear"></div></div><!-- wpcontent -->
384
-
385
- <div id="wpfooter" role="contentinfo">
386
- <p id="footer-left" class="alignleft">
387
- <span id="footer-thankyou">Thank you for creating with <a href="https://wordpress.org/">WordPress</a>.</span> </p>
388
- <p id="footer-upgrade" class="alignright">
389
- Version 4.9 </p>
390
- <div class="clear"></div>
391
- </div>
392
- <div id="wp-auth-check-wrap" class="hidden">
393
- <div id="wp-auth-check-bg"></div>
394
- <div id="wp-auth-check">
395
- <button type="button" class="wp-auth-check-close button-link"><span class="screen-reader-text">Close dialog</span></button>
396
- <div id="wp-auth-check-form" class="loading" data-src="http://lnmp.dev/download-monitor/wp-login.php?interim-login=1&#038;wp_lang=en_US"></div>
397
- <div class="wp-auth-fallback">
398
- <p><b class="wp-auth-fallback-expired" tabindex="0">Session expired</b></p>
399
- <p><a href="http://lnmp.dev/download-monitor/wp-login.php" target="_blank">Please log in again.</a>
400
- The login page will open in a new window. After logging in you can close it and return to this page.</p>
401
- </div>
402
- </div>
403
- </div>
404
-
405
-
406
- <div class="clear"></div></div><!-- wpwrap -->
407
- </body>
408
- </html>
1
+ <!DOCTYPE html>
2
+ <!--[if IE 8]>
3
+ <html xmlns="http://www.w3.org/1999/xhtml" class="ie8 wp-toolbar" lang="en-US">
4
+ <![endif]-->
5
+ <!--[if !(IE 8) ]><!-->
6
+ <html xmlns="http://www.w3.org/1999/xhtml" class="wp-toolbar" lang="en-US">
7
+ <!--<![endif]-->
8
+ <head>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
10
+ <title> &lsaquo; Download Monitor &#8212; WordPress</title>
11
+
12
+ <script type="text/javascript">
13
+ addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
14
+ var ajaxurl = 'http://lnmp.dev/download-monitor/wp-admin/admin-ajax.php',
15
+ pagenow = 'admin_page_dlm_legacy_upgrade',
16
+ typenow = '',
17
+ adminpage = 'admin_page_dlm_legacy_upgrade',
18
+ thousandsSeparator = ',',
19
+ decimalPoint = '.',
20
+ isRtl = 0;
21
+ </script>
22
+
23
+ <meta name="viewport" content="width=device-width,initial-scale=1.0">
24
+ <link rel='dns-prefetch' href='//s.w.org' />
25
+ <style type="text/css">
26
+ img.wp-smiley,
27
+ img.emoji {
28
+ display: inline !important;
29
+ border: none !important;
30
+ box-shadow: none !important;
31
+ height: 1em !important;
32
+ width: 1em !important;
33
+ margin: 0 .07em !important;
34
+ vertical-align: -0.1em !important;
35
+ background: none !important;
36
+ padding: 0 !important;
37
+ }
38
+ </style>
39
+ <link rel='stylesheet' id='dashicons-css' href='http://lnmp.dev/download-monitor/wp-includes/css/dashicons.css?ver=4.9' type='text/css' media='all' />
40
+ <link rel='stylesheet' id='admin-bar-css' href='http://lnmp.dev/download-monitor/wp-includes/css/admin-bar.css?ver=4.9' type='text/css' media='all' />
41
+ <link rel='stylesheet' id='common-css' href='http://lnmp.dev/download-monitor/wp-admin/css/common.css?ver=4.9' type='text/css' media='all' />
42
+ <link rel='stylesheet' id='forms-css' href='http://lnmp.dev/download-monitor/wp-admin/css/forms.css?ver=4.9' type='text/css' media='all' />
43
+ <link rel='stylesheet' id='admin-menu-css' href='http://lnmp.dev/download-monitor/wp-admin/css/admin-menu.css?ver=4.9' type='text/css' media='all' />
44
+ <link rel='stylesheet' id='dashboard-css' href='http://lnmp.dev/download-monitor/wp-admin/css/dashboard.css?ver=4.9' type='text/css' media='all' />
45
+ <link rel='stylesheet' id='list-tables-css' href='http://lnmp.dev/download-monitor/wp-admin/css/list-tables.css?ver=4.9' type='text/css' media='all' />
46
+ <link rel='stylesheet' id='edit-css' href='http://lnmp.dev/download-monitor/wp-admin/css/edit.css?ver=4.9' type='text/css' media='all' />
47
+ <link rel='stylesheet' id='revisions-css' href='http://lnmp.dev/download-monitor/wp-admin/css/revisions.css?ver=4.9' type='text/css' media='all' />
48
+ <link rel='stylesheet' id='media-css' href='http://lnmp.dev/download-monitor/wp-admin/css/media.css?ver=4.9' type='text/css' media='all' />
49
+ <link rel='stylesheet' id='themes-css' href='http://lnmp.dev/download-monitor/wp-admin/css/themes.css?ver=4.9' type='text/css' media='all' />
50
+ <link rel='stylesheet' id='about-css' href='http://lnmp.dev/download-monitor/wp-admin/css/about.css?ver=4.9' type='text/css' media='all' />
51
+ <link rel='stylesheet' id='nav-menus-css' href='http://lnmp.dev/download-monitor/wp-admin/css/nav-menus.css?ver=4.9' type='text/css' media='all' />
52
+ <link rel='stylesheet' id='wp-pointer-css' href='http://lnmp.dev/download-monitor/wp-includes/css/wp-pointer.css?ver=4.9' type='text/css' media='all' />
53
+ <link rel='stylesheet' id='widgets-css' href='http://lnmp.dev/download-monitor/wp-admin/css/widgets.css?ver=4.9' type='text/css' media='all' />
54
+ <link rel='stylesheet' id='site-icon-css' href='http://lnmp.dev/download-monitor/wp-admin/css/site-icon.css?ver=4.9' type='text/css' media='all' />
55
+ <link rel='stylesheet' id='l10n-css' href='http://lnmp.dev/download-monitor/wp-admin/css/l10n.css?ver=4.9' type='text/css' media='all' />
56
+ <link rel='stylesheet' id='buttons-css' href='http://lnmp.dev/download-monitor/wp-includes/css/buttons.css?ver=4.9' type='text/css' media='all' />
57
+ <!--[if lte IE 7]>
58
+ <link rel='stylesheet' id='ie-css' href='http://lnmp.dev/download-monitor/wp-admin/css/ie.css?ver=4.9' type='text/css' media='all' />
59
+ <![endif]-->
60
+ <link rel='stylesheet' id='wp-auth-check-css' href='http://lnmp.dev/download-monitor/wp-includes/css/wp-auth-check.css?ver=4.9' type='text/css' media='all' />
61
+ <link rel='stylesheet' id='download_monitor_menu_css-css' href='http://lnmp.dev/download-monitor/wp-content/plugins/_download-monitor-new/assets/css/menu.css?ver=4.9' type='text/css' media='all' />
62
+ <script type="text/javascript">
63
+ window._wpemojiSettings = {"baseUrl":"https:\/\/s.w.org\/images\/core\/emoji\/2.3\/72x72\/","ext":".png","svgUrl":"https:\/\/s.w.org\/images\/core\/emoji\/2.3\/svg\/","svgExt":".svg","source":{"wpemoji":"http:\/\/lnmp.dev\/download-monitor\/wp-includes\/js\/wp-emoji.js?ver=4.9","twemoji":"http:\/\/lnmp.dev\/download-monitor\/wp-includes\/js\/twemoji.js?ver=4.9"}};
64
+ ( function( window, document, settings ) {
65
+ var src, ready, ii, tests;
66
+
67
+ /*
68
+ * Create a canvas element for testing native browser support
69
+ * of emoji.
70
+ */
71
+ var canvas = document.createElement( 'canvas' );
72
+ var context = canvas.getContext && canvas.getContext( '2d' );
73
+
74
+ /**
75
+ * Check if two sets of Emoji characters render the same.
76
+ *
77
+ * @param set1 array Set of Emoji characters.
78
+ * @param set2 array Set of Emoji characters.
79
+ * @returns {boolean} True if the two sets render the same.
80
+ */
81
+ function emojiSetsRenderIdentically( set1, set2 ) {
82
+ var stringFromCharCode = String.fromCharCode;
83
+
84
+ // Cleanup from previous test.
85
+ context.clearRect( 0, 0, canvas.width, canvas.height );
86
+ context.fillText( stringFromCharCode.apply( this, set1 ), 0, 0 );
87
+ var rendered1 = canvas.toDataURL();
88
+
89
+ // Cleanup from previous test.
90
+ context.clearRect( 0, 0, canvas.width, canvas.height );
91
+ context.fillText( stringFromCharCode.apply( this, set2 ), 0, 0 );
92
+ var rendered2 = canvas.toDataURL();
93
+
94
+ return rendered1 === rendered2;
95
+ }
96
+
97
+ /**
98
+ * Detect if the browser supports rendering emoji or flag emoji. Flag emoji are a single glyph
99
+ * made of two characters, so some browsers (notably, Firefox OS X) don't support them.
100
+ *
101
+ * @since 4.2.0
102
+ *
103
+ * @param type {String} Whether to test for support of "flag" or "emoji".
104
+ * @return {Boolean} True if the browser can render emoji, false if it cannot.
105
+ */
106
+ function browserSupportsEmoji( type ) {
107
+ var isIdentical;
108
+
109
+ if ( ! context || ! context.fillText ) {
110
+ return false;
111
+ }
112
+
113
+ /*
114
+ * Chrome on OS X added native emoji rendering in M41. Unfortunately,
115
+ * it doesn't work when the font is bolder than 500 weight. So, we
116
+ * check for bold rendering support to avoid invisible emoji in Chrome.
117
+ */
118
+ context.textBaseline = 'top';
119
+ context.font = '600 32px Arial';
120
+
121
+ switch ( type ) {
122
+ case 'flag':
123
+ /*
124
+ * Test for UN flag compatibility. This is the least supported of the letter locale flags,
125
+ * so gives us an easy test for full support.
126
+ *
127
+ * To test for support, we try to render it, and compare the rendering to how it would look if
128
+ * the browser doesn't render it correctly ([U] + [N]).
129
+ */
130
+ isIdentical = emojiSetsRenderIdentically(
131
+ [ 55356, 56826, 55356, 56819 ],
132
+ [ 55356, 56826, 8203, 55356, 56819 ]
133
+ );
134
+
135
+ if ( isIdentical ) {
136
+ return false;
137
+ }
138
+
139
+ /*
140
+ * Test for English flag compatibility. England is a country in the United Kingdom, it
141
+ * does not have a two letter locale code but rather an five letter sub-division code.
142
+ *
143
+ * To test for support, we try to render it, and compare the rendering to how it would look if
144
+ * the browser doesn't render it correctly (black flag emoji + [G] + [B] + [E] + [N] + [G]).
145
+ */
146
+ isIdentical = emojiSetsRenderIdentically(
147
+ [ 55356, 57332, 56128, 56423, 56128, 56418, 56128, 56421, 56128, 56430, 56128, 56423, 56128, 56447 ],
148
+ [ 55356, 57332, 8203, 56128, 56423, 8203, 56128, 56418, 8203, 56128, 56421, 8203, 56128, 56430, 8203, 56128, 56423, 8203, 56128, 56447 ]
149
+ );
150
+
151
+ return ! isIdentical;
152
+ case 'emoji':
153
+ /*
154
+ * Emoji 5 has fairies of all genders.
155
+ *
156
+ * To test for support, try to render a new emoji (fairy, male), then compares
157
+ * it to how it would look if the browser doesn't render it correctly
158
+ * (fairy + male sign).
159
+ */
160
+ isIdentical = emojiSetsRenderIdentically(
161
+ [ 55358, 56794, 8205, 9794, 65039 ],
162
+ [ 55358, 56794, 8203, 9794, 65039 ]
163
+ );
164
+ return ! isIdentical;
165
+ }
166
+
167
+ return false;
168
+ }
169
+
170
+ function addScript( src ) {
171
+ var script = document.createElement( 'script' );
172
+
173
+ script.src = src;
174
+ script.defer = script.type = 'text/javascript';
175
+ document.getElementsByTagName( 'head' )[0].appendChild( script );
176
+ }
177
+
178
+ tests = Array( 'flag', 'emoji' );
179
+
180
+ settings.supports = {
181
+ everything: true,
182
+ everythingExceptFlag: true
183
+ };
184
+
185
+ for( ii = 0; ii < tests.length; ii++ ) {
186
+ settings.supports[ tests[ ii ] ] = browserSupportsEmoji( tests[ ii ] );
187
+
188
+ settings.supports.everything = settings.supports.everything && settings.supports[ tests[ ii ] ];
189
+
190
+ if ( 'flag' !== tests[ ii ] ) {
191
+ settings.supports.everythingExceptFlag = settings.supports.everythingExceptFlag && settings.supports[ tests[ ii ] ];
192
+ }
193
+ }
194
+
195
+ settings.supports.everythingExceptFlag = settings.supports.everythingExceptFlag && ! settings.supports.flag;
196
+
197
+ settings.DOMReady = false;
198
+ settings.readyCallback = function() {
199
+ settings.DOMReady = true;
200
+ };
201
+
202
+ if ( ! settings.supports.everything ) {
203
+ ready = function() {
204
+ settings.readyCallback();
205
+ };
206
+
207
+ if ( document.addEventListener ) {
208
+ document.addEventListener( 'DOMContentLoaded', ready, false );
209
+ window.addEventListener( 'load', ready, false );
210
+ } else {
211
+ window.attachEvent( 'onload', ready );
212
+ document.attachEvent( 'onreadystatechange', function() {
213
+ if ( 'complete' === document.readyState ) {
214
+ settings.readyCallback();
215
+ }
216
+ } );
217
+ }
218
+
219
+ src = settings.source || {};
220
+
221
+ if ( src.concatemoji ) {
222
+ addScript( src.concatemoji );
223
+ } else if ( src.wpemoji && src.twemoji ) {
224
+ addScript( src.twemoji );
225
+ addScript( src.wpemoji );
226
+ }
227
+ }
228
+
229
+ } )( window, document, window._wpemojiSettings );
230
+ </script>
231
+ <script type='text/javascript' src='http://lnmp.dev/download-monitor/wp-includes/js/jquery/jquery.js?ver=1.12.4'></script>
232
+ <script type='text/javascript' src='http://lnmp.dev/download-monitor/wp-includes/js/jquery/jquery-migrate.js?ver=1.4.1'></script>
233
+ <script type='text/javascript'>
234
+ /* <![CDATA[ */
235
+ var userSettings = {"url":"\/download-monitor\/","uid":"1","time":"1511968878","secure":""};
236
+ /* ]]> */
237
+ </script>
238
+ <script type='text/javascript' src='http://lnmp.dev/download-monitor/wp-includes/js/utils.js?ver=4.9'></script>
239
+ <script type='text/javascript'>
240
+ /* <![CDATA[ */
241
+ var dlm_id_strings = {"insert_download":"Insert Download"};
242
+ /* ]]> */
243
+ </script>
244
+ <script type='text/javascript' src='http://lnmp.dev/download-monitor/wp-content/plugins/_download-monitor-new/assets/js/insert-download.js?ver=4.0.0'></script>
245
+ <script type='text/javascript' src='http://lnmp.dev/download-monitor/wp-content/plugins/_download-monitor-new/assets/js/notices.js?ver=4.0.0'></script>
246
+ <link id="wp-admin-canonical" rel="canonical" href="http://lnmp.dev/download-monitor/wp-admin/options.php?page=dlm_legacy_upgrade" />
247
+ <script>
248
+ if ( window.history.replaceState ) {
249
+ window.history.replaceState( null, null, document.getElementById( 'wp-admin-canonical' ).href + window.location.hash );
250
+ }
251
+ </script>
252
+ <script type="text/javascript">var _wpColorScheme = {"icons":{"base":"#82878c","focus":"#00a0d2","current":"#fff"}};</script>
253
+ <style type="text/css" media="print">#wpadminbar { display:none; }</style>
254
+ </head>
255
+ <body class="wp-admin wp-core-ui no-js admin_page_dlm_legacy_upgrade auto-fold admin-bar branch-4-9 version-4-9 admin-color-fresh locale-en-us no-customize-support no-svg">
256
+ <script type="text/javascript">
257
+ document.body.className = document.body.className.replace('no-js','js');
258
+ </script>
259
+
260
+ <!--[if lte IE 8]>
261
+ <script type="text/javascript">
262
+ document.body.className = document.body.className.replace( /(^|\s)(no-)?customize-support(?=\s|$)/, '' ) + ' no-customize-support';
263
+ </script>
264
+ <![endif]-->
265
+ <!--[if gte IE 9]><!-->
266
+ <script type="text/javascript">
267
+ (function() {
268
+ var request, b = document.body, c = 'className', cs = 'customize-support', rcs = new RegExp('(^|\\s+)(no-)?'+cs+'(\\s+|$)');
269
+
270
+ request = true;
271
+
272
+ b[c] = b[c].replace( rcs, ' ' );
273
+ // The customizer requires postMessage and CORS (if the site is cross domain)
274
+ b[c] += ( window.postMessage && request ? ' ' : ' no-' ) + cs;
275
+ }());
276
+ </script>
277
+ <!--<![endif]-->
278
+
279
+ <div id="wpwrap">
280
+
281
+ <div id="adminmenumain" role="navigation" aria-label="Main menu">
282
+ <a href="#wpbody-content" class="screen-reader-shortcut">Skip to main content</a>
283
+ <a href="#wp-toolbar" class="screen-reader-shortcut">Skip to toolbar</a>
284
+ <div id="adminmenuback"></div>
285
+ <div id="adminmenuwrap">
286
+ <ul id="adminmenu">
287
+
288
+
289
+ <li class="wp-first-item wp-has-submenu wp-not-current-submenu menu-top menu-top-first menu-icon-dashboard menu-top-last" id="menu-dashboard">
290
+ <a href='index.php' class="wp-first-item wp-has-submenu wp-not-current-submenu menu-top menu-top-first menu-icon-dashboard menu-top-last" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-dashboard'><br /></div><div class='wp-menu-name'>Dashboard</div></a>
291
+ <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Dashboard</li><li class="wp-first-item"><a href='index.php' class="wp-first-item">Home</a></li><li><a href='update-core.php'>Updates <span class='update-plugins count-5'><span class='update-count'>5</span></span></a></li></ul></li>
292
+ <li class="wp-not-current-submenu wp-menu-separator" aria-hidden="true"><div class="separator"></div></li>
293
+ <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-post open-if-no-js menu-top-first" id="menu-posts">
294
+ <a href='edit.php' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-post open-if-no-js menu-top-first" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-post'><br /></div><div class='wp-menu-name'>Posts</div></a>
295
+ <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Posts</li><li class="wp-first-item"><a href='edit.php' class="wp-first-item">All Posts</a></li><li><a href='post-new.php'>Add New</a></li><li><a href='edit-tags.php?taxonomy=category'>Categories</a></li><li><a href='edit-tags.php?taxonomy=post_tag'>Tags</a></li></ul></li>
296
+ <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-media" id="menu-media">
297
+ <a href='upload.php' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-media" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-media'><br /></div><div class='wp-menu-name'>Media</div></a>
298
+ <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Media</li><li class="wp-first-item"><a href='upload.php' class="wp-first-item">Library</a></li><li><a href='media-new.php'>Add New</a></li></ul></li>
299
+ <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-page" id="menu-pages">
300
+ <a href='edit.php?post_type=page' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-page" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-page'><br /></div><div class='wp-menu-name'>Pages</div></a>
301
+ <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Pages</li><li class="wp-first-item"><a href='edit.php?post_type=page' class="wp-first-item">All Pages</a></li><li><a href='post-new.php?post_type=page'>Add New</a></li></ul></li>
302
+ <li class="wp-not-current-submenu menu-top menu-icon-comments" id="menu-comments">
303
+ <a href='edit-comments.php' class="wp-not-current-submenu menu-top menu-icon-comments" ><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-comments'><br /></div><div class='wp-menu-name'>Comments <span class="awaiting-mod count-0"><span class="pending-count">0</span></span></div></a></li>
304
+ <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-dlm_download menu-top-last" id="menu-posts-dlm_download">
305
+ <a href='edit.php?post_type=dlm_download' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-dlm_download menu-top-last" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-post'><br /></div><div class='wp-menu-name'>Downloads</div></a>
306
+ <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Downloads</li><li class="wp-first-item"><a href='edit.php?post_type=dlm_download' class="wp-first-item">All Downloads</a></li><li><a href='post-new.php?post_type=dlm_download'>Add New</a></li><li><a href='edit-tags.php?taxonomy=dlm_download_category&amp;post_type=dlm_download'>Categories</a></li><li><a href='edit-tags.php?taxonomy=dlm_download_tag&amp;post_type=dlm_download'>Tags</a></li><li><a href='edit.php?post_type=dlm_download&#038;page=download-monitor-settings'>Settings</a></li><li><a href='edit.php?post_type=dlm_download&#038;page=download-monitor-logs'>Logs</a></li><li><a href='edit.php?post_type=dlm_download&#038;page=download-monitor-reports'>Reports</a></li><li><a href='edit.php?post_type=dlm_download&#038;page=dlm-extensions'><span style="color:#419CCB;font-weight:bold;">Extensions</span></a></li></ul></li>
307
+ <li class="wp-not-current-submenu wp-menu-separator" aria-hidden="true"><div class="separator"></div></li>
308
+ <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-appearance menu-top-first" id="menu-appearance">
309
+ <a href='themes.php' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-appearance menu-top-first" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-appearance'><br /></div><div class='wp-menu-name'>Appearance</div></a>
310
+ <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Appearance</li><li class="wp-first-item"><a href='themes.php' class="wp-first-item">Themes</a></li><li class="hide-if-no-customize"><a href='customize.php?return=%2Fdownload-monitor%2Fwp-admin%2Foptions.php%3Fpage%3Ddlm_legacy_upgrade' class="hide-if-no-customize">Customize</a></li><li><a href='widgets.php'>Widgets</a></li><li><a href='nav-menus.php'>Menus</a></li><li class="hide-if-no-customize"><a href='customize.php?return=%2Fdownload-monitor%2Fwp-admin%2Foptions.php%3Fpage%3Ddlm_legacy_upgrade&#038;autofocus%5Bcontrol%5D=header_image' class="hide-if-no-customize">Header</a></li><li class="hide-if-no-customize"><a href='customize.php?return=%2Fdownload-monitor%2Fwp-admin%2Foptions.php%3Fpage%3Ddlm_legacy_upgrade&#038;autofocus%5Bcontrol%5D=background_image' class="hide-if-no-customize">Background</a></li><li><a href='themes.php?page=custom-header'>Header</a></li><li><a href='themes.php?page=custom-background'>Background</a></li><li><a href='theme-editor.php'>Editor</a></li></ul></li>
311
+ <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-plugins" id="menu-plugins">
312
+ <a href='plugins.php' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-plugins" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-plugins'><br /></div><div class='wp-menu-name'>Plugins <span class='update-plugins count-0'><span class='plugin-count'>0</span></span></div></a>
313
+ <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Plugins <span class='update-plugins count-0'><span class='plugin-count'>0</span></span></li><li class="wp-first-item"><a href='plugins.php' class="wp-first-item">Installed Plugins</a></li><li><a href='plugin-install.php'>Add New</a></li><li><a href='plugin-editor.php'>Editor</a></li></ul></li>
314
+ <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-users" id="menu-users">
315
+ <a href='users.php' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-users" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-users'><br /></div><div class='wp-menu-name'>Users</div></a>
316
+ <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Users</li><li class="wp-first-item"><a href='users.php' class="wp-first-item">All Users</a></li><li><a href='user-new.php'>Add New</a></li><li><a href='profile.php'>Your Profile</a></li></ul></li>
317
+ <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-tools" id="menu-tools">
318
+ <a href='tools.php' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-tools" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-tools'><br /></div><div class='wp-menu-name'>Tools</div></a>
319
+ <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Tools</li><li class="wp-first-item"><a href='tools.php' class="wp-first-item">Available Tools</a></li><li><a href='import.php'>Import</a></li><li><a href='export.php'>Export</a></li></ul></li>
320
+ <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-settings menu-top-last" id="menu-settings">
321
+ <a href='options-general.php' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-settings menu-top-last" aria-haspopup="true"><div class="wp-menu-arrow"><div></div></div><div class='wp-menu-image dashicons-before dashicons-admin-settings'><br /></div><div class='wp-menu-name'>Settings</div></a>
322
+ <ul class='wp-submenu wp-submenu-wrap'><li class='wp-submenu-head' aria-hidden='true'>Settings</li><li class="wp-first-item"><a href='options-general.php' class="wp-first-item">General</a></li><li><a href='options-writing.php'>Writing</a></li><li><a href='options-reading.php'>Reading</a></li><li><a href='options-discussion.php'>Discussion</a></li><li><a href='options-media.php'>Media</a></li><li><a href='options-permalink.php'>Permalinks</a></li></ul></li><li id="collapse-menu" class="hide-if-no-js"><button type="button" id="collapse-button" aria-label="Collapse Main menu" aria-expanded="true"><span class="collapse-button-icon" aria-hidden="true"></span><span class="collapse-button-label">Collapse menu</span></button></li></ul>
323
+ </div>
324
+ </div>
325
+ <div id="wpcontent">
326
+
327
+ <div id="wpadminbar" class="nojq nojs">
328
+ <div class="quicklinks" id="wp-toolbar" role="navigation" aria-label="Toolbar" tabindex="0">
329
+ <ul id="wp-admin-bar-root-default" class="ab-top-menu">
330
+ <li id="wp-admin-bar-menu-toggle"><a class="ab-item" href="#"><span class="ab-icon"></span><span class="screen-reader-text">Menu</span></a> </li>
331
+ <li id="wp-admin-bar-wp-logo" class="menupop"><a class="ab-item" aria-haspopup="true" href="http://lnmp.dev/download-monitor/wp-admin/about.php"><span class="ab-icon"></span><span class="screen-reader-text">About WordPress</span></a><div class="ab-sub-wrapper"><ul id="wp-admin-bar-wp-logo-default" class="ab-submenu">
332
+ <li id="wp-admin-bar-about"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-admin/about.php">About WordPress</a> </li></ul><ul id="wp-admin-bar-wp-logo-external" class="ab-sub-secondary ab-submenu">
333
+ <li id="wp-admin-bar-wporg"><a class="ab-item" href="https://wordpress.org/">WordPress.org</a> </li>
334
+ <li id="wp-admin-bar-documentation"><a class="ab-item" href="https://codex.wordpress.org/">Documentation</a> </li>
335
+ <li id="wp-admin-bar-support-forums"><a class="ab-item" href="https://wordpress.org/support/">Support Forums</a> </li>
336
+ <li id="wp-admin-bar-feedback"><a class="ab-item" href="https://wordpress.org/support/forum/requests-and-feedback">Feedback</a> </li></ul></div> </li>
337
+ <li id="wp-admin-bar-site-name" class="menupop"><a class="ab-item" aria-haspopup="true" href="http://lnmp.dev/download-monitor/">Download Monitor</a><div class="ab-sub-wrapper"><ul id="wp-admin-bar-site-name-default" class="ab-submenu">
338
+ <li id="wp-admin-bar-view-site"><a class="ab-item" href="http://lnmp.dev/download-monitor/">Visit Site</a> </li></ul></div> </li>
339
+ <li id="wp-admin-bar-updates"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-admin/update-core.php" title="4 Theme Updates, Translation Updates"><span class="ab-icon"></span><span class="ab-label">5</span><span class="screen-reader-text">4 Theme Updates, Translation Updates</span></a> </li>
340
+ <li id="wp-admin-bar-comments"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-admin/edit-comments.php"><span class="ab-icon"></span><span class="ab-label awaiting-mod pending-count count-0" aria-hidden="true">0</span><span class="screen-reader-text">0 comments awaiting moderation</span></a> </li>
341
+ <li id="wp-admin-bar-new-content" class="menupop"><a class="ab-item" aria-haspopup="true" href="http://lnmp.dev/download-monitor/wp-admin/post-new.php"><span class="ab-icon"></span><span class="ab-label">New</span></a><div class="ab-sub-wrapper"><ul id="wp-admin-bar-new-content-default" class="ab-submenu">
342
+ <li id="wp-admin-bar-new-post"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-admin/post-new.php">Post</a> </li>
343
+ <li id="wp-admin-bar-new-media"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-admin/media-new.php">Media</a> </li>
344
+ <li id="wp-admin-bar-new-page"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-admin/post-new.php?post_type=page">Page</a> </li>
345
+ <li id="wp-admin-bar-new-dlm_download"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-admin/post-new.php?post_type=dlm_download">Download</a> </li>
346
+ <li id="wp-admin-bar-new-user"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-admin/user-new.php">User</a> </li></ul></div> </li></ul><ul id="wp-admin-bar-top-secondary" class="ab-top-secondary ab-top-menu">
347
+ <li id="wp-admin-bar-my-account" class="menupop with-avatar"><a class="ab-item" aria-haspopup="true" href="http://lnmp.dev/download-monitor/wp-admin/profile.php">Howdy, <span class="display-name">admin</span><img alt='' src='http://2.gravatar.com/avatar/e16646b416e72c193d5f23b1790343ef?s=26&#038;d=mm&#038;r=g' srcset='http://2.gravatar.com/avatar/e16646b416e72c193d5f23b1790343ef?s=52&#038;d=mm&#038;r=g 2x' class='avatar avatar-26 photo' height='26' width='26' /></a><div class="ab-sub-wrapper"><ul id="wp-admin-bar-user-actions" class="ab-submenu">
348
+ <li id="wp-admin-bar-user-info"><a class="ab-item" tabindex="-1" href="http://lnmp.dev/download-monitor/wp-admin/profile.php"><img alt='' src='http://2.gravatar.com/avatar/e16646b416e72c193d5f23b1790343ef?s=64&#038;d=mm&#038;r=g' srcset='http://2.gravatar.com/avatar/e16646b416e72c193d5f23b1790343ef?s=128&#038;d=mm&#038;r=g 2x' class='avatar avatar-64 photo' height='64' width='64' /><span class='display-name'>admin</span></a> </li>
349
+ <li id="wp-admin-bar-edit-profile"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-admin/profile.php">Edit My Profile</a> </li>
350
+ <li id="wp-admin-bar-logout"><a class="ab-item" href="http://lnmp.dev/download-monitor/wp-login.php?action=logout&#038;_wpnonce=73db673a22">Log Out</a> </li></ul></div> </li></ul> </div>
351
+ <a class="screen-reader-shortcut" href="http://lnmp.dev/download-monitor/wp-login.php?action=logout&#038;_wpnonce=73db673a22">Log Out</a>
352
+ </div>
353
+
354
+
355
+ <div id="wpbody" role="main">
356
+
357
+ <div id="wpbody-content" aria-label="Main content" tabindex="0">
358
+ <div id="screen-meta" class="metabox-prefs">
359
+
360
+ <div id="contextual-help-wrap" class="hidden no-sidebar" tabindex="-1" aria-label="Contextual Help Tab">
361
+ <div id="contextual-help-back"></div>
362
+ <div id="contextual-help-columns">
363
+ <div class="contextual-help-tabs">
364
+ <ul>
365
+ </ul>
366
+ </div>
367
+
368
+
369
+ <div class="contextual-help-tabs-wrap">
370
+ </div>
371
+ </div>
372
+ </div>
373
+ </div>
374
+ <div class="wrap">
375
+ <h1>Download Monitor - Legacy Upgrade</h1><br/>
376
+ <p>Welcome to the Download Monitor Legacy Upgrader. On this page we will upgrade your old Download Monitor (legacy) data so it will work with the latest version. If you're on this page, it should mean that you updated to this version from Download Monitor <strong>3.x</strong>. If you're unsure if this is correct, or you want to read more about the legacy upgrade, we've setup a page that will explain this process in a lot more detail. <a href='https://www.download-monitor.com/kb/legacy-upgrade' target='_blank'>Click here</a> if to view that page.</p>
377
+
378
+ <div id="dlm-legacy-upgrade-container" style="position:relative;"></div>
379
+ </div>
380
+
381
+ <div class="clear"></div></div><!-- wpbody-content -->
382
+ <div class="clear"></div></div><!-- wpbody -->
383
+ <div class="clear"></div></div><!-- wpcontent -->
384
+
385
+ <div id="wpfooter" role="contentinfo">
386
+ <p id="footer-left" class="alignleft">
387
+ <span id="footer-thankyou">Thank you for creating with <a href="https://wordpress.org/">WordPress</a>.</span> </p>
388
+ <p id="footer-upgrade" class="alignright">
389
+ Version 4.9 </p>
390
+ <div class="clear"></div>
391
+ </div>
392
+ <div id="wp-auth-check-wrap" class="hidden">
393
+ <div id="wp-auth-check-bg"></div>
394
+ <div id="wp-auth-check">
395
+ <button type="button" class="wp-auth-check-close button-link"><span class="screen-reader-text">Close dialog</span></button>
396
+ <div id="wp-auth-check-form" class="loading" data-src="http://lnmp.dev/download-monitor/wp-login.php?interim-login=1&#038;wp_lang=en_US"></div>
397
+ <div class="wp-auth-fallback">
398
+ <p><b class="wp-auth-fallback-expired" tabindex="0">Session expired</b></p>
399
+ <p><a href="http://lnmp.dev/download-monitor/wp-login.php" target="_blank">Please log in again.</a>
400
+ The login page will open in a new window. After logging in you can close it and return to this page.</p>
401
+ </div>
402
+ </div>
403
+ </div>
404
+
405
+
406
+ <div class="clear"></div></div><!-- wpwrap -->
407
+ </body>
408
+ </html>
assets/js/legacy-upgrader/src/index.js CHANGED
@@ -1,20 +1,20 @@
1
- // import 'promise-polyfill';
2
- // import 'isomorphic-fetch';
3
- import { h, render } from 'preact';
4
- import './style';
5
-
6
- let root;
7
- function DLM_LU_init() {
8
- let App = require('./components/app').default;
9
- root = render(<App />, document.getElementById("dlm-legacy-upgrade-container"), root);
10
- }
11
-
12
- // in development, set up HMR:
13
- if (module.hot) {
14
- //require('preact/devtools'); // turn this on if you want to enable React DevTools!
15
- module.hot.accept('./components/app', () => requestAnimationFrame(init) );
16
- }
17
-
18
- document.addEventListener("DOMContentLoaded", function(event) {
19
- DLM_LU_init();
20
- });
1
+ // import 'promise-polyfill';
2
+ // import 'isomorphic-fetch';
3
+ import { h, render } from 'preact';
4
+ import './style';
5
+
6
+ let root;
7
+ function DLM_LU_init() {
8
+ let App = require('./components/app').default;
9
+ root = render(<App />, document.getElementById("dlm-legacy-upgrade-container"), root);
10
+ }
11
+
12
+ // in development, set up HMR:
13
+ if (module.hot) {
14
+ //require('preact/devtools'); // turn this on if you want to enable React DevTools!
15
+ module.hot.accept('./components/app', () => requestAnimationFrame(init) );
16
+ }
17
+
18
+ document.addEventListener("DOMContentLoaded", function(event) {
19
+ DLM_LU_init();
20
+ });
assets/js/legacy-upgrader/src/style/helpers.less CHANGED
@@ -1,20 +1,20 @@
1
- @import 'variables';
2
- @import 'mixins';
3
-
4
- .iconbefore( @glyph: "\f333" ) {
5
- font-family: dashicons !important;
6
- speak: none;
7
- font-weight: normal;
8
- font-variant: normal;
9
- text-transform: none;
10
- -webkit-font-smoothing: antialiased;
11
- -moz-osx-font-smoothing: grayscale;
12
- margin: 0 4px 0 0;
13
- content: @glyph;
14
- top: 1px;
15
- left: -1px;
16
- font-size: 1em;
17
- line-height: inherit;
18
- position: relative;
19
- vertical-align: top;
20
  }
1
+ @import 'variables';
2
+ @import 'mixins';
3
+
4
+ .iconbefore( @glyph: "\f333" ) {
5
+ font-family: dashicons !important;
6
+ speak: none;
7
+ font-weight: normal;
8
+ font-variant: normal;
9
+ text-transform: none;
10
+ -webkit-font-smoothing: antialiased;
11
+ -moz-osx-font-smoothing: grayscale;
12
+ margin: 0 4px 0 0;
13
+ content: @glyph;
14
+ top: 1px;
15
+ left: -1px;
16
+ font-size: 1em;
17
+ line-height: inherit;
18
+ position: relative;
19
+ vertical-align: top;
20
  }
assets/js/legacy-upgrader/src/style/index.less CHANGED
@@ -1,6 +1,6 @@
1
- @import 'helpers';
2
-
3
- #dlm_legacy_upgrader_app {
4
- height: 100%;
5
- box-sizing: border-box;
6
- }
1
+ @import 'helpers';
2
+
3
+ #dlm_legacy_upgrader_app {
4
+ height: 100%;
5
+ box-sizing: border-box;
6
+ }
assets/js/legacy-upgrader/src/style/mixins.less CHANGED
@@ -1,18 +1,18 @@
1
- .fill() {
2
- position: absolute;
3
- left: 0;
4
- top: 0;
5
- width: 100%;
6
- height: 100%;
7
- }
8
-
9
- .scroll() {
10
- overflow: auto;
11
- overflow-scrolling: touch;
12
-
13
- & > .inner {
14
- position: relative;
15
- transform: translateZ(0);
16
- overflow: hidden;
17
- }
18
- }
1
+ .fill() {
2
+ position: absolute;
3
+ left: 0;
4
+ top: 0;
5
+ width: 100%;
6
+ height: 100%;
7
+ }
8
+
9
+ .scroll() {
10
+ overflow: auto;
11
+ overflow-scrolling: touch;
12
+
13
+ & > .inner {
14
+ position: relative;
15
+ transform: translateZ(0);
16
+ overflow: hidden;
17
+ }
18
+ }
assets/js/legacy-upgrader/src/style/variables.less CHANGED
@@ -1,5 +1,5 @@
1
- @red: #F00;
2
- @blue: #00F;
3
- @white: #FFF;
4
- @gray: #999;
5
- @black: #000;
1
+ @red: #F00;
2
+ @blue: #00F;
3
+ @white: #FFF;
4
+ @gray: #999;
5
+ @black: #000;
assets/js/legacy-upgrader/webpack.config.babel.js CHANGED
@@ -1,184 +1,184 @@
1
- import webpack from 'webpack';
2
- import ExtractTextPlugin from 'extract-text-webpack-plugin';
3
- import HtmlWebpackPlugin from 'html-webpack-plugin';
4
- import autoprefixer from 'autoprefixer';
5
- import path from 'path';
6
- const ENV = process.env.NODE_ENV || 'development';
7
-
8
- const CSS_MAPS = ENV!=='production';
9
-
10
- module.exports = {
11
- context: path.resolve(__dirname, "src"),
12
- entry: './index.js',
13
-
14
- output: {
15
- path: path.resolve(__dirname, "build"),
16
- publicPath: '/',
17
- filename: 'bundle.js'
18
- },
19
-
20
- resolve: {
21
- extensions: ['.jsx', '.js', '.json', '.less'],
22
- modules: [
23
- path.resolve(__dirname, "src/lib"),
24
- path.resolve(__dirname, "node_modules"),
25
- 'node_modules'
26
- ],
27
- alias: {
28
- components: path.resolve(__dirname, "src/components"), // used for tests
29
- style: path.resolve(__dirname, "src/style"),
30
- 'react': 'preact-compat',
31
- 'react-dom': 'preact-compat'
32
- }
33
- },
34
-
35
- module: {
36
- rules: [
37
- {
38
- test: /\.jsx?$/,
39
- exclude: path.resolve(__dirname, 'src'),
40
- enforce: 'pre',
41
- use: 'source-map-loader'
42
- },
43
- {
44
- test: /\.jsx?$/,
45
- exclude: /node_modules/,
46
- use: 'babel-loader'
47
- },
48
- {
49
- // Transform our own .(less|css) files with PostCSS and CSS-modules
50
- test: /\.(less|css)$/,
51
- include: [path.resolve(__dirname, 'src/components')],
52
- use: ExtractTextPlugin.extract({
53
- fallback: 'style-loader',
54
- use: [
55
- {
56
- loader: 'css-loader',
57
- options: { modules: true, sourceMap: CSS_MAPS, importLoaders: 1, minimize: true }
58
- },
59
- {
60
- loader: `postcss-loader`,
61
- options: {
62
- sourceMap: CSS_MAPS,
63
- plugins: () => {
64
- autoprefixer({ browsers: [ 'last 2 versions' ] });
65
- }
66
- }
67
- },
68
- {
69
- loader: 'less-loader',
70
- options: { sourceMap: CSS_MAPS }
71
- }
72
- ]
73
- })
74
- },
75
- {
76
- test: /\.(less|css)$/,
77
- exclude: [path.resolve(__dirname, 'src/components')],
78
- use: ExtractTextPlugin.extract({
79
- fallback: 'style-loader',
80
- use: [
81
- {
82
- loader: 'css-loader',
83
- options: { sourceMap: CSS_MAPS, importLoaders: 1, minimize: true }
84
- },
85
- {
86
- loader: `postcss-loader`,
87
- options: {
88
- sourceMap: CSS_MAPS,
89
- plugins: () => {
90
- autoprefixer({ browsers: [ 'last 2 versions' ] });
91
- }
92
- }
93
- },
94
- {
95
- loader: 'less-loader',
96
- options: { sourceMap: CSS_MAPS }
97
- }
98
- ]
99
- })
100
- },
101
- {
102
- test: /\.json$/,
103
- use: 'json-loader'
104
- },
105
- {
106
- test: /\.(xml|html|txt|md)$/,
107
- use: 'raw-loader'
108
- },
109
- {
110
- test: /\.(svg|woff2?|ttf|eot|jpe?g|png|gif)(\?.*)?$/i,
111
- use: ENV==='production' ? 'file-loader' : 'url-loader'
112
- }
113
- ]
114
- },
115
- plugins: ([
116
- new webpack.NoEmitOnErrorsPlugin(),
117
- new ExtractTextPlugin({
118
- filename: 'style.css',
119
- allChunks: true,
120
- disable: ENV !== 'production'
121
- }),
122
- new webpack.DefinePlugin({
123
- 'process.env.NODE_ENV': JSON.stringify(ENV)
124
- }),
125
- new HtmlWebpackPlugin({
126
- template: './index.ejs',
127
- minify: { collapseWhitespace: true }
128
- })
129
- ]).concat(ENV==='production' ? [
130
- new webpack.optimize.UglifyJsPlugin({
131
- output: {
132
- comments: false
133
- },
134
- compress: {
135
- unsafe_comps: true,
136
- properties: true,
137
- keep_fargs: false,
138
- pure_getters: true,
139
- collapse_vars: true,
140
- unsafe: true,
141
- warnings: false,
142
- screw_ie8: true,
143
- sequences: true,
144
- dead_code: true,
145
- drop_debugger: true,
146
- comparisons: true,
147
- conditionals: true,
148
- evaluate: true,
149
- booleans: true,
150
- loops: true,
151
- unused: true,
152
- hoist_funs: true,
153
- if_return: true,
154
- join_vars: true,
155
- cascade: true,
156
- drop_console: true
157
- }
158
- })
159
- ] : []),
160
-
161
- stats: { colors: true },
162
-
163
- node: {
164
- global: true,
165
- process: false,
166
- Buffer: false,
167
- __filename: false,
168
- __dirname: false,
169
- setImmediate: false
170
- },
171
-
172
- devtool: ENV==='production' ? 'source-map' : 'cheap-module-eval-source-map',
173
-
174
- devServer: {
175
- inline: true,
176
- port: 1337,
177
- host: 'lnmp.dev',
178
- publicPath: '/',
179
- contentBase: './src',
180
- historyApiFallback: true,
181
- open: true,
182
- openPage: ''
183
- }
184
- };
1
+ import webpack from 'webpack';
2
+ import ExtractTextPlugin from 'extract-text-webpack-plugin';
3
+ import HtmlWebpackPlugin from 'html-webpack-plugin';
4
+ import autoprefixer from 'autoprefixer';
5
+ import path from 'path';
6
+ const ENV = process.env.NODE_ENV || 'development';
7
+
8
+ const CSS_MAPS = ENV!=='production';
9
+
10
+ module.exports = {
11
+ context: path.resolve(__dirname, "src"),
12
+ entry: './index.js',
13
+
14
+ output: {
15
+ path: path.resolve(__dirname, "build"),
16
+ publicPath: '/',
17
+ filename: 'bundle.js'
18
+ },
19
+
20
+ resolve: {
21
+ extensions: ['.jsx', '.js', '.json', '.less'],
22
+ modules: [
23
+ path.resolve(__dirname, "src/lib"),
24
+ path.resolve(__dirname, "node_modules"),
25
+ 'node_modules'
26
+ ],
27
+ alias: {
28
+ components: path.resolve(__dirname, "src/components"), // used for tests
29
+ style: path.resolve(__dirname, "src/style"),
30
+ 'react': 'preact-compat',
31
+ 'react-dom': 'preact-compat'
32
+ }
33
+ },
34
+
35
+ module: {
36
+ rules: [
37
+ {
38
+ test: /\.jsx?$/,
39
+ exclude: path.resolve(__dirname, 'src'),
40
+ enforce: 'pre',
41
+ use: 'source-map-loader'
42
+ },
43
+ {
44
+ test: /\.jsx?$/,
45
+ exclude: /node_modules/,
46
+ use: 'babel-loader'
47
+ },
48
+ {
49
+ // Transform our own .(less|css) files with PostCSS and CSS-modules
50
+ test: /\.(less|css)$/,
51
+ include: [path.resolve(__dirname, 'src/components')],
52
+ use: ExtractTextPlugin.extract({
53
+ fallback: 'style-loader',
54
+ use: [
55
+ {
56
+ loader: 'css-loader',
57
+ options: { modules: true, sourceMap: CSS_MAPS, importLoaders: 1, minimize: true }
58
+ },
59
+ {
60
+ loader: `postcss-loader`,
61
+ options: {
62
+ sourceMap: CSS_MAPS,
63
+ plugins: () => {
64
+ autoprefixer({ browsers: [ 'last 2 versions' ] });
65
+ }
66
+ }
67
+ },
68
+ {
69
+ loader: 'less-loader',
70
+ options: { sourceMap: CSS_MAPS }
71
+ }
72
+ ]
73
+ })
74
+ },
75
+ {
76
+ test: /\.(less|css)$/,
77
+ exclude: [path.resolve(__dirname, 'src/components')],
78
+ use: ExtractTextPlugin.extract({
79
+ fallback: 'style-loader',
80
+ use: [
81
+ {
82
+ loader: 'css-loader',
83
+ options: { sourceMap: CSS_MAPS, importLoaders: 1, minimize: true }
84
+ },
85
+ {
86
+ loader: `postcss-loader`,
87
+ options: {
88
+ sourceMap: CSS_MAPS,
89
+ plugins: () => {
90
+ autoprefixer({ browsers: [ 'last 2 versions' ] });
91
+ }
92
+ }
93
+ },
94
+ {
95
+ loader: 'less-loader',
96
+ options: { sourceMap: CSS_MAPS }
97
+ }
98
+ ]
99
+ })
100
+ },
101
+ {
102
+ test: /\.json$/,
103
+ use: 'json-loader'
104
+ },
105
+ {
106
+ test: /\.(xml|html|txt|md)$/,
107
+ use: 'raw-loader'
108
+ },
109
+ {
110
+ test: /\.(svg|woff2?|ttf|eot|jpe?g|png|gif)(\?.*)?$/i,
111
+ use: ENV==='production' ? 'file-loader' : 'url-loader'
112
+ }
113
+ ]
114
+ },
115
+ plugins: ([
116
+ new webpack.NoEmitOnErrorsPlugin(),
117
+ new ExtractTextPlugin({
118
+ filename: 'style.css',
119
+ allChunks: true,
120
+ disable: ENV !== 'production'
121
+ }),
122
+ new webpack.DefinePlugin({
123
+ 'process.env.NODE_ENV': JSON.stringify(ENV)
124
+ }),
125
+ new HtmlWebpackPlugin({
126
+ template: './index.ejs',
127
+ minify: { collapseWhitespace: true }
128
+ })
129
+ ]).concat(ENV==='production' ? [
130
+ new webpack.optimize.UglifyJsPlugin({
131
+ output: {
132
+ comments: false
133
+ },
134
+ compress: {
135
+ unsafe_comps: true,
136
+ properties: true,
137
+ keep_fargs: false,
138
+ pure_getters: true,
139
+ collapse_vars: true,
140
+ unsafe: true,
141
+ warnings: false,
142
+ screw_ie8: true,
143
+ sequences: true,
144
+ dead_code: true,
145
+ drop_debugger: true,
146
+ comparisons: true,
147
+ conditionals: true,
148
+ evaluate: true,
149
+ booleans: true,
150
+ loops: true,
151
+ unused: true,
152
+ hoist_funs: true,
153
+ if_return: true,
154
+ join_vars: true,
155
+ cascade: true,
156
+ drop_console: true
157
+ }
158
+ })
159
+ ] : []),
160
+
161
+ stats: { colors: true },
162
+
163
+ node: {
164
+ global: true,
165
+ process: false,
166
+ Buffer: false,
167
+ __filename: false,
168
+ __dirname: false,
169
+ setImmediate: false
170
+ },
171
+
172
+ devtool: ENV==='production' ? 'source-map' : 'cheap-module-eval-source-map',
173
+
174
+ devServer: {
175
+ inline: true,
176
+ port: 1337,
177
+ host: 'lnmp.dev',
178
+ publicPath: '/',
179
+ contentBase: './src',
180
+ historyApiFallback: true,
181
+ open: true,
182
+ openPage: ''
183
+ }
184
+ };
assets/js/notices.js CHANGED
@@ -1,21 +1,21 @@
1
- jQuery( function ( $ ) {
2
-
3
- $( '.dlm-notice.is-dismissible' ).on( 'click', '.notice-dismiss', function ( event ) {
4
- //$( '#dlm-ajax-nonce' ).val()
5
- var notice_el = $( this ).closest( '.dlm-notice' );
6
-
7
- var notice = notice_el.attr( 'id' );
8
- var notice_nonce = notice_el.attr( 'data-nonce' );
9
- $.post(
10
- ajaxurl,
11
- {
12
- action: 'dlm_dismiss_notice',
13
- nonce: notice_nonce,
14
- notice: notice
15
- },
16
- function ( response ) {
17
- }
18
- )
19
- } );
20
-
21
  } );
1
+ jQuery( function ( $ ) {
2
+
3
+ $( '.dlm-notice.is-dismissible' ).on( 'click', '.notice-dismiss', function ( event ) {
4
+ //$( '#dlm-ajax-nonce' ).val()
5
+ var notice_el = $( this ).closest( '.dlm-notice' );
6
+
7
+ var notice = notice_el.attr( 'id' );
8
+ var notice_nonce = notice_el.attr( 'data-nonce' );
9
+ $.post(
10
+ ajaxurl,
11
+ {
12
+ action: 'dlm_dismiss_notice',
13
+ nonce: notice_nonce,
14
+ notice: notice
15
+ },
16
+ function ( response ) {
17
+ }
18
+ )
19
+ } );
20
+
21
  } );
assets/js/onboarding.js CHANGED
@@ -1,70 +1,70 @@
1
- jQuery( function ( $ ) {
2
-
3
- $.each( $( '.dlm-create-page' ), function ( k, v ) {
4
- new DLM_Onboarding_CP( v );
5
- } );
6
-
7
- /*
8
- $('.dlm-create-page').click(function() {
9
-
10
- var page = $(this).data('page');
11
-
12
- $(this).html(dlm_onboarding.lbl_creating);
13
-
14
- // set loading
15
-
16
- // do ajax request
17
-
18
- // check response
19
-
20
- // if success, change button to green with checkmark
21
-
22
- });
23
- */
24
- } );
25
-
26
- var DLM_Onboarding_CP = function ( el ) {
27
- this.el = el;
28
- this.page = jQuery( el ).data( 'page' );
29
- this.allowAction = true;
30
- this.setup();
31
- };
32
-
33
- DLM_Onboarding_CP.prototype.setup = function () {
34
- var instance = this;
35
- jQuery( this.el ).click( function () {
36
- instance.process();
37
- } );
38
- };
39
-
40
- DLM_Onboarding_CP.prototype.process = function () {
41
- if ( !this.allowAction ) {
42
- return false;
43
- }
44
-
45
- this.allowAction = false;
46
-
47
- var instance = this;
48
-
49
- jQuery( instance.el ).html( dlm_onboarding.lbl_creating );
50
-
51
- jQuery.get( dlm_onboarding.ajax_url_create_page, {
52
- page: this.page
53
- }, function ( response ) {
54
- if ( response.result === 'success' ) {
55
- jQuery( instance.el ).html( dlm_onboarding.lbl_created );
56
- jQuery( instance.el ).removeClass( 'dlm-create-page' ).addClass( 'dlm-page-exists' );
57
- } else {
58
- jQuery( instance.el ).html( dlm_onboarding.lbl_create_page );
59
-
60
- if ( typeof response.error !== 'undefined' ) {
61
- alert( response.error );
62
- }
63
-
64
- instance.allowAction = true;
65
- }
66
-
67
- console.log( response );
68
- } );
69
-
70
  };
1
+ jQuery( function ( $ ) {
2
+
3
+ $.each( $( '.dlm-create-page' ), function ( k, v ) {
4
+ new DLM_Onboarding_CP( v );
5
+ } );
6
+
7
+ /*
8
+ $('.dlm-create-page').click(function() {
9
+
10
+ var page = $(this).data('page');
11
+
12
+ $(this).html(dlm_onboarding.lbl_creating);
13
+
14
+ // set loading
15
+
16
+ // do ajax request
17
+
18
+ // check response
19
+
20
+ // if success, change button to green with checkmark
21
+
22
+ });
23
+ */
24
+ } );
25
+
26
+ var DLM_Onboarding_CP = function ( el ) {
27
+ this.el = el;
28
+ this.page = jQuery( el ).data( 'page' );
29
+ this.allowAction = true;
30
+ this.setup();
31
+ };
32
+
33
+ DLM_Onboarding_CP.prototype.setup = function () {
34
+ var instance = this;
35
+ jQuery( this.el ).click( function () {
36
+ instance.process();
37
+ } );
38
+ };
39
+
40
+ DLM_Onboarding_CP.prototype.process = function () {
41
+ if ( !this.allowAction ) {
42
+ return false;
43
+ }
44
+
45
+ this.allowAction = false;
46
+
47
+ var instance = this;
48
+
49
+ jQuery( instance.el ).html( dlm_onboarding.lbl_creating );
50
+
51
+ jQuery.get( dlm_onboarding.ajax_url_create_page, {
52
+ page: this.page
53
+ }, function ( response ) {
54
+ if ( response.result === 'success' ) {
55
+ jQuery( instance.el ).html( dlm_onboarding.lbl_created );
56
+ jQuery( instance.el ).removeClass( 'dlm-create-page' ).addClass( 'dlm-page-exists' );
57
+ } else {
58
+ jQuery( instance.el ).html( dlm_onboarding.lbl_create_page );
59
+
60
+ if ( typeof response.error !== 'undefined' ) {
61
+ alert( response.error );
62
+ }
63
+
64
+ instance.allowAction = true;
65
+ }
66
+
67
+ console.log( response );
68
+ } );
69
+
70
  };
assets/js/overview-download.js CHANGED
@@ -1,39 +1,39 @@
1
- (function ( $ ) {
2
-
3
- // we create a copy of the WP inline edit post function
4
- var $wp_inline_edit = inlineEditPost.edit;
5
-
6
- // and then we overwrite the function with our own code
7
- inlineEditPost.edit = function ( id ) {
8
-
9
- // "call" the original WP edit function
10
- // we don't want to leave WordPress hanging
11
- $wp_inline_edit.apply( this, arguments );
12
-
13
- // now we take care of our business
14
-
15
- // get the post ID
16
- var $post_id = 0;
17
- if ( typeof( id ) == 'object' ) {
18
- $post_id = parseInt( this.getId( id ) );
19
- }
20
-
21
- if ( $post_id > 0 ) {
22
-
23
- // define rows
24
- var $edit_row = $( '#edit-' + $post_id );
25
- var $post_row = $( '#post-' + $post_id );
26
-
27
- // get data
28
- var featured = ('Yes' == $( '.column-featured', $post_row ).text() );
29
- var members_only = ('Yes' == $( '.column-members_only', $post_row ).text() );
30
- var redirect_only = ('Yes' == $( '.column-redirect_only', $post_row ).text() );
31
-
32
- // populate data
33
- $( ':input[name="_featured"]', $edit_row ).prop( 'checked', featured );
34
- $( ':input[name="_members_only"]', $edit_row ).prop( 'checked', members_only );
35
- $( ':input[name="_redirect_only"]', $edit_row ).prop( 'checked', redirect_only );
36
- }
37
- };
38
-
39
  })( jQuery );
1
+ (function ( $ ) {
2
+
3
+ // we create a copy of the WP inline edit post function
4
+ var $wp_inline_edit = inlineEditPost.edit;
5
+
6
+ // and then we overwrite the function with our own code
7
+ inlineEditPost.edit = function ( id ) {
8
+
9
+ // "call" the original WP edit function
10
+ // we don't want to leave WordPress hanging
11
+ $wp_inline_edit.apply( this, arguments );
12
+
13
+ // now we take care of our business
14
+
15
+ // get the post ID
16
+ var $post_id = 0;
17
+ if ( typeof( id ) == 'object' ) {
18
+ $post_id = parseInt( this.getId( id ) );
19
+ }
20
+
21
+ if ( $post_id > 0 ) {
22
+
23
+ // define rows
24
+ var $edit_row = $( '#edit-' + $post_id );
25
+ var $post_row = $( '#post-' + $post_id );
26
+
27
+ // get data
28
+ var featured = ('Yes' == $( '.column-featured', $post_row ).text() );
29
+ var members_only = ('Yes' == $( '.column-members_only', $post_row ).text() );
30
+ var redirect_only = ('Yes' == $( '.column-redirect_only', $post_row ).text() );
31
+
32
+ // populate data
33
+ $( ':input[name="_featured"]', $edit_row ).prop( 'checked', featured );
34
+ $( ':input[name="_members_only"]', $edit_row ).prop( 'checked', members_only );
35
+ $( ':input[name="_redirect_only"]', $edit_row ).prop( 'checked', redirect_only );
36
+ }
37
+ };
38
+
39
  })( jQuery );
assets/js/select2/select2.min.css CHANGED
@@ -1 +1 @@
1
- .select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{color:#999;margin-top:5px;float:left}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb}
1
+ .select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{color:#999;margin-top:5px;float:left}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb}
assets/js/shop/admin-order-details.js CHANGED
@@ -1,46 +1,46 @@
1
- jQuery( function ( $ ) {
2
-
3
- function handleChangeOrderAction() {
4
- var button = $("#dlm-order-details-button-change-state");
5
- var ogLbl = button.html();
6
- var isWorking = false;
7
- var successBlock = null;
8
-
9
- button.click(function(){
10
- if(isWorking) {
11
- return;
12
- }
13
- isWorking = true;
14
- button.html('...');
15
-
16
- var new_status = $("#dlm-order-details-current-state").val();
17
-
18
- $.post( dlm_strings.ajax_url_change_order_status, {
19
- status: new_status,
20
- order_id: dlm_strings.order_id
21
- }, function ( response ) {
22
- if ( response.success === true ) {
23
- button.html(ogLbl);
24
- isWorking = false;
25
- if(successBlock === null) {
26
- successBlock = $("<span>").addClass("dlm-order-details-update-successful").html("✓");
27
- button.parent().append(successBlock);
28
- setTimeout(
29
- function() {
30
- successBlock.fadeOut(300, function(){
31
- successBlock.remove();
32
- successBlock = null;
33
- });
34
- }, 300
35
- );
36
- }
37
-
38
- }
39
- } );
40
-
41
- });
42
- }
43
-
44
- handleChangeOrderAction();
45
-
46
  } );
1
+ jQuery( function ( $ ) {
2
+
3
+ function handleChangeOrderAction() {
4
+ var button = $("#dlm-order-details-button-change-state");
5
+ var ogLbl = button.html();
6
+ var isWorking = false;
7
+ var successBlock = null;
8
+
9
+ button.click(function(){
10
+ if(isWorking) {
11
+ return;
12
+ }
13
+ isWorking = true;
14
+ button.html('...');
15
+
16
+ var new_status = $("#dlm-order-details-current-state").val();
17
+
18
+ $.post( dlm_strings.ajax_url_change_order_status, {
19
+ status: new_status,
20
+ order_id: dlm_strings.order_id
21
+ }, function ( response ) {
22
+ if ( response.success === true ) {
23
+ button.html(ogLbl);
24
+ isWorking = false;
25
+ if(successBlock === null) {
26
+ successBlock = $("<span>").addClass("dlm-order-details-update-successful").html("✓");
27
+ button.parent().append(successBlock);
28
+ setTimeout(
29
+ function() {
30
+ successBlock.fadeOut(300, function(){
31
+ successBlock.remove();
32
+ successBlock = null;
33
+ });
34
+ }, 300
35
+ );
36
+ }
37
+
38
+ }
39
+ } );
40
+
41
+ });
42
+ }
43
+
44
+ handleChangeOrderAction();
45
+
46
  } );
assets/js/shop/checkout.js CHANGED
@@ -1,127 +1,127 @@
1
- jQuery( function ( $ ) {
2
-
3
- $( '#dlm-form-checkout' ).submit( function ( e ) {
4
-
5
- var form = $( this );
6
-
7
- dlmShopResetErrorFields( form );
8
- dlmShopRemoveErrors( form );
9
-
10
- dlmShopShowLoading( form );
11
-
12
- var customer = {
13
- first_name: form.find( '#dlm_first_name' ).val(),
14
- last_name: form.find( '#dlm_last_name' ).val(),
15
- company: form.find( '#dlm_company' ).val(),
16
- email: form.find( '#dlm_email' ).val(),
17
- address_1: form.find( '#dlm_address_1' ).val(),
18
- postcode: form.find( '#dlm_postcode' ).val(),
19
- city: form.find( '#dlm_city' ).val(),
20
- country: form.find( '#dlm_country' ).val(),
21
- };
22
-
23
- var data = {
24
- payment_gateway: $( 'input[name=dlm_gateway]:checked', $( this ) ).val(),
25
- customer: customer
26
- };
27
-
28
- if ( typeof form.data( 'order_id' ) !== "undefined" ) {
29
- data.order_id = form.data( 'order_id' );
30
- }
31
-
32
- if ( typeof form.data( 'order_hash' ) !== "undefined" ) {
33
- data.order_hash = form.data( 'order_hash' );
34
- }
35
-
36
- // check if required data is set
37
- var errorFields = [];
38
- var success = true;
39
- for ( var i = 0; i < dlm_strings.required_fields.length; i ++ ) {
40
-
41
- if ( customer[dlm_strings.required_fields[i]] === "" ) {
42
- success = false;
43
- errorFields.push( dlm_strings.required_fields[i] );
44
- }
45
- }
46
-
47
- if ( success === false ) {
48
- dlmShopMarkErrorFields( form, errorFields );
49
-
50
- dlmShopDisplayError( form, dlm_strings.error_message_required_fields );
51
-
52
- dlmShopHideLoading( form );
53
- return false;
54
- }
55
-
56
- $.post( dlm_strings.ajax_url_place_order, data, function ( response ) {
57
- if ( response.success === true && typeof response.redirect !== 'undefined' ) {
58
- window.location.replace( response.redirect );
59
- return false;
60
- } else if ( response.success === false && response.error !== '' ) {
61
- dlmShopDisplayError( form, response.error );
62
- }
63
- dlmShopHideLoading( form );
64
- } );
65
-
66
- return false;
67
- } );
68
-
69
- function dlmShopMarkErrorFields( form, fields ) {
70
- for ( var i = 0; i < fields.length; i ++ ) {
71
- $( form ).find( '#dlm_' + fields[i] ).addClass( 'dlm-checkout-field-error' );
72
- }
73
- }
74
-
75
- function dlmShopResetErrorFields( form ) {
76
- $( form ).find( '.dlm-checkout-field-error' ).removeClass( 'dlm-checkout-field-error' );
77
- }
78
-
79
- function dlmShopDisplayError( form, errorMessage ) {
80
- var errorContainer = $( '<div>' ).addClass( "dlm-checkout-error" );
81
- errorContainer.append( $( '<img>' ).attr( 'src', dlm_strings.icon_error ).attr( 'alt', 'Checkout error' ).addClass( 'dlm-checkout-error-icon' ) );
82
- errorContainer.append( $( '<p>' ).html( errorMessage ) );
83
- form.prepend( errorContainer );
84
- }
85
-
86
- function dlmShopRemoveErrors( form ) {
87
- form.find( '.dlm-checkout-error' ).remove();
88
- }
89
-
90
- function dlmShopShowLoading( form ) {
91
- $( form ).find( '#dlm_checkout_submit' ).attr( 'disabled', true );
92
-
93
- var overlayBg = $( '<div>' ).addClass( 'dlm-checkout-overlay-bg' );
94
-
95
- var overlay = $( '<div>' ).addClass( 'dlm-checkout-overlay' );
96
- overlay.append( $( '<h2>' ).html( dlm_strings.overlay_title ) );
97
- overlay.append( $( '<span>' ).html( dlm_strings.overlay_body ) );
98
- overlay.append( $( '<img>' ).attr( 'src', dlm_strings.overlay_img_src ) );
99
-
100
- $( 'body' ).append( overlayBg );
101
- $( 'body' ).append( overlay );
102
-
103
- overlayBg.fadeIn( 300, function () {
104
- overlay.css( 'display', 'block' ).css( 'top', '47%' );
105
- overlay.animate( {
106
- "top": "+=3%"
107
- }, 300 );
108
- } );
109
- }
110
-
111
- function dlmShopHideLoading( form ) {
112
-
113
- var overlay = $( '.dlm-checkout-overlay:first' );
114
- var overlayBg = $( '.dlm-checkout-overlay-bg:first' );
115
-
116
- overlay.fadeOut( 300, function () {
117
- overlay.remove();
118
- } );
119
-
120
- overlayBg.fadeOut( 300, function () {
121
- overlayBg.remove();
122
- $( form ).find( '#dlm_checkout_submit' ).attr( 'disabled', false );
123
- } );
124
- }
125
- } );
126
-
127
-
1
+ jQuery( function ( $ ) {
2
+
3
+ $( '#dlm-form-checkout' ).submit( function ( e ) {
4
+
5
+ var form = $( this );
6
+
7
+ dlmShopResetErrorFields( form );
8
+ dlmShopRemoveErrors( form );
9
+
10
+ dlmShopShowLoading( form );
11
+
12
+ var customer = {
13
+ first_name: form.find( '#dlm_first_name' ).val(),
14
+ last_name: form.find( '#dlm_last_name' ).val(),
15
+ company: form.find( '#dlm_company' ).val(),
16
+ email: form.find( '#dlm_email' ).val(),
17
+ address_1: form.find( '#dlm_address_1' ).val(),
18
+ postcode: form.find( '#dlm_postcode' ).val(),
19
+ city: form.find( '#dlm_city' ).val(),
20
+ country: form.find( '#dlm_country' ).val(),
21
+ };
22
+
23
+ var data = {
24
+ payment_gateway: $( 'input[name=dlm_gateway]:checked', $( this ) ).val(),
25
+ customer: customer
26
+ };
27
+
28
+ if ( typeof form.data( 'order_id' ) !== "undefined" ) {
29
+ data.order_id = form.data( 'order_id' );
30
+ }
31
+
32
+ if ( typeof form.data( 'order_hash' ) !== "undefined" ) {
33
+ data.order_hash = form.data( 'order_hash' );
34
+ }
35
+
36
+ // check if required data is set
37
+ var errorFields = [];
38
+ var success = true;
39
+ for ( var i = 0; i < dlm_strings.required_fields.length; i ++ ) {
40
+
41
+ if ( customer[dlm_strings.required_fields[i]] === "" ) {
42
+ success = false;
43
+ errorFields.push( dlm_strings.required_fields[i] );
44
+ }
45
+ }
46
+
47
+ if ( success === false ) {
48
+ dlmShopMarkErrorFields( form, errorFields );
49
+
50
+ dlmShopDisplayError( form, dlm_strings.error_message_required_fields );
51
+
52
+ dlmShopHideLoading( form );
53
+ return false;
54
+ }
55
+
56
+ $.post( dlm_strings.ajax_url_place_order, data, function ( response ) {
57
+ if ( response.success === true && typeof response.redirect !== 'undefined' ) {
58
+ window.location.replace( response.redirect );
59
+ return false;
60
+ } else if ( response.success === false && response.error !== '' ) {
61
+ dlmShopDisplayError( form, response.error );
62
+ }
63
+ dlmShopHideLoading( form );
64
+ } );
65
+
66
+ return false;
67
+ } );
68
+
69
+ function dlmShopMarkErrorFields( form, fields ) {
70
+ for ( var i = 0; i < fields.length; i ++ ) {
71
+ $( form ).find( '#dlm_' + fields[i] ).addClass( 'dlm-checkout-field-error' );
72
+ }
73
+ }
74
+
75
+ function dlmShopResetErrorFields( form ) {
76
+ $( form ).find( '.dlm-checkout-field-error' ).removeClass( 'dlm-checkout-field-error' );
77
+ }
78
+
79
+ function dlmShopDisplayError( form, errorMessage ) {
80
+ var errorContainer = $( '<div>' ).addClass( "dlm-checkout-error" );
81
+ errorContainer.append( $( '<img>' ).attr( 'src', dlm_strings.icon_error ).attr( 'alt', 'Checkout error' ).addClass( 'dlm-checkout-error-icon' ) );
82
+ errorContainer.append( $( '<p>' ).html( errorMessage ) );
83
+ form.prepend( errorContainer );
84
+ }
85
+
86
+ function dlmShopRemoveErrors( form ) {
87
+ form.find( '.dlm-checkout-error' ).remove();
88
+ }
89
+
90
+ function dlmShopShowLoading( form ) {
91
+ $( form ).find( '#dlm_checkout_submit' ).attr( 'disabled', true );
92
+
93
+ var overlayBg = $( '<div>' ).addClass( 'dlm-checkout-overlay-bg' );
94
+
95
+ var overlay = $( '<div>' ).addClass( 'dlm-checkout-overlay' );
96
+ overlay.append( $( '<h2>' ).html( dlm_strings.overlay_title ) );
97
+ overlay.append( $( '<span>' ).html( dlm_strings.overlay_body ) );
98
+ overlay.append( $( '<img>' ).attr( 'src', dlm_strings.overlay_img_src ) );
99
+
100
+ $( 'body' ).append( overlayBg );
101
+ $( 'body' ).append( overlay );
102
+
103
+ overlayBg.fadeIn( 300, function () {
104
+ overlay.css( 'display', 'block' ).css( 'top', '47%' );
105
+ overlay.animate( {
106
+ "top": "+=3%"
107
+ }, 300 );
108
+ } );
109
+ }
110
+
111
+ function dlmShopHideLoading( form ) {
112
+
113
+ var overlay = $( '.dlm-checkout-overlay:first' );
114
+ var overlayBg = $( '.dlm-checkout-overlay-bg:first' );
115
+
116
+ overlay.fadeOut( 300, function () {
117
+ overlay.remove();
118
+ } );
119
+
120
+ overlayBg.fadeOut( 300, function () {
121
+ overlayBg.remove();
122
+ $( form ).find( '#dlm_checkout_submit' ).attr( 'disabled', false );
123
+ } );
124
+ }
125
+ } );
126
+
127
+
assets/js/shop/edit-product.js CHANGED
@@ -1,3 +1,3 @@
1
- jQuery( function ( $ ) {
2
- $('.dlm-select-ext').select2();
3
  });
1
+ jQuery( function ( $ ) {
2
+ $('.dlm-select-ext').select2();
3
  });
assets/js/upload-file.js CHANGED
@@ -1,73 +1,66 @@
1
- jQuery( function ( $ ) {
2
- $('.dlm-metaboxes.downloadable_files').on('click', '.dlm_upload_file', function(e){
3
- e.preventDefault();
4
- button_elem = this;
5
- DLMopenFileDialog(dlm_selected_file);
6
 
7
- });
8
-
9
- function DLMopenFileDialog(callback) {
10
 
11
- // Create an input element
12
- var inputElement = document.createElement("input");
13
 
14
- // Set its type to file
15
- inputElement.type = "file";
16
 
17
- // set onchange event to call callback when user has selected file
18
- inputElement.addEventListener("change", callback)
 
 
 
 
 
 
 
 
19
 
20
- // dispatch a click event to open the file dialog
21
- inputElement.dispatchEvent(new MouseEvent("click"));
22
- }
23
 
24
- var dlm_selected_file = function DLMselectedFileAction( event ){
25
-
26
- [...this.files].forEach(file => {
27
- var formData = new FormData();
28
 
29
- formData.append("file", file, file.name);
30
- formData.append('action', 'dlm_upload_file');
31
 
32
- if ( max_file_size > file.size ){
33
- $.ajax({
34
- type: "POST",
35
- url: ajaxurl,
36
- success: function (data) {
37
 
38
- if( data.success == true ){
 
 
39
 
40
- var $el = $( button_elem );
41
- var $file_path_field = $el.parent().parent().find( '.downloadable_file_urls' );
42
- var file_paths = $file_path_field.val();
43
- file_paths = file_paths ? file_paths + "\n" + data.data.file_url : data.data.file_url;
44
- $file_path_field.val( file_paths );
45
- }else if( data.success == false ){
46
 
47
- var $el = $( button_elem );
48
- var $file_path_field = $el.parent().parent().find( '.downloadable_file_urls' );
49
- $file_path_field.parent().append('<div class="notice notice-error dlm-upload-notices"><p>' + data.data.errorMessage + '</p></div>');
50
- }
51
-
52
- },
53
- error: function () {
54
- var $el = $( button_elem );
55
- var $file_path_field = $el.parent().parent().find( '.downloadable_file_urls' );
56
- $file_path_field.parent().append('<div class="notice notice-error dlm-upload-notices"><p>An error occurred while uploading the file. Please try again.</p></div>');
57
  },
58
- async: true,
59
- data: formData,
60
- cache: false,
61
- contentType: false,
62
- processData: false,
63
- timeout: 60000
64
- });
65
- }else{
66
- $( ".dlm-upload-notices" ).remove();
67
- var $el = $( button_elem );
68
- var $file_path_field = $el.parent().parent().find( '.downloadable_file_urls' );
69
- $file_path_field.parent().append('<div class="notice notice-error dlm-upload-notices"><p>The file size exceeds the max_upload_file_size limit. Max: '+max_file_size+'</p></div>');
70
- }
71
  });
72
- }
73
- } );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(function ($) {
 
 
 
 
2
 
3
+ /**
4
+ * Set up the Media Uploader
5
+ */
6
 
7
+ let dlmUploadButtons = [];
8
+ $('.dlm_upload_file').each((index, element) => {
9
 
10
+ dlmUploadButtons.push($(element));
 
11
 
12
+ const dlmUploaderOptions = {
13
+ browser: $(element),
14
+ plupload: {
15
+ multi_selection: false,
16
+ },
17
+ params: {
18
+ type: 'dlm_download'
19
+ }
20
+ },
21
+ dlmUploader = new wp.Uploader(dlmUploaderOptions);
22
 
23
+ dlmUploader.uploader.bind('FileUploaded', dlmAddFileToPath);
24
+ });
 
25
 
 
 
 
 
26
 
27
+ $(document).on('dlm_new_file_added', () => {
 
28
 
29
+ $('.dlm_upload_file').each((index, element) => {
 
 
 
 
30
 
31
+ if (dlmUploadButtons.includes($(element))) {
32
+ return true;
33
+ }
34
 
35
+ dlmUploadButtons.push($(element));
 
 
 
 
 
36
 
37
+ const dlmUploaderOptions = {
38
+ browser: $(element),
39
+ plupload: {
40
+ multi_selection: false,
 
 
 
 
 
 
41
  },
42
+ params: {
43
+ type: 'dlm_download'
44
+ }
45
+ },
46
+ dlmUploader = new wp.Uploader(dlmUploaderOptions);
47
+
48
+ dlmUploader.uploader.bind('FileUploaded', dlmAddFileToPath);
 
 
 
 
 
 
49
  });
50
+
51
+ });
52
+
53
+ /**
54
+ * Add the file url to File URLs meta
55
+ * @param {*} up
56
+ * @param {*} file
57
+ */
58
+ function dlmAddFileToPath(up, file) {
59
+
60
+ const fileUrl = file.attachment.attributes.url;
61
+ const fileURLs = jQuery(up.settings.browse_button).parents('td').find('textarea');
62
+ let filePaths = fileURLs.val();
63
+ filePaths = filePaths ? filePaths + "\n" + fileUrl : fileUrl;
64
+ fileURLs.val(filePaths);
65
+ }
66
+ });
assets/js/upload-file.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(function(l){l(".dlm-metaboxes.downloadable_files").on("click",".dlm_upload_file",function(e){var a;e.preventDefault(),button_elem=this,a=n,(e=document.createElement("input")).type="file",e.addEventListener("change",a),e.dispatchEvent(new MouseEvent("click"))});var n=function(e){[...this.files].forEach(e=>{var a=new FormData;a.append("file",e,e.name),a.append("action","dlm_upload_file"),max_file_size>e.size?l.ajax({type:"POST",url:ajaxurl,success:function(e){var a,n;1==e.success?(a=(a=(n=l(button_elem).parent().parent().find(".downloadable_file_urls")).val())?a+"\n"+e.data.file_url:e.data.file_url,n.val(a)):0==e.success&&(n=l(button_elem).parent().parent().find(".downloadable_file_urls")).parent().append('<div class="notice notice-error dlm-upload-notices"><p>'+e.data.errorMessage+"</p></div>")},error:function(){l(button_elem).parent().parent().find(".downloadable_file_urls").parent().append('<div class="notice notice-error dlm-upload-notices"><p>An error occurred while uploading the file. Please try again.</p></div>')},async:!0,data:a,cache:!1,contentType:!1,processData:!1,timeout:6e4}):(l(".dlm-upload-notices").remove(),l(button_elem).parent().parent().find(".downloadable_file_urls").parent().append('<div class="notice notice-error dlm-upload-notices"><p>The file size exceeds the max_upload_file_size limit. Max: '+max_file_size+"</p></div>"))})}});
1
+ jQuery(function(a){let o=[];function n(e,l){l=l.attachment.attributes.url;const d=jQuery(e.settings.browse_button).parents("td").find("textarea");let t=d.val();t=t?t+"\n"+l:l,d.val(t)}a(".dlm_upload_file").each((e,l)=>{o.push(a(l));const d={browser:a(l),plupload:{multi_selection:!1},params:{type:"dlm_download"}},t=new wp.Uploader(d);t.uploader.bind("FileUploaded",n)}),a(document).on("dlm_new_file_added",()=>{a(".dlm_upload_file").each((e,l)=>{if(o.includes(a(l)))return!0;o.push(a(l));const d={browser:a(l),plupload:{multi_selection:!1},params:{type:"dlm_download"}},t=new wp.Uploader(d);t.uploader.bind("FileUploaded",n)})})});
assets/views/meta-box/version.php CHANGED
@@ -53,7 +53,7 @@ if ( ! defined( 'ABSPATH' ) ) {
53
  $buttons = apply_filters( 'dlm_downloadable_file_version_buttons', $buttons );
54
 
55
  foreach ( $buttons as $key => $button ) {
56
- echo '<a href="#" class="button dlm_' . esc_attr( $key ) . '" ';
57
  if ( ! empty( $button['data'] ) ) {
58
  foreach ( $button['data'] as $data_key => $data_value ) {
59
  echo 'data-' . esc_attr( $data_key ) . '="' . esc_attr( $data_value ) . '" ';
53
  $buttons = apply_filters( 'dlm_downloadable_file_version_buttons', $buttons );
54
 
55
  foreach ( $buttons as $key => $button ) {
56
+ echo '<a href="#" ' . ( 'upload_file' === $key ? 'id="dlm_upload_file_' . absint( $version_increment ) . '"' : '' ) . ' class="button dlm_' . esc_attr( $key ) . '" ';
57
  if ( ! empty( $button['data'] ) ) {
58
  foreach ( $button['data'] as $data_key => $data_value ) {
59
  echo 'data-' . esc_attr( $data_key ) . '="' . esc_attr( $data_value ) . '" ';
assets/views/notice-lu-upgrade.php CHANGED
@@ -1,12 +1,12 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- } // Exit if accessed directly
5
- ?>
6
- <div class="dlm-lu-upgrade-notice">
7
- <h3><?php echo esc_html__('It looks like you upgraded to the latest version of Download Monitor from a legacy version (3.x)', 'download-monitor' ); ?></h3>
8
- <p><?php printf( esc_html__( "Currently your downloads don't work like they should, we need to %s before they'll work again.", 'download-monitor' ), sprintf( '<strong>%s</strong>', esc_html__( 'upgrade your downloads', 'download-monitor' ) ) ); ?></p>
9
- <p><?php printf( esc_html__( "We've created an upgrading tool that will do all the work for you. You can read more about this tool on %sour website (click here)%s or start the upgrade now.", 'download-monitor'), '<a href="https://www.download-monitor.com/kb/legacy-upgrade?utm_source=plugin&utm_medium=dlm-lu-upgrade-notice&utm_campaign=dlm-lu-more-information" target="_blank">', '</a>' ); ?></p>
10
- <a href="<?php echo esc_url( admin_url( 'options.php?page=dlm_legacy_upgrade' ) ); ?>" class="button"><?php echo esc_html__( 'Take me to the Upgrade Tool', 'download-monitor' ); ?></a>
11
- <a href="<?php echo esc_url( admin_url( 'edit.php?post_type=dlm_download&dlm_lu_hide_notice=1' ) ); ?>" class="dlm-lu-upgrade-notice-hide"><?php echo esc_html__( 'hide notice', 'download-monitor' ); ?></a>
12
- </div>
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ } // Exit if accessed directly
5
+ ?>
6
+ <div class="dlm-lu-upgrade-notice">
7
+ <h3><?php echo esc_html__('It looks like you upgraded to the latest version of Download Monitor from a legacy version (3.x)', 'download-monitor' ); ?></h3>
8
+ <p><?php printf( esc_html__( "Currently your downloads don't work like they should, we need to %s before they'll work again.", 'download-monitor' ), sprintf( '<strong>%s</strong>', esc_html__( 'upgrade your downloads', 'download-monitor' ) ) ); ?></p>
9
+ <p><?php printf( esc_html__( "We've created an upgrading tool that will do all the work for you. You can read more about this tool on %sour website (click here)%s or start the upgrade now.", 'download-monitor'), '<a href="https://www.download-monitor.com/kb/legacy-upgrade?utm_source=plugin&utm_medium=dlm-lu-upgrade-notice&utm_campaign=dlm-lu-more-information" target="_blank">', '</a>' ); ?></p>
10
+ <a href="<?php echo esc_url( admin_url( 'options.php?page=dlm_legacy_upgrade' ) ); ?>" class="button"><?php echo esc_html__( 'Take me to the Upgrade Tool', 'download-monitor' ); ?></a>
11
+ <a href="<?php echo esc_url( admin_url( 'edit.php?post_type=dlm_download&dlm_lu_hide_notice=1' ) ); ?>" class="dlm-lu-upgrade-notice-hide"><?php echo esc_html__( 'hide notice', 'download-monitor' ); ?></a>
12
+ </div>
changelog.txt CHANGED
@@ -1,3 +1,12 @@
 
 
 
 
 
 
 
 
 
1
 
2
  = 4.5.4 - 28.02.2022 =
3
  Added: Included DLM Download Duplicator as core Download Monitor function ( https://github.com/WPChill/download-monitor/issues/848 )
1
+ = 4.5.5 - 08.03.2022 =
2
+ * Fixed: Uninstall now completely removes everything based on selection ( https://github.com/WPChill/download-monitor/issues/761 )
3
+ * Added: New option to display featured downloads for the [downloads] shortcode ( https://github.com/WPChill/download-monitor/issues/624)
4
+ * Added: Shortcode visible on all downloads page ( #821 )
5
+ * Fixed: Set our own orderby param on Admin Dashboard ( https://github.com/WPChill/download-monitor/issues/809 )
6
+ * Fixed: PayPal - new API ( https://github.com/WPChill/download-monitor/issues/861, https://github.com/WPChill/download-monitor/issues/796, https://github.com/WPChill/download-monitor/issues/665, https://github.com/WPChill/download-monitor/issues/636 )
7
+ * Fixed: Direct upload button ( https://github.com/WPChill/download-monitor/issues/863 )
8
+ * Fixed: Escaping on shop e-mail templates
9
+ * Fixed: Issue preventing a product to be added to cart. ( https://github.com/WPChill/download-monitor/issues/865 )
10
 
11
  = 4.5.4 - 28.02.2022 =
12
  Added: Included DLM Download Duplicator as core Download Monitor function ( https://github.com/WPChill/download-monitor/issues/848 )
download-monitor.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Download Monitor
4
  Plugin URI: https://www.download-monitor.com
5
  Description: A full solution for managing and selling downloadable files, monitoring downloads and outputting download links and file information on your WordPress powered site.
6
- Version: 4.5.4
7
  Author: WPChill
8
  Author URI: https://wpchill.com
9
  Requires at least: 5.4
@@ -33,7 +33,7 @@ if ( ! defined( 'ABSPATH' ) ) {
33
  } // Exit if accessed directly
34
 
35
  // Define DLM Version
36
- define( 'DLM_VERSION', '4.5.4' );
37
 
38
  // Define DLM FILE
39
  define( 'DLM_PLUGIN_FILE', __FILE__ );
3
  Plugin Name: Download Monitor
4
  Plugin URI: https://www.download-monitor.com
5
  Description: A full solution for managing and selling downloadable files, monitoring downloads and outputting download links and file information on your WordPress powered site.
6
+ Version: 4.5.5
7
  Author: WPChill
8
  Author URI: https://wpchill.com
9
  Requires at least: 5.4
33
  } // Exit if accessed directly
34
 
35
  // Define DLM Version
36
+ define( 'DLM_VERSION', '4.5.5' );
37
 
38
  // Define DLM FILE
39
  define( 'DLM_PLUGIN_FILE', __FILE__ );
includes/admin/uninstall/class-dlm-uninstall.php CHANGED
@@ -179,6 +179,9 @@ class DLM_Uninstall {
179
  * Remove all options that have our dlm_ prefix
180
  */
181
  $wpdb->query( "DELETE FROM {$wpdb->options} WHERE `option_name` LIKE 'dlm_%';" );
 
 
 
182
 
183
  // filter for options to be added by Download Monitor's add-ons
184
  $options_array = apply_filters( 'dlm_uninstall_db_options', array() );
@@ -210,17 +213,59 @@ class DLM_Uninstall {
210
  // Delete custom post type
211
  if ( '1' == $uninstall_option['delete_cpt'] ) {
212
 
213
- $post_types = apply_filters( 'dlm_uninstall_post_types', array( 'dlm_download' ) );
214
 
215
  $dlm_cpts = get_posts( array( 'post_type' => $post_types, 'posts_per_page' => - 1, 'fields' => 'ids' ) );
216
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
217
 
218
  if ( is_array( $dlm_cpts ) && ! empty( $dlm_cpts ) ) {
219
 
220
- $id_in = implode( ',', $dlm_cpts );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
221
 
222
- $sql = $wpdb->prepare( "DELETE FROM $wpdb->posts WHERE ID IN ( $id_in )" );
223
- $sql_meta = $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE post_id IN ( $id_in )" );
224
  $wpdb->query( $sql );
225
  $wpdb->query( $sql_meta );
226
  }
@@ -229,19 +274,26 @@ class DLM_Uninstall {
229
  // Delete tables set by the plugin
230
  if ( '1' == $uninstall_option['delete_set_tables'] ) {
231
 
232
- $dlm_tables = apply_filters( 'dlm_uninstall_db_tables', array( $wpdb->prefix . "download_log" ) );
 
 
 
 
 
 
 
 
 
 
233
 
234
  if ( ! empty( $dlm_tables ) ) {
235
 
236
  foreach ( $dlm_tables as $table ) {
237
 
238
  $sql_dlm_table = $wpdb->prepare( "DROP TABLE IF EXISTS $table" );
239
-
240
  $wpdb->query( $sql_dlm_table );
241
  }
242
  }
243
-
244
-
245
  }
246
 
247
  do_action( 'dlm_uninstall' );
179
  * Remove all options that have our dlm_ prefix
180
  */
181
  $wpdb->query( "DELETE FROM {$wpdb->options} WHERE `option_name` LIKE 'dlm_%';" );
182
+ $wpdb->query( "DELETE FROM {$wpdb->options} WHERE `option_name` LIKE '%_dlm_%';" );
183
+ $wpdb->query( "DELETE FROM {$wpdb->options} WHERE `option_name` LIKE '%download-monitor%';" );
184
+ $wpdb->query( "DELETE FROM {$wpdb->options} WHERE `option_name` LIKE '%download_monitor%';" );
185
 
186
  // filter for options to be added by Download Monitor's add-ons
187
  $options_array = apply_filters( 'dlm_uninstall_db_options', array() );
213
  // Delete custom post type
214
  if ( '1' == $uninstall_option['delete_cpt'] ) {
215
 
216
+ $post_types = apply_filters( 'dlm_uninstall_post_types', array( 'dlm_download', 'dlm_download_version', 'dlm_product' ) );
217
 
218
  $dlm_cpts = get_posts( array( 'post_type' => $post_types, 'posts_per_page' => - 1, 'fields' => 'ids' ) );
219
 
220
+ $terms = get_terms( 'dlm_download_category', array( 'hide_empty' => false, 'fields' => 'ids' ) );
221
+
222
+ if ( ! empty( $terms ) ) {
223
+
224
+ $where_terms = $wpdb->prepare(
225
+ sprintf(
226
+ "{$wpdb->terms}.term_id IN (%s)",
227
+ implode( ', ', array_fill( 0, count( $terms ), '%d' ) )
228
+ ),
229
+ $terms
230
+ );
231
+
232
+ $sql_terms = $wpdb->prepare( "DELETE FROM {$wpdb->terms} WHERE {$where_terms}" );
233
+
234
+ $where_taxonomy = $wpdb->prepare(
235
+ sprintf(
236
+ "{$wpdb->term_taxonomy}.term_id IN (%s)",
237
+ implode( ', ', array_fill( 0, count( $terms ), '%d' ) )
238
+ ),
239
+ $terms
240
+ );
241
+
242
+ $sql_taxonomy = $wpdb->prepare( "DELETE FROM {$wpdb->term_taxonomy} WHERE {$where_taxonomy}" );
243
+
244
+ $wpdb->query( $sql_terms );
245
+ $wpdb->query( $sql_taxonomy );
246
+ }
247
 
248
  if ( is_array( $dlm_cpts ) && ! empty( $dlm_cpts ) ) {
249
 
250
+ $where = $wpdb->prepare(
251
+ sprintf(
252
+ "{$wpdb->posts}.ID IN (%s)",
253
+ implode( ', ', array_fill( 0, count( $dlm_cpts ), '%d' ) )
254
+ ),
255
+ $dlm_cpts
256
+ );
257
+
258
+ $sql = $wpdb->prepare( "DELETE FROM {$wpdb->posts} WHERE {$where}" );
259
+
260
+ $where_meta = $wpdb->prepare(
261
+ sprintf(
262
+ "{$wpdb->postmeta}.post_id IN (%s)",
263
+ implode( ', ', array_fill( 0, count( $dlm_cpts ), '%d' ) )
264
+ ),
265
+ $dlm_cpts
266
+ );
267
+ $sql_meta = $wpdb->prepare( "DELETE FROM {$wpdb->postmeta} WHERE {$where_meta}" );
268
 
 
 
269
  $wpdb->query( $sql );
270
  $wpdb->query( $sql_meta );
271
  }
274
  // Delete tables set by the plugin
275
  if ( '1' == $uninstall_option['delete_set_tables'] ) {
276
 
277
+ $dlm_tables = apply_filters(
278
+ 'dlm_uninstall_db_tables',
279
+ array(
280
+ $wpdb->prefix . 'download_log',
281
+ $wpdb->prefix . 'dlm_session',
282
+ $wpdb->prefix . 'dlm_order_customer',
283
+ $wpdb->prefix . 'dlm_order_item',
284
+ $wpdb->prefix . 'dlm_order_transaction',
285
+ $wpdb->prefix . 'dlm_order',
286
+ )
287
+ );
288
 
289
  if ( ! empty( $dlm_tables ) ) {
290
 
291
  foreach ( $dlm_tables as $table ) {
292
 
293
  $sql_dlm_table = $wpdb->prepare( "DROP TABLE IF EXISTS $table" );
 
294
  $wpdb->query( $sql_dlm_table );
295
  }
296
  }
 
 
297
  }
298
 
299
  do_action( 'dlm_uninstall' );
includes/bootstrap.php CHANGED
@@ -1,45 +1,45 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- } // Exit if accessed directly
5
-
6
-
7
- function download_monitor() {
8
- static $instance;
9
- if ( is_null( $instance ) ) {
10
- $instance = new WP_DLM();
11
- }
12
- return $instance;
13
- }
14
-
15
- function _load_download_monitor() {
16
- // fetch instance and store in global
17
- $GLOBALS['download_monitor'] = download_monitor();
18
- }
19
-
20
- // require autoloader
21
- require_once dirname( DLM_PLUGIN_FILE ) . '/vendor/autoload.php';
22
-
23
- // load the upsells
24
- require_once dirname( DLM_PLUGIN_FILE ) . '/includes/admin/class-dlm-upsells.php';
25
-
26
- // Init plugin
27
- add_action( 'plugins_loaded', '_load_download_monitor', 10 );
28
-
29
- if ( is_admin() && ( false === defined( 'DOING_AJAX' ) || false === DOING_AJAX ) ) {
30
-
31
- // set installer file constant
32
- define( 'DLM_PLUGIN_FILE_INSTALLER', DLM_PLUGIN_FILE );
33
-
34
- // include installer functions
35
- require_once( 'installer-functions.php' );
36
-
37
- // Activation hook
38
- register_activation_hook( DLM_PLUGIN_FILE_INSTALLER, '_download_monitor_install' );
39
-
40
- // Multisite new blog hook
41
- add_action( 'wpmu_new_blog', '_download_monitor_mu_new_blog', 10, 6 );
42
-
43
- // Multisite blog delete
44
- add_filter( 'wpmu_drop_tables', '_download_monitor_mu_delete_blog' );
45
- }
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ } // Exit if accessed directly
5
+
6
+
7
+ function download_monitor() {
8
+ static $instance;
9
+ if ( is_null( $instance ) ) {
10
+ $instance = new WP_DLM();
11
+ }
12
+ return $instance;
13
+ }
14
+
15
+ function _load_download_monitor() {
16
+ // fetch instance and store in global
17
+ $GLOBALS['download_monitor'] = download_monitor();
18
+ }
19
+
20
+ // require autoloader
21
+ require_once dirname( DLM_PLUGIN_FILE ) . '/vendor/autoload.php';
22
+
23
+ // load the upsells
24
+ require_once dirname( DLM_PLUGIN_FILE ) . '/includes/admin/class-dlm-upsells.php';
25
+
26
+ // Init plugin
27
+ add_action( 'plugins_loaded', '_load_download_monitor', 10 );
28
+
29
+ if ( is_admin() && ( false === defined( 'DOING_AJAX' ) || false === DOING_AJAX ) ) {
30
+
31
+ // set installer file constant
32
+ define( 'DLM_PLUGIN_FILE_INSTALLER', DLM_PLUGIN_FILE );
33
+
34
+ // include installer functions
35
+ require_once( 'installer-functions.php' );
36
+
37
+ // Activation hook
38
+ register_activation_hook( DLM_PLUGIN_FILE_INSTALLER, '_download_monitor_install' );
39
+
40
+ // Multisite new blog hook
41
+ add_action( 'wpmu_new_blog', '_download_monitor_mu_new_blog', 10, 6 );
42
+
43
+ // Multisite blog delete
44
+ add_filter( 'wpmu_drop_tables', '_download_monitor_mu_delete_blog' );
45
+ }
includes/deprecated.php CHANGED
@@ -1,37 +1,37 @@
1
- <?php
2
- /**
3
- * Deprecated code, avoid using anything that's in this file
4
- */
5
-
6
- /**
7
- * dlm_create_log function.
8
- *
9
- * @access public
10
- *
11
- * @deprecated 1.6.0
12
- *
13
- * @param string $type
14
- * @param string $status
15
- * @param string $message
16
- * @param mixed $download
17
- * @param mixed $version
18
- *
19
- * @return void
20
- */
21
- function dlm_create_log( $type, $status, $message, $download, $version ) {
22
-
23
- // Deprecated notice
24
- _deprecated_function( __FUNCTION__, '1.6.0', 'DLM_Logging->create_log()' );
25
-
26
- // Logging object
27
- $logging = new DLM_Logging();
28
-
29
- // Check if logging is enabled
30
- if( $logging->is_logging_enabled() ) {
31
-
32
- // Create log
33
- $logging->create_log( $type, $status, $message, $download, $version );
34
-
35
- }
36
-
37
- }
1
+ <?php
2
+ /**
3
+ * Deprecated code, avoid using anything that's in this file
4
+ */
5
+
6
+ /**
7
+ * dlm_create_log function.
8
+ *
9
+ * @access public
10
+ *
11
+ * @deprecated 1.6.0
12
+ *
13
+ * @param string $type
14
+ * @param string $status
15
+ * @param string $message
16
+ * @param mixed $download
17
+ * @param mixed $version
18
+ *
19
+ * @return void
20
+ */
21
+ function dlm_create_log( $type, $status, $message, $download, $version ) {
22
+
23
+ // Deprecated notice
24
+ _deprecated_function( __FUNCTION__, '1.6.0', 'DLM_Logging->create_log()' );
25
+
26
+ // Logging object
27
+ $logging = new DLM_Logging();
28
+
29
+ // Check if logging is enabled
30
+ if( $logging->is_logging_enabled() ) {
31
+
32
+ // Create log
33
+ $logging->create_log( $type, $status, $message, $download, $version );
34
+
35
+ }
36
+
37
+ }
includes/download-functions.php CHANGED
@@ -1,15 +1,15 @@
1
- <?php
2
-
3
- /**
4
- * Gets the name of the default template
5
- * @return string
6
- */
7
- function dlm_get_default_download_template() {
8
- $default = get_option( 'dlm_default_template' );
9
-
10
- if ( $default == 'custom' ) {
11
- $default = get_option( 'dlm_custom_template' );
12
- }
13
-
14
- return $default;
15
- }
1
+ <?php
2
+
3
+ /**
4
+ * Gets the name of the default template
5
+ * @return string
6
+ */
7
+ function dlm_get_default_download_template() {
8
+ $default = get_option( 'dlm_default_template' );
9
+
10
+ if ( $default == 'custom' ) {
11
+ $default = get_option( 'dlm_custom_template' );
12
+ }
13
+
14
+ return $default;
15
+ }
includes/installer-functions.php CHANGED
@@ -1,92 +1,92 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
- } // Exit if accessed directly
6
-
7
- /**
8
- * Plugin activation hook.
9
- * When site is multisite and plugin is network activated, installer will run for each blog
10
- *
11
- * @param bool $network_wide
12
- */
13
- function _download_monitor_install( $network_wide = false ) {
14
-
15
- // DLM Installer
16
- $installer = new DLM_Installer();
17
-
18
- // check if
19
- if ( ! function_exists( 'is_plugin_active_for_network' ) ) {
20
- require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
21
- }
22
-
23
- // check if it's multisite
24
- if ( is_multisite() && true == $network_wide ) {
25
-
26
- // get websites
27
- $sites = wp_get_sites();
28
-
29
- // loop
30
- if ( count( $sites ) > 0 ) {
31
- foreach ( $sites as $site ) {
32
-
33
- // switch to blog
34
- switch_to_blog( $site['blog_id'] );
35
-
36
- // run installer on blog
37
- $installer->install();
38
-
39
- // restore current blog
40
- restore_current_blog();
41
- }
42
- }
43
-
44
- } else {
45
- // no multisite so do normal install
46
- $installer->install();
47
- }
48
-
49
- }
50
-
51
-
52
- /**
53
- * Run installer for new blogs on multisite when plugin is network activated
54
- *
55
- * @param $blog_id
56
- * @param $user_id
57
- * @param $domain
58
- * @param $path
59
- * @param $site_id
60
- * @param $meta
61
- */
62
- function _download_monitor_mu_new_blog( $blog_id, $user_id, $domain, $path, $site_id, $meta ) {
63
-
64
- // check if plugin is network activated
65
- if ( is_plugin_active_for_network( 'download-monitor/download-monitor.php' ) ) {
66
-
67
- // DLM Installer
68
- $installer = new DLM_Installer();
69
-
70
- // switch to new blog
71
- switch_to_blog( $blog_id );
72
-
73
- // run installer on blog
74
- $installer->install();
75
-
76
- // restore current blog
77
- restore_current_blog();
78
- }
79
- }
80
- /**
81
- * Delete DLM log table on multisite when blog is deleted
82
- *
83
- * @param $tables
84
- *
85
- * @return array
86
- */
87
- function _download_monitor_mu_delete_blog( $tables ) {
88
- global $wpdb;
89
- $tables[] = $wpdb->prefix . 'download_log';
90
-
91
- return $tables;
92
  }
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ } // Exit if accessed directly
6
+
7
+ /**
8
+ * Plugin activation hook.
9
+ * When site is multisite and plugin is network activated, installer will run for each blog
10
+ *
11
+ * @param bool $network_wide
12
+ */
13
+ function _download_monitor_install( $network_wide = false ) {
14
+
15
+ // DLM Installer
16
+ $installer = new DLM_Installer();
17
+
18
+ // check if
19
+ if ( ! function_exists( 'is_plugin_active_for_network' ) ) {
20
+ require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
21
+ }
22
+
23
+ // check if it's multisite
24
+ if ( is_multisite() && true == $network_wide ) {
25
+
26
+ // get websites
27
+ $sites = wp_get_sites();
28
+
29
+ // loop
30
+ if ( count( $sites ) > 0 ) {
31
+ foreach ( $sites as $site ) {
32
+
33
+ // switch to blog
34
+ switch_to_blog( $site['blog_id'] );
35
+
36
+ // run installer on blog
37
+ $installer->install();
38
+
39
+ // restore current blog
40
+ restore_current_blog();
41
+ }
42
+ }
43
+
44
+ } else {
45
+ // no multisite so do normal install
46
+ $installer->install();
47
+ }
48
+
49
+ }
50
+
51
+
52
+ /**
53
+ * Run installer for new blogs on multisite when plugin is network activated
54
+ *
55
+ * @param $blog_id
56
+ * @param $user_id
57
+ * @param $domain
58
+ * @param $path
59
+ * @param $site_id
60
+ * @param $meta
61
+ */
62
+ function _download_monitor_mu_new_blog( $blog_id, $user_id, $domain, $path, $site_id, $meta ) {
63
+
64
+ // check if plugin is network activated
65
+ if ( is_plugin_active_for_network( 'download-monitor/download-monitor.php' ) ) {
66
+
67
+ // DLM Installer
68
+ $installer = new DLM_Installer();
69
+
70
+ // switch to new blog
71
+ switch_to_blog( $blog_id );
72
+
73
+ // run installer on blog
74
+ $installer->install();
75
+
76
+ // restore current blog
77
+ restore_current_blog();
78
+ }
79
+ }
80
+ /**
81
+ * Delete DLM log table on multisite when blog is deleted
82
+ *
83
+ * @param $tables
84
+ *
85
+ * @return array
86
+ */
87
+ function _download_monitor_mu_delete_blog( $tables ) {
88
+ global $wpdb;
89
+ $tables[] = $wpdb->prefix . 'download_log';
90
+
91
+ return $tables;
92
  }
includes/php-too-low.php CHANGED
@@ -1,43 +1,43 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- } // Exit if accessed directly
5
-
6
- function dlm_admin_notice_php_version() {
7
-
8
- $version_parts = explode( '.', phpversion() );
9
- $user_version_nice = '';
10
- if ( ! empty( $version_parts[0] ) ) {
11
- $user_version_nice .= $version_parts[0];
12
- }
13
- if ( ! empty( $version_parts[1] ) ) {
14
- $user_version_nice .= '.' . $version_parts[1];
15
- }
16
-
17
- ?>
18
- <div class="notice notice-error is-dismissible">
19
- <h3><?php echo esc_html__( 'PHP Version too low!', 'download-monitor' ); ?></h3>
20
- <p>
21
- <?php
22
- printf(
23
- esc_html_e( "Download Monitor can't be loaded because it needs at least %1\$s but the server that is hosting your WordPress website is running %2\$s", 'download-monitor' ),
24
- '<strong>' . sprintf( esc_html_e( 'PHP Version %s', 'download-monitor' ), '5.3' ) . '</strong>',
25
- '<strong>' . sprintf( esc_html_e( 'PHP Version %s', 'download-monitor' ), esc_html( $user_version_nice ) ) . '</strong>'
26
- );
27
- ?>
28
- </p>
29
- <p>
30
- <?php
31
- printf(
32
- esc_html_e( "You can learn more about why it's important that you update and get tips on how to update by %s", 'download-monitor' ),
33
- '<a href="https://www.download-monitor.com/kb/minimum-required-php-version/" target="_blank">' . esc_html_e( 'clicking this link', 'download-monitor' ) . '</a>'
34
- );
35
- ?>
36
- </p>
37
- <p><?php echo esc_html__( "After you've upgraded your PHP version, Download Monitor will automatically load and work.", 'download-monitor' ); ?></p>
38
- <p></p>
39
- </div>
40
- <?php
41
- }
42
-
43
- add_action( 'admin_notices', 'dlm_admin_notice_php_version' );
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ } // Exit if accessed directly
5
+
6
+ function dlm_admin_notice_php_version() {
7
+
8
+ $version_parts = explode( '.', phpversion() );
9
+ $user_version_nice = '';
10
+ if ( ! empty( $version_parts[0] ) ) {
11
+ $user_version_nice .= $version_parts[0];
12
+ }
13
+ if ( ! empty( $version_parts[1] ) ) {
14
+ $user_version_nice .= '.' . $version_parts[1];
15
+ }
16
+
17
+ ?>
18
+ <div class="notice notice-error is-dismissible">
19
+ <h3><?php echo esc_html__( 'PHP Version too low!', 'download-monitor' ); ?></h3>
20
+ <p>
21
+ <?php
22
+ printf(
23
+ esc_html_e( "Download Monitor can't be loaded because it needs at least %1\$s but the server that is hosting your WordPress website is running %2\$s", 'download-monitor' ),
24
+ '<strong>' . sprintf( esc_html_e( 'PHP Version %s', 'download-monitor' ), '5.3' ) . '</strong>',
25
+ '<strong>' . sprintf( esc_html_e( 'PHP Version %s', 'download-monitor' ), esc_html( $user_version_nice ) ) . '</strong>'
26
+ );
27
+ ?>
28
+ </p>
29
+ <p>
30
+ <?php
31
+ printf(
32
+ esc_html_e( "You can learn more about why it's important that you update and get tips on how to update by %s", 'download-monitor' ),
33
+ '<a href="https://www.download-monitor.com/kb/minimum-required-php-version/" target="_blank">' . esc_html_e( 'clicking this link', 'download-monitor' ) . '</a>'
34
+ );
35
+ ?>
36
+ </p>
37
+ <p><?php echo esc_html__( "After you've upgraded your PHP version, Download Monitor will automatically load and work.", 'download-monitor' ); ?></p>
38
+ <p></p>
39
+ </div>
40
+ <?php
41
+ }
42
+
43
+ add_action( 'admin_notices', 'dlm_admin_notice_php_version' );
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: wpchill, silkalns, barrykooij, mikejolley
3
  Tags: download manager, document management, file manager, digital store, ecommerce, document management plugin, download monitor, download counter, password protection, download protection, password, protect downloads, tracker, sell, shop, ecommerce, paypal
4
  Requires at least: 5.4
5
  Tested up to: 5.9
6
- Stable tag: 4.5.4
7
  License: GPLv3
8
  Text Domain: -
9
  Requires PHP: 5.6
3
  Tags: download manager, document management, file manager, digital store, ecommerce, document management plugin, download monitor, download counter, password protection, download protection, password, protect downloads, tracker, sell, shop, ecommerce, paypal
4
  Requires at least: 5.4
5
  Tested up to: 5.9
6
+ Stable tag: 4.5.5
7
  License: GPLv3
8
  Text Domain: -
9
  Requires PHP: 5.6
src/Admin/AdminScripts.php CHANGED
@@ -56,15 +56,6 @@ class DLM_Admin_Scripts {
56
  DLM_VERSION
57
  );
58
 
59
- // Upload file JS
60
- wp_enqueue_script(
61
- 'dlm_upload_file_js',
62
- plugins_url( '/assets/js/upload-file' . ( ( ! SCRIPT_DEBUG ) ? '.min' : '' ) . '.js', $dlm->get_plugin_file() ),
63
- array( 'jquery' ),
64
- DLM_VERSION
65
- );
66
- wp_add_inline_script( 'dlm_upload_file_js', 'const max_file_size = ' . wp_max_upload_size() . ';', 'before' );
67
-
68
  // Make JavaScript strings translatable
69
  wp_localize_script( 'dlm_insert_download', 'dlm_id_strings', $this->get_strings( 'edit-post' ) );
70
 
@@ -77,6 +68,21 @@ class DLM_Admin_Scripts {
77
  ( $pagenow == 'post-new.php' && isset( $_GET['post_type'] ) && 'dlm_download' == $_GET['post_type'] )
78
  ) {
79
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
  // Enqueue Edit Download JS
81
  wp_enqueue_script(
82
  'dlm_edit_download',
56
  DLM_VERSION
57
  );
58
 
 
 
 
 
 
 
 
 
 
59
  // Make JavaScript strings translatable
60
  wp_localize_script( 'dlm_insert_download', 'dlm_id_strings', $this->get_strings( 'edit-post' ) );
61
 
68
  ( $pagenow == 'post-new.php' && isset( $_GET['post_type'] ) && 'dlm_download' == $_GET['post_type'] )
69
  ) {
70
 
71
+ wp_enqueue_media(
72
+ array(
73
+ 'post' => $post->ID,
74
+ )
75
+ );
76
+
77
+ // Upload file JS
78
+ wp_enqueue_script(
79
+ 'dlm_upload_file_js',
80
+ plugins_url( '/assets/js/upload-file' . ( ( ! SCRIPT_DEBUG ) ? '.min' : '' ) . '.js', $dlm->get_plugin_file() ),
81
+ array( 'jquery' ),
82
+ DLM_VERSION
83
+ );
84
+ wp_add_inline_script( 'dlm_upload_file_js', 'const max_file_size = ' . wp_max_upload_size() . ';', 'before' );
85
+
86
  // Enqueue Edit Download JS
87
  wp_enqueue_script(
88
  'dlm_edit_download',
src/Admin/CategoryWalker.php CHANGED
@@ -1,53 +1,53 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- } // Exit if accessed directly
5
-
6
- /**
7
- * DLM_Category_Walker class.
8
- *
9
- * @extends Walker
10
- */
11
- class DLM_Category_Walker extends Walker {
12
-
13
- var $tree_type = 'category';
14
- var $db_fields = array( 'parent' => 'parent', 'id' => 'term_id', 'slug' => 'slug' );
15
-
16
- /**
17
- * @see Walker::start_el()
18
- * @since 2.1.0
19
- *
20
- * @param string $output Passed by reference. Used to append additional content.
21
- * @param object $category Category data object.
22
- * @param int $depth Depth of category in reference to parents.
23
- * @param array $args
24
- */
25
- function start_el( &$output, $object, $depth = 0, $args = array(), $current_object_id = 0 ) {
26
-
27
- if ( ! empty( $args['hierarchical'] ) ) {
28
- $pad = str_repeat( '&nbsp;', $depth * 3 );
29
- } else {
30
- $pad = '';
31
- }
32
-
33
- $cat_name = apply_filters( 'list_product_cats', $object->name, $object );
34
-
35
- $value = isset( $args['value'] ) && $args['value'] == 'id' ? $object->term_id : $object->slug;
36
-
37
- $output .= "\t<option class=\"level-$depth\" value=\"" . $value . "\"";
38
-
39
- if ( $value == $args['selected'] || ( is_array( $args['selected'] ) && in_array( $value, $args['selected'] ) ) ) {
40
- $output .= ' selected="selected"';
41
- }
42
-
43
- $output .= '>';
44
-
45
- $output .= $pad . __( $cat_name, 'download-monitor' );
46
-
47
- if ( ! empty( $args['show_count'] ) ) {
48
- $output .= '&nbsp;(' . $object->count . ')';
49
- }
50
-
51
- $output .= "</option>\n";
52
- }
53
  }
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ } // Exit if accessed directly
5
+
6
+ /**
7
+ * DLM_Category_Walker class.
8
+ *
9
+ * @extends Walker
10
+ */
11
+ class DLM_Category_Walker extends Walker {
12
+
13
+ var $tree_type = 'category';
14
+ var $db_fields = array( 'parent' => 'parent', 'id' => 'term_id', 'slug' => 'slug' );
15
+
16
+ /**
17
+ * @see Walker::start_el()
18
+ * @since 2.1.0
19
+ *
20
+ * @param string $output Passed by reference. Used to append additional content.
21
+ * @param object $category Category data object.
22
+ * @param int $depth Depth of category in reference to parents.
23
+ * @param array $args
24
+ */
25
+ function start_el( &$output, $object, $depth = 0, $args = array(), $current_object_id = 0 ) {
26
+
27
+ if ( ! empty( $args['hierarchical'] ) ) {
28
+ $pad = str_repeat( '&nbsp;', $depth * 3 );
29
+ } else {
30
+ $pad = '';
31
+ }
32
+
33
+ $cat_name = apply_filters( 'list_product_cats', $object->name, $object );
34
+
35
+ $value = isset( $args['value'] ) && $args['value'] == 'id' ? $object->term_id : $object->slug;
36
+
37
+ $output .= "\t<option class=\"level-$depth\" value=\"" . $value . "\"";
38
+
39
+ if ( $value == $args['selected'] || ( is_array( $args['selected'] ) && in_array( $value, $args['selected'] ) ) ) {
40
+ $output .= ' selected="selected"';
41
+ }
42
+
43
+ $output .= '>';
44
+
45
+ $output .= $pad . __( $cat_name, 'download-monitor' );
46
+
47
+ if ( ! empty( $args['show_count'] ) ) {
48
+ $output .= '&nbsp;(' . $object->count . ')';
49
+ }
50
+
51
+ $output .= "</option>\n";
52
+ }
53
  }
src/Admin/CustomColumns.php CHANGED
@@ -26,7 +26,8 @@ class DLM_Custom_Columns {
26
  $columns["download_id"] = __( "ID", 'download-monitor' );
27
  $columns["file"] = __( "File", 'download-monitor' );
28
  $columns["version"] = __( "Version", 'download-monitor' );
29
- $columns["download_cat"] = __( "Categories", 'download-monitor' );
 
30
  $columns["download_tag"] = __( "Tags", 'download-monitor' );
31
  $columns["download_count"] = __( "Download count", 'download-monitor' );
32
  $columns["featured"] = __( "Featured", 'download-monitor' );
@@ -75,7 +76,7 @@ class DLM_Custom_Columns {
75
  if ( ! $terms = get_the_terms( $post->ID, 'dlm_download_category' ) ) {
76
  echo '<span class="na">&ndash;</span>';
77
  } else {
78
- foreach ( $terms as $term ) {
79
  echo '<a href=' . esc_url( add_query_arg( 'dlm_download_category', esc_attr( $term->slug ) ) ) . '>' . esc_html( $term->name ) . '</a> ';
80
  }
81
  }
@@ -126,6 +127,10 @@ class DLM_Custom_Columns {
126
  echo '<span class="na">&ndash;</span>';
127
  }
128
  break;
 
 
 
 
129
  case "download_count" :
130
  echo number_format( $download->get_download_count(), 0, '.', ',' );
131
  break;
26
  $columns["download_id"] = __( "ID", 'download-monitor' );
27
  $columns["file"] = __( "File", 'download-monitor' );
28
  $columns["version"] = __( "Version", 'download-monitor' );
29
+ $columns["version"] = __( "Version", 'download-monitor' );
30
+ $columns["shortcode"] = __( "Shortcode", 'download-monitor' );
31
  $columns["download_tag"] = __( "Tags", 'download-monitor' );
32
  $columns["download_count"] = __( "Download count", 'download-monitor' );
33
  $columns["featured"] = __( "Featured", 'download-monitor' );
76
  if ( ! $terms = get_the_terms( $post->ID, 'dlm_download_category' ) ) {
77
  echo '<span class="na">&ndash;</span>';
78
  } else {
79
+ foreach ( $terms as $term ) {
80
  echo '<a href=' . esc_url( add_query_arg( 'dlm_download_category', esc_attr( $term->slug ) ) ) . '>' . esc_html( $term->name ) . '</a> ';
81
  }
82
  }
127
  echo '<span class="na">&ndash;</span>';
128
  }
129
  break;
130
+
131
+ case "shortcode" :
132
+ echo '<code>[download id="' . esc_html( $post->ID ) . '"]</code>';
133
+ break;
134
  case "download_count" :
135
  echo number_format( $download->get_download_count(), 0, '.', ',' );
136
  break;
src/Admin/CustomLabels.php CHANGED
@@ -1,60 +1,60 @@
1
- <?php
2
-
3
- class DLM_Custom_Labels {
4
-
5
- /**
6
- * Setup custom labels
7
- */
8
- public function setup() {
9
- add_filter( 'enter_title_here', array( $this, 'enter_title_here' ), 1, 2 );
10
- add_filter( 'post_updated_messages', array( $this, 'post_updated_messages' ) );
11
- }
12
-
13
- /**
14
- * enter_title_here function.
15
- *
16
- * @param string $text
17
- * @param WP_Post $post
18
- *
19
- * @access public
20
- * @return string
21
- */
22
- public function enter_title_here( $text, $post ) {
23
- if ( 'dlm_download' == $post->post_type ) {
24
- return __( 'Download title', 'download-monitor' );
25
- }
26
-
27
- return $text;
28
- }
29
-
30
- /**
31
- * post_updated_messages function.
32
- *
33
- * @access public
34
- *
35
- * @param array $messages
36
- *
37
- * @return array
38
- */
39
- public function post_updated_messages( $messages ) {
40
- global $post;
41
-
42
- $messages['dlm_download'] = array(
43
- 0 => '', // Unused. Messages start at index 1.
44
- 1 => __( 'Download updated.', 'download-monitor' ),
45
- 2 => __( 'Custom field updated.', 'download-monitor' ),
46
- 3 => __( 'Custom field deleted.', 'download-monitor' ),
47
- 4 => __( 'Download updated.', 'download-monitor' ),
48
- 5 => isset( $_GET['revision'] ) ? sprintf( esc_html__( 'Download restored to revision from %s', 'download-monitor' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
49
- 6 => __( 'Download published.', 'download-monitor' ),
50
- 7 => __( 'Download saved.', 'download-monitor' ),
51
- 8 => __( 'Download submitted.', 'download-monitor' ),
52
- 9 => sprintf( __( 'Download scheduled for: <strong>%1$s</strong>.', 'download-monitor' ),
53
- date_i18n( __( 'M j, Y @ G:i', 'download-monitor' ), strtotime( $post->post_date ) ) ),
54
- 10 => __( 'Download draft updated.', 'download-monitor' ),
55
- );
56
-
57
- return $messages;
58
- }
59
-
60
  }
1
+ <?php
2
+
3
+ class DLM_Custom_Labels {
4
+
5
+ /**
6
+ * Setup custom labels
7
+ */
8
+ public function setup() {
9
+ add_filter( 'enter_title_here', array( $this, 'enter_title_here' ), 1, 2 );
10
+ add_filter( 'post_updated_messages', array( $this, 'post_updated_messages' ) );
11
+ }
12
+
13
+ /**
14
+ * enter_title_here function.
15
+ *
16
+ * @param string $text
17
+ * @param WP_Post $post
18
+ *
19
+ * @access public
20
+ * @return string
21
+ */
22
+ public function enter_title_here( $text, $post ) {
23
+ if ( 'dlm_download' == $post->post_type ) {
24
+ return __( 'Download title', 'download-monitor' );
25
+ }
26
+
27
+ return $text;
28
+ }
29
+
30
+ /**
31
+ * post_updated_messages function.
32
+ *
33
+ * @access public
34
+ *
35
+ * @param array $messages
36
+ *
37
+ * @return array
38
+ */
39
+ public function post_updated_messages( $messages ) {
40
+ global $post;
41
+
42
+ $messages['dlm_download'] = array(
43
+ 0 => '', // Unused. Messages start at index 1.
44
+ 1 => __( 'Download updated.', 'download-monitor' ),
45
+ 2 => __( 'Custom field updated.', 'download-monitor' ),
46
+ 3 => __( 'Custom field deleted.', 'download-monitor' ),
47
+ 4 => __( 'Download updated.', 'download-monitor' ),
48
+ 5 => isset( $_GET['revision'] ) ? sprintf( esc_html__( 'Download restored to revision from %s', 'download-monitor' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
49
+ 6 => __( 'Download published.', 'download-monitor' ),
50
+ 7 => __( 'Download saved.', 'download-monitor' ),
51
+ 8 => __( 'Download submitted.', 'download-monitor' ),
52
+ 9 => sprintf( __( 'Download scheduled for: <strong>%1$s</strong>.', 'download-monitor' ),
53
+ date_i18n( __( 'M j, Y @ G:i', 'download-monitor' ), strtotime( $post->post_date ) ) ),
54
+ 10 => __( 'Download draft updated.', 'download-monitor' ),
55
+ );
56
+
57
+ return $messages;
58
+ }
59
+
60
  }
src/Admin/Dashboard.php CHANGED
@@ -20,10 +20,14 @@ class DLM_Admin_Dashboard {
20
  return;
21
  }
22
 
23
- wp_add_dashboard_widget( 'dlm_popular_downloads', __( 'Popular Downloads', 'download-monitor' ), array(
24
- $this,
25
- 'popular_downloads'
26
- ) );
 
 
 
 
27
  }
28
 
29
  /**
@@ -34,28 +38,36 @@ class DLM_Admin_Dashboard {
34
  */
35
  public function popular_downloads() {
36
 
37
- $filters = apply_filters( 'dlm_admin_dashboard_popular_downloads_filters', array(
38
- 'no_found_rows' => 1,
39
- 'orderby' => array(
40
- 'orderby_meta' => 'DESC'
41
- ),
42
- 'meta_query' => array(
43
- 'orderby_meta' => array(
44
- 'key' => '_download_count',
45
- 'type' => 'NUMERIC'
46
  ),
47
- array(
48
- 'key' => '_download_count',
49
- 'value' => '0',
50
- 'compare' => '>',
51
- 'type' => 'NUMERIC'
52
- )
53
- ),
54
- ) );
 
 
 
 
 
 
55
 
 
 
56
 
57
  $downloads = download_monitor()->service( 'download_repository' )->retrieve( $filters, 10 );
58
 
 
 
 
59
  if ( empty( $downloads ) ) {
60
  echo '<p>' . esc_html__( 'There are no stats available yet!', 'download-monitor' ) . '</p>';
61
 
@@ -67,14 +79,14 @@ class DLM_Admin_Dashboard {
67
  $max_count = 1;
68
  }
69
  ?>
70
- <table class="download_chart" cellpadding="0" cellspacing="0">
71
- <thead>
72
- <tr>
73
- <th scope="col"><?php echo esc_html__( 'Download', "download-monitor" ); ?></th>
74
- <th scope="col"><?php echo esc_html__( 'Download count', "download-monitor" ); ?></th>
75
- </tr>
76
- </thead>
77
- <tbody>
78
  <?php
79
  if ( $downloads ) {
80
  /** @var DLM_Download $download */
@@ -89,9 +101,33 @@ class DLM_Admin_Dashboard {
89
  }
90
  }
91
  ?>
92
- </tbody>
93
- </table>
94
  <?php
95
  }
96
 
97
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  return;
21
  }
22
 
23
+ wp_add_dashboard_widget(
24
+ 'dlm_popular_downloads',
25
+ __( 'Popular Downloads', 'download-monitor' ),
26
+ array(
27
+ $this,
28
+ 'popular_downloads',
29
+ )
30
+ );
31
  }
32
 
33
  /**
38
  */
39
  public function popular_downloads() {
40
 
41
+ $filters = apply_filters(
42
+ 'dlm_admin_dashboard_popular_downloads_filters',
43
+ array(
44
+ 'no_found_rows' => 1,
45
+ 'orderby' => array(
46
+ 'orderby_meta' => 'DESC',
 
 
 
47
  ),
48
+ 'meta_query' => array(
49
+ 'orderby_meta' => array(
50
+ 'key' => '_download_count',
51
+ 'type' => 'NUMERIC',
52
+ ),
53
+ array(
54
+ 'key' => '_download_count',
55
+ 'value' => '0',
56
+ 'compare' => '>',
57
+ 'type' => 'NUMERIC',
58
+ ),
59
+ ),
60
+ )
61
+ );
62
 
63
+ // This is a fix for Custom Posts ordering plugins
64
+ add_action( 'pre_get_posts', array( $this, 'orderby_fix' ), 15 );
65
 
66
  $downloads = download_monitor()->service( 'download_repository' )->retrieve( $filters, 10 );
67
 
68
+ // This is a fix for Custom Posts ordering plugins
69
+ remove_action( 'pre_get_posts', array( $this, 'orderby_fix' ), 15 );
70
+
71
  if ( empty( $downloads ) ) {
72
  echo '<p>' . esc_html__( 'There are no stats available yet!', 'download-monitor' ) . '</p>';
73
 
79
  $max_count = 1;
80
  }
81
  ?>
82
+ <table class="download_chart" cellpadding="0" cellspacing="0">
83
+ <thead>
84
+ <tr>
85
+ <th scope="col"><?php echo esc_html__( 'Download', 'download-monitor' ); ?></th>
86
+ <th scope="col"><?php echo esc_html__( 'Download count', 'download-monitor' ); ?></th>
87
+ </tr>
88
+ </thead>
89
+ <tbody>
90
  <?php
91
  if ( $downloads ) {
92
  /** @var DLM_Download $download */
101
  }
102
  }
103
  ?>
104
+ </tbody>
105
+ </table>
106
  <?php
107
  }
108
 
109
+ /**
110
+ * This is a fix for Custom Posts ordering plugins
111
+ *
112
+ * @param Object $query
113
+ * @return void
114
+ *
115
+ * @since 4.5.5
116
+ */
117
+ public function orderby_fix( $query ) {
118
+
119
+ if ( ! is_admin() ) {
120
+ return;
121
+ }
122
+
123
+ $query->set(
124
+ 'orderby',
125
+ array(
126
+ 'orderby_meta' => 'DESC',
127
+ )
128
+ );
129
+
130
+ do_action( 'dlm_orderby_dashboard_fix', $query );
131
+
132
+ }
133
+ }
src/Admin/MediaBrowser.php CHANGED
@@ -1,122 +1,122 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
- } // Exit if accessed directly
6
-
7
- /**
8
- * DLM_Admin_Media_Browser class.
9
- */
10
- class DLM_Admin_Media_Browser {
11
-
12
- /**
13
- * __construct function.
14
- *
15
- * @access public
16
- */
17
- public function __construct() {
18
- add_action( 'media_upload_downloadable_file_browser', array( $this, 'media_browser' ) );
19
- }
20
-
21
- /**
22
- * media_browser function.
23
- *
24
- * @access public
25
- * @return void
26
- */
27
- public function media_browser() {
28
- // File Manager
29
- $file_manager = new DLM_File_Manager();
30
-
31
- // Files
32
- $files = $file_manager->list_files( ABSPATH, 1 );
33
-
34
- echo '<!DOCTYPE html><html lang="en"><head><title>' . esc_html__( 'Browse for a file', 'download-monitor' ) . '</title>';
35
-
36
- wp_enqueue_style( 'download_monitor_admin_css', download_monitor()->get_plugin_url() . '/assets/css/admin.css', array( 'dashicons' ) );
37
- do_action( 'admin_print_styles' );
38
- do_action( 'admin_print_scripts' );
39
- do_action( 'admin_head' );
40
-
41
- echo '<meta charset="utf-8" /></head><body>';
42
-
43
- echo '<ul class="download_monitor_file_browser">';
44
-
45
- foreach ( $files as $found_file ) {
46
-
47
- $file = pathinfo( $found_file['path'] );
48
-
49
- if ( $found_file['type'] == 'folder' ) {
50
-
51
- echo '<li><a href="#" class="folder" data-path="' . esc_attr( trailingslashit( $file['dirname'] ) ) . esc_attr( $file['basename'] ) . '">' . esc_html( $file['basename'] ) . '</a></li>';
52
-
53
- } else {
54
-
55
- $filename = $file['basename'];
56
- $extension = ( empty( $file['extension'] ) ) ? '' : $file['extension'];
57
-
58
- if ( substr( $filename, 0, 1 ) == '.' ) {
59
- continue;
60
- } // Ignore files starting with . like htaccess
61
- if ( in_array( $extension, array( '', 'php', 'html', 'htm', 'tmp' ) ) ) {
62
- continue;
63
- } // Ignored file types
64
-
65
- echo '<li><a href="#" class="file filetype-' . esc_attr( sanitize_title( $extension ) ) . '" data-path="' . esc_attr( trailingslashit( $file['dirname'] ) ) . esc_attr( $file['basename'] ) . '">' . esc_html( $file['basename'] ) . '</a></li>';
66
-
67
- }
68
-
69
- }
70
-
71
- echo '</ul>';
72
- ?>
73
- <script type="text/javascript">
74
- jQuery( function () {
75
- jQuery( '.download_monitor_file_browser' ).on( 'click', 'a', function () {
76
-
77
- var $link = jQuery( this );
78
- var $parent = $link.closest( 'li' );
79
-
80
- if ( $link.is( '.file' ) ) {
81
-
82
- var win = window.dialogArguments || opener || parent || top;
83
-
84
- win.send_to_editor( $link.attr( 'data-path' ) );
85
-
86
- } else if ( $link.is( '.folder_open' ) ) {
87
-
88
- $parent.find( 'ul' ).remove();
89
- $link.removeClass( 'folder_open' );
90
-
91
- } else {
92
-
93
- $link.after( '<ul class="load_tree loading"></ul>' );
94
-
95
- var data = {
96
- action: 'download_monitor_list_files',
97
- path: jQuery( this ).attr( 'data-path' ),
98
- security: '<?php echo esc_js(wp_create_nonce("list-files")); ?>'
99
- };
100
-
101
- jQuery.post( '<?php echo esc_url( admin_url('admin-ajax.php') ); ?>', data, function ( response ) {
102
-
103
- $link.addClass( 'folder_open' );
104
-
105
- if ( response ) {
106
- $parent.find( '.load_tree' ).html( response );
107
- } else {
108
- $parent.find( '.load_tree' ).html( '<li class="nofiles"><?php echo esc_html__('No files found', 'download-monitor'); ?></li>' );
109
- }
110
- $parent.find( '.load_tree' ).removeClass( 'load_tree loading' );
111
-
112
- } );
113
- }
114
- return false;
115
- } );
116
- } );
117
- </script>
118
- <?php
119
- echo '</body></html>';
120
- }
121
-
122
  }
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ } // Exit if accessed directly
6
+
7
+ /**
8
+ * DLM_Admin_Media_Browser class.
9
+ */
10
+ class DLM_Admin_Media_Browser {
11
+
12
+ /**
13
+ * __construct function.
14
+ *
15
+ * @access public
16
+ */
17
+ public function __construct() {
18
+ add_action( 'media_upload_downloadable_file_browser', array( $this, 'media_browser' ) );
19
+ }
20
+
21
+ /**
22
+ * media_browser function.
23
+ *
24
+ * @access public
25
+ * @return void
26
+ */
27
+ public function media_browser() {
28
+ // File Manager
29
+ $file_manager = new DLM_File_Manager();
30
+
31
+ // Files
32
+ $files = $file_manager->list_files( ABSPATH, 1 );
33
+
34
+ echo '<!DOCTYPE html><html lang="en"><head><title>' . esc_html__( 'Browse for a file', 'download-monitor' ) . '</title>';
35
+
36
+ wp_enqueue_style( 'download_monitor_admin_css', download_monitor()->get_plugin_url() . '/assets/css/admin.css', array( 'dashicons' ) );
37
+ do_action( 'admin_print_styles' );
38
+ do_action( 'admin_print_scripts' );
39
+ do_action( 'admin_head' );
40
+
41
+ echo '<meta charset="utf-8" /></head><body>';
42
+
43
+ echo '<ul class="download_monitor_file_browser">';
44
+
45
+ foreach ( $files as $found_file ) {
46
+
47
+ $file = pathinfo( $found_file['path'] );
48
+
49
+ if ( $found_file['type'] == 'folder' ) {
50
+
51
+ echo '<li><a href="#" class="folder" data-path="' . esc_attr( trailingslashit( $file['dirname'] ) ) . esc_attr( $file['basename'] ) . '">' . esc_html( $file['basename'] ) . '</a></li>';
52
+
53
+ } else {
54
+
55
+ $filename = $file['basename'];
56
+ $extension = ( empty( $file['extension'] ) ) ? '' : $file['extension'];
57
+
58
+ if ( substr( $filename, 0, 1 ) == '.' ) {
59
+ continue;
60
+ } // Ignore files starting with . like htaccess
61
+ if ( in_array( $extension, array( '', 'php', 'html', 'htm', 'tmp' ) ) ) {
62
+ continue;
63
+ } // Ignored file types
64
+
65
+ echo '<li><a href="#" class="file filetype-' . esc_attr( sanitize_title( $extension ) ) . '" data-path="' . esc_attr( trailingslashit( $file['dirname'] ) ) . esc_attr( $file['basename'] ) . '">' . esc_html( $file['basename'] ) . '</a></li>';
66
+
67
+ }
68
+
69
+ }
70
+
71
+ echo '</ul>';
72
+ ?>
73
+ <script type="text/javascript">
74
+ jQuery( function () {
75
+ jQuery( '.download_monitor_file_browser' ).on( 'click', 'a', function () {
76
+
77
+ var $link = jQuery( this );
78
+ var $parent = $link.closest( 'li' );
79
+
80
+ if ( $link.is( '.file' ) ) {
81
+
82
+ var win = window.dialogArguments || opener || parent || top;
83
+
84
+ win.send_to_editor( $link.attr( 'data-path' ) );
85
+
86
+ } else if ( $link.is( '.folder_open' ) ) {
87
+
88
+ $parent.find( 'ul' ).remove();
89
+ $link.removeClass( 'folder_open' );
90
+
91
+ } else {
92
+
93
+ $link.after( '<ul class="load_tree loading"></ul>' );
94
+
95
+ var data = {
96
+ action: 'download_monitor_list_files',
97
+ path: jQuery( this ).attr( 'data-path' ),
98
+ security: '<?php echo esc_js(wp_create_nonce("list-files")); ?>'
99
+ };
100
+
101
+ jQuery.post( '<?php echo esc_url( admin_url('admin-ajax.php') ); ?>', data, function ( response ) {
102
+
103
+ $link.addClass( 'folder_open' );
104
+
105
+ if ( response ) {
106
+ $parent.find( '.load_tree' ).html( response );
107
+ } else {
108
+ $parent.find( '.load_tree' ).html( '<li class="nofiles"><?php echo esc_html__('No files found', 'download-monitor'); ?></li>' );
109
+ }
110
+ $parent.find( '.load_tree' ).removeClass( 'load_tree loading' );
111
+
112
+ } );
113
+ }
114
+ return false;
115
+ } );
116
+ } );
117
+ </script>
118
+ <?php
119
+ echo '</body></html>';
120
+ }
121
+
122
  }
src/Admin/OptionsUpsells.php CHANGED
@@ -1,96 +1,96 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
- } // Exit if accessed directly
6
-
7
- /**
8
- * DLM_Admin class.
9
- */
10
- class DLM_Admin_OptionsUpsells {
11
-
12
- /**
13
- * __construct function.
14
- *
15
- * @access public
16
- */
17
- public function __construct() {
18
- add_action( 'dlm_options_end', array( $this, 'add_upsells_products' ), 99 );
19
- }
20
-
21
- public function get_active_addons(){
22
-
23
- return DLM_Product_Manager::get()->get_products();
24
- }
25
-
26
- public function add_upsells_products(){
27
-
28
- $active_addons = $this->get_active_addons();
29
-
30
- if( !array_key_exists( 'dlm-terms-and-conditions', $active_addons ) ){
31
- $this->render_terms_and_conditions_upsell();
32
- }
33
-
34
- if( !array_key_exists( 'dlm-twitter-lock', $active_addons ) ){
35
- $this->render_twitter_lock_upsell();
36
- }
37
-
38
- if( !array_key_exists( 'dlm-email-lock', $active_addons ) ){
39
- $this->render_email_lock_upsell();
40
- }
41
-
42
- if( !array_key_exists( 'dlm-captcha', $active_addons ) ){
43
- $this->render_captcha_upsell();
44
- }
45
-
46
-
47
- }
48
-
49
- public function render_terms_and_conditions_upsell(){
50
- ?>
51
- <a href="<?php echo esc_url( 'https://www.download-monitor.com/pricing/?utm_source=plugin&utm_medium=extension-block&utm_campaign=Terms%20and%20Conditions' ); ?>" class="options_upsell_link" target="_blank">
52
- <p class="form-field form-field-checkbox not-active">
53
- <span class="dashicons dashicons-lock"></span>
54
- <span><?php esc_html_e( 'Terms &amp; Conditions Required', 'download-monitor' ); ?><span class="dlm-upsell-badge">PRO</span> </span>
55
- <span class="dlm-description"> <?php esc_html_e( 'This download will only be downloadable after accepting the terms and conditions.', 'download-monitor' ); ?></span>
56
- </p>
57
- </a>
58
- <?php
59
- }
60
-
61
- public function render_twitter_lock_upsell(){
62
- ?>
63
- <a href="<?php echo esc_url( 'https://www.download-monitor.com/pricing/?utm_source=plugin&utm_medium=extension-block&utm_campaign=Twitter%20Lock' ); ?>" class="options_upsell_link" target="_blank">
64
- <p class="form-field form-field-checkbox not-active">
65
- <span class="dashicons dashicons-lock"></span>
66
- <span><?php esc_html_e( 'Twitter Lock', 'download-monitor' ); ?><span class="dlm-upsell-badge">PRO</span></span>
67
- <span class="dlm-description"> <?php esc_html_e( 'Twitter locked downloads will only be available after user tweets a predefined text.', 'download-monitor' ); ?></span>
68
- </p>
69
- </a>
70
- <?php
71
- }
72
-
73
- public function render_email_lock_upsell(){
74
- ?>
75
- <a href="<?php echo esc_url( 'https://www.download-monitor.com/pricing/?utm_source=plugin&utm_medium=extension-block&utm_campaign=Email%20Lock' ); ?>" class="options_upsell_link" target="_blank">
76
- <p class="form-field form-field-checkbox not-active">
77
- <span class="dashicons dashicons-lock"></span>
78
- <span><?php esc_html_e( 'Email Lock', 'download-monitor' ); ?><span class="dlm-upsell-badge">PRO</span></span>
79
- <span class="dlm-description"> <?php esc_html_e( 'Email locked downloads will only be available after user entered their email address.', 'download-monitor' ); ?></span>
80
- </p>
81
- </a>
82
- <?php
83
- }
84
-
85
- public function render_captcha_upsell(){
86
- ?>
87
- <a href="<?php echo esc_url( 'https://www.download-monitor.com/pricing/?utm_source=plugin&utm_medium=extension-block&utm_campaign=Captcha' ); ?>" class="options_upsell_link" target="_blank">
88
- <p class="form-field form-field-checkbox not-active">
89
- <span class="dashicons dashicons-lock"></span>
90
- <span><?php esc_html_e( 'Require Captcha', 'download-monitor' ); ?><span class="dlm-upsell-badge">PRO</span></span>
91
- <span class="dlm-description"> <?php esc_html_e( 'User is required to complete a reCAPTCHA before access is granted to the dowload.', 'download-monitor' ); ?></span>
92
- </p>
93
- </a>
94
- <?php
95
- }
96
  }
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ } // Exit if accessed directly
6
+
7
+ /**
8
+ * DLM_Admin class.
9
+ */
10
+ class DLM_Admin_OptionsUpsells {
11
+
12
+ /**
13
+ * __construct function.
14
+ *
15
+ * @access public
16
+ */
17
+ public function __construct() {
18
+ add_action( 'dlm_options_end', array( $this, 'add_upsells_products' ), 99 );
19
+ }
20
+
21
+ public function get_active_addons(){
22
+
23
+ return DLM_Product_Manager::get()->get_products();
24
+ }
25
+
26
+ public function add_upsells_products(){
27
+
28
+ $active_addons = $this->get_active_addons();
29
+
30
+ if( !array_key_exists( 'dlm-terms-and-conditions', $active_addons ) ){
31
+ $this->render_terms_and_conditions_upsell();
32
+ }
33
+
34
+ if( !array_key_exists( 'dlm-twitter-lock', $active_addons ) ){
35
+ $this->render_twitter_lock_upsell();
36
+ }
37
+
38
+ if( !array_key_exists( 'dlm-email-lock', $active_addons ) ){
39
+ $this->render_email_lock_upsell();
40
+ }
41
+
42
+ if( !array_key_exists( 'dlm-captcha', $active_addons ) ){
43
+ $this->render_captcha_upsell();
44
+ }
45
+
46
+
47
+ }
48
+
49
+ public function render_terms_and_conditions_upsell(){
50
+ ?>
51
+ <a href="<?php echo esc_url( 'https://www.download-monitor.com/pricing/?utm_source=plugin&utm_medium=extension-block&utm_campaign=Terms%20and%20Conditions' ); ?>" class="options_upsell_link" target="_blank">
52
+ <p class="form-field form-field-checkbox not-active">
53
+ <span class="dashicons dashicons-lock"></span>
54
+ <span><?php esc_html_e( 'Terms &amp; Conditions Required', 'download-monitor' ); ?><span class="dlm-upsell-badge">PRO</span> </span>
55
+ <span class="dlm-description"> <?php esc_html_e( 'This download will only be downloadable after accepting the terms and conditions.', 'download-monitor' ); ?></span>
56
+ </p>
57
+ </a>
58
+ <?php
59
+ }
60
+
61
+ public function render_twitter_lock_upsell(){
62
+ ?>
63
+ <a href="<?php echo esc_url( 'https://www.download-monitor.com/pricing/?utm_source=plugin&utm_medium=extension-block&utm_campaign=Twitter%20Lock' ); ?>" class="options_upsell_link" target="_blank">
64
+ <p class="form-field form-field-checkbox not-active">
65
+ <span class="dashicons dashicons-lock"></span>
66
+ <span><?php esc_html_e( 'Twitter Lock', 'download-monitor' ); ?><span class="dlm-upsell-badge">PRO</span></span>
67
+ <span class="dlm-description"> <?php esc_html_e( 'Twitter locked downloads will only be available after user tweets a predefined text.', 'download-monitor' ); ?></span>
68
+ </p>
69
+ </a>
70
+ <?php
71
+ }
72
+
73
+ public function render_email_lock_upsell(){
74
+ ?>
75
+ <a href="<?php echo esc_url( 'https://www.download-monitor.com/pricing/?utm_source=plugin&utm_medium=extension-block&utm_campaign=Email%20Lock' ); ?>" class="options_upsell_link" target="_blank">
76
+ <p class="form-field form-field-checkbox not-active">
77
+ <span class="dashicons dashicons-lock"></span>
78
+ <span><?php esc_html_e( 'Email Lock', 'download-monitor' ); ?><span class="dlm-upsell-badge">PRO</span></span>
79
+ <span class="dlm-description"> <?php esc_html_e( 'Email locked downloads will only be available after user entered their email address.', 'download-monitor' ); ?></span>
80
+ </p>
81
+ </a>
82
+ <?php
83
+ }
84
+
85
+ public function render_captcha_upsell(){
86
+ ?>
87
+ <a href="<?php echo esc_url( 'https://www.download-monitor.com/pricing/?utm_source=plugin&utm_medium=extension-block&utm_campaign=Captcha' ); ?>" class="options_upsell_link" target="_blank">
88
+ <p class="form-field form-field-checkbox not-active">
89
+ <span class="dashicons dashicons-lock"></span>
90
+ <span><?php esc_html_e( 'Require Captcha', 'download-monitor' ); ?><span class="dlm-upsell-badge">PRO</span></span>
91
+ <span class="dlm-description"> <?php esc_html_e( 'User is required to complete a reCAPTCHA before access is granted to the dowload.', 'download-monitor' ); ?></span>
92
+ </p>
93
+ </a>
94
+ <?php
95
+ }
96
  }
src/Admin/Settings/Fields/ActionButton.php CHANGED
@@ -1,56 +1,56 @@
1
- <?php
2
-
3
- class DLM_Admin_Fields_Field_ActionButton extends DLM_Admin_Fields_Field {
4
-
5
- /** @var string */
6
- private $link;
7
-
8
- /** @var string */
9
- private $label;
10
-
11
- /**
12
- * DLM_Admin_Fields_Field constructor.
13
- *
14
- * @param String $name
15
- * @param String $link
16
- * @param String $label
17
- */
18
- public function __construct( $name, $link, $label ) {
19
- $this->link = $link;
20
- $this->label = $label;
21
- parent::__construct( $name, '', '' );
22
- }
23
-
24
- /**
25
- * Generate nonce
26
- *
27
- * @return string
28
- */
29
- private function generate_nonce() {
30
- return wp_create_nonce( $this->get_name() );
31
- }
32
-
33
- /**
34
- * Get prepped URL
35
- *
36
- * @return string
37
- */
38
- private function get_url() {
39
- return add_query_arg( array(
40
- 'dlm_action' => $this->get_name(),
41
- 'dlm_nonce' => $this->generate_nonce()
42
- ), $this->link );
43
- }
44
-
45
- /**
46
- * Renders field
47
- *
48
- * The Button is quite an odd 'field'. It's basically just an a tag.
49
- */
50
- public function render() {
51
- ?>
52
- <a class="button" href="<?php echo esc_url( $this->get_url() ); ?>"><?php echo esc_html( $this->label ); ?></a>
53
- <?php
54
- }
55
-
56
  }
1
+ <?php
2
+
3
+ class DLM_Admin_Fields_Field_ActionButton extends DLM_Admin_Fields_Field {
4
+
5
+ /** @var string */
6
+ private $link;
7
+
8
+ /** @var string */
9
+ private $label;
10
+
11
+ /**
12
+ * DLM_Admin_Fields_Field constructor.
13
+ *
14
+ * @param String $name
15
+ * @param String $link
16
+ * @param String $label
17
+ */
18
+ public function __construct( $name, $link, $label ) {
19
+ $this->link = $link;
20
+ $this->label = $label;
21
+ parent::__construct( $name, '', '' );
22
+ }
23
+
24
+ /**
25
+ * Generate nonce
26
+ *
27
+ * @return string
28
+ */
29
+ private function generate_nonce() {
30
+ return wp_create_nonce( $this->get_name() );
31
+ }
32
+
33
+ /**
34
+ * Get prepped URL
35
+ *
36
+ * @return string
37
+ */
38
+ private function get_url() {
39
+ return add_query_arg( array(
40
+ 'dlm_action' => $this->get_name(),
41
+ 'dlm_nonce' => $this->generate_nonce()
42
+ ), $this->link );
43
+ }
44
+
45
+ /**
46
+ * Renders field
47
+ *
48
+ * The Button is quite an odd 'field'. It's basically just an a tag.
49
+ */
50
+ public function render() {
51
+ ?>
52
+ <a class="button" href="<?php echo esc_url( $this->get_url() ); ?>"><?php echo esc_html( $this->label ); ?></a>
53
+ <?php
54
+ }
55
+
56
  }
src/Admin/Settings/Fields/Desc.php CHANGED
@@ -1,14 +1,14 @@
1
- <?php
2
-
3
- class DLM_Admin_Fields_Field_Desc extends DLM_Admin_Fields_Field {
4
-
5
- /**
6
- * Renders field
7
- */
8
- public function render() {
9
- ?>
10
- <p class="dlm-setting-field-description"><?php echo wp_kses_post( $this->get_value() ); ?></p>
11
- <?php
12
- }
13
-
14
  }
1
+ <?php
2
+
3
+ class DLM_Admin_Fields_Field_Desc extends DLM_Admin_Fields_Field {
4
+
5
+ /**
6
+ * Renders field
7
+ */
8
+ public function render() {
9
+ ?>
10
+ <p class="dlm-setting-field-description"><?php echo wp_kses_post( $this->get_value() ); ?></p>
11
+ <?php
12
+ }
13
+
14
  }
src/Admin/Settings/Fields/FieldFactory.php CHANGED
@@ -48,6 +48,9 @@ class DLM_Admin_Fields_Field_Factory {
48
  case 'gateway_overview':
49
  $field = new \Never5\DownloadMonitor\Shop\Admin\Fields\GatewayOverview( $option['gateways'] );
50
  break;
 
 
 
51
  default:
52
  /**
53
  * do_filter: dlm_setting_field_$type: (null) $field, (array) $option, (String) $value, (String) $placeholder
48
  case 'gateway_overview':
49
  $field = new \Never5\DownloadMonitor\Shop\Admin\Fields\GatewayOverview( $option['gateways'] );
50
  break;
51
+ case 'htaccess_status':
52
+ $field = new DLM_Admin_Fields_Field_HtaccessStatus( $option );
53
+ break;
54
  default:
55
  /**
56
  * do_filter: dlm_setting_field_$type: (null) $field, (array) $option, (String) $value, (String) $placeholder
src/Admin/Settings/Fields/HtaccessStatus.php ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class DLM_Admin_Fields_Field_HtaccessStatus extends DLM_Admin_Fields_Field {
4
+
5
+ /**
6
+ *
7
+ * @var String
8
+ */
9
+ private $icon;
10
+
11
+ /**
12
+ *
13
+ * @var String
14
+ */
15
+ private $icon_text;
16
+
17
+ /**
18
+ *
19
+ * @var String
20
+ */
21
+ private $icon_color;
22
+
23
+ /**
24
+ *
25
+ * @var String
26
+ */
27
+ private $link;
28
+
29
+ /**
30
+ *
31
+ * @var String
32
+ */
33
+ private $label;
34
+
35
+ /**
36
+ *
37
+ * @var String
38
+ */
39
+ private $disabled;
40
+
41
+ /**
42
+ * DLM_Admin_Fields_Field_HtaccessStatus constructor
43
+ *
44
+ * @param Array $option Array containing all options of the button
45
+ */
46
+ public function __construct( $option ) {
47
+
48
+ $this->icon = isset( $option['icon'] ) ? $option['icon'] : '';
49
+ $this->icon_text = isset( $option['icon-text'] ) ? $option['icon-text'] : '';
50
+ $this->icon_color = isset( $option['icon-color'] ) ? $option['icon-color'] : '';
51
+ $this->link = isset( $option['link'] ) ? $option['link'] : '';
52
+ $this->label = isset( $option['label'] ) ? $option['label'] : '';
53
+ $this->disabled = ( isset( $option['disabled'] ) && 'true' === $option['disabled'] ) ? true : false;
54
+ $name = isset( $option['name'] ) ? $option['name'] : '';
55
+
56
+ parent::__construct( $name, '', '' );
57
+ }
58
+
59
+ /**
60
+ * Generate nonce
61
+ *
62
+ * @return string
63
+ */
64
+ private function generate_nonce() {
65
+ return wp_create_nonce( $this->get_name() );
66
+ }
67
+
68
+ /**
69
+ * Get prepped URL
70
+ *
71
+ * @return string
72
+ */
73
+ private function get_url() {
74
+ return add_query_arg(
75
+ array(
76
+ 'dlm_action' => $this->get_name(),
77
+ 'dlm_nonce' => $this->generate_nonce(),
78
+ ),
79
+ $this->link
80
+ );
81
+ }
82
+ /**
83
+ * Renders field
84
+ */
85
+ public function render() {
86
+ ?>
87
+ <p class="dlm_htaccess_notice"><span style="color:<?php echo esc_attr( $this->icon_color ); ?>" class="dashicons <?php echo esc_attr( $this->icon ); ?>"></span> <?php echo wp_kses_post( $this->icon_text ); ?></p>
88
+ <a class="button" <?php echo ( $this->disabled ) ? 'disabled="disabled"' : ''; ?> href="<?php echo esc_url( $this->get_url() ); ?>"><?php echo wp_kses_post( $this->label ); ?></a>
89
+ <?php
90
+ }
91
+
92
+ }
src/Admin/Settings/Fields/Title.php CHANGED
@@ -1,30 +1,30 @@
1
- <?php
2
-
3
- class DLM_Admin_Fields_Field_Title extends DLM_Admin_Fields_Field {
4
-
5
- /** @var string */
6
- private $link;
7
-
8
- /** @var string */
9
- private $title;
10
-
11
- /**
12
- * DLM_Admin_Fields_Field_Title constructor.
13
- *
14
- * @param String $title
15
- */
16
- public function __construct( $title ) {
17
- $this->title = $title;
18
- parent::__construct( '', '', '' );
19
- }
20
-
21
- /**
22
- * Renders field
23
- */
24
- public function render() {
25
- ?>
26
- <h3><?php echo esc_html( $this->title ); ?></h3>
27
- <?php
28
- }
29
-
30
  }
1
+ <?php
2
+
3
+ class DLM_Admin_Fields_Field_Title extends DLM_Admin_Fields_Field {
4
+
5
+ /** @var string */
6
+ private $link;
7
+
8
+ /** @var string */
9
+ private $title;
10
+
11
+ /**
12
+ * DLM_Admin_Fields_Field_Title constructor.
13
+ *
14
+ * @param String $title
15
+ */
16
+ public function __construct( $title ) {
17
+ $this->title = $title;
18
+ parent::__construct( '', '', '' );
19
+ }
20
+
21
+ /**
22
+ * Renders field
23
+ */
24
+ public function render() {
25
+ ?>
26
+ <h3><?php echo esc_html( $this->title ); ?></h3>
27
+ <?php
28
+ }
29
+
30
  }
src/Admin/Settings/Page.php CHANGED
@@ -55,7 +55,14 @@ class DLM_Settings_Page {
55
  case 'dlm_clear_transients':
56
  $result = download_monitor()->service( 'transient_manager' )->clear_all_version_transients();
57
  if ( $result ) {
58
- wp_redirect( add_query_arg( array( 'dlm_action_done' => $action ), DLM_Admin_Settings::get_url() ) );
 
 
 
 
 
 
 
59
  exit;
60
  }
61
  break;
@@ -96,6 +103,9 @@ class DLM_Settings_Page {
96
  case 'dlm_clear_transients':
97
  echo "<p>" . esc_html__( 'Download Monitor Transients successfully cleared!', 'download-monitor' ) . "</p>";
98
  break;
 
 
 
99
  }
100
  ?>
101
  </div>
@@ -278,6 +288,8 @@ class DLM_Settings_Page {
278
  add_action( 'in_admin_header', array( $this, 'dlm_page_header' ) );
279
 
280
  add_filter( 'dlm_page_header', array( $this, 'page_header_locations' ) );
 
 
281
  }
282
 
283
  /**
@@ -389,4 +401,133 @@ class DLM_Settings_Page {
389
  return ( ! empty( $_GET['section'] ) ? sanitize_title( wp_unslash($_GET['section']) ) : $this->array_first_key( $sections ) );
390
  }
391
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
392
  }
55
  case 'dlm_clear_transients':
56
  $result = download_monitor()->service( 'transient_manager' )->clear_all_version_transients();
57
  if ( $result ) {
58
+ wp_redirect( add_query_arg( array( 'dlm_action_done' => $action ), admin_url( 'edit.php?post_type=dlm_download&page=download-monitor-settings&tab=advanced&section=misc' ) ) );
59
+ exit;
60
+ }
61
+ break;
62
+ case 'dlm_regenerate_protection':
63
+
64
+ if ( $this->regenerate_protection() ) {
65
+ wp_redirect( add_query_arg( array( 'dlm_action_done' => $action ), admin_url( 'edit.php?post_type=dlm_download&page=download-monitor-settings&tab=advanced&section=misc' ) ) );
66
  exit;
67
  }
68
  break;
103
  case 'dlm_clear_transients':
104
  echo "<p>" . esc_html__( 'Download Monitor Transients successfully cleared!', 'download-monitor' ) . "</p>";
105
  break;
106
+ case 'dlm_regenerate_protection':
107
+ echo "<p>" . esc_html__( '.htaccess file successfully regenerated!', 'download-monitor' ) . "</p>";
108
+ break;
109
  }
110
  ?>
111
  </div>
288
  add_action( 'in_admin_header', array( $this, 'dlm_page_header' ) );
289
 
290
  add_filter( 'dlm_page_header', array( $this, 'page_header_locations' ) );
291
+
292
+ add_filter( 'dlm_settings', array( $this, 'access_files_checker_field' ) );
293
  }
294
 
295
  /**
401
  return ( ! empty( $_GET['section'] ) ? sanitize_title( wp_unslash($_GET['section']) ) : $this->array_first_key( $sections ) );
402
  }
403
 
404
+ /**
405
+ * Function used to regenerate the .htaccess for the dlm_uploads folder
406
+ *
407
+ * @return void
408
+ *
409
+ * @since 4.5.5
410
+ */
411
+ private function regenerate_protection(){
412
+ $upload_dir = wp_upload_dir();
413
+
414
+ $htaccess_path = $upload_dir['basedir'] . '/dlm_uploads/.htaccess';
415
+ $index_path = $upload_dir['basedir'] . '/dlm_uploads/index.html';
416
+
417
+ //remove old htaccess and index files
418
+ if ( file_exists( $htaccess_path ) ) {
419
+ unlink( $htaccess_path );
420
+ }
421
+ if ( file_exists( $index_path ) ) {
422
+ unlink( $index_path );
423
+ }
424
+
425
+ //generate new htaccess and index files
426
+ $this->directory_protection();
427
+
428
+ //check if the files were created.
429
+ if ( file_exists( $htaccess_path ) && file_exists( $index_path ) ) {
430
+ return true;
431
+ }
432
+
433
+ return false;
434
+ }
435
+
436
+ /**
437
+ * Add setting to check if the .htaccess file is there
438
+ *
439
+ * @param Array $settings
440
+ * @return void
441
+ *
442
+ * @since 4.5.5
443
+ */
444
+ public function access_files_checker_field( $settings ){
445
+
446
+ $upload_dir = wp_upload_dir();
447
+ $htaccess_path = $upload_dir['basedir'] . '/dlm_uploads/.htaccess';
448
+ $icon = 'dashicons-dismiss';
449
+ $icon_color = '#f00';
450
+ $icon_text = __( 'Htaccess is missing.', 'download-monitor' );
451
+
452
+ if ( file_exists( $htaccess_path ) ) {
453
+ $icon = 'dashicons-yes-alt';
454
+ $icon_color = '#00A32A';
455
+ $icon_text = __( 'You are protected by htaccess.', 'download-monitor' );
456
+ }
457
+
458
+ if ( stristr( sanitize_text_field( wp_unslash( $_SERVER['SERVER_SOFTWARE'] ) ), 'nginx' ) !== false ) {
459
+
460
+ $upload_path = str_replace( sanitize_text_field( wp_unslash( $_SERVER['DOCUMENT_ROOT'] ) ), '', $upload_dir['basedir'] );
461
+ $nginx_rules = "<code class='dlm-code-nginx-rules'>location " . $upload_path . "/dlm_uploads {<br />deny all;<br />return 403;<br />}</code>";
462
+
463
+ $nginx_text = sprintf( __( 'Please add the following rules to your nginx config to disable direct file access: %s', 'download-monitor'), wp_kses_post( $nginx_rules ) );
464
+
465
+ $icon = 'dashicons-dismiss';
466
+ $icon_color = '#f00';
467
+ $icon_text = sprintf( __( 'Because your server is running on nginx, our .htaccess file can\'t protect your downloads. %s', 'download-monitor' ), $nginx_text );
468
+ $disabled = true;
469
+ }
470
+
471
+ $settings['advanced']['sections']['misc']['fields'][] = array(
472
+ 'name' => 'dlm_regenerate_protection',
473
+ 'label' => __( 'Regenerate protection for uploads folder', 'download-monitor' ),
474
+ 'desc' => __( 'Regenerates the .htaccess file.', 'download-monitor' ),
475
+ 'link' => admin_url( 'edit.php?post_type=dlm_download&page=download-monitor-settings' ) . '&tab=advanced&section=misc',
476
+ 'icon' => $icon,
477
+ 'icon-color' => $icon_color,
478
+ 'icon-text' => $icon_text,
479
+ 'disabled' => isset( $disabled ) ? 'true' : 'false',
480
+ 'type' => 'htaccess_status',
481
+ );
482
+
483
+ return $settings;
484
+ }
485
+
486
+ /**
487
+ * Protect the upload dir on activation.
488
+ *
489
+ * @access public
490
+ * @return void
491
+ *
492
+ * @since 4.5.5 // Copied from Installer.php
493
+ */
494
+ private function directory_protection() {
495
+
496
+ // Install files and folders for uploading files and prevent hotlinking
497
+ $upload_dir = wp_upload_dir();
498
+
499
+ $htaccess_content = "# Apache 2.4 and up
500
+ <IfModule mod_authz_core.c>
501
+ Require all denied
502
+ </IfModule>
503
+
504
+ # Apache 2.3 and down
505
+ <IfModule !mod_authz_core.c>
506
+ Order Allow,Deny
507
+ Deny from all
508
+ </IfModule>";
509
+
510
+ $files = array(
511
+ array(
512
+ 'base' => $upload_dir['basedir'] . '/dlm_uploads',
513
+ 'file' => '.htaccess',
514
+ 'content' => $htaccess_content
515
+ ),
516
+ array(
517
+ 'base' => $upload_dir['basedir'] . '/dlm_uploads',
518
+ 'file' => 'index.html',
519
+ 'content' => ''
520
+ )
521
+ );
522
+
523
+ foreach ( $files as $file ) {
524
+ if ( wp_mkdir_p( $file['base'] ) && ! file_exists( trailingslashit( $file['base'] ) . $file['file'] ) ) {
525
+ if ( $file_handle = @fopen( trailingslashit( $file['base'] ) . $file['file'], 'w' ) ) {
526
+ fwrite( $file_handle, $file['content'] );
527
+ fclose( $file_handle );
528
+ }
529
+ }
530
+ }
531
+ }
532
+
533
  }
src/Admin/ViewManager.php CHANGED
@@ -1,33 +1,33 @@
1
- <?php
2
-
3
- class DLM_View_Manager {
4
-
5
- /**
6
- * Display a view
7
- *
8
- * @param String $view
9
- * @param array $vars
10
- * @param String $path
11
- */
12
- public function display( $view, $vars=array(), $path = '' ) {
13
-
14
- // setup variables
15
- extract( $vars );
16
-
17
- // set default path if $path is empty
18
- if ( empty( $path ) ) {
19
- $path = download_monitor()->get_plugin_path() . 'assets/views/';
20
- }
21
-
22
- // setup full view path
23
- $view = $path . $view . '.php';
24
-
25
- // check if view exists
26
- if ( file_exists( $view ) ) {
27
-
28
- // load view
29
- include( $view );
30
- }
31
- }
32
-
33
  }
1
+ <?php
2
+
3
+ class DLM_View_Manager {
4
+
5
+ /**
6
+ * Display a view
7
+ *
8
+ * @param String $view
9
+ * @param array $vars
10
+ * @param String $path
11
+ */
12
+ public function display( $view, $vars=array(), $path = '' ) {
13
+
14
+ // setup variables
15
+ extract( $vars );
16
+
17
+ // set default path if $path is empty
18
+ if ( empty( $path ) ) {
19
+ $path = download_monitor()->get_plugin_path() . 'assets/views/';
20
+ }
21
+
22
+ // setup full view path
23
+ $view = $path . $view . '.php';
24
+
25
+ // check if view exists
26
+ if ( file_exists( $view ) ) {
27
+
28
+ // load view
29
+ include( $view );
30
+ }
31
+ }
32
+
33
  }
src/Ajax/Ajax.php CHANGED
@@ -1,33 +1,33 @@
1
- <?php
2
-
3
- abstract class DLM_Ajax {
4
- private $tag = '';
5
-
6
- /**
7
- * @param string $tag
8
- */
9
- public function __construct( $tag ) {
10
- $this->tag = $tag;
11
- }
12
-
13
- /**
14
- * Register AJAX action
15
- */
16
- public function register() {
17
- add_action( DLM_Ajax_Manager::ENDPOINT . $this->tag, array( $this, 'run' ) );
18
- }
19
-
20
- /**
21
- * Checks AJAX nonce
22
- */
23
- protected function check_nonce() {
24
- check_ajax_referer( 'dlm_ajax_nonce_' . $this->tag, 'nonce' );
25
- }
26
-
27
- /**
28
- * AJAX callback method, must be overridden
29
- *
30
- * @return void
31
- */
32
- public abstract function run();
33
  }
1
+ <?php
2
+
3
+ abstract class DLM_Ajax {
4
+ private $tag = '';
5
+
6
+ /**
7
+ * @param string $tag
8
+ */
9
+ public function __construct( $tag ) {
10
+ $this->tag = $tag;
11
+ }
12
+
13
+ /**
14
+ * Register AJAX action
15
+ */
16
+ public function register() {
17
+ add_action( DLM_Ajax_Manager::ENDPOINT . $this->tag, array( $this, 'run' ) );
18
+ }
19
+
20
+ /**
21
+ * Checks AJAX nonce
22
+ */
23
+ protected function check_nonce() {
24
+ check_ajax_referer( 'dlm_ajax_nonce_' . $this->tag, 'nonce' );
25
+ }
26
+
27
+ /**
28
+ * AJAX callback method, must be overridden
29
+ *
30
+ * @return void
31
+ */
32
+ public abstract function run();
33
  }
src/Ajax/GetDownloads.php CHANGED
@@ -1,41 +1,41 @@
1
- <?php
2
-
3
- class DLM_Ajax_GetDownloads extends DLM_Ajax {
4
-
5
- /**
6
- * Constructor
7
- */
8
- public function __construct() {
9
- parent::__construct( 'get_downloads' );
10
- }
11
-
12
- /**
13
- * AJAX callback method
14
- *
15
- * @return void
16
- */
17
- public function run() {
18
- // check nonce
19
- $this->check_nonce();
20
-
21
- $downloads = download_monitor()->service( 'download_repository' )->retrieve( array(
22
- 'orderby' => 'title',
23
- 'order' => 'ASC'
24
- ) );
25
- $downloads_array = array();
26
- if ( ! empty( $downloads ) ) {
27
- /** @var DLM_Download $download */
28
- foreach ( $downloads as $download ) {
29
- $downloads_array[] = array(
30
- 'value' => $download->get_id(),
31
- 'label' => $download->get_title()
32
- );
33
- }
34
- }
35
-
36
- wp_send_json( $downloads_array );
37
-
38
- exit;
39
- }
40
-
41
  }
1
+ <?php
2
+
3
+ class DLM_Ajax_GetDownloads extends DLM_Ajax {
4
+
5
+ /**
6
+ * Constructor
7
+ */
8
+ public function __construct() {
9
+ parent::__construct( 'get_downloads' );
10
+ }
11
+
12
+ /**
13
+ * AJAX callback method
14
+ *
15
+ * @return void
16
+ */
17
+ public function run() {
18
+ // check nonce
19
+ $this->check_nonce();
20
+
21
+ $downloads = download_monitor()->service( 'download_repository' )->retrieve( array(
22
+ 'orderby' => 'title',
23
+ 'order' => 'ASC'
24
+ ) );
25
+ $downloads_array = array();
26
+ if ( ! empty( $downloads ) ) {
27
+ /** @var DLM_Download $download */
28
+ foreach ( $downloads as $download ) {
29
+ $downloads_array[] = array(
30
+ 'value' => $download->get_id(),
31
+ 'label' => $download->get_title()
32
+ );
33
+ }
34
+ }
35
+
36
+ wp_send_json( $downloads_array );
37
+
38
+ exit;
39
+ }
40
+
41
  }
src/Ajax/GetVersions.php CHANGED
@@ -1,54 +1,54 @@
1
- <?php
2
-
3
- class DLM_Ajax_GetVersions extends DLM_Ajax {
4
-
5
- /**
6
- * Constructor
7
- */
8
- public function __construct() {
9
- parent::__construct( 'get_versions' );
10
- }
11
-
12
- /**
13
- * AJAX callback method
14
- *
15
- * @return void
16
- */
17
- public function run() {
18
- // check nonce
19
- $this->check_nonce();
20
-
21
- if ( ! isset( $_GET['download_id'] ) ) {
22
- wp_send_json( array() );
23
- exit;
24
- }
25
-
26
- $download_id = absint( $_GET['download_id'] );
27
-
28
- try {
29
- /** @var DLM_Download $download */
30
- $download = download_monitor()->service( 'download_repository' )->retrieve_single( $download_id );
31
- } catch ( Exception $exception ) {
32
- wp_send_json( array() );
33
- exit;
34
- }
35
-
36
- $versions = $download->get_versions();
37
-
38
- $versions_array = array();
39
- if ( ! empty( $download ) ) {
40
- /** @var DLM_Download_Version $version */
41
- foreach ( $versions as $version ) {
42
- $versions_array[] = array(
43
- 'value' => $version->get_id(),
44
- 'label' => $version->get_version()
45
- );
46
- }
47
- }
48
-
49
- wp_send_json( $versions_array );
50
-
51
- exit;
52
- }
53
-
54
  }
1
+ <?php
2
+
3
+ class DLM_Ajax_GetVersions extends DLM_Ajax {
4
+
5
+ /**
6
+ * Constructor
7
+ */
8
+ public function __construct() {
9
+ parent::__construct( 'get_versions' );
10
+ }
11
+
12
+ /**
13
+ * AJAX callback method
14
+ *
15
+ * @return void
16
+ */
17
+ public function run() {
18
+ // check nonce
19
+ $this->check_nonce();
20
+
21
+ if ( ! isset( $_GET['download_id'] ) ) {
22
+ wp_send_json( array() );
23
+ exit;
24
+ }
25
+
26
+ $download_id = absint( $_GET['download_id'] );
27
+
28
+ try {
29
+ /** @var DLM_Download $download */
30
+ $download = download_monitor()->service( 'download_repository' )->retrieve_single( $download_id );
31
+ } catch ( Exception $exception ) {
32
+ wp_send_json( array() );
33
+ exit;
34
+ }
35
+
36
+ $versions = $download->get_versions();
37
+
38
+ $versions_array = array();
39
+ if ( ! empty( $download ) ) {
40
+ /** @var DLM_Download_Version $version */
41
+ foreach ( $versions as $version ) {
42
+ $versions_array[] = array(
43
+ 'value' => $version->get_id(),
44
+ 'label' => $version->get_version()
45
+ );
46
+ }
47
+ }
48
+
49
+ wp_send_json( $versions_array );
50
+
51
+ exit;
52
+ }
53
+
54
  }
src/Ajax/Manager.php CHANGED
@@ -1,85 +1,85 @@
1
- <?php
2
-
3
- class DLM_Ajax_Manager {
4
- const ENDPOINT = 'dlm-ajax';
5
-
6
- /**a
7
- * Setup custom AJAX calls & custom AJAX handler
8
- */
9
- public function setup() {
10
- add_action( 'init', array( $this, 'add_endpoints' ) );
11
- add_action( 'template_redirect', array( $this, 'handle_ajax' ), 0 );
12
- $this->add_ajax_actions();
13
- }
14
-
15
- /**
16
- * Add endpoints
17
- */
18
- public function add_endpoints() {
19
- add_rewrite_tag( '%' . self::ENDPOINT . '%', '([^/]*)' );
20
- add_rewrite_rule( self::ENDPOINT . '/([^/]*)/?', 'index.php?' . self::ENDPOINT . '=$matches[1]', 'top' );
21
- add_rewrite_rule( 'index.php/' . self::ENDPOINT . '/([^/]*)/?', 'index.php?' . self::ENDPOINT . '=$matches[1]', 'top' );
22
- }
23
-
24
- /**
25
- * Get AJAX for given ajax
26
- *
27
- * @param string $action
28
- * @param bool $include_nonce
29
- *
30
- * @return string
31
- */
32
- public static function get_ajax_url( $action, $include_nonce = true ) {
33
- return untrailingslashit( home_url( sprintf( '?%s=%s&nonce=%s', self::ENDPOINT, $action, wp_create_nonce( 'dlm_ajax_nonce_' . $action ) ) ) );
34
- }
35
-
36
- /**
37
- * Add AJAX actions
38
- */
39
- private function add_ajax_actions() {
40
-
41
- $get_downloads = new DLM_Ajax_GetDownloads();
42
- $get_downloads->register();
43
-
44
- $get_versions = new DLM_Ajax_GetVersions();
45
- $get_versions->register();
46
-
47
- $create_page = new DLM_Ajax_CreatePage();
48
- $create_page->register();
49
-
50
- }
51
-
52
- /**
53
- * Handle AJAX requests
54
- */
55
- public function handle_ajax() {
56
- global $wp_query;
57
-
58
- // set AJAX action if it's set in $_GET
59
- if ( ! empty( $_GET[ self::ENDPOINT ] ) ) {
60
- $wp_query->set( self::ENDPOINT, sanitize_text_field( wp_unslash($_GET[ self::ENDPOINT ]) ) );
61
- }
62
-
63
- // check if endpoint is not false or an empty string
64
- if ( false != $wp_query->get( self::ENDPOINT ) && '' != trim( $wp_query->get( self::ENDPOINT ) ) ) {
65
-
66
- // set AJAX action into var
67
- $action = sanitize_text_field( $wp_query->get( self::ENDPOINT ) );
68
-
69
- // set DOING AJAX to true
70
- if ( ! defined( 'DOING_AJAX' ) ) {
71
- define( 'DOING_AJAX', true );
72
- }
73
-
74
- // set is_home to false
75
- $wp_query->is_home = false;
76
-
77
- // run custom AJAX action
78
- do_action( self::ENDPOINT . $action );
79
-
80
- // bye
81
- die();
82
-
83
- }
84
- }
85
  }
1
+ <?php
2
+
3
+ class DLM_Ajax_Manager {
4
+ const ENDPOINT = 'dlm-ajax';
5
+
6
+ /**a
7
+ * Setup custom AJAX calls & custom AJAX handler
8
+ */
9
+ public function setup() {
10
+ add_action( 'init', array( $this, 'add_endpoints' ) );
11
+ add_action( 'template_redirect', array( $this, 'handle_ajax' ), 0 );
12
+ $this->add_ajax_actions();
13
+ }
14
+
15
+ /**
16
+ * Add endpoints
17
+ */
18
+ public function add_endpoints() {
19
+ add_rewrite_tag( '%' . self::ENDPOINT . '%', '([^/]*)' );
20
+ add_rewrite_rule( self::ENDPOINT . '/([^/]*)/?', 'index.php?' . self::ENDPOINT . '=$matches[1]', 'top' );
21
+ add_rewrite_rule( 'index.php/' . self::ENDPOINT . '/([^/]*)/?', 'index.php?' . self::ENDPOINT . '=$matches[1]', 'top' );
22
+ }
23
+
24
+ /**
25
+ * Get AJAX for given ajax
26
+ *
27
+ * @param string $action
28
+ * @param bool $include_nonce
29
+ *
30
+ * @return string
31
+ */
32
+ public static function get_ajax_url( $action, $include_nonce = true ) {
33
+ return untrailingslashit( home_url( sprintf( '?%s=%s&nonce=%s', self::ENDPOINT, $action, wp_create_nonce( 'dlm_ajax_nonce_' . $action ) ) ) );
34
+ }
35
+
36
+ /**
37
+ * Add AJAX actions
38
+ */
39
+ private function add_ajax_actions() {
40
+
41
+ $get_downloads = new DLM_Ajax_GetDownloads();
42
+ $get_downloads->register();
43
+
44
+ $get_versions = new DLM_Ajax_GetVersions();
45
+ $get_versions->register();
46
+
47
+ $create_page = new DLM_Ajax_CreatePage();
48
+ $create_page->register();
49
+
50
+ }
51
+
52
+ /**
53
+ * Handle AJAX requests
54
+ */
55
+ public function handle_ajax() {
56
+ global $wp_query;
57
+
58
+ // set AJAX action if it's set in $_GET
59
+ if ( ! empty( $_GET[ self::ENDPOINT ] ) ) {
60
+ $wp_query->set( self::ENDPOINT, sanitize_text_field( wp_unslash($_GET[ self::ENDPOINT ]) ) );
61
+ }
62
+
63
+ // check if endpoint is not false or an empty string
64
+ if ( false != $wp_query->get( self::ENDPOINT ) && '' != trim( $wp_query->get( self::ENDPOINT ) ) ) {
65
+
66
+ // set AJAX action into var
67
+ $action = sanitize_text_field( $wp_query->get( self::ENDPOINT ) );
68
+
69
+ // set DOING AJAX to true
70
+ if ( ! defined( 'DOING_AJAX' ) ) {
71
+ define( 'DOING_AJAX', true );
72
+ }
73
+
74
+ // set is_home to false
75
+ $wp_query->is_home = false;
76
+
77
+ // run custom AJAX action
78
+ do_action( self::ENDPOINT . $action );
79
+
80
+ // bye
81
+ die();
82
+
83
+ }
84
+ }
85
  }
src/AjaxHandler.php CHANGED
@@ -1,287 +1,287 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
- } // Exit if accessed directly
6
-
7
- /**
8
- * DLM_Ajax_Handler class.
9
- */
10
- class DLM_Ajax_Handler {
11
-
12
- /**
13
- * __construct function.
14
- *
15
- * @access public
16
- */
17
- public function __construct() {
18
- add_action( 'wp_ajax_download_monitor_remove_file', array( $this, 'remove_file' ) );
19
- add_action( 'wp_ajax_download_monitor_add_file', array( $this, 'add_file' ) );
20
- add_action( 'wp_ajax_download_monitor_list_files', array( $this, 'list_files' ) );
21
- add_action( 'wp_ajax_download_monitor_insert_panel_upload', array( $this, 'insert_panel_upload' ) );
22
- add_action( 'wp_ajax_dlm_settings_lazy_select', array( $this, 'handle_settings_lazy_select' ) );
23
- add_action( 'wp_ajax_dlm_extension', array( $this, 'handle_extensions' ) );
24
- add_action( 'wp_ajax_dlm_dismiss_notice', array( $this, 'dismiss_notice' ) );
25
- }
26
-
27
- /**
28
- * insert_panel_upload function.
29
- *
30
- * @access public
31
- * @return void
32
- */
33
- public function insert_panel_upload() {
34
-
35
- check_ajax_referer( 'file-upload' );
36
-
37
- // Check user rights
38
- if ( ! current_user_can( 'manage_downloads' ) ) {
39
- die();
40
- }
41
-
42
- require_once( ABSPATH . 'wp-admin/includes/image.php' );
43
- require_once( ABSPATH . 'wp-admin/includes/file.php' );
44
- require_once( ABSPATH . 'wp-admin/includes/media.php' );
45
-
46
- $attachment_id = media_handle_upload( 'async-upload', 0 );
47
-
48
- if ( ! is_wp_error( $attachment_id ) ) {
49
- $attachment_url = wp_get_attachment_url( $attachment_id );
50
-
51
- if ( false !== $attachment_url ) {
52
- echo esc_url( $attachment_url );
53
- }
54
- }
55
-
56
- die();
57
- }
58
-
59
- /**
60
- * remove_file function.
61
- *
62
- * @access public
63
- * @return void
64
- */
65
- public function remove_file() {
66
-
67
- check_ajax_referer( 'remove-file', 'security' );
68
-
69
- // Check user rights
70
- if ( ! current_user_can( 'manage_downloads' ) ) {
71
- die();
72
- }
73
-
74
- if ( ! isset( $_POST['file_id'] ) ) {
75
- die();
76
- }
77
-
78
- $file = get_post( intval( $_POST['file_id'] ) );
79
-
80
- if ( $file && $file->post_type == "dlm_download_version" ) {
81
- // clear transient
82
- download_monitor()->service( 'transient_manager' )->clear_versions_transient( $file->post_parent );
83
-
84
- wp_delete_post( $file->ID );
85
- }
86
-
87
- die();
88
- }
89
-
90
- /**
91
- * add_file function.
92
- *
93
- * @access public
94
- * @return void
95
- */
96
- public function add_file() {
97
-
98
- // check nonce
99
- check_ajax_referer( 'add-file', 'security' );
100
-
101
- // Check user rights
102
- if ( ! current_user_can( 'manage_downloads' ) ) {
103
- die();
104
- }
105
-
106
- // get POST data
107
- $download_id = isset( $_POST['post_id'] ) ? absint( $_POST['post_id'] ) : 0;
108
- $size = isset( $_POST['size'] ) ? absint( $_POST['size'] ) : 0;
109
-
110
- /** @var DLM_Download_Version $new_version */
111
- $new_version = new DLM_Download_Version();
112
-
113
- // set download id
114
- $new_version->set_download_id( $download_id );
115
-
116
- // set other version data
117
- $new_version->set_author( get_current_user_id() );
118
- $new_version->set_date( new DateTime( current_time( 'mysql' ) ) );
119
-
120
- // persist new version
121
- download_monitor()->service( 'version_repository' )->persist( $new_version );
122
-
123
- // clear download transient
124
- download_monitor()->service( 'transient_manager' )->clear_versions_transient( $download_id );
125
-
126
- // output new version admin html
127
- download_monitor()->service( 'view_manager' )->display( 'meta-box/version', array(
128
- 'version_increment' => $size,
129
- 'file_id' => $new_version->get_id(),
130
- 'file_version' => $new_version->get_version(),
131
- 'file_post_date' => $new_version->get_date(),
132
- 'file_download_count' => $new_version->get_download_count(),
133
- 'file_urls' => $new_version->get_mirrors(),
134
- 'version' => $new_version
135
- ) );
136
-
137
- die();
138
- }
139
-
140
- /**
141
- * list_files function.
142
- *
143
- * @access public
144
- * @return void
145
- */
146
- public function list_files() {
147
-
148
- // Check Nonce
149
- check_ajax_referer( 'list-files', 'security' );
150
-
151
- // Check user rights
152
- if ( ! current_user_can( 'manage_downloads' ) ) {
153
- die();
154
- }
155
-
156
- if ( ! isset( $_POST['path'] ) ) {
157
- die();
158
- }
159
-
160
- $path = sanitize_text_field( wp_unslash( $_POST['path'] ) );
161
-
162
- // List all files
163
- $files = download_monitor()->service( 'file_manager' )->list_files( $path );
164
-
165
- foreach ( $files as $found_file ) {
166
-
167
- // Multi-byte-safe pathinfo
168
- $file = download_monitor()->service( 'file_manager' )->mb_pathinfo( $found_file['path'] );
169
-
170
- if ( $found_file['type'] == 'folder' ) {
171
-
172
- echo '<li><a href="#" class="folder" data-path="' . esc_attr( trailingslashit( $file['dirname'] ) ) . esc_attr( $file['basename'] ) . '">' . esc_attr( $file['basename'] ) . '</a></li>';
173
-
174
- } else {
175
-
176
- $filename = $file['basename'];
177
- $extension = ( empty( $file['extension'] ) ) ? '' : $file['extension'];
178
-
179
- if ( substr( $filename, 0, 1 ) == '.' ) {
180
- continue;
181
- } // Ignore files starting with . like htaccess
182
- if ( in_array( $extension, array( '', 'php', 'html', 'htm', 'tmp' ) ) ) {
183
- continue;
184
- } // Ignored file types
185
-
186
- echo '<li><a href="#" class="file filetype-' . esc_attr( sanitize_title( $extension ) ) . '" data-path="' . esc_attr( trailingslashit( $file['dirname'] ) ) . esc_attr( $file['basename'] ) . '">' . esc_attr( $file['basename'] ) . '</a></li>';
187
-
188
- }
189
-
190
- }
191
-
192
- die();
193
- }
194
-
195
- /**
196
- * Handle notice dismissal
197
- */
198
- public function dismiss_notice() {
199
-
200
- // check notice
201
- if ( ! isset( $_POST['notice'] ) || empty( $_POST['notice'] ) ) {
202
- exit;
203
- }
204
-
205
- // the notice
206
- $notice = sanitize_text_field( wp_unslash($_POST['notice']) );
207
-
208
- // check nonce
209
- check_ajax_referer( 'dlm_hide_notice-' . $notice, 'nonce' );
210
-
211
- // update option
212
- update_option( 'dlm_hide_notice-' . $notice, 1 );
213
-
214
- // send JSON
215
- wp_send_json( array( 'response' => 'success' ) );
216
- }
217
-
218
- /**
219
- * Handle lazy select AJAX calls
220
- */
221
- public function handle_settings_lazy_select() {
222
-
223
- // check nonce
224
- check_ajax_referer( 'dlm-settings-lazy-select-nonce', 'nonce' );
225
-
226
- if ( ! isset( $_POST['option'] ) ) {
227
- wp_send_json_error();
228
- exit;
229
- }
230
-
231
- // settings key
232
- $option_key = sanitize_text_field( wp_unslash($_POST['option']) );
233
-
234
- // get options
235
- $options = apply_filters( 'dlm_settings_lazy_select_'.$option_key, array() );
236
-
237
- // send options
238
- wp_send_json( $options );
239
- exit;
240
-
241
- }
242
-
243
- /**
244
- * Handle extensions AJAX
245
- */
246
- public function handle_extensions() {
247
-
248
- // Check nonce
249
- check_ajax_referer( 'dlm-ajax-nonce', 'nonce' );
250
-
251
- // Post vars
252
- $product_id = isset( $_POST['product_id'] ) ? sanitize_text_field( wp_unslash($_POST['product_id']) ) : 0;
253
- $key = isset( $_POST['key'] ) ? sanitize_text_field( wp_unslash($_POST['key']) ) : '';
254
- $email = isset( $_POST['email'] ) ? sanitize_text_field( wp_unslash($_POST['email']) ) : '';
255
- $extension_action = isset( $_POST['extension_action'] ) ? sanitize_text_field( wp_unslash($_POST['extension_action']) ) : 'activate';
256
-
257
- // Get products
258
- $products = DLM_Product_Manager::get()->get_products();
259
-
260
- // Check if product exists
261
- $response = "";
262
- if ( isset( $products[ $product_id ] ) ) {
263
-
264
- // Get correct product
265
- /** @var DLM_Product $product */
266
- $product = $products[ $product_id ];
267
-
268
- // Set new key in license object
269
- $product->get_license()->set_key( $key );
270
-
271
- // Set new email in license object
272
- $product->get_license()->set_email( $email );
273
-
274
- if ( 'activate' === $extension_action ) {
275
- // Try to activate the license
276
- $response = $product->activate();
277
- } else {
278
- // Try to deactivate the license
279
- $response = $product->deactivate();
280
- }
281
-
282
- }
283
-
284
- // Send JSON
285
- wp_send_json( $response );
286
- }
287
  }
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ } // Exit if accessed directly
6
+
7
+ /**
8
+ * DLM_Ajax_Handler class.
9
+ */
10
+ class DLM_Ajax_Handler {
11
+
12
+ /**
13
+ * __construct function.
14
+ *
15
+ * @access public
16
+ */
17
+ public function __construct() {
18
+ add_action( 'wp_ajax_download_monitor_remove_file', array( $this, 'remove_file' ) );
19
+ add_action( 'wp_ajax_download_monitor_add_file', array( $this, 'add_file' ) );
20
+ add_action( 'wp_ajax_download_monitor_list_files', array( $this, 'list_files' ) );
21
+ add_action( 'wp_ajax_download_monitor_insert_panel_upload', array( $this, 'insert_panel_upload' ) );
22
+ add_action( 'wp_ajax_dlm_settings_lazy_select', array( $this, 'handle_settings_lazy_select' ) );
23
+ add_action( 'wp_ajax_dlm_extension', array( $this, 'handle_extensions' ) );
24
+ add_action( 'wp_ajax_dlm_dismiss_notice', array( $this, 'dismiss_notice' ) );
25
+ }
26
+
27
+ /**
28
+ * insert_panel_upload function.
29
+ *
30
+ * @access public
31
+ * @return void
32
+ */
33
+ public function insert_panel_upload() {
34
+
35
+ check_ajax_referer( 'file-upload' );
36
+
37
+ // Check user rights
38
+ if ( ! current_user_can( 'manage_downloads' ) ) {
39
+ die();
40
+ }
41
+
42
+ require_once( ABSPATH . 'wp-admin/includes/image.php' );
43
+ require_once( ABSPATH . 'wp-admin/includes/file.php' );
44
+ require_once( ABSPATH . 'wp-admin/includes/media.php' );
45
+
46
+ $attachment_id = media_handle_upload( 'async-upload', 0 );
47
+
48
+ if ( ! is_wp_error( $attachment_id ) ) {
49
+ $attachment_url = wp_get_attachment_url( $attachment_id );
50
+
51
+ if ( false !== $attachment_url ) {
52
+ echo esc_url( $attachment_url );
53
+ }
54
+ }
55
+
56
+ die();
57
+ }
58
+
59
+ /**
60
+ * remove_file function.
61
+ *
62
+ * @access public
63
+ * @return void
64
+ */
65
+ public function remove_file() {
66
+
67
+ check_ajax_referer( 'remove-file', 'security' );
68
+
69
+ // Check user rights
70
+ if ( ! current_user_can( 'manage_downloads' ) ) {
71
+ die();
72
+ }
73
+
74
+ if ( ! isset( $_POST['file_id'] ) ) {
75
+ die();
76
+ }
77
+
78
+ $file = get_post( intval( $_POST['file_id'] ) );
79
+
80
+ if ( $file && $file->post_type == "dlm_download_version" ) {
81
+ // clear transient
82
+ download_monitor()->service( 'transient_manager' )->clear_versions_transient( $file->post_parent );
83
+
84
+ wp_delete_post( $file->ID );
85
+ }
86
+
87
+ die();
88
+ }
89
+
90
+ /**
91
+ * add_file function.
92
+ *
93
+ * @access public
94
+ * @return void
95
+ */
96
+ public function add_file() {
97
+
98
+ // check nonce
99
+ check_ajax_referer( 'add-file', 'security' );
100
+
101
+ // Check user rights
102
+ if ( ! current_user_can( 'manage_downloads' ) ) {
103
+ die();
104
+ }
105
+
106
+ // get POST data
107
+ $download_id = isset( $_POST['post_id'] ) ? absint( $_POST['post_id'] ) : 0;
108
+ $size = isset( $_POST['size'] ) ? absint( $_POST['size'] ) : 0;
109
+
110
+ /** @var DLM_Download_Version $new_version */
111
+ $new_version = new DLM_Download_Version();
112
+
113
+ // set download id
114
+ $new_version->set_download_id( $download_id );
115
+
116
+ // set other version data
117
+ $new_version->set_author( get_current_user_id() );
118
+ $new_version->set_date( new DateTime( current_time( 'mysql' ) ) );
119
+
120
+ // persist new version
121
+ download_monitor()->service( 'version_repository' )->persist( $new_version );
122
+
123
+ // clear download transient
124
+ download_monitor()->service( 'transient_manager' )->clear_versions_transient( $download_id );
125
+
126
+ // output new version admin html
127
+ download_monitor()->service( 'view_manager' )->display( 'meta-box/version', array(
128
+ 'version_increment' => $size,
129
+ 'file_id' => $new_version->get_id(),
130
+ 'file_version' => $new_version->get_version(),
131
+ 'file_post_date' => $new_version->get_date(),
132
+ 'file_download_count' => $new_version->get_download_count(),
133
+ 'file_urls' => $new_version->get_mirrors(),
134
+ 'version' => $new_version
135
+ ) );
136
+
137
+ die();
138
+ }
139
+
140
+ /**
141
+ * list_files function.
142
+ *
143
+ * @access public
144
+ * @return void
145
+ */
146
+ public function list_files() {
147
+
148
+ // Check Nonce
149
+ check_ajax_referer( 'list-files', 'security' );
150
+
151
+ // Check user rights
152
+ if ( ! current_user_can( 'manage_downloads' ) ) {
153
+ die();
154
+ }
155
+
156
+ if ( ! isset( $_POST['path'] ) ) {
157
+ die();
158
+ }
159
+
160
+ $path = sanitize_text_field( wp_unslash( $_POST['path'] ) );
161
+
162
+ // List all files
163
+ $files = download_monitor()->service( 'file_manager' )->list_files( $path );
164
+
165
+ foreach ( $files as $found_file ) {
166
+
167
+ // Multi-byte-safe pathinfo
168
+ $file = download_monitor()->service( 'file_manager' )->mb_pathinfo( $found_file['path'] );
169
+
170
+ if ( $found_file['type'] == 'folder' ) {
171
+
172
+ echo '<li><a href="#" class="folder" data-path="' . esc_attr( trailingslashit( $file['dirname'] ) ) . esc_attr( $file['basename'] ) . '">' . esc_attr( $file['basename'] ) . '</a></li>';
173
+
174
+ } else {
175
+
176
+ $filename = $file['basename'];
177
+ $extension = ( empty( $file['extension'] ) ) ? '' : $file['extension'];
178
+
179
+ if ( substr( $filename, 0, 1 ) == '.' ) {
180
+ continue;
181
+ } // Ignore files starting with . like htaccess
182
+ if ( in_array( $extension, array( '', 'php', 'html', 'htm', 'tmp' ) ) ) {
183
+ continue;
184
+ } // Ignored file types
185
+
186
+ echo '<li><a href="#" class="file filetype-' . esc_attr( sanitize_title( $extension ) ) . '" data-path="' . esc_attr( trailingslashit( $file['dirname'] ) ) . esc_attr( $file['basename'] ) . '">' . esc_attr( $file['basename'] ) . '</a></li>';
187
+
188
+ }
189
+
190
+ }
191
+
192
+ die();
193
+ }
194
+
195
+ /**
196
+ * Handle notice dismissal
197
+ */
198
+ public function dismiss_notice() {
199
+
200
+ // check notice
201
+ if ( ! isset( $_POST['notice'] ) || empty( $_POST['notice'] ) ) {
202
+ exit;
203
+ }
204
+
205
+ // the notice
206
+ $notice = sanitize_text_field( wp_unslash($_POST['notice']) );
207
+
208
+ // check nonce
209
+ check_ajax_referer( 'dlm_hide_notice-' . $notice, 'nonce' );
210
+
211
+ // update option
212
+ update_option( 'dlm_hide_notice-' . $notice, 1 );
213
+
214
+ // send JSON
215
+ wp_send_json( array( 'response' => 'success' ) );
216
+ }
217
+
218
+ /**
219
+ * Handle lazy select AJAX calls
220
+ */
221
+ public function handle_settings_lazy_select() {
222
+
223
+ // check nonce
224
+ check_ajax_referer( 'dlm-settings-lazy-select-nonce', 'nonce' );
225
+
226
+ if ( ! isset( $_POST['option'] ) ) {
227
+ wp_send_json_error();
228
+ exit;
229
+ }
230
+
231
+ // settings key
232
+ $option_key = sanitize_text_field( wp_unslash($_POST['option']) );
233
+
234
+ // get options
235
+ $options = apply_filters( 'dlm_settings_lazy_select_'.$option_key, array() );
236
+
237
+ // send options
238
+ wp_send_json( $options );
239
+ exit;
240
+
241
+ }
242
+
243
+ /**
244
+ * Handle extensions AJAX
245
+ */
246
+ public function handle_extensions() {
247
+
248
+ // Check nonce
249
+ check_ajax_referer( 'dlm-ajax-nonce', 'nonce' );
250
+
251
+ // Post vars
252
+ $product_id = isset( $_POST['product_id'] ) ? sanitize_text_field( wp_unslash($_POST['product_id']) ) : 0;
253
+ $key = isset( $_POST['key'] ) ? sanitize_text_field( wp_unslash($_POST['key']) ) : '';
254
+ $email = isset( $_POST['email'] ) ? sanitize_text_field( wp_unslash($_POST['email']) ) : '';
255
+ $extension_action = isset( $_POST['extension_action'] ) ? sanitize_text_field( wp_unslash($_POST['extension_action']) ) : 'activate';
256
+
257
+ // Get products
258
+ $products = DLM_Product_Manager::get()->get_products();
259
+
260
+ // Check if product exists
261
+ $response = "";
262
+ if ( isset( $products[ $product_id ] ) ) {
263
+
264
+ // Get correct product
265
+ /** @var DLM_Product $product */
266
+ $product = $products[ $product_id ];
267
+
268
+ // Set new key in license object
269
+ $product->get_license()->set_key( $key );
270
+
271
+ // Set new email in license object
272
+ $product->get_license()->set_email( $email );
273
+
274
+ if ( 'activate' === $extension_action ) {
275
+ // Try to activate the license
276
+ $response = $product->activate();
277
+ } else {
278
+ // Try to deactivate the license
279
+ $response = $product->deactivate();
280
+ }
281
+
282
+ }
283
+
284
+ // Send JSON
285
+ wp_send_json( $response );
286
+ }
287
  }
src/Constants.php CHANGED
@@ -1,16 +1,16 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
- } // Exit if accessed directly
6
-
7
- class DLM_Constants {
8
-
9
- const OPTION_CURRENT_VERSION = 'dlm_current_version';
10
-
11
- const LU_OPTION_NEEDS_UPGRADING = "dlm_lu_needs_upgrading";
12
- const LU_OPTION_UPGRADED = "dlm_lu_upgraded";
13
- const LU_OPTION_DOWNLOAD_QUEUE_BUILD = "dlm_lu_download_queue_build";
14
- const LU_OPTION_CONTENT_QUEUE_BUILD = "dlm_lu_content_queue_build";
15
-
16
  }
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ } // Exit if accessed directly
6
+
7
+ class DLM_Constants {
8
+
9
+ const OPTION_CURRENT_VERSION = 'dlm_current_version';
10
+
11
+ const LU_OPTION_NEEDS_UPGRADING = "dlm_lu_needs_upgrading";
12
+ const LU_OPTION_UPGRADED = "dlm_lu_upgraded";
13
+ const LU_OPTION_DOWNLOAD_QUEUE_BUILD = "dlm_lu_download_queue_build";
14
+ const LU_OPTION_CONTENT_QUEUE_BUILD = "dlm_lu_content_queue_build";
15
+
16
  }
src/DebugLogger.php CHANGED
@@ -1,50 +1,50 @@
1
- <?php
2
-
3
- class DLM_Debug_Logger {
4
-
5
- const MSG_PREFIX = "DLM Notice: ";
6
-
7
- /**
8
- * Returns if debugging is enabled
9
- *
10
- * @return bool
11
- */
12
- private static function is_enabled() {
13
- return WP_DEBUG;
14
- }
15
-
16
- /**
17
- * Log debug message
18
- *
19
- * @param string $message
20
- */
21
- public static function log( $message ) {
22
-
23
- // Only continue if enabled
24
- if ( ! self::is_enabled() ) {
25
- return;
26
- }
27
-
28
- error_log( self::MSG_PREFIX . $message, 0 );
29
-
30
- }
31
-
32
- /**
33
- * Log deprecated warning
34
- *
35
- * @param string $method
36
- */
37
- public static function deprecated( $method ) {
38
-
39
- // Only continue if enabled
40
- if ( ! self::is_enabled() ) {
41
- return;
42
- }
43
-
44
- // Debug message
45
- $message = 'Deprecated method called: ' . $method;
46
-
47
- error_log( self::MSG_PREFIX . $message, 0 );
48
- }
49
-
50
  }
1
+ <?php
2
+
3
+ class DLM_Debug_Logger {
4
+
5
+ const MSG_PREFIX = "DLM Notice: ";
6
+
7
+ /**
8
+ * Returns if debugging is enabled
9
+ *
10
+ * @return bool
11
+ */
12
+ private static function is_enabled() {
13
+ return WP_DEBUG;
14
+ }
15
+
16
+ /**
17
+ * Log debug message
18
+ *
19
+ * @param string $message
20
+ */
21
+ public static function log( $message ) {
22
+
23
+ // Only continue if enabled
24
+ if ( ! self::is_enabled() ) {
25
+ return;
26
+ }
27
+
28
+ error_log( self::MSG_PREFIX . $message, 0 );
29
+
30
+ }
31
+
32
+ /**
33
+ * Log deprecated warning
34
+ *
35
+ * @param string $method
36
+ */
37
+ public static function deprecated( $method ) {
38
+
39
+ // Only continue if enabled
40
+ if ( ! self::is_enabled() ) {
41
+ return;
42
+ }
43
+
44
+ // Debug message
45
+ $message = 'Deprecated method called: ' . $method;
46
+
47
+ error_log( self::MSG_PREFIX . $message, 0 );
48
+ }
49
+
50
  }
src/Dependencies/PayPal/Api/Agreement.php DELETED
@@ -1,647 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalResourceModel;
6
- use Never5\DownloadMonitor\Dependencies\PayPal\Core\PayPalConstants;
7
- use Never5\DownloadMonitor\Dependencies\PayPal\Rest\ApiContext;
8
- use Never5\DownloadMonitor\Dependencies\PayPal\Transport\PayPalRestCall;
9
- use Never5\DownloadMonitor\Dependencies\PayPal\Validation\ArgumentValidator;
10
-
11
- /**
12
- * Class Agreement
13
- *
14
- * A resource representing an agreement.
15
- *
16
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
17
- *
18
- * @property string id
19
- * @property string state
20
- * @property string name
21
- * @property string description
22
- * @property string start_date
23
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Payer payer
24
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Address shipping_address
25
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\MerchantPreferences override_merchant_preferences
26
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\OverrideChargeModel[] override_charge_models
27
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Plan plan
28
- * @property string create_time
29
- * @property string update_time
30
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\AgreementDetails agreement_details
31
- */
32
- class Agreement extends PayPalResourceModel
33
- {
34
- /**
35
- * Identifier of the agreement.
36
- *
37
- * @param string $id
38
- *
39
- * @return $this
40
- */
41
- public function setId($id)
42
- {
43
- $this->id = $id;
44
- return $this;
45
- }
46
-
47
- /**
48
- * Identifier of the agreement.
49
- *
50
- * @return string
51
- */
52
- public function getId()
53
- {
54
- return $this->id;
55
- }
56
-
57
- /**
58
- * State of the agreement.
59
- *
60
- * @param string $state
61
- *
62
- * @return $this
63
- */
64
- public function setState($state)
65
- {
66
- $this->state = $state;
67
- return $this;
68
- }
69
-
70
- /**
71
- * State of the agreement.
72
- *
73
- * @return string
74
- */
75
- public function getState()
76
- {
77
- return $this->state;
78
- }
79
-
80
- /**
81
- * Name of the agreement.
82
- *
83
- * @param string $name
84
- *
85
- * @return $this
86
- */
87
- public function setName($name)
88
- {
89
- $this->name = $name;
90
- return $this;
91
- }
92
-
93
- /**
94
- * Name of the agreement.
95
- *
96
- * @return string
97
- */
98
- public function getName()
99
- {
100
- return $this->name;
101
- }
102
-
103
- /**
104
- * Description of the agreement.
105
- *
106
- * @param string $description
107
- *
108
- * @return $this
109
- */
110
- public function setDescription($description)
111
- {
112
- $this->description = $description;
113
- return $this;
114
- }
115
-
116
- /**
117
- * Description of the agreement.
118
- *
119
- * @return string
120
- */
121
- public function getDescription()
122
- {
123
- return $this->description;
124
- }
125
-
126
- /**
127
- * Start date of the agreement. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6).
128
- *
129
- * @param string $start_date
130
- *
131
- * @return $this
132
- */
133
- public function setStartDate($start_date)
134
- {
135
- $this->start_date = $start_date;
136
- return $this;
137
- }
138
-
139
- /**
140
- * Start date of the agreement. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6).
141
- *
142
- * @return string
143
- */
144
- public function getStartDate()
145
- {
146
- return $this->start_date;
147
- }
148
-
149
- /**
150
- * Details of the buyer who is enrolling in this agreement. This information is gathered from execution of the approval URL.
151
- *
152
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Payer $payer
153
- *
154
- * @return $this
155
- */
156
- public function setPayer($payer)
157
- {
158
- $this->payer = $payer;
159
- return $this;
160
- }
161
-
162
- /**
163
- * Details of the buyer who is enrolling in this agreement. This information is gathered from execution of the approval URL.
164
- *
165
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Payer
166
- */
167
- public function getPayer()
168
- {
169
- return $this->payer;
170
- }
171
-
172
- /**
173
- * Shipping address object of the agreement, which should be provided if it is different from the default address.
174
- *
175
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Address $shipping_address
176
- *
177
- * @return $this
178
- */
179
- public function setShippingAddress($shipping_address)
180
- {
181
- $this->shipping_address = $shipping_address;
182
- return $this;
183
- }
184
-
185
- /**
186
- * Shipping address object of the agreement, which should be provided if it is different from the default address.
187
- *
188
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Address
189
- */
190
- public function getShippingAddress()
191
- {
192
- return $this->shipping_address;
193
- }
194
-
195
- /**
196
- * Default merchant preferences from the billing plan are used, unless override preferences are provided here.
197
- *
198
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\MerchantPreferences $override_merchant_preferences
199
- *
200
- * @return $this
201
- */
202
- public function setOverrideMerchantPreferences($override_merchant_preferences)
203
- {
204
- $this->override_merchant_preferences = $override_merchant_preferences;
205
- return $this;
206
- }
207
-
208
- /**
209
- * Default merchant preferences from the billing plan are used, unless override preferences are provided here.
210
- *
211
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\MerchantPreferences
212
- */
213
- public function getOverrideMerchantPreferences()
214
- {
215
- return $this->override_merchant_preferences;
216
- }
217
-
218
- /**
219
- * Array of override_charge_model for this agreement if needed to change the default models from the billing plan.
220
- *
221
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\OverrideChargeModel[] $override_charge_models
222
- *
223
- * @return $this
224
- */
225
- public function setOverrideChargeModels($override_charge_models)
226
- {
227
- $this->override_charge_models = $override_charge_models;
228
- return $this;
229
- }
230
-
231
- /**
232
- * Array of override_charge_model for this agreement if needed to change the default models from the billing plan.
233
- *
234
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\OverrideChargeModel[]
235
- */
236
- public function getOverrideChargeModels()
237
- {
238
- return $this->override_charge_models;
239
- }
240
-
241
- /**
242
- * Append OverrideChargeModels to the list.
243
- *
244
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\OverrideChargeModel $overrideChargeModel
245
- * @return $this
246
- */
247
- public function addOverrideChargeModel($overrideChargeModel)
248
- {
249
- if (!$this->getOverrideChargeModels()) {
250
- return $this->setOverrideChargeModels(array($overrideChargeModel));
251
- } else {
252
- return $this->setOverrideChargeModels(
253
- array_merge($this->getOverrideChargeModels(), array($overrideChargeModel))
254
- );
255
- }
256
- }
257
-
258
- /**
259
- * Remove OverrideChargeModels from the list.
260
- *
261
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\OverrideChargeModel $overrideChargeModel
262
- * @return $this
263
- */
264
- public function removeOverrideChargeModel($overrideChargeModel)
265
- {
266
- return $this->setOverrideChargeModels(
267
- array_diff($this->getOverrideChargeModels(), array($overrideChargeModel))
268
- );
269
- }
270
-
271
- /**
272
- * Plan details for this agreement.
273
- *
274
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Plan $plan
275
- *
276
- * @return $this
277
- */
278
- public function setPlan($plan)
279
- {
280
- $this->plan = $plan;
281
- return $this;
282
- }
283
-
284
- /**
285
- * Plan details for this agreement.
286
- *
287
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Plan
288
- */
289
- public function getPlan()
290
- {
291
- return $this->plan;
292
- }
293
-
294
- /**
295
- * Date and time that this resource was created. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6).
296
- *
297
- * @param string $create_time
298
- *
299
- * @return $this
300
- */
301
- public function setCreateTime($create_time)
302
- {
303
- $this->create_time = $create_time;
304
- return $this;
305
- }
306
-
307
- /**
308
- * Date and time that this resource was created. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6).
309
- *
310
- * @return string
311
- */
312
- public function getCreateTime()
313
- {
314
- return $this->create_time;
315
- }
316
-
317
- /**
318
- * Date and time that this resource was updated. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6).
319
- *
320
- * @param string $update_time
321
- *
322
- * @return $this
323
- */
324
- public function setUpdateTime($update_time)
325
- {
326
- $this->update_time = $update_time;
327
- return $this;
328
- }
329
-
330
- /**
331
- * Date and time that this resource was updated. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6).
332
- *
333
- * @return string
334
- */
335
- public function getUpdateTime()
336
- {
337
- return $this->update_time;
338
- }
339
-
340
- /**
341
- * Agreement Details
342
- *
343
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\AgreementDetails $agreement_details
344
- *
345
- * @return $this
346
- */
347
- public function setAgreementDetails($agreement_details)
348
- {
349
- $this->agreement_details = $agreement_details;
350
- return $this;
351
- }
352
-
353
- /**
354
- * Agreement Details
355
- *
356
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\AgreementDetails
357
- */
358
- public function getAgreementDetails()
359
- {
360
- return $this->agreement_details;
361
- }
362
-
363
- /**
364
- * Get Approval Link
365
- *
366
- * @return null|string
367
- */
368
- public function getApprovalLink()
369
- {
370
- return $this->getLink(PayPalConstants::APPROVAL_URL);
371
- }
372
-
373
- /**
374
- * Create a new billing agreement by passing the details for the agreement, including the name, description, start date, payer, and billing plan in the request JSON.
375
- *
376
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
377
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
378
- * @return Agreement
379
- */
380
- public function create($apiContext = null, $restCall = null)
381
- {
382
- $payLoad = $this->toJSON();
383
- $json = self::executeCall(
384
- "/v1/payments/billing-agreements/",
385
- "POST",
386
- $payLoad,
387
- null,
388
- $apiContext,
389
- $restCall
390
- );
391
- $this->fromJson($json);
392
- return $this;
393
- }
394
-
395
- /**
396
- * Execute a billing agreement after buyer approval by passing the payment token to the request URI.
397
- *
398
- * @param $paymentToken
399
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
400
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
401
- * @return Agreement
402
- */
403
- public function execute($paymentToken, $apiContext = null, $restCall = null)
404
- {
405
- ArgumentValidator::validate($paymentToken, 'paymentToken');
406
- $payLoad = "";
407
- $json = self::executeCall(
408
- "/v1/payments/billing-agreements/$paymentToken/agreement-execute",
409
- "POST",
410
- $payLoad,
411
- null,
412
- $apiContext,
413
- $restCall
414
- );
415
- $this->fromJson($json);
416
- return $this;
417
- }
418
-
419
- /**
420
- * Retrieve details for a particular billing agreement by passing the ID of the agreement to the request URI.
421
- *
422
- * @param string $agreementId
423
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
424
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
425
- * @return Agreement
426
- */
427
- public static function get($agreementId, $apiContext = null, $restCall = null)
428
- {
429
- ArgumentValidator::validate($agreementId, 'agreementId');
430
- $payLoad = "";
431
- $json = self::executeCall(
432
- "/v1/payments/billing-agreements/$agreementId",
433
- "GET",
434
- $payLoad,
435
- null,
436
- $apiContext,
437
- $restCall
438
- );
439
- $ret = new Agreement();
440
- $ret->fromJson($json);
441
- return $ret;
442
- }
443
-
444
- /**
445
- * Update details of a billing agreement, such as the description, shipping address, and start date, by passing the ID of the agreement to the request URI.
446
- *
447
- * @param PatchRequest $patchRequest
448
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
449
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
450
- * @return bool
451
- */
452
- public function update($patchRequest, $apiContext = null, $restCall = null)
453
- {
454
- ArgumentValidator::validate($this->getId(), "Id");
455
- ArgumentValidator::validate($patchRequest, 'patchRequest');
456
- $payLoad = $patchRequest->toJSON();
457
- self::executeCall(
458
- "/v1/payments/billing-agreements/{$this->getId()}",
459
- "PATCH",
460
- $payLoad,
461
- null,
462
- $apiContext,
463
- $restCall
464
- );
465
- return true;
466
- }
467
-
468
- /**
469
- * Suspend a particular billing agreement by passing the ID of the agreement to the request URI.
470
- *
471
- * @param AgreementStateDescriptor $agreementStateDescriptor
472
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
473
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
474
- * @return bool
475
- */
476
- public function suspend($agreementStateDescriptor, $apiContext = null, $restCall = null)
477
- {
478
- ArgumentValidator::validate($this->getId(), "Id");
479
- ArgumentValidator::validate($agreementStateDescriptor, 'agreementStateDescriptor');
480
- $payLoad = $agreementStateDescriptor->toJSON();
481
- self::executeCall(
482
- "/v1/payments/billing-agreements/{$this->getId()}/suspend",
483
- "POST",
484
- $payLoad,
485
- null,
486
- $apiContext,
487
- $restCall
488
- );
489
- return true;
490
- }
491
-
492
- /**
493
- * Reactivate a suspended billing agreement by passing the ID of the agreement to the appropriate URI. In addition, pass an agreement_state_descriptor object in the request JSON that includes a note about the reason for changing the state of the agreement and the amount and currency for the agreement.
494
- *
495
- * @param AgreementStateDescriptor $agreementStateDescriptor
496
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
497
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
498
- * @return bool
499
- */
500
- public function reActivate($agreementStateDescriptor, $apiContext = null, $restCall = null)
501
- {
502
- ArgumentValidator::validate($this->getId(), "Id");
503
- ArgumentValidator::validate($agreementStateDescriptor, 'agreementStateDescriptor');
504
- $payLoad = $agreementStateDescriptor->toJSON();
505
- self::executeCall(
506
- "/v1/payments/billing-agreements/{$this->getId()}/re-activate",
507
- "POST",
508
- $payLoad,
509
- null,
510
- $apiContext,
511
- $restCall
512
- );
513
- return true;
514
- }
515
-
516
- /**
517
- * Cancel a billing agreement by passing the ID of the agreement to the request URI. In addition, pass an agreement_state_descriptor object in the request JSON that includes a note about the reason for changing the state of the agreement and the amount and currency for the agreement.
518
- *
519
- * @param AgreementStateDescriptor $agreementStateDescriptor
520
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
521
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
522
- * @return bool
523
- */
524
- public function cancel($agreementStateDescriptor, $apiContext = null, $restCall = null)
525
- {
526
- ArgumentValidator::validate($this->getId(), "Id");
527
- ArgumentValidator::validate($agreementStateDescriptor, 'agreementStateDescriptor');
528
- $payLoad = $agreementStateDescriptor->toJSON();
529
- self::executeCall(
530
- "/v1/payments/billing-agreements/{$this->getId()}/cancel",
531
- "POST",
532
- $payLoad,
533
- null,
534
- $apiContext,
535
- $restCall
536
- );
537
- return true;
538
- }
539
-
540
- /**
541
- * Bill an outstanding amount for an agreement by passing the ID of the agreement to the request URI. In addition, pass an agreement_state_descriptor object in the request JSON that includes a note about the reason for changing the state of the agreement and the amount and currency for the agreement.
542
- *
543
- * @param AgreementStateDescriptor $agreementStateDescriptor
544
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
545
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
546
- * @return bool
547
- */
548
- public function billBalance($agreementStateDescriptor, $apiContext = null, $restCall = null)
549
- {
550
- ArgumentValidator::validate($this->getId(), "Id");
551
- ArgumentValidator::validate($agreementStateDescriptor, 'agreementStateDescriptor');
552
- $payLoad = $agreementStateDescriptor->toJSON();
553
- self::executeCall(
554
- "/v1/payments/billing-agreements/{$this->getId()}/bill-balance",
555
- "POST",
556
- $payLoad,
557
- null,
558
- $apiContext,
559
- $restCall
560
- );
561
- return true;
562
- }
563
-
564
- /**
565
- * Set the balance for an agreement by passing the ID of the agreement to the request URI. In addition, pass a common_currency object in the request JSON that specifies the currency type and value of the balance.
566
- *
567
- * @param Currency $currency
568
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
569
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
570
- * @return bool
571
- */
572
- public function setBalance($currency, $apiContext = null, $restCall = null)
573
- {
574
- ArgumentValidator::validate($this->getId(), "Id");
575
- ArgumentValidator::validate($currency, 'currency');
576
- $payLoad = $currency->toJSON();
577
- self::executeCall(
578
- "/v1/payments/billing-agreements/{$this->getId()}/set-balance",
579
- "POST",
580
- $payLoad,
581
- null,
582
- $apiContext,
583
- $restCall
584
- );
585
- return true;
586
- }
587
-
588
- /**
589
- * List transactions for a billing agreement by passing the ID of the agreement, as well as the start and end dates of the range of transactions to list, to the request URI.
590
- *
591
- * @deprecated Please use searchTransactions Instead
592
- * @param string $agreementId
593
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
594
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
595
- * @return AgreementTransactions
596
- */
597
- public static function transactions($agreementId, $apiContext = null, $restCall = null)
598
- {
599
- ArgumentValidator::validate($agreementId, 'agreementId');
600
- $payLoad = "";
601
- $json = self::executeCall(
602
- "/v1/payments/billing-agreements/$agreementId/transactions",
603
- "GET",
604
- $payLoad,
605
- null,
606
- $apiContext,
607
- $restCall
608
- );
609
- $ret = new AgreementTransactions();
610
- $ret->fromJson($json);
611
- return $ret;
612
- }
613
-
614
- /**
615
- * List transactions for a billing agreement by passing the ID of the agreement, as well as the start and end dates of the range of transactions to list, to the request URI.
616
- *
617
- * @param string $agreementId
618
- * @param array $params Parameters for search string. Options: start_date, and end_date
619
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
620
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
621
- * @return AgreementTransactions
622
- */
623
- public static function searchTransactions($agreementId, $params = array(), $apiContext = null, $restCall = null)
624
- {
625
- ArgumentValidator::validate($agreementId, 'agreementId');
626
- ArgumentValidator::validate($params, 'params');
627
-
628
- $allowedParams = array(
629
- 'start_date' => 1,
630
- 'end_date' => 1,
631
- );
632
-
633
- $payLoad = "";
634
- $json = self::executeCall(
635
- "/v1/payments/billing-agreements/$agreementId/transactions?" . http_build_query(array_intersect_key($params, $allowedParams)),
636
- "GET",
637
- $payLoad,
638
- null,
639
- $apiContext,
640
- $restCall
641
- );
642
- $ret = new AgreementTransactions();
643
- $ret->fromJson($json);
644
- return $ret;
645
- }
646
-
647
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/AgreementDetails.php DELETED
@@ -1,209 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class AgreementDetails
9
- *
10
- * A resource representing the agreement details.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency outstanding_balance
15
- * @property string cycles_remaining
16
- * @property string cycles_completed
17
- * @property string next_billing_date
18
- * @property string last_payment_date
19
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency last_payment_amount
20
- * @property string final_payment_date
21
- * @property string failed_payment_count
22
- */
23
- class AgreementDetails extends PayPalModel
24
- {
25
- /**
26
- * The outstanding balance for this agreement.
27
- *
28
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency $outstanding_balance
29
- *
30
- * @return $this
31
- */
32
- public function setOutstandingBalance($outstanding_balance)
33
- {
34
- $this->outstanding_balance = $outstanding_balance;
35
- return $this;
36
- }
37
-
38
- /**
39
- * The outstanding balance for this agreement.
40
- *
41
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency
42
- */
43
- public function getOutstandingBalance()
44
- {
45
- return $this->outstanding_balance;
46
- }
47
-
48
- /**
49
- * Number of cycles remaining for this agreement.
50
- *
51
- * @param string $cycles_remaining
52
- *
53
- * @return $this
54
- */
55
- public function setCyclesRemaining($cycles_remaining)
56
- {
57
- $this->cycles_remaining = $cycles_remaining;
58
- return $this;
59
- }
60
-
61
- /**
62
- * Number of cycles remaining for this agreement.
63
- *
64
- * @return string
65
- */
66
- public function getCyclesRemaining()
67
- {
68
- return $this->cycles_remaining;
69
- }
70
-
71
- /**
72
- * Number of cycles completed for this agreement.
73
- *
74
- * @param string $cycles_completed
75
- *
76
- * @return $this
77
- */
78
- public function setCyclesCompleted($cycles_completed)
79
- {
80
- $this->cycles_completed = $cycles_completed;
81
- return $this;
82
- }
83
-
84
- /**
85
- * Number of cycles completed for this agreement.
86
- *
87
- * @return string
88
- */
89
- public function getCyclesCompleted()
90
- {
91
- return $this->cycles_completed;
92
- }
93
-
94
- /**
95
- * The next billing date for this agreement, represented as 2014-02-19T10:00:00Z format.
96
- *
97
- * @param string $next_billing_date
98
- *
99
- * @return $this
100
- */
101
- public function setNextBillingDate($next_billing_date)
102
- {
103
- $this->next_billing_date = $next_billing_date;
104
- return $this;
105
- }
106
-
107
- /**
108
- * The next billing date for this agreement, represented as 2014-02-19T10:00:00Z format.
109
- *
110
- * @return string
111
- */
112
- public function getNextBillingDate()
113
- {
114
- return $this->next_billing_date;
115
- }
116
-
117
- /**
118
- * Last payment date for this agreement, represented as 2014-06-09T09:42:31Z format.
119
- *
120
- * @param string $last_payment_date
121
- *
122
- * @return $this
123
- */
124
- public function setLastPaymentDate($last_payment_date)
125
- {
126
- $this->last_payment_date = $last_payment_date;
127
- return $this;
128
- }
129
-
130
- /**
131
- * Last payment date for this agreement, represented as 2014-06-09T09:42:31Z format.
132
- *
133
- * @return string
134
- */
135
- public function getLastPaymentDate()
136
- {
137
- return $this->last_payment_date;
138
- }
139
-
140
- /**
141
- * Last payment amount for this agreement.
142
- *
143
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency $last_payment_amount
144
- *
145
- * @return $this
146
- */
147
- public function setLastPaymentAmount($last_payment_amount)
148
- {
149
- $this->last_payment_amount = $last_payment_amount;
150
- return $this;
151
- }
152
-
153
- /**
154
- * Last payment amount for this agreement.
155
- *
156
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency
157
- */
158
- public function getLastPaymentAmount()
159
- {
160
- return $this->last_payment_amount;
161
- }
162
-
163
- /**
164
- * Last payment date for this agreement, represented as 2015-02-19T10:00:00Z format.
165
- *
166
- * @param string $final_payment_date
167
- *
168
- * @return $this
169
- */
170
- public function setFinalPaymentDate($final_payment_date)
171
- {
172
- $this->final_payment_date = $final_payment_date;
173
- return $this;
174
- }
175
-
176
- /**
177
- * Last payment date for this agreement, represented as 2015-02-19T10:00:00Z format.
178
- *
179
- * @return string
180
- */
181
- public function getFinalPaymentDate()
182
- {
183
- return $this->final_payment_date;
184
- }
185
-
186
- /**
187
- * Total number of failed payments for this agreement.
188
- *
189
- * @param string $failed_payment_count
190
- *
191
- * @return $this
192
- */
193
- public function setFailedPaymentCount($failed_payment_count)
194
- {
195
- $this->failed_payment_count = $failed_payment_count;
196
- return $this;
197
- }
198
-
199
- /**
200
- * Total number of failed payments for this agreement.
201
- *
202
- * @return string
203
- */
204
- public function getFailedPaymentCount()
205
- {
206
- return $this->failed_payment_count;
207
- }
208
-
209
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/AgreementStateDescriptor.php DELETED
@@ -1,65 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class AgreementStateDescriptor
9
- *
10
- * Description of the current state of the agreement.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property string note
15
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency amount
16
- */
17
- class AgreementStateDescriptor extends PayPalModel
18
- {
19
- /**
20
- * Reason for changing the state of the agreement.
21
- *
22
- * @param string $note
23
- *
24
- * @return $this
25
- */
26
- public function setNote($note)
27
- {
28
- $this->note = $note;
29
- return $this;
30
- }
31
-
32
- /**
33
- * Reason for changing the state of the agreement.
34
- *
35
- * @return string
36
- */
37
- public function getNote()
38
- {
39
- return $this->note;
40
- }
41
-
42
- /**
43
- * The amount and currency of the agreement.
44
- *
45
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency $amount
46
- *
47
- * @return $this
48
- */
49
- public function setAmount($amount)
50
- {
51
- $this->amount = $amount;
52
- return $this;
53
- }
54
-
55
- /**
56
- * The amount and currency of the agreement.
57
- *
58
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency
59
- */
60
- public function getAmount()
61
- {
62
- return $this->amount;
63
- }
64
-
65
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/AgreementTransaction.php DELETED
@@ -1,257 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class AgreementTransaction
9
- *
10
- * A resource representing an agreement_transaction that is returned during a transaction search.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property string transaction_id
15
- * @property string status
16
- * @property string transaction_type
17
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency amount
18
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency fee_amount
19
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency net_amount
20
- * @property string payer_email
21
- * @property string payer_name
22
- * @property string time_stamp
23
- * @property string time_zone
24
- */
25
- class AgreementTransaction extends PayPalModel
26
- {
27
- /**
28
- * Id corresponding to this transaction.
29
- *
30
- * @param string $transaction_id
31
- *
32
- * @return $this
33
- */
34
- public function setTransactionId($transaction_id)
35
- {
36
- $this->transaction_id = $transaction_id;
37
- return $this;
38
- }
39
-
40
- /**
41
- * Id corresponding to this transaction.
42
- *
43
- * @return string
44
- */
45
- public function getTransactionId()
46
- {
47
- return $this->transaction_id;
48
- }
49
-
50
- /**
51
- * State of the subscription at this time.
52
- *
53
- * @param string $status
54
- *
55
- * @return $this
56
- */
57
- public function setStatus($status)
58
- {
59
- $this->status = $status;
60
- return $this;
61
- }
62
-
63
- /**
64
- * State of the subscription at this time.
65
- *
66
- * @return string
67
- */
68
- public function getStatus()
69
- {
70
- return $this->status;
71
- }
72
-
73
- /**
74
- * Type of transaction, usually Recurring Payment.
75
- *
76
- * @param string $transaction_type
77
- *
78
- * @return $this
79
- */
80
- public function setTransactionType($transaction_type)
81
- {
82
- $this->transaction_type = $transaction_type;
83
- return $this;
84
- }
85
-
86
- /**
87
- * Type of transaction, usually Recurring Payment.
88
- *
89
- * @return string
90
- */
91
- public function getTransactionType()
92
- {
93
- return $this->transaction_type;
94
- }
95
-
96
- /**
97
- * Amount for this transaction.
98
- *
99
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency $amount
100
- *
101
- * @return $this
102
- */
103
- public function setAmount($amount)
104
- {
105
- $this->amount = $amount;
106
- return $this;
107
- }
108
-
109
- /**
110
- * Amount for this transaction.
111
- *
112
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency
113
- */
114
- public function getAmount()
115
- {
116
- return $this->amount;
117
- }
118
-
119
- /**
120
- * Fee amount for this transaction.
121
- *
122
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency $fee_amount
123
- *
124
- * @return $this
125
- */
126
- public function setFeeAmount($fee_amount)
127
- {
128
- $this->fee_amount = $fee_amount;
129
- return $this;
130
- }
131
-
132
- /**
133
- * Fee amount for this transaction.
134
- *
135
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency
136
- */
137
- public function getFeeAmount()
138
- {
139
- return $this->fee_amount;
140
- }
141
-
142
- /**
143
- * Net amount for this transaction.
144
- *
145
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency $net_amount
146
- *
147
- * @return $this
148
- */
149
- public function setNetAmount($net_amount)
150
- {
151
- $this->net_amount = $net_amount;
152
- return $this;
153
- }
154
-
155
- /**
156
- * Net amount for this transaction.
157
- *
158
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency
159
- */
160
- public function getNetAmount()
161
- {
162
- return $this->net_amount;
163
- }
164
-
165
- /**
166
- * Email id of payer.
167
- *
168
- * @param string $payer_email
169
- *
170
- * @return $this
171
- */
172
- public function setPayerEmail($payer_email)
173
- {
174
- $this->payer_email = $payer_email;
175
- return $this;
176
- }
177
-
178
- /**
179
- * Email id of payer.
180
- *
181
- * @return string
182
- */
183
- public function getPayerEmail()
184
- {
185
- return $this->payer_email;
186
- }
187
-
188
- /**
189
- * Business name of payer.
190
- *
191
- * @param string $payer_name
192
- *
193
- * @return $this
194
- */
195
- public function setPayerName($payer_name)
196
- {
197
- $this->payer_name = $payer_name;
198
- return $this;
199
- }
200
-
201
- /**
202
- * Business name of payer.
203
- *
204
- * @return string
205
- */
206
- public function getPayerName()
207
- {
208
- return $this->payer_name;
209
- }
210
-
211
- /**
212
- * Time at which this transaction happened.
213
- *
214
- * @param string $time_stamp
215
- *
216
- * @return $this
217
- */
218
- public function setTimeStamp($time_stamp)
219
- {
220
- $this->time_stamp = $time_stamp;
221
- return $this;
222
- }
223
-
224
- /**
225
- * Time at which this transaction happened.
226
- *
227
- * @return string
228
- */
229
- public function getTimeStamp()
230
- {
231
- return $this->time_stamp;
232
- }
233
-
234
- /**
235
- * Time zone of time_updated field.
236
- *
237
- * @param string $time_zone
238
- *
239
- * @return $this
240
- */
241
- public function setTimeZone($time_zone)
242
- {
243
- $this->time_zone = $time_zone;
244
- return $this;
245
- }
246
-
247
- /**
248
- * Time zone of time_updated field.
249
- *
250
- * @return string
251
- */
252
- public function getTimeZone()
253
- {
254
- return $this->time_zone;
255
- }
256
-
257
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/AgreementTransactions.php DELETED
@@ -1,71 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class AgreementTransactions
9
- *
10
- * A resource representing agreement_transactions that is returned during a transaction search.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\AgreementTransaction[] agreement_transaction_list
15
- */
16
- class AgreementTransactions extends PayPalModel
17
- {
18
- /**
19
- * Array of agreement_transaction object.
20
- *
21
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\AgreementTransaction[] $agreement_transaction_list
22
- *
23
- * @return $this
24
- */
25
- public function setAgreementTransactionList($agreement_transaction_list)
26
- {
27
- $this->agreement_transaction_list = $agreement_transaction_list;
28
- return $this;
29
- }
30
-
31
- /**
32
- * Array of agreement_transaction object.
33
- *
34
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\AgreementTransaction[]
35
- */
36
- public function getAgreementTransactionList()
37
- {
38
- return $this->agreement_transaction_list;
39
- }
40
-
41
- /**
42
- * Append AgreementTransactionList to the list.
43
- *
44
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\AgreementTransaction $agreementTransaction
45
- * @return $this
46
- */
47
- public function addAgreementTransactionList($agreementTransaction)
48
- {
49
- if (!$this->getAgreementTransactionList()) {
50
- return $this->setAgreementTransactionList(array($agreementTransaction));
51
- } else {
52
- return $this->setAgreementTransactionList(
53
- array_merge($this->getAgreementTransactionList(), array($agreementTransaction))
54
- );
55
- }
56
- }
57
-
58
- /**
59
- * Remove AgreementTransactionList from the list.
60
- *
61
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\AgreementTransaction $agreementTransaction
62
- * @return $this
63
- */
64
- public function removeAgreementTransactionList($agreementTransaction)
65
- {
66
- return $this->setAgreementTransactionList(
67
- array_diff($this->getAgreementTransactionList(), array($agreementTransaction))
68
- );
69
- }
70
-
71
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/AlternatePayment.php DELETED
@@ -1,91 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class AlternatePayment
9
- *
10
- * A resource representing a alternate payment account that can be used to fund a payment.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @deprecated Used for limited release only.
15
- *
16
- * @property string alternate_payment_account_id
17
- * @property string external_customer_id
18
- * @property string alternate_payment_provider_id
19
- */
20
- class AlternatePayment extends PayPalModel
21
- {
22
- /**
23
- * The unique identifier of the alternate payment account.
24
- *
25
- * @param string $alternate_payment_account_id
26
- *
27
- * @return $this
28
- */
29
- public function setAlternatePaymentAccountId($alternate_payment_account_id)
30
- {
31
- $this->alternate_payment_account_id = $alternate_payment_account_id;
32
- return $this;
33
- }
34
-
35
- /**
36
- * The unique identifier of the alternate payment account.
37
- *
38
- * @return string
39
- */
40
- public function getAlternatePaymentAccountId()
41
- {
42
- return $this->alternate_payment_account_id;
43
- }
44
-
45
- /**
46
- * The unique identifier of the payer
47
- *
48
- * @param string $external_customer_id
49
- *
50
- * @return $this
51
- */
52
- public function setExternalCustomerId($external_customer_id)
53
- {
54
- $this->external_customer_id = $external_customer_id;
55
- return $this;
56
- }
57
-
58
- /**
59
- * The unique identifier of the payer
60
- *
61
- * @return string
62
- */
63
- public function getExternalCustomerId()
64
- {
65
- return $this->external_customer_id;
66
- }
67
-
68
- /**
69
- * Alternate Payment provider id. This is an optional attribute needed only for certain alternate providers e.g Ideal
70
- *
71
- * @param string $alternate_payment_provider_id
72
- *
73
- * @return $this
74
- */
75
- public function setAlternatePaymentProviderId($alternate_payment_provider_id)
76
- {
77
- $this->alternate_payment_provider_id = $alternate_payment_provider_id;
78
- return $this;
79
- }
80
-
81
- /**
82
- * Alternate Payment provider id. This is an optional attribute needed only for certain alternate providers e.g Ideal
83
- *
84
- * @return string
85
- */
86
- public function getAlternatePaymentProviderId()
87
- {
88
- return $this->alternate_payment_provider_id;
89
- }
90
-
91
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/Authorization.php DELETED
@@ -1,507 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalResourceModel;
6
- use Never5\DownloadMonitor\Dependencies\PayPal\Validation\ArgumentValidator;
7
- use Never5\DownloadMonitor\Dependencies\PayPal\Rest\ApiContext;
8
-
9
- /**
10
- * Class Authorization
11
- *
12
- * An authorization transaction.
13
- *
14
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
15
- *
16
- * @property string id
17
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Amount amount
18
- * @property string payment_mode
19
- * @property string state
20
- * @property string reason_code
21
- * @property string pending_reason
22
- * @property string protection_eligibility
23
- * @property string protection_eligibility_type
24
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\FmfDetails fmf_details
25
- * @property string parent_payment
26
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\ProcessorResponse processor_response
27
- * @property string valid_until
28
- * @property string create_time
29
- * @property string update_time
30
- * @property string reference_id
31
- * @property string receipt_id
32
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links[] links
33
- */
34
- class Authorization extends PayPalResourceModel
35
- {
36
- /**
37
- * ID of the authorization transaction.
38
- *
39
- * @param string $id
40
- *
41
- * @return $this
42
- */
43
- public function setId($id)
44
- {
45
- $this->id = $id;
46
- return $this;
47
- }
48
-
49
- /**
50
- * ID of the authorization transaction.
51
- *
52
- * @return string
53
- */
54
- public function getId()
55
- {
56
- return $this->id;
57
- }
58
-
59
- /**
60
- * Amount being authorized.
61
- *
62
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Amount $amount
63
- *
64
- * @return $this
65
- */
66
- public function setAmount($amount)
67
- {
68
- $this->amount = $amount;
69
- return $this;
70
- }
71
-
72
- /**
73
- * Amount being authorized.
74
- *
75
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Amount
76
- */
77
- public function getAmount()
78
- {
79
- return $this->amount;
80
- }
81
-
82
- /**
83
- * Specifies the payment mode of the transaction.
84
- * Valid Values: ["INSTANT_TRANSFER"]
85
- *
86
- * @param string $payment_mode
87
- *
88
- * @return $this
89
- */
90
- public function setPaymentMode($payment_mode)
91
- {
92
- $this->payment_mode = $payment_mode;
93
- return $this;
94
- }
95
-
96
- /**
97
- * Specifies the payment mode of the transaction.
98
- *
99
- * @return string
100
- */
101
- public function getPaymentMode()
102
- {
103
- return $this->payment_mode;
104
- }
105
-
106
- /**
107
- * State of the authorization.
108
- * Valid Values: ["pending", "authorized", "partially_captured", "captured", "expired", "voided"]
109
- *
110
- * @param string $state
111
- *
112
- * @return $this
113
- */
114
- public function setState($state)
115
- {
116
- $this->state = $state;
117
- return $this;
118
- }
119
-
120
- /**
121
- * State of the authorization.
122
- *
123
- * @return string
124
- */
125
- public function getState()
126
- {
127
- return $this->state;
128
- }
129
-
130
- /**
131
- * Reason code, `AUTHORIZATION`, for a transaction state of `pending`.
132
- * Valid Values: ["AUTHORIZATION"]
133
- *
134
- * @param string $reason_code
135
- *
136
- * @return $this
137
- */
138
- public function setReasonCode($reason_code)
139
- {
140
- $this->reason_code = $reason_code;
141
- return $this;
142
- }
143
-
144
- /**
145
- * Reason code, `AUTHORIZATION`, for a transaction state of `pending`.
146
- *
147
- * @return string
148
- */
149
- public function getReasonCode()
150
- {
151
- return $this->reason_code;
152
- }
153
-
154
- /**
155
- * [DEPRECATED] Reason code for the transaction state being Pending.Obsolete. use reason_code field instead.
156
- * Valid Values: ["AUTHORIZATION"]
157
- *
158
- * @param string $pending_reason
159
- *
160
- * @return $this
161
- */
162
- public function setPendingReason($pending_reason)
163
- {
164
- $this->pending_reason = $pending_reason;
165
- return $this;
166
- }
167
-
168
- /**
169
- * @deprecated [DEPRECATED] Reason code for the transaction state being Pending.Obsolete. use reason_code field instead.
170
- *
171
- * @return string
172
- */
173
- public function getPendingReason()
174
- {
175
- return $this->pending_reason;
176
- }
177
-
178
- /**
179
- * The level of seller protection in force for the transaction. Only supported when the `payment_method` is set to `paypal`. Allowed values:<br> `ELIGIBLE`- Merchant is protected by PayPal's Seller Protection Policy for Unauthorized Payments and Item Not Received.<br> `PARTIALLY_ELIGIBLE`- Merchant is protected by PayPal's Seller Protection Policy for Item Not Received or Unauthorized Payments. Refer to `protection_eligibility_type` for specifics. <br> `INELIGIBLE`- Merchant is not protected under the Seller Protection Policy.
180
- * Valid Values: ["ELIGIBLE", "PARTIALLY_ELIGIBLE", "INELIGIBLE"]
181
- *
182
- * @param string $protection_eligibility
183
- *
184
- * @return $this
185
- */
186
- public function setProtectionEligibility($protection_eligibility)
187
- {
188
- $this->protection_eligibility = $protection_eligibility;
189
- return $this;
190
- }
191
-
192
- /**
193
- * The level of seller protection in force for the transaction. Only supported when the `payment_method` is set to `paypal`. Allowed values:<br> `ELIGIBLE`- Merchant is protected by PayPal's Seller Protection Policy for Unauthorized Payments and Item Not Received.<br> `PARTIALLY_ELIGIBLE`- Merchant is protected by PayPal's Seller Protection Policy for Item Not Received or Unauthorized Payments. Refer to `protection_eligibility_type` for specifics. <br> `INELIGIBLE`- Merchant is not protected under the Seller Protection Policy.
194
- *
195
- * @return string
196
- */
197
- public function getProtectionEligibility()
198
- {
199
- return $this->protection_eligibility;
200
- }
201
-
202
- /**
203
- * The kind of seller protection in force for the transaction. This property is returned only when the `protection_eligibility` property is set to `ELIGIBLE`or `PARTIALLY_ELIGIBLE`. Only supported when the `payment_method` is set to `paypal`. Allowed values:<br> `ITEM_NOT_RECEIVED_ELIGIBLE`- Sellers are protected against claims for items not received.<br> `UNAUTHORIZED_PAYMENT_ELIGIBLE`- Sellers are protected against claims for unauthorized payments.<br> One or both of the allowed values can be returned.
204
- * Valid Values: ["ITEM_NOT_RECEIVED_ELIGIBLE", "UNAUTHORIZED_PAYMENT_ELIGIBLE", "ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE"]
205
- *
206
- * @param string $protection_eligibility_type
207
- *
208
- * @return $this
209
- */
210
- public function setProtectionEligibilityType($protection_eligibility_type)
211
- {
212
- $this->protection_eligibility_type = $protection_eligibility_type;
213
- return $this;
214
- }
215
-
216
- /**
217
- * The kind of seller protection in force for the transaction. This property is returned only when the `protection_eligibility` property is set to `ELIGIBLE`or `PARTIALLY_ELIGIBLE`. Only supported when the `payment_method` is set to `paypal`. Allowed values:<br> `ITEM_NOT_RECEIVED_ELIGIBLE`- Sellers are protected against claims for items not received.<br> `UNAUTHORIZED_PAYMENT_ELIGIBLE`- Sellers are protected against claims for unauthorized payments.<br> One or both of the allowed values can be returned.
218
- *
219
- * @return string
220
- */
221
- public function getProtectionEligibilityType()
222
- {
223
- return $this->protection_eligibility_type;
224
- }
225
-
226
- /**
227
- * Fraud Management Filter (FMF) details applied for the payment that could result in accept, deny, or pending action. Returned in a payment response only if the merchant has enabled FMF in the profile settings and one of the fraud filters was triggered based on those settings. See [Fraud Management Filters Summary](https://developer.paypal.com/docs/classic/fmf/integration-guide/FMFSummary/) for more information.
228
- *
229
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\FmfDetails $fmf_details
230
- *
231
- * @return $this
232
- */
233
- public function setFmfDetails($fmf_details)
234
- {
235
- $this->fmf_details = $fmf_details;
236
- return $this;
237
- }
238
-
239
- /**
240
- * Fraud Management Filter (FMF) details applied for the payment that could result in accept, deny, or pending action. Returned in a payment response only if the merchant has enabled FMF in the profile settings and one of the fraud filters was triggered based on those settings. See [Fraud Management Filters Summary](https://developer.paypal.com/docs/classic/fmf/integration-guide/FMFSummary/) for more information.
241
- *
242
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\FmfDetails
243
- */
244
- public function getFmfDetails()
245
- {
246
- return $this->fmf_details;
247
- }
248
-
249
- /**
250
- * ID of the Payment resource that this transaction is based on.
251
- *
252
- * @param string $parent_payment
253
- *
254
- * @return $this
255
- */
256
- public function setParentPayment($parent_payment)
257
- {
258
- $this->parent_payment = $parent_payment;
259
- return $this;
260
- }
261
-
262
- /**
263
- * ID of the Payment resource that this transaction is based on.
264
- *
265
- * @return string
266
- */
267
- public function getParentPayment()
268
- {
269
- return $this->parent_payment;
270
- }
271
-
272
- /**
273
- * Response codes returned by the processor concerning the submitted payment. Only supported when the `payment_method` is set to `credit_card`.
274
- *
275
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\ProcessorResponse $processor_response
276
- *
277
- * @return $this
278
- */
279
- public function setProcessorResponse($processor_response)
280
- {
281
- $this->processor_response = $processor_response;
282
- return $this;
283
- }
284
-
285
- /**
286
- * Response codes returned by the processor concerning the submitted payment. Only supported when the `payment_method` is set to `credit_card`.
287
- *
288
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\ProcessorResponse
289
- */
290
- public function getProcessorResponse()
291
- {
292
- return $this->processor_response;
293
- }
294
-
295
- /**
296
- * Authorization expiration time and date as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
297
- *
298
- * @param string $valid_until
299
- *
300
- * @return $this
301
- */
302
- public function setValidUntil($valid_until)
303
- {
304
- $this->valid_until = $valid_until;
305
- return $this;
306
- }
307
-
308
- /**
309
- * Authorization expiration time and date as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
310
- *
311
- * @return string
312
- */
313
- public function getValidUntil()
314
- {
315
- return $this->valid_until;
316
- }
317
-
318
- /**
319
- * Time of authorization as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
320
- *
321
- * @param string $create_time
322
- *
323
- * @return $this
324
- */
325
- public function setCreateTime($create_time)
326
- {
327
- $this->create_time = $create_time;
328
- return $this;
329
- }
330
-
331
- /**
332
- * Time of authorization as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
333
- *
334
- * @return string
335
- */
336
- public function getCreateTime()
337
- {
338
- return $this->create_time;
339
- }
340
-
341
- /**
342
- * Time that the resource was last updated.
343
- *
344
- * @param string $update_time
345
- *
346
- * @return $this
347
- */
348
- public function setUpdateTime($update_time)
349
- {
350
- $this->update_time = $update_time;
351
- return $this;
352
- }
353
-
354
- /**
355
- * Time that the resource was last updated.
356
- *
357
- * @return string
358
- */
359
- public function getUpdateTime()
360
- {
361
- return $this->update_time;
362
- }
363
-
364
- /**
365
- * Identifier to the purchase or transaction unit corresponding to this authorization transaction.
366
- *
367
- * @param string $reference_id
368
- *
369
- * @return $this
370
- */
371
- public function setReferenceId($reference_id)
372
- {
373
- $this->reference_id = $reference_id;
374
- return $this;
375
- }
376
-
377
- /**
378
- * Identifier to the purchase or transaction unit corresponding to this authorization transaction.
379
- *
380
- * @return string
381
- */
382
- public function getReferenceId()
383
- {
384
- return $this->reference_id;
385
- }
386
-
387
- /**
388
- * Receipt id is 16 digit number payment identification number returned for guest users to identify the payment.
389
- *
390
- * @param string $receipt_id
391
- *
392
- * @return $this
393
- */
394
- public function setReceiptId($receipt_id)
395
- {
396
- $this->receipt_id = $receipt_id;
397
- return $this;
398
- }
399
-
400
- /**
401
- * Receipt id is 16 digit number payment identification number returned for guest users to identify the payment.
402
- *
403
- * @return string
404
- */
405
- public function getReceiptId()
406
- {
407
- return $this->receipt_id;
408
- }
409
-
410
- /**
411
- * Shows details for an authorization, by ID.
412
- *
413
- * @param string $authorizationId
414
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
415
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
416
- * @return Authorization
417
- */
418
- public static function get($authorizationId, $apiContext = null, $restCall = null)
419
- {
420
- ArgumentValidator::validate($authorizationId, 'authorizationId');
421
- $payLoad = "";
422
- $json = self::executeCall(
423
- "/v1/payments/authorization/$authorizationId",
424
- "GET",
425
- $payLoad,
426
- null,
427
- $apiContext,
428
- $restCall
429
- );
430
- $ret = new Authorization();
431
- $ret->fromJson($json);
432
- return $ret;
433
- }
434
-
435
- /**
436
- * Captures and processes an authorization, by ID. To use this call, the original payment call must specify an intent of `authorize`.
437
- *
438
- * @param Capture $capture
439
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
440
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
441
- * @return Capture
442
- */
443
- public function capture($capture, $apiContext = null, $restCall = null)
444
- {
445
- ArgumentValidator::validate($this->getId(), "Id");
446
- ArgumentValidator::validate($capture, 'capture');
447
- $payLoad = $capture->toJSON();
448
- $json = self::executeCall(
449
- "/v1/payments/authorization/{$this->getId()}/capture",
450
- "POST",
451
- $payLoad,
452
- null,
453
- $apiContext,
454
- $restCall
455
- );
456
- $ret = new Capture();
457
- $ret->fromJson($json);
458
- return $ret;
459
- }
460
-
461
- /**
462
- * Voids, or cancels, an authorization, by ID. You cannot void a fully captured authorization.
463
- *
464
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
465
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
466
- * @return Authorization
467
- */
468
- public function void($apiContext = null, $restCall = null)
469
- {
470
- ArgumentValidator::validate($this->getId(), "Id");
471
- $payLoad = "";
472
- $json = self::executeCall(
473
- "/v1/payments/authorization/{$this->getId()}/void",
474
- "POST",
475
- $payLoad,
476
- null,
477
- $apiContext,
478
- $restCall
479
- );
480
- $this->fromJson($json);
481
- return $this;
482
- }
483
-
484
- /**
485
- * Reauthorizes a PayPal account payment, by authorization ID. To ensure that funds are still available, reauthorize a payment after the initial three-day honor period. Supports only the `amount` request parameter.
486
- *
487
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
488
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
489
- * @return Authorization
490
- */
491
- public function reauthorize($apiContext = null, $restCall = null)
492
- {
493
- ArgumentValidator::validate($this->getId(), "Id");
494
- $payLoad = $this->toJSON();
495
- $json = self::executeCall(
496
- "/v1/payments/authorization/{$this->getId()}/reauthorize",
497
- "POST",
498
- $payLoad,
499
- null,
500
- $apiContext,
501
- $restCall
502
- );
503
- $this->fromJson($json);
504
- return $this;
505
- }
506
-
507
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/BankAccount.php DELETED
@@ -1,629 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class BankAccount
9
- *
10
- * A resource representing a bank account that can be used to fund a payment.
11
- * @deprecated Deprecated. It is for internal use only. It may be removed in next major revision.
12
- *
13
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
14
- *
15
- * @property string account_number
16
- * @property string account_number_type
17
- * @property string routing_number
18
- * @property string account_type
19
- * @property string account_name
20
- * @property string check_type
21
- * @property string auth_type
22
- * @property string auth_capture_timestamp
23
- * @property string bank_name
24
- * @property string country_code
25
- * @property string first_name
26
- * @property string last_name
27
- * @property string birth_date
28
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Address billing_address
29
- * @property string state
30
- * @property string confirmation_status
31
- * @property string payer_id
32
- * @property string external_customer_id
33
- * @property string merchant_id
34
- * @property string create_time
35
- * @property string update_time
36
- * @property string valid_until
37
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links[] links
38
- */
39
- class BankAccount extends PayPalModel
40
- {
41
- /**
42
- * ID of the bank account being saved for later use.
43
- * @deprecated Not publicly available
44
- * @param string $id
45
- *
46
- * @return $this
47
- */
48
- public function setId($id)
49
- {
50
- $this->id = $id;
51
- return $this;
52
- }
53
-
54
- /**
55
- * ID of the bank account being saved for later use.
56
- * @deprecated Not publicly available
57
- * @return string
58
- */
59
- public function getId()
60
- {
61
- return $this->id;
62
- }
63
-
64
- /**
65
- * Account number in either IBAN (max length 34) or BBAN (max length 17) format.
66
- *
67
- * @param string $account_number
68
- *
69
- * @return $this
70
- */
71
- public function setAccountNumber($account_number)
72
- {
73
- $this->account_number = $account_number;
74
- return $this;
75
- }
76
-
77
- /**
78
- * Account number in either IBAN (max length 34) or BBAN (max length 17) format.
79
- *
80
- * @return string
81
- */
82
- public function getAccountNumber()
83
- {
84
- return $this->account_number;
85
- }
86
-
87
- /**
88
- * Type of the bank account number (International or Basic Bank Account Number). For more information refer to http://en.wikipedia.org/wiki/International_Bank_Account_Number.
89
- * Valid Values: ["BBAN", "IBAN"]
90
- *
91
- * @param string $account_number_type
92
- *
93
- * @return $this
94
- */
95
- public function setAccountNumberType($account_number_type)
96
- {
97
- $this->account_number_type = $account_number_type;
98
- return $this;
99
- }
100
-
101
- /**
102
- * Type of the bank account number (International or Basic Bank Account Number). For more information refer to http://en.wikipedia.org/wiki/International_Bank_Account_Number.
103
- *
104
- * @return string
105
- */
106
- public function getAccountNumberType()
107
- {
108
- return $this->account_number_type;
109
- }
110
-
111
- /**
112
- * Routing transit number (aka Bank Code) of the bank (typically for domestic use only - for international use, IBAN includes bank code). For more information refer to http://en.wikipedia.org/wiki/Bank_code.
113
- *
114
- * @param string $routing_number
115
- *
116
- * @return $this
117
- */
118
- public function setRoutingNumber($routing_number)
119
- {
120
- $this->routing_number = $routing_number;
121
- return $this;
122
- }
123
-
124
- /**
125
- * Routing transit number (aka Bank Code) of the bank (typically for domestic use only - for international use, IBAN includes bank code). For more information refer to http://en.wikipedia.org/wiki/Bank_code.
126
- *
127
- * @return string
128
- */
129
- public function getRoutingNumber()
130
- {
131
- return $this->routing_number;
132
- }
133
-
134
- /**
135
- * Type of the bank account.
136
- * Valid Values: ["CHECKING", "SAVINGS"]
137
- *
138
- * @param string $account_type
139
- *
140
- * @return $this
141
- */
142
- public function setAccountType($account_type)
143
- {
144
- $this->account_type = $account_type;
145
- return $this;
146
- }
147
-
148
- /**
149
- * Type of the bank account.
150
- *
151
- * @return string
152
- */
153
- public function getAccountType()
154
- {
155
- return $this->account_type;
156
- }
157
-
158
- /**
159
- * A customer designated name.
160
- *
161
- * @param string $account_name
162
- *
163
- * @return $this
164
- */
165
- public function setAccountName($account_name)
166
- {
167
- $this->account_name = $account_name;
168
- return $this;
169
- }
170
-
171
- /**
172
- * A customer designated name.
173
- *
174
- * @return string
175
- */
176
- public function getAccountName()
177
- {
178
- return $this->account_name;
179
- }
180
-
181
- /**
182
- * Type of the check when this information was obtained through a check by the facilitator or merchant.
183
- * Valid Values: ["PERSONAL", "COMPANY"]
184
- *
185
- * @param string $check_type
186
- *
187
- * @return $this
188
- */
189
- public function setCheckType($check_type)
190
- {
191
- $this->check_type = $check_type;
192
- return $this;
193
- }
194
-
195
- /**
196
- * Type of the check when this information was obtained through a check by the facilitator or merchant.
197
- *
198
- * @return string
199
- */
200
- public function getCheckType()
201
- {
202
- return $this->check_type;
203
- }
204
-
205
- /**
206
- * How the check was obtained from the customer, if check was the source of the information provided.
207
- * Valid Values: ["CCD", "PPD", "TEL", "POP", "ARC", "RCK", "WEB"]
208
- *
209
- * @param string $auth_type
210
- *
211
- * @return $this
212
- */
213
- public function setAuthType($auth_type)
214
- {
215
- $this->auth_type = $auth_type;
216
- return $this;
217
- }
218
-
219
- /**
220
- * How the check was obtained from the customer, if check was the source of the information provided.
221
- *
222
- * @return string
223
- */
224
- public function getAuthType()
225
- {
226
- return $this->auth_type;
227
- }
228
-
229
- /**
230
- * Time at which the authorization (or check) was captured. Use this field if the user authorization needs to be captured due to any privacy requirements.
231
- *
232
- * @param string $auth_capture_timestamp
233
- *
234
- * @return $this
235
- */
236
- public function setAuthCaptureTimestamp($auth_capture_timestamp)
237
- {
238
- $this->auth_capture_timestamp = $auth_capture_timestamp;
239
- return $this;
240
- }
241
-
242
- /**
243
- * Time at which the authorization (or check) was captured. Use this field if the user authorization needs to be captured due to any privacy requirements.
244
- *
245
- * @return string
246
- */
247
- public function getAuthCaptureTimestamp()
248
- {
249
- return $this->auth_capture_timestamp;
250
- }
251
-
252
- /**
253
- * Name of the bank.
254
- *
255
- * @param string $bank_name
256
- *
257
- * @return $this
258
- */
259
- public function setBankName($bank_name)
260
- {
261
- $this->bank_name = $bank_name;
262
- return $this;
263
- }
264
-
265
- /**
266
- * Name of the bank.
267
- *
268
- * @return string
269
- */
270
- public function getBankName()
271
- {
272
- return $this->bank_name;
273
- }
274
-
275
- /**
276
- * 2 letter country code of the Bank.
277
- *
278
- * @param string $country_code
279
- *
280
- * @return $this
281
- */
282
- public function setCountryCode($country_code)
283
- {
284
- $this->country_code = $country_code;
285
- return $this;
286
- }
287
-
288
- /**
289
- * 2 letter country code of the Bank.
290
- *
291
- * @return string
292
- */
293
- public function getCountryCode()
294
- {
295
- return $this->country_code;
296
- }
297
-
298
- /**
299
- * Account holder's first name.
300
- *
301
- * @param string $first_name
302
- *
303
- * @return $this
304
- */
305
- public function setFirstName($first_name)
306
- {
307
- $this->first_name = $first_name;
308
- return $this;
309
- }
310
-
311
- /**
312
- * Account holder's first name.
313
- *
314
- * @return string
315
- */
316
- public function getFirstName()
317
- {
318
- return $this->first_name;
319
- }
320
-
321
- /**
322
- * Account holder's last name.
323
- *
324
- * @param string $last_name
325
- *
326
- * @return $this
327
- */
328
- public function setLastName($last_name)
329
- {
330
- $this->last_name = $last_name;
331
- return $this;
332
- }
333
-
334
- /**
335
- * Account holder's last name.
336
- *
337
- * @return string
338
- */
339
- public function getLastName()
340
- {
341
- return $this->last_name;
342
- }
343
-
344
- /**
345
- * Birth date of the bank account holder.
346
- *
347
- * @param string $birth_date
348
- *
349
- * @return $this
350
- */
351
- public function setBirthDate($birth_date)
352
- {
353
- $this->birth_date = $birth_date;
354
- return $this;
355
- }
356
-
357
- /**
358
- * Birth date of the bank account holder.
359
- *
360
- * @return string
361
- */
362
- public function getBirthDate()
363
- {
364
- return $this->birth_date;
365
- }
366
-
367
- /**
368
- * Billing address.
369
- *
370
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Address $billing_address
371
- *
372
- * @return $this
373
- */
374
- public function setBillingAddress($billing_address)
375
- {
376
- $this->billing_address = $billing_address;
377
- return $this;
378
- }
379
-
380
- /**
381
- * Billing address.
382
- *
383
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Address
384
- */
385
- public function getBillingAddress()
386
- {
387
- return $this->billing_address;
388
- }
389
-
390
- /**
391
- * State of this funding instrument.
392
- * Valid Values: ["ACTIVE", "INACTIVE", "DELETED"]
393
- *
394
- * @param string $state
395
- *
396
- * @return $this
397
- */
398
- public function setState($state)
399
- {
400
- $this->state = $state;
401
- return $this;
402
- }
403
-
404
- /**
405
- * State of this funding instrument.
406
- *
407
- * @return string
408
- */
409
- public function getState()
410
- {
411
- return $this->state;
412
- }
413
-
414
- /**
415
- * Confirmation status of a bank account.
416
- * Valid Values: ["UNCONFIRMED", "CONFIRMED"]
417
- *
418
- * @param string $confirmation_status
419
- *
420
- * @return $this
421
- */
422
- public function setConfirmationStatus($confirmation_status)
423
- {
424
- $this->confirmation_status = $confirmation_status;
425
- return $this;
426
- }
427
-
428
- /**
429
- * Confirmation status of a bank account.
430
- *
431
- * @return string
432
- */
433
- public function getConfirmationStatus()
434
- {
435
- return $this->confirmation_status;
436
- }
437
-
438
- /**
439
- * [DEPRECATED] Use external_customer_id instead.
440
- *
441
- * @param string $payer_id
442
- *
443
- * @return $this
444
- */
445
- public function setPayerId($payer_id)
446
- {
447
- $this->payer_id = $payer_id;
448
- return $this;
449
- }
450
-
451
- /**
452
- * @deprecated [DEPRECATED] Use external_customer_id instead.
453
- *
454
- * @return string
455
- */
456
- public function getPayerId()
457
- {
458
- return $this->payer_id;
459
- }
460
-
461
- /**
462
- * A unique identifier of the customer to whom this bank account belongs to. Generated and provided by the facilitator. This is required when creating or using a stored funding instrument in vault.
463
- *
464
- * @param string $external_customer_id
465
- *
466
- * @return $this
467
- */
468
- public function setExternalCustomerId($external_customer_id)
469
- {
470
- $this->external_customer_id = $external_customer_id;
471
- return $this;
472
- }
473
-
474
- /**
475
- * A unique identifier of the customer to whom this bank account belongs to. Generated and provided by the facilitator. This is required when creating or using a stored funding instrument in vault.
476
- *
477
- * @return string
478
- */
479
- public function getExternalCustomerId()
480
- {
481
- return $this->external_customer_id;
482
- }
483
-
484
- /**
485
- * A unique identifier of the merchant for which this bank account has been stored for. Generated and provided by the facilitator so it can be used to restrict the usage of the bank account to the specific merchant.
486
- *
487
- * @param string $merchant_id
488
- *
489
- * @return $this
490
- */
491
- public function setMerchantId($merchant_id)
492
- {
493
- $this->merchant_id = $merchant_id;
494
- return $this;
495
- }
496
-
497
- /**
498
- * A unique identifier of the merchant for which this bank account has been stored for. Generated and provided by the facilitator so it can be used to restrict the usage of the bank account to the specific merchant.
499
- *
500
- * @return string
501
- */
502
- public function getMerchantId()
503
- {
504
- return $this->merchant_id;
505
- }
506
-
507
- /**
508
- * Time the resource was created.
509
- *
510
- * @param string $create_time
511
- *
512
- * @return $this
513
- */
514
- public function setCreateTime($create_time)
515
- {
516
- $this->create_time = $create_time;
517
- return $this;
518
- }
519
-
520
- /**
521
- * Time the resource was created.
522
- *
523
- * @return string
524
- */
525
- public function getCreateTime()
526
- {
527
- return $this->create_time;
528
- }
529
-
530
- /**
531
- * Time the resource was last updated.
532
- *
533
- * @param string $update_time
534
- *
535
- * @return $this
536
- */
537
- public function setUpdateTime($update_time)
538
- {
539
- $this->update_time = $update_time;
540
- return $this;
541
- }
542
-
543
- /**
544
- * Time the resource was last updated.
545
- *
546
- * @return string
547
- */
548
- public function getUpdateTime()
549
- {
550
- return $this->update_time;
551
- }
552
-
553
- /**
554
- * Date/Time until this resource can be used to fund a payment.
555
- *
556
- * @param string $valid_until
557
- *
558
- * @return $this
559
- */
560
- public function setValidUntil($valid_until)
561
- {
562
- $this->valid_until = $valid_until;
563
- return $this;
564
- }
565
-
566
- /**
567
- * Date/Time until this resource can be used to fund a payment.
568
- *
569
- * @return string
570
- */
571
- public function getValidUntil()
572
- {
573
- return $this->valid_until;
574
- }
575
-
576
- /**
577
- * Sets Links
578
- *
579
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links[] $links
580
- *
581
- * @return $this
582
- */
583
- public function setLinks($links)
584
- {
585
- $this->links = $links;
586
- return $this;
587
- }
588
-
589
- /**
590
- * Gets Links
591
- *
592
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links[]
593
- */
594
- public function getLinks()
595
- {
596
- return $this->links;
597
- }
598
-
599
- /**
600
- * Append Links to the list.
601
- *
602
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links $links
603
- * @return $this
604
- */
605
- public function addLink($links)
606
- {
607
- if (!$this->getLinks()) {
608
- return $this->setLinks(array($links));
609
- } else {
610
- return $this->setLinks(
611
- array_merge($this->getLinks(), array($links))
612
- );
613
- }
614
- }
615
-
616
- /**
617
- * Remove Links from the list.
618
- *
619
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links $links
620
- * @return $this
621
- */
622
- public function removeLink($links)
623
- {
624
- return $this->setLinks(
625
- array_diff($this->getLinks(), array($links))
626
- );
627
- }
628
-
629
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/BankAccountsList.php DELETED
@@ -1,119 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class BankAccountsList
9
- *
10
- * A list of Bank Account Resources
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\BankAccount[] bank_accounts
15
- * @property int count
16
- * @property string next_id
17
- */
18
- class BankAccountsList extends PayPalModel
19
- {
20
- /**
21
- * A list of bank account resources
22
- *
23
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\BankAccount[] $bank_accounts
24
- *
25
- * @return $this
26
- */
27
- public function setBankAccounts($bank_accounts)
28
- {
29
- $this->{"bank-accounts"} = $bank_accounts;
30
- return $this;
31
- }
32
-
33
- /**
34
- * A list of bank account resources
35
- *
36
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\BankAccount[]
37
- */
38
- public function getBankAccounts()
39
- {
40
- return $this->{"bank-accounts"};
41
- }
42
-
43
- /**
44
- * Append BankAccounts to the list.
45
- *
46
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\BankAccount $bankAccount
47
- * @return $this
48
- */
49
- public function addBankAccount($bankAccount)
50
- {
51
- if (!$this->getBankAccounts()) {
52
- return $this->setBankAccounts(array($bankAccount));
53
- } else {
54
- return $this->setBankAccounts(
55
- array_merge($this->getBankAccounts(), array($bankAccount))
56
- );
57
- }
58
- }
59
-
60
- /**
61
- * Remove BankAccounts from the list.
62
- *
63
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\BankAccount $bankAccount
64
- * @return $this
65
- */
66
- public function removeBankAccount($bankAccount)
67
- {
68
- return $this->setBankAccounts(
69
- array_diff($this->getBankAccounts(), array($bankAccount))
70
- );
71
- }
72
-
73
- /**
74
- * Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items.
75
- *
76
- * @param int $count
77
- *
78
- * @return $this
79
- */
80
- public function setCount($count)
81
- {
82
- $this->count = $count;
83
- return $this;
84
- }
85
-
86
- /**
87
- * Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items.
88
- *
89
- * @return int
90
- */
91
- public function getCount()
92
- {
93
- return $this->count;
94
- }
95
-
96
- /**
97
- * Identifier of the next element to get the next range of results.
98
- *
99
- * @param string $next_id
100
- *
101
- * @return $this
102
- */
103
- public function setNextId($next_id)
104
- {
105
- $this->next_id = $next_id;
106
- return $this;
107
- }
108
-
109
- /**
110
- * Identifier of the next element to get the next range of results.
111
- *
112
- * @return string
113
- */
114
- public function getNextId()
115
- {
116
- return $this->next_id;
117
- }
118
-
119
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/BankToken.php DELETED
@@ -1,89 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class BankToken
9
- *
10
- * A resource representing a bank that can be used to fund a payment.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property string bank_id
15
- * @property string external_customer_id
16
- * @property string mandate_reference_number
17
- */
18
- class BankToken extends PayPalModel
19
- {
20
- /**
21
- * ID of a previously saved Bank resource using /vault/bank API.
22
- *
23
- * @param string $bank_id
24
- *
25
- * @return $this
26
- */
27
- public function setBankId($bank_id)
28
- {
29
- $this->bank_id = $bank_id;
30
- return $this;
31
- }
32
-
33
- /**
34
- * ID of a previously saved Bank resource using /vault/bank API.
35
- *
36
- * @return string
37
- */
38
- public function getBankId()
39
- {
40
- return $this->bank_id;
41
- }
42
-
43
- /**
44
- * The unique identifier of the payer used when saving this bank using /vault/bank API.
45
- *
46
- * @param string $external_customer_id
47
- *
48
- * @return $this
49
- */
50
- public function setExternalCustomerId($external_customer_id)
51
- {
52
- $this->external_customer_id = $external_customer_id;
53
- return $this;
54
- }
55
-
56
- /**
57
- * The unique identifier of the payer used when saving this bank using /vault/bank API.
58
- *
59
- * @return string
60
- */
61
- public function getExternalCustomerId()
62
- {
63
- return $this->external_customer_id;
64
- }
65
-
66
- /**
67
- * Identifier of the direct debit mandate to validate. Currently supported only for EU bank accounts(SEPA).
68
- *
69
- * @param string $mandate_reference_number
70
- *
71
- * @return $this
72
- */
73
- public function setMandateReferenceNumber($mandate_reference_number)
74
- {
75
- $this->mandate_reference_number = $mandate_reference_number;
76
- return $this;
77
- }
78
-
79
- /**
80
- * Identifier of the direct debit mandate to validate. Currently supported only for EU bank accounts(SEPA).
81
- *
82
- * @return string
83
- */
84
- public function getMandateReferenceNumber()
85
- {
86
- return $this->mandate_reference_number;
87
- }
88
-
89
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/Billing.php DELETED
@@ -1,43 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class Billing
9
- *
10
- * Billing instrument used to charge the payer.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @deprecated Used internally only.
15
- *
16
- * @property string billing_agreement_id
17
- */
18
- class Billing extends PayPalModel
19
- {
20
- /**
21
- * Identifier of the instrument in PayPal Wallet
22
- *
23
- * @param string $billing_agreement_id
24
- *
25
- * @return $this
26
- */
27
- public function setBillingAgreementId($billing_agreement_id)
28
- {
29
- $this->billing_agreement_id = $billing_agreement_id;
30
- return $this;
31
- }
32
-
33
- /**
34
- * Identifier of the instrument in PayPal Wallet
35
- *
36
- * @return string
37
- */
38
- public function getBillingAgreementId()
39
- {
40
- return $this->billing_agreement_id;
41
- }
42
-
43
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/BillingAgreementToken.php DELETED
@@ -1,17 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class BillingAgreementToken
9
- *
10
- * PayPal generated billing agreement token. It is a token returned by /v1/billing-agreements/agreement-token API end point.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- */
15
- class BillingAgreementToken extends PayPalModel
16
- {
17
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/BillingInfo.php DELETED
@@ -1,235 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class BillingInfo
9
- *
10
- * Billing information for the invoice recipient.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property string email
15
- * @property string first_name
16
- * @property string last_name
17
- * @property string business_name
18
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\InvoiceAddress address
19
- * @property string language
20
- * @property string additional_info
21
- * @property string notification_channel
22
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Phone phone
23
- */
24
- class BillingInfo extends PayPalModel
25
- {
26
- /**
27
- * The invoice recipient email address. Maximum length is 260 characters.
28
- *
29
- * @param string $email
30
- *
31
- * @return $this
32
- */
33
- public function setEmail($email)
34
- {
35
- $this->email = $email;
36
- return $this;
37
- }
38
-
39
- /**
40
- * The invoice recipient email address. Maximum length is 260 characters.
41
- *
42
- * @return string
43
- */
44
- public function getEmail()
45
- {
46
- return $this->email;
47
- }
48
-
49
- /**
50
- * The invoice recipient first name. Maximum length is 30 characters.
51
- *
52
- * @param string $first_name
53
- *
54
- * @return $this
55
- */
56
- public function setFirstName($first_name)
57
- {
58
- $this->first_name = $first_name;
59
- return $this;
60
- }
61
-
62
- /**
63
- * The invoice recipient first name. Maximum length is 30 characters.
64
- *
65
- * @return string
66
- */
67
- public function getFirstName()
68
- {
69
- return $this->first_name;
70
- }
71
-
72
- /**
73
- * The invoice recipient last name. Maximum length is 30 characters.
74
- *
75
- * @param string $last_name
76
- *
77
- * @return $this
78
- */
79
- public function setLastName($last_name)
80
- {
81
- $this->last_name = $last_name;
82
- return $this;
83
- }
84
-
85
- /**
86
- * The invoice recipient last name. Maximum length is 30 characters.
87
- *
88
- * @return string
89
- */
90
- public function getLastName()
91
- {
92
- return $this->last_name;
93
- }
94
-
95
- /**
96
- * The invoice recipient company business name. Maximum length is 100 characters.
97
- *
98
- * @param string $business_name
99
- *
100
- * @return $this
101
- */
102
- public function setBusinessName($business_name)
103
- {
104
- $this->business_name = $business_name;
105
- return $this;
106
- }
107
-
108
- /**
109
- * The invoice recipient company business name. Maximum length is 100 characters.
110
- *
111
- * @return string
112
- */
113
- public function getBusinessName()
114
- {
115
- return $this->business_name;
116
- }
117
-
118
- /**
119
- * The invoice recipient address.
120
- *
121
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\InvoiceAddress $address
122
- *
123
- * @return $this
124
- */
125
- public function setAddress($address)
126
- {
127
- $this->address = $address;
128
- return $this;
129
- }
130
-
131
- /**
132
- * The invoice recipient address.
133
- *
134
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\InvoiceAddress
135
- */
136
- public function getAddress()
137
- {
138
- return $this->address;
139
- }
140
-
141
- /**
142
- * The language in which the email was sent to the payer. Used only when the payer does not have a PayPal account.
143
- * Valid Values: ["da_DK", "de_DE", "en_AU", "en_GB", "en_US", "es_ES", "es_XC", "fr_CA", "fr_FR", "fr_XC", "he_IL", "id_ID", "it_IT", "ja_JP", "nl_NL", "no_NO", "pl_PL", "pt_BR", "pt_PT", "ru_RU", "sv_SE", "th_TH", "tr_TR", "zh_CN", "zh_HK", "zh_TW", "zh_XC"]
144
- *
145
- * @param string $language
146
- *
147
- * @return $this
148
- */
149
- public function setLanguage($language)
150
- {
151
- $this->language = $language;
152
- return $this;
153
- }
154
-
155
- /**
156
- * The language in which the email was sent to the payer. Used only when the payer does not have a PayPal account.
157
- *
158
- * @return string
159
- */
160
- public function getLanguage()
161
- {
162
- return $this->language;
163
- }
164
-
165
- /**
166
- * Additional information, such as business hours. Maximum length is 40 characters.
167
- *
168
- * @param string $additional_info
169
- *
170
- * @return $this
171
- */
172
- public function setAdditionalInfo($additional_info)
173
- {
174
- $this->additional_info = $additional_info;
175
- return $this;
176
- }
177
-
178
- /**
179
- * Additional information, such as business hours. Maximum length is 40 characters.
180
- *
181
- * @return string
182
- */
183
- public function getAdditionalInfo()
184
- {
185
- return $this->additional_info;
186
- }
187
-
188
- /**
189
- * Preferred notification channel of the payer. Email by default.
190
- * Valid Values: ["SMS", "EMAIL"]
191
- *
192
- * @param string $notification_channel
193
- *
194
- * @return $this
195
- */
196
- public function setNotificationChannel($notification_channel)
197
- {
198
- $this->notification_channel = $notification_channel;
199
- return $this;
200
- }
201
-
202
- /**
203
- * Preferred notification channel of the payer. Email by default.
204
- *
205
- * @return string
206
- */
207
- public function getNotificationChannel()
208
- {
209
- return $this->notification_channel;
210
- }
211
-
212
- /**
213
- * Mobile Phone number of the recipient to which SMS will be sent if notification_channel is SMS.
214
- *
215
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Phone $phone
216
- *
217
- * @return $this
218
- */
219
- public function setPhone($phone)
220
- {
221
- $this->phone = $phone;
222
- return $this;
223
- }
224
-
225
- /**
226
- * Mobile Phone number of the recipient to which SMS will be sent if notification_channel is SMS.
227
- *
228
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Phone
229
- */
230
- public function getPhone()
231
- {
232
- return $this->phone;
233
- }
234
-
235
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/CancelNotification.php DELETED
@@ -1,167 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class CancelNotification
9
- *
10
- * Email/SMS notification.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property string subject
15
- * @property string note
16
- * @property bool send_to_merchant
17
- * @property bool send_to_payer
18
- * @property string[] cc_emails
19
- */
20
- class CancelNotification extends PayPalModel
21
- {
22
- /**
23
- * Subject of the notification.
24
- *
25
- * @param string $subject
26
- *
27
- * @return $this
28
- */
29
- public function setSubject($subject)
30
- {
31
- $this->subject = $subject;
32
- return $this;
33
- }
34
-
35
- /**
36
- * Subject of the notification.
37
- *
38
- * @return string
39
- */
40
- public function getSubject()
41
- {
42
- return $this->subject;
43
- }
44
-
45
- /**
46
- * Note to the payer.
47
- *
48
- * @param string $note
49
- *
50
- * @return $this
51
- */
52
- public function setNote($note)
53
- {
54
- $this->note = $note;
55
- return $this;
56
- }
57
-
58
- /**
59
- * Note to the payer.
60
- *
61
- * @return string
62
- */
63
- public function getNote()
64
- {
65
- return $this->note;
66
- }
67
-
68
- /**
69
- * Indicates whether to send a copy of the notification to the merchant.
70
- *
71
- * @param bool $send_to_merchant
72
- *
73
- * @return $this
74
- */
75
- public function setSendToMerchant($send_to_merchant)
76
- {
77
- $this->send_to_merchant = $send_to_merchant;
78
- return $this;
79
- }
80
-
81
- /**
82
- * Indicates whether to send a copy of the notification to the merchant.
83
- *
84
- * @return bool
85
- */
86
- public function getSendToMerchant()
87
- {
88
- return $this->send_to_merchant;
89
- }
90
-
91
- /**
92
- * Indicates whether to send a copy of the notification to the payer.
93
- *
94
- * @param bool $send_to_payer
95
- *
96
- * @return $this
97
- */
98
- public function setSendToPayer($send_to_payer)
99
- {
100
- $this->send_to_payer = $send_to_payer;
101
- return $this;
102
- }
103
-
104
- /**
105
- * Indicates whether to send a copy of the notification to the payer.
106
- *
107
- * @return bool
108
- */
109
- public function getSendToPayer()
110
- {
111
- return $this->send_to_payer;
112
- }
113
-
114
- /**
115
- * Applicable for invoices created with Cc emails. If this field is not in the body, all the cc email addresses added as part of the invoice shall be notified else this field can be used to limit the list of email addresses. Note: additional email addresses are not supported.
116
- *
117
- * @param string[] $cc_emails
118
- *
119
- * @return $this
120
- */
121
- public function setCcEmails($cc_emails)
122
- {
123
- $this->cc_emails = $cc_emails;
124
- return $this;
125
- }
126
-
127
- /**
128
- * Applicable for invoices created with Cc emails. If this field is not in the body, all the cc email addresses added as part of the invoice shall be notified else this field can be used to limit the list of email addresses. Note: additional email addresses are not supported.
129
- *
130
- * @return string[]
131
- */
132
- public function getCcEmails()
133
- {
134
- return $this->cc_emails;
135
- }
136
-
137
- /**
138
- * Append CcEmails to the list.
139
- *
140
- * @param string $string
141
- * @return $this
142
- */
143
- public function addCcEmail($string)
144
- {
145
- if (!$this->getCcEmails()) {
146
- return $this->setCcEmails(array($string));
147
- } else {
148
- return $this->setCcEmails(
149
- array_merge($this->getCcEmails(), array($string))
150
- );
151
- }
152
- }
153
-
154
- /**
155
- * Remove CcEmails from the list.
156
- *
157
- * @param string $string
158
- * @return $this
159
- */
160
- public function removeCcEmail($string)
161
- {
162
- return $this->setCcEmails(
163
- array_diff($this->getCcEmails(), array($string))
164
- );
165
- }
166
-
167
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/Capture.php DELETED
@@ -1,341 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalResourceModel;
6
- use Never5\DownloadMonitor\Dependencies\PayPal\Transport\PayPalRestCall;
7
- use Never5\DownloadMonitor\Dependencies\PayPal\Validation\ArgumentValidator;
8
- use Never5\DownloadMonitor\Dependencies\PayPal\Rest\ApiContext;
9
-
10
- /**
11
- * Class Capture
12
- *
13
- * A capture transaction.
14
- *
15
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
16
- *
17
- * @property string id
18
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Amount amount
19
- * @property bool is_final_capture
20
- * @property string state
21
- * @property string reason_code
22
- * @property string parent_payment
23
- * @property string invoice_number
24
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency transaction_fee
25
- * @property string create_time
26
- * @property string update_time
27
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links[] links
28
- */
29
- class Capture extends PayPalResourceModel
30
- {
31
- /**
32
- * The ID of the capture transaction.
33
- *
34
- * @param string $id
35
- *
36
- * @return $this
37
- */
38
- public function setId($id)
39
- {
40
- $this->id = $id;
41
- return $this;
42
- }
43
-
44
- /**
45
- * The ID of the capture transaction.
46
- *
47
- * @return string
48
- */
49
- public function getId()
50
- {
51
- return $this->id;
52
- }
53
-
54
- /**
55
- * The amount to capture. If the amount matches the orginally authorized amount, the state of the authorization changes to `captured`. If not, the state of the authorization changes to `partially_captured`.
56
- *
57
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Amount $amount
58
- *
59
- * @return $this
60
- */
61
- public function setAmount($amount)
62
- {
63
- $this->amount = $amount;
64
- return $this;
65
- }
66
-
67
- /**
68
- * The amount to capture. If the amount matches the orginally authorized amount, the state of the authorization changes to `captured`. If not, the state of the authorization changes to `partially_captured`.
69
- *
70
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Amount
71
- */
72
- public function getAmount()
73
- {
74
- return $this->amount;
75
- }
76
-
77
- /**
78
- * Indicates whether to release all remaining funds that the authorization holds in the funding instrument. Default is `false`.
79
- *
80
- * @param bool $is_final_capture
81
- *
82
- * @return $this
83
- */
84
- public function setIsFinalCapture($is_final_capture)
85
- {
86
- $this->is_final_capture = $is_final_capture;
87
- return $this;
88
- }
89
-
90
- /**
91
- * Indicates whether to release all remaining funds that the authorization holds in the funding instrument. Default is `false`.
92
- *
93
- * @return bool
94
- */
95
- public function getIsFinalCapture()
96
- {
97
- return $this->is_final_capture;
98
- }
99
-
100
- /**
101
- * The state of the capture.
102
- * Valid Values: ["pending", "completed", "refunded", "partially_refunded"]
103
- *
104
- * @param string $state
105
- *
106
- * @return $this
107
- */
108
- public function setState($state)
109
- {
110
- $this->state = $state;
111
- return $this;
112
- }
113
-
114
- /**
115
- * The state of the capture.
116
- *
117
- * @return string
118
- */
119
- public function getState()
120
- {
121
- return $this->state;
122
- }
123
-
124
- /**
125
- * The reason code that describes why the transaction state is pending or reversed.
126
- * Valid Values: ["CHARGEBACK", "GUARANTEE", "BUYER_COMPLAINT", "REFUND", "UNCONFIRMED_SHIPPING_ADDRESS", "ECHECK", "INTERNATIONAL_WITHDRAWAL", "RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION", "PAYMENT_REVIEW", "REGULATORY_REVIEW", "UNILATERAL", "VERIFICATION_REQUIRED", "TRANSACTION_APPROVED_AWAITING_FUNDING"]
127
- *
128
- * @param string $reason_code
129
- *
130
- * @return $this
131
- */
132
- public function setReasonCode($reason_code)
133
- {
134
- $this->reason_code = $reason_code;
135
- return $this;
136
- }
137
-
138
- /**
139
- * The reason code that describes why the transaction state is pending or reversed.
140
- *
141
- * @return string
142
- */
143
- public function getReasonCode()
144
- {
145
- return $this->reason_code;
146
- }
147
-
148
- /**
149
- * The ID of the payment on which this transaction is based.
150
- *
151
- * @param string $parent_payment
152
- *
153
- * @return $this
154
- */
155
- public function setParentPayment($parent_payment)
156
- {
157
- $this->parent_payment = $parent_payment;
158
- return $this;
159
- }
160
-
161
- /**
162
- * The ID of the payment on which this transaction is based.
163
- *
164
- * @return string
165
- */
166
- public function getParentPayment()
167
- {
168
- return $this->parent_payment;
169
- }
170
-
171
- /**
172
- * The invoice number to track this payment.
173
- *
174
- * @param string $invoice_number
175
- *
176
- * @return $this
177
- */
178
- public function setInvoiceNumber($invoice_number)
179
- {
180
- $this->invoice_number = $invoice_number;
181
- return $this;
182
- }
183
-
184
- /**
185
- * The invoice number to track this payment.
186
- *
187
- * @return string
188
- */
189
- public function getInvoiceNumber()
190
- {
191
- return $this->invoice_number;
192
- }
193
-
194
- /**
195
- * The transaction fee for this payment.
196
- *
197
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency $transaction_fee
198
- *
199
- * @return $this
200
- */
201
- public function setTransactionFee($transaction_fee)
202
- {
203
- $this->transaction_fee = $transaction_fee;
204
- return $this;
205
- }
206
-
207
- /**
208
- * The transaction fee for this payment.
209
- *
210
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency
211
- */
212
- public function getTransactionFee()
213
- {
214
- return $this->transaction_fee;
215
- }
216
-
217
- /**
218
- * The date and time of capture, as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
219
- *
220
- * @param string $create_time
221
- *
222
- * @return $this
223
- */
224
- public function setCreateTime($create_time)
225
- {
226
- $this->create_time = $create_time;
227
- return $this;
228
- }
229
-
230
- /**
231
- * The date and time of capture, as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
232
- *
233
- * @return string
234
- */
235
- public function getCreateTime()
236
- {
237
- return $this->create_time;
238
- }
239
-
240
- /**
241
- * The date and time when the resource was last updated.
242
- *
243
- * @param string $update_time
244
- *
245
- * @return $this
246
- */
247
- public function setUpdateTime($update_time)
248
- {
249
- $this->update_time = $update_time;
250
- return $this;
251
- }
252
-
253
- /**
254
- * The date and time when the resource was last updated.
255
- *
256
- * @return string
257
- */
258
- public function getUpdateTime()
259
- {
260
- return $this->update_time;
261
- }
262
-
263
- /**
264
- * Shows details for a captured payment, by ID.
265
- *
266
- * @param string $captureId
267
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
268
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
269
- * @return Capture
270
- */
271
- public static function get($captureId, $apiContext = null, $restCall = null)
272
- {
273
- ArgumentValidator::validate($captureId, 'captureId');
274
- $payLoad = "";
275
- $json = self::executeCall(
276
- "/v1/payments/capture/$captureId",
277
- "GET",
278
- $payLoad,
279
- null,
280
- $apiContext,
281
- $restCall
282
- );
283
- $ret = new Capture();
284
- $ret->fromJson($json);
285
- return $ret;
286
- }
287
-
288
- /**
289
- * Refund a captured payment by passing the capture_id in the request URI. In addition, include an amount object in the body of the request JSON.
290
- *
291
- * @deprecated Please use #refundCapturedPayment instead.
292
- * @param Refund $refund
293
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
294
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
295
- * @return Refund
296
- */
297
- public function refund($refund, $apiContext = null, $restCall = null)
298
- {
299
- ArgumentValidator::validate($this->getId(), "Id");
300
- ArgumentValidator::validate($refund, 'refund');
301
- $payLoad = $refund->toJSON();
302
- $json = self::executeCall(
303
- "/v1/payments/capture/{$this->getId()}/refund",
304
- "POST",
305
- $payLoad,
306
- null,
307
- $apiContext,
308
- $restCall
309
- );
310
- $ret = new Refund();
311
- $ret->fromJson($json);
312
- return $ret;
313
- }
314
-
315
- /**
316
- * Refunds a captured payment, by ID. Include an `amount` object in the JSON request body.
317
- *
318
- * @param RefundRequest $refundRequest
319
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
320
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
321
- * @return DetailedRefund
322
- */
323
- public function refundCapturedPayment($refundRequest, $apiContext = null, $restCall = null)
324
- {
325
- ArgumentValidator::validate($this->getId(), "Id");
326
- ArgumentValidator::validate($refundRequest, 'refundRequest');
327
- $payLoad = $refundRequest->toJSON();
328
- $json = self::executeCall(
329
- "/v1/payments/capture/{$this->getId()}/refund",
330
- "POST",
331
- $payLoad,
332
- null,
333
- $apiContext,
334
- $restCall
335
- );
336
- $ret = new DetailedRefund();
337
- $ret->fromJson($json);
338
- return $ret;
339
- }
340
-
341
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/CarrierAccountToken.php DELETED
@@ -1,65 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class CarrierAccountToken
9
- *
10
- * A resource representing a carrier account that can be used to fund a payment.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property string carrier_account_id
15
- * @property string external_customer_id
16
- */
17
- class CarrierAccountToken extends PayPalModel
18
- {
19
- /**
20
- * ID of a previously saved carrier account resource.
21
- *
22
- * @param string $carrier_account_id
23
- *
24
- * @return $this
25
- */
26
- public function setCarrierAccountId($carrier_account_id)
27
- {
28
- $this->carrier_account_id = $carrier_account_id;
29
- return $this;
30
- }
31
-
32
- /**
33
- * ID of a previously saved carrier account resource.
34
- *
35
- * @return string
36
- */
37
- public function getCarrierAccountId()
38
- {
39
- return $this->carrier_account_id;
40
- }
41
-
42
- /**
43
- * The unique identifier of the payer used when saving this carrier account instrument.
44
- *
45
- * @param string $external_customer_id
46
- *
47
- * @return $this
48
- */
49
- public function setExternalCustomerId($external_customer_id)
50
- {
51
- $this->external_customer_id = $external_customer_id;
52
- return $this;
53
- }
54
-
55
- /**
56
- * The unique identifier of the payer used when saving this carrier account instrument.
57
- *
58
- * @return string
59
- */
60
- public function getExternalCustomerId()
61
- {
62
- return $this->external_customer_id;
63
- }
64
-
65
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/ChargeModel.php DELETED
@@ -1,89 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class ChargeModel
9
- *
10
- * A resource representing a charge model for a payment definition.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property string id
15
- * @property string type
16
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency amount
17
- */
18
- class ChargeModel extends PayPalModel
19
- {
20
- /**
21
- * Identifier of the charge model. 128 characters max.
22
- *
23
- * @param string $id
24
- *
25
- * @return $this
26
- */
27
- public function setId($id)
28
- {
29
- $this->id = $id;
30
- return $this;
31
- }
32
-
33
- /**
34
- * Identifier of the charge model. 128 characters max.
35
- *
36
- * @return string
37
- */
38
- public function getId()
39
- {
40
- return $this->id;
41
- }
42
-
43
- /**
44
- * Type of charge model. Allowed values: `SHIPPING`, `TAX`.
45
- *
46
- * @param string $type
47
- *
48
- * @return $this
49
- */
50
- public function setType($type)
51
- {
52
- $this->type = $type;
53
- return $this;
54
- }
55
-
56
- /**
57
- * Type of charge model. Allowed values: `SHIPPING`, `TAX`.
58
- *
59
- * @return string
60
- */
61
- public function getType()
62
- {
63
- return $this->type;
64
- }
65
-
66
- /**
67
- * Specific amount for this charge model.
68
- *
69
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency $amount
70
- *
71
- * @return $this
72
- */
73
- public function setAmount($amount)
74
- {
75
- $this->amount = $amount;
76
- return $this;
77
- }
78
-
79
- /**
80
- * Specific amount for this charge model.
81
- *
82
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency
83
- */
84
- public function getAmount()
85
- {
86
- return $this->amount;
87
- }
88
-
89
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/Cost.php DELETED
@@ -1,69 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
- use Never5\DownloadMonitor\Dependencies\PayPal\Converter\FormatConverter;
7
- use Never5\DownloadMonitor\Dependencies\PayPal\Validation\NumericValidator;
8
-
9
- /**
10
- * Class Cost
11
- *
12
- * Cost as a percent or an amount. For example, to specify 10%, enter `10`. Alternatively, to specify an amount of 5, enter `5`.
13
- *
14
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
15
- *
16
- * @property string percent
17
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency amount
18
- */
19
- class Cost extends PayPalModel
20
- {
21
- /**
22
- * Cost in percent. Range of 0 to 100.
23
- *
24
- * @param string $percent
25
- *
26
- * @return $this
27
- */
28
- public function setPercent($percent)
29
- {
30
- NumericValidator::validate($percent, "Percent");
31
- $percent = FormatConverter::formatToNumber($percent);
32
- $this->percent = $percent;
33
- return $this;
34
- }
35
-
36
- /**
37
- * Cost in percent. Range of 0 to 100.
38
- *
39
- * @return string
40
- */
41
- public function getPercent()
42
- {
43
- return $this->percent;
44
- }
45
-
46
- /**
47
- * The cost, as an amount. Valid range is from 0 to 1,000,000.
48
- *
49
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency $amount
50
- *
51
- * @return $this
52
- */
53
- public function setAmount($amount)
54
- {
55
- $this->amount = $amount;
56
- return $this;
57
- }
58
-
59
- /**
60
- * The cost, as an amount. Valid range is from 0 to 1,000,000.
61
- *
62
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency
63
- */
64
- public function getAmount()
65
- {
66
- return $this->amount;
67
- }
68
-
69
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/CountryCode.php DELETED
@@ -1,41 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class CountryCode
9
- *
10
- * The ISO 3166-1 alpha-2 country code. A complete list of valid codes is available at Wikipedia: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 In particular, note that the country code for Great Britain is GB, not UK as used in that country's top-level domain names.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property string country_code
15
- */
16
- class CountryCode extends PayPalModel
17
- {
18
- /**
19
- * ISO country code based on 2-character IS0-3166-1 codes.
20
- *
21
- * @param string $country_code
22
- *
23
- * @return $this
24
- */
25
- public function setCountryCode($country_code)
26
- {
27
- $this->country_code = $country_code;
28
- return $this;
29
- }
30
-
31
- /**
32
- * ISO country code based on 2-character IS0-3166-1 codes.
33
- *
34
- * @return string
35
- */
36
- public function getCountryCode()
37
- {
38
- return $this->country_code;
39
- }
40
-
41
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/CreateProfileResponse.php DELETED
@@ -1,40 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- /**
6
- * Class CreateProfileResponse
7
- *
8
- * Response schema for create profile api
9
- *
10
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
11
- *
12
- * @property string id
13
- */
14
- class CreateProfileResponse extends WebProfile
15
- {
16
- /**
17
- * ID of the payment web experience profile.
18
- *
19
- *
20
- * @param string $id
21
- *
22
- * @return $this
23
- */
24
- public function setId($id)
25
- {
26
- $this->id = $id;
27
- return $this;
28
- }
29
-
30
- /**
31
- * ID of the payment web experience profile.
32
- *
33
- * @return string
34
- */
35
- public function getId()
36
- {
37
- return $this->id;
38
- }
39
-
40
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/Credit.php DELETED
@@ -1,66 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class Credit
9
- *
10
- * A resource representing a credit instrument.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property string id
15
- * @property string type
16
- */
17
- class Credit extends PayPalModel
18
- {
19
- /**
20
- * Unique identifier of credit resource.
21
- *
22
- * @param string $id
23
- *
24
- * @return $this
25
- */
26
- public function setId($id)
27
- {
28
- $this->id = $id;
29
- return $this;
30
- }
31
-
32
- /**
33
- * Unique identifier of credit resource.
34
- *
35
- * @return string
36
- */
37
- public function getId()
38
- {
39
- return $this->id;
40
- }
41
-
42
- /**
43
- * specifies type of credit
44
- * Valid Values: ["BILL_ME_LATER", "PAYPAL_EXTRAS_MASTERCARD", "EBAY_MASTERCARD", "PAYPAL_SMART_CONNECT"]
45
- *
46
- * @param string $type
47
- *
48
- * @return $this
49
- */
50
- public function setType($type)
51
- {
52
- $this->type = $type;
53
- return $this;
54
- }
55
-
56
- /**
57
- * specifies type of credit
58
- *
59
- * @return string
60
- */
61
- public function getType()
62
- {
63
- return $this->type;
64
- }
65
-
66
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/CreditCard.php DELETED
@@ -1,560 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalResourceModel;
6
- use Never5\DownloadMonitor\Dependencies\PayPal\Rest\ApiContext;
7
- use Never5\DownloadMonitor\Dependencies\PayPal\Transport\PayPalRestCall;
8
- use Never5\DownloadMonitor\Dependencies\PayPal\Validation\ArgumentValidator;
9
-
10
- /**
11
- * Class CreditCard
12
- *
13
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
14
- *
15
- * @property string number
16
- * @property string type
17
- * @property int expire_month
18
- * @property int expire_year
19
- * @property string cvv2
20
- * @property string first_name
21
- * @property string last_name
22
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Address billing_address
23
- * @property string external_customer_id
24
- * @property string state
25
- * @property string valid_until
26
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links[] links
27
- */
28
- class CreditCard extends PayPalResourceModel
29
- {
30
- /**
31
- * ID of the credit card. This ID is provided in the response when storing credit cards. **Required if using a stored credit card.**
32
- *
33
- * @deprecated Not publicly available
34
- * @param string $id
35
- *
36
- * @return $this
37
- */
38
- public function setId($id)
39
- {
40
- $this->id = $id;
41
- return $this;
42
- }
43
-
44
- /**
45
- * ID of the credit card. This ID is provided in the response when storing credit cards. **Required if using a stored credit card.**
46
- *
47
- * @deprecated Not publicly available
48
- * @return string
49
- */
50
- public function getId()
51
- {
52
- return $this->id;
53
- }
54
-
55
- /**
56
- * Credit card number. Numeric characters only with no spaces or punctuation. The string must conform with modulo and length required by each credit card type. *Redacted in responses.*
57
- *
58
- * @param string $number
59
- *
60
- * @return $this
61
- */
62
- public function setNumber($number)
63
- {
64
- $this->number = $number;
65
- return $this;
66
- }
67
-
68
- /**
69
- * Credit card number. Numeric characters only with no spaces or punctuation. The string must conform with modulo and length required by each credit card type. *Redacted in responses.*
70
- *
71
- * @return string
72
- */
73
- public function getNumber()
74
- {
75
- return $this->number;
76
- }
77
-
78
- /**
79
- * Credit card type. Valid types are: `visa`, `mastercard`, `discover`, `amex`
80
- *
81
- * @param string $type
82
- *
83
- * @return $this
84
- */
85
- public function setType($type)
86
- {
87
- $this->type = $type;
88
- return $this;
89
- }
90
-
91
- /**
92
- * Credit card type. Valid types are: `visa`, `mastercard`, `discover`, `amex`
93
- *
94
- * @return string
95
- */
96
- public function getType()
97
- {
98
- return $this->type;
99
- }
100
-
101
- /**
102
- * Expiration month with no leading zero. Acceptable values are 1 through 12.
103
- *
104
- * @param int $expire_month
105
- *
106
- * @return $this
107
- */
108
- public function setExpireMonth($expire_month)
109
- {
110
- $this->expire_month = $expire_month;
111
- return $this;
112
- }
113
-
114
- /**
115
- * Expiration month with no leading zero. Acceptable values are 1 through 12.
116
- *
117
- * @return int
118
- */
119
- public function getExpireMonth()
120
- {
121
- return $this->expire_month;
122
- }
123
-
124
- /**
125
- * 4-digit expiration year.
126
- *
127
- * @param int $expire_year
128
- *
129
- * @return $this
130
- */
131
- public function setExpireYear($expire_year)
132
- {
133
- $this->expire_year = $expire_year;
134
- return $this;
135
- }
136
-
137
- /**
138
- * 4-digit expiration year.
139
- *
140
- * @return int
141
- */
142
- public function getExpireYear()
143
- {
144
- return $this->expire_year;
145
- }
146
-
147
- /**
148
- * 3-4 digit card validation code.
149
- *
150
- * @param string $cvv2
151
- *
152
- * @return $this
153
- */
154
- public function setCvv2($cvv2)
155
- {
156
- $this->cvv2 = $cvv2;
157
- return $this;
158
- }
159
-
160
- /**
161
- * 3-4 digit card validation code.
162
- *
163
- * @return string
164
- */
165
- public function getCvv2()
166
- {
167
- return $this->cvv2;
168
- }
169
-
170
- /**
171
- * Cardholder's first name.
172
- *
173
- * @param string $first_name
174
- *
175
- * @return $this
176
- */
177
- public function setFirstName($first_name)
178
- {
179
- $this->first_name = $first_name;
180
- return $this;
181
- }
182
-
183
- /**
184
- * Cardholder's first name.
185
- *
186
- * @return string
187
- */
188
- public function getFirstName()
189
- {
190
- return $this->first_name;
191
- }
192
-
193
- /**
194
- * Cardholder's last name.
195
- *
196
- * @param string $last_name
197
- *
198
- * @return $this
199
- */
200
- public function setLastName($last_name)
201
- {
202
- $this->last_name = $last_name;
203
- return $this;
204
- }
205
-
206
- /**
207
- * Cardholder's last name.
208
- *
209
- * @return string
210
- */
211
- public function getLastName()
212
- {
213
- return $this->last_name;
214
- }
215
-
216
- /**
217
- * Billing Address associated with this card.
218
- *
219
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Address $billing_address
220
- *
221
- * @return $this
222
- */
223
- public function setBillingAddress($billing_address)
224
- {
225
- $this->billing_address = $billing_address;
226
- return $this;
227
- }
228
-
229
- /**
230
- * Billing Address associated with this card.
231
- *
232
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Address
233
- */
234
- public function getBillingAddress()
235
- {
236
- return $this->billing_address;
237
- }
238
-
239
- /**
240
- * A unique identifier of the customer to whom this bank account belongs. Generated and provided by the facilitator. **This is now used in favor of `payer_id` when creating or using a stored funding instrument in the vault.**
241
- *
242
- * @param string $external_customer_id
243
- *
244
- * @return $this
245
- */
246
- public function setExternalCustomerId($external_customer_id)
247
- {
248
- $this->external_customer_id = $external_customer_id;
249
- return $this;
250
- }
251
-
252
- /**
253
- * A unique identifier of the customer to whom this bank account belongs. Generated and provided by the facilitator. **This is now used in favor of `payer_id` when creating or using a stored funding instrument in the vault.**
254
- *
255
- * @return string
256
- */
257
- public function getExternalCustomerId()
258
- {
259
- return $this->external_customer_id;
260
- }
261
-
262
- /**
263
- * A user provided, optional convenvience field that functions as a unique identifier for the merchant on behalf of whom this credit card is being stored for. Note that this has no relation to PayPal merchant id
264
- *
265
- * @param string $merchant_id
266
- *
267
- * @return $this
268
- */
269
- public function setMerchantId($merchant_id)
270
- {
271
- $this->merchant_id = $merchant_id;
272
- return $this;
273
- }
274
-
275
- /**
276
- * A user provided, optional convenvience field that functions as a unique identifier for the merchant on behalf of whom this credit card is being stored for. Note that this has no relation to PayPal merchant id
277
- *
278
- * @return string
279
- */
280
- public function getMerchantId()
281
- {
282
- return $this->merchant_id;
283
- }
284
-
285
- /**
286
- * A unique identifier that you can assign and track when storing a credit card or using a stored credit card. This ID can help to avoid unintentional use or misuse of credit cards. This ID can be any value you would like to associate with the saved card, such as a UUID, username, or email address. Required when using a stored credit card if a payer_id was originally provided when storing the credit card in vault.
287
- *
288
- * @deprecated This is being deprecated in favor of the `external_customer_id` property.
289
- * @param string $payer_id
290
- *
291
- * @return $this
292
- */
293
- public function setPayerId($payer_id)
294
- {
295
- $this->payer_id = $payer_id;
296
- return $this;
297
- }
298
-
299
- /**
300
- * A unique identifier that you can assign and track when storing a credit card or using a stored credit card. This ID can help to avoid unintentional use or misuse of credit cards. This ID can be any value you would like to associate with the saved card, such as a UUID, username, or email address. Required when using a stored credit card if a payer_id was originally provided when storing the credit card in vault.
301
- *
302
- * @deprecated This is being deprecated in favor of the `external_customer_id` property.
303
- * @return string
304
- */
305
- public function getPayerId()
306
- {
307
- return $this->payer_id;
308
- }
309
-
310
- /**
311
- * A unique identifier of the bank account resource. Generated and provided by the facilitator so it can be used to restrict the usage of the bank account to the specific merchant.
312
- *
313
- * @param string $external_card_id
314
- *
315
- * @return $this
316
- */
317
- public function setExternalCardId($external_card_id)
318
- {
319
- $this->external_card_id = $external_card_id;
320
- return $this;
321
- }
322
-
323
- /**
324
- * A unique identifier of the bank account resource. Generated and provided by the facilitator so it can be used to restrict the usage of the bank account to the specific merchant.
325
- *
326
- * @return string
327
- */
328
- public function getExternalCardId()
329
- {
330
- return $this->external_card_id;
331
- }
332
-
333
- /**
334
- * State of the credit card funding instrument.
335
- * Valid Values: ["expired", "ok"]
336
- *
337
- * @param string $state
338
- *
339
- * @return $this
340
- */
341
- public function setState($state)
342
- {
343
- $this->state = $state;
344
- return $this;
345
- }
346
-
347
- /**
348
- * State of the credit card funding instrument.
349
- *
350
- * @return string
351
- */
352
- public function getState()
353
- {
354
- return $this->state;
355
- }
356
-
357
- /**
358
- * Funding instrument expiration date.
359
- *
360
- * @param string $create_time
361
- *
362
- * @return $this
363
- */
364
- public function setCreateTime($create_time)
365
- {
366
- $this->create_time = $create_time;
367
- return $this;
368
- }
369
-
370
- /**
371
- * Resource creation time as ISO8601 date-time format (ex: 1994-11-05T13:15:30Z) that indicates creation time.
372
- *
373
- * @return string
374
- */
375
- public function getCreateTime()
376
- {
377
- return $this->create_time;
378
- }
379
-
380
- /**
381
- * Resource creation time as ISO8601 date-time format (ex: 1994-11-05T13:15:30Z) that indicates the updation time.
382
- *
383
- * @param string $update_time
384
- *
385
- * @return $this
386
- */
387
- public function setUpdateTime($update_time)
388
- {
389
- $this->update_time = $update_time;
390
- return $this;
391
- }
392
-
393
- /**
394
- * Resource creation time as ISO8601 date-time format (ex: 1994-11-05T13:15:30Z) that indicates the updation time.
395
- *
396
- * @return string
397
- */
398
- public function getUpdateTime()
399
- {
400
- return $this->update_time;
401
- }
402
-
403
- /**
404
- * Date/Time until this resource can be used fund a payment.
405
- *
406
- * @param string $valid_until
407
- *
408
- * @return $this
409
- */
410
- public function setValidUntil($valid_until)
411
- {
412
- $this->valid_until = $valid_until;
413
- return $this;
414
- }
415
-
416
- /**
417
- * Funding instrument expiration date.
418
- *
419
- * @return string
420
- */
421
- public function getValidUntil()
422
- {
423
- return $this->valid_until;
424
- }
425
-
426
- /**
427
- * Creates a new Credit Card Resource (aka Tokenize).
428
- *
429
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
430
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
431
- * @return CreditCard
432
- */
433
- public function create($apiContext = null, $restCall = null)
434
- {
435
- $payLoad = $this->toJSON();
436
- $json = self::executeCall(
437
- "/v1/vault/credit-cards",
438
- "POST",
439
- $payLoad,
440
- null,
441
- $apiContext,
442
- $restCall
443
- );
444
- $this->fromJson($json);
445
- return $this;
446
- }
447
-
448
- /**
449
- * Obtain the Credit Card resource for the given identifier.
450
- *
451
- * @param string $creditCardId
452
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
453
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
454
- * @return CreditCard
455
- */
456
- public static function get($creditCardId, $apiContext = null, $restCall = null)
457
- {
458
- ArgumentValidator::validate($creditCardId, 'creditCardId');
459
- $payLoad = "";
460
- $json = self::executeCall(
461
- "/v1/vault/credit-cards/$creditCardId",
462
- "GET",
463
- $payLoad,
464
- null,
465
- $apiContext,
466
- $restCall
467
- );
468
- $ret = new CreditCard();
469
- $ret->fromJson($json);
470
- return $ret;
471
- }
472
-
473
- /**
474
- * Delete the Credit Card resource for the given identifier.
475
- *
476
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
477
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
478
- * @return bool
479
- */
480
- public function delete($apiContext = null, $restCall = null)
481
- {
482
- ArgumentValidator::validate($this->getId(), "Id");
483
- $payLoad = "";
484
- self::executeCall(
485
- "/v1/vault/credit-cards/{$this->getId()}",
486
- "DELETE",
487
- $payLoad,
488
- null,
489
- $apiContext,
490
- $restCall
491
- );
492
- return true;
493
- }
494
-
495
- /**
496
- * Update information in a previously saved card. Only the modified fields need to be passed in the request.
497
- *
498
- * @param PatchRequest $patchRequest
499
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
500
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
501
- * @return CreditCard
502
- */
503
- public function update($patchRequest, $apiContext = null, $restCall = null)
504
- {
505
- ArgumentValidator::validate($this->getId(), "Id");
506
- ArgumentValidator::validate($patchRequest, 'patch');
507
- $payload = $patchRequest->toJSON();
508
- $json = self::executeCall(
509
- "/v1/vault/credit-cards/{$this->getId()}",
510
- "PATCH",
511
- $payload,
512
- null,
513
- $apiContext,
514
- $restCall
515
- );
516
- $this->fromJson($json);
517
- return $this;
518
- }
519
-
520
- /**
521
- * Retrieves a list of Credit Card resources.
522
- *
523
- * @param array $params
524
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
525
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
526
- * @return CreditCardList
527
- */
528
- public static function all($params, $apiContext = null, $restCall = null)
529
- {
530
- if (is_null($params)) {
531
- $params = array();
532
- }
533
- ArgumentValidator::validate($params, 'params');
534
- $payLoad = "";
535
- $allowedParams = array(
536
- 'page_size' => 1,
537
- 'page' => 1,
538
- 'start_time' => 1,
539
- 'end_time' => 1,
540
- 'sort_order' => 1,
541
- 'sort_by' => 1,
542
- 'merchant_id' => 1,
543
- 'external_card_id' => 1,
544
- 'external_customer_id' => 1,
545
- 'total_required' => 1
546
- );
547
- $json = self::executeCall(
548
- "/v1/vault/credit-cards" . "?" . http_build_query(array_intersect_key($params, $allowedParams)),
549
- "GET",
550
- $payLoad,
551
- null,
552
- $apiContext,
553
- $restCall
554
- );
555
- $ret = new CreditCardList();
556
- $ret->fromJson($json);
557
- return $ret;
558
- }
559
-
560
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/CreditCardHistory.php DELETED
@@ -1,91 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class CreditCardHistory
9
- *
10
- * A list of Credit Card Resources
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\CreditCard[] credit_cards
15
- * @property int count
16
- * @property string next_id
17
- */
18
- class CreditCardHistory extends PayPalModel
19
- {
20
- /**
21
- * A list of credit card resources
22
- *
23
- *
24
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\CreditCard[] $credit_cards
25
- * @return $this
26
- */
27
- public function setCreditCards($credit_cards)
28
- {
29
- $this->{"credit-cards"} = $credit_cards;
30
- return $this;
31
- }
32
-
33
- /**
34
- * A list of credit card resources
35
- *
36
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\CreditCard
37
- */
38
- public function getCreditCards()
39
- {
40
- return $this->{"credit-cards"};
41
- }
42
-
43
- /**
44
- * Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items.
45
- *
46
- *
47
- * @param int $count
48
- *
49
- * @return $this
50
- */
51
- public function setCount($count)
52
- {
53
- $this->count = $count;
54
- return $this;
55
- }
56
-
57
- /**
58
- * Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items.
59
- *
60
- * @return int
61
- */
62
- public function getCount()
63
- {
64
- return $this->count;
65
- }
66
-
67
- /**
68
- * Identifier of the next element to get the next range of results.
69
- *
70
- *
71
- * @param string $next_id
72
- *
73
- * @return $this
74
- */
75
- public function setNextId($next_id)
76
- {
77
- $this->next_id = $next_id;
78
- return $this;
79
- }
80
-
81
- /**
82
- * Identifier of the next element to get the next range of results.
83
- *
84
- * @return string
85
- */
86
- public function getNextId()
87
- {
88
- return $this->next_id;
89
- }
90
-
91
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/CreditCardList.php DELETED
@@ -1,120 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalResourceModel;
6
-
7
- /**
8
- * Class CreditCardList
9
- *
10
- * A list of Credit Card Resources
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\CreditCard[] items
15
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links[] links
16
- * @property int total_items
17
- * @property int total_pages
18
- */
19
- class CreditCardList extends PayPalResourceModel
20
- {
21
- /**
22
- * A list of credit card resources
23
- *
24
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\CreditCard[] $items
25
- *
26
- * @return $this
27
- */
28
- public function setItems($items)
29
- {
30
- $this->items = $items;
31
- return $this;
32
- }
33
-
34
- /**
35
- * A list of credit card resources
36
- *
37
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\CreditCard[]
38
- */
39
- public function getItems()
40
- {
41
- return $this->items;
42
- }
43
-
44
- /**
45
- * Append Items to the list.
46
- *
47
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\CreditCard $creditCard
48
- * @return $this
49
- */
50
- public function addItem($creditCard)
51
- {
52
- if (!$this->getItems()) {
53
- return $this->setItems(array($creditCard));
54
- } else {
55
- return $this->setItems(
56
- array_merge($this->getItems(), array($creditCard))
57
- );
58
- }
59
- }
60
-
61
- /**
62
- * Remove Items from the list.
63
- *
64
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\CreditCard $creditCard
65
- * @return $this
66
- */
67
- public function removeItem($creditCard)
68
- {
69
- return $this->setItems(
70
- array_diff($this->getItems(), array($creditCard))
71
- );
72
- }
73
-
74
- /**
75
- * Total number of items present in the given list. Note that the number of items might be larger than the records in the current page.
76
- *
77
- * @param int $total_items
78
- *
79
- * @return $this
80
- */
81
- public function setTotalItems($total_items)
82
- {
83
- $this->total_items = $total_items;
84
- return $this;
85
- }
86
-
87
- /**
88
- * Total number of items present in the given list. Note that the number of items might be larger than the records in the current page.
89
- *
90
- * @return int
91
- */
92
- public function getTotalItems()
93
- {
94
- return $this->total_items;
95
- }
96
-
97
- /**
98
- * Total number of pages that exist, for the total number of items, with the given page size.
99
- *
100
- * @param int $total_pages
101
- *
102
- * @return $this
103
- */
104
- public function setTotalPages($total_pages)
105
- {
106
- $this->total_pages = $total_pages;
107
- return $this;
108
- }
109
-
110
- /**
111
- * Total number of pages that exist, for the total number of items, with the given page size.
112
- *
113
- * @return int
114
- */
115
- public function getTotalPages()
116
- {
117
- return $this->total_pages;
118
- }
119
-
120
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/CreditCardToken.php DELETED
@@ -1,161 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class CreditCardToken
9
- *
10
- * A resource representing a credit card that can be used to fund a payment.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property string credit_card_id
15
- * @property string payer_id
16
- * @property string last4
17
- * @property string type
18
- * @property int expire_month
19
- * @property int expire_year
20
- */
21
- class CreditCardToken extends PayPalModel
22
- {
23
- /**
24
- * ID of credit card previously stored using `/vault/credit-card`.
25
- *
26
- * @param string $credit_card_id
27
- *
28
- * @return $this
29
- */
30
- public function setCreditCardId($credit_card_id)
31
- {
32
- $this->credit_card_id = $credit_card_id;
33
- return $this;
34
- }
35
-
36
- /**
37
- * ID of credit card previously stored using `/vault/credit-card`.
38
- *
39
- * @return string
40
- */
41
- public function getCreditCardId()
42
- {
43
- return $this->credit_card_id;
44
- }
45
-
46
- /**
47
- * A unique identifier that you can assign and track when storing a credit card or using a stored credit card. This ID can help to avoid unintentional use or misuse of credit cards. This ID can be any value you would like to associate with the saved card, such as a UUID, username, or email address. **Required when using a stored credit card if a payer_id was originally provided when storing the credit card in vault.**
48
- *
49
- * @param string $payer_id
50
- *
51
- * @return $this
52
- */
53
- public function setPayerId($payer_id)
54
- {
55
- $this->payer_id = $payer_id;
56
- return $this;
57
- }
58
-
59
- /**
60
- * A unique identifier that you can assign and track when storing a credit card or using a stored credit card. This ID can help to avoid unintentional use or misuse of credit cards. This ID can be any value you would like to associate with the saved card, such as a UUID, username, or email address. **Required when using a stored credit card if a payer_id was originally provided when storing the credit card in vault.**
61
- *
62
- * @return string
63
- */
64
- public function getPayerId()
65
- {
66
- return $this->payer_id;
67
- }
68
-
69
- /**
70
- * Last four digits of the stored credit card number.
71
- *
72
- * @param string $last4
73
- *
74
- * @return $this
75
- */
76
- public function setLast4($last4)
77
- {
78
- $this->last4 = $last4;
79
- return $this;
80
- }
81
-
82
- /**
83
- * Last four digits of the stored credit card number.
84
- *
85
- * @return string
86
- */
87
- public function getLast4()
88
- {
89
- return $this->last4;
90
- }
91
-
92
- /**
93
- * Credit card type. Valid types are: `visa`, `mastercard`, `discover`, `amex`. Values are presented in lowercase and not should not be used for display.
94
- *
95
- * @param string $type
96
- *
97
- * @return $this
98
- */
99
- public function setType($type)
100
- {
101
- $this->type = $type;
102
- return $this;
103
- }
104
-
105
- /**
106
- * Credit card type. Valid types are: `visa`, `mastercard`, `discover`, `amex`. Values are presented in lowercase and not should not be used for display.
107
- *
108
- * @return string
109
- */
110
- public function getType()
111
- {
112
- return $this->type;
113
- }
114
-
115
- /**
116
- * Expiration month with no leading zero. Acceptable values are 1 through 12.
117
- *
118
- * @param int $expire_month
119
- *
120
- * @return $this
121
- */
122
- public function setExpireMonth($expire_month)
123
- {
124
- $this->expire_month = $expire_month;
125
- return $this;
126
- }
127
-
128
- /**
129
- * Expiration month with no leading zero. Acceptable values are 1 through 12.
130
- *
131
- * @return int
132
- */
133
- public function getExpireMonth()
134
- {
135
- return $this->expire_month;
136
- }
137
-
138
- /**
139
- * 4-digit expiration year.
140
- *
141
- * @param int $expire_year
142
- *
143
- * @return $this
144
- */
145
- public function setExpireYear($expire_year)
146
- {
147
- $this->expire_year = $expire_year;
148
- return $this;
149
- }
150
-
151
- /**
152
- * 4-digit expiration year.
153
- *
154
- * @return int
155
- */
156
- public function getExpireYear()
157
- {
158
- return $this->expire_year;
159
- }
160
-
161
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/CreditFinancingOffered.php DELETED
@@ -1,161 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class CreditFinancingOffered
9
- *
10
- * Credit financing offered to customer on PayPal side with opt-in/opt-out status
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency total_cost
15
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\number term
16
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency monthly_payment
17
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency total_interest
18
- * @property bool payer_acceptance
19
- * @property bool cart_amount_immutable
20
- */
21
- class CreditFinancingOffered extends PayPalModel
22
- {
23
- /**
24
- * This is the estimated total payment amount including interest and fees the user will pay during the lifetime of the loan.
25
- *
26
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency $total_cost
27
- *
28
- * @return $this
29
- */
30
- public function setTotalCost($total_cost)
31
- {
32
- $this->total_cost = $total_cost;
33
- return $this;
34
- }
35
-
36
- /**
37
- * This is the estimated total payment amount including interest and fees the user will pay during the lifetime of the loan.
38
- *
39
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency
40
- */
41
- public function getTotalCost()
42
- {
43
- return $this->total_cost;
44
- }
45
-
46
- /**
47
- * Length of financing terms in month
48
- *
49
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\number $term
50
- *
51
- * @return $this
52
- */
53
- public function setTerm($term)
54
- {
55
- $this->term = $term;
56
- return $this;
57
- }
58
-
59
- /**
60
- * Length of financing terms in month
61
- *
62
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\number
63
- */
64
- public function getTerm()
65
- {
66
- return $this->term;
67
- }
68
-
69
- /**
70
- * This is the estimated amount per month that the customer will need to pay including fees and interest.
71
- *
72
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency $monthly_payment
73
- *
74
- * @return $this
75
- */
76
- public function setMonthlyPayment($monthly_payment)
77
- {
78
- $this->monthly_payment = $monthly_payment;
79
- return $this;
80
- }
81
-
82
- /**
83
- * This is the estimated amount per month that the customer will need to pay including fees and interest.
84
- *
85
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency
86
- */
87
- public function getMonthlyPayment()
88
- {
89
- return $this->monthly_payment;
90
- }
91
-
92
- /**
93
- * Estimated interest or fees amount the payer will have to pay during the lifetime of the loan.
94
- *
95
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency $total_interest
96
- *
97
- * @return $this
98
- */
99
- public function setTotalInterest($total_interest)
100
- {
101
- $this->total_interest = $total_interest;
102
- return $this;
103
- }
104
-
105
- /**
106
- * Estimated interest or fees amount the payer will have to pay during the lifetime of the loan.
107
- *
108
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency
109
- */
110
- public function getTotalInterest()
111
- {
112
- return $this->total_interest;
113
- }
114
-
115
- /**
116
- * Status on whether the customer ultimately was approved for and chose to make the payment using the approved installment credit.
117
- *
118
- * @param bool $payer_acceptance
119
- *
120
- * @return $this
121
- */
122
- public function setPayerAcceptance($payer_acceptance)
123
- {
124
- $this->payer_acceptance = $payer_acceptance;
125
- return $this;
126
- }
127
-
128
- /**
129
- * Status on whether the customer ultimately was approved for and chose to make the payment using the approved installment credit.
130
- *
131
- * @return bool
132
- */
133
- public function getPayerAcceptance()
134
- {
135
- return $this->payer_acceptance;
136
- }
137
-
138
- /**
139
- * Indicates whether the cart amount is editable after payer's acceptance on PayPal side
140
- *
141
- * @param bool $cart_amount_immutable
142
- *
143
- * @return $this
144
- */
145
- public function setCartAmountImmutable($cart_amount_immutable)
146
- {
147
- $this->cart_amount_immutable = $cart_amount_immutable;
148
- return $this;
149
- }
150
-
151
- /**
152
- * Indicates whether the cart amount is editable after payer's acceptance on PayPal side
153
- *
154
- * @return bool
155
- */
156
- public function getCartAmountImmutable()
157
- {
158
- return $this->cart_amount_immutable;
159
- }
160
-
161
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/Currency.php DELETED
@@ -1,69 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
- use Never5\DownloadMonitor\Dependencies\PayPal\Converter\FormatConverter;
7
- use Never5\DownloadMonitor\Dependencies\PayPal\Validation\NumericValidator;
8
-
9
- /**
10
- * Class Currency
11
- *
12
- * Base object for all financial value related fields (balance, payment due, etc.)
13
- *
14
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
15
- *
16
- * @property string currency
17
- * @property string value
18
- */
19
- class Currency extends PayPalModel
20
- {
21
- /**
22
- * 3 letter currency code as defined by ISO 4217.
23
- *
24
- * @param string $currency
25
- *
26
- * @return $this
27
- */
28
- public function setCurrency($currency)
29
- {
30
- $this->currency = $currency;
31
- return $this;
32
- }
33
-
34
- /**
35
- * 3 letter currency code as defined by ISO 4217.
36
- *
37
- * @return string
38
- */
39
- public function getCurrency()
40
- {
41
- return $this->currency;
42
- }
43
-
44
- /**
45
- * amount up to N digit after the decimals separator as defined in ISO 4217 for the appropriate currency code.
46
- *
47
- * @param string|double $value
48
- *
49
- * @return $this
50
- */
51
- public function setValue($value)
52
- {
53
- NumericValidator::validate($value, "Value");
54
- $value = FormatConverter::formatToPrice($value, $this->getCurrency());
55
- $this->value = $value;
56
- return $this;
57
- }
58
-
59
- /**
60
- * amount up to N digit after the decimals separator as defined in ISO 4217 for the appropriate currency code.
61
- *
62
- * @return string
63
- */
64
- public function getValue()
65
- {
66
- return $this->value;
67
- }
68
-
69
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/CurrencyConversion.php DELETED
@@ -1,266 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
- use Never5\DownloadMonitor\Dependencies\PayPal\Validation\UrlValidator;
7
-
8
- /**
9
- * Class CurrencyConversion
10
- *
11
- * Object used to store the currency conversion rate.
12
- *
13
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
14
- *
15
- * @property string conversion_date
16
- * @property string from_currency
17
- * @property string from_amount
18
- * @property string to_currency
19
- * @property string to_amount
20
- * @property string conversion_type
21
- * @property bool conversion_type_changeable
22
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links[] links
23
- */
24
- class CurrencyConversion extends PayPalModel
25
- {
26
- /**
27
- * Date of validity for the conversion rate.
28
- *
29
- * @param string $conversion_date
30
- *
31
- * @return $this
32
- */
33
- public function setConversionDate($conversion_date)
34
- {
35
- $this->conversion_date = $conversion_date;
36
- return $this;
37
- }
38
-
39
- /**
40
- * Date of validity for the conversion rate.
41
- *
42
- * @return string
43
- */
44
- public function getConversionDate()
45
- {
46
- return $this->conversion_date;
47
- }
48
-
49
- /**
50
- * 3 letter currency code
51
- *
52
- * @param string $from_currency
53
- *
54
- * @return $this
55
- */
56
- public function setFromCurrency($from_currency)
57
- {
58
- $this->from_currency = $from_currency;
59
- return $this;
60
- }
61
-
62
- /**
63
- * 3 letter currency code
64
- *
65
- * @return string
66
- */
67
- public function getFromCurrency()
68
- {
69
- return $this->from_currency;
70
- }
71
-
72
- /**
73
- * Amount participating in currency conversion, set to 1 as default
74
- *
75
- * @param string $from_amount
76
- *
77
- * @return $this
78
- */
79
- public function setFromAmount($from_amount)
80
- {
81
- $this->from_amount = $from_amount;
82
- return $this;
83
- }
84
-
85
- /**
86
- * Amount participating in currency conversion, set to 1 as default
87
- *
88
- * @return string
89
- */
90
- public function getFromAmount()
91
- {
92
- return $this->from_amount;
93
- }
94
-
95
- /**
96
- * 3 letter currency code
97
- *
98
- * @param string $to_currency
99
- *
100
- * @return $this
101
- */
102
- public function setToCurrency($to_currency)
103
- {
104
- $this->to_currency = $to_currency;
105
- return $this;
106
- }
107
-
108
- /**
109
- * 3 letter currency code
110
- *
111
- * @return string
112
- */
113
- public function getToCurrency()
114
- {
115
- return $this->to_currency;
116
- }
117
-
118
- /**
119
- * Amount resulting from currency conversion.
120
- *
121
- * @param string $to_amount
122
- *
123
- * @return $this
124
- */
125
- public function setToAmount($to_amount)
126
- {
127
- $this->to_amount = $to_amount;
128
- return $this;
129
- }
130
-
131
- /**
132
- * Amount resulting from currency conversion.
133
- *
134
- * @return string
135
- */
136
- public function getToAmount()
137
- {
138
- return $this->to_amount;
139
- }
140
-
141
- /**
142
- * Field indicating conversion type applied.
143
- * Valid Values: ["PAYPAL", "VENDOR"]
144
- *
145
- * @param string $conversion_type
146
- *
147
- * @return $this
148
- */
149
- public function setConversionType($conversion_type)
150
- {
151
- $this->conversion_type = $conversion_type;
152
- return $this;
153
- }
154
-
155
- /**
156
- * Field indicating conversion type applied.
157
- *
158
- * @return string
159
- */
160
- public function getConversionType()
161
- {
162
- return $this->conversion_type;
163
- }
164
-
165
- /**
166
- * Allow Payer to change conversion type.
167
- *
168
- * @param bool $conversion_type_changeable
169
- *
170
- * @return $this
171
- */
172
- public function setConversionTypeChangeable($conversion_type_changeable)
173
- {
174
- $this->conversion_type_changeable = $conversion_type_changeable;
175
- return $this;
176
- }
177
-
178
- /**
179
- * Allow Payer to change conversion type.
180
- *
181
- * @return bool
182
- */
183
- public function getConversionTypeChangeable()
184
- {
185
- return $this->conversion_type_changeable;
186
- }
187
-
188
- /**
189
- * Base URL to web applications endpoint
190
- * Valid Values: ["https://www.paypal.com/{country_code}/webapps/xocspartaweb/webflow/sparta/proxwebflow", "https://www.paypal.com/{country_code}/proxflow"]
191
- * @deprecated Not publicly available
192
- * @param string $web_url
193
- * @throws \InvalidArgumentException
194
- * @return $this
195
- */
196
- public function setWebUrl($web_url)
197
- {
198
- UrlValidator::validate($web_url, "WebUrl");
199
- $this->web_url = $web_url;
200
- return $this;
201
- }
202
-
203
- /**
204
- * Base URL to web applications endpoint
205
- * @deprecated Not publicly available
206
- * @return string
207
- */
208
- public function getWebUrl()
209
- {
210
- return $this->web_url;
211
- }
212
-
213
- /**
214
- * Sets Links
215
- *
216
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links[] $links
217
- *
218
- * @return $this
219
- */
220
- public function setLinks($links)
221
- {
222
- $this->links = $links;
223
- return $this;
224
- }
225
-
226
- /**
227
- * Gets Links
228
- *
229
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links[]
230
- */
231
- public function getLinks()
232
- {
233
- return $this->links;
234
- }
235
-
236
- /**
237
- * Append Links to the list.
238
- *
239
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links $links
240
- * @return $this
241
- */
242
- public function addLink($links)
243
- {
244
- if (!$this->getLinks()) {
245
- return $this->setLinks(array($links));
246
- } else {
247
- return $this->setLinks(
248
- array_merge($this->getLinks(), array($links))
249
- );
250
- }
251
- }
252
-
253
- /**
254
- * Remove Links from the list.
255
- *
256
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links $links
257
- * @return $this
258
- */
259
- public function removeLink($links)
260
- {
261
- return $this->setLinks(
262
- array_diff($this->getLinks(), array($links))
263
- );
264
- }
265
-
266
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/CustomAmount.php DELETED
@@ -1,65 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class CustomAmount
9
- *
10
- * The custom amount applied on an invoice. If you include a label, the amount cannot be empty.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property string label
15
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency amount
16
- */
17
- class CustomAmount extends PayPalModel
18
- {
19
- /**
20
- * The custom amount label. Maximum length is 25 characters.
21
- *
22
- * @param string $label
23
- *
24
- * @return $this
25
- */
26
- public function setLabel($label)
27
- {
28
- $this->label = $label;
29
- return $this;
30
- }
31
-
32
- /**
33
- * The custom amount label. Maximum length is 25 characters.
34
- *
35
- * @return string
36
- */
37
- public function getLabel()
38
- {
39
- return $this->label;
40
- }
41
-
42
- /**
43
- * The custom amount value. Valid range is from -999999.99 to 999999.99.
44
- *
45
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency $amount
46
- *
47
- * @return $this
48
- */
49
- public function setAmount($amount)
50
- {
51
- $this->amount = $amount;
52
- return $this;
53
- }
54
-
55
- /**
56
- * The custom amount value. Valid range is from -999999.99 to 999999.99.
57
- *
58
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency
59
- */
60
- public function getAmount()
61
- {
62
- return $this->amount;
63
- }
64
-
65
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/DetailedRefund.php DELETED
@@ -1,160 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
-
6
- /**
7
- * Class DetailedRefund
8
- *
9
- * A refund transaction. This is the resource that is returned on GET /refund
10
- *
11
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
12
- *
13
- * @property string custom
14
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency refund_to_payer
15
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\ExternalFunding[] refund_to_external_funding
16
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency refund_from_transaction_fee
17
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency refund_from_received_amount
18
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency total_refunded_amount
19
- */
20
- class DetailedRefund extends Refund
21
- {
22
- /**
23
- * free-form field for the use of clients
24
- *
25
- * @param string $custom
26
- *
27
- * @return $this
28
- */
29
- public function setCustom($custom)
30
- {
31
- $this->custom = $custom;
32
- return $this;
33
- }
34
-
35
- /**
36
- * free-form field for the use of clients
37
- *
38
- * @return string
39
- */
40
- public function getCustom()
41
- {
42
- return $this->custom;
43
- }
44
-
45
- /**
46
- * Amount refunded to payer of the original transaction, in the current Refund call
47
- *
48
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency $refund_to_payer
49
- *
50
- * @return $this
51
- */
52
- public function setRefundToPayer($refund_to_payer)
53
- {
54
- $this->refund_to_payer = $refund_to_payer;
55
- return $this;
56
- }
57
-
58
- /**
59
- * Amount refunded to payer of the original transaction, in the current Refund call
60
- *
61
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency
62
- */
63
- public function getRefundToPayer()
64
- {
65
- return $this->refund_to_payer;
66
- }
67
-
68
- /**
69
- * List of external funding that were refunded by the Refund call. Each external_funding unit should have a unique reference_id
70
- *
71
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\ExternalFunding[] $refund_to_external_funding
72
- *
73
- * @return $this
74
- */
75
- public function setRefundToExternalFunding($refund_to_external_funding)
76
- {
77
- $this->refund_to_external_funding = $refund_to_external_funding;
78
- return $this;
79
- }
80
-
81
- /**
82
- * List of external funding that were refunded by the Refund call. Each external_funding unit should have a unique reference_id
83
- *
84
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\ExternalFunding[]
85
- */
86
- public function getRefundToExternalFunding()
87
- {
88
- return $this->refund_to_external_funding;
89
- }
90
-
91
- /**
92
- * Transaction fee refunded to original recipient of payment.
93
- *
94
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency $refund_from_transaction_fee
95
- *
96
- * @return $this
97
- */
98
- public function setRefundFromTransactionFee($refund_from_transaction_fee)
99
- {
100
- $this->refund_from_transaction_fee = $refund_from_transaction_fee;
101
- return $this;
102
- }
103
-
104
- /**
105
- * Transaction fee refunded to original recipient of payment.
106
- *
107
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency
108
- */
109
- public function getRefundFromTransactionFee()
110
- {
111
- return $this->refund_from_transaction_fee;
112
- }
113
-
114
- /**
115
- * Amount subtracted from PayPal balance of the original recipient of payment, to make this refund.
116
- *
117
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency $refund_from_received_amount
118
- *
119
- * @return $this
120
- */
121
- public function setRefundFromReceivedAmount($refund_from_received_amount)
122
- {
123
- $this->refund_from_received_amount = $refund_from_received_amount;
124
- return $this;
125
- }
126
-
127
- /**
128
- * Amount subtracted from PayPal balance of the original recipient of payment, to make this refund.
129
- *
130
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency
131
- */
132
- public function getRefundFromReceivedAmount()
133
- {
134
- return $this->refund_from_received_amount;
135
- }
136
-
137
- /**
138
- * Total amount refunded so far from the original purchase. Say, for example, a buyer makes $100 purchase, the buyer was refunded $20 a week ago and is refunded $30 in this transaction. The gross refund amount is $30 (in this transaction). The total refunded amount is $50.
139
- *
140
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency $total_refunded_amount
141
- *
142
- * @return $this
143
- */
144
- public function setTotalRefundedAmount($total_refunded_amount)
145
- {
146
- $this->total_refunded_amount = $total_refunded_amount;
147
- return $this;
148
- }
149
-
150
- /**
151
- * Total amount refunded so far from the original purchase. Say, for example, a buyer makes $100 purchase, the buyer was refunded $20 a week ago and is refunded $30 in this transaction. The gross refund amount is $30 (in this transaction). The total refunded amount is $50.
152
- *
153
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency
154
- */
155
- public function getTotalRefundedAmount()
156
- {
157
- return $this->total_refunded_amount;
158
- }
159
-
160
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/Error.php DELETED
@@ -1,320 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class Error
9
- *
10
- * Details of an Error
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property string name
15
- * @property string message
16
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\ErrorDetails[] details
17
- * @property string information_link
18
- * @property string debug_id
19
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links[] links
20
- */
21
- class Error extends PayPalModel
22
- {
23
- /**
24
- * Human readable, unique name of the error.
25
- *
26
- * @param string $name
27
- *
28
- * @return $this
29
- */
30
- public function setName($name)
31
- {
32
- $this->name = $name;
33
- return $this;
34
- }
35
-
36
- /**
37
- * Human readable, unique name of the error.
38
- *
39
- * @return string
40
- */
41
- public function getName()
42
- {
43
- return $this->name;
44
- }
45
-
46
- /**
47
- * Reference ID of the purchase_unit associated with this error
48
- *
49
- * @deprecated Not publicly available
50
- * @param string $purchase_unit_reference_id
51
- *
52
- * @return $this
53
- */
54
- public function setPurchaseUnitReferenceId($purchase_unit_reference_id)
55
- {
56
- $this->purchase_unit_reference_id = $purchase_unit_reference_id;
57
- return $this;
58
- }
59
-
60
- /**
61
- * Reference ID of the purchase_unit associated with this error
62
- *
63
- * @deprecated Not publicly available
64
- * @return string
65
- */
66
- public function getPurchaseUnitReferenceId()
67
- {
68
- return $this->purchase_unit_reference_id;
69
- }
70
-
71
- /**
72
- * PayPal internal error code.
73
- *
74
- * @deprecated Not publicly available
75
- * @param string $code
76
- *
77
- * @return $this
78
- */
79
- public function setCode($code)
80
- {
81
- $this->code = $code;
82
- return $this;
83
- }
84
-
85
- /**
86
- * PayPal internal error code.
87
- *
88
- * @deprecated Not publicly available
89
- * @return string
90
- */
91
- public function getCode()
92
- {
93
- return $this->code;
94
- }
95
-
96
- /**
97
- * PayPal internal identifier used for correlation purposes.
98
- *
99
- * @param string $debug_id
100
- *
101
- * @return $this
102
- */
103
- public function setDebugId($debug_id)
104
- {
105
- $this->debug_id = $debug_id;
106
- return $this;
107
- }
108
-
109
- /**
110
- * PayPal internal identifier used for correlation purposes.
111
- *
112
- * @return string
113
- */
114
- public function getDebugId()
115
- {
116
- return $this->debug_id;
117
- }
118
-
119
- /**
120
- * Message describing the error.
121
- *
122
- * @param string $message
123
- *
124
- * @return $this
125
- */
126
- public function setMessage($message)
127
- {
128
- $this->message = $message;
129
- return $this;
130
- }
131
-
132
- /**
133
- * Message describing the error.
134
- *
135
- * @return string
136
- */
137
- public function getMessage()
138
- {
139
- return $this->message;
140
- }
141
-
142
- /**
143
- * URI for detailed information related to this error for the developer.
144
- *
145
- * @param string $information_link
146
- *
147
- * @return $this
148
- */
149
- public function setInformationLink($information_link)
150
- {
151
- $this->information_link = $information_link;
152
- return $this;
153
- }
154
-
155
- /**
156
- * URI for detailed information related to this error for the developer.
157
- *
158
- * @return string
159
- */
160
- public function getInformationLink()
161
- {
162
- return $this->information_link;
163
- }
164
-
165
- /**
166
- * Additional details of the error
167
- *
168
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\ErrorDetails[] $details
169
- *
170
- * @return $this
171
- */
172
- public function setDetails($details)
173
- {
174
- $this->details = $details;
175
- return $this;
176
- }
177
-
178
- /**
179
- * Additional details of the error
180
- *
181
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\ErrorDetails[]
182
- */
183
- public function getDetails()
184
- {
185
- return $this->details;
186
- }
187
-
188
- /**
189
- * Append Details to the list.
190
- *
191
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\ErrorDetails $errorDetails
192
- * @return $this
193
- */
194
- public function addDetail($errorDetails)
195
- {
196
- if (!$this->getDetails()) {
197
- return $this->setDetails(array($errorDetails));
198
- } else {
199
- return $this->setDetails(
200
- array_merge($this->getDetails(), array($errorDetails))
201
- );
202
- }
203
- }
204
-
205
- /**
206
- * Remove Details from the list.
207
- *
208
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\ErrorDetails $errorDetails
209
- * @return $this
210
- */
211
- public function removeDetail($errorDetails)
212
- {
213
- return $this->setDetails(
214
- array_diff($this->getDetails(), array($errorDetails))
215
- );
216
- }
217
-
218
- /**
219
- * response codes returned from a payment processor such as avs, cvv, etc. Only supported when the `payment_method` is set to `credit_card`.
220
- *
221
- * @deprecated Not publicly available
222
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\ProcessorResponse $processor_response
223
- *
224
- * @return $this
225
- */
226
- public function setProcessorResponse($processor_response)
227
- {
228
- $this->processor_response = $processor_response;
229
- return $this;
230
- }
231
-
232
- /**
233
- * response codes returned from a payment processor such as avs, cvv, etc. Only supported when the `payment_method` is set to `credit_card`.
234
- *
235
- * @deprecated Not publicly available
236
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\ProcessorResponse
237
- */
238
- public function getProcessorResponse()
239
- {
240
- return $this->processor_response;
241
- }
242
-
243
- /**
244
- * Fraud filter details. Only supported when the `payment_method` is set to `credit_card`
245
- *
246
- * @deprecated Not publicly available
247
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\FmfDetails $fmf_details
248
- *
249
- * @return $this
250
- */
251
- public function setFmfDetails($fmf_details)
252
- {
253
- $this->fmf_details = $fmf_details;
254
- return $this;
255
- }
256
-
257
- /**
258
- * Fraud filter details. Only supported when the `payment_method` is set to `credit_card`
259
- *
260
- * @deprecated Not publicly available
261
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\FmfDetails
262
- */
263
- public function getFmfDetails()
264
- {
265
- return $this->fmf_details;
266
- }
267
-
268
- /**
269
- * Sets Links
270
- *
271
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links[] $links
272
- *
273
- * @return $this
274
- */
275
- public function setLinks($links)
276
- {
277
- $this->links = $links;
278
- return $this;
279
- }
280
-
281
- /**
282
- * Gets Links
283
- *
284
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links[]
285
- */
286
- public function getLinks()
287
- {
288
- return $this->links;
289
- }
290
-
291
- /**
292
- * Append Links to the list.
293
- *
294
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links $links
295
- * @return $this
296
- */
297
- public function addLink($links)
298
- {
299
- if (!$this->getLinks()) {
300
- return $this->setLinks(array($links));
301
- } else {
302
- return $this->setLinks(
303
- array_merge($this->getLinks(), array($links))
304
- );
305
- }
306
- }
307
-
308
- /**
309
- * Remove Links from the list.
310
- *
311
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links $links
312
- * @return $this
313
- */
314
- public function removeLink($links)
315
- {
316
- return $this->setLinks(
317
- array_diff($this->getLinks(), array($links))
318
- );
319
- }
320
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/ErrorDetails.php DELETED
@@ -1,111 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class ErrorDetails
9
- *
10
- * Details about a specific error.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property string field
15
- * @property string issue
16
- */
17
- class ErrorDetails extends PayPalModel
18
- {
19
- /**
20
- * Name of the field that caused the error.
21
- *
22
- * @param string $field
23
- *
24
- * @return $this
25
- */
26
- public function setField($field)
27
- {
28
- $this->field = $field;
29
- return $this;
30
- }
31
-
32
- /**
33
- * Name of the field that caused the error.
34
- *
35
- * @return string
36
- */
37
- public function getField()
38
- {
39
- return $this->field;
40
- }
41
-
42
- /**
43
- * Reason for the error.
44
- *
45
- * @param string $issue
46
- *
47
- * @return $this
48
- */
49
- public function setIssue($issue)
50
- {
51
- $this->issue = $issue;
52
- return $this;
53
- }
54
-
55
- /**
56
- * Reason for the error.
57
- *
58
- * @return string
59
- */
60
- public function getIssue()
61
- {
62
- return $this->issue;
63
- }
64
-
65
- /**
66
- * Reference ID of the purchase_unit associated with this error
67
- * @deprecated Not publicly available
68
- * @param string $purchase_unit_reference_id
69
- *
70
- * @return $this
71
- */
72
- public function setPurchaseUnitReferenceId($purchase_unit_reference_id)
73
- {
74
- $this->purchase_unit_reference_id = $purchase_unit_reference_id;
75
- return $this;
76
- }
77
-
78
- /**
79
- * Reference ID of the purchase_unit associated with this error
80
- * @deprecated Not publicly available
81
- * @return string
82
- */
83
- public function getPurchaseUnitReferenceId()
84
- {
85
- return $this->purchase_unit_reference_id;
86
- }
87
-
88
- /**
89
- * PayPal internal error code.
90
- * @deprecated Not publicly available
91
- * @param string $code
92
- *
93
- * @return $this
94
- */
95
- public function setCode($code)
96
- {
97
- $this->code = $code;
98
- return $this;
99
- }
100
-
101
- /**
102
- * PayPal internal error code.
103
- * @deprecated Not publicly available
104
- * @return string
105
- */
106
- public function getCode()
107
- {
108
- return $this->code;
109
- }
110
-
111
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/ExtendedBankAccount.php DELETED
@@ -1,38 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- /**
6
- * Class ExtendedBankAccount
7
- *
8
- * A resource representing a bank account that can be used to fund a payment including support for SEPA.
9
- *
10
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
11
- *
12
- */
13
- class ExtendedBankAccount extends BankAccount
14
- {
15
- /**
16
- * Identifier of the direct debit mandate to validate. Currently supported only for EU bank accounts(SEPA).
17
- * @deprecated Not publicly available
18
- * @param string $mandate_reference_number
19
- *
20
- * @return $this
21
- */
22
- public function setMandateReferenceNumber($mandate_reference_number)
23
- {
24
- $this->mandate_reference_number = $mandate_reference_number;
25
- return $this;
26
- }
27
-
28
- /**
29
- * Identifier of the direct debit mandate to validate. Currently supported only for EU bank accounts(SEPA).
30
- * @deprecated Not publicly available
31
- * @return string
32
- */
33
- public function getMandateReferenceNumber()
34
- {
35
- return $this->mandate_reference_number;
36
- }
37
-
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/ExternalFunding.php DELETED
@@ -1,161 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class ExternalFunding
9
- *
10
- * A resource representing an external funding object.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property string reference_id
15
- * @property string code
16
- * @property string funding_account_id
17
- * @property string display_text
18
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Amount amount
19
- * @property string funding_instruction
20
- */
21
- class ExternalFunding extends PayPalModel
22
- {
23
- /**
24
- * Unique identifier for the external funding
25
- *
26
- * @param string $reference_id
27
- *
28
- * @return $this
29
- */
30
- public function setReferenceId($reference_id)
31
- {
32
- $this->reference_id = $reference_id;
33
- return $this;
34
- }
35
-
36
- /**
37
- * Unique identifier for the external funding
38
- *
39
- * @return string
40
- */
41
- public function getReferenceId()
42
- {
43
- return $this->reference_id;
44
- }
45
-
46
- /**
47
- * Generic identifier for the external funding
48
- *
49
- * @param string $code
50
- *
51
- * @return $this
52
- */
53
- public function setCode($code)
54
- {
55
- $this->code = $code;
56
- return $this;
57
- }
58
-
59
- /**
60
- * Generic identifier for the external funding
61
- *
62
- * @return string
63
- */
64
- public function getCode()
65
- {
66
- return $this->code;
67
- }
68
-
69
- /**
70
- * Encrypted PayPal Account identifier for the funding account
71
- *
72
- * @param string $funding_account_id
73
- *
74
- * @return $this
75
- */
76
- public function setFundingAccountId($funding_account_id)
77
- {
78
- $this->funding_account_id = $funding_account_id;
79
- return $this;
80
- }
81
-
82
- /**
83
- * Encrypted PayPal Account identifier for the funding account
84
- *
85
- * @return string
86
- */
87
- public function getFundingAccountId()
88
- {
89
- return $this->funding_account_id;
90
- }
91
-
92
- /**
93
- * Description of the external funding being applied
94
- *
95
- * @param string $display_text
96
- *
97
- * @return $this
98
- */
99
- public function setDisplayText($display_text)
100
- {
101
- $this->display_text = $display_text;
102
- return $this;
103
- }
104
-
105
- /**
106
- * Description of the external funding being applied
107
- *
108
- * @return string
109
- */
110
- public function getDisplayText()
111
- {
112
- return $this->display_text;
113
- }
114
-
115
- /**
116
- * Amount being funded by the external funding account
117
- *
118
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Amount $amount
119
- *
120
- * @return $this
121
- */
122
- public function setAmount($amount)
123
- {
124
- $this->amount = $amount;
125
- return $this;
126
- }
127
-
128
- /**
129
- * Amount being funded by the external funding account
130
- *
131
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Amount
132
- */
133
- public function getAmount()
134
- {
135
- return $this->amount;
136
- }
137
-
138
- /**
139
- * Indicates that the Payment should be fully funded by External Funded Incentive
140
- * Valid Values: ["FULLY_FUNDED"]
141
- *
142
- * @param string $funding_instruction
143
- *
144
- * @return $this
145
- */
146
- public function setFundingInstruction($funding_instruction)
147
- {
148
- $this->funding_instruction = $funding_instruction;
149
- return $this;
150
- }
151
-
152
- /**
153
- * Indicates that the Payment should be fully funded by External Funded Incentive
154
- *
155
- * @return string
156
- */
157
- public function getFundingInstruction()
158
- {
159
- return $this->funding_instruction;
160
- }
161
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/FileAttachment.php DELETED
@@ -1,67 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
- use Never5\DownloadMonitor\Dependencies\PayPal\Validation\UrlValidator;
7
-
8
- /**
9
- * Class FileAttachment
10
- *
11
- * File attached to an invoice or template
12
- *
13
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
14
- *
15
- * @property string name
16
- * @property string url
17
- */
18
- class FileAttachment extends PayPalModel
19
- {
20
- /**
21
- * Name of the file attached.
22
- *
23
- * @param string $name
24
- *
25
- * @return $this
26
- */
27
- public function setName($name)
28
- {
29
- $this->name = $name;
30
- return $this;
31
- }
32
-
33
- /**
34
- * Name of the file attached.
35
- *
36
- * @return string
37
- */
38
- public function getName()
39
- {
40
- return $this->name;
41
- }
42
-
43
- /**
44
- * URL of the attached file that can be downloaded.
45
- *
46
- * @param string $url
47
- * @throws \InvalidArgumentException
48
- * @return $this
49
- */
50
- public function setUrl($url)
51
- {
52
- UrlValidator::validate($url, "Url");
53
- $this->url = $url;
54
- return $this;
55
- }
56
-
57
- /**
58
- * URL of the attached file that can be downloaded.
59
- *
60
- * @return string
61
- */
62
- public function getUrl()
63
- {
64
- return $this->url;
65
- }
66
-
67
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/FlowConfig.php DELETED
@@ -1,115 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
- use Never5\DownloadMonitor\Dependencies\PayPal\Validation\UrlValidator;
7
-
8
- /**
9
- * Class FlowConfig
10
- *
11
- * Parameters for flow configuration.
12
- *
13
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
14
- *
15
- * @property string landing_page_type
16
- * @property string bank_txn_pending_url
17
- * @property string user_action
18
- * @property string return_uri_http_method
19
- */
20
- class FlowConfig extends PayPalModel
21
- {
22
- /**
23
- * The type of landing page to display on the PayPal site for user checkout. Set to `Billing` to use the non-PayPal account landing page. Set to `Login` to use the PayPal account login landing page.
24
- *
25
- * @param string $landing_page_type
26
- *
27
- * @return $this
28
- */
29
- public function setLandingPageType($landing_page_type)
30
- {
31
- $this->landing_page_type = $landing_page_type;
32
- return $this;
33
- }
34
-
35
- /**
36
- * The type of landing page to display on the PayPal site for user checkout. Set to `Billing` to use the non-PayPal account landing page. Set to `Login` to use the PayPal account login landing page.
37
- *
38
- * @return string
39
- */
40
- public function getLandingPageType()
41
- {
42
- return $this->landing_page_type;
43
- }
44
-
45
- /**
46
- * The merchant site URL to display after a bank transfer payment. Valid for only the Giropay or bank transfer payment method in Germany.
47
- *
48
- * @param string $bank_txn_pending_url
49
- * @throws \InvalidArgumentException
50
- * @return $this
51
- */
52
- public function setBankTxnPendingUrl($bank_txn_pending_url)
53
- {
54
- UrlValidator::validate($bank_txn_pending_url, "BankTxnPendingUrl");
55
- $this->bank_txn_pending_url = $bank_txn_pending_url;
56
- return $this;
57
- }
58
-
59
- /**
60
- * The merchant site URL to display after a bank transfer payment. Valid for only the Giropay or bank transfer payment method in Germany.
61
- *
62
- * @return string
63
- */
64
- public function getBankTxnPendingUrl()
65
- {
66
- return $this->bank_txn_pending_url;
67
- }
68
-
69
- /**
70
- * Defines whether buyers can complete purchases on the PayPal or merchant website.
71
- *
72
- * @param string $user_action
73
- *
74
- * @return $this
75
- */
76
- public function setUserAction($user_action)
77
- {
78
- $this->user_action = $user_action;
79
- return $this;
80
- }
81
-
82
- /**
83
- * Defines whether buyers can complete purchases on the PayPal or merchant website.
84
- *
85
- * @return string
86
- */
87
- public function getUserAction()
88
- {
89
- return $this->user_action;
90
- }
91
-
92
- /**
93
- * Defines the HTTP method to use to redirect the user to a return URL. A valid value is `GET` or `POST`.
94
- *
95
- * @param string $return_uri_http_method
96
- *
97
- * @return $this
98
- */
99
- public function setReturnUriHttpMethod($return_uri_http_method)
100
- {
101
- $this->return_uri_http_method = $return_uri_http_method;
102
- return $this;
103
- }
104
-
105
- /**
106
- * Defines the HTTP method to use to redirect the user to a return URL. A valid value is `GET` or `POST`.
107
- *
108
- * @return string
109
- */
110
- public function getReturnUriHttpMethod()
111
- {
112
- return $this->return_uri_http_method;
113
- }
114
-
115
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/FmfDetails.php DELETED
@@ -1,115 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class FmfDetails
9
- *
10
- * Details of Fraud Management Filter (FMF).
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property string filter_type
15
- * @property string filter_id
16
- * @property string name
17
- * @property string description
18
- */
19
- class FmfDetails extends PayPalModel
20
- {
21
- /**
22
- * Type of filter.
23
- * Valid Values: ["ACCEPT", "PENDING", "DENY", "REPORT"]
24
- *
25
- * @param string $filter_type
26
- *
27
- * @return $this
28
- */
29
- public function setFilterType($filter_type)
30
- {
31
- $this->filter_type = $filter_type;
32
- return $this;
33
- }
34
-
35
- /**
36
- * Type of filter.
37
- *
38
- * @return string
39
- */
40
- public function getFilterType()
41
- {
42
- return $this->filter_type;
43
- }
44
-
45
- /**
46
- * Filter Identifier.
47
- * Valid Values: ["AVS_NO_MATCH", "AVS_PARTIAL_MATCH", "AVS_UNAVAILABLE_OR_UNSUPPORTED", "CARD_SECURITY_CODE_MISMATCH", "MAXIMUM_TRANSACTION_AMOUNT", "UNCONFIRMED_ADDRESS", "COUNTRY_MONITOR", "LARGE_ORDER_NUMBER", "BILLING_OR_SHIPPING_ADDRESS_MISMATCH", "RISKY_ZIP_CODE", "SUSPECTED_FREIGHT_FORWARDER_CHECK", "TOTAL_PURCHASE_PRICE_MINIMUM", "IP_ADDRESS_VELOCITY", "RISKY_EMAIL_ADDRESS_DOMAIN_CHECK", "RISKY_BANK_IDENTIFICATION_NUMBER_CHECK", "RISKY_IP_ADDRESS_RANGE", "PAYPAL_FRAUD_MODEL"]
48
- *
49
- * @param string $filter_id
50
- *
51
- * @return $this
52
- */
53
- public function setFilterId($filter_id)
54
- {
55
- $this->filter_id = $filter_id;
56
- return $this;
57
- }
58
-
59
- /**
60
- * Filter Identifier.
61
- *
62
- * @return string
63
- */
64
- public function getFilterId()
65
- {
66
- return $this->filter_id;
67
- }
68
-
69
- /**
70
- * Name of the filter
71
- *
72
- * @param string $name
73
- *
74
- * @return $this
75
- */
76
- public function setName($name)
77
- {
78
- $this->name = $name;
79
- return $this;
80
- }
81
-
82
- /**
83
- * Name of the filter
84
- *
85
- * @return string
86
- */
87
- public function getName()
88
- {
89
- return $this->name;
90
- }
91
-
92
- /**
93
- * Description of the filter.
94
- *
95
- * @param string $description
96
- *
97
- * @return $this
98
- */
99
- public function setDescription($description)
100
- {
101
- $this->description = $description;
102
- return $this;
103
- }
104
-
105
- /**
106
- * Description of the filter.
107
- *
108
- * @return string
109
- */
110
- public function getDescription()
111
- {
112
- return $this->description;
113
- }
114
-
115
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/FundingDetail.php DELETED
@@ -1,114 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class FundingDetail
9
- *
10
- * Additional detail of the funding.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property string clearing_time
15
- * @property string payment_hold_date
16
- * @property string payment_debit_date
17
- * @property string processing_type
18
- */
19
- class FundingDetail extends PayPalModel
20
- {
21
- /**
22
- * Expected clearing time
23
- *
24
- * @param string $clearing_time
25
- *
26
- * @return $this
27
- */
28
- public function setClearingTime($clearing_time)
29
- {
30
- $this->clearing_time = $clearing_time;
31
- return $this;
32
- }
33
-
34
- /**
35
- * Expected clearing time
36
- *
37
- * @return string
38
- */
39
- public function getClearingTime()
40
- {
41
- return $this->clearing_time;
42
- }
43
-
44
- /**
45
- * [DEPRECATED] Hold-off duration of the payment. payment_debit_date should be used instead.
46
- *
47
- * @param string $payment_hold_date
48
- *
49
- * @return $this
50
- */
51
- public function setPaymentHoldDate($payment_hold_date)
52
- {
53
- $this->payment_hold_date = $payment_hold_date;
54
- return $this;
55
- }
56
-
57
- /**
58
- * @deprecated [DEPRECATED] Hold-off duration of the payment. payment_debit_date should be used instead.
59
- *
60
- * @return string
61
- */
62
- public function getPaymentHoldDate()
63
- {
64
- return $this->payment_hold_date;
65
- }
66
-
67
- /**
68
- * Date when funds will be debited from the payer's account
69
- *
70
- * @param string $payment_debit_date
71
- *
72
- * @return $this
73
- */
74
- public function setPaymentDebitDate($payment_debit_date)
75
- {
76
- $this->payment_debit_date = $payment_debit_date;
77
- return $this;
78
- }
79
-
80
- /**
81
- * Date when funds will be debited from the payer's account
82
- *
83
- * @return string
84
- */
85
- public function getPaymentDebitDate()
86
- {
87
- return $this->payment_debit_date;
88
- }
89
-
90
- /**
91
- * Processing type of the payment card
92
- * Valid Values: ["CUP_SECURE", "PINLESS_DEBIT"]
93
- *
94
- * @param string $processing_type
95
- *
96
- * @return $this
97
- */
98
- public function setProcessingType($processing_type)
99
- {
100
- $this->processing_type = $processing_type;
101
- return $this;
102
- }
103
-
104
- /**
105
- * Processing type of the payment card
106
- *
107
- * @return string
108
- */
109
- public function getProcessingType()
110
- {
111
- return $this->processing_type;
112
- }
113
-
114
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/FundingInstrument.php DELETED
@@ -1,321 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class FundingInstrument
9
- *
10
- * A resource representing a Payer's funding instrument. An instance of this schema is valid if and only if it is valid against exactly one of these supported properties
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\CreditCard credit_card
15
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\CreditCardToken credit_card_token
16
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Billing billing
17
- */
18
- class FundingInstrument extends PayPalModel
19
- {
20
- /**
21
- * Credit Card instrument.
22
- *
23
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\CreditCard $credit_card
24
- *
25
- * @return $this
26
- */
27
- public function setCreditCard($credit_card)
28
- {
29
- $this->credit_card = $credit_card;
30
- return $this;
31
- }
32
-
33
- /**
34
- * Credit Card instrument.
35
- *
36
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\CreditCard
37
- */
38
- public function getCreditCard()
39
- {
40
- return $this->credit_card;
41
- }
42
-
43
- /**
44
- * PayPal vaulted credit Card instrument.
45
- *
46
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\CreditCardToken $credit_card_token
47
- *
48
- * @return $this
49
- */
50
- public function setCreditCardToken($credit_card_token)
51
- {
52
- $this->credit_card_token = $credit_card_token;
53
- return $this;
54
- }
55
-
56
- /**
57
- * PayPal vaulted credit Card instrument.
58
- *
59
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\CreditCardToken
60
- */
61
- public function getCreditCardToken()
62
- {
63
- return $this->credit_card_token;
64
- }
65
-
66
- /**
67
- * Payment Card information.
68
- *
69
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\PaymentCard $payment_card
70
- *
71
- * @return $this
72
- */
73
- public function setPaymentCard($payment_card)
74
- {
75
- $this->payment_card = $payment_card;
76
- return $this;
77
- }
78
-
79
- /**
80
- * Payment Card information.
81
- *
82
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\PaymentCard
83
- */
84
- public function getPaymentCard()
85
- {
86
- return $this->payment_card;
87
- }
88
-
89
- /**
90
- * Bank Account information.
91
- * @deprecated Not publicly available
92
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\ExtendedBankAccount $bank_account
93
- *
94
- * @return $this
95
- */
96
- public function setBankAccount($bank_account)
97
- {
98
- $this->bank_account = $bank_account;
99
- return $this;
100
- }
101
-
102
- /**
103
- * Bank Account information.
104
- * @deprecated Not publicly available
105
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\ExtendedBankAccount
106
- */
107
- public function getBankAccount()
108
- {
109
- return $this->bank_account;
110
- }
111
-
112
- /**
113
- * Vaulted bank account instrument.
114
- * @deprecated Not publicly available
115
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\BankToken $bank_account_token
116
- *
117
- * @return $this
118
- */
119
- public function setBankAccountToken($bank_account_token)
120
- {
121
- $this->bank_account_token = $bank_account_token;
122
- return $this;
123
- }
124
-
125
- /**
126
- * Vaulted bank account instrument.
127
- * @deprecated Not publicly available
128
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\BankToken
129
- */
130
- public function getBankAccountToken()
131
- {
132
- return $this->bank_account_token;
133
- }
134
-
135
- /**
136
- * PayPal credit funding instrument.
137
- * @deprecated Not publicly available
138
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Credit $credit
139
- *
140
- * @return $this
141
- */
142
- public function setCredit($credit)
143
- {
144
- $this->credit = $credit;
145
- return $this;
146
- }
147
-
148
- /**
149
- * PayPal credit funding instrument.
150
- * @deprecated Not publicly available
151
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Credit
152
- */
153
- public function getCredit()
154
- {
155
- return $this->credit;
156
- }
157
-
158
- /**
159
- * Incentive funding instrument.
160
- * @deprecated Not publicly available
161
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Incentive $incentive
162
- *
163
- * @return $this
164
- */
165
- public function setIncentive($incentive)
166
- {
167
- $this->incentive = $incentive;
168
- return $this;
169
- }
170
-
171
- /**
172
- * Incentive funding instrument.
173
- * @deprecated Not publicly available
174
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Incentive
175
- */
176
- public function getIncentive()
177
- {
178
- return $this->incentive;
179
- }
180
-
181
- /**
182
- * External funding instrument.
183
- * @deprecated Not publicly available
184
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\ExternalFunding $external_funding
185
- *
186
- * @return $this
187
- */
188
- public function setExternalFunding($external_funding)
189
- {
190
- $this->external_funding = $external_funding;
191
- return $this;
192
- }
193
-
194
- /**
195
- * External funding instrument.
196
- * @deprecated Not publicly available
197
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\ExternalFunding
198
- */
199
- public function getExternalFunding()
200
- {
201
- return $this->external_funding;
202
- }
203
-
204
- /**
205
- * Carrier account token instrument.
206
- * @deprecated Not publicly available
207
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\CarrierAccountToken $carrier_account_token
208
- *
209
- * @return $this
210
- */
211
- public function setCarrierAccountToken($carrier_account_token)
212
- {
213
- $this->carrier_account_token = $carrier_account_token;
214
- return $this;
215
- }
216
-
217
- /**
218
- * Carrier account token instrument.
219
- * @deprecated Not publicly available
220
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\CarrierAccountToken
221
- */
222
- public function getCarrierAccountToken()
223
- {
224
- return $this->carrier_account_token;
225
- }
226
-
227
- /**
228
- * Carrier account instrument
229
- * @deprecated Not publicly available
230
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\CarrierAccount $carrier_account
231
- *
232
- * @return $this
233
- */
234
- public function setCarrierAccount($carrier_account)
235
- {
236
- $this->carrier_account = $carrier_account;
237
- return $this;
238
- }
239
-
240
- /**
241
- * Carrier account instrument
242
- * @deprecated Not publicly available
243
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\CarrierAccount
244
- */
245
- public function getCarrierAccount()
246
- {
247
- return $this->carrier_account;
248
- }
249
-
250
- /**
251
- * Private Label Card funding instrument. These are store cards provided by merchants to drive business with value to customer with convenience and rewards.
252
- * @deprecated Not publicly available
253
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\PrivateLabelCard $private_label_card
254
- *
255
- * @return $this
256
- */
257
- public function setPrivateLabelCard($private_label_card)
258
- {
259
- $this->private_label_card = $private_label_card;
260
- return $this;
261
- }
262
-
263
- /**
264
- * Private Label Card funding instrument. These are store cards provided by merchants to drive business with value to customer with convenience and rewards.
265
- * @deprecated Not publicly available
266
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\PrivateLabelCard
267
- */
268
- public function getPrivateLabelCard()
269
- {
270
- return $this->private_label_card;
271
- }
272
-
273
- /**
274
- * Billing instrument that references pre-approval information for the payment
275
- *
276
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Billing $billing
277
- *
278
- * @return $this
279
- */
280
- public function setBilling($billing)
281
- {
282
- $this->billing = $billing;
283
- return $this;
284
- }
285
-
286
- /**
287
- * Billing instrument that references pre-approval information for the payment
288
- *
289
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Billing
290
- */
291
- public function getBilling()
292
- {
293
- return $this->billing;
294
- }
295
-
296
- /**
297
- * Alternate Payment information - Mostly regional payment providers. For e.g iDEAL in Netherlands
298
- *
299
- * @deprecated Not publicly available
300
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\AlternatePayment $alternate_payment
301
- *
302
- * @return $this
303
- */
304
- public function setAlternatePayment($alternate_payment)
305
- {
306
- $this->alternate_payment = $alternate_payment;
307
- return $this;
308
- }
309
-
310
- /**
311
- * Alternate Payment information - Mostly regional payment providers. For e.g iDEAL in Netherlands
312
- *
313
- * @deprecated Not publicly available
314
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\AlternatePayment
315
- */
316
- public function getAlternatePayment()
317
- {
318
- return $this->alternate_payment;
319
- }
320
-
321
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/FundingOption.php DELETED
@@ -1,221 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class FundingOption
9
- *
10
- * specifies the funding option details.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property string id
15
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\FundingSource[] funding_sources
16
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\FundingInstrument backup_funding_instrument
17
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\CurrencyConversion currency_conversion
18
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\InstallmentInfo installment_info
19
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links[] links
20
- */
21
- class FundingOption extends PayPalModel
22
- {
23
- /**
24
- * id of the funding option.
25
- *
26
- * @param string $id
27
- *
28
- * @return $this
29
- */
30
- public function setId($id)
31
- {
32
- $this->id = $id;
33
- return $this;
34
- }
35
-
36
- /**
37
- * id of the funding option.
38
- *
39
- * @return string
40
- */
41
- public function getId()
42
- {
43
- return $this->id;
44
- }
45
-
46
- /**
47
- * List of funding sources that contributes to a payment.
48
- *
49
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\FundingSource[] $funding_sources
50
- *
51
- * @return $this
52
- */
53
- public function setFundingSources($funding_sources)
54
- {
55
- $this->funding_sources = $funding_sources;
56
- return $this;
57
- }
58
-
59
- /**
60
- * List of funding sources that contributes to a payment.
61
- *
62
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\FundingSource[]
63
- */
64
- public function getFundingSources()
65
- {
66
- return $this->funding_sources;
67
- }
68
-
69
- /**
70
- * Append FundingSources to the list.
71
- *
72
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\FundingSource $fundingSource
73
- * @return $this
74
- */
75
- public function addFundingSource($fundingSource)
76
- {
77
- if (!$this->getFundingSources()) {
78
- return $this->setFundingSources(array($fundingSource));
79
- } else {
80
- return $this->setFundingSources(
81
- array_merge($this->getFundingSources(), array($fundingSource))
82
- );
83
- }
84
- }
85
-
86
- /**
87
- * Remove FundingSources from the list.
88
- *
89
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\FundingSource $fundingSource
90
- * @return $this
91
- */
92
- public function removeFundingSource($fundingSource)
93
- {
94
- return $this->setFundingSources(
95
- array_diff($this->getFundingSources(), array($fundingSource))
96
- );
97
- }
98
-
99
- /**
100
- * Backup funding instrument which will be used for payment if primary fails.
101
- *
102
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\FundingInstrument $backup_funding_instrument
103
- *
104
- * @return $this
105
- */
106
- public function setBackupFundingInstrument($backup_funding_instrument)
107
- {
108
- $this->backup_funding_instrument = $backup_funding_instrument;
109
- return $this;
110
- }
111
-
112
- /**
113
- * Backup funding instrument which will be used for payment if primary fails.
114
- *
115
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\FundingInstrument
116
- */
117
- public function getBackupFundingInstrument()
118
- {
119
- return $this->backup_funding_instrument;
120
- }
121
-
122
- /**
123
- * Currency conversion applicable to this funding option.
124
- *
125
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\CurrencyConversion $currency_conversion
126
- *
127
- * @return $this
128
- */
129
- public function setCurrencyConversion($currency_conversion)
130
- {
131
- $this->currency_conversion = $currency_conversion;
132
- return $this;
133
- }
134
-
135
- /**
136
- * Currency conversion applicable to this funding option.
137
- *
138
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\CurrencyConversion
139
- */
140
- public function getCurrencyConversion()
141
- {
142
- return $this->currency_conversion;
143
- }
144
-
145
- /**
146
- * Installment options available for a funding option.
147
- *
148
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\InstallmentInfo $installment_info
149
- *
150
- * @return $this
151
- */
152
- public function setInstallmentInfo($installment_info)
153
- {
154
- $this->installment_info = $installment_info;
155
- return $this;
156
- }
157
-
158
- /**
159
- * Installment options available for a funding option.
160
- *
161
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\InstallmentInfo
162
- */
163
- public function getInstallmentInfo()
164
- {
165
- return $this->installment_info;
166
- }
167
-
168
- /**
169
- * Sets Links
170
- *
171
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links[] $links
172
- *
173
- * @return $this
174
- */
175
- public function setLinks($links)
176
- {
177
- $this->links = $links;
178
- return $this;
179
- }
180
-
181
- /**
182
- * Gets Links
183
- *
184
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links[]
185
- */
186
- public function getLinks()
187
- {
188
- return $this->links;
189
- }
190
-
191
- /**
192
- * Append Links to the list.
193
- *
194
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links $links
195
- * @return $this
196
- */
197
- public function addLink($links)
198
- {
199
- if (!$this->getLinks()) {
200
- return $this->setLinks(array($links));
201
- } else {
202
- return $this->setLinks(
203
- array_merge($this->getLinks(), array($links))
204
- );
205
- }
206
- }
207
-
208
- /**
209
- * Remove Links from the list.
210
- *
211
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links $links
212
- * @return $this
213
- */
214
- public function removeLink($links)
215
- {
216
- return $this->setLinks(
217
- array_diff($this->getLinks(), array($links))
218
- );
219
- }
220
-
221
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/FundingSource.php DELETED
@@ -1,292 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class FundingSource
9
- *
10
- * specifies the funding source details.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property string funding_mode
15
- * @property string funding_instrument_type
16
- * @property string soft_descriptor
17
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency amount
18
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency negative_balance_amount
19
- * @property string legal_text
20
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\FundingDetail funding_detail
21
- * @property string additional_text
22
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links[] links
23
- */
24
- class FundingSource extends FundingInstrument
25
- {
26
- /**
27
- * specifies funding mode of the instrument
28
- * Valid Values: ["INSTANT_TRANSFER", "MANUAL_BANK_TRANSFER", "DELAYED_TRANSFER", "ECHECK", "PAY_UPON_INVOICE"]
29
- *
30
- * @param string $funding_mode
31
- *
32
- * @return $this
33
- */
34
- public function setFundingMode($funding_mode)
35
- {
36
- $this->funding_mode = $funding_mode;
37
- return $this;
38
- }
39
-
40
- /**
41
- * specifies funding mode of the instrument
42
- *
43
- * @return string
44
- */
45
- public function getFundingMode()
46
- {
47
- return $this->funding_mode;
48
- }
49
-
50
- /**
51
- * Instrument type for this funding source
52
- * Valid Values: ["BALANCE", "PAYMENT_CARD", "BANK_ACCOUNT", "CREDIT", "INCENTIVE", "EXTERNAL_FUNDING", "TAB"]
53
- *
54
- * @param string $funding_instrument_type
55
- *
56
- * @return $this
57
- */
58
- public function setFundingInstrumentType($funding_instrument_type)
59
- {
60
- $this->funding_instrument_type = $funding_instrument_type;
61
- return $this;
62
- }
63
-
64
- /**
65
- * Instrument type for this funding source
66
- *
67
- * @return string
68
- */
69
- public function getFundingInstrumentType()
70
- {
71
- return $this->funding_instrument_type;
72
- }
73
-
74
- /**
75
- * Soft descriptor used when charging this funding source.
76
- *
77
- * @param string $soft_descriptor
78
- *
79
- * @return $this
80
- */
81
- public function setSoftDescriptor($soft_descriptor)
82
- {
83
- $this->soft_descriptor = $soft_descriptor;
84
- return $this;
85
- }
86
-
87
- /**
88
- * Soft descriptor used when charging this funding source.
89
- *
90
- * @return string
91
- */
92
- public function getSoftDescriptor()
93
- {
94
- return $this->soft_descriptor;
95
- }
96
-
97
- /**
98
- * Total anticipated amount of money to be pulled from instrument.
99
- *
100
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency $amount
101
- *
102
- * @return $this
103
- */
104
- public function setAmount($amount)
105
- {
106
- $this->amount = $amount;
107
- return $this;
108
- }
109
-
110
- /**
111
- * Total anticipated amount of money to be pulled from instrument.
112
- *
113
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency
114
- */
115
- public function getAmount()
116
- {
117
- return $this->amount;
118
- }
119
-
120
- /**
121
- * Additional amount to be pulled from the instrument to recover a negative balance on the buyer's account that is owed to PayPal.
122
- *
123
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency $negative_balance_amount
124
- *
125
- * @return $this
126
- */
127
- public function setNegativeBalanceAmount($negative_balance_amount)
128
- {
129
- $this->negative_balance_amount = $negative_balance_amount;
130
- return $this;
131
- }
132
-
133
- /**
134
- * Additional amount to be pulled from the instrument to recover a negative balance on the buyer's account that is owed to PayPal.
135
- *
136
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency
137
- */
138
- public function getNegativeBalanceAmount()
139
- {
140
- return $this->negative_balance_amount;
141
- }
142
-
143
- /**
144
- * Localized legal text relevant to funding source.
145
- *
146
- * @param string $legal_text
147
- *
148
- * @return $this
149
- */
150
- public function setLegalText($legal_text)
151
- {
152
- $this->legal_text = $legal_text;
153
- return $this;
154
- }
155
-
156
- /**
157
- * Localized legal text relevant to funding source.
158
- *
159
- * @return string
160
- */
161
- public function getLegalText()
162
- {
163
- return $this->legal_text;
164
- }
165
-
166
- /**
167
- * Additional detail of the funding.
168
- *
169
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\FundingDetail $funding_detail
170
- *
171
- * @return $this
172
- */
173
- public function setFundingDetail($funding_detail)
174
- {
175
- $this->funding_detail = $funding_detail;
176
- return $this;
177
- }
178
-
179
- /**
180
- * Additional detail of the funding.
181
- *
182
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\FundingDetail
183
- */
184
- public function getFundingDetail()
185
- {
186
- return $this->funding_detail;
187
- }
188
-
189
- /**
190
- * Additional text relevant to funding source.
191
- *
192
- * @param string $additional_text
193
- *
194
- * @return $this
195
- */
196
- public function setAdditionalText($additional_text)
197
- {
198
- $this->additional_text = $additional_text;
199
- return $this;
200
- }
201
-
202
- /**
203
- * Additional text relevant to funding source.
204
- *
205
- * @return string
206
- */
207
- public function getAdditionalText()
208
- {
209
- return $this->additional_text;
210
- }
211
-
212
- /**
213
- * Sets Extends
214
- *
215
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\FundingInstrument $extends
216
- *
217
- * @deprecated Unused
218
- *
219
- * @return $this
220
- */
221
- public function setExtends($extends)
222
- {
223
- $this->extends = $extends;
224
- return $this;
225
- }
226
-
227
- /**
228
- * Gets Extends
229
- *
230
- * @deprecated Unused
231
- *
232
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\FundingInstrument
233
- */
234
- public function getExtends()
235
- {
236
- return $this->extends;
237
- }
238
-
239
- /**
240
- * Sets Links
241
- *
242
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links[] $links
243
- *
244
- * @return $this
245
- */
246
- public function setLinks($links)
247
- {
248
- $this->links = $links;
249
- return $this;
250
- }
251
-
252
- /**
253
- * Gets Links
254
- *
255
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links[]
256
- */
257
- public function getLinks()
258
- {
259
- return $this->links;
260
- }
261
-
262
- /**
263
- * Append Links to the list.
264
- *
265
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links $links
266
- * @return $this
267
- */
268
- public function addLink($links)
269
- {
270
- if (!$this->getLinks()) {
271
- return $this->setLinks(array($links));
272
- } else {
273
- return $this->setLinks(
274
- array_merge($this->getLinks(), array($links))
275
- );
276
- }
277
- }
278
-
279
- /**
280
- * Remove Links from the list.
281
- *
282
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links $links
283
- * @return $this
284
- */
285
- public function removeLink($links)
286
- {
287
- return $this->setLinks(
288
- array_diff($this->getLinks(), array($links))
289
- );
290
- }
291
-
292
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/FuturePayment.php DELETED
@@ -1,59 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Rest\ApiContext;
6
- use Never5\DownloadMonitor\Dependencies\PayPal\Transport\PayPalRestCall;
7
-
8
- /**
9
- * Class FuturePayment
10
- *
11
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
12
- */
13
- class FuturePayment extends Payment
14
- {
15
-
16
- /**
17
- * Extends the Payment object to create future payments
18
- *
19
- * @param null $apiContext
20
- * @param string|null $clientMetadataId
21
- * @param PayPalRestCall|null $restCall is the Rest Call Service that is used to make rest calls
22
- * @return $this
23
- */
24
- public function create($apiContext = null, $clientMetadataId = null, $restCall = null)
25
- {
26
- $headers = array();
27
- if ($clientMetadataId != null) {
28
- $headers = array(
29
- 'PAYPAL-CLIENT-METADATA-ID' => $clientMetadataId
30
- );
31
- }
32
- $payLoad = $this->toJSON();
33
- $json = self::executeCall(
34
- "/v1/payments/payment",
35
- "POST",
36
- $payLoad,
37
- $headers,
38
- $apiContext,
39
- $restCall
40
- );
41
- $this->fromJson($json);
42
- return $this;
43
- }
44
-
45
- /**
46
- * Get a Refresh Token from Authorization Code
47
- *
48
- * @param $authorizationCode
49
- * @param ApiContext $apiContext
50
- * @return string|null refresh token
51
- */
52
- public static function getRefreshToken($authorizationCode, $apiContext = null)
53
- {
54
- $apiContext = $apiContext ? $apiContext : new ApiContext(self::$credential);
55
- $credential = $apiContext->getCredential();
56
- return $credential->getRefreshToken($apiContext->getConfig(), $authorizationCode);
57
- }
58
-
59
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/HyperSchema.php DELETED
@@ -1,191 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class HyperSchema
9
- *
10
- *
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links[] links
15
- * @property string fragmentResolution
16
- * @property bool readonly
17
- * @property string contentEncoding
18
- * @property string pathStart
19
- * @property string mediaType
20
- */
21
- class HyperSchema extends PayPalModel
22
- {
23
- /**
24
- * Sets Links
25
- *
26
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links[] $links
27
- *
28
- * @return $this
29
- */
30
- public function setLinks($links)
31
- {
32
- $this->links = $links;
33
- return $this;
34
- }
35
-
36
- /**
37
- * Gets Links
38
- *
39
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links[]
40
- */
41
- public function getLinks()
42
- {
43
- return $this->links;
44
- }
45
-
46
- /**
47
- * Append Links to the list.
48
- *
49
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links $links
50
- * @return $this
51
- */
52
- public function addLink($links)
53
- {
54
- if (!$this->getLinks()) {
55
- return $this->setLinks(array($links));
56
- } else {
57
- return $this->setLinks(
58
- array_merge($this->getLinks(), array($links))
59
- );
60
- }
61
- }
62
-
63
- /**
64
- * Remove Links from the list.
65
- *
66
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links $links
67
- * @return $this
68
- */
69
- public function removeLink($links)
70
- {
71
- return $this->setLinks(
72
- array_diff($this->getLinks(), array($links))
73
- );
74
- }
75
-
76
- /**
77
- * Sets FragmentResolution
78
- *
79
- * @param string $fragmentResolution
80
- *
81
- * @return $this
82
- */
83
- public function setFragmentResolution($fragmentResolution)
84
- {
85
- $this->fragmentResolution = $fragmentResolution;
86
- return $this;
87
- }
88
-
89
- /**
90
- * Gets FragmentResolution
91
- *
92
- * @return string
93
- */
94
- public function getFragmentResolution()
95
- {
96
- return $this->fragmentResolution;
97
- }
98
-
99
- /**
100
- * Sets Readonly
101
- *
102
- * @param bool $readonly
103
- *
104
- * @return $this
105
- */
106
- public function setReadonly($readonly)
107
- {
108
- $this->readonly = $readonly;
109
- return $this;
110
- }
111
-
112
- /**
113
- * Gets Readonly
114
- *
115
- * @return bool
116
- */
117
- public function getReadonly()
118
- {
119
- return $this->readonly;
120
- }
121
-
122
- /**
123
- * Sets ContentEncoding
124
- *
125
- * @param string $contentEncoding
126
- *
127
- * @return $this
128
- */
129
- public function setContentEncoding($contentEncoding)
130
- {
131
- $this->contentEncoding = $contentEncoding;
132
- return $this;
133
- }
134
-
135
- /**
136
- * Gets ContentEncoding
137
- *
138
- * @return string
139
- */
140
- public function getContentEncoding()
141
- {
142
- return $this->contentEncoding;
143
- }
144
-
145
- /**
146
- * Sets PathStart
147
- *
148
- * @param string $pathStart
149
- *
150
- * @return $this
151
- */
152
- public function setPathStart($pathStart)
153
- {
154
- $this->pathStart = $pathStart;
155
- return $this;
156
- }
157
-
158
- /**
159
- * Gets PathStart
160
- *
161
- * @return string
162
- */
163
- public function getPathStart()
164
- {
165
- return $this->pathStart;
166
- }
167
-
168
- /**
169
- * Sets MediaType
170
- *
171
- * @param string $mediaType
172
- *
173
- * @return $this
174
- */
175
- public function setMediaType($mediaType)
176
- {
177
- $this->mediaType = $mediaType;
178
- return $this;
179
- }
180
-
181
- /**
182
- * Gets MediaType
183
- *
184
- * @return string
185
- */
186
- public function getMediaType()
187
- {
188
- return $this->mediaType;
189
- }
190
-
191
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/Image.php DELETED
@@ -1,56 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class Image
9
- *
10
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
11
- *
12
- * @property string image
13
- */
14
- class Image extends PayPalModel
15
- {
16
- /**
17
- * List of invoices belonging to a merchant.
18
- *
19
- * @param string $imageBase64String
20
- *
21
- * @return $this
22
- */
23
- public function setImage($imageBase64String)
24
- {
25
- $this->image = $imageBase64String;
26
- return $this;
27
- }
28
-
29
- /**
30
- * Get Image as Base-64 encoded String
31
- *
32
- * @return string
33
- */
34
- public function getImage()
35
- {
36
- return $this->image;
37
- }
38
-
39
- /**
40
- * Stores the Image to file
41
- *
42
- * @param string $name File Name
43
- * @return string File name
44
- */
45
- public function saveToFile($name = null)
46
- {
47
- // Self Generate File Location
48
- if (!$name) {
49
- $name = uniqid() . '.png';
50
- }
51
- // Save to File
52
- file_put_contents($name, base64_decode($this->getImage()));
53
- return $name;
54
- }
55
-
56
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/Incentive.php DELETED
@@ -1,236 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
- use Never5\DownloadMonitor\Dependencies\PayPal\Validation\UrlValidator;
7
-
8
- /**
9
- * Class Incentive
10
- *
11
- * A resource representing a incentive.
12
- *
13
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
14
- *
15
- * @property string id
16
- * @property string code
17
- * @property string name
18
- * @property string description
19
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency minimum_purchase_amount
20
- * @property string logo_image_url
21
- * @property string expiry_date
22
- * @property string type
23
- * @property string terms
24
- */
25
- class Incentive extends PayPalModel
26
- {
27
- /**
28
- * Identifier of the instrument in PayPal Wallet
29
- *
30
- * @param string $id
31
- *
32
- * @return $this
33
- */
34
- public function setId($id)
35
- {
36
- $this->id = $id;
37
- return $this;
38
- }
39
-
40
- /**
41
- * Identifier of the instrument in PayPal Wallet
42
- *
43
- * @return string
44
- */
45
- public function getId()
46
- {
47
- return $this->id;
48
- }
49
-
50
- /**
51
- * Code that identifies the incentive.
52
- *
53
- * @param string $code
54
- *
55
- * @return $this
56
- */
57
- public function setCode($code)
58
- {
59
- $this->code = $code;
60
- return $this;
61
- }
62
-
63
- /**
64
- * Code that identifies the incentive.
65
- *
66
- * @return string
67
- */
68
- public function getCode()
69
- {
70
- return $this->code;
71
- }
72
-
73
- /**
74
- * Name of the incentive.
75
- *
76
- * @param string $name
77
- *
78
- * @return $this
79
- */
80
- public function setName($name)
81
- {
82
- $this->name = $name;
83
- return $this;
84
- }
85
-
86
- /**
87
- * Name of the incentive.
88
- *
89
- * @return string
90
- */
91
- public function getName()
92
- {
93
- return $this->name;
94
- }
95
-
96
- /**
97
- * Description of the incentive.
98
- *
99
- * @param string $description
100
- *
101
- * @return $this
102
- */
103
- public function setDescription($description)
104
- {
105
- $this->description = $description;
106
- return $this;
107
- }
108
-
109
- /**
110
- * Description of the incentive.
111
- *
112
- * @return string
113
- */
114
- public function getDescription()
115
- {
116
- return $this->description;
117
- }
118
-
119
- /**
120
- * Indicates incentive is applicable for this minimum purchase amount.
121
- *
122
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency $minimum_purchase_amount
123
- *
124
- * @return $this
125
- */
126
- public function setMinimumPurchaseAmount($minimum_purchase_amount)
127
- {
128
- $this->minimum_purchase_amount = $minimum_purchase_amount;
129
- return $this;
130
- }
131
-
132
- /**
133
- * Indicates incentive is applicable for this minimum purchase amount.
134
- *
135
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency
136
- */
137
- public function getMinimumPurchaseAmount()
138
- {
139
- return $this->minimum_purchase_amount;
140
- }
141
-
142
- /**
143
- * Logo image url for the incentive.
144
- *
145
- * @param string $logo_image_url
146
- * @throws \InvalidArgumentException
147
- * @return $this
148
- */
149
- public function setLogoImageUrl($logo_image_url)
150
- {
151
- UrlValidator::validate($logo_image_url, "LogoImageUrl");
152
- $this->logo_image_url = $logo_image_url;
153
- return $this;
154
- }
155
-
156
- /**
157
- * Logo image url for the incentive.
158
- *
159
- * @return string
160
- */
161
- public function getLogoImageUrl()
162
- {
163
- return $this->logo_image_url;
164
- }
165
-
166
- /**
167
- * expiry date of the incentive.
168
- *
169
- * @param string $expiry_date
170
- *
171
- * @return $this
172
- */
173
- public function setExpiryDate($expiry_date)
174
- {
175
- $this->expiry_date = $expiry_date;
176
- return $this;
177
- }
178
-
179
- /**
180
- * expiry date of the incentive.
181
- *
182
- * @return string
183
- */
184
- public function getExpiryDate()
185
- {
186
- return $this->expiry_date;
187
- }
188
-
189
- /**
190
- * Specifies type of incentive
191
- * Valid Values: ["COUPON", "GIFT_CARD", "MERCHANT_SPECIFIC_BALANCE", "VOUCHER"]
192
- *
193
- * @param string $type
194
- *
195
- * @return $this
196
- */
197
- public function setType($type)
198
- {
199
- $this->type = $type;
200
- return $this;
201
- }
202
-
203
- /**
204
- * Specifies type of incentive
205
- *
206
- * @return string
207
- */
208
- public function getType()
209
- {
210
- return $this->type;
211
- }
212
-
213
- /**
214
- * URI to the associated terms
215
- *
216
- * @param string $terms
217
- *
218
- * @return $this
219
- */
220
- public function setTerms($terms)
221
- {
222
- $this->terms = $terms;
223
- return $this;
224
- }
225
-
226
- /**
227
- * URI to the associated terms
228
- *
229
- * @return string
230
- */
231
- public function getTerms()
232
- {
233
- return $this->terms;
234
- }
235
-
236
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/InputFields.php DELETED
@@ -1,89 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class InputFields
9
- *
10
- * Parameters for input fields customization.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property bool allow_note
15
- * @property int no_shipping
16
- * @property int address_override
17
- */
18
- class InputFields extends PayPalModel
19
- {
20
- /**
21
- * Indicates whether the buyer can enter a note to the merchant on the PayPal page during checkout.
22
- *
23
- * @param bool $allow_note
24
- *
25
- * @return $this
26
- */
27
- public function setAllowNote($allow_note)
28
- {
29
- $this->allow_note = $allow_note;
30
- return $this;
31
- }
32
-
33
- /**
34
- * Indicates whether the buyer can enter a note to the merchant on the PayPal page during checkout.
35
- *
36
- * @return bool
37
- */
38
- public function getAllowNote()
39
- {
40
- return $this->allow_note;
41
- }
42
-
43
- /**
44
- * Indicates whether PayPal displays shipping address fields on the experience pages. Valid value is `0`, `1`, or `2`. Set to `0` to display the shipping address on the PayPal pages. Set to `1` to redact shipping address fields from the PayPal pages. Set to `2` to not pass the shipping address but instead get it from the buyer's account profile. For digital goods, this field is required and value must be `1`.
45
- *
46
- * @param int $no_shipping
47
- *
48
- * @return $this
49
- */
50
- public function setNoShipping($no_shipping)
51
- {
52
- $this->no_shipping = $no_shipping;
53
- return $this;
54
- }
55
-
56
- /**
57
- * Indicates whether PayPal displays shipping address fields on the experience pages. Valid value is `0`, `1`, or `2`. Set to `0` to display the shipping address on the PayPal pages. Set to `1` to redact shipping address fields from the PayPal pages. Set to `2` to not pass the shipping address but instead get it from the buyer's account profile. For digital goods, this field is required and value must be `1`.
58
- *
59
- * @return int
60
- */
61
- public function getNoShipping()
62
- {
63
- return $this->no_shipping;
64
- }
65
-
66
- /**
67
- * Indicates whether to display the shipping address that is passed to this call rather than the one on file with PayPal for this buyer on the PayPal experience pages. Valid value is `0` or `1`. Set to `0` to display the shipping address on file. Set to `1` to display the shipping address supplied to this call; the buyer cannot edit this shipping address.
68
- *
69
- * @param int $address_override
70
- *
71
- * @return $this
72
- */
73
- public function setAddressOverride($address_override)
74
- {
75
- $this->address_override = $address_override;
76
- return $this;
77
- }
78
-
79
- /**
80
- * Indicates whether to display the shipping address that is passed to this call rather than the one on file with PayPal for this buyer on the PayPal experience pages. Valid value is `0` or `1`. Set to `0` to display the shipping address on file. Set to `1` to display the shipping address supplied to this call; the buyer cannot edit this shipping address.
81
- *
82
- * @return int
83
- */
84
- public function getAddressOverride()
85
- {
86
- return $this->address_override;
87
- }
88
-
89
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/InstallmentInfo.php DELETED
@@ -1,144 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class InstallmentInfo
9
- *
10
- * A resource representing installment information available for a transaction
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property string installment_id
15
- * @property string network
16
- * @property string issuer
17
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\InstallmentOption[] installment_options
18
- */
19
- class InstallmentInfo extends PayPalModel
20
- {
21
- /**
22
- * Installment id.
23
- *
24
- * @param string $installment_id
25
- *
26
- * @return $this
27
- */
28
- public function setInstallmentId($installment_id)
29
- {
30
- $this->installment_id = $installment_id;
31
- return $this;
32
- }
33
-
34
- /**
35
- * Installment id.
36
- *
37
- * @return string
38
- */
39
- public function getInstallmentId()
40
- {
41
- return $this->installment_id;
42
- }
43
-
44
- /**
45
- * Credit card network.
46
- * Valid Values: ["VISA", "MASTERCARD"]
47
- *
48
- * @param string $network
49
- *
50
- * @return $this
51
- */
52
- public function setNetwork($network)
53
- {
54
- $this->network = $network;
55
- return $this;
56
- }
57
-
58
- /**
59
- * Credit card network.
60
- *
61
- * @return string
62
- */
63
- public function getNetwork()
64
- {
65
- return $this->network;
66
- }
67
-
68
- /**
69
- * Credit card issuer.
70
- *
71
- * @param string $issuer
72
- *
73
- * @return $this
74
- */
75
- public function setIssuer($issuer)
76
- {
77
- $this->issuer = $issuer;
78
- return $this;
79
- }
80
-
81
- /**
82
- * Credit card issuer.
83
- *
84
- * @return string
85
- */
86
- public function getIssuer()
87
- {
88
- return $this->issuer;
89
- }
90
-
91
- /**
92
- * List of available installment options and the cost associated with each one.
93
- *
94
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\InstallmentOption[] $installment_options
95
- *
96
- * @return $this
97
- */
98
- public function setInstallmentOptions($installment_options)
99
- {
100
- $this->installment_options = $installment_options;
101
- return $this;
102
- }
103
-
104
- /**
105
- * List of available installment options and the cost associated with each one.
106
- *
107
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\InstallmentOption[]
108
- */
109
- public function getInstallmentOptions()
110
- {
111
- return $this->installment_options;
112
- }
113
-
114
- /**
115
- * Append InstallmentOptions to the list.
116
- *
117
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\InstallmentOption $installmentOption
118
- * @return $this
119
- */
120
- public function addInstallmentOption($installmentOption)
121
- {
122
- if (!$this->getInstallmentOptions()) {
123
- return $this->setInstallmentOptions(array($installmentOption));
124
- } else {
125
- return $this->setInstallmentOptions(
126
- array_merge($this->getInstallmentOptions(), array($installmentOption))
127
- );
128
- }
129
- }
130
-
131
- /**
132
- * Remove InstallmentOptions from the list.
133
- *
134
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\InstallmentOption $installmentOption
135
- * @return $this
136
- */
137
- public function removeInstallmentOption($installmentOption)
138
- {
139
- return $this->setInstallmentOptions(
140
- array_diff($this->getInstallmentOptions(), array($installmentOption))
141
- );
142
- }
143
-
144
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/InstallmentOption.php DELETED
@@ -1,113 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class InstallmentOption
9
- *
10
- * A resource describing an installment
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property int term
15
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency monthly_payment
16
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency discount_amount
17
- * @property string discount_percentage
18
- */
19
- class InstallmentOption extends PayPalModel
20
- {
21
- /**
22
- * Number of installments
23
- *
24
- * @param int $term
25
- *
26
- * @return $this
27
- */
28
- public function setTerm($term)
29
- {
30
- $this->term = $term;
31
- return $this;
32
- }
33
-
34
- /**
35
- * Number of installments
36
- *
37
- * @return int
38
- */
39
- public function getTerm()
40
- {
41
- return $this->term;
42
- }
43
-
44
- /**
45
- * Monthly payment
46
- *
47
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency $monthly_payment
48
- *
49
- * @return $this
50
- */
51
- public function setMonthlyPayment($monthly_payment)
52
- {
53
- $this->monthly_payment = $monthly_payment;
54
- return $this;
55
- }
56
-
57
- /**
58
- * Monthly payment
59
- *
60
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency
61
- */
62
- public function getMonthlyPayment()
63
- {
64
- return $this->monthly_payment;
65
- }
66
-
67
- /**
68
- * Discount amount applied to the payment, if any
69
- *
70
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency $discount_amount
71
- *
72
- * @return $this
73
- */
74
- public function setDiscountAmount($discount_amount)
75
- {
76
- $this->discount_amount = $discount_amount;
77
- return $this;
78
- }
79
-
80
- /**
81
- * Discount amount applied to the payment, if any
82
- *
83
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency
84
- */
85
- public function getDiscountAmount()
86
- {
87
- return $this->discount_amount;
88
- }
89
-
90
- /**
91
- * Discount percentage applied to the payment, if any
92
- *
93
- * @param string $discount_percentage
94
- *
95
- * @return $this
96
- */
97
- public function setDiscountPercentage($discount_percentage)
98
- {
99
- $this->discount_percentage = $discount_percentage;
100
- return $this;
101
- }
102
-
103
- /**
104
- * Discount percentage applied to the payment, if any
105
- *
106
- * @return string
107
- */
108
- public function getDiscountPercentage()
109
- {
110
- return $this->discount_percentage;
111
- }
112
-
113
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/Invoice.php DELETED
@@ -1,1340 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalResourceModel;
6
- use Never5\DownloadMonitor\Dependencies\PayPal\Rest\ApiContext;
7
- use Never5\DownloadMonitor\Dependencies\PayPal\Transport\PayPalRestCall;
8
- use Never5\DownloadMonitor\Dependencies\PayPal\Validation\ArgumentValidator;
9
- use Never5\DownloadMonitor\Dependencies\PayPal\Validation\UrlValidator;
10
-
11
- /**
12
- * Class Invoice
13
- *
14
- * Detailed invoice information.
15
- *
16
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
17
- *
18
- * @property string id
19
- * @property string number
20
- * @property string template_id
21
- * @property string uri
22
- * @property string status
23
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\MerchantInfo merchant_info
24
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\BillingInfo[] billing_info
25
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Participant[] cc_info
26
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\ShippingInfo shipping_info
27
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\InvoiceItem[] items
28
- * @property string invoice_date
29
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\PaymentTerm payment_term
30
- * @property string reference
31
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Cost discount
32
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\ShippingCost shipping_cost
33
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\CustomAmount custom
34
- * @property bool allow_partial_payment
35
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency minimum_amount_due
36
- * @property bool tax_calculated_after_discount
37
- * @property bool tax_inclusive
38
- * @property string terms
39
- * @property string note
40
- * @property string merchant_memo
41
- * @property string logo_url
42
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency total_amount
43
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\PaymentDetail[] payments
44
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\RefundDetail[] refunds
45
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Metadata metadata
46
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\PaymentSummary paid_amount
47
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\PaymentSummary refunded_amount
48
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\FileAttachment[] attachments
49
- */
50
- class Invoice extends PayPalResourceModel
51
- {
52
- /**
53
- * The unique invoice resource identifier.
54
- *
55
- * @param string $id
56
- *
57
- * @return $this
58
- */
59
- public function setId($id)
60
- {
61
- $this->id = $id;
62
- return $this;
63
- }
64
-
65
- /**
66
- * The unique invoice resource identifier.
67
- *
68
- * @return string
69
- */
70
- public function getId()
71
- {
72
- return $this->id;
73
- }
74
-
75
- /**
76
- * Unique number that appears on the invoice. If left blank will be auto-incremented from the last number. 25 characters max.
77
- *
78
- * @param string $number
79
- *
80
- * @return $this
81
- */
82
- public function setNumber($number)
83
- {
84
- $this->number = $number;
85
- return $this;
86
- }
87
-
88
- /**
89
- * Unique number that appears on the invoice. If left blank will be auto-incremented from the last number. 25 characters max.
90
- *
91
- * @return string
92
- */
93
- public function getNumber()
94
- {
95
- return $this->number;
96
- }
97
-
98
- /**
99
- * The template ID used for the invoice. Useful for copy functionality.
100
- *
101
- * @param string $template_id
102
- *
103
- * @return $this
104
- */
105
- public function setTemplateId($template_id)
106
- {
107
- $this->template_id = $template_id;
108
- return $this;
109
- }
110
-
111
- /**
112
- * The template ID used for the invoice. Useful for copy functionality.
113
- *
114
- * @return string
115
- */
116
- public function getTemplateId()
117
- {
118
- return $this->template_id;
119
- }
120
-
121
- /**
122
- * URI of the invoice resource.
123
- *
124
- * @param string $uri
125
- *
126
- * @return $this
127
- */
128
- public function setUri($uri)
129
- {
130
- $this->uri = $uri;
131
- return $this;
132
- }
133
-
134
- /**
135
- * URI of the invoice resource.
136
- *
137
- * @return string
138
- */
139
- public function getUri()
140
- {
141
- return $this->uri;
142
- }
143
-
144
- /**
145
- * Status of the invoice.
146
- * Valid Values: ["DRAFT", "SENT", "PAID", "MARKED_AS_PAID", "CANCELLED", "REFUNDED", "PARTIALLY_REFUNDED", "MARKED_AS_REFUNDED", "UNPAID", "PAYMENT_PENDING"]
147
- *
148
- * @param string $status
149
- *
150
- * @return $this
151
- */
152
- public function setStatus($status)
153
- {
154
- $this->status = $status;
155
- return $this;
156
- }
157
-
158
- /**
159
- * Status of the invoice.
160
- *
161
- * @return string
162
- */
163
- public function getStatus()
164
- {
165
- return $this->status;
166
- }
167
-
168
- /**
169
- * Information about the merchant who is sending the invoice.
170
- *
171
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\MerchantInfo $merchant_info
172
- *
173
- * @return $this
174
- */
175
- public function setMerchantInfo($merchant_info)
176
- {
177
- $this->merchant_info = $merchant_info;
178
- return $this;
179
- }
180
-
181
- /**
182
- * Information about the merchant who is sending the invoice.
183
- *
184
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\MerchantInfo
185
- */
186
- public function getMerchantInfo()
187
- {
188
- return $this->merchant_info;
189
- }
190
-
191
- /**
192
- * The required invoice recipient email address and any optional billing information. One recipient is supported.
193
- *
194
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\BillingInfo[] $billing_info
195
- *
196
- * @return $this
197
- */
198
- public function setBillingInfo($billing_info)
199
- {
200
- $this->billing_info = $billing_info;
201
- return $this;
202
- }
203
-
204
- /**
205
- * The required invoice recipient email address and any optional billing information. One recipient is supported.
206
- *
207
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\BillingInfo[]
208
- */
209
- public function getBillingInfo()
210
- {
211
- return $this->billing_info;
212
- }
213
-
214
- /**
215
- * Append BillingInfo to the list.
216
- *
217
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\BillingInfo $billingInfo
218
- * @return $this
219
- */
220
- public function addBillingInfo($billingInfo)
221
- {
222
- if (!$this->getBillingInfo()) {
223
- return $this->setBillingInfo(array($billingInfo));
224
- } else {
225
- return $this->setBillingInfo(
226
- array_merge($this->getBillingInfo(), array($billingInfo))
227
- );
228
- }
229
- }
230
-
231
- /**
232
- * Remove BillingInfo from the list.
233
- *
234
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\BillingInfo $billingInfo
235
- * @return $this
236
- */
237
- public function removeBillingInfo($billingInfo)
238
- {
239
- return $this->setBillingInfo(
240
- array_diff($this->getBillingInfo(), array($billingInfo))
241
- );
242
- }
243
-
244
- /**
245
- * For invoices sent by email, one or more email addresses to which to send a Cc: copy of the notification. Supports only email addresses under participant.
246
- *
247
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Participant[] $cc_info
248
- *
249
- * @return $this
250
- */
251
- public function setCcInfo($cc_info)
252
- {
253
- $this->cc_info = $cc_info;
254
- return $this;
255
- }
256
-
257
- /**
258
- * For invoices sent by email, one or more email addresses to which to send a Cc: copy of the notification. Supports only email addresses under participant.
259
- *
260
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Participant[]
261
- */
262
- public function getCcInfo()
263
- {
264
- return $this->cc_info;
265
- }
266
-
267
- /**
268
- * Append CcInfo to the list.
269
- *
270
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Participant $participant
271
- * @return $this
272
- */
273
- public function addCcInfo($participant)
274
- {
275
- if (!$this->getCcInfo()) {
276
- return $this->setCcInfo(array($participant));
277
- } else {
278
- return $this->setCcInfo(
279
- array_merge($this->getCcInfo(), array($participant))
280
- );
281
- }
282
- }
283
-
284
- /**
285
- * Remove CcInfo from the list.
286
- *
287
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Participant $participant
288
- * @return $this
289
- */
290
- public function removeCcInfo($participant)
291
- {
292
- return $this->setCcInfo(
293
- array_diff($this->getCcInfo(), array($participant))
294
- );
295
- }
296
-
297
- /**
298
- * The shipping information for entities to whom items are being shipped.
299
- *
300
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\ShippingInfo $shipping_info
301
- *
302
- * @return $this
303
- */
304
- public function setShippingInfo($shipping_info)
305
- {
306
- $this->shipping_info = $shipping_info;
307
- return $this;
308
- }
309
-
310
- /**
311
- * The shipping information for entities to whom items are being shipped.
312
- *
313
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\ShippingInfo
314
- */
315
- public function getShippingInfo()
316
- {
317
- return $this->shipping_info;
318
- }
319
-
320
- /**
321
- * The list of items to include in the invoice. Maximum value is 100 items per invoice.
322
- *
323
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\InvoiceItem[] $items
324
- *
325
- * @return $this
326
- */
327
- public function setItems($items)
328
- {
329
- $this->items = $items;
330
- return $this;
331
- }
332
-
333
- /**
334
- * The list of items to include in the invoice. Maximum value is 100 items per invoice.
335
- *
336
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\InvoiceItem[]
337
- */
338
- public function getItems()
339
- {
340
- return $this->items;
341
- }
342
-
343
- /**
344
- * Append Items to the list.
345
- *
346
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\InvoiceItem $invoiceItem
347
- * @return $this
348
- */
349
- public function addItem($invoiceItem)
350
- {
351
- if (!$this->getItems()) {
352
- return $this->setItems(array($invoiceItem));
353
- } else {
354
- return $this->setItems(
355
- array_merge($this->getItems(), array($invoiceItem))
356
- );
357
- }
358
- }
359
-
360
- /**
361
- * Remove Items from the list.
362
- *
363
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\InvoiceItem $invoiceItem
364
- * @return $this
365
- */
366
- public function removeItem($invoiceItem)
367
- {
368
- return $this->setItems(
369
- array_diff($this->getItems(), array($invoiceItem))
370
- );
371
- }
372
-
373
- /**
374
- * The date when the invoice was enabled. The date format is *yyyy*-*MM*-*dd* *z* as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6).
375
- *
376
- * @param string $invoice_date
377
- *
378
- * @return $this
379
- */
380
- public function setInvoiceDate($invoice_date)
381
- {
382
- $this->invoice_date = $invoice_date;
383
- return $this;
384
- }
385
-
386
- /**
387
- * The date when the invoice was enabled. The date format is *yyyy*-*MM*-*dd* *z* as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6).
388
- *
389
- * @return string
390
- */
391
- public function getInvoiceDate()
392
- {
393
- return $this->invoice_date;
394
- }
395
-
396
- /**
397
- * Optional. The payment deadline for the invoice. Value is either `term_type` or `due_date` but not both.
398
- *
399
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\PaymentTerm $payment_term
400
- *
401
- * @return $this
402
- */
403
- public function setPaymentTerm($payment_term)
404
- {
405
- $this->payment_term = $payment_term;
406
- return $this;
407
- }
408
-
409
- /**
410
- * Optional. The payment deadline for the invoice. Value is either `term_type` or `due_date` but not both.
411
- *
412
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\PaymentTerm
413
- */
414
- public function getPaymentTerm()
415
- {
416
- return $this->payment_term;
417
- }
418
-
419
- /**
420
- * Reference data, such as PO number, to add to the invoice. Maximum length is 60 characters.
421
- *
422
- * @param string $reference
423
- *
424
- * @return $this
425
- */
426
- public function setReference($reference)
427
- {
428
- $this->reference = $reference;
429
- return $this;
430
- }
431
-
432
- /**
433
- * Reference data, such as PO number, to add to the invoice. Maximum length is 60 characters.
434
- *
435
- * @return string
436
- */
437
- public function getReference()
438
- {
439
- return $this->reference;
440
- }
441
-
442
- /**
443
- * The invoice level discount, as a percent or an amount value.
444
- *
445
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Cost $discount
446
- *
447
- * @return $this
448
- */
449
- public function setDiscount($discount)
450
- {
451
- $this->discount = $discount;
452
- return $this;
453
- }
454
-
455
- /**
456
- * The invoice level discount, as a percent or an amount value.
457
- *
458
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Cost
459
- */
460
- public function getDiscount()
461
- {
462
- return $this->discount;
463
- }
464
-
465
- /**
466
- * The shipping cost, as a percent or an amount value.
467
- *
468
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\ShippingCost $shipping_cost
469
- *
470
- * @return $this
471
- */
472
- public function setShippingCost($shipping_cost)
473
- {
474
- $this->shipping_cost = $shipping_cost;
475
- return $this;
476
- }
477
-
478
- /**
479
- * The shipping cost, as a percent or an amount value.
480
- *
481
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\ShippingCost
482
- */
483
- public function getShippingCost()
484
- {
485
- return $this->shipping_cost;
486
- }
487
-
488
- /**
489
- * The custom amount to apply on an invoice. If you include a label, the amount cannot be empty.
490
- *
491
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\CustomAmount $custom
492
- *
493
- * @return $this
494
- */
495
- public function setCustom($custom)
496
- {
497
- $this->custom = $custom;
498
- return $this;
499
- }
500
-
501
- /**
502
- * The custom amount to apply on an invoice. If you include a label, the amount cannot be empty.
503
- *
504
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\CustomAmount
505
- */
506
- public function getCustom()
507
- {
508
- return $this->custom;
509
- }
510
-
511
- /**
512
- * Indicates whether the invoice allows a partial payment. If set to `false`, invoice must be paid in full. If set to `true`, the invoice allows partial payments. Default is `false`.
513
- *
514
- * @param bool $allow_partial_payment
515
- *
516
- * @return $this
517
- */
518
- public function setAllowPartialPayment($allow_partial_payment)
519
- {
520
- $this->allow_partial_payment = $allow_partial_payment;
521
- return $this;
522
- }
523
-
524
- /**
525
- * Indicates whether the invoice allows a partial payment. If set to `false`, invoice must be paid in full. If set to `true`, the invoice allows partial payments. Default is `false`.
526
- *
527
- * @return bool
528
- */
529
- public function getAllowPartialPayment()
530
- {
531
- return $this->allow_partial_payment;
532
- }
533
-
534
- /**
535
- * If `allow_partial_payment` is set to `true`, the minimum amount allowed for a partial payment.
536
- *
537
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency $minimum_amount_due
538
- *
539
- * @return $this
540
- */
541
- public function setMinimumAmountDue($minimum_amount_due)
542
- {
543
- $this->minimum_amount_due = $minimum_amount_due;
544
- return $this;
545
- }
546
-
547
- /**
548
- * If `allow_partial_payment` is set to `true`, the minimum amount allowed for a partial payment.
549
- *
550
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency
551
- */
552
- public function getMinimumAmountDue()
553
- {
554
- return $this->minimum_amount_due;
555
- }
556
-
557
- /**
558
- * Indicates whether tax is calculated before or after a discount. If set to `false`, the tax is calculated before a discount. If set to `true`, the tax is calculated after a discount. Default is `false`.
559
- *
560
- * @param bool $tax_calculated_after_discount
561
- *
562
- * @return $this
563
- */
564
- public function setTaxCalculatedAfterDiscount($tax_calculated_after_discount)
565
- {
566
- $this->tax_calculated_after_discount = $tax_calculated_after_discount;
567
- return $this;
568
- }
569
-
570
- /**
571
- * Indicates whether tax is calculated before or after a discount. If set to `false`, the tax is calculated before a discount. If set to `true`, the tax is calculated after a discount. Default is `false`.
572
- *
573
- * @return bool
574
- */
575
- public function getTaxCalculatedAfterDiscount()
576
- {
577
- return $this->tax_calculated_after_discount;
578
- }
579
-
580
- /**
581
- * Indicates whether the unit price includes tax. Default is `false`.
582
- *
583
- * @param bool $tax_inclusive
584
- *
585
- * @return $this
586
- */
587
- public function setTaxInclusive($tax_inclusive)
588
- {
589
- $this->tax_inclusive = $tax_inclusive;
590
- return $this;
591
- }
592
-
593
- /**
594
- * Indicates whether the unit price includes tax. Default is `false`.
595
- *
596
- * @return bool
597
- */
598
- public function getTaxInclusive()
599
- {
600
- return $this->tax_inclusive;
601
- }
602
-
603
- /**
604
- * General terms of the invoice. 4000 characters max.
605
- *
606
- * @param string $terms
607
- *
608
- * @return $this
609
- */
610
- public function setTerms($terms)
611
- {
612
- $this->terms = $terms;
613
- return $this;
614
- }
615
-
616
- /**
617
- * General terms of the invoice. 4000 characters max.
618
- *
619
- * @return string
620
- */
621
- public function getTerms()
622
- {
623
- return $this->terms;
624
- }
625
-
626
- /**
627
- * Note to the payer. 4000 characters max.
628
- *
629
- * @param string $note
630
- *
631
- * @return $this
632
- */
633
- public function setNote($note)
634
- {
635
- $this->note = $note;
636
- return $this;
637
- }
638
-
639
- /**
640
- * Note to the payer. 4000 characters max.
641
- *
642
- * @return string
643
- */
644
- public function getNote()
645
- {
646
- return $this->note;
647
- }
648
-
649
- /**
650
- * A private bookkeeping memo for the merchant. Maximum length is 150 characters.
651
- *
652
- * @param string $merchant_memo
653
- *
654
- * @return $this
655
- */
656
- public function setMerchantMemo($merchant_memo)
657
- {
658
- $this->merchant_memo = $merchant_memo;
659
- return $this;
660
- }
661
-
662
- /**
663
- * A private bookkeeping memo for the merchant. Maximum length is 150 characters.
664
- *
665
- * @return string
666
- */
667
- public function getMerchantMemo()
668
- {
669
- return $this->merchant_memo;
670
- }
671
-
672
- /**
673
- * Full URL of an external image to use as the logo. Maximum length is 4000 characters.
674
- *
675
- * @param string $logo_url
676
- * @throws \InvalidArgumentException
677
- * @return $this
678
- */
679
- public function setLogoUrl($logo_url)
680
- {
681
- UrlValidator::validate($logo_url, "LogoUrl");
682
- $this->logo_url = $logo_url;
683
- return $this;
684
- }
685
-
686
- /**
687
- * Full URL of an external image to use as the logo. Maximum length is 4000 characters.
688
- *
689
- * @return string
690
- */
691
- public function getLogoUrl()
692
- {
693
- return $this->logo_url;
694
- }
695
-
696
- /**
697
- * The total amount of the invoice.
698
- *
699
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency $total_amount
700
- *
701
- * @return $this
702
- */
703
- public function setTotalAmount($total_amount)
704
- {
705
- $this->total_amount = $total_amount;
706
- return $this;
707
- }
708
-
709
- /**
710
- * The total amount of the invoice.
711
- *
712
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency
713
- */
714
- public function getTotalAmount()
715
- {
716
- return $this->total_amount;
717
- }
718
-
719
- /**
720
- * List of payment details for the invoice.
721
- *
722
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\PaymentDetail[] $payments
723
- *
724
- * @return $this
725
- */
726
- public function setPayments($payments)
727
- {
728
- $this->payments = $payments;
729
- return $this;
730
- }
731
-
732
- /**
733
- * List of payment details for the invoice.
734
- *
735
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\PaymentDetail[]
736
- */
737
- public function getPayments()
738
- {
739
- return $this->payments;
740
- }
741
-
742
- /**
743
- * Append Payments to the list.
744
- *
745
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\PaymentDetail $paymentDetail
746
- * @return $this
747
- */
748
- public function addPayment($paymentDetail)
749
- {
750
- if (!$this->getPayments()) {
751
- return $this->setPayments(array($paymentDetail));
752
- } else {
753
- return $this->setPayments(
754
- array_merge($this->getPayments(), array($paymentDetail))
755
- );
756
- }
757
- }
758
-
759
- /**
760
- * Remove Payments from the list.
761
- *
762
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\PaymentDetail $paymentDetail
763
- * @return $this
764
- */
765
- public function removePayment($paymentDetail)
766
- {
767
- return $this->setPayments(
768
- array_diff($this->getPayments(), array($paymentDetail))
769
- );
770
- }
771
-
772
- /**
773
- * List of refund details for the invoice.
774
- *
775
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\RefundDetail[] $refunds
776
- *
777
- * @return $this
778
- */
779
- public function setRefunds($refunds)
780
- {
781
- $this->refunds = $refunds;
782
- return $this;
783
- }
784
-
785
- /**
786
- * List of refund details for the invoice.
787
- *
788
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\RefundDetail[]
789
- */
790
- public function getRefunds()
791
- {
792
- return $this->refunds;
793
- }
794
-
795
- /**
796
- * Append Refunds to the list.
797
- *
798
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\RefundDetail $refundDetail
799
- * @return $this
800
- */
801
- public function addRefund($refundDetail)
802
- {
803
- if (!$this->getRefunds()) {
804
- return $this->setRefunds(array($refundDetail));
805
- } else {
806
- return $this->setRefunds(
807
- array_merge($this->getRefunds(), array($refundDetail))
808
- );
809
- }
810
- }
811
-
812
- /**
813
- * Remove Refunds from the list.
814
- *
815
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\RefundDetail $refundDetail
816
- * @return $this
817
- */
818
- public function removeRefund($refundDetail)
819
- {
820
- return $this->setRefunds(
821
- array_diff($this->getRefunds(), array($refundDetail))
822
- );
823
- }
824
-
825
- /**
826
- * Audit information for the invoice.
827
- *
828
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Metadata $metadata
829
- *
830
- * @return $this
831
- */
832
- public function setMetadata($metadata)
833
- {
834
- $this->metadata = $metadata;
835
- return $this;
836
- }
837
-
838
- /**
839
- * Audit information for the invoice.
840
- *
841
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Metadata
842
- */
843
- public function getMetadata()
844
- {
845
- return $this->metadata;
846
- }
847
-
848
- /**
849
- * Any miscellaneous invoice data. Maximum length is 4000 characters.
850
- * @deprecated Not publicly available
851
- * @param string $additional_data
852
- *
853
- * @return $this
854
- */
855
- public function setAdditionalData($additional_data)
856
- {
857
- $this->additional_data = $additional_data;
858
- return $this;
859
- }
860
-
861
- /**
862
- * Any miscellaneous invoice data. Maximum length is 4000 characters.
863
- * @deprecated Not publicly available
864
- * @return string
865
- */
866
- public function getAdditionalData()
867
- {
868
- return $this->additional_data;
869
- }
870
-
871
- /**
872
- * Payment summary of the invoice including amount paid through PayPal and other sources.
873
- *
874
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\PaymentSummary $paid_amount
875
- *
876
- * @return $this
877
- */
878
- public function setPaidAmount($paid_amount)
879
- {
880
- $this->paid_amount = $paid_amount;
881
- return $this;
882
- }
883
-
884
- /**
885
- * Payment summary of the invoice including amount paid through PayPal and other sources.
886
- *
887
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\PaymentSummary
888
- */
889
- public function getPaidAmount()
890
- {
891
- return $this->paid_amount;
892
- }
893
-
894
- /**
895
- * Payment summary of the invoice including amount refunded through PayPal and other sources.
896
- *
897
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\PaymentSummary $refunded_amount
898
- *
899
- * @return $this
900
- */
901
- public function setRefundedAmount($refunded_amount)
902
- {
903
- $this->refunded_amount = $refunded_amount;
904
- return $this;
905
- }
906
-
907
- /**
908
- * Payment summary of the invoice including amount refunded through PayPal and other sources.
909
- *
910
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\PaymentSummary
911
- */
912
- public function getRefundedAmount()
913
- {
914
- return $this->refunded_amount;
915
- }
916
-
917
- /**
918
- * List of files attached to the invoice.
919
- *
920
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\FileAttachment[] $attachments
921
- *
922
- * @return $this
923
- */
924
- public function setAttachments($attachments)
925
- {
926
- $this->attachments = $attachments;
927
- return $this;
928
- }
929
-
930
- /**
931
- * List of files attached to the invoice.
932
- *
933
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\FileAttachment[]
934
- */
935
- public function getAttachments()
936
- {
937
- return $this->attachments;
938
- }
939
-
940
- /**
941
- * Append Attachments to the list.
942
- *
943
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\FileAttachment $fileAttachment
944
- * @return $this
945
- */
946
- public function addAttachment($fileAttachment)
947
- {
948
- if (!$this->getAttachments()) {
949
- return $this->setAttachments(array($fileAttachment));
950
- } else {
951
- return $this->setAttachments(
952
- array_merge($this->getAttachments(), array($fileAttachment))
953
- );
954
- }
955
- }
956
-
957
- /**
958
- * Remove Attachments from the list.
959
- *
960
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\FileAttachment $fileAttachment
961
- * @return $this
962
- */
963
- public function removeAttachment($fileAttachment)
964
- {
965
- return $this->setAttachments(
966
- array_diff($this->getAttachments(), array($fileAttachment))
967
- );
968
- }
969
-
970
- /**
971
- * Creates an invoice. Include invoice details including merchant information in the request.
972
- *
973
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
974
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
975
- * @return Invoice
976
- */
977
- public function create($apiContext = null, $restCall = null)
978
- {
979
- $payLoad = $this->toJSON();
980
- $json = self::executeCall(
981
- "/v1/invoicing/invoices",
982
- "POST",
983
- $payLoad,
984
- null,
985
- $apiContext,
986
- $restCall
987
- );
988
- $this->fromJson($json);
989
- return $this;
990
- }
991
-
992
- /**
993
- * Searches for an invoice or invoices. Include a search object that specifies your search criteria in the request.
994
- *
995
- * @param Search $search
996
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
997
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
998
- * @return InvoiceSearchResponse
999
- */
1000
- public static function search($search, $apiContext = null, $restCall = null)
1001
- {
1002
- ArgumentValidator::validate($search, 'search');
1003
- $payLoad = $search->toJSON();
1004
- $json = self::executeCall(
1005
- "/v1/invoicing/search",
1006
- "POST",
1007
- $payLoad,
1008
- null,
1009
- $apiContext,
1010
- $restCall
1011
- );
1012
- $ret = new InvoiceSearchResponse();
1013
- $ret->fromJson($json);
1014
- return $ret;
1015
- }
1016
-
1017
- /**
1018
- * Sends an invoice, by ID, to a recipient. Optionally, set the `notify_merchant` query parameter to send the merchant an invoice update notification. By default, `notify_merchant` is `true`.
1019
- *
1020
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
1021
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
1022
- * @return bool
1023
- */
1024
- public function send($apiContext = null, $restCall = null)
1025
- {
1026
- ArgumentValidator::validate($this->getId(), "Id");
1027
- $payLoad = "";
1028
- self::executeCall(
1029
- "/v1/invoicing/invoices/{$this->getId()}/send",
1030
- "POST",
1031
- $payLoad,
1032
- null,
1033
- $apiContext,
1034
- $restCall
1035
- );
1036
- return true;
1037
- }
1038
-
1039
- /**
1040
- * Sends a reminder about a specific invoice, by ID, to a recipient. Include a notification object that defines the reminder subject and other details in the JSON request body.
1041
- *
1042
- * @param Notification $notification
1043
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
1044
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
1045
- * @return bool
1046
- */
1047
- public function remind($notification, $apiContext = null, $restCall = null)
1048
- {
1049
- ArgumentValidator::validate($this->getId(), "Id");
1050
- ArgumentValidator::validate($notification, 'notification');
1051
- $payLoad = $notification->toJSON();
1052
- self::executeCall(
1053
- "/v1/invoicing/invoices/{$this->getId()}/remind",
1054
- "POST",
1055
- $payLoad,
1056
- null,
1057
- $apiContext,
1058
- $restCall
1059
- );
1060
- return true;
1061
- }
1062
-
1063
- /**
1064
- * Cancels an invoice, by ID.
1065
- *
1066
- * @param CancelNotification $cancelNotification
1067
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
1068
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
1069
- * @return bool
1070
- */
1071
- public function cancel($cancelNotification, $apiContext = null, $restCall = null)
1072
- {
1073
- ArgumentValidator::validate($this->getId(), "Id");
1074
- ArgumentValidator::validate($cancelNotification, 'cancelNotification');
1075
- $payLoad = $cancelNotification->toJSON();
1076
- self::executeCall(
1077
- "/v1/invoicing/invoices/{$this->getId()}/cancel",
1078
- "POST",
1079
- $payLoad,
1080
- null,
1081
- $apiContext,
1082
- $restCall
1083
- );
1084
- return true;
1085
- }
1086
-
1087
- /**
1088
- * Marks the status of a specified invoice, by ID, as paid. Include a payment detail object that defines the payment method and other details in the JSON request body.
1089
- *
1090
- * @param PaymentDetail $paymentDetail
1091
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
1092
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
1093
- * @return bool
1094
- */
1095
- public function recordPayment($paymentDetail, $apiContext = null, $restCall = null)
1096
- {
1097
- ArgumentValidator::validate($this->getId(), "Id");
1098
- ArgumentValidator::validate($paymentDetail, 'paymentDetail');
1099
- $payLoad = $paymentDetail->toJSON();
1100
- self::executeCall(
1101
- "/v1/invoicing/invoices/{$this->getId()}/record-payment",
1102
- "POST",
1103
- $payLoad,
1104
- null,
1105
- $apiContext,
1106
- $restCall
1107
- );
1108
- return true;
1109
- }
1110
-
1111
- /**
1112
- * Marks the status of a specified invoice, by ID, as refunded. Include a refund detail object that defines the refund type and other details in the JSON request body.
1113
- *
1114
- * @param RefundDetail $refundDetail
1115
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
1116
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
1117
- * @return bool
1118
- */
1119
- public function recordRefund($refundDetail, $apiContext = null, $restCall = null)
1120
- {
1121
- ArgumentValidator::validate($this->getId(), "Id");
1122
- ArgumentValidator::validate($refundDetail, 'refundDetail');
1123
- $payLoad = $refundDetail->toJSON();
1124
- self::executeCall(
1125
- "/v1/invoicing/invoices/{$this->getId()}/record-refund",
1126
- "POST",
1127
- $payLoad,
1128
- null,
1129
- $apiContext,
1130
- $restCall
1131
- );
1132
- return true;
1133
- }
1134
-
1135
- /**
1136
- * Gets the details for a specified invoice, by ID.
1137
- *
1138
- * @param string $invoiceId
1139
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
1140
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
1141
- * @return Invoice
1142
- */
1143
- public static function get($invoiceId, $apiContext = null, $restCall = null)
1144
- {
1145
- ArgumentValidator::validate($invoiceId, 'invoiceId');
1146
- $payLoad = "";
1147
- $json = self::executeCall(
1148
- "/v1/invoicing/invoices/$invoiceId",
1149
- "GET",
1150
- $payLoad,
1151
- null,
1152
- $apiContext,
1153
- $restCall
1154
- );
1155
- $ret = new Invoice();
1156
- $ret->fromJson($json);
1157
- return $ret;
1158
- }
1159
-
1160
- /**
1161
- * Lists some or all merchant invoices. Filters the response by any specified optional query string parameters.
1162
- *
1163
- * @param array $params
1164
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
1165
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
1166
- * @return InvoiceSearchResponse
1167
- */
1168
- public static function getAll($params = array(), $apiContext = null, $restCall = null)
1169
- {
1170
- ArgumentValidator::validate($params, 'params');
1171
-
1172
- $allowedParams = array(
1173
- 'page' => 1,
1174
- 'page_size' => 1,
1175
- 'total_count_required' => 1
1176
- );
1177
-
1178
- $payLoad = "";
1179
- $json = self::executeCall(
1180
- "/v1/invoicing/invoices/?" . http_build_query(array_intersect_key($params, $allowedParams)),
1181
- "GET",
1182
- $payLoad,
1183
- null,
1184
- $apiContext,
1185
- $restCall
1186
- );
1187
- $ret = new InvoiceSearchResponse();
1188
- $ret->fromJson($json);
1189
- return $ret;
1190
- }
1191
-
1192
- /**
1193
- * Fully updates an invoice by passing the invoice ID to the request URI. In addition, pass a complete invoice object in the request JSON. Partial updates are not supported.
1194
- *
1195
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
1196
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
1197
- * @return Invoice
1198
- */
1199
- public function update($apiContext = null, $restCall = null)
1200
- {
1201
- ArgumentValidator::validate($this->getId(), "Id");
1202
- $payLoad = $this->toJSON();
1203
- $json = self::executeCall(
1204
- "/v1/invoicing/invoices/{$this->getId()}",
1205
- "PUT",
1206
- $payLoad,
1207
- null,
1208
- $apiContext,
1209
- $restCall
1210
- );
1211
- $this->fromJson($json);
1212
- return $this;
1213
- }
1214
-
1215
- /**
1216
- * Delete a particular invoice by passing the invoice ID to the request URI.
1217
- *
1218
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
1219
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
1220
- * @return bool
1221
- */
1222
- public function delete($apiContext = null, $restCall = null)
1223
- {
1224
- ArgumentValidator::validate($this->getId(), "Id");
1225
- $payLoad = "";
1226
- self::executeCall(
1227
- "/v1/invoicing/invoices/{$this->getId()}",
1228
- "DELETE",
1229
- $payLoad,
1230
- null,
1231
- $apiContext,
1232
- $restCall
1233
- );
1234
- return true;
1235
- }
1236
-
1237
- /**
1238
- * Delete external payment.
1239
- *
1240
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
1241
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
1242
- * @return bool
1243
- */
1244
- public function deleteExternalPayment($transactionId, $apiContext = null, $restCall = null)
1245
- {
1246
- ArgumentValidator::validate($this->getId(), "Id");
1247
- ArgumentValidator::validate($transactionId, "TransactionId");
1248
- $payLoad = "";
1249
- self::executeCall(
1250
- "/v1/invoicing/invoices/{$this->getId()}/payment-records/{$transactionId}",
1251
- "DELETE",
1252
- $payLoad,
1253
- null,
1254
- $apiContext,
1255
- $restCall
1256
- );
1257
- return true;
1258
- }
1259
-
1260
- /**
1261
- * Delete external refund.
1262
- *
1263
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
1264
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
1265
- * @return bool
1266
- */
1267
- public function deleteExternalRefund($transactionId, $apiContext = null, $restCall = null)
1268
- {
1269
- ArgumentValidator::validate($this->getId(), "Id");
1270
- ArgumentValidator::validate($transactionId, "TransactionId");
1271
- $payLoad = "";
1272
- self::executeCall(
1273
- "/v1/invoicing/invoices/{$this->getId()}/refund-records/{$transactionId}",
1274
- "DELETE",
1275
- $payLoad,
1276
- null,
1277
- $apiContext,
1278
- $restCall
1279
- );
1280
- return true;
1281
- }
1282
-
1283
- /**
1284
- * Generate a QR code for an invoice by passing the invoice ID to the request URI. The request generates a QR code that is 500 pixels in width and height. You can change the dimensions of the returned code by specifying optional query parameters.
1285
- *
1286
- * @param array $params
1287
- * @param string $invoiceId
1288
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
1289
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
1290
- * @return Image
1291
- */
1292
- public static function qrCode($invoiceId, $params = array(), $apiContext = null, $restCall = null)
1293
- {
1294
- ArgumentValidator::validate($invoiceId, 'invoiceId');
1295
- ArgumentValidator::validate($params, 'params');
1296
-
1297
- $allowedParams = array(
1298
- 'width' => 1,
1299
- 'height' => 1,
1300
- 'action' => 1
1301
- );
1302
-
1303
- $payLoad = "";
1304
- $json = self::executeCall(
1305
- "/v1/invoicing/invoices/$invoiceId/qr-code?" . http_build_query(array_intersect_key($params, $allowedParams)),
1306
- "GET",
1307
- $payLoad,
1308
- null,
1309
- $apiContext,
1310
- $restCall
1311
- );
1312
- $ret = new Image();
1313
- $ret->fromJson($json);
1314
- return $ret;
1315
- }
1316
-
1317
- /**
1318
- * Generates the successive invoice number.
1319
- *
1320
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
1321
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
1322
- * @return InvoiceNumber
1323
- */
1324
- public static function generateNumber($apiContext = null, $restCall = null)
1325
- {
1326
- $payLoad = "";
1327
- $json = self::executeCall(
1328
- "/v1/invoicing/invoices/next-invoice-number",
1329
- "POST",
1330
- $payLoad,
1331
- null,
1332
- $apiContext,
1333
- $restCall
1334
- );
1335
- $ret = new InvoiceNumber();
1336
- $ret->fromJson($json);
1337
- return $ret;
1338
- }
1339
-
1340
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/InvoiceAddress.php DELETED
@@ -1,39 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- /**
6
- * Class InvoiceAddress
7
- *
8
- * Base Address object used as billing address in a payment or extended for Shipping Address.
9
- *
10
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
11
- *
12
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Phone phone
13
- */
14
- class InvoiceAddress extends BaseAddress
15
- {
16
- /**
17
- * Phone number in E.123 format.
18
- *
19
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Phone $phone
20
- *
21
- * @return $this
22
- */
23
- public function setPhone($phone)
24
- {
25
- $this->phone = $phone;
26
- return $this;
27
- }
28
-
29
- /**
30
- * Phone number in E.123 format.
31
- *
32
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Phone
33
- */
34
- public function getPhone()
35
- {
36
- return $this->phone;
37
- }
38
-
39
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/InvoiceItem.php DELETED
@@ -1,239 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
- use Never5\DownloadMonitor\Dependencies\PayPal\Converter\FormatConverter;
7
- use Never5\DownloadMonitor\Dependencies\PayPal\Validation\NumericValidator;
8
- use Never5\DownloadMonitor\Dependencies\PayPal\Validation\UrlValidator;
9
-
10
- /**
11
- * Class InvoiceItem
12
- *
13
- * Information about a single line item.
14
- *
15
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
16
- *
17
- * @property string name
18
- * @property string description
19
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\number quantity
20
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency unit_price
21
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Tax tax
22
- * @property string date
23
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Cost discount
24
- * @property string unit_of_measure
25
- */
26
- class InvoiceItem extends PayPalModel
27
- {
28
- /**
29
- * Name of the item. 200 characters max.
30
- *
31
- * @param string $name
32
- *
33
- * @return $this
34
- */
35
- public function setName($name)
36
- {
37
- $this->name = $name;
38
- return $this;
39
- }
40
-
41
- /**
42
- * Name of the item. 200 characters max.
43
- *
44
- * @return string
45
- */
46
- public function getName()
47
- {
48
- return $this->name;
49
- }
50
-
51
- /**
52
- * Description of the item. 1000 characters max.
53
- *
54
- * @param string $description
55
- *
56
- * @return $this
57
- */
58
- public function setDescription($description)
59
- {
60
- $this->description = $description;
61
- return $this;
62
- }
63
-
64
- /**
65
- * Description of the item. 1000 characters max.
66
- *
67
- * @return string
68
- */
69
- public function getDescription()
70
- {
71
- return $this->description;
72
- }
73
-
74
- /**
75
- * Quantity of the item. Range of -10000 to 10000.
76
- *
77
- * @param string|double $quantity
78
- *
79
- * @return $this
80
- */
81
- public function setQuantity($quantity)
82
- {
83
- NumericValidator::validate($quantity, "Quantity");
84
- $quantity = FormatConverter::formatToPrice($quantity);
85
- $this->quantity = $quantity;
86
- return $this;
87
- }
88
-
89
- /**
90
- * Quantity of the item. Range of -10000 to 10000.
91
- *
92
- * @return string
93
- */
94
- public function getQuantity()
95
- {
96
- return $this->quantity;
97
- }
98
-
99
- /**
100
- * Unit price of the item. Range of -1,000,000 to 1,000,000.
101
- *
102
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency $unit_price
103
- *
104
- * @return $this
105
- */
106
- public function setUnitPrice($unit_price)
107
- {
108
- $this->unit_price = $unit_price;
109
- return $this;
110
- }
111
-
112
- /**
113
- * Unit price of the item. Range of -1,000,000 to 1,000,000.
114
- *
115
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency
116
- */
117
- public function getUnitPrice()
118
- {
119
- return $this->unit_price;
120
- }
121
-
122
- /**
123
- * Tax associated with the item.
124
- *
125
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Tax $tax
126
- *
127
- * @return $this
128
- */
129
- public function setTax($tax)
130
- {
131
- $this->tax = $tax;
132
- return $this;
133
- }
134
-
135
- /**
136
- * Tax associated with the item.
137
- *
138
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Tax
139
- */
140
- public function getTax()
141
- {
142
- return $this->tax;
143
- }
144
-
145
- /**
146
- * The date when the item or service was provided. The date format is *yyyy*-*MM*-*dd* *z* as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6).
147
- *
148
- * @param string $date
149
- *
150
- * @return $this
151
- */
152
- public function setDate($date)
153
- {
154
- $this->date = $date;
155
- return $this;
156
- }
157
-
158
- /**
159
- * The date when the item or service was provided. The date format is *yyyy*-*MM*-*dd* *z* as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6).
160
- *
161
- * @return string
162
- */
163
- public function getDate()
164
- {
165
- return $this->date;
166
- }
167
-
168
- /**
169
- * The item discount, as a percent or an amount value.
170
- *
171
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Cost $discount
172
- *
173
- * @return $this
174
- */
175
- public function setDiscount($discount)
176
- {
177
- $this->discount = $discount;
178
- return $this;
179
- }
180
-
181
- /**
182
- * The item discount, as a percent or an amount value.
183
- *
184
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Cost
185
- */
186
- public function getDiscount()
187
- {
188
- return $this->discount;
189
- }
190
-
191
- /**
192
- * The image URL. Maximum length is 4000 characters.
193
- * @deprecated Not publicly available
194
- * @param string $image_url
195
- * @throws \InvalidArgumentException
196
- * @return $this
197
- */
198
- public function setImageUrl($image_url)
199
- {
200
- UrlValidator::validate($image_url, "ImageUrl");
201
- $this->image_url = $image_url;
202
- return $this;
203
- }
204
-
205
- /**
206
- * The image URL. Maximum length is 4000 characters.
207
- * @deprecated Not publicly available
208
- * @return string
209
- */
210
- public function getImageUrl()
211
- {
212
- return $this->image_url;
213
- }
214
-
215
- /**
216
- * The unit of measure of the item being invoiced.
217
- * Valid Values: ["QUANTITY", "HOURS", "AMOUNT"]
218
- *
219
- * @param string $unit_of_measure
220
- *
221
- * @return $this
222
- */
223
- public function setUnitOfMeasure($unit_of_measure)
224
- {
225
- $this->unit_of_measure = $unit_of_measure;
226
- return $this;
227
- }
228
-
229
- /**
230
- * The unit of measure of the item being invoiced.
231
- *
232
- * @return string
233
- */
234
- public function getUnitOfMeasure()
235
- {
236
- return $this->unit_of_measure;
237
- }
238
-
239
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/InvoiceNumber.php DELETED
@@ -1,38 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class InvoiceNumber
9
- *
10
- * The next invoice number
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property string number
15
- */
16
- class InvoiceNumber extends PayPalModel
17
- {
18
- /**
19
- * The next invoice number.
20
- *
21
- * @param string $number
22
- *
23
- * @return $this
24
- */
25
- public function setNumber($number) {
26
- $this->number = $number;
27
- return $this;
28
- }
29
-
30
- /**
31
- * The next invoice number.
32
- *
33
- * @return string
34
- */
35
- public function getNumber() {
36
- return $this->number;
37
- }
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/InvoiceSearchResponse.php DELETED
@@ -1,95 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class InvoiceSearchResponse
9
- *
10
- *
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property int total_count
15
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Invoice[] invoices
16
- */
17
- class InvoiceSearchResponse extends PayPalModel
18
- {
19
- /**
20
- * Total number of invoices.
21
- *
22
- * @param int $total_count
23
- *
24
- * @return $this
25
- */
26
- public function setTotalCount($total_count)
27
- {
28
- $this->total_count = $total_count;
29
- return $this;
30
- }
31
-
32
- /**
33
- * Total number of invoices.
34
- *
35
- * @return int
36
- */
37
- public function getTotalCount()
38
- {
39
- return $this->total_count;
40
- }
41
-
42
- /**
43
- * List of invoices belonging to a merchant.
44
- *
45
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Invoice[] $invoices
46
- *
47
- * @return $this
48
- */
49
- public function setInvoices($invoices)
50
- {
51
- $this->invoices = $invoices;
52
- return $this;
53
- }
54
-
55
- /**
56
- * List of invoices belonging to a merchant.
57
- *
58
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Invoice[]
59
- */
60
- public function getInvoices()
61
- {
62
- return $this->invoices;
63
- }
64
-
65
- /**
66
- * Append Invoices to the list.
67
- *
68
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Invoice $invoice
69
- * @return $this
70
- */
71
- public function addInvoice($invoice)
72
- {
73
- if (!$this->getInvoices()) {
74
- return $this->setInvoices(array($invoice));
75
- } else {
76
- return $this->setInvoices(
77
- array_merge($this->getInvoices(), array($invoice))
78
- );
79
- }
80
- }
81
-
82
- /**
83
- * Remove Invoices from the list.
84
- *
85
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Invoice $invoice
86
- * @return $this
87
- */
88
- public function removeInvoice($invoice)
89
- {
90
- return $this->setInvoices(
91
- array_diff($this->getInvoices(), array($invoice))
92
- );
93
- }
94
-
95
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/Links.php DELETED
@@ -1,161 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class Links
9
- *
10
- *
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property string href
15
- * @property string rel
16
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\HyperSchema targetSchema
17
- * @property string method
18
- * @property string enctype
19
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\HyperSchema schema
20
- */
21
- class Links extends PayPalModel
22
- {
23
- /**
24
- * Sets Href
25
- *
26
- * @param string $href
27
- *
28
- * @return $this
29
- */
30
- public function setHref($href)
31
- {
32
- $this->href = $href;
33
- return $this;
34
- }
35
-
36
- /**
37
- * Gets Href
38
- *
39
- * @return string
40
- */
41
- public function getHref()
42
- {
43
- return $this->href;
44
- }
45
-
46
- /**
47
- * Sets Rel
48
- *
49
- * @param string $rel
50
- *
51
- * @return $this
52
- */
53
- public function setRel($rel)
54
- {
55
- $this->rel = $rel;
56
- return $this;
57
- }
58
-
59
- /**
60
- * Gets Rel
61
- *
62
- * @return string
63
- */
64
- public function getRel()
65
- {
66
- return $this->rel;
67
- }
68
-
69
- /**
70
- * Sets TargetSchema
71
- *
72
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\HyperSchema $targetSchema
73
- *
74
- * @return $this
75
- */
76
- public function setTargetSchema($targetSchema)
77
- {
78
- $this->targetSchema = $targetSchema;
79
- return $this;
80
- }
81
-
82
- /**
83
- * Gets TargetSchema
84
- *
85
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\HyperSchema
86
- */
87
- public function getTargetSchema()
88
- {
89
- return $this->targetSchema;
90
- }
91
-
92
- /**
93
- * Sets Method
94
- *
95
- * @param string $method
96
- *
97
- * @return $this
98
- */
99
- public function setMethod($method)
100
- {
101
- $this->method = $method;
102
- return $this;
103
- }
104
-
105
- /**
106
- * Gets Method
107
- *
108
- * @return string
109
- */
110
- public function getMethod()
111
- {
112
- return $this->method;
113
- }
114
-
115
- /**
116
- * Sets Enctype
117
- *
118
- * @param string $enctype
119
- *
120
- * @return $this
121
- */
122
- public function setEnctype($enctype)
123
- {
124
- $this->enctype = $enctype;
125
- return $this;
126
- }
127
-
128
- /**
129
- * Gets Enctype
130
- *
131
- * @return string
132
- */
133
- public function getEnctype()
134
- {
135
- return $this->enctype;
136
- }
137
-
138
- /**
139
- * Sets Schema
140
- *
141
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\HyperSchema $schema
142
- *
143
- * @return $this
144
- */
145
- public function setSchema($schema)
146
- {
147
- $this->schema = $schema;
148
- return $this;
149
- }
150
-
151
- /**
152
- * Gets Schema
153
- *
154
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\HyperSchema
155
- */
156
- public function getSchema()
157
- {
158
- return $this->schema;
159
- }
160
-
161
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/Measurement.php DELETED
@@ -1,65 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class Measurement
9
- *
10
- * Measurement to represent item dimensions like length, width, height and weight etc.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property string value
15
- * @property string unit
16
- */
17
- class Measurement extends PayPalModel
18
- {
19
- /**
20
- * Value this measurement represents.
21
- *
22
- * @param string $value
23
- *
24
- * @return $this
25
- */
26
- public function setValue($value)
27
- {
28
- $this->value = $value;
29
- return $this;
30
- }
31
-
32
- /**
33
- * Value this measurement represents.
34
- *
35
- * @return string
36
- */
37
- public function getValue()
38
- {
39
- return $this->value;
40
- }
41
-
42
- /**
43
- * Unit in which the value is represented.
44
- *
45
- * @param string $unit
46
- *
47
- * @return $this
48
- */
49
- public function setUnit($unit)
50
- {
51
- $this->unit = $unit;
52
- return $this;
53
- }
54
-
55
- /**
56
- * Unit in which the value is represented.
57
- *
58
- * @return string
59
- */
60
- public function getUnit()
61
- {
62
- return $this->unit;
63
- }
64
-
65
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/MerchantInfo.php DELETED
@@ -1,281 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class MerchantInfo
9
- *
10
- * Merchant business information that appears on the invoice.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property string email
15
- * @property string first_name
16
- * @property string last_name
17
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\InvoiceAddress address
18
- * @property string business_name
19
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Phone phone
20
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Phone fax
21
- * @property string website
22
- * @property string tax_id
23
- * @property string additional_info_label
24
- * @property string additional_info
25
- */
26
- class MerchantInfo extends PayPalModel
27
- {
28
- /**
29
- * The merchant email address. Maximum length is 260 characters.
30
- *
31
- * @param string $email
32
- *
33
- * @return $this
34
- */
35
- public function setEmail($email)
36
- {
37
- $this->email = $email;
38
- return $this;
39
- }
40
-
41
- /**
42
- * The merchant email address. Maximum length is 260 characters.
43
- *
44
- * @return string
45
- */
46
- public function getEmail()
47
- {
48
- return $this->email;
49
- }
50
-
51
- /**
52
- * The merchant first name. Maximum length is 30 characters.
53
- *
54
- * @param string $first_name
55
- *
56
- * @return $this
57
- */
58
- public function setFirstName($first_name)
59
- {
60
- $this->first_name = $first_name;
61
- return $this;
62
- }
63
-
64
- /**
65
- * The merchant first name. Maximum length is 30 characters.
66
- *
67
- * @return string
68
- */
69
- public function getFirstName()
70
- {
71
- return $this->first_name;
72
- }
73
-
74
- /**
75
- * The merchant last name. Maximum length is 30 characters.
76
- *
77
- * @param string $last_name
78
- *
79
- * @return $this
80
- */
81
- public function setLastName($last_name)
82
- {
83
- $this->last_name = $last_name;
84
- return $this;
85
- }
86
-
87
- /**
88
- * The merchant last name. Maximum length is 30 characters.
89
- *
90
- * @return string
91
- */
92
- public function getLastName()
93
- {
94
- return $this->last_name;
95
- }
96
-
97
- /**
98
- * The merchant address.
99
- *
100
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\InvoiceAddress $address
101
- *
102
- * @return $this
103
- */
104
- public function setAddress($address)
105
- {
106
- $this->address = $address;
107
- return $this;
108
- }
109
-
110
- /**
111
- * The merchant address.
112
- *
113
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\InvoiceAddress
114
- */
115
- public function getAddress()
116
- {
117
- return $this->address;
118
- }
119
-
120
- /**
121
- * The merchant company business name. Maximum length is 100 characters.
122
- *
123
- * @param string $business_name
124
- *
125
- * @return $this
126
- */
127
- public function setBusinessName($business_name)
128
- {
129
- $this->business_name = $business_name;
130
- return $this;
131
- }
132
-
133
- /**
134
- * The merchant company business name. Maximum length is 100 characters.
135
- *
136
- * @return string
137
- */
138
- public function getBusinessName()
139
- {
140
- return $this->business_name;
141
- }
142
-
143
- /**
144
- * The merchant phone number.
145
- *
146
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Phone $phone
147
- *
148
- * @return $this
149
- */
150
- public function setPhone($phone)
151
- {
152
- $this->phone = $phone;
153
- return $this;
154
- }
155
-
156
- /**
157
- * The merchant phone number.
158
- *
159
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Phone
160
- */
161
- public function getPhone()
162
- {
163
- return $this->phone;
164
- }
165
-
166
- /**
167
- * The merchant fax number.
168
- *
169
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Phone $fax
170
- *
171
- * @return $this
172
- */
173
- public function setFax($fax)
174
- {
175
- $this->fax = $fax;
176
- return $this;
177
- }
178
-
179
- /**
180
- * The merchant fax number.
181
- *
182
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Phone
183
- */
184
- public function getFax()
185
- {
186
- return $this->fax;
187
- }
188
-
189
- /**
190
- * The merchant website. Maximum length is 2048 characters.
191
- *
192
- * @param string $website
193
- *
194
- * @return $this
195
- */
196
- public function setWebsite($website)
197
- {
198
- $this->website = $website;
199
- return $this;
200
- }
201
-
202
- /**
203
- * The merchant website. Maximum length is 2048 characters.
204
- *
205
- * @return string
206
- */
207
- public function getWebsite()
208
- {
209
- return $this->website;
210
- }
211
-
212
- /**
213
- * The merchant tax ID. Maximum length is 100 characters.
214
- *
215
- * @param string $tax_id
216
- *
217
- * @return $this
218
- */
219
- public function setTaxId($tax_id)
220
- {
221
- $this->tax_id = $tax_id;
222
- return $this;
223
- }
224
-
225
- /**
226
- * The merchant tax ID. Maximum length is 100 characters.
227
- *
228
- * @return string
229
- */
230
- public function getTaxId()
231
- {
232
- return $this->tax_id;
233
- }
234
-
235
- /**
236
- * Option to provide a label to the additional_info field. 40 characters max.
237
- *
238
- * @param string $additional_info_label
239
- *
240
- * @return $this
241
- */
242
- public function setAdditionalInfoLabel($additional_info_label)
243
- {
244
- $this->additional_info_label = $additional_info_label;
245
- return $this;
246
- }
247
-
248
- /**
249
- * Option to provide a label to the additional_info field. 40 characters max.
250
- *
251
- * @return string
252
- */
253
- public function getAdditionalInfoLabel()
254
- {
255
- return $this->additional_info_label;
256
- }
257
-
258
- /**
259
- * Additional information, such as business hours. Maximum length is 40 characters.
260
- *
261
- * @param string $additional_info
262
- *
263
- * @return $this
264
- */
265
- public function setAdditionalInfo($additional_info)
266
- {
267
- $this->additional_info = $additional_info;
268
- return $this;
269
- }
270
-
271
- /**
272
- * Additional information, such as business hours. Maximum length is 40 characters.
273
- *
274
- * @return string
275
- */
276
- public function getAdditionalInfo()
277
- {
278
- return $this->additional_info;
279
- }
280
-
281
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/MerchantPreferences.php DELETED
@@ -1,261 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
- use Never5\DownloadMonitor\Dependencies\PayPal\Validation\UrlValidator;
7
-
8
- /**
9
- * Class MerchantPreferences
10
- *
11
- * Resource representing merchant preferences like max failed attempts, set up fee and others for a plan.
12
- *
13
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
14
- *
15
- * @property string id
16
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency setup_fee
17
- * @property string cancel_url
18
- * @property string return_url
19
- * @property string notify_url
20
- * @property string max_fail_attempts
21
- * @property string auto_bill_amount
22
- * @property string initial_fail_amount_action
23
- * @property string accepted_payment_type
24
- * @property string char_set
25
- */
26
- class MerchantPreferences extends PayPalModel
27
- {
28
- /**
29
- * Identifier of the merchant_preferences. 128 characters max.
30
- *
31
- * @param string $id
32
- *
33
- * @return $this
34
- */
35
- public function setId($id)
36
- {
37
- $this->id = $id;
38
- return $this;
39
- }
40
-
41
- /**
42
- * Identifier of the merchant_preferences. 128 characters max.
43
- *
44
- * @return string
45
- */
46
- public function getId()
47
- {
48
- return $this->id;
49
- }
50
-
51
- /**
52
- * Setup fee amount. Default is 0.
53
- *
54
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency $setup_fee
55
- *
56
- * @return $this
57
- */
58
- public function setSetupFee($setup_fee)
59
- {
60
- $this->setup_fee = $setup_fee;
61
- return $this;
62
- }
63
-
64
- /**
65
- * Setup fee amount. Default is 0.
66
- *
67
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency
68
- */
69
- public function getSetupFee()
70
- {
71
- return $this->setup_fee;
72
- }
73
-
74
- /**
75
- * Redirect URL on cancellation of agreement request. 1000 characters max.
76
- *
77
- * @param string $cancel_url
78
- * @throws \InvalidArgumentException
79
- * @return $this
80
- */
81
- public function setCancelUrl($cancel_url)
82
- {
83
- UrlValidator::validate($cancel_url, "CancelUrl");
84
- $this->cancel_url = $cancel_url;
85
- return $this;
86
- }
87
-
88
- /**
89
- * Redirect URL on cancellation of agreement request. 1000 characters max.
90
- *
91
- * @return string
92
- */
93
- public function getCancelUrl()
94
- {
95
- return $this->cancel_url;
96
- }
97
-
98
- /**
99
- * Redirect URL on creation of agreement request. 1000 characters max.
100
- *
101
- * @param string $return_url
102
- * @throws \InvalidArgumentException
103
- * @return $this
104
- */
105
- public function setReturnUrl($return_url)
106
- {
107
- UrlValidator::validate($return_url, "ReturnUrl");
108
- $this->return_url = $return_url;
109
- return $this;
110
- }
111
-
112
- /**
113
- * Redirect URL on creation of agreement request. 1000 characters max.
114
- *
115
- * @return string
116
- */
117
- public function getReturnUrl()
118
- {
119
- return $this->return_url;
120
- }
121
-
122
- /**
123
- * Notify URL on agreement creation. 1000 characters max.
124
- *
125
- * @param string $notify_url
126
- * @throws \InvalidArgumentException
127
- * @return $this
128
- */
129
- public function setNotifyUrl($notify_url)
130
- {
131
- UrlValidator::validate($notify_url, "NotifyUrl");
132
- $this->notify_url = $notify_url;
133
- return $this;
134
- }
135
-
136
- /**
137
- * Notify URL on agreement creation. 1000 characters max.
138
- *
139
- * @return string
140
- */
141
- public function getNotifyUrl()
142
- {
143
- return $this->notify_url;
144
- }
145
-
146
- /**
147
- * Total number of failed attempts allowed. Default is 0, representing an infinite number of failed attempts.
148
- *
149
- * @param string $max_fail_attempts
150
- *
151
- * @return $this
152
- */
153
- public function setMaxFailAttempts($max_fail_attempts)
154
- {
155
- $this->max_fail_attempts = $max_fail_attempts;
156
- return $this;
157
- }
158
-
159
- /**
160
- * Total number of failed attempts allowed. Default is 0, representing an infinite number of failed attempts.
161
- *
162
- * @return string
163
- */
164
- public function getMaxFailAttempts()
165
- {
166
- return $this->max_fail_attempts;
167
- }
168
-
169
- /**
170
- * Allow auto billing for the outstanding amount of the agreement in the next cycle. Allowed values: `YES`, `NO`. Default is `NO`.
171
- *
172
- * @param string $auto_bill_amount
173
- *
174
- * @return $this
175
- */
176
- public function setAutoBillAmount($auto_bill_amount)
177
- {
178
- $this->auto_bill_amount = $auto_bill_amount;
179
- return $this;
180
- }
181
-
182
- /**
183
- * Allow auto billing for the outstanding amount of the agreement in the next cycle. Allowed values: `YES`, `NO`. Default is `NO`.
184
- *
185
- * @return string
186
- */
187
- public function getAutoBillAmount()
188
- {
189
- return $this->auto_bill_amount;
190
- }
191
-
192
- /**
193
- * Action to take if a failure occurs during initial payment. Allowed values: `CONTINUE`, `CANCEL`. Default is continue.
194
- *
195
- * @param string $initial_fail_amount_action
196
- *
197
- * @return $this
198
- */
199
- public function setInitialFailAmountAction($initial_fail_amount_action)
200
- {
201
- $this->initial_fail_amount_action = $initial_fail_amount_action;
202
- return $this;
203
- }
204
-
205
- /**
206
- * Action to take if a failure occurs during initial payment. Allowed values: `CONTINUE`, `CANCEL`. Default is continue.
207
- *
208
- * @return string
209
- */
210
- public function getInitialFailAmountAction()
211
- {
212
- return $this->initial_fail_amount_action;
213
- }
214
-
215
- /**
216
- * Payment types that are accepted for this plan.
217
- *
218
- * @param string $accepted_payment_type
219
- *
220
- * @return $this
221
- */
222
- public function setAcceptedPaymentType($accepted_payment_type)
223
- {
224
- $this->accepted_payment_type = $accepted_payment_type;
225
- return $this;
226
- }
227
-
228
- /**
229
- * Payment types that are accepted for this plan.
230
- *
231
- * @return string
232
- */
233
- public function getAcceptedPaymentType()
234
- {
235
- return $this->accepted_payment_type;
236
- }
237
-
238
- /**
239
- * char_set for this plan.
240
- *
241
- * @param string $char_set
242
- *
243
- * @return $this
244
- */
245
- public function setCharSet($char_set)
246
- {
247
- $this->char_set = $char_set;
248
- return $this;
249
- }
250
-
251
- /**
252
- * char_set for this plan.
253
- *
254
- * @return string
255
- */
256
- public function getCharSet()
257
- {
258
- return $this->char_set;
259
- }
260
-
261
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/Metadata.php DELETED
@@ -1,259 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
- use Never5\DownloadMonitor\Dependencies\PayPal\Validation\UrlValidator;
7
-
8
- /**
9
- * Class Metadata
10
- *
11
- * Audit information for the resource.
12
- *
13
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
14
- *
15
- * @property string created_date
16
- * @property string created_by
17
- * @property string cancelled_date
18
- * @property string cancelled_by
19
- * @property string last_updated_date
20
- * @property string last_updated_by
21
- * @property string first_sent_date
22
- * @property string last_sent_date
23
- * @property string last_sent_by
24
- * @property string payer_view_url
25
- */
26
- class Metadata extends PayPalModel
27
- {
28
- /**
29
- * The date and time when the resource was created.
30
- *
31
- * @param string $created_date
32
- *
33
- * @return $this
34
- */
35
- public function setCreatedDate($created_date)
36
- {
37
- $this->created_date = $created_date;
38
- return $this;
39
- }
40
-
41
- /**
42
- * The date and time when the resource was created.
43
- *
44
- * @return string
45
- */
46
- public function getCreatedDate()
47
- {
48
- return $this->created_date;
49
- }
50
-
51
- /**
52
- * The email address of the account that created the resource.
53
- *
54
- * @param string $created_by
55
- *
56
- * @return $this
57
- */
58
- public function setCreatedBy($created_by)
59
- {
60
- $this->created_by = $created_by;
61
- return $this;
62
- }
63
-
64
- /**
65
- * The email address of the account that created the resource.
66
- *
67
- * @return string
68
- */
69
- public function getCreatedBy()
70
- {
71
- return $this->created_by;
72
- }
73
-
74
- /**
75
- * The date and time when the resource was cancelled.
76
- *
77
- * @param string $cancelled_date
78
- *
79
- * @return $this
80
- */
81
- public function setCancelledDate($cancelled_date)
82
- {
83
- $this->cancelled_date = $cancelled_date;
84
- return $this;
85
- }
86
-
87
- /**
88
- * The date and time when the resource was cancelled.
89
- *
90
- * @return string
91
- */
92
- public function getCancelledDate()
93
- {
94
- return $this->cancelled_date;
95
- }
96
-
97
- /**
98
- * The actor who cancelled the resource.
99
- *
100
- * @param string $cancelled_by
101
- *
102
- * @return $this
103
- */
104
- public function setCancelledBy($cancelled_by)
105
- {
106
- $this->cancelled_by = $cancelled_by;
107
- return $this;
108
- }
109
-
110
- /**
111
- * The actor who cancelled the resource.
112
- *
113
- * @return string
114
- */
115
- public function getCancelledBy()
116
- {
117
- return $this->cancelled_by;
118
- }
119
-
120
- /**
121
- * The date and time when the resource was last edited.
122
- *
123
- * @param string $last_updated_date
124
- *
125
- * @return $this
126
- */
127
- public function setLastUpdatedDate($last_updated_date)
128
- {
129
- $this->last_updated_date = $last_updated_date;
130
- return $this;
131
- }
132
-
133
- /**
134
- * The date and time when the resource was last edited.
135
- *
136
- * @return string
137
- */
138
- public function getLastUpdatedDate()
139
- {
140
- return $this->last_updated_date;
141
- }
142
-
143
- /**
144
- * The email address of the account that last edited the resource.
145
- *
146
- * @param string $last_updated_by
147
- *
148
- * @return $this
149
- */
150
- public function setLastUpdatedBy($last_updated_by)
151
- {
152
- $this->last_updated_by = $last_updated_by;
153
- return $this;
154
- }
155
-
156
- /**
157
- * The email address of the account that last edited the resource.
158
- *
159
- * @return string
160
- */
161
- public function getLastUpdatedBy()
162
- {
163
- return $this->last_updated_by;
164
- }
165
-
166
- /**
167
- * The date and time when the resource was first sent.
168
- *
169
- * @param string $first_sent_date
170
- *
171
- * @return $this
172
- */
173
- public function setFirstSentDate($first_sent_date)
174
- {
175
- $this->first_sent_date = $first_sent_date;
176
- return $this;
177
- }
178
-
179
- /**
180
- * The date and time when the resource was first sent.
181
- *
182
- * @return string
183
- */
184
- public function getFirstSentDate()
185
- {
186
- return $this->first_sent_date;
187
- }
188
-
189
- /**
190
- * The date and time when the resource was last sent.
191
- *
192
- * @param string $last_sent_date
193
- *
194
- * @return $this
195
- */
196
- public function setLastSentDate($last_sent_date)
197
- {
198
- $this->last_sent_date = $last_sent_date;
199
- return $this;
200
- }
201
-
202
- /**
203
- * The date and time when the resource was last sent.
204
- *
205
- * @return string
206
- */
207
- public function getLastSentDate()
208
- {
209
- return $this->last_sent_date;
210
- }
211
-
212
- /**
213
- * The email address of the account that last sent the resource.
214
- *
215
- * @param string $last_sent_by
216
- *
217
- * @return $this
218
- */
219
- public function setLastSentBy($last_sent_by)
220
- {
221
- $this->last_sent_by = $last_sent_by;
222
- return $this;
223
- }
224
-
225
- /**
226
- * The email address of the account that last sent the resource.
227
- *
228
- * @return string
229
- */
230
- public function getLastSentBy()
231
- {
232
- return $this->last_sent_by;
233
- }
234
-
235
- /**
236
- * URL representing the payer's view of the invoice.
237
- *
238
- * @param string $payer_view_url
239
- * @throws \InvalidArgumentException
240
- * @return $this
241
- */
242
- public function setPayerViewUrl($payer_view_url)
243
- {
244
- UrlValidator::validate($payer_view_url, "PayerViewUrl");
245
- $this->payer_view_url = $payer_view_url;
246
- return $this;
247
- }
248
-
249
- /**
250
- * URL representing the payer's view of the invoice.
251
- *
252
- * @return string
253
- */
254
- public function getPayerViewUrl()
255
- {
256
- return $this->payer_view_url;
257
- }
258
-
259
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/NameValuePair.php DELETED
@@ -1,65 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class NameValuePair
9
- *
10
- * Used to define a type for name-value pairs. The use of name value pairs in an API should be limited and approved by architecture.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property string name
15
- * @property string value
16
- */
17
- class NameValuePair extends PayPalModel
18
- {
19
- /**
20
- * Key for the name value pair. The value name types should be correlated
21
- *
22
- * @param string $name
23
- *
24
- * @return $this
25
- */
26
- public function setName($name)
27
- {
28
- $this->name = $name;
29
- return $this;
30
- }
31
-
32
- /**
33
- * Key for the name value pair. The value name types should be correlated
34
- *
35
- * @return string
36
- */
37
- public function getName()
38
- {
39
- return $this->name;
40
- }
41
-
42
- /**
43
- * Value for the name value pair.
44
- *
45
- * @param string $value
46
- *
47
- * @return $this
48
- */
49
- public function setValue($value)
50
- {
51
- $this->value = $value;
52
- return $this;
53
- }
54
-
55
- /**
56
- * Value for the name value pair.
57
- *
58
- * @return string
59
- */
60
- public function getValue()
61
- {
62
- return $this->value;
63
- }
64
-
65
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/Notification.php DELETED
@@ -1,143 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class Notification
9
- *
10
- * Email/SMS notification.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property string subject
15
- * @property string note
16
- * @property bool send_to_merchant
17
- * @property string[] cc_emails
18
- */
19
- class Notification extends PayPalModel
20
- {
21
- /**
22
- * Subject of the notification.
23
- *
24
- * @param string $subject
25
- *
26
- * @return $this
27
- */
28
- public function setSubject($subject)
29
- {
30
- $this->subject = $subject;
31
- return $this;
32
- }
33
-
34
- /**
35
- * Subject of the notification.
36
- *
37
- * @return string
38
- */
39
- public function getSubject()
40
- {
41
- return $this->subject;
42
- }
43
-
44
- /**
45
- * Note to the payer.
46
- *
47
- * @param string $note
48
- *
49
- * @return $this
50
- */
51
- public function setNote($note)
52
- {
53
- $this->note = $note;
54
- return $this;
55
- }
56
-
57
- /**
58
- * Note to the payer.
59
- *
60
- * @return string
61
- */
62
- public function getNote()
63
- {
64
- return $this->note;
65
- }
66
-
67
- /**
68
- * Indicates whether to send a copy of the email to the merchant.
69
- *
70
- * @param bool $send_to_merchant
71
- *
72
- * @return $this
73
- */
74
- public function setSendToMerchant($send_to_merchant)
75
- {
76
- $this->send_to_merchant = $send_to_merchant;
77
- return $this;
78
- }
79
-
80
- /**
81
- * Indicates whether to send a copy of the email to the merchant.
82
- *
83
- * @return bool
84
- */
85
- public function getSendToMerchant()
86
- {
87
- return $this->send_to_merchant;
88
- }
89
-
90
- /**
91
- * Applicable for invoices created with Cc emails. If this field is not in the body, all the cc email addresses added as part of the invoice shall be notified else this field can be used to limit the list of email addresses. Note: additional email addresses are not supported.
92
- *
93
- * @param string[] $cc_emails
94
- *
95
- * @return $this
96
- */
97
- public function setCcEmails($cc_emails)
98
- {
99
- $this->cc_emails = $cc_emails;
100
- return $this;
101
- }
102
-
103
- /**
104
- * Applicable for invoices created with Cc emails. If this field is not in the body, all the cc email addresses added as part of the invoice shall be notified else this field can be used to limit the list of email addresses. Note: additional email addresses are not supported.
105
- *
106
- * @return string[]
107
- */
108
- public function getCcEmails()
109
- {
110
- return $this->cc_emails;
111
- }
112
-
113
- /**
114
- * Append CcEmails to the list.
115
- *
116
- * @param string $string
117
- * @return $this
118
- */
119
- public function addCcEmail($string)
120
- {
121
- if (!$this->getCcEmails()) {
122
- return $this->setCcEmails(array($string));
123
- } else {
124
- return $this->setCcEmails(
125
- array_merge($this->getCcEmails(), array($string))
126
- );
127
- }
128
- }
129
-
130
- /**
131
- * Remove CcEmails from the list.
132
- *
133
- * @param string $string
134
- * @return $this
135
- */
136
- public function removeCcEmail($string)
137
- {
138
- return $this->setCcEmails(
139
- array_diff($this->getCcEmails(), array($string))
140
- );
141
- }
142
-
143
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/OpenIdAddress.php DELETED
@@ -1,133 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class OpenIdAddress
9
- *
10
- * End-User's preferred address.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property string street_address
15
- * @property string locality
16
- * @property string region
17
- * @property string postal_code
18
- * @property string country
19
- */
20
- class OpenIdAddress extends PayPalModel
21
- {
22
- /**
23
- * Full street address component, which may include house number, street name.
24
- *
25
- * @param string $street_address
26
- * @return self
27
- */
28
- public function setStreetAddress($street_address)
29
- {
30
- $this->street_address = $street_address;
31
- return $this;
32
- }
33
-
34
- /**
35
- * Full street address component, which may include house number, street name.
36
- *
37
- * @return string
38
- */
39
- public function getStreetAddress()
40
- {
41
- return $this->street_address;
42
- }
43
-
44
- /**
45
- * City or locality component.
46
- *
47
- * @param string $locality
48
- * @return self
49
- */
50
- public function setLocality($locality)
51
- {
52
- $this->locality = $locality;
53
- return $this;
54
- }
55
-
56
- /**
57
- * City or locality component.
58
- *
59
- * @return string
60
- */
61
- public function getLocality()
62
- {
63
- return $this->locality;
64
- }
65
-
66
- /**
67
- * State, province, prefecture or region component.
68
- *
69
- * @param string $region
70
- * @return self
71
- */
72
- public function setRegion($region)
73
- {
74
- $this->region = $region;
75
- return $this;
76
- }
77
-
78
- /**
79
- * State, province, prefecture or region component.
80
- *
81
- * @return string
82
- */
83
- public function getRegion()
84
- {
85
- return $this->region;
86
- }
87
-
88
- /**
89
- * Zip code or postal code component.
90
- *
91
- * @param string $postal_code
92
- * @return self
93
- */
94
- public function setPostalCode($postal_code)
95
- {
96
- $this->postal_code = $postal_code;
97
- return $this;
98
- }
99
-
100
- /**
101
- * Zip code or postal code component.
102
- *
103
- * @return string
104
- */
105
- public function getPostalCode()
106
- {
107
- return $this->postal_code;
108
- }
109
-
110
- /**
111
- * Country name component.
112
- *
113
- * @param string $country
114
- * @return self
115
- */
116
- public function setCountry($country)
117
- {
118
- $this->country = $country;
119
- return $this;
120
- }
121
-
122
- /**
123
- * Country name component.
124
- *
125
- * @return string
126
- */
127
- public function getCountry()
128
- {
129
- return $this->country;
130
- }
131
-
132
-
133
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/OpenIdError.php DELETED
@@ -1,85 +0,0 @@
1
- <?php
2
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
3
-
4
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
5
-
6
- /**
7
- * Class OpenIdError
8
- *
9
- * Error resource
10
- *
11
- * @property string error
12
- * @property string error_description
13
- * @property string error_uri
14
- */
15
- class OpenIdError extends PayPalModel
16
- {
17
-
18
- /**
19
- * A single ASCII error code from the following enum.
20
- *
21
- * @param string $error
22
- * @return self
23
- */
24
- public function setError($error)
25
- {
26
- $this->error = $error;
27
- return $this;
28
- }
29
-
30
- /**
31
- * A single ASCII error code from the following enum.
32
- *
33
- * @return string
34
- */
35
- public function getError()
36
- {
37
- return $this->error;
38
- }
39
-
40
- /**
41
- * A resource ID that indicates the starting resource in the returned results.
42
- *
43
- * @param string $error_description
44
- * @return self
45
- */
46
- public function setErrorDescription($error_description)
47
- {
48
- $this->error_description = $error_description;
49
- return $this;
50
- }
51
-
52
- /**
53
- * A resource ID that indicates the starting resource in the returned results.
54
- *
55
- * @return string
56
- */
57
- public function getErrorDescription()
58
- {
59
- return $this->error_description;
60
- }
61
-
62
- /**
63
- * A URI identifying a human-readable web page with information about the error, used to provide the client developer with additional information about the error.
64
- *
65
- * @param string $error_uri
66
- * @return self
67
- */
68
- public function setErrorUri($error_uri)
69
- {
70
- $this->error_uri = $error_uri;
71
- return $this;
72
- }
73
-
74
- /**
75
- * A URI identifying a human-readable web page with information about the error, used to provide the client developer with additional information about the error.
76
- *
77
- * @return string
78
- */
79
- public function getErrorUri()
80
- {
81
- return $this->error_uri;
82
- }
83
-
84
-
85
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/OpenIdSession.php DELETED
@@ -1,107 +0,0 @@
1
- <?php
2
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
3
-
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Core\PayPalConstants;
6
- use Never5\DownloadMonitor\Dependencies\PayPal\Rest\ApiContext;
7
-
8
- class OpenIdSession
9
- {
10
-
11
- /**
12
- * Returns the PayPal URL to which the user must be redirected to
13
- * start the authentication / authorization process.
14
- *
15
- * @param string $redirectUri Uri on merchant website to where
16
- * the user must be redirected to post paypal login
17
- * @param array $scope The access privilges that you are requesting for
18
- * from the user. Pass empty array for all scopes.
19
- * @param string $clientId client id from developer portal
20
- * See https://developer.paypal.com/docs/integration/direct/log-in-with-paypal/detailed/#attributes for more
21
- * @param null $nonce
22
- * @param null $state
23
- * @param ApiContext $apiContext Optional API Context
24
- * @return string Authorization URL
25
- */
26
- public static function getAuthorizationUrl($redirectUri, $scope, $clientId, $nonce = null, $state = null, $apiContext = null)
27
- {
28
- $apiContext = $apiContext ? $apiContext : new ApiContext();
29
- $config = $apiContext->getConfig();
30
-
31
- if ($apiContext->get($clientId)) {
32
- $clientId = $apiContext->get($clientId);
33
- }
34
-
35
- $clientId = $clientId ? $clientId : $apiContext->getCredential()->getClientId();
36
-
37
- $scope = count($scope) != 0 ? $scope : array('openid', 'profile', 'address', 'email', 'phone',
38
- 'https://uri.paypal.com/services/paypalattributes', 'https://uri.paypal.com/services/expresscheckout');
39
- if (!in_array('openid', $scope)) {
40
- $scope[] = 'openid';
41
- }
42
-
43
- $params = array(
44
- 'client_id' => $clientId,
45
- 'response_type' => 'code',
46
- 'scope' => implode(" ", $scope),
47
- 'redirect_uri' => $redirectUri
48
- );
49
-
50
- if ($nonce) {
51
- $params['nonce'] = $nonce;
52
- }
53
- if ($state) {
54
- $params['state'] = $state;
55
- }
56
- return sprintf("%s/signin/authorize?%s", self::getBaseUrl($config), http_build_query($params));
57
- }
58
-
59
-
60
- /**
61
- * Returns the URL to which the user must be redirected to
62
- * logout from the OpenID provider (i.e. PayPal)
63
- *
64
- * @param string $redirectUri Uri on merchant website to where
65
- * the user must be redirected to post logout
66
- * @param string $idToken id_token from the TokenInfo object
67
- * @param ApiContext $apiContext Optional API Context
68
- * @return string logout URL
69
- */
70
- public static function getLogoutUrl($redirectUri, $idToken, $apiContext = null)
71
- {
72
-
73
- if (is_null($apiContext)) {
74
- $apiContext = new ApiContext();
75
- }
76
- $config = $apiContext->getConfig();
77
-
78
- $params = array(
79
- 'id_token' => $idToken,
80
- 'redirect_uri' => $redirectUri,
81
- 'logout' => 'true'
82
- );
83
- return sprintf("%s/webapps/auth/protocol/openidconnect/v1/endsession?%s", self::getBaseUrl($config), http_build_query($params));
84
- }
85
-
86
- /**
87
- * Gets the base URL for the Redirect URI
88
- *
89
- * @param $config
90
- * @return null|string
91
- */
92
- private static function getBaseUrl($config)
93
- {
94
-
95
- if (array_key_exists('openid.RedirectUri', $config)) {
96
- return $config['openid.RedirectUri'];
97
- } else if (array_key_exists('mode', $config)) {
98
- switch (strtoupper($config['mode'])) {
99
- case 'SANDBOX':
100
- return PayPalConstants::OPENID_REDIRECT_SANDBOX_URL;
101
- case 'LIVE':
102
- return PayPalConstants::OPENID_REDIRECT_LIVE_URL;
103
- }
104
- }
105
- return null;
106
- }
107
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/OpenIdTokeninfo.php DELETED
@@ -1,255 +0,0 @@
1
- <?php
2
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
3
-
4
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalResourceModel;
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Rest\ApiContext;
6
- use Never5\DownloadMonitor\Dependencies\PayPal\Transport\PayPalRestCall;
7
-
8
- /**
9
- * Class OpenIdTokeninfo
10
- *
11
- * Token grant resource
12
- *
13
- * @property string scope
14
- * @property string access_token
15
- * @property string refresh_token
16
- * @property string token_type
17
- * @property string id_token
18
- * @property int expires_in
19
- */
20
- class OpenIdTokeninfo extends PayPalResourceModel
21
- {
22
-
23
- /**
24
- * OPTIONAL, if identical to the scope requested by the client; otherwise, REQUIRED.
25
- *
26
- * @param string $scope
27
- * @return self
28
- */
29
- public function setScope($scope)
30
- {
31
- $this->scope = $scope;
32
- return $this;
33
- }
34
-
35
- /**
36
- * OPTIONAL, if identical to the scope requested by the client; otherwise, REQUIRED.
37
- *
38
- * @return string
39
- */
40
- public function getScope()
41
- {
42
- return $this->scope;
43
- }
44
-
45
- /**
46
- * The access token issued by the authorization server.
47
- *
48
- * @param string $access_token
49
- * @return self
50
- */
51
- public function setAccessToken($access_token)
52
- {
53
- $this->access_token = $access_token;
54
- return $this;
55
- }
56
-
57
- /**
58
- * The access token issued by the authorization server.
59
- *
60
- * @return string
61
- */
62
- public function getAccessToken()
63
- {
64
- return $this->access_token;
65
- }
66
-
67
- /**
68
- * The refresh token, which can be used to obtain new access tokens using the same authorization grant as described in OAuth2.0 RFC6749 in Section 6.
69
- *
70
- * @param string $refresh_token
71
- * @return self
72
- */
73
- public function setRefreshToken($refresh_token)
74
- {
75
- $this->refresh_token = $refresh_token;
76
- return $this;
77
- }
78
-
79
- /**
80
- * The refresh token, which can be used to obtain new access tokens using the same authorization grant as described in OAuth2.0 RFC6749 in Section 6.
81
- *
82
- * @return string
83
- */
84
- public function getRefreshToken()
85
- {
86
- return $this->refresh_token;
87
- }
88
-
89
- /**
90
- * The type of the token issued as described in OAuth2.0 RFC6749 (Section 7.1). Value is case insensitive.
91
- *
92
- * @param string $token_type
93
- * @return self
94
- */
95
- public function setTokenType($token_type)
96
- {
97
- $this->token_type = $token_type;
98
- return $this;
99
- }
100
-
101
- /**
102
- * The type of the token issued as described in OAuth2.0 RFC6749 (Section 7.1). Value is case insensitive.
103
- *
104
- * @return string
105
- */
106
- public function getTokenType()
107
- {
108
- return $this->token_type;
109
- }
110
-
111
- /**
112
- * The id_token is a session token assertion that denotes the user's authentication status
113
- *
114
- * @param string $id_token
115
- * @return self
116
- */
117
- public function setIdToken($id_token)
118
- {
119
- $this->id_token = $id_token;
120
- return $this;
121
- }
122
-
123
- /**
124
- * The id_token is a session token assertion that denotes the user's authentication status
125
- *
126
- * @return string
127
- */
128
- public function getIdToken()
129
- {
130
- return $this->id_token;
131
- }
132
-
133
- /**
134
- * The lifetime in seconds of the access token.
135
- *
136
- * @param integer $expires_in
137
- * @return self
138
- */
139
- public function setExpiresIn($expires_in)
140
- {
141
- $this->expires_in = $expires_in;
142
- return $this;
143
- }
144
-
145
- /**
146
- * The lifetime in seconds of the access token.
147
- *
148
- * @return integer
149
- */
150
- public function getExpiresIn()
151
- {
152
- return $this->expires_in;
153
- }
154
-
155
-
156
- /**
157
- * Creates an Access Token from an Authorization Code.
158
- *
159
- * @path /v1/identity/openidconnect/tokenservice
160
- * @method POST
161
- * @param array $params (allowed values are client_id, client_secret, grant_type, code and redirect_uri)
162
- * (required) client_id from developer portal
163
- * (required) client_secret from developer portal
164
- * (required) code is Authorization code previously received from the authorization server
165
- * (required) redirect_uri Redirection endpoint that must match the one provided during the
166
- * authorization request that ended in receiving the authorization code.
167
- * (optional) grant_type is the Token grant type. Defaults to authorization_code
168
- * @param string $clientId
169
- * @param string $clientSecret
170
- * @param ApiContext $apiContext Optional API Context
171
- * @param PayPalRestCall $restCall
172
- * @return OpenIdTokeninfo
173
- */
174
- public static function createFromAuthorizationCode($params, $clientId = null, $clientSecret = null, $apiContext = null, $restCall = null)
175
- {
176
- static $allowedParams = array('grant_type' => 1, 'code' => 1, 'redirect_uri' => 1);
177
-
178
- if (!array_key_exists('grant_type', $params)) {
179
- $params['grant_type'] = 'authorization_code';
180
- }
181
- $apiContext = $apiContext ? $apiContext : new ApiContext(self::$credential);
182
-
183
- if (sizeof($apiContext->get($clientId)) > 0) {
184
- $clientId = $apiContext->get($clientId);
185
- }
186
-
187
- if (sizeof($apiContext->get($clientSecret)) > 0) {
188
- $clientSecret = $apiContext->get($clientSecret);
189
- }
190
-
191
- $clientId = $clientId ? $clientId : $apiContext->getCredential()->getClientId();
192
- $clientSecret = $clientSecret ? $clientSecret : $apiContext->getCredential()->getClientSecret();
193
-
194
- $json = self::executeCall(
195
- "/v1/identity/openidconnect/tokenservice",
196
- "POST",
197
- http_build_query(array_intersect_key($params, $allowedParams)),
198
- array(
199
- 'Content-Type' => 'application/x-www-form-urlencoded',
200
- 'Authorization' => 'Basic ' . base64_encode($clientId . ":" . $clientSecret)
201
- ),
202
- $apiContext,
203
- $restCall
204
- );
205
- $token = new OpenIdTokeninfo();
206
- $token->fromJson($json);
207
- return $token;
208
- }
209
-
210
- /**
211
- * Creates an Access Token from an Refresh Token.
212
- *
213
- * @path /v1/identity/openidconnect/tokenservice
214
- * @method POST
215
- * @param array $params (allowed values are grant_type and scope)
216
- * (required) client_id from developer portal
217
- * (required) client_secret from developer portal
218
- * (optional) refresh_token refresh token. If one is not passed, refresh token from the current object is used.
219
- * (optional) grant_type is the Token grant type. Defaults to refresh_token
220
- * (optional) scope is an array that either the same or a subset of the scope passed to the authorization request
221
- * @param APIContext $apiContext Optional API Context
222
- * @param PayPalRestCall $restCall
223
- * @return OpenIdTokeninfo
224
- */
225
- public function createFromRefreshToken($params, $apiContext = null, $restCall = null)
226
- {
227
- static $allowedParams = array('grant_type' => 1, 'refresh_token' => 1, 'scope' => 1);
228
- $apiContext = $apiContext ? $apiContext : new ApiContext(self::$credential);
229
-
230
- if (!array_key_exists('grant_type', $params)) {
231
- $params['grant_type'] = 'refresh_token';
232
- }
233
- if (!array_key_exists('refresh_token', $params)) {
234
- $params['refresh_token'] = $this->getRefreshToken();
235
- }
236
-
237
- $clientId = isset($params['client_id']) ? $params['client_id'] : $apiContext->getCredential()->getClientId();
238
- $clientSecret = isset($params['client_secret']) ? $params['client_secret'] : $apiContext->getCredential()->getClientSecret();
239
-
240
- $json = self::executeCall(
241
- "/v1/identity/openidconnect/tokenservice",
242
- "POST",
243
- http_build_query(array_intersect_key($params, $allowedParams)),
244
- array(
245
- 'Content-Type' => 'application/x-www-form-urlencoded',
246
- 'Authorization' => 'Basic ' . base64_encode($clientId . ":" . $clientSecret)
247
- ),
248
- $apiContext,
249
- $restCall
250
- );
251
-
252
- $this->fromJson($json);
253
- return $this;
254
- }
255
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/Order.php DELETED
@@ -1,464 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalResourceModel;
6
- use Never5\DownloadMonitor\Dependencies\PayPal\Validation\ArgumentValidator;
7
- use Never5\DownloadMonitor\Dependencies\PayPal\Rest\ApiContext;
8
-
9
- /**
10
- * Class Order
11
- *
12
- * An order transaction.
13
- *
14
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
15
- *
16
- * @property string id
17
- * @property string reference_id
18
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Amount amount
19
- * @property string payment_mode
20
- * @property string state
21
- * @property string reason_code
22
- * @property string pending_reason
23
- * @property string protection_eligibility
24
- * @property string protection_eligibility_type
25
- * @property string parent_payment
26
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\FmfDetails fmf_details
27
- * @property string create_time
28
- * @property string update_time
29
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links[] links
30
- */
31
- class Order extends PayPalResourceModel
32
- {
33
- /**
34
- * Identifier of the order transaction.
35
- *
36
- * @param string $id
37
- *
38
- * @return $this
39
- */
40
- public function setId($id)
41
- {
42
- $this->id = $id;
43
- return $this;
44
- }
45
-
46
- /**
47
- * Identifier of the order transaction.
48
- *
49
- * @return string
50
- */
51
- public function getId()
52
- {
53
- return $this->id;
54
- }
55
-
56
- /**
57
- * Identifier to the purchase unit associated with this object. Obsolete. Use one in cart_base.
58
- *
59
- * @deprecated Use #setReferenceId instead
60
- *
61
- * @param string $purchase_unit_reference_id
62
- *
63
- * @return $this
64
- */
65
- public function setPurchaseUnitReferenceId($purchase_unit_reference_id)
66
- {
67
- $this->purchase_unit_reference_id = $purchase_unit_reference_id;
68
- return $this;
69
- }
70
-
71
- /**
72
- * Identifier to the purchase unit associated with this object. Obsolete. Use one in cart_base.
73
- * @deprecated Use #getReferenceId instead
74
- *
75
- * @return string
76
- */
77
- public function getPurchaseUnitReferenceId()
78
- {
79
- return $this->purchase_unit_reference_id;
80
- }
81
-
82
- /**
83
- * Identifier to the purchase unit associated with this object. Obsolete. Use one in cart_base.
84
- *
85
- * @param string $reference_id
86
- *
87
- * @return $this
88
- */
89
- public function setReferenceId($reference_id)
90
- {
91
- $this->reference_id = $reference_id;
92
- return $this;
93
- }
94
-
95
- /**
96
- * Identifier to the purchase unit associated with this object. Obsolete. Use one in cart_base.
97
- *
98
- * @return string
99
- */
100
- public function getReferenceId()
101
- {
102
- return $this->reference_id;
103
- }
104
-
105
- /**
106
- * Amount being collected.
107
- *
108
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Amount $amount
109
- *
110
- * @return $this
111
- */
112
- public function setAmount($amount)
113
- {
114
- $this->amount = $amount;
115
- return $this;
116
- }
117
-
118
- /**
119
- * Amount being collected.
120
- *
121
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Amount
122
- */
123
- public function getAmount()
124
- {
125
- return $this->amount;
126
- }
127
-
128
- /**
129
- * specifies payment mode of the transaction
130
- * Valid Values: ["INSTANT_TRANSFER", "MANUAL_BANK_TRANSFER", "DELAYED_TRANSFER", "ECHECK"]
131
- *
132
- * @param string $payment_mode
133
- *
134
- * @return $this
135
- */
136
- public function setPaymentMode($payment_mode)
137
- {
138
- $this->payment_mode = $payment_mode;
139
- return $this;
140
- }
141
-
142
- /**
143
- * specifies payment mode of the transaction
144
- *
145
- * @return string
146
- */
147
- public function getPaymentMode()
148
- {
149
- return $this->payment_mode;
150
- }
151
-
152
- /**
153
- * State of the order transaction.
154
- * Valid Values: ["pending", "completed", "voided", "authorized", "captured"]
155
- *
156
- * @param string $state
157
- *
158
- * @return $this
159
- */
160
- public function setState($state)
161
- {
162
- $this->state = $state;
163
- return $this;
164
- }
165
-
166
- /**
167
- * State of the order transaction.
168
- *
169
- * @return string
170
- */
171
- public function getState()
172
- {
173
- return $this->state;
174
- }
175
-
176
- /**
177
- * Reason code for the transaction state being Pending or Reversed. This field will replace pending_reason field eventually. Only supported when the `payment_method` is set to `paypal`.
178
- * Valid Values: ["PAYER_SHIPPING_UNCONFIRMED", "MULTI_CURRENCY", "RISK_REVIEW", "REGULATORY_REVIEW", "VERIFICATION_REQUIRED", "ORDER", "OTHER"]
179
- *
180
- * @param string $reason_code
181
- *
182
- * @return $this
183
- */
184
- public function setReasonCode($reason_code)
185
- {
186
- $this->reason_code = $reason_code;
187
- return $this;
188
- }
189
-
190
- /**
191
- * Reason code for the transaction state being Pending or Reversed. This field will replace pending_reason field eventually. Only supported when the `payment_method` is set to `paypal`.
192
- *
193
- * @return string
194
- */
195
- public function getReasonCode()
196
- {
197
- return $this->reason_code;
198
- }
199
-
200
- /**
201
- * [DEPRECATED] Reason code for the transaction state being Pending. Obsolete. Retained for backward compatability. Use reason_code field above instead.
202
- * Valid Values: ["payer_shipping_unconfirmed", "multi_currency", "risk_review", "regulatory_review", "verification_required", "order", "other"]
203
- *
204
- * @param string $pending_reason
205
- *
206
- * @return $this
207
- */
208
- public function setPendingReason($pending_reason)
209
- {
210
- $this->pending_reason = $pending_reason;
211
- return $this;
212
- }
213
-
214
- /**
215
- * @deprecated [DEPRECATED] Reason code for the transaction state being Pending. Obsolete. Retained for backward compatability. Use reason_code field above instead.
216
- *
217
- * @return string
218
- */
219
- public function getPendingReason()
220
- {
221
- return $this->pending_reason;
222
- }
223
-
224
- /**
225
- * The level of seller protection in force for the transaction.
226
- * Valid Values: ["ELIGIBLE", "PARTIALLY_ELIGIBLE", "INELIGIBLE"]
227
- *
228
- * @param string $protection_eligibility
229
- *
230
- * @return $this
231
- */
232
- public function setProtectionEligibility($protection_eligibility)
233
- {
234
- $this->protection_eligibility = $protection_eligibility;
235
- return $this;
236
- }
237
-
238
- /**
239
- * The level of seller protection in force for the transaction.
240
- *
241
- * @return string
242
- */
243
- public function getProtectionEligibility()
244
- {
245
- return $this->protection_eligibility;
246
- }
247
-
248
- /**
249
- * The kind of seller protection in force for the transaction. This property is returned only when the `protection_eligibility` property is set to `ELIGIBLE`or `PARTIALLY_ELIGIBLE`. Only supported when the `payment_method` is set to `paypal`. Allowed values:<br> `ITEM_NOT_RECEIVED_ELIGIBLE`- Sellers are protected against claims for items not received.<br> `UNAUTHORIZED_PAYMENT_ELIGIBLE`- Sellers are protected against claims for unauthorized payments.<br> One or both of the allowed values can be returned.
250
- * Valid Values: ["ITEM_NOT_RECEIVED_ELIGIBLE", "UNAUTHORIZED_PAYMENT_ELIGIBLE", "ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE"]
251
- *
252
- * @param string $protection_eligibility_type
253
- *
254
- * @return $this
255
- */
256
- public function setProtectionEligibilityType($protection_eligibility_type)
257
- {
258
- $this->protection_eligibility_type = $protection_eligibility_type;
259
- return $this;
260
- }
261
-
262
- /**
263
- * The kind of seller protection in force for the transaction. This property is returned only when the `protection_eligibility` property is set to `ELIGIBLE`or `PARTIALLY_ELIGIBLE`. Only supported when the `payment_method` is set to `paypal`. Allowed values:<br> `ITEM_NOT_RECEIVED_ELIGIBLE`- Sellers are protected against claims for items not received.<br> `UNAUTHORIZED_PAYMENT_ELIGIBLE`- Sellers are protected against claims for unauthorized payments.<br> One or both of the allowed values can be returned.
264
- *
265
- * @return string
266
- */
267
- public function getProtectionEligibilityType()
268
- {
269
- return $this->protection_eligibility_type;
270
- }
271
-
272
- /**
273
- * ID of the Payment resource that this transaction is based on.
274
- *
275
- * @param string $parent_payment
276
- *
277
- * @return $this
278
- */
279
- public function setParentPayment($parent_payment)
280
- {
281
- $this->parent_payment = $parent_payment;
282
- return $this;
283
- }
284
-
285
- /**
286
- * ID of the Payment resource that this transaction is based on.
287
- *
288
- * @return string
289
- */
290
- public function getParentPayment()
291
- {
292
- return $this->parent_payment;
293
- }
294
-
295
- /**
296
- * Fraud Management Filter (FMF) details applied for the payment that could result in accept/deny/pending action.
297
- *
298
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\FmfDetails $fmf_details
299
- *
300
- * @return $this
301
- */
302
- public function setFmfDetails($fmf_details)
303
- {
304
- $this->fmf_details = $fmf_details;
305
- return $this;
306
- }
307
-
308
- /**
309
- * Fraud Management Filter (FMF) details applied for the payment that could result in accept/deny/pending action.
310
- *
311
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\FmfDetails
312
- */
313
- public function getFmfDetails()
314
- {
315
- return $this->fmf_details;
316
- }
317
-
318
- /**
319
- * Time the resource was created in UTC ISO8601 format.
320
- *
321
- * @param string $create_time
322
- *
323
- * @return $this
324
- */
325
- public function setCreateTime($create_time)
326
- {
327
- $this->create_time = $create_time;
328
- return $this;
329
- }
330
-
331
- /**
332
- * Time the resource was created in UTC ISO8601 format.
333
- *
334
- * @return string
335
- */
336
- public function getCreateTime()
337
- {
338
- return $this->create_time;
339
- }
340
-
341
- /**
342
- * Time the resource was last updated in UTC ISO8601 format.
343
- *
344
- * @param string $update_time
345
- *
346
- * @return $this
347
- */
348
- public function setUpdateTime($update_time)
349
- {
350
- $this->update_time = $update_time;
351
- return $this;
352
- }
353
-
354
- /**
355
- * Time the resource was last updated in UTC ISO8601 format.
356
- *
357
- * @return string
358
- */
359
- public function getUpdateTime()
360
- {
361
- return $this->update_time;
362
- }
363
-
364
- /**
365
- * Shows details for an order, by ID.
366
- *
367
- * @param string $orderId
368
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
369
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
370
- * @return Order
371
- */
372
- public static function get($orderId, $apiContext = null, $restCall = null)
373
- {
374
- ArgumentValidator::validate($orderId, 'orderId');
375
- $payLoad = "";
376
- $json = self::executeCall(
377
- "/v1/payments/orders/$orderId",
378
- "GET",
379
- $payLoad,
380
- null,
381
- $apiContext,
382
- $restCall
383
- );
384
- $ret = new Order();
385
- $ret->fromJson($json);
386
- return $ret;
387
- }
388
-
389
- /**
390
- * Captures a payment for an order, by ID. To use this call, the original payment call must specify an intent of `order`. In the JSON request body, include the payment amount and indicate whether this capture is the final capture for the authorization.
391
- *
392
- * @param Capture $capture
393
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
394
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
395
- * @return Capture
396
- */
397
- public function capture($capture, $apiContext = null, $restCall = null)
398
- {
399
- ArgumentValidator::validate($this->getId(), "Id");
400
- ArgumentValidator::validate($capture, 'capture');
401
- $payLoad = $capture->toJSON();
402
- $json = self::executeCall(
403
- "/v1/payments/orders/{$this->getId()}/capture",
404
- "POST",
405
- $payLoad,
406
- null,
407
- $apiContext,
408
- $restCall
409
- );
410
- $ret = new Capture();
411
- $ret->fromJson($json);
412
- return $ret;
413
- }
414
-
415
- /**
416
- * Voids, or cancels, an order, by ID. You cannot void an order if a payment has already been partially or fully captured.
417
- *
418
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
419
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
420
- * @return Order
421
- */
422
- public function void($apiContext = null, $restCall = null)
423
- {
424
- ArgumentValidator::validate($this->getId(), "Id");
425
- $payLoad = "";
426
- $json = self::executeCall(
427
- "/v1/payments/orders/{$this->getId()}/do-void",
428
- "POST",
429
- $payLoad,
430
- null,
431
- $apiContext,
432
- $restCall
433
- );
434
- $this->fromJson($json);
435
- return $this;
436
- }
437
-
438
- /**
439
- * Authorizes an order, by ID. Include an `amount` object in the JSON request body.
440
- *
441
- * @param Authorization $authorization Authorization Object with Amount value to be authorized
442
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
443
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
444
- * @return Authorization
445
- */
446
- public function authorize($authorization, $apiContext = null, $restCall = null)
447
- {
448
- ArgumentValidator::validate($this->getId(), "Id");
449
- ArgumentValidator::validate($authorization, 'Authorization');
450
- $payLoad = $authorization->toJSON();
451
- $json = self::executeCall(
452
- "/v1/payments/orders/{$this->getId()}/authorize",
453
- "POST",
454
- $payLoad,
455
- null,
456
- $apiContext,
457
- $restCall
458
- );
459
- $ret = new Authorization();
460
- $ret->fromJson($json);
461
- return $ret;
462
- }
463
-
464
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/OverrideChargeModel.php DELETED
@@ -1,65 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class OverrideChargeModel
9
- *
10
- * A resource representing an override_charge_model to be used during creation of the agreement.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property string charge_id
15
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency amount
16
- */
17
- class OverrideChargeModel extends PayPalModel
18
- {
19
- /**
20
- * ID of charge model.
21
- *
22
- * @param string $charge_id
23
- *
24
- * @return $this
25
- */
26
- public function setChargeId($charge_id)
27
- {
28
- $this->charge_id = $charge_id;
29
- return $this;
30
- }
31
-
32
- /**
33
- * ID of charge model.
34
- *
35
- * @return string
36
- */
37
- public function getChargeId()
38
- {
39
- return $this->charge_id;
40
- }
41
-
42
- /**
43
- * Updated Amount to be associated with this charge model.
44
- *
45
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency $amount
46
- *
47
- * @return $this
48
- */
49
- public function setAmount($amount)
50
- {
51
- $this->amount = $amount;
52
- return $this;
53
- }
54
-
55
- /**
56
- * Updated Amount to be associated with this charge model.
57
- *
58
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency
59
- */
60
- public function getAmount()
61
- {
62
- return $this->amount;
63
- }
64
-
65
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/Participant.php DELETED
@@ -1,233 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class Participant
9
- *
10
- * Participant information.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property string email
15
- * @property string first_name
16
- * @property string last_name
17
- * @property string business_name
18
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Phone phone
19
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Phone fax
20
- * @property string website
21
- * @property string additional_info
22
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Address address
23
- */
24
- class Participant extends PayPalModel
25
- {
26
- /**
27
- * The participant email address.
28
- *
29
- * @param string $email
30
- *
31
- * @return $this
32
- */
33
- public function setEmail($email)
34
- {
35
- $this->email = $email;
36
- return $this;
37
- }
38
-
39
- /**
40
- * The participant email address.
41
- *
42
- * @return string
43
- */
44
- public function getEmail()
45
- {
46
- return $this->email;
47
- }
48
-
49
- /**
50
- * The participant first name.
51
- *
52
- * @param string $first_name
53
- *
54
- * @return $this
55
- */
56
- public function setFirstName($first_name)
57
- {
58
- $this->first_name = $first_name;
59
- return $this;
60
- }
61
-
62
- /**
63
- * The participant first name.
64
- *
65
- * @return string
66
- */
67
- public function getFirstName()
68
- {
69
- return $this->first_name;
70
- }
71
-
72
- /**
73
- * The participant last name.
74
- *
75
- * @param string $last_name
76
- *
77
- * @return $this
78
- */
79
- public function setLastName($last_name)
80
- {
81
- $this->last_name = $last_name;
82
- return $this;
83
- }
84
-
85
- /**
86
- * The participant last name.
87
- *
88
- * @return string
89
- */
90
- public function getLastName()
91
- {
92
- return $this->last_name;
93
- }
94
-
95
- /**
96
- * The participant company business name.
97
- *
98
- * @param string $business_name
99
- *
100
- * @return $this
101
- */
102
- public function setBusinessName($business_name)
103
- {
104
- $this->business_name = $business_name;
105
- return $this;
106
- }
107
-
108
- /**
109
- * The participant company business name.
110
- *
111
- * @return string
112
- */
113
- public function getBusinessName()
114
- {
115
- return $this->business_name;
116
- }
117
-
118
- /**
119
- * The participant phone number.
120
- *
121
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Phone $phone
122
- *
123
- * @return $this
124
- */
125
- public function setPhone($phone)
126
- {
127
- $this->phone = $phone;
128
- return $this;
129
- }
130
-
131
- /**
132
- * The participant phone number.
133
- *
134
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Phone
135
- */
136
- public function getPhone()
137
- {
138
- return $this->phone;
139
- }
140
-
141
- /**
142
- * The participant fax number.
143
- *
144
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Phone $fax
145
- *
146
- * @return $this
147
- */
148
- public function setFax($fax)
149
- {
150
- $this->fax = $fax;
151
- return $this;
152
- }
153
-
154
- /**
155
- * The participant fax number.
156
- *
157
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Phone
158
- */
159
- public function getFax()
160
- {
161
- return $this->fax;
162
- }
163
-
164
- /**
165
- * The participant website.
166
- *
167
- * @param string $website
168
- *
169
- * @return $this
170
- */
171
- public function setWebsite($website)
172
- {
173
- $this->website = $website;
174
- return $this;
175
- }
176
-
177
- /**
178
- * The participant website.
179
- *
180
- * @return string
181
- */
182
- public function getWebsite()
183
- {
184
- return $this->website;
185
- }
186
-
187
- /**
188
- * Additional information, such as business hours.
189
- *
190
- * @param string $additional_info
191
- *
192
- * @return $this
193
- */
194
- public function setAdditionalInfo($additional_info)
195
- {
196
- $this->additional_info = $additional_info;
197
- return $this;
198
- }
199
-
200
- /**
201
- * Additional information, such as business hours.
202
- *
203
- * @return string
204
- */
205
- public function getAdditionalInfo()
206
- {
207
- return $this->additional_info;
208
- }
209
-
210
- /**
211
- * The participant address.
212
- *
213
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Address $address
214
- *
215
- * @return $this
216
- */
217
- public function setAddress($address)
218
- {
219
- $this->address = $address;
220
- return $this;
221
- }
222
-
223
- /**
224
- * The participant address.
225
- *
226
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Address
227
- */
228
- public function getAddress()
229
- {
230
- return $this->address;
231
- }
232
-
233
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/Patch.php DELETED
@@ -1,114 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class Patch
9
- *
10
- * A JSON patch object that you can use to apply partial updates to resources.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property string op
15
- * @property string path
16
- * @property mixed value
17
- * @property string from
18
- */
19
- class Patch extends PayPalModel
20
- {
21
- /**
22
- * The operation to perform.
23
- * Valid Values: ["add", "remove", "replace", "move", "copy", "test"]
24
- *
25
- * @param string $op
26
- *
27
- * @return $this
28
- */
29
- public function setOp($op)
30
- {
31
- $this->op = $op;
32
- return $this;
33
- }
34
-
35
- /**
36
- * The operation to perform.
37
- *
38
- * @return string
39
- */
40
- public function getOp()
41
- {
42
- return $this->op;
43
- }
44
-
45
- /**
46
- * A JSON pointer that references a location in the target document where the operation is performed. A `string` value.
47
- *
48
- * @param string $path
49
- *
50
- * @return $this
51
- */
52
- public function setPath($path)
53
- {
54
- $this->path = $path;
55
- return $this;
56
- }
57
-
58
- /**
59
- * A JSON pointer that references a location in the target document where the operation is performed. A `string` value.
60
- *
61
- * @return string
62
- */
63
- public function getPath()
64
- {
65
- return $this->path;
66
- }
67
-
68
- /**
69
- * New value to apply based on the operation.
70
- *
71
- * @param mixed $value
72
- *
73
- * @return $this
74
- */
75
- public function setValue($value)
76
- {
77
- $this->value = $value;
78
- return $this;
79
- }
80
-
81
- /**
82
- * New value to apply based on the operation.
83
- *
84
- * @return mixed
85
- */
86
- public function getValue()
87
- {
88
- return $this->value;
89
- }
90
-
91
- /**
92
- * A string containing a JSON Pointer value that references the location in the target document to move the value from.
93
- *
94
- * @param string $from
95
- *
96
- * @return $this
97
- */
98
- public function setFrom($from)
99
- {
100
- $this->from = $from;
101
- return $this;
102
- }
103
-
104
- /**
105
- * A string containing a JSON Pointer value that references the location in the target document to move the value from.
106
- *
107
- * @return string
108
- */
109
- public function getFrom()
110
- {
111
- return $this->from;
112
- }
113
-
114
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/PatchRequest.php DELETED
@@ -1,86 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class PatchRequest
9
- *
10
- * A JSON patch request.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Patch[] patches
15
- */
16
- class PatchRequest extends PayPalModel
17
- {
18
- /**
19
- * Placeholder for holding array of patch objects
20
- *
21
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Patch[] $patches
22
- *
23
- * @return $this
24
- */
25
- public function setPatches($patches)
26
- {
27
- $this->patches = $patches;
28
- return $this;
29
- }
30
-
31
- /**
32
- * Placeholder for holding array of patch objects
33
- *
34
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Patch[]
35
- */
36
- public function getPatches()
37
- {
38
- return $this->patches;
39
- }
40
-
41
- /**
42
- * Append Patches to the list.
43
- *
44
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Patch $patch
45
- * @return $this
46
- */
47
- public function addPatch($patch)
48
- {
49
- if (!$this->getPatches()) {
50
- return $this->setPatches(array($patch));
51
- } else {
52
- return $this->setPatches(
53
- array_merge($this->getPatches(), array($patch))
54
- );
55
- }
56
- }
57
-
58
- /**
59
- * Remove Patches from the list.
60
- *
61
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Patch $patch
62
- * @return $this
63
- */
64
- public function removePatch($patch)
65
- {
66
- return $this->setPatches(
67
- array_diff($this->getPatches(), array($patch))
68
- );
69
- }
70
-
71
- /**
72
- * As PatchRequest holds the array of Patch object, we would override the json conversion to return
73
- * a json representation of array of Patch objects.
74
- *
75
- * @param int $options
76
- * @return mixed|string
77
- */
78
- public function toJSON($options = 0)
79
- {
80
- $json = array();
81
- foreach ($this->getPatches() as $patch) {
82
- $json[] = $patch->toArray();
83
- }
84
- return str_replace('\\/', '/', json_encode($json, $options));
85
- }
86
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/Payee.php DELETED
@@ -1,157 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class Payee
9
- *
10
- * A resource representing a Payee who receives the funds and fulfills the order.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property string email
15
- * @property string merchant_id
16
- */
17
- class Payee extends PayPalModel
18
- {
19
- /**
20
- * Email Address associated with the Payee's PayPal Account. If the provided email address is not associated with any PayPal Account, the payee can only receive PayPal Wallet Payments. Direct Credit Card Payments will be denied due to card compliance requirements.
21
- *
22
- * @param string $email
23
- *
24
- * @return $this
25
- */
26
- public function setEmail($email)
27
- {
28
- $this->email = $email;
29
- return $this;
30
- }
31
-
32
- /**
33
- * Email Address associated with the Payee's PayPal Account. If the provided email address is not associated with any PayPal Account, the payee can only receive PayPal Wallet Payments. Direct Credit Card Payments will be denied due to card compliance requirements.
34
- *
35
- * @return string
36
- */
37
- public function getEmail()
38
- {
39
- return $this->email;
40
- }
41
-
42
- /**
43
- * Encrypted PayPal account identifier for the Payee.
44
- *
45
- * @param string $merchant_id
46
- *
47
- * @return $this
48
- */
49
- public function setMerchantId($merchant_id)
50
- {
51
- $this->merchant_id = $merchant_id;
52
- return $this;
53
- }
54
-
55
- /**
56
- * Encrypted PayPal account identifier for the Payee.
57
- *
58
- * @return string
59
- */
60
- public function getMerchantId()
61
- {
62
- return $this->merchant_id;
63
- }
64
-
65
- /**
66
- * First Name of the Payee.
67
- * @deprecated Not publicly available
68
- * @param string $first_name
69
- *
70
- * @return $this
71
- */
72
- public function setFirstName($first_name)
73
- {
74
- $this->first_name = $first_name;
75
- return $this;
76
- }
77
-
78
- /**
79
- * First Name of the Payee.
80
- * @deprecated Not publicly available
81
- * @return string
82
- */
83
- public function getFirstName()
84
- {
85
- return $this->first_name;
86
- }
87
-
88
- /**
89
- * Last Name of the Payee.
90
- * @deprecated Not publicly available
91
- * @param string $last_name
92
- *
93
- * @return $this
94
- */
95
- public function setLastName($last_name)
96
- {
97
- $this->last_name = $last_name;
98
- return $this;
99
- }
100
-
101
- /**
102
- * Last Name of the Payee.
103
- * @deprecated Not publicly available
104
- * @return string
105
- */
106
- public function getLastName()
107
- {
108
- return $this->last_name;
109
- }
110
-
111
- /**
112
- * Unencrypted PayPal account Number of the Payee
113
- * @deprecated Not publicly available
114
- * @param string $account_number
115
- *
116
- * @return $this
117
- */
118
- public function setAccountNumber($account_number)
119
- {
120
- $this->account_number = $account_number;
121
- return $this;
122
- }
123
-
124
- /**
125
- * Unencrypted PayPal account Number of the Payee
126
- * @deprecated Not publicly available
127
- * @return string
128
- */
129
- public function getAccountNumber()
130
- {
131
- return $this->account_number;
132
- }
133
-
134
- /**
135
- * Information related to the Payee.
136
- * @deprecated Not publicly available
137
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Phone $phone
138
- *
139
- * @return $this
140
- */
141
- public function setPhone($phone)
142
- {
143
- $this->phone = $phone;
144
- return $this;
145
- }
146
-
147
- /**
148
- * Information related to the Payee.
149
- * @deprecated Not publicly available
150
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Phone
151
- */
152
- public function getPhone()
153
- {
154
- return $this->phone;
155
- }
156
-
157
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/Payment.php DELETED
@@ -1,691 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalResourceModel;
6
- use Never5\DownloadMonitor\Dependencies\PayPal\Core\PayPalConstants;
7
- use Never5\DownloadMonitor\Dependencies\PayPal\Validation\ArgumentValidator;
8
- use Never5\DownloadMonitor\Dependencies\PayPal\Rest\ApiContext;
9
-
10
- /**
11
- * Class Payment
12
- *
13
- * Lets you create, process and manage payments.
14
- *
15
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
16
- *
17
- * @property string id
18
- * @property string intent
19
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Payer payer
20
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Transaction[] transactions
21
- * @property string state
22
- * @property string experience_profile_id
23
- * @property string note_to_payer
24
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Payee $payee
25
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\RedirectUrls redirect_urls
26
- * @property string failure_reason
27
- * @property string create_time
28
- * @property string update_time
29
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links[] links
30
- */
31
- class Payment extends PayPalResourceModel
32
- {
33
- /**
34
- * Identifier of the payment resource created.
35
- *
36
- * @param string $id
37
- *
38
- * @return $this
39
- */
40
- public function setId($id)
41
- {
42
- $this->id = $id;
43
- return $this;
44
- }
45
-
46
- /**
47
- * Identifier of the payment resource created.
48
- *
49
- * @return string
50
- */
51
- public function getId()
52
- {
53
- return $this->id;
54
- }
55
-
56
- /**
57
- * Payment intent.
58
- * Valid Values: ["sale", "authorize", "order"]
59
- *
60
- * @param string $intent
61
- *
62
- * @return $this
63
- */
64
- public function setIntent($intent)
65
- {
66
- $this->intent = $intent;
67
- return $this;
68
- }
69
-
70
- /**
71
- * Payment intent.
72
- *
73
- * @return string
74
- */
75
- public function getIntent()
76
- {
77
- return $this->intent;
78
- }
79
-
80
- /**
81
- * Source of the funds for this payment represented by a PayPal account or a direct credit card.
82
- *
83
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Payer $payer
84
- *
85
- * @return $this
86
- */
87
- public function setPayer($payer)
88
- {
89
- $this->payer = $payer;
90
- return $this;
91
- }
92
-
93
- /**
94
- * Source of the funds for this payment represented by a PayPal account or a direct credit card.
95
- *
96
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Payer
97
- */
98
- public function getPayer()
99
- {
100
- return $this->payer;
101
- }
102
-
103
- /**
104
- * Information that the merchant knows about the payer. This information is not definitive and only serves as a hint to the UI or any pre-processing logic.
105
- * @deprecated Not publicly available
106
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\PotentialPayerInfo $potential_payer_info
107
- *
108
- * @return $this
109
- */
110
- public function setPotentialPayerInfo($potential_payer_info)
111
- {
112
- $this->potential_payer_info = $potential_payer_info;
113
- return $this;
114
- }
115
-
116
- /**
117
- * Information that the merchant knows about the payer. This information is not definitive and only serves as a hint to the UI or any pre-processing logic.
118
- * @deprecated Not publicly available
119
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\PotentialPayerInfo
120
- */
121
- public function getPotentialPayerInfo()
122
- {
123
- return $this->potential_payer_info;
124
- }
125
-
126
- /**
127
- * Receiver of funds for this payment.
128
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Payee $payee
129
- *
130
- * @return $this
131
- */
132
- public function setPayee($payee)
133
- {
134
- $this->payee = $payee;
135
- return $this;
136
- }
137
-
138
- /**
139
- * Receiver of funds for this payment.
140
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Payee
141
- */
142
- public function getPayee()
143
- {
144
- return $this->payee;
145
- }
146
-
147
- /**
148
- * ID of the cart to execute the payment.
149
- * @deprecated Not publicly available
150
- * @param string $cart
151
- *
152
- * @return $this
153
- */
154
- public function setCart($cart)
155
- {
156
- $this->cart = $cart;
157
- return $this;
158
- }
159
-
160
- /**
161
- * ID of the cart to execute the payment.
162
- * @deprecated Not publicly available
163
- * @return string
164
- */
165
- public function getCart()
166
- {
167
- return $this->cart;
168
- }
169
-
170
- /**
171
- * Transactional details including the amount and item details.
172
- *
173
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Transaction[] $transactions
174
- *
175
- * @return $this
176
- */
177
- public function setTransactions($transactions)
178
- {
179
- $this->transactions = $transactions;
180
- return $this;
181
- }
182
-
183
- /**
184
- * Transactional details including the amount and item details.
185
- *
186
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Transaction[]
187
- */
188
- public function getTransactions()
189
- {
190
- return $this->transactions;
191
- }
192
-
193
- /**
194
- * Append Transactions to the list.
195
- *
196
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Transaction $transaction
197
- * @return $this
198
- */
199
- public function addTransaction($transaction)
200
- {
201
- if (!$this->getTransactions()) {
202
- return $this->setTransactions(array($transaction));
203
- } else {
204
- return $this->setTransactions(
205
- array_merge($this->getTransactions(), array($transaction))
206
- );
207
- }
208
- }
209
-
210
- /**
211
- * Remove Transactions from the list.
212
- *
213
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Transaction $transaction
214
- * @return $this
215
- */
216
- public function removeTransaction($transaction)
217
- {
218
- return $this->setTransactions(
219
- array_diff($this->getTransactions(), array($transaction))
220
- );
221
- }
222
-
223
- /**
224
- * Applicable for advanced payments like multi seller payment (MSP) to support partial failures
225
- * @deprecated Not publicly available
226
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Error[] $failed_transactions
227
- *
228
- * @return $this
229
- */
230
- public function setFailedTransactions($failed_transactions)
231
- {
232
- $this->failed_transactions = $failed_transactions;
233
- return $this;
234
- }
235
-
236
- /**
237
- * Applicable for advanced payments like multi seller payment (MSP) to support partial failures
238
- * @deprecated Not publicly available
239
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Error[]
240
- */
241
- public function getFailedTransactions()
242
- {
243
- return $this->failed_transactions;
244
- }
245
-
246
- /**
247
- * Append FailedTransactions to the list.
248
- * @deprecated Not publicly available
249
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Error $error
250
- * @return $this
251
- */
252
- public function addFailedTransaction($error)
253
- {
254
- if (!$this->getFailedTransactions()) {
255
- return $this->setFailedTransactions(array($error));
256
- } else {
257
- return $this->setFailedTransactions(
258
- array_merge($this->getFailedTransactions(), array($error))
259
- );
260
- }
261
- }
262
-
263
- /**
264
- * Remove FailedTransactions from the list.
265
- * @deprecated Not publicly available
266
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Error $error
267
- * @return $this
268
- */
269
- public function removeFailedTransaction($error)
270
- {
271
- return $this->setFailedTransactions(
272
- array_diff($this->getFailedTransactions(), array($error))
273
- );
274
- }
275
-
276
- /**
277
- * Collection of PayPal generated billing agreement tokens.
278
- * @deprecated Not publicly available
279
- * @param string[] $billing_agreement_tokens
280
- *
281
- * @return $this
282
- */
283
- public function setBillingAgreementTokens($billing_agreement_tokens)
284
- {
285
- $this->billing_agreement_tokens = $billing_agreement_tokens;
286
- return $this;
287
- }
288
-
289
- /**
290
- * Collection of PayPal generated billing agreement tokens.
291
- * @deprecated Not publicly available
292
- * @return string[]
293
- */
294
- public function getBillingAgreementTokens()
295
- {
296
- return $this->billing_agreement_tokens;
297
- }
298
-
299
- /**
300
- * Append BillingAgreementTokens to the list.
301
- * @deprecated Not publicly available
302
- * @param string $billingAgreementToken
303
- * @return $this
304
- */
305
- public function addBillingAgreementToken($billingAgreementToken)
306
- {
307
- if (!$this->getBillingAgreementTokens()) {
308
- return $this->setBillingAgreementTokens(array($billingAgreementToken));
309
- } else {
310
- return $this->setBillingAgreementTokens(
311
- array_merge($this->getBillingAgreementTokens(), array($billingAgreementToken))
312
- );
313
- }
314
- }
315
-
316
- /**
317
- * Remove BillingAgreementTokens from the list.
318
- * @deprecated Not publicly available
319
- * @param string $billingAgreementToken
320
- * @return $this
321
- */
322
- public function removeBillingAgreementToken($billingAgreementToken)
323
- {
324
- return $this->setBillingAgreementTokens(
325
- array_diff($this->getBillingAgreementTokens(), array($billingAgreementToken))
326
- );
327
- }
328
-
329
- /**
330
- * Credit financing offered to payer on PayPal side. Returned in payment after payer opts-in
331
- * @deprecated Not publicly available
332
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\CreditFinancingOffered $credit_financing_offered
333
- *
334
- * @return $this
335
- */
336
- public function setCreditFinancingOffered($credit_financing_offered)
337
- {
338
- $this->credit_financing_offered = $credit_financing_offered;
339
- return $this;
340
- }
341
-
342
- /**
343
- * Credit financing offered to payer on PayPal side. Returned in payment after payer opts-in
344
- * @deprecated Not publicly available
345
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\CreditFinancingOffered
346
- */
347
- public function getCreditFinancingOffered()
348
- {
349
- return $this->credit_financing_offered;
350
- }
351
-
352
- /**
353
- * Instructions for the payer to complete this payment.
354
- * @deprecated Not publicly available
355
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\PaymentInstruction $payment_instruction
356
- *
357
- * @return $this
358
- */
359
- public function setPaymentInstruction($payment_instruction)
360
- {
361
- $this->payment_instruction = $payment_instruction;
362
- return $this;
363
- }
364
-
365
- /**
366
- * Instructions for the payer to complete this payment.
367
- * @deprecated Not publicly available
368
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\PaymentInstruction
369
- */
370
- public function getPaymentInstruction()
371
- {
372
- return $this->payment_instruction;
373
- }
374
-
375
- /**
376
- * The state of the payment, authorization, or order transaction. The value is:<ul><li><code>created</code>. The transaction was successfully created.</li><li><code>approved</code>. The buyer approved the transaction.</li><li><code>failed</code>. The transaction request failed.</li></ul>
377
- * Valid Values: ["created", "approved", "failed", "partially_completed", "in_progress"]
378
- *
379
- * @param string $state
380
- *
381
- * @return $this
382
- */
383
- public function setState($state)
384
- {
385
- $this->state = $state;
386
- return $this;
387
- }
388
-
389
- /**
390
- * The state of the payment, authorization, or order transaction. The value is:<ul><li><code>created</code>. The transaction was successfully created.</li><li><code>approved</code>. The buyer approved the transaction.</li><li><code>failed</code>. The transaction request failed.</li></ul>
391
- *
392
- * @return string
393
- */
394
- public function getState()
395
- {
396
- return $this->state;
397
- }
398
-
399
- /**
400
- * PayPal generated identifier for the merchant's payment experience profile. Refer to [this](https://developer.paypal.com/docs/api/#payment-experience) link to create experience profile ID.
401
- *
402
- * @param string $experience_profile_id
403
- *
404
- * @return $this
405
- */
406
- public function setExperienceProfileId($experience_profile_id)
407
- {
408
- $this->experience_profile_id = $experience_profile_id;
409
- return $this;
410
- }
411
-
412
- /**
413
- * PayPal generated identifier for the merchant's payment experience profile. Refer to [this](https://developer.paypal.com/docs/api/#payment-experience) link to create experience profile ID.
414
- *
415
- * @return string
416
- */
417
- public function getExperienceProfileId()
418
- {
419
- return $this->experience_profile_id;
420
- }
421
-
422
- /**
423
- * free-form field for the use of clients to pass in a message to the payer
424
- *
425
- * @param string $note_to_payer
426
- *
427
- * @return $this
428
- */
429
- public function setNoteToPayer($note_to_payer)
430
- {
431
- $this->note_to_payer = $note_to_payer;
432
- return $this;
433
- }
434
-
435
- /**
436
- * free-form field for the use of clients to pass in a message to the payer
437
- *
438
- * @return string
439
- */
440
- public function getNoteToPayer()
441
- {
442
- return $this->note_to_payer;
443
- }
444
-
445
- /**
446
- * Set of redirect URLs you provide only for PayPal-based payments.
447
- *
448
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\RedirectUrls $redirect_urls
449
- *
450
- * @return $this
451
- */
452
- public function setRedirectUrls($redirect_urls)
453
- {
454
- $this->redirect_urls = $redirect_urls;
455
- return $this;
456
- }
457
-
458
- /**
459
- * Set of redirect URLs you provide only for PayPal-based payments.
460
- *
461
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\RedirectUrls
462
- */
463
- public function getRedirectUrls()
464
- {
465
- return $this->redirect_urls;
466
- }
467
-
468
- /**
469
- * Failure reason code returned when the payment failed for some valid reasons.
470
- * Valid Values: ["UNABLE_TO_COMPLETE_TRANSACTION", "INVALID_PAYMENT_METHOD", "PAYER_CANNOT_PAY", "CANNOT_PAY_THIS_PAYEE", "REDIRECT_REQUIRED", "PAYEE_FILTER_RESTRICTIONS"]
471
- *
472
- * @param string $failure_reason
473
- *
474
- * @return $this
475
- */
476
- public function setFailureReason($failure_reason)
477
- {
478
- $this->failure_reason = $failure_reason;
479
- return $this;
480
- }
481
-
482
- /**
483
- * Failure reason code returned when the payment failed for some valid reasons.
484
- *
485
- * @return string
486
- */
487
- public function getFailureReason()
488
- {
489
- return $this->failure_reason;
490
- }
491
-
492
- /**
493
- * Payment creation time as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
494
- *
495
- * @param string $create_time
496
- *
497
- * @return $this
498
- */
499
- public function setCreateTime($create_time)
500
- {
501
- $this->create_time = $create_time;
502
- return $this;
503
- }
504
-
505
- /**
506
- * Payment creation time as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
507
- *
508
- * @return string
509
- */
510
- public function getCreateTime()
511
- {
512
- return $this->create_time;
513
- }
514
-
515
- /**
516
- * Payment update time as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
517
- *
518
- * @param string $update_time
519
- *
520
- * @return $this
521
- */
522
- public function setUpdateTime($update_time)
523
- {
524
- $this->update_time = $update_time;
525
- return $this;
526
- }
527
-
528
- /**
529
- * Payment update time as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
530
- *
531
- * @return string
532
- */
533
- public function getUpdateTime()
534
- {
535
- return $this->update_time;
536
- }
537
-
538
- /**
539
- * Get Approval Link
540
- *
541
- * @return null|string
542
- */
543
- public function getApprovalLink()
544
- {
545
- return $this->getLink(PayPalConstants::APPROVAL_URL);
546
- }
547
-
548
- /**
549
- * Get token from Approval Link
550
- *
551
- * @return null|string
552
- */
553
- public function getToken()
554
- {
555
- $parameter_name = "token";
556
- parse_str(parse_url($this->getApprovalLink(), PHP_URL_QUERY), $query);
557
- return !isset($query[$parameter_name]) ? null : $query[$parameter_name];
558
- }
559
-
560
- /**
561
- * Creates and processes a payment. In the JSON request body, include a `payment` object with the intent, payer, and transactions. For PayPal payments, include redirect URLs in the `payment` object.
562
- *
563
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
564
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
565
- * @return Payment
566
- */
567
- public function create($apiContext = null, $restCall = null)
568
- {
569
- $payLoad = $this->toJSON();
570
- $json = self::executeCall(
571
- "/v1/payments/payment",
572
- "POST",
573
- $payLoad,
574
- null,
575
- $apiContext,
576
- $restCall
577
- );
578
- $this->fromJson($json);
579
- return $this;
580
- }
581
-
582
- /**
583
- * Shows details for a payment, by ID.
584
- *
585
- * @param string $paymentId
586
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
587
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
588
- * @return Payment
589
- */
590
- public static function get($paymentId, $apiContext = null, $restCall = null)
591
- {
592
- ArgumentValidator::validate($paymentId, 'paymentId');
593
- $payLoad = "";
594
- $json = self::executeCall(
595
- "/v1/payments/payment/$paymentId",
596
- "GET",
597
- $payLoad,
598
- null,
599
- $apiContext,
600
- $restCall
601
- );
602
- $ret = new Payment();
603
- $ret->fromJson($json);
604
- return $ret;
605
- }
606
-
607
- /**
608
- * Partially updates a payment, by ID. You can update the amount, shipping address, invoice ID, and custom data. You cannot use patch after execute has been called.
609
- *
610
- * @param PatchRequest $patchRequest
611
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
612
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
613
- * @return boolean
614
- */
615
- public function update($patchRequest, $apiContext = null, $restCall = null)
616
- {
617
- ArgumentValidator::validate($this->getId(), "Id");
618
- ArgumentValidator::validate($patchRequest, 'patchRequest');
619
- $payLoad = $patchRequest->toJSON();
620
- self::executeCall(
621
- "/v1/payments/payment/{$this->getId()}",
622
- "PATCH",
623
- $payLoad,
624
- null,
625
- $apiContext,
626
- $restCall
627
- );
628
- return true;
629
- }
630
-
631
- /**
632
- * Executes, or completes, a PayPal payment that the payer has approved. You can optionally update selective payment information when you execute a payment.
633
- *
634
- * @param PaymentExecution $paymentExecution
635
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
636
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
637
- * @return Payment
638
- */
639
- public function execute($paymentExecution, $apiContext = null, $restCall = null)
640
- {
641
- ArgumentValidator::validate($this->getId(), "Id");
642
- ArgumentValidator::validate($paymentExecution, 'paymentExecution');
643
- $payLoad = $paymentExecution->toJSON();
644
- $json = self::executeCall(
645
- "/v1/payments/payment/{$this->getId()}/execute",
646
- "POST",
647
- $payLoad,
648
- null,
649
- $apiContext,
650
- $restCall
651
- );
652
- $this->fromJson($json);
653
- return $this;
654
- }
655
-
656
- /**
657
- * List payments that were made to the merchant who issues the request. Payments can be in any state.
658
- *
659
- * @param array $params
660
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
661
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
662
- * @return PaymentHistory
663
- */
664
- public static function all($params, $apiContext = null, $restCall = null)
665
- {
666
- ArgumentValidator::validate($params, 'params');
667
- $payLoad = "";
668
- $allowedParams = array(
669
- 'count' => 1,
670
- 'start_id' => 1,
671
- 'start_index' => 1,
672
- 'start_time' => 1,
673
- 'end_time' => 1,
674
- 'payee_id' => 1,
675
- 'sort_by' => 1,
676
- 'sort_order' => 1,
677
- );
678
- $json = self::executeCall(
679
- "/v1/payments/payment?" . http_build_query(array_intersect_key($params, $allowedParams)),
680
- "GET",
681
- $payLoad,
682
- null,
683
- $apiContext,
684
- $restCall
685
- );
686
- $ret = new PaymentHistory();
687
- $ret->fromJson($json);
688
- return $ret;
689
- }
690
-
691
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/PaymentCard.php DELETED
@@ -1,482 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class PaymentCard
9
- *
10
- * A payment card that can fund a payment.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property string id
15
- * @property string number
16
- * @property string type
17
- * @property string expire_month
18
- * @property string expire_year
19
- * @property string start_month
20
- * @property string start_year
21
- * @property string cvv2
22
- * @property string first_name
23
- * @property string last_name
24
- * @property string billing_country
25
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Address billing_address
26
- * @property string external_customer_id
27
- * @property string status
28
- * @property string card_product_class
29
- * @property string valid_until
30
- * @property string issue_number
31
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links[] links
32
- */
33
- class PaymentCard extends PayPalModel
34
- {
35
- /**
36
- * The ID of a credit card to save for later use.
37
- *
38
- * @param string $id
39
- *
40
- * @return $this
41
- */
42
- public function setId($id)
43
- {
44
- $this->id = $id;
45
- return $this;
46
- }
47
-
48
- /**
49
- * The ID of a credit card to save for later use.
50
- *
51
- * @return string
52
- */
53
- public function getId()
54
- {
55
- return $this->id;
56
- }
57
-
58
- /**
59
- * The card number.
60
- *
61
- * @param string $number
62
- *
63
- * @return $this
64
- */
65
- public function setNumber($number)
66
- {
67
- $this->number = $number;
68
- return $this;
69
- }
70
-
71
- /**
72
- * The card number.
73
- *
74
- * @return string
75
- */
76
- public function getNumber()
77
- {
78
- return $this->number;
79
- }
80
-
81
- /**
82
- * The card type.
83
- * Valid Values: ["VISA", "AMEX", "SOLO", "JCB", "STAR", "DELTA", "DISCOVER", "SWITCH", "MAESTRO", "CB_NATIONALE", "CONFINOGA", "COFIDIS", "ELECTRON", "CETELEM", "CHINA_UNION_PAY", "MASTERCARD"]
84
- *
85
- * @param string $type
86
- *
87
- * @return $this
88
- */
89
- public function setType($type)
90
- {
91
- $this->type = $type;
92
- return $this;
93
- }
94
-
95
- /**
96
- * The card type.
97
- *
98
- * @return string
99
- */
100
- public function getType()
101
- {
102
- return $this->type;
103
- }
104
-
105
- /**
106
- * The two-digit expiry month for the card.
107
- *
108
- * @param string $expire_month
109
- *
110
- * @return $this
111
- */
112
- public function setExpireMonth($expire_month)
113
- {
114
- $this->expire_month = $expire_month;
115
- return $this;
116
- }
117
-
118
- /**
119
- * The two-digit expiry month for the card.
120
- *
121
- * @return string
122
- */
123
- public function getExpireMonth()
124
- {
125
- return $this->expire_month;
126
- }
127
-
128
- /**
129
- * The four-digit expiry year for the card.
130
- *
131
- * @param string $expire_year
132
- *
133
- * @return $this
134
- */
135
- public function setExpireYear($expire_year)
136
- {
137
- $this->expire_year = $expire_year;
138
- return $this;
139
- }
140
-
141
- /**
142
- * The four-digit expiry year for the card.
143
- *
144
- * @return string
145
- */
146
- public function getExpireYear()
147
- {
148
- return $this->expire_year;
149
- }
150
-
151
- /**
152
- * The two-digit start month for the card. Required for UK Maestro cards.
153
- *
154
- * @param string $start_month
155
- *
156
- * @return $this
157
- */
158
- public function setStartMonth($start_month)
159
- {
160
- $this->start_month = $start_month;
161
- return $this;
162
- }
163
-
164
- /**
165
- * The two-digit start month for the card. Required for UK Maestro cards.
166
- *
167
- * @return string
168
- */
169
- public function getStartMonth()
170
- {
171
- return $this->start_month;
172
- }
173
-
174
- /**
175
- * The four-digit start year for the card. Required for UK Maestro cards.
176
- *
177
- * @param string $start_year
178
- *
179
- * @return $this
180
- */
181
- public function setStartYear($start_year)
182
- {
183
- $this->start_year = $start_year;
184
- return $this;
185
- }
186
-
187
- /**
188
- * The four-digit start year for the card. Required for UK Maestro cards.
189
- *
190
- * @return string
191
- */
192
- public function getStartYear()
193
- {
194
- return $this->start_year;
195
- }
196
-
197
- /**
198
- * The validation code for the card. Supported for payments but not for saving payment cards for future use.
199
- *
200
- * @param string $cvv2
201
- *
202
- * @return $this
203
- */
204
- public function setCvv2($cvv2)
205
- {
206
- $this->cvv2 = $cvv2;
207
- return $this;
208
- }
209
-
210
- /**
211
- * The validation code for the card. Supported for payments but not for saving payment cards for future use.
212
- *
213
- * @return string
214
- */
215
- public function getCvv2()
216
- {
217
- return $this->cvv2;
218
- }
219
-
220
- /**
221
- * The first name of the card holder.
222
- *
223
- * @param string $first_name
224
- *
225
- * @return $this
226
- */
227
- public function setFirstName($first_name)
228
- {
229
- $this->first_name = $first_name;
230
- return $this;
231
- }
232
-
233
- /**
234
- * The first name of the card holder.
235
- *
236
- * @return string
237
- */
238
- public function getFirstName()
239
- {
240
- return $this->first_name;
241
- }
242
-
243
- /**
244
- * The last name of the card holder.
245
- *
246
- * @param string $last_name
247
- *
248
- * @return $this
249
- */
250
- public function setLastName($last_name)
251
- {
252
- $this->last_name = $last_name;
253
- return $this;
254
- }
255
-
256
- /**
257
- * The last name of the card holder.
258
- *
259
- * @return string
260
- */
261
- public function getLastName()
262
- {
263
- return $this->last_name;
264
- }
265
-
266
- /**
267
- * The two-letter country code.
268
- *
269
- * @param string $billing_country
270
- *
271
- * @return $this
272
- */
273
- public function setBillingCountry($billing_country)
274
- {
275
- $this->billing_country = $billing_country;
276
- return $this;
277
- }
278
-
279
- /**
280
- * The two-letter country code.
281
- *
282
- * @return string
283
- */
284
- public function getBillingCountry()
285
- {
286
- return $this->billing_country;
287
- }
288
-
289
- /**
290
- * The billing address for the card.
291
- *
292
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Address $billing_address
293
- *
294
- * @return $this
295
- */
296
- public function setBillingAddress($billing_address)
297
- {
298
- $this->billing_address = $billing_address;
299
- return $this;
300
- }
301
-
302
- /**
303
- * The billing address for the card.
304
- *
305
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Address
306
- */
307
- public function getBillingAddress()
308
- {
309
- return $this->billing_address;
310
- }
311
-
312
- /**
313
- * The ID of the customer who owns this card account. The facilitator generates and provides this ID. Required when you create or use a stored funding instrument in the PayPal vault.
314
- *
315
- * @param string $external_customer_id
316
- *
317
- * @return $this
318
- */
319
- public function setExternalCustomerId($external_customer_id)
320
- {
321
- $this->external_customer_id = $external_customer_id;
322
- return $this;
323
- }
324
-
325
- /**
326
- * The ID of the customer who owns this card account. The facilitator generates and provides this ID. Required when you create or use a stored funding instrument in the PayPal vault.
327
- *
328
- * @return string
329
- */
330
- public function getExternalCustomerId()
331
- {
332
- return $this->external_customer_id;
333
- }
334
-
335
- /**
336
- * The state of the funding instrument.
337
- * Valid Values: ["EXPIRED", "ACTIVE"]
338
- *
339
- * @param string $status
340
- *
341
- * @return $this
342
- */
343
- public function setStatus($status)
344
- {
345
- $this->status = $status;
346
- return $this;
347
- }
348
-
349
- /**
350
- * The state of the funding instrument.
351
- *
352
- * @return string
353
- */
354
- public function getStatus()
355
- {
356
- return $this->status;
357
- }
358
-
359
- /**
360
- * The product class of the financial instrument issuer.
361
- * Valid Values: ["CREDIT", "DEBIT", "GIFT", "PAYPAL_PREPAID", "PREPAID", "UNKNOWN"]
362
- *
363
- * @param string $card_product_class
364
- *
365
- * @return $this
366
- */
367
- public function setCardProductClass($card_product_class)
368
- {
369
- $this->card_product_class = $card_product_class;
370
- return $this;
371
- }
372
-
373
- /**
374
- * The product class of the financial instrument issuer.
375
- *
376
- * @return string
377
- */
378
- public function getCardProductClass()
379
- {
380
- return $this->card_product_class;
381
- }
382
-
383
- /**
384
- * The date and time until when this instrument can be used fund a payment.
385
- *
386
- * @param string $valid_until
387
- *
388
- * @return $this
389
- */
390
- public function setValidUntil($valid_until)
391
- {
392
- $this->valid_until = $valid_until;
393
- return $this;
394
- }
395
-
396
- /**
397
- * The date and time until when this instrument can be used fund a payment.
398
- *
399
- * @return string
400
- */
401
- public function getValidUntil()
402
- {
403
- return $this->valid_until;
404
- }
405
-
406
- /**
407
- * The one- to two-digit card issue number. Required for UK Maestro cards.
408
- *
409
- * @param string $issue_number
410
- *
411
- * @return $this
412
- */
413
- public function setIssueNumber($issue_number)
414
- {
415
- $this->issue_number = $issue_number;
416
- return $this;
417
- }
418
-
419
- /**
420
- * The one- to two-digit card issue number. Required for UK Maestro cards.
421
- *
422
- * @return string
423
- */
424
- public function getIssueNumber()
425
- {
426
- return $this->issue_number;
427
- }
428
-
429
- /**
430
- * Sets Links
431
- *
432
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links[] $links
433
- *
434
- * @return $this
435
- */
436
- public function setLinks($links)
437
- {
438
- $this->links = $links;
439
- return $this;
440
- }
441
-
442
- /**
443
- * Gets Links
444
- *
445
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links[]
446
- */
447
- public function getLinks()
448
- {
449
- return $this->links;
450
- }
451
-
452
- /**
453
- * Append Links to the list.
454
- *
455
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links $links
456
- * @return $this
457
- */
458
- public function addLink($links)
459
- {
460
- if (!$this->getLinks()) {
461
- return $this->setLinks(array($links));
462
- } else {
463
- return $this->setLinks(
464
- array_merge($this->getLinks(), array($links))
465
- );
466
- }
467
- }
468
-
469
- /**
470
- * Remove Links from the list.
471
- *
472
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links $links
473
- * @return $this
474
- */
475
- public function removeLink($links)
476
- {
477
- return $this->setLinks(
478
- array_diff($this->getLinks(), array($links))
479
- );
480
- }
481
-
482
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/PaymentCardToken.php DELETED
@@ -1,162 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class PaymentCardToken
9
- *
10
- * A resource representing a payment card that can be used to fund a payment.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property string payment_card_id
15
- * @property string external_customer_id
16
- * @property string last4
17
- * @property string type
18
- * @property int expire_month
19
- * @property int expire_year
20
- */
21
- class PaymentCardToken extends PayPalModel
22
- {
23
- /**
24
- * ID of a previously saved Payment Card resource.
25
- *
26
- * @param string $payment_card_id
27
- *
28
- * @return $this
29
- */
30
- public function setPaymentCardId($payment_card_id)
31
- {
32
- $this->payment_card_id = $payment_card_id;
33
- return $this;
34
- }
35
-
36
- /**
37
- * ID of a previously saved Payment Card resource.
38
- *
39
- * @return string
40
- */
41
- public function getPaymentCardId()
42
- {
43
- return $this->payment_card_id;
44
- }
45
-
46
- /**
47
- * The unique identifier of the payer used when saving this payment card.
48
- *
49
- * @param string $external_customer_id
50
- *
51
- * @return $this
52
- */
53
- public function setExternalCustomerId($external_customer_id)
54
- {
55
- $this->external_customer_id = $external_customer_id;
56
- return $this;
57
- }
58
-
59
- /**
60
- * The unique identifier of the payer used when saving this payment card.
61
- *
62
- * @return string
63
- */
64
- public function getExternalCustomerId()
65
- {
66
- return $this->external_customer_id;
67
- }
68
-
69
- /**
70
- * Last 4 digits of the card number from the saved card.
71
- *
72
- * @param string $last4
73
- *
74
- * @return $this
75
- */
76
- public function setLast4($last4)
77
- {
78
- $this->last4 = $last4;
79
- return $this;
80
- }
81
-
82
- /**
83
- * Last 4 digits of the card number from the saved card.
84
- *
85
- * @return string
86
- */
87
- public function getLast4()
88
- {
89
- return $this->last4;
90
- }
91
-
92
- /**
93
- * Type of the Card.
94
- * Valid Values: ["VISA", "AMEX", "SOLO", "JCB", "STAR", "DELTA", "DISCOVER", "SWITCH", "MAESTRO", "CB_NATIONALE", "CONFINOGA", "COFIDIS", "ELECTRON", "CETELEM", "CHINA_UNION_PAY", "MASTERCARD"]
95
- *
96
- * @param string $type
97
- *
98
- * @return $this
99
- */
100
- public function setType($type)
101
- {
102
- $this->type = $type;
103
- return $this;
104
- }
105
-
106
- /**
107
- * Type of the Card.
108
- *
109
- * @return string
110
- */
111
- public function getType()
112
- {
113
- return $this->type;
114
- }
115
-
116
- /**
117
- * Expiry month from the saved card with value 1 - 12.
118
- *
119
- * @param int $expire_month
120
- *
121
- * @return $this
122
- */
123
- public function setExpireMonth($expire_month)
124
- {
125
- $this->expire_month = $expire_month;
126
- return $this;
127
- }
128
-
129
- /**
130
- * Expiry month from the saved card with value 1 - 12.
131
- *
132
- * @return int
133
- */
134
- public function getExpireMonth()
135
- {
136
- return $this->expire_month;
137
- }
138
-
139
- /**
140
- * Four digit expiry year from the saved card, represented as YYYY format.
141
- *
142
- * @param int $expire_year
143
- *
144
- * @return $this
145
- */
146
- public function setExpireYear($expire_year)
147
- {
148
- $this->expire_year = $expire_year;
149
- return $this;
150
- }
151
-
152
- /**
153
- * Four digit expiry year from the saved card, represented as YYYY format.
154
- *
155
- * @return int
156
- */
157
- public function getExpireYear()
158
- {
159
- return $this->expire_year;
160
- }
161
-
162
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/PaymentDefinition.php DELETED
@@ -1,239 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class PaymentDefinition
9
- *
10
- * Resource representing payment definition scheduling information.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property string id
15
- * @property string name
16
- * @property string type
17
- * @property string frequency_interval
18
- * @property string frequency
19
- * @property string cycles
20
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency amount
21
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\ChargeModel[] charge_models
22
- */
23
- class PaymentDefinition extends PayPalModel
24
- {
25
- /**
26
- * Identifier of the payment_definition. 128 characters max.
27
- *
28
- * @param string $id
29
- *
30
- * @return $this
31
- */
32
- public function setId($id)
33
- {
34
- $this->id = $id;
35
- return $this;
36
- }
37
-
38
- /**
39
- * Identifier of the payment_definition. 128 characters max.
40
- *
41
- * @return string
42
- */
43
- public function getId()
44
- {
45
- return $this->id;
46
- }
47
-
48
- /**
49
- * Name of the payment definition. 128 characters max.
50
- *
51
- * @param string $name
52
- *
53
- * @return $this
54
- */
55
- public function setName($name)
56
- {
57
- $this->name = $name;
58
- return $this;
59
- }
60
-
61
- /**
62
- * Name of the payment definition. 128 characters max.
63
- *
64
- * @return string
65
- */
66
- public function getName()
67
- {
68
- return $this->name;
69
- }
70
-
71
- /**
72
- * Type of the payment definition. Allowed values: `TRIAL`, `REGULAR`.
73
- *
74
- * @param string $type
75
- *
76
- * @return $this
77
- */
78
- public function setType($type)
79
- {
80
- $this->type = $type;
81
- return $this;
82
- }
83
-
84
- /**
85
- * Type of the payment definition. Allowed values: `TRIAL`, `REGULAR`.
86
- *
87
- * @return string
88
- */
89
- public function getType()
90
- {
91
- return $this->type;
92
- }
93
-
94
- /**
95
- * How frequently the customer should be charged.
96
- *
97
- * @param string $frequency_interval
98
- *
99
- * @return $this
100
- */
101
- public function setFrequencyInterval($frequency_interval)
102
- {
103
- $this->frequency_interval = $frequency_interval;
104
- return $this;
105
- }
106
-
107
- /**
108
- * How frequently the customer should be charged.
109
- *
110
- * @return string
111
- */
112
- public function getFrequencyInterval()
113
- {
114
- return $this->frequency_interval;
115
- }
116
-
117
- /**
118
- * Frequency of the payment definition offered. Allowed values: `WEEK`, `DAY`, `YEAR`, `MONTH`.
119
- *
120
- * @param string $frequency
121
- *
122
- * @return $this
123
- */
124
- public function setFrequency($frequency)
125
- {
126
- $this->frequency = $frequency;
127
- return $this;
128
- }
129
-
130
- /**
131
- * Frequency of the payment definition offered. Allowed values: `WEEK`, `DAY`, `YEAR`, `MONTH`.
132
- *
133
- * @return string
134
- */
135
- public function getFrequency()
136
- {
137
- return $this->frequency;
138
- }
139
-
140
- /**
141
- * Number of cycles in this payment definition.
142
- *
143
- * @param string $cycles
144
- *
145
- * @return $this
146
- */
147
- public function setCycles($cycles)
148
- {
149
- $this->cycles = $cycles;
150
- return $this;
151
- }
152
-
153
- /**
154
- * Number of cycles in this payment definition.
155
- *
156
- * @return string
157
- */
158
- public function getCycles()
159
- {
160
- return $this->cycles;
161
- }
162
-
163
- /**
164
- * Amount that will be charged at the end of each cycle for this payment definition.
165
- *
166
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency $amount
167
- *
168
- * @return $this
169
- */
170
- public function setAmount($amount)
171
- {
172
- $this->amount = $amount;
173
- return $this;
174
- }
175
-
176
- /**
177
- * Amount that will be charged at the end of each cycle for this payment definition.
178
- *
179
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency
180
- */
181
- public function getAmount()
182
- {
183
- return $this->amount;
184
- }
185
-
186
- /**
187
- * Array of charge_models for this payment definition.
188
- *
189
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\ChargeModel[] $charge_models
190
- *
191
- * @return $this
192
- */
193
- public function setChargeModels($charge_models)
194
- {
195
- $this->charge_models = $charge_models;
196
- return $this;
197
- }
198
-
199
- /**
200
- * Array of charge_models for this payment definition.
201
- *
202
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\ChargeModel[]
203
- */
204
- public function getChargeModels()
205
- {
206
- return $this->charge_models;
207
- }
208
-
209
- /**
210
- * Append ChargeModels to the list.
211
- *
212
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\ChargeModel $chargeModel
213
- * @return $this
214
- */
215
- public function addChargeModel($chargeModel)
216
- {
217
- if (!$this->getChargeModels()) {
218
- return $this->setChargeModels(array($chargeModel));
219
- } else {
220
- return $this->setChargeModels(
221
- array_merge($this->getChargeModels(), array($chargeModel))
222
- );
223
- }
224
- }
225
-
226
- /**
227
- * Remove ChargeModels from the list.
228
- *
229
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\ChargeModel $chargeModel
230
- * @return $this
231
- */
232
- public function removeChargeModel($chargeModel)
233
- {
234
- return $this->setChargeModels(
235
- array_diff($this->getChargeModels(), array($chargeModel))
236
- );
237
- }
238
-
239
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/PaymentDetail.php DELETED
@@ -1,188 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class PaymentDetail
9
- *
10
- * Invoicing payment information.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property string type
15
- * @property string transaction_id
16
- * @property string transaction_type
17
- * @property string date
18
- * @property string method
19
- * @property string note
20
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency amount
21
- */
22
- class PaymentDetail extends PayPalModel
23
- {
24
- /**
25
- * The PayPal payment detail. Indicates whether payment was made in an invoicing flow through PayPal or externally. In the case of the mark-as-paid API, the supported payment type is `EXTERNAL`. For backward compatibility, the `PAYPAL` payment type is still supported.
26
- * Valid Values: ["PAYPAL", "EXTERNAL"]
27
- *
28
- * @param string $type
29
- *
30
- * @return $this
31
- */
32
- public function setType($type)
33
- {
34
- $this->type = $type;
35
- return $this;
36
- }
37
-
38
- /**
39
- * The PayPal payment detail. Indicates whether payment was made in an invoicing flow through PayPal or externally. In the case of the mark-as-paid API, the supported payment type is `EXTERNAL`. For backward compatibility, the `PAYPAL` payment type is still supported.
40
- *
41
- * @return string
42
- */
43
- public function getType()
44
- {
45
- return $this->type;
46
- }
47
-
48
- /**
49
- * The PayPal payment transaction ID. Required with the `PAYPAL` payment type.
50
- *
51
- * @param string $transaction_id
52
- *
53
- * @return $this
54
- */
55
- public function setTransactionId($transaction_id)
56
- {
57
- $this->transaction_id = $transaction_id;
58
- return $this;
59
- }
60
-
61
- /**
62
- * The PayPal payment transaction ID. Required with the `PAYPAL` payment type.
63
- *
64
- * @return string
65
- */
66
- public function getTransactionId()
67
- {
68
- return $this->transaction_id;
69
- }
70
-
71
- /**
72
- * Type of the transaction.
73
- * Valid Values: ["SALE", "AUTHORIZATION", "CAPTURE"]
74
- *
75
- * @param string $transaction_type
76
- *
77
- * @return $this
78
- */
79
- public function setTransactionType($transaction_type)
80
- {
81
- $this->transaction_type = $transaction_type;
82
- return $this;
83
- }
84
-
85
- /**
86
- * Type of the transaction.
87
- *
88
- * @return string
89
- */
90
- public function getTransactionType()
91
- {
92
- return $this->transaction_type;
93
- }
94
-
95
- /**
96
- * The date when the invoice was paid. The date format is *yyyy*-*MM*-*dd* *z* as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6).
97
- *
98
- * @param string $date
99
- *
100
- * @return $this
101
- */
102
- public function setDate($date)
103
- {
104
- $this->date = $date;
105
- return $this;
106
- }
107
-
108
- /**
109
- * The date when the invoice was paid. The date format is *yyyy*-*MM*-*dd* *z* as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6).
110
- *
111
- * @return string
112
- */
113
- public function getDate()
114
- {
115
- return $this->date;
116
- }
117
-
118
- /**
119
- * The payment mode or method. Required with the `EXTERNAL` payment type.
120
- * Valid Values: ["BANK_TRANSFER", "CASH", "CHECK", "CREDIT_CARD", "DEBIT_CARD", "PAYPAL", "WIRE_TRANSFER", "OTHER"]
121
- *
122
- * @param string $method
123
- *
124
- * @return $this
125
- */
126
- public function setMethod($method)
127
- {
128
- $this->method = $method;
129
- return $this;
130
- }
131
-
132
- /**
133
- * The payment mode or method. Required with the `EXTERNAL` payment type.
134
- *
135
- * @return string
136
- */
137
- public function getMethod()
138
- {
139
- return $this->method;
140
- }
141
-
142
- /**
143
- * Optional. A note associated with the payment.
144
- *
145
- * @param string $note
146
- *
147
- * @return $this
148
- */
149
- public function setNote($note)
150
- {
151
- $this->note = $note;
152
- return $this;
153
- }
154
-
155
- /**
156
- * Optional. A note associated with the payment.
157
- *
158
- * @return string
159
- */
160
- public function getNote()
161
- {
162
- return $this->note;
163
- }
164
-
165
- /**
166
- * The amount to record as payment against invoice. If you omit this parameter, the total invoice amount is recorded as payment.
167
- *
168
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency $amount
169
- *
170
- * @return $this
171
- */
172
- public function setAmount($amount)
173
- {
174
- $this->amount = $amount;
175
- return $this;
176
- }
177
-
178
- /**
179
- * The amount to record as payment against invoice. If you omit this parameter, the total invoice amount is recorded as payment.
180
- *
181
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency
182
- */
183
- public function getAmount()
184
- {
185
- return $this->amount;
186
- }
187
-
188
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/PaymentExecution.php DELETED
@@ -1,118 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class PaymentExecution
9
- *
10
- * Let's you execute a PayPal Account based Payment resource with the payer_id obtained from web approval url.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property string payer_id
15
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Transaction[] transactions
16
- */
17
- class PaymentExecution extends PayPalModel
18
- {
19
- /**
20
- * The ID of the Payer, passed in the `return_url` by PayPal.
21
- *
22
- * @param string $payer_id
23
- *
24
- * @return $this
25
- */
26
- public function setPayerId($payer_id)
27
- {
28
- $this->payer_id = $payer_id;
29
- return $this;
30
- }
31
-
32
- /**
33
- * The ID of the Payer, passed in the `return_url` by PayPal.
34
- *
35
- * @return string
36
- */
37
- public function getPayerId()
38
- {
39
- return $this->payer_id;
40
- }
41
-
42
- /**
43
- * Carrier account id for a carrier billing payment. For a carrier billing payment, payer_id is not applicable.
44
- * @deprecated Not publicly available
45
- * @param string $carrier_account_id
46
- *
47
- * @return $this
48
- */
49
- public function setCarrierAccountId($carrier_account_id)
50
- {
51
- $this->carrier_account_id = $carrier_account_id;
52
- return $this;
53
- }
54
-
55
- /**
56
- * Carrier account id for a carrier billing payment. For a carrier billing payment, payer_id is not applicable.
57
- * @deprecated Not publicly available
58
- * @return string
59
- */
60
- public function getCarrierAccountId()
61
- {
62
- return $this->carrier_account_id;
63
- }
64
-
65
- /**
66
- * Transactional details including the amount and item details.
67
- *
68
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Transaction[] $transactions
69
- *
70
- * @return $this
71
- */
72
- public function setTransactions($transactions)
73
- {
74
- $this->transactions = $transactions;
75
- return $this;
76
- }
77
-
78
- /**
79
- * Transactional details including the amount and item details.
80
- *
81
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Transaction[]
82
- */
83
- public function getTransactions()
84
- {
85
- return $this->transactions;
86
- }
87
-
88
- /**
89
- * Append Transactions to the list.
90
- *
91
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Transaction $transaction
92
- * @return $this
93
- */
94
- public function addTransaction($transaction)
95
- {
96
- if (!$this->getTransactions()) {
97
- return $this->setTransactions(array($transaction));
98
- } else {
99
- return $this->setTransactions(
100
- array_merge($this->getTransactions(), array($transaction))
101
- );
102
- }
103
- }
104
-
105
- /**
106
- * Remove Transactions from the list.
107
- *
108
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Transaction $transaction
109
- * @return $this
110
- */
111
- public function removeTransaction($transaction)
112
- {
113
- return $this->setTransactions(
114
- array_diff($this->getTransactions(), array($transaction))
115
- );
116
- }
117
-
118
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/PaymentHistory.php DELETED
@@ -1,119 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class PaymentHistory
9
- *
10
- * List of Payments made by the seller.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Payment[] payments
15
- * @property int count
16
- * @property string next_id
17
- */
18
- class PaymentHistory extends PayPalModel
19
- {
20
- /**
21
- * A list of Payment resources
22
- *
23
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Payment[] $payments
24
- *
25
- * @return $this
26
- */
27
- public function setPayments($payments)
28
- {
29
- $this->payments = $payments;
30
- return $this;
31
- }
32
-
33
- /**
34
- * A list of Payment resources
35
- *
36
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Payment[]
37
- */
38
- public function getPayments()
39
- {
40
- return $this->payments;
41
- }
42
-
43
- /**
44
- * Append Payments to the list.
45
- *
46
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Payment $payment
47
- * @return $this
48
- */
49
- public function addPayment($payment)
50
- {
51
- if (!$this->getPayments()) {
52
- return $this->setPayments(array($payment));
53
- } else {
54
- return $this->setPayments(
55
- array_merge($this->getPayments(), array($payment))
56
- );
57
- }
58
- }
59
-
60
- /**
61
- * Remove Payments from the list.
62
- *
63
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Payment $payment
64
- * @return $this
65
- */
66
- public function removePayment($payment)
67
- {
68
- return $this->setPayments(
69
- array_diff($this->getPayments(), array($payment))
70
- );
71
- }
72
-
73
- /**
74
- * Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items. Maximum value: 20.
75
- *
76
- * @param int $count
77
- *
78
- * @return $this
79
- */
80
- public function setCount($count)
81
- {
82
- $this->count = $count;
83
- return $this;
84
- }
85
-
86
- /**
87
- * Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items. Maximum value: 20.
88
- *
89
- * @return int
90
- */
91
- public function getCount()
92
- {
93
- return $this->count;
94
- }
95
-
96
- /**
97
- * Identifier of the next element to get the next range of results.
98
- *
99
- * @param string $next_id
100
- *
101
- * @return $this
102
- */
103
- public function setNextId($next_id)
104
- {
105
- $this->next_id = $next_id;
106
- return $this;
107
- }
108
-
109
- /**
110
- * Identifier of the next element to get the next range of results.
111
- *
112
- * @return string
113
- */
114
- public function getNextId()
115
- {
116
- return $this->next_id;
117
- }
118
-
119
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/PaymentInstruction.php DELETED
@@ -1,190 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalResourceModel;
6
- use Never5\DownloadMonitor\Dependencies\PayPal\Rest\ApiContext;
7
- use Never5\DownloadMonitor\Dependencies\PayPal\Validation\ArgumentValidator;
8
-
9
- /**
10
- * Class PaymentInstruction
11
- *
12
- * Contain details of how and when the payment should be made to PayPal in cases of manual bank transfer.
13
- *
14
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
15
- *
16
- * @property string reference_number
17
- * @property string instruction_type
18
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\RecipientBankingInstruction recipient_banking_instruction
19
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency amount
20
- * @property string payment_due_date
21
- * @property string note
22
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links[] links
23
- */
24
- class PaymentInstruction extends PayPalResourceModel
25
- {
26
- /**
27
- * ID of payment instruction
28
- *
29
- * @param string $reference_number
30
- *
31
- * @return $this
32
- */
33
- public function setReferenceNumber($reference_number)
34
- {
35
- $this->reference_number = $reference_number;
36
- return $this;
37
- }
38
-
39
- /**
40
- * ID of payment instruction
41
- *
42
- * @return string
43
- */
44
- public function getReferenceNumber()
45
- {
46
- return $this->reference_number;
47
- }
48
-
49
- /**
50
- * Type of payment instruction
51
- * Valid Values: ["MANUAL_BANK_TRANSFER", "PAY_UPON_INVOICE"]
52
- *
53
- * @param string $instruction_type
54
- *
55
- * @return $this
56
- */
57
- public function setInstructionType($instruction_type)
58
- {
59
- $this->instruction_type = $instruction_type;
60
- return $this;
61
- }
62
-
63
- /**
64
- * Type of payment instruction
65
- *
66
- * @return string
67
- */
68
- public function getInstructionType()
69
- {
70
- return $this->instruction_type;
71
- }
72
-
73
- /**
74
- * Recipient bank Details.
75
- *
76
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\RecipientBankingInstruction $recipient_banking_instruction
77
- *
78
- * @return $this
79
- */
80
- public function setRecipientBankingInstruction($recipient_banking_instruction)
81
- {
82
- $this->recipient_banking_instruction = $recipient_banking_instruction;
83
- return $this;
84
- }
85
-
86
- /**
87
- * Recipient bank Details.
88
- *
89
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\RecipientBankingInstruction
90
- */
91
- public function getRecipientBankingInstruction()
92
- {
93
- return $this->recipient_banking_instruction;
94
- }
95
-
96
- /**
97
- * Amount to be transferred
98
- *
99
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency $amount
100
- *
101
- * @return $this
102
- */
103
- public function setAmount($amount)
104
- {
105
- $this->amount = $amount;
106
- return $this;
107
- }
108
-
109
- /**
110
- * Amount to be transferred
111
- *
112
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency
113
- */
114
- public function getAmount()
115
- {
116
- return $this->amount;
117
- }
118
-
119
- /**
120
- * Date by which payment should be received
121
- *
122
- * @param string $payment_due_date
123
- *
124
- * @return $this
125
- */
126
- public function setPaymentDueDate($payment_due_date)
127
- {
128
- $this->payment_due_date = $payment_due_date;
129
- return $this;
130
- }
131
-
132
- /**
133
- * Date by which payment should be received
134
- *
135
- * @return string
136
- */
137
- public function getPaymentDueDate()
138
- {
139
- return $this->payment_due_date;
140
- }
141
-
142
- /**
143
- * Additional text regarding payment handling
144
- *
145
- * @param string $note
146
- *
147
- * @return $this
148
- */
149
- public function setNote($note)
150
- {
151
- $this->note = $note;
152
- return $this;
153
- }
154
-
155
- /**
156
- * Additional text regarding payment handling
157
- *
158
- * @return string
159
- */
160
- public function getNote()
161
- {
162
- return $this->note;
163
- }
164
-
165
- /**
166
- * Retrieve a payment instruction by passing the payment_id in the request URI. Use this request if you are implementing a solution that includes delayed payment like Pay Upon Invoice (PUI).
167
- *
168
- * @param string $paymentId
169
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
170
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
171
- * @return PaymentInstruction
172
- */
173
- public static function get($paymentId, $apiContext = null, $restCall = null)
174
- {
175
- ArgumentValidator::validate($paymentId, 'paymentId');
176
- $payLoad = "";
177
- $json = self::executeCall(
178
- "/v1/payments/payment/$paymentId/payment-instruction",
179
- "GET",
180
- $payLoad,
181
- null,
182
- $apiContext,
183
- $restCall
184
- );
185
- $ret = new PaymentInstruction();
186
- $ret->fromJson($json);
187
- return $ret;
188
- }
189
-
190
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/PaymentOptions.php DELETED
@@ -1,88 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class PaymentOptions
9
- *
10
- * Payment options requested for this purchase unit
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property string allowed_payment_method
15
- */
16
- class PaymentOptions extends PayPalModel
17
- {
18
- /**
19
- * Payment method requested for this purchase unit
20
- * Valid Values: ["UNRESTRICTED", "INSTANT_FUNDING_SOURCE", "IMMEDIATE_PAY"]
21
- *
22
- * @param string $allowed_payment_method
23
- *
24
- * @return $this
25
- */
26
- public function setAllowedPaymentMethod($allowed_payment_method)
27
- {
28
- $this->allowed_payment_method = $allowed_payment_method;
29
- return $this;
30
- }
31
-
32
- /**
33
- * Payment method requested for this purchase unit
34
- *
35
- * @return string
36
- */
37
- public function getAllowedPaymentMethod()
38
- {
39
- return $this->allowed_payment_method;
40
- }
41
-
42
- /**
43
- * Indicator if this payment request is a recurring payment. Only supported when the `payment_method` is set to `credit_card`
44
- * @deprecated Not publicly available
45
- * @param bool $recurring_flag
46
- *
47
- * @return $this
48
- */
49
- public function setRecurringFlag($recurring_flag)
50
- {
51
- $this->recurring_flag = $recurring_flag;
52
- return $this;
53
- }
54
-
55
- /**
56
- * Indicator if this payment request is a recurring payment. Only supported when the `payment_method` is set to `credit_card`
57
- * @deprecated Not publicly available
58
- * @return bool
59
- */
60
- public function getRecurringFlag()
61
- {
62
- return $this->recurring_flag;
63
- }
64
-
65
- /**
66
- * Indicator if fraud management filters (fmf) should be skipped for this transaction. Only supported when the `payment_method` is set to `credit_card`
67
- * @deprecated Not publicly available
68
- * @param bool $skip_fmf
69
- *
70
- * @return $this
71
- */
72
- public function setSkipFmf($skip_fmf)
73
- {
74
- $this->skip_fmf = $skip_fmf;
75
- return $this;
76
- }
77
-
78
- /**
79
- * Indicator if fraud management filters (fmf) should be skipped for this transaction. Only supported when the `payment_method` is set to `credit_card`
80
- * @deprecated Not publicly available
81
- * @return bool
82
- */
83
- public function getSkipFmf()
84
- {
85
- return $this->skip_fmf;
86
- }
87
-
88
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/PaymentSummary.php DELETED
@@ -1,65 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class PaymentSummary
9
- *
10
- * Payment/Refund break up
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency paypal
15
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency other
16
- */
17
- class PaymentSummary extends PayPalModel
18
- {
19
- /**
20
- * Total Amount paid/refunded via PayPal.
21
- *
22
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency $paypal
23
- *
24
- * @return $this
25
- */
26
- public function setPaypal($paypal)
27
- {
28
- $this->paypal = $paypal;
29
- return $this;
30
- }
31
-
32
- /**
33
- * Total Amount paid/refunded via PayPal.
34
- *
35
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency
36
- */
37
- public function getPaypal()
38
- {
39
- return $this->paypal;
40
- }
41
-
42
- /**
43
- * Total Amount paid/refunded via other sources.
44
- *
45
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency $other
46
- *
47
- * @return $this
48
- */
49
- public function setOther($other)
50
- {
51
- $this->other = $other;
52
- return $this;
53
- }
54
-
55
- /**
56
- * Total Amount paid/refunded via other sources.
57
- *
58
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency
59
- */
60
- public function getOther()
61
- {
62
- return $this->other;
63
- }
64
-
65
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/PaymentTerm.php DELETED
@@ -1,66 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class PaymentTerm
9
- *
10
- * The payment term of the invoice. If you specify `term_type`, you cannot specify `due_date` and vice versa.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property string term_type
15
- * @property string due_date
16
- */
17
- class PaymentTerm extends PayPalModel
18
- {
19
- /**
20
- * The terms by which the invoice payment is due.
21
- * Valid Values: ["DUE_ON_RECEIPT", "DUE_ON_DATE_SPECIFIED", "NET_10", "NET_15", "NET_30", "NET_45", "NET_60", "NET_90", "NO_DUE_DATE"]
22
- *
23
- * @param string $term_type
24
- *
25
- * @return $this
26
- */
27
- public function setTermType($term_type)
28
- {
29
- $this->term_type = $term_type;
30
- return $this;
31
- }
32
-
33
- /**
34
- * The terms by which the invoice payment is due.
35
- *
36
- * @return string
37
- */
38
- public function getTermType()
39
- {
40
- return $this->term_type;
41
- }
42
-
43
- /**
44
- * The date when the invoice payment is due. This date must be a future date. Date format is *yyyy*-*MM*-*dd* *z*, as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6).
45
- *
46
- * @param string $due_date
47
- *
48
- * @return $this
49
- */
50
- public function setDueDate($due_date)
51
- {
52
- $this->due_date = $due_date;
53
- return $this;
54
- }
55
-
56
- /**
57
- * The date when the invoice payment is due. This date must be a future date. Date format is *yyyy*-*MM*-*dd* *z*, as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6).
58
- *
59
- * @return string
60
- */
61
- public function getDueDate()
62
- {
63
- return $this->due_date;
64
- }
65
-
66
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/Payout.php DELETED
@@ -1,166 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalResourceModel;
6
- use Never5\DownloadMonitor\Dependencies\PayPal\Rest\ApiContext;
7
- use Never5\DownloadMonitor\Dependencies\PayPal\Transport\PayPalRestCall;
8
- use Never5\DownloadMonitor\Dependencies\PayPal\Validation\ArgumentValidator;
9
-
10
- /**
11
- * Class Payout
12
- *
13
- * This object represents a set of payouts that includes status data for the payouts. This object enables you to create a payout using a POST request.
14
- *
15
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
16
- *
17
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\PayoutSenderBatchHeader sender_batch_header
18
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\PayoutItem[] items
19
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links[] links
20
- */
21
- class Payout extends PayPalResourceModel
22
- {
23
- /**
24
- * The original batch header as provided by the payment sender.
25
- *
26
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\PayoutSenderBatchHeader $sender_batch_header
27
- *
28
- * @return $this
29
- */
30
- public function setSenderBatchHeader($sender_batch_header)
31
- {
32
- $this->sender_batch_header = $sender_batch_header;
33
- return $this;
34
- }
35
-
36
- /**
37
- * The original batch header as provided by the payment sender.
38
- *
39
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\PayoutSenderBatchHeader
40
- */
41
- public function getSenderBatchHeader()
42
- {
43
- return $this->sender_batch_header;
44
- }
45
-
46
- /**
47
- * An array of payout items (that is, a set of individual payouts).
48
- *
49
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\PayoutItem[] $items
50
- *
51
- * @return $this
52
- */
53
- public function setItems($items)
54
- {
55
- $this->items = $items;
56
- return $this;
57
- }
58
-
59
- /**
60
- * An array of payout items (that is, a set of individual payouts).
61
- *
62
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\PayoutItem[]
63
- */
64
- public function getItems()
65
- {
66
- return $this->items;
67
- }
68
-
69
- /**
70
- * Append Items to the list.
71
- *
72
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\PayoutItem $payoutItem
73
- * @return $this
74
- */
75
- public function addItem($payoutItem)
76
- {
77
- if (!$this->getItems()) {
78
- return $this->setItems(array($payoutItem));
79
- } else {
80
- return $this->setItems(
81
- array_merge($this->getItems(), array($payoutItem))
82
- );
83
- }
84
- }
85
-
86
- /**
87
- * Remove Items from the list.
88
- *
89
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\PayoutItem $payoutItem
90
- * @return $this
91
- */
92
- public function removeItem($payoutItem)
93
- {
94
- return $this->setItems(
95
- array_diff($this->getItems(), array($payoutItem))
96
- );
97
- }
98
-
99
- /**
100
- * Create a payout batch resource by passing a sender_batch_header and an items array to the request URI. The sender_batch_header contains payout parameters that describe the handling of a batch resource while the items array conatins payout items.
101
- *
102
- * @param array $params
103
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
104
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
105
- * @return PayoutBatch
106
- */
107
- public function create($params = array(), $apiContext = null, $restCall = null)
108
- {
109
- $params = $params ? $params : array();
110
- ArgumentValidator::validate($params, 'params');
111
- $payLoad = $this->toJSON();
112
- $allowedParams = array(
113
- 'sync_mode' => 1,
114
- );
115
- $json = self::executeCall(
116
- "/v1/payments/payouts" . "?" . http_build_query(array_intersect_key($params, $allowedParams)),
117
- "POST",
118
- $payLoad,
119
- null,
120
- $apiContext,
121
- $restCall
122
- );
123
- $ret = new PayoutBatch();
124
- $ret->fromJson($json);
125
- return $ret;
126
- }
127
-
128
- /**
129
- * You can submit a payout with a synchronous API call, which immediately returns the results of a PayPal payment.
130
- *
131
- * @param ApiContext $apiContext
132
- * @param PayPalRestCall $restCall
133
- * @return PayoutBatch
134
- */
135
- public function createSynchronous($apiContext = null, $restCall = null)
136
- {
137
- $params = array('sync_mode' => 'true');
138
- return $this->create($params, $apiContext, $restCall);
139
- }
140
-
141
- /**
142
- * Obtain the status of a specific batch resource by passing the payout batch ID to the request URI. You can issue this call multiple times to get the current status.
143
- *
144
- * @param string $payoutBatchId
145
- * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
146
- * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
147
- * @return PayoutBatch
148
- */
149
- public static function get($payoutBatchId, $apiContext = null, $restCall = null)
150
- {
151
- ArgumentValidator::validate($payoutBatchId, 'payoutBatchId');
152
- $payLoad = "";
153
- $json = self::executeCall(
154
- "/v1/payments/payouts/$payoutBatchId",
155
- "GET",
156
- $payLoad,
157
- null,
158
- $apiContext,
159
- $restCall
160
- );
161
- $ret = new PayoutBatch();
162
- $ret->fromJson($json);
163
- return $ret;
164
- }
165
-
166
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/PayoutBatch.php DELETED
@@ -1,120 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class PayoutBatch
9
- *
10
- * The PayPal-generated batch status.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\PayoutBatchHeader batch_header
15
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\PayoutItemDetails[] items
16
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links[] links
17
- */
18
- class PayoutBatch extends PayPalModel
19
- {
20
- /**
21
- * A batch header. Includes the generated batch status.
22
- *
23
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\PayoutBatchHeader $batch_header
24
- *
25
- * @return $this
26
- */
27
- public function setBatchHeader($batch_header)
28
- {
29
- $this->batch_header = $batch_header;
30
- return $this;
31
- }
32
-
33
- /**
34
- * A batch header. Includes the generated batch status.
35
- *
36
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\PayoutBatchHeader
37
- */
38
- public function getBatchHeader()
39
- {
40
- return $this->batch_header;
41
- }
42
-
43
- /**
44
- * An array of items in a batch payout.
45
- *
46
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\PayoutItemDetails[] $items
47
- *
48
- * @return $this
49
- */
50
- public function setItems($items)
51
- {
52
- $this->items = $items;
53
- return $this;
54
- }
55
-
56
- /**
57
- * An array of items in a batch payout.
58
- *
59
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\PayoutItemDetails[]
60
- */
61
- public function getItems()
62
- {
63
- return $this->items;
64
- }
65
-
66
- /**
67
- * Append Items to the list.
68
- *
69
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\PayoutItemDetails $payoutItemDetails
70
- * @return $this
71
- */
72
- public function addItem($payoutItemDetails)
73
- {
74
- if (!$this->getItems()) {
75
- return $this->setItems(array($payoutItemDetails));
76
- } else {
77
- return $this->setItems(
78
- array_merge($this->getItems(), array($payoutItemDetails))
79
- );
80
- }
81
- }
82
-
83
- /**
84
- * Remove Items from the list.
85
- *
86
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\PayoutItemDetails $payoutItemDetails
87
- * @return $this
88
- */
89
- public function removeItem($payoutItemDetails)
90
- {
91
- return $this->setItems(
92
- array_diff($this->getItems(), array($payoutItemDetails))
93
- );
94
- }
95
-
96
-
97
- /**
98
- * Sets Links
99
- *
100
- * @param \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links[] $links
101
- *
102
- * @return $this
103
- */
104
- public function setLinks($links)
105
- {
106
- $this->links = $links;
107
- return $this;
108
- }
109
-
110
- /**
111
- * Gets Links
112
- *
113
- * @return \Never5\DownloadMonitor\Dependencies\PayPal\Api\Links[]
114
- */
115
- public function getLinks()
116
- {
117
- return $this->links;
118
- }
119
-
120
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Dependencies/PayPal/Api/PayoutBatchHeader.php DELETED
@@ -1,263 +0,0 @@
1
- <?php
2
-
3
- namespace Never5\DownloadMonitor\Dependencies\PayPal\Api;
4
-
5
- use Never5\DownloadMonitor\Dependencies\PayPal\Common\PayPalModel;
6
-
7
- /**
8
- * Class PayoutBatchHeader
9
- *
10
- * Batch header resource.
11
- *
12
- * @package Never5\DownloadMonitor\Dependencies\PayPal\Api
13
- *
14
- * @property string payout_batch_id
15
- * @property string batch_status
16
- * @property string time_created
17
- * @property string time_completed
18
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\PayoutSenderBatchHeader sender_batch_header
19
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Api\Currency amount
20
- * @property \Never5\DownloadMonitor\Dependencies\PayPal\Ap