Easy Forms for MailChimp - Version 5.2

Version Description

  • December 10th, 2014 =

  • New Feature: Added ability to add, edit or delete form fields directly from the WordPress dashboard

  • New Feature: Added ability to add, edit or delete interest groups directly from the WordPress dashboard

  • New Feature: Added "Update" link to forms when a user has previously subscribed

  • New Feature: Added 'default' option to text fields ( with custom pre-defined tags : {post_id} , {post_title} , {page_url} , {blog_name} , {user_logged_in} with the ability to define your own! )

  • New Feature: Added the ability to adjust required state, visibility state, merge tag and more

  • New Feature: Added the ability to toggle between ssl_verifypeer true/false

  • New Feature: Added an error log to help users diagnose errors happening within the plugin (and updated advanced debugging) - found on the debug options of the settings page

  • Enhancement: Remove JavaScript dependency to populate place holder values

  • Enhancement: Replaced Captcha with the all new No-Captcha reCaptcha API from Google

  • Enhancement: Introduced all new filters ( check documentation for examples )

  • Enhancement: Un-checking 'visibility' now hides the input field (instead of not generating it at all)

  • Enhancement: Re-defined YKSEME_PATH for users who have the plugins folder outside of wp-content

  • Enhancement: Added new classes to labels and input fields on the front end forms ( new classes yks-mc-label-field-label , yks-mc-form-row-field-label , yks-mc-input-field-row-field-label , yks-mc-input-field-label )

  • Bug Fix: Re-sorting fields that had a stored custom class name didn't store properly

  • Bug Fix: Wrapped bundled template text in filters

  • Bug Fix: Repaired some broken filters (get_form_data_before_send)

  • Bug Fix: Fixed labels on 'Manage List Forms' page and added field names to titles

  • Bug Fix: Fixed path to check box images on 'Clean Blue' bundled templates

  • Bug Fix: Fixed empty API key from outputting any string (confused some users)

  • Other: Split main class file into multiple included files (help organize the main class file (sub-files located in /lib/inc/)

  • Other: Began to build up a Wiki on Github , for plug in installation/usage instructions

  • Other: Altered single/double opt-in strings inside shortcode_form.php (reference thread)

  • Other: Removed 'Interest Group Label' option, as users can now update the name from within the plugin

Download this release

Release Info

Developer liljimmi
Plugin Icon 128x128 Easy Forms for MailChimp
Version 5.2
Comparing to
See all releases

Code changes from version 5.1.2 to 5.2

Mailchimp/Campaigns.php CHANGED
@@ -1,377 +1,377 @@
1
- <?php
2
-
3
- class Mailchimp_Campaigns {
4
- public function __construct(wpyksMCAPI $master) {
5
- $this->master = $master;
6
- }
7
-
8
- /**
9
- * Get the content (both html and text) for a campaign either as it would appear in the campaign archive or as the raw, original content
10
- * @param string $cid
11
- * @param associative_array $options
12
- * - view string optional one of "archive" (default), "preview" (like our popup-preview) or "raw"
13
- * - email associative_array optional if provided, view is "archive" or "preview", the campaign's list still exists, and the requested record is subscribed to the list. the returned content will be populated with member data populated. a struct with one of the following keys - failing to provide anything will produce an error relating to the email address. Providing multiples and will use the first we see in this same order.
14
- * - email string an email address
15
- * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
16
- * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
17
- * @return associative_array containing all content for the campaign
18
- * - html string The HTML content used for the campaign with merge tags intact
19
- * - text string The Text content used for the campaign with merge tags intact
20
- */
21
- public function content($cid, $options=array()) {
22
- $_params = array("cid" => $cid, "options" => $options);
23
- return $this->master->call('campaigns/content', $_params);
24
- }
25
-
26
- /**
27
- * Create a new draft campaign to send. You <strong>can not</strong> have more than 32,000 campaigns in your account.
28
- * @param string $type
29
- * @param associative_array $options
30
- * - list_id string the list to send this campaign to- get lists using lists/list()
31
- * - subject string the subject line for your campaign message
32
- * - from_email string the From: email address for your campaign message
33
- * - from_name string the From: name for your campaign message (not an email address)
34
- * - to_name string the To: name recipients will see (not email address)
35
- * - template_id int optional - use this user-created template to generate the HTML content of the campaign (takes precendence over other template options)
36
- * - gallery_template_id int optional - use a template from the public gallery to generate the HTML content of the campaign (takes precendence over base template options)
37
- * - base_template_id int optional - use this a base/start-from-scratch template to generate the HTML content of the campaign
38
- * - folder_id int optional - automatically file the new campaign in the folder_id passed. Get using folders/list() - note that Campaigns and Autoresponders have separate folder setups
39
- * - tracking associative_array optional - set which recipient actions will be tracked. Click tracking can not be disabled for Free accounts.
40
- * - opens bool whether to track opens, defaults to true
41
- * - html_clicks bool whether to track clicks in HTML content, defaults to true
42
- * - text_clicks bool whether to track clicks in Text content, defaults to false
43
- * - title string optional - an internal name to use for this campaign. By default, the campaign subject will be used.
44
- * - authenticate boolean optional - set to true to enable SenderID, DomainKeys, and DKIM authentication, defaults to false.
45
- * - analytics associative_array optional - one or more of these keys set to the tag to use - that can be any custom text (up to 50 bytes)
46
- * - google string for Google Analytics tracking
47
- * - clicktale string for ClickTale tracking
48
- * - gooal string for Goo.al tracking
49
- * - auto_footer boolean optional Whether or not we should auto-generate the footer for your content. Mostly useful for content from URLs or Imports
50
- * - inline_css boolean optional Whether or not css should be automatically inlined when this campaign is sent, defaults to false.
51
- * - generate_text boolean optional Whether of not to auto-generate your Text content from the HTML content. Note that this will be ignored if the Text part of the content passed is not empty, defaults to false.
52
- * - auto_tweet boolean optional If set, this campaign will be auto-tweeted when it is sent - defaults to false. Note that if a Twitter account isn't linked, this will be silently ignored.
53
- * - auto_fb_post array optional If set, this campaign will be auto-posted to the page_ids contained in the array. If a Facebook account isn't linked or the account does not have permission to post to the page_ids requested, those failures will be silently ignored.
54
- * - fb_comments boolean optional If true, the Facebook comments (and thus the <a href="http://kb.mailchimp.com/article/i-dont-want-an-archiave-of-my-campaign-can-i-turn-it-off/" target="_blank">archive bar</a> will be displayed. If false, Facebook comments will not be enabled (does not imply no archive bar, see previous link). Defaults to "true".
55
- * - timewarp boolean optional If set, this campaign must be scheduled 24 hours in advance of sending - default to false. Only valid for "regular" campaigns and "absplit" campaigns that split on schedule_time.
56
- * - ecomm360 boolean optional If set, our <a href="http://www.mailchimp.com/blog/ecommerce-tracking-plugin/" target="_blank">Ecommerce360 tracking</a> will be enabled for links in the campaign
57
- * - crm_tracking array optional If set, an array of structs to enable CRM tracking for:
58
- * - salesforce associative_array optional Enable SalesForce push back
59
- * - campaign bool optional - if true, create a Campaign object and update it with aggregate stats
60
- * - notes bool optional - if true, attempt to update Contact notes based on email address
61
- * - highrise associative_array optional Enable Highrise push back
62
- * - campaign bool optional - if true, create a Kase object and update it with aggregate stats
63
- * - notes bool optional - if true, attempt to update Contact notes based on email address
64
- * - capsule associative_array optional Enable Capsule push back (only notes are supported)
65
- * - notes bool optional - if true, attempt to update Contact notes based on email address
66
- * @param associative_array $content
67
- * - html string for raw/pasted HTML content
68
- * - sections associative_array when using a template instead of raw HTML, each key should be the unique mc:edit area name from the template.
69
- * - text string for the plain-text version
70
- * - url string to have us pull in content from a URL. Note, this will override any other content options - for lists with Email Format options, you'll need to turn on generate_text as well
71
- * - archive string to send a Base64 encoded archive file for us to import all media from. Note, this will override any other content options - for lists with Email Format options, you'll need to turn on generate_text as well
72
- * - archive_type string optional - only necessary for the "archive" option. Supported formats are: zip, tar.gz, tar.bz2, tar, tgz, tbz . If not included, we will default to zip
73
- * @param associative_array $segment_opts
74
- * @param associative_array $type_opts
75
- * - rss associative_array For RSS Campaigns this, struct should contain:
76
- * - url string the URL to pull RSS content from - it will be verified and must exist
77
- * - schedule string optional one of "daily", "weekly", "monthly" - defaults to "daily"
78
- * - schedule_hour string optional an hour between 0 and 24 - default to 4 (4am <em>local time</em>) - applies to all schedule types
79
- * - schedule_weekday string optional for "weekly" only, a number specifying the day of the week to send: 0 (Sunday) - 6 (Saturday) - defaults to 1 (Monday)
80
- * - schedule_monthday string optional for "monthly" only, a number specifying the day of the month to send (1 - 28) or "last" for the last day of a given month. Defaults to the 1st day of the month
81
- * - days associative_array optional used for "daily" schedules only, an array of the <a href="http://en.wikipedia.org/wiki/ISO-8601#Week_dates" target="_blank">ISO-8601 weekday numbers</a> to send on
82
- * - 1 bool optional Monday, defaults to true
83
- * - 2 bool optional Tuesday, defaults to true
84
- * - 3 bool optional Wednesday, defaults to true
85
- * - 4 bool optional Thursday, defaults to true
86
- * - 5 bool optional Friday, defaults to true
87
- * - 6 bool optional Saturday, defaults to true
88
- * - 7 bool optional Sunday, defaults to true
89
- * - absplit associative_array For A/B Split campaigns, this struct should contain:
90
- * - split_test string The values to segment based on. Currently, one of: "subject", "from_name", "schedule". NOTE, for "schedule", you will need to call campaigns/schedule() separately!
91
- * - pick_winner string How the winner will be picked, one of: "opens" (by the open_rate), "clicks" (by the click rate), "manual" (you pick manually)
92
- * - wait_units int optional the default time unit to wait before auto-selecting a winner - use "3600" for hours, "86400" for days. Defaults to 86400.
93
- * - wait_time int optional the number of units to wait before auto-selecting a winner - defaults to 1, so if not set, a winner will be selected after 1 Day.
94
- * - split_size int optional this is a percentage of what size the Campaign's List plus any segmentation options results in. "schedule" type forces 50%, all others default to 10%
95
- * - from_name_a string optional sort of, required when split_test is "from_name"
96
- * - from_name_b string optional sort of, required when split_test is "from_name"
97
- * - from_email_a string optional sort of, required when split_test is "from_name"
98
- * - from_email_b string optional sort of, required when split_test is "from_name"
99
- * - subject_a string optional sort of, required when split_test is "subject"
100
- * - subject_b string optional sort of, required when split_test is "subject"
101
- * - auto associative_array For AutoResponder campaigns, this struct should contain:
102
- * - offset-units string one of "hourly", "day", "week", "month", "year" - required
103
- * - offset-time string optional, sort of - the number of units must be a number greater than 0 for signup based autoresponders, ignored for "hourly"
104
- * - offset-dir string either "before" or "after", ignored for "hourly"
105
- * - event string optional "signup" (default) to base this members added to a list, "date", "annual", or "birthday" to base this on merge field in the list, "campaignOpen" or "campaignClicka" to base this on any activity for a campaign, "campaignClicko" to base this on clicks on a specific URL in a campaign, "mergeChanged" to base this on a specific merge field being changed to a specific value
106
- * - event-datemerge string optional sort of, this is required if the event is "date", "annual", "birthday", or "mergeChanged"
107
- * - campaign_id string optional sort of, required for "campaignOpen", "campaignClicka", or "campaignClicko"
108
- * - campaign_url string optional sort of, required for "campaignClicko"
109
- * - schedule_hour int The hour of the day - 24 hour format in GMT - the autoresponder should be triggered, ignored for "hourly"
110
- * - use_import_time boolean whether or not imported subscribers (ie, <em>any</em> non-double optin subscribers) will receive
111
- * - days associative_array optional used for "daily" schedules only, an array of the <a href="http://en.wikipedia.org/wiki/ISO-8601#Week_dates" target="_blank">ISO-8601 weekday numbers</a> to send on<
112
- * - 1 bool optional Monday, defaults to true
113
- * - 2 bool optional Tuesday, defaults to true
114
- * - 3 bool optional Wednesday, defaults to true
115
- * - 4 bool optional Thursday, defaults to true
116
- * - 5 bool optional Friday, defaults to true
117
- * - 6 bool optional Saturday, defaults to true
118
- * - 7 bool optional Sunday, defaults to true
119
- * @return associative_array the new campaign's details - will return same data as single campaign from campaigns/list()
120
- */
121
- public function create($type, $options, $content, $segment_opts=null, $type_opts=null) {
122
- $_params = array("type" => $type, "options" => $options, "content" => $content, "segment_opts" => $segment_opts, "type_opts" => $type_opts);
123
- return $this->master->call('campaigns/create', $_params);
124
- }
125
-
126
- /**
127
- * Delete a campaign. Seriously, "poof, gone!" - be careful! Seriously, no one can undelete these.
128
- * @param string $cid
129
- * @return associative_array with a single entry:
130
- * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
131
- */
132
- public function delete($cid) {
133
- $_params = array("cid" => $cid);
134
- return $this->master->call('campaigns/delete', $_params);
135
- }
136
-
137
- /**
138
- * Get the list of campaigns and their details matching the specified filters
139
- * @param associative_array $filters
140
- * - campaign_id string optional - return the campaign using a know campaign_id. Accepts multiples separated by commas when not using exact matching.
141
- * - parent_id string optional - return the child campaigns using a known parent campaign_id. Accepts multiples separated by commas when not using exact matching.
142
- * - list_id string optional - the list to send this campaign to - get lists using lists/list(). Accepts multiples separated by commas when not using exact matching.
143
- * - folder_id int optional - only show campaigns from this folder id - get folders using folders/list(). Accepts multiples separated by commas when not using exact matching.
144
- * - template_id int optional - only show campaigns using this template id - get templates using templates/list(). Accepts multiples separated by commas when not using exact matching.
145
- * - status string optional - return campaigns of a specific status - one of "sent", "save", "paused", "schedule", "sending". Accepts multiples separated by commas when not using exact matching.
146
- * - type string optional - return campaigns of a specific type - one of "regular", "plaintext", "absplit", "rss", "auto". Accepts multiples separated by commas when not using exact matching.
147
- * - from_name string optional - only show campaigns that have this "From Name"
148
- * - from_email string optional - only show campaigns that have this "Reply-to Email"
149
- * - title string optional - only show campaigns that have this title
150
- * - subject string optional - only show campaigns that have this subject
151
- * - sendtime_start string optional - only show campaigns that have been sent since this date/time (in GMT) - - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00" - if this is invalid the whole call fails
152
- * - sendtime_end string optional - only show campaigns that have been sent before this date/time (in GMT) - - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00" - if this is invalid the whole call fails
153
- * - uses_segment boolean - whether to return just campaigns with or without segments
154
- * - exact boolean optional - flag for whether to filter on exact values when filtering, or search within content for filter values - defaults to true. Using this disables the use of any filters that accept multiples.
155
- * @param int $start
156
- * @param int $limit
157
- * @param string $sort_field
158
- * @param string $sort_dir
159
- * @return associative_array containing a count of all matching campaigns, the specific ones for the current page, and any errors from the filters provided
160
- * - total int the total number of campaigns matching the filters passed in
161
- * - data array structs for each campaign being returned
162
- * - id string Campaign Id (used for all other campaign functions)
163
- * - web_id int The Campaign id used in our web app, allows you to create a link directly to it
164
- * - list_id string The List used for this campaign
165
- * - folder_id int The Folder this campaign is in
166
- * - template_id int The Template this campaign uses
167
- * - content_type string How the campaign's content is put together - one of 'template', 'html', 'url'
168
- * - title string Title of the campaign
169
- * - type string The type of campaign this is (regular,plaintext,absplit,rss,inspection,auto)
170
- * - create_time string Creation time for the campaign
171
- * - send_time string Send time for the campaign - also the scheduled time for scheduled campaigns.
172
- * - emails_sent int Number of emails email was sent to
173
- * - status string Status of the given campaign (save,paused,schedule,sending,sent)
174
- * - from_name string From name of the given campaign
175
- * - from_email string Reply-to email of the given campaign
176
- * - subject string Subject of the given campaign
177
- * - to_name string Custom "To:" email string using merge variables
178
- * - archive_url string Archive link for the given campaign
179
- * - inline_css boolean Whether or not the campaign content's css was auto-inlined
180
- * - analytics string Either "google" if enabled or "N" if disabled
181
- * - analytics_tag string The name/tag the campaign's links were tagged with if analytics were enabled.
182
- * - authenticate boolean Whether or not the campaign was authenticated
183
- * - ecomm360 boolean Whether or not ecomm360 tracking was appended to links
184
- * - auto_tweet boolean Whether or not the campaign was auto tweeted after sending
185
- * - auto_fb_post string A comma delimited list of Facebook Profile/Page Ids the campaign was posted to after sending. If not used, blank.
186
- * - auto_footer boolean Whether or not the auto_footer was manually turned on
187
- * - timewarp boolean Whether or not the campaign used Timewarp
188
- * - timewarp_schedule string The time, in GMT, that the Timewarp campaign is being sent. For A/B Split campaigns, this is blank and is instead in their schedule_a and schedule_b in the type_opts array
189
- * - parent_id string the unique id of the parent campaign (currently only valid for rss children)
190
- * - tests_sent string tests sent
191
- * - tests_remain string test sends remaining
192
- * - tracking associative_array the various tracking options used
193
- * - html_clicks boolean whether or not tracking for html clicks was enabled.
194
- * - text_clicks boolean whether or not tracking for text clicks was enabled.
195
- * - opens boolean whether or not opens tracking was enabled.
196
- * - segment_text string a string marked-up with HTML explaining the segment used for the campaign in plain English
197
- * - segment_opts array the segment used for the campaign - can be passed to campaigns/segment-test or campaigns/create()
198
- * - saved_segment associative_array if a saved segment was used (match+conditions returned above):
199
- * - id associative_array the saved segment id
200
- * - type associative_array the saved segment type
201
- * - name associative_array the saved segment name
202
- * - type_opts associative_array the type-specific options for the campaign - can be passed to campaigns/create()
203
- * - comments_total int total number of comments left on this campaign
204
- * - comments_unread int total number of unread comments for this campaign based on the login the apikey belongs to
205
- * - summary associative_array if available, the basic aggregate stats returned by reports/summary
206
- * - errors array structs of any errors found while loading lists - usually just from providing invalid list ids
207
- * - filter string the filter that caused the failure
208
- * - value string the filter value that caused the failure
209
- * - code int the error code
210
- * - error int the error message
211
- */
212
- public function getList($filters=array(), $start=0, $limit=25, $sort_field='create_time', $sort_dir='DESC') {
213
- $_params = array("filters" => $filters, "start" => $start, "limit" => $limit, "sort_field" => $sort_field, "sort_dir" => $sort_dir);
214
- return $this->master->call('campaigns/list', $_params);
215
- }
216
-
217
- /**
218
- * Pause an AutoResponder or RSS campaign from sending
219
- * @param string $cid
220
- * @return associative_array with a single entry:
221
- * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
222
- */
223
- public function pause($cid) {
224
- $_params = array("cid" => $cid);
225
- return $this->master->call('campaigns/pause', $_params);
226
- }
227
-
228
- /**
229
- * Returns information on whether a campaign is ready to send and possible issues we may have detected with it - very similar to the confirmation step in the app.
230
- * @param string $cid
231
- * @return associative_array containing:
232
- * - is_ready bool whether or not you're going to be able to send this campaign
233
- * - items array an array of structs explaining basically what the app's confirmation step would
234
- * - type string the item type - generally success, warning, or error
235
- * - heading string the item's heading in the app
236
- * - details string the item's details from the app, sans any html tags/links
237
- */
238
- public function ready($cid) {
239
- $_params = array("cid" => $cid);
240
- return $this->master->call('campaigns/ready', $_params);
241
- }
242
-
243
- /**
244
- * Replicate a campaign.
245
- * @param string $cid
246
- * @return associative_array the matching campaign's details - will return same data as single campaign from campaigns/list()
247
- */
248
- public function replicate($cid) {
249
- $_params = array("cid" => $cid);
250
- return $this->master->call('campaigns/replicate', $_params);
251
- }
252
-
253
- /**
254
- * Resume sending an AutoResponder or RSS campaign
255
- * @param string $cid
256
- * @return associative_array with a single entry:
257
- * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
258
- */
259
- public function resume($cid) {
260
- $_params = array("cid" => $cid);
261
- return $this->master->call('campaigns/resume', $_params);
262
- }
263
-
264
- /**
265
- * Schedule a campaign to be sent in the future
266
- * @param string $cid
267
- * @param string $schedule_time
268
- * @param string $schedule_time_b
269
- * @return associative_array with a single entry:
270
- * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
271
- */
272
- public function schedule($cid, $schedule_time, $schedule_time_b=null) {
273
- $_params = array("cid" => $cid, "schedule_time" => $schedule_time, "schedule_time_b" => $schedule_time_b);
274
- return $this->master->call('campaigns/schedule', $_params);
275
- }
276
-
277
- /**
278
- * Schedule a campaign to be sent in batches sometime in the future. Only valid for "regular" campaigns
279
- * @param string $cid
280
- * @param string $schedule_time
281
- * @param int $num_batches
282
- * @param int $stagger_mins
283
- * @return associative_array with a single entry:
284
- * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
285
- */
286
- public function scheduleBatch($cid, $schedule_time, $num_batches=2, $stagger_mins=5) {
287
- $_params = array("cid" => $cid, "schedule_time" => $schedule_time, "num_batches" => $num_batches, "stagger_mins" => $stagger_mins);
288
- return $this->master->call('campaigns/schedule-batch', $_params);
289
- }
290
-
291
- /**
292
- * Allows one to test their segmentation rules before creating a campaign using them
293
- * @param string $list_id
294
- * @param associative_array $options
295
- * - saved_segment_id string a saved segment id from lists/segments() - this will take precendence, otherwise the match+conditions are required.
296
- * - match string controls whether to use AND or OR when applying your options - expects "<strong>any</strong>" (for OR) or "<strong>all</strong>" (for AND)
297
- * - conditions array of up to 5 structs for different criteria to apply while segmenting. Each criteria row must contain 3 keys - "<strong>field</strong>", "<strong>op</strong>", and "<strong>value</strong>" - and possibly a fourth, "<strong>extra</strong>", based on these definitions:
298
- * @return associative_array with a single entry:
299
- * - total int The total number of subscribers matching your segmentation options
300
- */
301
- public function segmentTest($list_id, $options) {
302
- $_params = array("list_id" => $list_id, "options" => $options);
303
- return $this->master->call('campaigns/segment-test', $_params);
304
- }
305
-
306
- /**
307
- * Send a given campaign immediately. For RSS campaigns, this will "start" them.
308
- * @param string $cid
309
- * @return associative_array with a single entry:
310
- * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
311
- */
312
- public function send($cid) {
313
- $_params = array("cid" => $cid);
314
- return $this->master->call('campaigns/send', $_params);
315
- }
316
-
317
- /**
318
- * Send a test of this campaign to the provided email addresses
319
- * @param string $cid
320
- * @param array $test_emails
321
- * @param string $send_type
322
- * @return associative_array with a single entry:
323
- * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
324
- */
325
- public function sendTest($cid, $test_emails=array(), $send_type='html') {
326
- $_params = array("cid" => $cid, "test_emails" => $test_emails, "send_type" => $send_type);
327
- return $this->master->call('campaigns/send-test', $_params);
328
- }
329
-
330
- /**
331
- * Get the HTML template content sections for a campaign. Note that this <strong>will</strong> return very jagged, non-standard results based on the template
332
- a campaign is using. You only want to use this if you want to allow editing template sections in your application.
333
- * @param string $cid
334
- * @return associative_array content containing all content section for the campaign - section name are dependent upon the template used and thus can't be documented
335
- */
336
- public function templateContent($cid) {
337
- $_params = array("cid" => $cid);
338
- return $this->master->call('campaigns/template-content', $_params);
339
- }
340
-
341
- /**
342
- * Unschedule a campaign that is scheduled to be sent in the future
343
- * @param string $cid
344
- * @return associative_array with a single entry:
345
- * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
346
- */
347
- public function unschedule($cid) {
348
- $_params = array("cid" => $cid);
349
- return $this->master->call('campaigns/unschedule', $_params);
350
- }
351
-
352
- /**
353
- * Update just about any setting besides type for a campaign that has <em>not</em> been sent. See campaigns/create() for details.
354
- Caveats:<br/><ul class='bullets'>
355
- <li>If you set a new list_id, all segmentation options will be deleted and must be re-added.</li>
356
- <li>If you set template_id, you need to follow that up by setting it's 'content'</li>
357
- <li>If you set segment_opts, you should have tested your options against campaigns/segment-test().</li>
358
- <li>To clear/unset segment_opts, pass an empty string or array as the value. Various wrappers may require one or the other.</li>
359
- </ul>
360
- * @param string $cid
361
- * @param string $name
362
- * @param array $value
363
- * @return associative_array updated campaign details and any errors
364
- * - data associative_array the update campaign details - will return same data as single campaign from campaigns/list()
365
- * - errors array for "options" only - structs containing:
366
- * - code int the error code
367
- * - message string the full error message
368
- * - name string the parameter name that failed
369
- */
370
- public function update($cid, $name, $value) {
371
- $_params = array("cid" => $cid, "name" => $name, "value" => $value);
372
- return $this->master->call('campaigns/update', $_params);
373
- }
374
-
375
- }
376
-
377
-
1
+ <?php
2
+
3
+ class Mailchimp_Campaigns {
4
+ public function __construct(wpyksMCAPI $master) {
5
+ $this->master = $master;
6
+ }
7
+
8
+ /**
9
+ * Get the content (both html and text) for a campaign either as it would appear in the campaign archive or as the raw, original content
10
+ * @param string $cid
11
+ * @param associative_array $options
12
+ * - view string optional one of "archive" (default), "preview" (like our popup-preview) or "raw"
13
+ * - email associative_array optional if provided, view is "archive" or "preview", the campaign's list still exists, and the requested record is subscribed to the list. the returned content will be populated with member data populated. a struct with one of the following keys - failing to provide anything will produce an error relating to the email address. Providing multiples and will use the first we see in this same order.
14
+ * - email string an email address
15
+ * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
16
+ * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
17
+ * @return associative_array containing all content for the campaign
18
+ * - html string The HTML content used for the campaign with merge tags intact
19
+ * - text string The Text content used for the campaign with merge tags intact
20
+ */
21
+ public function content($cid, $options=array()) {
22
+ $_params = array("cid" => $cid, "options" => $options);
23
+ return $this->master->call('campaigns/content', $_params);
24
+ }
25
+
26
+ /**
27
+ * Create a new draft campaign to send. You <strong>can not</strong> have more than 32,000 campaigns in your account.
28
+ * @param string $type
29
+ * @param associative_array $options
30
+ * - list_id string the list to send this campaign to- get lists using lists/list()
31
+ * - subject string the subject line for your campaign message
32
+ * - from_email string the From: email address for your campaign message
33
+ * - from_name string the From: name for your campaign message (not an email address)
34
+ * - to_name string the To: name recipients will see (not email address)
35
+ * - template_id int optional - use this user-created template to generate the HTML content of the campaign (takes precendence over other template options)
36
+ * - gallery_template_id int optional - use a template from the public gallery to generate the HTML content of the campaign (takes precendence over base template options)
37
+ * - base_template_id int optional - use this a base/start-from-scratch template to generate the HTML content of the campaign
38
+ * - folder_id int optional - automatically file the new campaign in the folder_id passed. Get using folders/list() - note that Campaigns and Autoresponders have separate folder setups
39
+ * - tracking associative_array optional - set which recipient actions will be tracked. Click tracking can not be disabled for Free accounts.
40
+ * - opens bool whether to track opens, defaults to true
41
+ * - html_clicks bool whether to track clicks in HTML content, defaults to true
42
+ * - text_clicks bool whether to track clicks in Text content, defaults to false
43
+ * - title string optional - an internal name to use for this campaign. By default, the campaign subject will be used.
44
+ * - authenticate boolean optional - set to true to enable SenderID, DomainKeys, and DKIM authentication, defaults to false.
45
+ * - analytics associative_array optional - one or more of these keys set to the tag to use - that can be any custom text (up to 50 bytes)
46
+ * - google string for Google Analytics tracking
47
+ * - clicktale string for ClickTale tracking
48
+ * - gooal string for Goo.al tracking
49
+ * - auto_footer boolean optional Whether or not we should auto-generate the footer for your content. Mostly useful for content from URLs or Imports
50
+ * - inline_css boolean optional Whether or not css should be automatically inlined when this campaign is sent, defaults to false.
51
+ * - generate_text boolean optional Whether of not to auto-generate your Text content from the HTML content. Note that this will be ignored if the Text part of the content passed is not empty, defaults to false.
52
+ * - auto_tweet boolean optional If set, this campaign will be auto-tweeted when it is sent - defaults to false. Note that if a Twitter account isn't linked, this will be silently ignored.
53
+ * - auto_fb_post array optional If set, this campaign will be auto-posted to the page_ids contained in the array. If a Facebook account isn't linked or the account does not have permission to post to the page_ids requested, those failures will be silently ignored.
54
+ * - fb_comments boolean optional If true, the Facebook comments (and thus the <a href="http://kb.mailchimp.com/article/i-dont-want-an-archiave-of-my-campaign-can-i-turn-it-off/" target="_blank">archive bar</a> will be displayed. If false, Facebook comments will not be enabled (does not imply no archive bar, see previous link). Defaults to "true".
55
+ * - timewarp boolean optional If set, this campaign must be scheduled 24 hours in advance of sending - default to false. Only valid for "regular" campaigns and "absplit" campaigns that split on schedule_time.
56
+ * - ecomm360 boolean optional If set, our <a href="http://www.mailchimp.com/blog/ecommerce-tracking-plugin/" target="_blank">Ecommerce360 tracking</a> will be enabled for links in the campaign
57
+ * - crm_tracking array optional If set, an array of structs to enable CRM tracking for:
58
+ * - salesforce associative_array optional Enable SalesForce push back
59
+ * - campaign bool optional - if true, create a Campaign object and update it with aggregate stats
60
+ * - notes bool optional - if true, attempt to update Contact notes based on email address
61
+ * - highrise associative_array optional Enable Highrise push back
62
+ * - campaign bool optional - if true, create a Kase object and update it with aggregate stats
63
+ * - notes bool optional - if true, attempt to update Contact notes based on email address
64
+ * - capsule associative_array optional Enable Capsule push back (only notes are supported)
65
+ * - notes bool optional - if true, attempt to update Contact notes based on email address
66
+ * @param associative_array $content
67
+ * - html string for raw/pasted HTML content
68
+ * - sections associative_array when using a template instead of raw HTML, each key should be the unique mc:edit area name from the template.
69
+ * - text string for the plain-text version
70
+ * - url string to have us pull in content from a URL. Note, this will override any other content options - for lists with Email Format options, you'll need to turn on generate_text as well
71
+ * - archive string to send a Base64 encoded archive file for us to import all media from. Note, this will override any other content options - for lists with Email Format options, you'll need to turn on generate_text as well
72
+ * - archive_type string optional - only necessary for the "archive" option. Supported formats are: zip, tar.gz, tar.bz2, tar, tgz, tbz . If not included, we will default to zip
73
+ * @param associative_array $segment_opts
74
+ * @param associative_array $type_opts
75
+ * - rss associative_array For RSS Campaigns this, struct should contain:
76
+ * - url string the URL to pull RSS content from - it will be verified and must exist
77
+ * - schedule string optional one of "daily", "weekly", "monthly" - defaults to "daily"
78
+ * - schedule_hour string optional an hour between 0 and 24 - default to 4 (4am <em>local time</em>) - applies to all schedule types
79
+ * - schedule_weekday string optional for "weekly" only, a number specifying the day of the week to send: 0 (Sunday) - 6 (Saturday) - defaults to 1 (Monday)
80
+ * - schedule_monthday string optional for "monthly" only, a number specifying the day of the month to send (1 - 28) or "last" for the last day of a given month. Defaults to the 1st day of the month
81
+ * - days associative_array optional used for "daily" schedules only, an array of the <a href="http://en.wikipedia.org/wiki/ISO-8601#Week_dates" target="_blank">ISO-8601 weekday numbers</a> to send on
82
+ * - 1 bool optional Monday, defaults to true
83
+ * - 2 bool optional Tuesday, defaults to true
84
+ * - 3 bool optional Wednesday, defaults to true
85
+ * - 4 bool optional Thursday, defaults to true
86
+ * - 5 bool optional Friday, defaults to true
87
+ * - 6 bool optional Saturday, defaults to true
88
+ * - 7 bool optional Sunday, defaults to true
89
+ * - absplit associative_array For A/B Split campaigns, this struct should contain:
90
+ * - split_test string The values to segment based on. Currently, one of: "subject", "from_name", "schedule". NOTE, for "schedule", you will need to call campaigns/schedule() separately!
91
+ * - pick_winner string How the winner will be picked, one of: "opens" (by the open_rate), "clicks" (by the click rate), "manual" (you pick manually)
92
+ * - wait_units int optional the default time unit to wait before auto-selecting a winner - use "3600" for hours, "86400" for days. Defaults to 86400.
93
+ * - wait_time int optional the number of units to wait before auto-selecting a winner - defaults to 1, so if not set, a winner will be selected after 1 Day.
94
+ * - split_size int optional this is a percentage of what size the Campaign's List plus any segmentation options results in. "schedule" type forces 50%, all others default to 10%
95
+ * - from_name_a string optional sort of, required when split_test is "from_name"
96
+ * - from_name_b string optional sort of, required when split_test is "from_name"
97
+ * - from_email_a string optional sort of, required when split_test is "from_name"
98
+ * - from_email_b string optional sort of, required when split_test is "from_name"
99
+ * - subject_a string optional sort of, required when split_test is "subject"
100
+ * - subject_b string optional sort of, required when split_test is "subject"
101
+ * - auto associative_array For AutoResponder campaigns, this struct should contain:
102
+ * - offset-units string one of "hourly", "day", "week", "month", "year" - required
103
+ * - offset-time string optional, sort of - the number of units must be a number greater than 0 for signup based autoresponders, ignored for "hourly"
104
+ * - offset-dir string either "before" or "after", ignored for "hourly"
105
+ * - event string optional "signup" (default) to base this members added to a list, "date", "annual", or "birthday" to base this on merge field in the list, "campaignOpen" or "campaignClicka" to base this on any activity for a campaign, "campaignClicko" to base this on clicks on a specific URL in a campaign, "mergeChanged" to base this on a specific merge field being changed to a specific value
106
+ * - event-datemerge string optional sort of, this is required if the event is "date", "annual", "birthday", or "mergeChanged"
107
+ * - campaign_id string optional sort of, required for "campaignOpen", "campaignClicka", or "campaignClicko"
108
+ * - campaign_url string optional sort of, required for "campaignClicko"
109
+ * - schedule_hour int The hour of the day - 24 hour format in GMT - the autoresponder should be triggered, ignored for "hourly"
110
+ * - use_import_time boolean whether or not imported subscribers (ie, <em>any</em> non-double optin subscribers) will receive
111
+ * - days associative_array optional used for "daily" schedules only, an array of the <a href="http://en.wikipedia.org/wiki/ISO-8601#Week_dates" target="_blank">ISO-8601 weekday numbers</a> to send on<
112
+ * - 1 bool optional Monday, defaults to true
113
+ * - 2 bool optional Tuesday, defaults to true
114
+ * - 3 bool optional Wednesday, defaults to true
115
+ * - 4 bool optional Thursday, defaults to true
116
+ * - 5 bool optional Friday, defaults to true
117
+ * - 6 bool optional Saturday, defaults to true
118
+ * - 7 bool optional Sunday, defaults to true
119
+ * @return associative_array the new campaign's details - will return same data as single campaign from campaigns/list()
120
+ */
121
+ public function create($type, $options, $content, $segment_opts=null, $type_opts=null) {
122
+ $_params = array("type" => $type, "options" => $options, "content" => $content, "segment_opts" => $segment_opts, "type_opts" => $type_opts);
123
+ return $this->master->call('campaigns/create', $_params);
124
+ }
125
+
126
+ /**
127
+ * Delete a campaign. Seriously, "poof, gone!" - be careful! Seriously, no one can undelete these.
128
+ * @param string $cid
129
+ * @return associative_array with a single entry:
130
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
131
+ */
132
+ public function delete($cid) {
133
+ $_params = array("cid" => $cid);
134
+ return $this->master->call('campaigns/delete', $_params);
135
+ }
136
+
137
+ /**
138
+ * Get the list of campaigns and their details matching the specified filters
139
+ * @param associative_array $filters
140
+ * - campaign_id string optional - return the campaign using a know campaign_id. Accepts multiples separated by commas when not using exact matching.
141
+ * - parent_id string optional - return the child campaigns using a known parent campaign_id. Accepts multiples separated by commas when not using exact matching.
142
+ * - list_id string optional - the list to send this campaign to - get lists using lists/list(). Accepts multiples separated by commas when not using exact matching.
143
+ * - folder_id int optional - only show campaigns from this folder id - get folders using folders/list(). Accepts multiples separated by commas when not using exact matching.
144
+ * - template_id int optional - only show campaigns using this template id - get templates using templates/list(). Accepts multiples separated by commas when not using exact matching.
145
+ * - status string optional - return campaigns of a specific status - one of "sent", "save", "paused", "schedule", "sending". Accepts multiples separated by commas when not using exact matching.
146
+ * - type string optional - return campaigns of a specific type - one of "regular", "plaintext", "absplit", "rss", "auto". Accepts multiples separated by commas when not using exact matching.
147
+ * - from_name string optional - only show campaigns that have this "From Name"
148
+ * - from_email string optional - only show campaigns that have this "Reply-to Email"
149
+ * - title string optional - only show campaigns that have this title
150
+ * - subject string optional - only show campaigns that have this subject
151
+ * - sendtime_start string optional - only show campaigns that have been sent since this date/time (in GMT) - - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00" - if this is invalid the whole call fails
152
+ * - sendtime_end string optional - only show campaigns that have been sent before this date/time (in GMT) - - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00" - if this is invalid the whole call fails
153
+ * - uses_segment boolean - whether to return just campaigns with or without segments
154
+ * - exact boolean optional - flag for whether to filter on exact values when filtering, or search within content for filter values - defaults to true. Using this disables the use of any filters that accept multiples.
155
+ * @param int $start
156
+ * @param int $limit
157
+ * @param string $sort_field
158
+ * @param string $sort_dir
159
+ * @return associative_array containing a count of all matching campaigns, the specific ones for the current page, and any errors from the filters provided
160
+ * - total int the total number of campaigns matching the filters passed in
161
+ * - data array structs for each campaign being returned
162
+ * - id string Campaign Id (used for all other campaign functions)
163
+ * - web_id int The Campaign id used in our web app, allows you to create a link directly to it
164
+ * - list_id string The List used for this campaign
165
+ * - folder_id int The Folder this campaign is in
166
+ * - template_id int The Template this campaign uses
167
+ * - content_type string How the campaign's content is put together - one of 'template', 'html', 'url'
168
+ * - title string Title of the campaign
169
+ * - type string The type of campaign this is (regular,plaintext,absplit,rss,inspection,auto)
170
+ * - create_time string Creation time for the campaign
171
+ * - send_time string Send time for the campaign - also the scheduled time for scheduled campaigns.
172
+ * - emails_sent int Number of emails email was sent to
173
+ * - status string Status of the given campaign (save,paused,schedule,sending,sent)
174
+ * - from_name string From name of the given campaign
175
+ * - from_email string Reply-to email of the given campaign
176
+ * - subject string Subject of the given campaign
177
+ * - to_name string Custom "To:" email string using merge variables
178
+ * - archive_url string Archive link for the given campaign
179
+ * - inline_css boolean Whether or not the campaign content's css was auto-inlined
180
+ * - analytics string Either "google" if enabled or "N" if disabled
181
+ * - analytics_tag string The name/tag the campaign's links were tagged with if analytics were enabled.
182
+ * - authenticate boolean Whether or not the campaign was authenticated
183
+ * - ecomm360 boolean Whether or not ecomm360 tracking was appended to links
184
+ * - auto_tweet boolean Whether or not the campaign was auto tweeted after sending
185
+ * - auto_fb_post string A comma delimited list of Facebook Profile/Page Ids the campaign was posted to after sending. If not used, blank.
186
+ * - auto_footer boolean Whether or not the auto_footer was manually turned on
187
+ * - timewarp boolean Whether or not the campaign used Timewarp
188
+ * - timewarp_schedule string The time, in GMT, that the Timewarp campaign is being sent. For A/B Split campaigns, this is blank and is instead in their schedule_a and schedule_b in the type_opts array
189
+ * - parent_id string the unique id of the parent campaign (currently only valid for rss children)
190
+ * - tests_sent string tests sent
191
+ * - tests_remain string test sends remaining
192
+ * - tracking associative_array the various tracking options used
193
+ * - html_clicks boolean whether or not tracking for html clicks was enabled.
194
+ * - text_clicks boolean whether or not tracking for text clicks was enabled.
195
+ * - opens boolean whether or not opens tracking was enabled.
196
+ * - segment_text string a string marked-up with HTML explaining the segment used for the campaign in plain English
197
+ * - segment_opts array the segment used for the campaign - can be passed to campaigns/segment-test or campaigns/create()
198
+ * - saved_segment associative_array if a saved segment was used (match+conditions returned above):
199
+ * - id associative_array the saved segment id
200
+ * - type associative_array the saved segment type
201
+ * - name associative_array the saved segment name
202
+ * - type_opts associative_array the type-specific options for the campaign - can be passed to campaigns/create()
203
+ * - comments_total int total number of comments left on this campaign
204
+ * - comments_unread int total number of unread comments for this campaign based on the login the apikey belongs to
205
+ * - summary associative_array if available, the basic aggregate stats returned by reports/summary
206
+ * - errors array structs of any errors found while loading lists - usually just from providing invalid list ids
207
+ * - filter string the filter that caused the failure
208
+ * - value string the filter value that caused the failure
209
+ * - code int the error code
210
+ * - error int the error message
211
+ */
212
+ public function getList($filters=array(), $start=0, $limit=25, $sort_field='create_time', $sort_dir='DESC') {
213
+ $_params = array("filters" => $filters, "start" => $start, "limit" => $limit, "sort_field" => $sort_field, "sort_dir" => $sort_dir);
214
+ return $this->master->call('campaigns/list', $_params);
215
+ }
216
+
217
+ /**
218
+ * Pause an AutoResponder or RSS campaign from sending
219
+ * @param string $cid
220
+ * @return associative_array with a single entry:
221
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
222
+ */
223
+ public function pause($cid) {
224
+ $_params = array("cid" => $cid);
225
+ return $this->master->call('campaigns/pause', $_params);
226
+ }
227
+
228
+ /**
229
+ * Returns information on whether a campaign is ready to send and possible issues we may have detected with it - very similar to the confirmation step in the app.
230
+ * @param string $cid
231
+ * @return associative_array containing:
232
+ * - is_ready bool whether or not you're going to be able to send this campaign
233
+ * - items array an array of structs explaining basically what the app's confirmation step would
234
+ * - type string the item type - generally success, warning, or error
235
+ * - heading string the item's heading in the app
236
+ * - details string the item's details from the app, sans any html tags/links
237
+ */
238
+ public function ready($cid) {
239
+ $_params = array("cid" => $cid);
240
+ return $this->master->call('campaigns/ready', $_params);
241
+ }
242
+
243
+ /**
244
+ * Replicate a campaign.
245
+ * @param string $cid
246
+ * @return associative_array the matching campaign's details - will return same data as single campaign from campaigns/list()
247
+ */
248
+ public function replicate($cid) {
249
+ $_params = array("cid" => $cid);
250
+ return $this->master->call('campaigns/replicate', $_params);
251
+ }
252
+
253
+ /**
254
+ * Resume sending an AutoResponder or RSS campaign
255
+ * @param string $cid
256
+ * @return associative_array with a single entry:
257
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
258
+ */
259
+ public function resume($cid) {
260
+ $_params = array("cid" => $cid);
261
+ return $this->master->call('campaigns/resume', $_params);
262
+ }
263
+
264
+ /**
265
+ * Schedule a campaign to be sent in the future
266
+ * @param string $cid
267
+ * @param string $schedule_time
268
+ * @param string $schedule_time_b
269
+ * @return associative_array with a single entry:
270
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
271
+ */
272
+ public function schedule($cid, $schedule_time, $schedule_time_b=null) {
273
+ $_params = array("cid" => $cid, "schedule_time" => $schedule_time, "schedule_time_b" => $schedule_time_b);
274
+ return $this->master->call('campaigns/schedule', $_params);
275
+ }
276
+
277
+ /**
278
+ * Schedule a campaign to be sent in batches sometime in the future. Only valid for "regular" campaigns
279
+ * @param string $cid
280
+ * @param string $schedule_time
281
+ * @param int $num_batches
282
+ * @param int $stagger_mins
283
+ * @return associative_array with a single entry:
284
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
285
+ */
286
+ public function scheduleBatch($cid, $schedule_time, $num_batches=2, $stagger_mins=5) {
287
+ $_params = array("cid" => $cid, "schedule_time" => $schedule_time, "num_batches" => $num_batches, "stagger_mins" => $stagger_mins);
288
+ return $this->master->call('campaigns/schedule-batch', $_params);
289
+ }
290
+
291
+ /**
292
+ * Allows one to test their segmentation rules before creating a campaign using them
293
+ * @param string $list_id
294
+ * @param associative_array $options
295
+ * - saved_segment_id string a saved segment id from lists/segments() - this will take precendence, otherwise the match+conditions are required.
296
+ * - match string controls whether to use AND or OR when applying your options - expects "<strong>any</strong>" (for OR) or "<strong>all</strong>" (for AND)
297
+ * - conditions array of up to 5 structs for different criteria to apply while segmenting. Each criteria row must contain 3 keys - "<strong>field</strong>", "<strong>op</strong>", and "<strong>value</strong>" - and possibly a fourth, "<strong>extra</strong>", based on these definitions:
298
+ * @return associative_array with a single entry:
299
+ * - total int The total number of subscribers matching your segmentation options
300
+ */
301
+ public function segmentTest($list_id, $options) {
302
+ $_params = array("list_id" => $list_id, "options" => $options);
303
+ return $this->master->call('campaigns/segment-test', $_params);
304
+ }
305
+
306
+ /**
307
+ * Send a given campaign immediately. For RSS campaigns, this will "start" them.
308
+ * @param string $cid
309
+ * @return associative_array with a single entry:
310
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
311
+ */
312
+ public function send($cid) {
313
+ $_params = array("cid" => $cid);
314
+ return $this->master->call('campaigns/send', $_params);
315
+ }
316
+
317
+ /**
318
+ * Send a test of this campaign to the provided email addresses
319
+ * @param string $cid
320
+ * @param array $test_emails
321
+ * @param string $send_type
322
+ * @return associative_array with a single entry:
323
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
324
+ */
325
+ public function sendTest($cid, $test_emails=array(), $send_type='html') {
326
+ $_params = array("cid" => $cid, "test_emails" => $test_emails, "send_type" => $send_type);
327
+ return $this->master->call('campaigns/send-test', $_params);
328
+ }
329
+
330
+ /**
331
+ * Get the HTML template content sections for a campaign. Note that this <strong>will</strong> return very jagged, non-standard results based on the template
332
+ a campaign is using. You only want to use this if you want to allow editing template sections in your application.
333
+ * @param string $cid
334
+ * @return associative_array content containing all content section for the campaign - section name are dependent upon the template used and thus can't be documented
335
+ */
336
+ public function templateContent($cid) {
337
+ $_params = array("cid" => $cid);
338
+ return $this->master->call('campaigns/template-content', $_params);
339
+ }
340
+
341
+ /**
342
+ * Unschedule a campaign that is scheduled to be sent in the future
343
+ * @param string $cid
344
+ * @return associative_array with a single entry:
345
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
346
+ */
347
+ public function unschedule($cid) {
348
+ $_params = array("cid" => $cid);
349
+ return $this->master->call('campaigns/unschedule', $_params);
350
+ }
351
+
352
+ /**
353
+ * Update just about any setting besides type for a campaign that has <em>not</em> been sent. See campaigns/create() for details.
354
+ Caveats:<br/><ul class='bullets'>
355
+ <li>If you set a new list_id, all segmentation options will be deleted and must be re-added.</li>
356
+ <li>If you set template_id, you need to follow that up by setting it's 'content'</li>
357
+ <li>If you set segment_opts, you should have tested your options against campaigns/segment-test().</li>
358
+ <li>To clear/unset segment_opts, pass an empty string or array as the value. Various wrappers may require one or the other.</li>
359
+ </ul>
360
+ * @param string $cid
361
+ * @param string $name
362
+ * @param array $value
363
+ * @return associative_array updated campaign details and any errors
364
+ * - data associative_array the update campaign details - will return same data as single campaign from campaigns/list()
365
+ * - errors array for "options" only - structs containing:
366
+ * - code int the error code
367
+ * - message string the full error message
368
+ * - name string the parameter name that failed
369
+ */
370
+ public function update($cid, $name, $value) {
371
+ $_params = array("cid" => $cid, "name" => $name, "value" => $value);
372
+ return $this->master->call('campaigns/update', $_params);
373
+ }
374
+
375
+ }
376
+
377
+
Mailchimp/Ecomm.php CHANGED
@@ -1,86 +1,86 @@
1
- <?php
2
-
3
- class Mailchimp_Ecomm {
4
- public function __construct(wpyksMCAPI $master) {
5
- $this->master = $master;
6
- }
7
-
8
- /**
9
- * Import Ecommerce Order Information to be used for Segmentation. This will generally be used by ecommerce package plugins
10
- <a href="http://connect.mailchimp.com/category/ecommerce" target="_blank">provided by us or by 3rd part system developers</a>.
11
- * @param associative_array $order
12
- * - id string the Order Id
13
- * - campaign_id string optional the Campaign Id to track this order against (see the "mc_cid" query string variable a campaign passes)
14
- * - email_id string optional (kind of) the Email Id of the subscriber we should attach this order to (see the "mc_eid" query string variable a campaign passes) - required if campaign_id is passed, otherwise either this or <strong>email</strong> is required. If both are provided, email_id takes precedence
15
- * - email string optional (kind of) the Email Address we should attach this order to - either this or <strong>email_id</strong> is required. If both are provided, email_id takes precedence
16
- * - total double The Order Total (ie, the full amount the customer ends up paying)
17
- * - order_date string optional the date of the order - if this is not provided, we will default the date to now. Should be in the format of 2012-12-30
18
- * - shipping double optional the total paid for Shipping Fees
19
- * - tax double optional the total tax paid
20
- * - store_id string a unique id for the store sending the order in (32 bytes max)
21
- * - store_name string optional a "nice" name for the store - typically the base web address (ie, "store.mailchimp.com"). We will automatically update this if it changes (based on store_id)
22
- * - items array structs for each individual line item including:
23
- * - line_num int optional the line number of the item on the order. We will generate these if they are not passed
24
- * - product_id int the store's internal Id for the product. Lines that do no contain this will be skipped
25
- * - sku string optional the store's internal SKU for the product. (max 30 bytes)
26
- * - product_name string the product name for the product_id associated with this item. We will auto update these as they change (based on product_id)
27
- * - category_id int the store's internal Id for the (main) category associated with this product. Our testing has found this to be a "best guess" scenario
28
- * - category_name string the category name for the category_id this product is in. Our testing has found this to be a "best guess" scenario. Our plugins walk the category heirarchy up and send "Root - SubCat1 - SubCat4", etc.
29
- * - qty double optional the quantity of the item ordered - defaults to 1
30
- * - cost double optional the cost of a single item (ie, not the extended cost of the line) - defaults to 0
31
- * @return associative_array with a single entry:
32
- * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
33
- */
34
- public function orderAdd($order) {
35
- $_params = array("order" => $order);
36
- return $this->master->call('ecomm/order-add', $_params);
37
- }
38
-
39
- /**
40
- * Delete Ecommerce Order Information used for segmentation. This will generally be used by ecommerce package plugins
41
- <a href="/plugins/ecomm360.phtml">that we provide</a> or by 3rd part system developers.
42
- * @param string $store_id
43
- * @param string $order_id
44
- * @return associative_array with a single entry:
45
- * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
46
- */
47
- public function orderDel($store_id, $order_id) {
48
- $_params = array("store_id" => $store_id, "order_id" => $order_id);
49
- return $this->master->call('ecomm/order-del', $_params);
50
- }
51
-
52
- /**
53
- * Retrieve the Ecommerce Orders for an account
54
- * @param string $cid
55
- * @param int $start
56
- * @param int $limit
57
- * @param string $since
58
- * @return associative_array the total matching orders and the specific orders for the requested page
59
- * - total int the total matching orders
60
- * - data array structs for each order being returned
61
- * - store_id string the store id generated by the plugin used to uniquely identify a store
62
- * - store_name string the store name collected by the plugin - often the domain name
63
- * - order_id string the internal order id the store tracked this order by
64
- * - email string the email address that received this campaign and is associated with this order
65
- * - order_total double the order total
66
- * - tax_total double the total tax for the order (if collected)
67
- * - ship_total double the shipping total for the order (if collected)
68
- * - order_date string the date the order was tracked - from the store if possible, otherwise the GMT time we received it
69
- * - items array structs for each line item on this order.:
70
- * - line_num int the line number
71
- * - product_id int the product id
72
- * - product_name string the product name
73
- * - product_sku string the sku for the product
74
- * - product_category_id int the category id for the product
75
- * - product_category_name string the category name for the product
76
- * - qty int the quantity ordered
77
- * - cost double the cost of the item
78
- */
79
- public function orders($cid=null, $start=0, $limit=100, $since=null) {
80
- $_params = array("cid" => $cid, "start" => $start, "limit" => $limit, "since" => $since);
81
- return $this->master->call('ecomm/orders', $_params);
82
- }
83
-
84
- }
85
-
86
-
1
+ <?php
2
+
3
+ class Mailchimp_Ecomm {
4
+ public function __construct(wpyksMCAPI $master) {
5
+ $this->master = $master;
6
+ }
7
+
8
+ /**
9
+ * Import Ecommerce Order Information to be used for Segmentation. This will generally be used by ecommerce package plugins
10
+ <a href="http://connect.mailchimp.com/category/ecommerce" target="_blank">provided by us or by 3rd part system developers</a>.
11
+ * @param associative_array $order
12
+ * - id string the Order Id
13
+ * - campaign_id string optional the Campaign Id to track this order against (see the "mc_cid" query string variable a campaign passes)
14
+ * - email_id string optional (kind of) the Email Id of the subscriber we should attach this order to (see the "mc_eid" query string variable a campaign passes) - required if campaign_id is passed, otherwise either this or <strong>email</strong> is required. If both are provided, email_id takes precedence
15
+ * - email string optional (kind of) the Email Address we should attach this order to - either this or <strong>email_id</strong> is required. If both are provided, email_id takes precedence
16
+ * - total double The Order Total (ie, the full amount the customer ends up paying)
17
+ * - order_date string optional the date of the order - if this is not provided, we will default the date to now. Should be in the format of 2012-12-30
18
+ * - shipping double optional the total paid for Shipping Fees
19
+ * - tax double optional the total tax paid
20
+ * - store_id string a unique id for the store sending the order in (32 bytes max)
21
+ * - store_name string optional a "nice" name for the store - typically the base web address (ie, "store.mailchimp.com"). We will automatically update this if it changes (based on store_id)
22
+ * - items array structs for each individual line item including:
23
+ * - line_num int optional the line number of the item on the order. We will generate these if they are not passed
24
+ * - product_id int the store's internal Id for the product. Lines that do no contain this will be skipped
25
+ * - sku string optional the store's internal SKU for the product. (max 30 bytes)
26
+ * - product_name string the product name for the product_id associated with this item. We will auto update these as they change (based on product_id)
27
+ * - category_id int the store's internal Id for the (main) category associated with this product. Our testing has found this to be a "best guess" scenario
28
+ * - category_name string the category name for the category_id this product is in. Our testing has found this to be a "best guess" scenario. Our plugins walk the category heirarchy up and send "Root - SubCat1 - SubCat4", etc.
29
+ * - qty double optional the quantity of the item ordered - defaults to 1
30
+ * - cost double optional the cost of a single item (ie, not the extended cost of the line) - defaults to 0
31
+ * @return associative_array with a single entry:
32
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
33
+ */
34
+ public function orderAdd($order) {
35
+ $_params = array("order" => $order);
36
+ return $this->master->call('ecomm/order-add', $_params);
37
+ }
38
+
39
+ /**
40
+ * Delete Ecommerce Order Information used for segmentation. This will generally be used by ecommerce package plugins
41
+ <a href="/plugins/ecomm360.phtml">that we provide</a> or by 3rd part system developers.
42
+ * @param string $store_id
43
+ * @param string $order_id
44
+ * @return associative_array with a single entry:
45
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
46
+ */
47
+ public function orderDel($store_id, $order_id) {
48
+ $_params = array("store_id" => $store_id, "order_id" => $order_id);
49
+ return $this->master->call('ecomm/order-del', $_params);
50
+ }
51
+
52
+ /**
53
+ * Retrieve the Ecommerce Orders for an account
54
+ * @param string $cid
55
+ * @param int $start
56
+ * @param int $limit
57
+ * @param string $since
58
+ * @return associative_array the total matching orders and the specific orders for the requested page
59
+ * - total int the total matching orders
60
+ * - data array structs for each order being returned
61
+ * - store_id string the store id generated by the plugin used to uniquely identify a store
62
+ * - store_name string the store name collected by the plugin - often the domain name
63
+ * - order_id string the internal order id the store tracked this order by
64
+ * - email string the email address that received this campaign and is associated with this order
65
+ * - order_total double the order total
66
+ * - tax_total double the total tax for the order (if collected)
67
+ * - ship_total double the shipping total for the order (if collected)
68
+ * - order_date string the date the order was tracked - from the store if possible, otherwise the GMT time we received it
69
+ * - items array structs for each line item on this order.:
70
+ * - line_num int the line number
71
+ * - product_id int the product id
72
+ * - product_name string the product name
73
+ * - product_sku string the sku for the product
74
+ * - product_category_id int the category id for the product
75
+ * - product_category_name string the category name for the product
76
+ * - qty int the quantity ordered
77
+ * - cost double the cost of the item
78
+ */
79
+ public function orders($cid=null, $start=0, $limit=100, $since=null) {
80
+ $_params = array("cid" => $cid, "start" => $start, "limit" => $limit, "since" => $since);
81
+ return $this->master->call('ecomm/orders', $_params);
82
+ }
83
+
84
+ }
85
+
86
+
Mailchimp/Exceptions.php CHANGED
@@ -1,441 +1,441 @@
1
- <?php
2
-
3
- class Mailchimp_Error extends Exception {}
4
- class Mailchimp_HttpError extends Mailchimp_Error {}
5
-
6
- /**
7
- * The parameters passed to the API call are invalid or not provided when required
8
- */
9
- class Mailchimp_ValidationError extends Mailchimp_Error {}
10
-
11
- /**
12
- * None
13
- */
14
- class Mailchimp_ServerError_MethodUnknown extends Mailchimp_Error {}
15
-
16
- /**
17
- * None
18
- */
19
- class Mailchimp_ServerError_InvalidParameters extends Mailchimp_Error {}
20
-
21
- /**
22
- * None
23
- */
24
- class Mailchimp_Unknown_Exception extends Mailchimp_Error {}
25
-
26
- /**
27
- * None
28
- */
29
- class Mailchimp_Request_TimedOut extends Mailchimp_Error {}
30
-
31
- /**
32
- * None
33
- */
34
- class Mailchimp_Zend_Uri_Exception extends Mailchimp_Error {}
35
-
36
- /**
37
- * None
38
- */
39
- class Mailchimp_PDOException extends Mailchimp_Error {}
40
-
41
- /**
42
- * None
43
- */
44
- class Mailchimp_Avesta_Db_Exception extends Mailchimp_Error {}
45
-
46
- /**
47
- * None
48
- */
49
- class Mailchimp_XML_RPC2_Exception extends Mailchimp_Error {}
50
-
51
- /**
52
- * None
53
- */
54
- class Mailchimp_XML_RPC2_FaultException extends Mailchimp_Error {}
55
-
56
- /**
57
- * None
58
- */
59
- class Mailchimp_Too_Many_Connections extends Mailchimp_Error {}
60
-
61
- /**
62
- * None
63
- */
64
- class Mailchimp_Parse_Exception extends Mailchimp_Error {}
65
-
66
- /**
67
- * None
68
- */
69
- class Mailchimp_User_Unknown extends Mailchimp_Error {}
70
-
71
- /**
72
- * None
73
- */
74
- class Mailchimp_User_Disabled extends Mailchimp_Error {}
75
-
76
- /**
77
- * None
78
- */
79
- class Mailchimp_User_DoesNotExist extends Mailchimp_Error {}
80
-
81
- /**
82
- * None
83
- */
84
- class Mailchimp_User_NotApproved extends Mailchimp_Error {}
85
-
86
- /**
87
- * None
88
- */
89
- class Mailchimp_Invalid_ApiKey extends Mailchimp_Error {}
90
-
91
- /**
92
- * None
93
- */
94
- class Mailchimp_User_UnderMaintenance extends Mailchimp_Error {}
95
-
96
- /**
97
- * None
98
- */
99
- class Mailchimp_Invalid_AppKey extends Mailchimp_Error {}
100
-
101
- /**
102
- * None
103
- */
104
- class Mailchimp_Invalid_IP extends Mailchimp_Error {}
105
-
106
- /**
107
- * None
108
- */
109
- class Mailchimp_User_DoesExist extends Mailchimp_Error {}
110
-
111
- /**
112
- * None
113
- */
114
- class Mailchimp_User_InvalidRole extends Mailchimp_Error {}
115
-
116
- /**
117
- * None
118
- */
119
- class Mailchimp_User_InvalidAction extends Mailchimp_Error {}
120
-
121
- /**
122
- * None
123
- */
124
- class Mailchimp_User_MissingEmail extends Mailchimp_Error {}
125
-
126
- /**
127
- * None
128
- */
129
- class Mailchimp_User_CannotSendCampaign extends Mailchimp_Error {}
130
-
131
- /**
132
- * None
133
- */
134
- class Mailchimp_User_MissingModuleOutbox extends Mailchimp_Error {}
135
-
136
- /**
137
- * None
138
- */
139
- class Mailchimp_User_ModuleAlreadyPurchased extends Mailchimp_Error {}
140
-
141
- /**
142
- * None
143
- */
144
- class Mailchimp_User_ModuleNotPurchased extends Mailchimp_Error {}
145
-
146
- /**
147
- * None
148
- */
149
- class Mailchimp_User_NotEnoughCredit extends Mailchimp_Error {}
150
-
151
- /**
152
- * None
153
- */
154
- class Mailchimp_MC_InvalidPayment extends Mailchimp_Error {}
155
-
156
- /**
157
- * None
158
- */
159
- class Mailchimp_List_DoesNotExist extends Mailchimp_Error {}
160
-
161
- /**
162
- * None
163
- */
164
- class Mailchimp_List_InvalidInterestFieldType extends Mailchimp_Error {}
165
-
166
- /**
167
- * None
168
- */
169
- class Mailchimp_List_InvalidOption extends Mailchimp_Error {}
170
-
171
- /**
172
- * None
173
- */
174
- class Mailchimp_List_InvalidUnsubMember extends Mailchimp_Error {}
175
-
176
- /**
177
- * None
178
- */
179
- class Mailchimp_List_InvalidBounceMember extends Mailchimp_Error {}
180
-
181
- /**
182
- * None
183
- */
184
- class Mailchimp_List_AlreadySubscribed extends Mailchimp_Error {}
185
-
186
- /**
187
- * None
188
- */
189
- class Mailchimp_List_NotSubscribed extends Mailchimp_Error {}
190
-
191
- /**
192
- * None
193
- */
194
- class Mailchimp_List_InvalidImport extends Mailchimp_Error {}
195
-
196
- /**
197
- * None
198
- */
199
- class Mailchimp_MC_PastedList_Duplicate extends Mailchimp_Error {}
200
-
201
- /**
202
- * None
203
- */
204
- class Mailchimp_MC_PastedList_InvalidImport extends Mailchimp_Error {}
205
-
206
- /**
207
- * None
208
- */
209
- class Mailchimp_Email_AlreadySubscribed extends Mailchimp_Error {}
210
-
211
- /**
212
- * None
213
- */
214
- class Mailchimp_Email_AlreadyUnsubscribed extends Mailchimp_Error {}
215
-
216
- /**
217
- * None
218
- */
219
- class Mailchimp_Email_NotExists extends Mailchimp_Error {}
220
-
221
- /**
222
- * None
223
- */
224
- class Mailchimp_Email_NotSubscribed extends Mailchimp_Error {}
225
-
226
- /**
227
- * None
228
- */
229
- class Mailchimp_List_MergeFieldRequired extends Mailchimp_Error {}
230
-
231
- /**
232
- * None
233
- */
234
- class Mailchimp_List_CannotRemoveEmailMerge extends Mailchimp_Error {}
235
-
236
- /**
237
- * None
238
- */
239
- class Mailchimp_List_Merge_InvalidMergeID extends Mailchimp_Error {}
240
-
241
- /**
242
- * None
243
- */
244
- class Mailchimp_List_TooManyMergeFields extends Mailchimp_Error {}
245
-
246
- /**
247
- * None
248
- */
249
- class Mailchimp_List_InvalidMergeField extends Mailchimp_Error {}
250
-
251
- /**
252
- * None
253
- */
254
- class Mailchimp_List_InvalidInterestGroup extends Mailchimp_Error {}
255
-
256
- /**
257
- * None
258
- */
259
- class Mailchimp_List_TooManyInterestGroups extends Mailchimp_Error {}
260
-
261
- /**
262
- * None
263
- */
264
- class Mailchimp_Campaign_DoesNotExist extends Mailchimp_Error {}
265
-
266
- /**
267
- * None
268
- */
269
- class Mailchimp_Campaign_StatsNotAvailable extends Mailchimp_Error {}
270
-
271
- /**
272
- * None
273
- */
274
- class Mailchimp_Campaign_InvalidAbsplit extends Mailchimp_Error {}
275
-
276
- /**
277
- * None
278
- */
279
- class Mailchimp_Campaign_InvalidContent extends Mailchimp_Error {}
280
-
281
- /**
282
- * None
283
- */
284
- class Mailchimp_Campaign_InvalidOption extends Mailchimp_Error {}
285
-
286
- /**
287
- * None
288
- */
289
- class Mailchimp_Campaign_InvalidStatus extends Mailchimp_Error {}
290
-
291
- /**
292
- * None
293
- */
294
- class Mailchimp_Campaign_NotSaved extends Mailchimp_Error {}
295
-
296
- /**
297
- * None
298
- */
299
- class Mailchimp_Campaign_InvalidSegment extends Mailchimp_Error {}
300
-
301
- /**
302
- * None
303
- */
304
- class Mailchimp_Campaign_InvalidRss extends Mailchimp_Error {}
305
-
306
- /**
307
- * None
308
- */
309
- class Mailchimp_Campaign_InvalidAuto extends Mailchimp_Error {}
310
-
311
- /**
312
- * None
313
- */
314
- class Mailchimp_MC_ContentImport_InvalidArchive extends Mailchimp_Error {}
315
-
316
- /**
317
- * None
318
- */
319
- class Mailchimp_Campaign_BounceMissing extends Mailchimp_Error {}
320
-
321
- /**
322
- * None
323
- */
324
- class Mailchimp_Campaign_InvalidTemplate extends Mailchimp_Error {}
325
-
326
- /**
327
- * None
328
- */
329
- class Mailchimp_Invalid_EcommOrder extends Mailchimp_Error {}
330
-
331
- /**
332
- * None
333
- */
334
- class Mailchimp_Absplit_UnknownError extends Mailchimp_Error {}
335
-
336
- /**
337
- * None
338
- */
339
- class Mailchimp_Absplit_UnknownSplitTest extends Mailchimp_Error {}
340
-
341
- /**
342
- * None
343
- */
344
- class Mailchimp_Absplit_UnknownTestType extends Mailchimp_Error {}
345
-
346
- /**
347
- * None
348
- */
349
- class Mailchimp_Absplit_UnknownWaitUnit extends Mailchimp_Error {}
350
-
351
- /**
352
- * None
353
- */
354
- class Mailchimp_Absplit_UnknownWinnerType extends Mailchimp_Error {}
355
-
356
- /**
357
- * None
358
- */
359
- class Mailchimp_Absplit_WinnerNotSelected extends Mailchimp_Error {}
360
-
361
- /**
362
- * None
363
- */
364
- class Mailchimp_Invalid_Analytics extends Mailchimp_Error {}
365
-
366
- /**
367
- * None
368
- */
369
- class Mailchimp_Invalid_DateTime extends Mailchimp_Error {}
370
-
371
- /**
372
- * None
373
- */
374
- class Mailchimp_Invalid_Email extends Mailchimp_Error {}
375
-
376
- /**
377
- * None
378
- */
379
- class Mailchimp_Invalid_SendType extends Mailchimp_Error {}
380
-
381
- /**
382
- * None
383
- */
384
- class Mailchimp_Invalid_Template extends Mailchimp_Error {}
385
-
386
- /**
387
- * None
388
- */
389
- class Mailchimp_Invalid_TrackingOptions extends Mailchimp_Error {}
390
-
391
- /**
392
- * None
393
- */
394
- class Mailchimp_Invalid_Options extends Mailchimp_Error {}
395
-
396
- /**
397
- * None
398
- */
399
- class Mailchimp_Invalid_Folder extends Mailchimp_Error {}
400
-
401
- /**
402
- * None
403
- */
404
- class Mailchimp_Invalid_URL extends Mailchimp_Error {}
405
-
406
- /**
407
- * None
408
- */
409
- class Mailchimp_Module_Unknown extends Mailchimp_Error {}
410
-
411
- /**
412
- * None
413
- */
414
- class Mailchimp_MonthlyPlan_Unknown extends Mailchimp_Error {}
415
-
416
- /**
417
- * None
418
- */
419
- class Mailchimp_Order_TypeUnknown extends Mailchimp_Error {}
420
-
421
- /**
422
- * None
423
- */
424
- class Mailchimp_Invalid_PagingLimit extends Mailchimp_Error {}
425
-
426
- /**
427
- * None
428
- */
429
- class Mailchimp_Invalid_PagingStart extends Mailchimp_Error {}
430
-
431
- /**
432
- * None
433
- */
434
- class Mailchimp_Max_Size_Reached extends Mailchimp_Error {}
435
-
436
- /**
437
- * None
438
- */
439
- class Mailchimp_MC_SearchException extends Mailchimp_Error {}
440
-
441
-
1
+ <?php
2
+
3
+ class Mailchimp_Error extends Exception {}
4
+ class Mailchimp_HttpError extends Mailchimp_Error {}
5
+
6
+ /**
7
+ * The parameters passed to the API call are invalid or not provided when required
8
+ */
9
+ class Mailchimp_ValidationError extends Mailchimp_Error {}
10
+
11
+ /**
12
+ * None
13
+ */
14
+ class Mailchimp_ServerError_MethodUnknown extends Mailchimp_Error {}
15
+
16
+ /**
17
+ * None
18
+ */
19
+ class Mailchimp_ServerError_InvalidParameters extends Mailchimp_Error {}
20
+
21
+ /**
22
+ * None
23
+ */
24
+ class Mailchimp_Unknown_Exception extends Mailchimp_Error {}
25
+
26
+ /**
27
+ * None
28
+ */
29
+ class Mailchimp_Request_TimedOut extends Mailchimp_Error {}
30
+
31
+ /**
32
+ * None
33
+ */
34
+ class Mailchimp_Zend_Uri_Exception extends Mailchimp_Error {}
35
+
36
+ /**
37
+ * None
38
+ */
39
+ class Mailchimp_PDOException extends Mailchimp_Error {}
40
+
41
+ /**
42
+ * None
43
+ */
44
+ class Mailchimp_Avesta_Db_Exception extends Mailchimp_Error {}
45
+
46
+ /**
47
+ * None
48
+ */
49
+ class Mailchimp_XML_RPC2_Exception extends Mailchimp_Error {}
50
+
51
+ /**
52
+ * None
53
+ */
54
+ class Mailchimp_XML_RPC2_FaultException extends Mailchimp_Error {}
55
+
56
+ /**
57
+ * None
58
+ */
59
+ class Mailchimp_Too_Many_Connections extends Mailchimp_Error {}
60
+
61
+ /**
62
+ * None
63
+ */
64
+ class Mailchimp_Parse_Exception extends Mailchimp_Error {}
65
+
66
+ /**
67
+ * None
68
+ */
69
+ class Mailchimp_User_Unknown extends Mailchimp_Error {}
70
+
71
+ /**
72
+ * None
73
+ */
74
+ class Mailchimp_User_Disabled extends Mailchimp_Error {}
75
+
76
+ /**
77
+ * None
78
+ */
79
+ class Mailchimp_User_DoesNotExist extends Mailchimp_Error {}
80
+
81
+ /**
82
+ * None
83
+ */
84
+ class Mailchimp_User_NotApproved extends Mailchimp_Error {}
85
+
86
+ /**
87
+ * None
88
+ */
89
+ class Mailchimp_Invalid_ApiKey extends Mailchimp_Error {}
90
+
91
+ /**
92
+ * None
93
+ */
94
+ class Mailchimp_User_UnderMaintenance extends Mailchimp_Error {}
95
+
96
+ /**
97
+ * None
98
+ */
99
+ class Mailchimp_Invalid_AppKey extends Mailchimp_Error {}
100
+
101
+ /**
102
+ * None
103
+ */
104
+ class Mailchimp_Invalid_IP extends Mailchimp_Error {}
105
+
106
+ /**
107
+ * None
108
+ */
109
+ class Mailchimp_User_DoesExist extends Mailchimp_Error {}
110
+
111
+ /**
112
+ * None
113
+ */
114
+ class Mailchimp_User_InvalidRole extends Mailchimp_Error {}
115
+
116
+ /**
117
+ * None
118
+ */
119
+ class Mailchimp_User_InvalidAction extends Mailchimp_Error {}
120
+
121
+ /**
122
+ * None
123
+ */
124
+ class Mailchimp_User_MissingEmail extends Mailchimp_Error {}
125
+
126
+ /**
127
+ * None
128
+ */
129
+ class Mailchimp_User_CannotSendCampaign extends Mailchimp_Error {}
130
+
131
+ /**
132
+ * None
133
+ */
134
+ class Mailchimp_User_MissingModuleOutbox extends Mailchimp_Error {}
135
+
136
+ /**
137
+ * None
138
+ */
139
+ class Mailchimp_User_ModuleAlreadyPurchased extends Mailchimp_Error {}
140
+
141
+ /**
142
+ * None
143
+ */
144
+ class Mailchimp_User_ModuleNotPurchased extends Mailchimp_Error {}
145
+
146
+ /**
147
+ * None
148
+ */
149
+ class Mailchimp_User_NotEnoughCredit extends Mailchimp_Error {}
150
+
151
+ /**
152
+ * None
153
+ */
154
+ class Mailchimp_MC_InvalidPayment extends Mailchimp_Error {}
155
+
156
+ /**
157
+ * None
158
+ */
159
+ class Mailchimp_List_DoesNotExist extends Mailchimp_Error {}
160
+
161
+ /**
162
+ * None
163
+ */
164
+ class Mailchimp_List_InvalidInterestFieldType extends Mailchimp_Error {}
165
+
166
+ /**
167
+ * None
168
+ */
169
+ class Mailchimp_List_InvalidOption extends Mailchimp_Error {}
170
+
171
+ /**
172
+ * None
173
+ */
174
+ class Mailchimp_List_InvalidUnsubMember extends Mailchimp_Error {}
175
+
176
+ /**
177
+ * None
178
+ */
179
+ class Mailchimp_List_InvalidBounceMember extends Mailchimp_Error {}
180
+
181
+ /**
182
+ * None
183
+ */
184
+ class Mailchimp_List_AlreadySubscribed extends Mailchimp_Error {}
185
+
186
+ /**
187
+ * None
188
+ */
189
+ class Mailchimp_List_NotSubscribed extends Mailchimp_Error {}
190
+
191
+ /**
192
+ * None
193
+ */
194
+ class Mailchimp_List_InvalidImport extends Mailchimp_Error {}
195
+
196
+ /**
197
+ * None
198
+ */
199
+ class Mailchimp_MC_PastedList_Duplicate extends Mailchimp_Error {}
200
+
201
+ /**
202
+ * None
203
+ */
204
+ class Mailchimp_MC_PastedList_InvalidImport extends Mailchimp_Error {}
205
+
206
+ /**
207
+ * None
208
+ */
209
+ class Mailchimp_Email_AlreadySubscribed extends Mailchimp_Error {}
210
+
211
+ /**
212
+ * None
213
+ */
214
+ class Mailchimp_Email_AlreadyUnsubscribed extends Mailchimp_Error {}
215
+
216
+ /**
217
+ * None
218
+ */
219
+ class Mailchimp_Email_NotExists extends Mailchimp_Error {}
220
+
221
+ /**
222
+ * None
223
+ */
224
+ class Mailchimp_Email_NotSubscribed extends Mailchimp_Error {}
225
+
226
+ /**
227
+ * None
228
+ */
229
+ class Mailchimp_List_MergeFieldRequired extends Mailchimp_Error {}
230
+
231
+ /**
232
+ * None
233
+ */
234
+ class Mailchimp_List_CannotRemoveEmailMerge extends Mailchimp_Error {}
235
+
236
+ /**
237
+ * None
238
+ */
239
+ class Mailchimp_List_Merge_InvalidMergeID extends Mailchimp_Error {}
240
+
241
+ /**
242
+ * None
243
+ */
244
+ class Mailchimp_List_TooManyMergeFields extends Mailchimp_Error {}
245
+
246
+ /**
247
+ * None
248
+ */
249
+ class Mailchimp_List_InvalidMergeField extends Mailchimp_Error {}
250
+
251
+ /**
252
+ * None
253
+ */
254
+ class Mailchimp_List_InvalidInterestGroup extends Mailchimp_Error {}
255
+
256
+ /**
257
+ * None
258
+ */
259
+ class Mailchimp_List_TooManyInterestGroups extends Mailchimp_Error {}
260
+
261
+ /**
262
+ * None
263
+ */
264
+ class Mailchimp_Campaign_DoesNotExist extends Mailchimp_Error {}
265
+
266
+ /**
267
+ * None
268
+ */
269
+ class Mailchimp_Campaign_StatsNotAvailable extends Mailchimp_Error {}
270
+
271
+ /**
272
+ * None
273
+ */
274
+ class Mailchimp_Campaign_InvalidAbsplit extends Mailchimp_Error {}
275
+
276
+ /**
277
+ * None
278
+ */
279
+ class Mailchimp_Campaign_InvalidContent extends Mailchimp_Error {}
280
+
281
+ /**
282
+ * None
283
+ */
284
+ class Mailchimp_Campaign_InvalidOption extends Mailchimp_Error {}
285
+
286
+ /**
287
+ * None
288
+ */
289
+ class Mailchimp_Campaign_InvalidStatus extends Mailchimp_Error {}
290
+
291
+ /**
292
+ * None
293
+ */
294
+ class Mailchimp_Campaign_NotSaved extends Mailchimp_Error {}
295
+
296
+ /**
297
+ * None
298
+ */
299
+ class Mailchimp_Campaign_InvalidSegment extends Mailchimp_Error {}
300
+
301
+ /**
302
+ * None
303
+ */
304
+ class Mailchimp_Campaign_InvalidRss extends Mailchimp_Error {}
305
+
306
+ /**
307
+ * None
308
+ */
309
+ class Mailchimp_Campaign_InvalidAuto extends Mailchimp_Error {}
310
+
311
+ /**
312
+ * None
313
+ */
314
+ class Mailchimp_MC_ContentImport_InvalidArchive extends Mailchimp_Error {}
315
+
316
+ /**
317
+ * None
318
+ */
319
+ class Mailchimp_Campaign_BounceMissing extends Mailchimp_Error {}
320
+
321
+ /**
322
+ * None
323
+ */
324
+ class Mailchimp_Campaign_InvalidTemplate extends Mailchimp_Error {}
325
+
326
+ /**
327
+ * None
328
+ */
329
+ class Mailchimp_Invalid_EcommOrder extends Mailchimp_Error {}
330
+
331
+ /**
332
+ * None
333
+ */
334
+ class Mailchimp_Absplit_UnknownError extends Mailchimp_Error {}
335
+
336
+ /**
337
+ * None
338
+ */
339
+ class Mailchimp_Absplit_UnknownSplitTest extends Mailchimp_Error {}
340
+
341
+ /**
342
+ * None
343
+ */
344
+ class Mailchimp_Absplit_UnknownTestType extends Mailchimp_Error {}
345
+
346
+ /**
347
+ * None
348
+ */
349
+ class Mailchimp_Absplit_UnknownWaitUnit extends Mailchimp_Error {}
350
+
351
+ /**
352
+ * None
353
+ */
354
+ class Mailchimp_Absplit_UnknownWinnerType extends Mailchimp_Error {}
355
+
356
+ /**
357
+ * None
358
+ */
359
+ class Mailchimp_Absplit_WinnerNotSelected extends Mailchimp_Error {}
360
+
361
+ /**
362
+ * None
363
+ */
364
+ class Mailchimp_Invalid_Analytics extends Mailchimp_Error {}
365
+
366
+ /**
367
+ * None
368
+ */
369
+ class Mailchimp_Invalid_DateTime extends Mailchimp_Error {}
370
+
371
+ /**
372
+ * None
373
+ */
374
+ class Mailchimp_Invalid_Email extends Mailchimp_Error {}
375
+
376
+ /**
377
+ * None
378
+ */
379
+ class Mailchimp_Invalid_SendType extends Mailchimp_Error {}
380
+
381
+ /**
382
+ * None
383
+ */
384
+ class Mailchimp_Invalid_Template extends Mailchimp_Error {}
385
+
386
+ /**
387
+ * None
388
+ */
389
+ class Mailchimp_Invalid_TrackingOptions extends Mailchimp_Error {}
390
+
391
+ /**
392
+ * None
393
+ */
394
+ class Mailchimp_Invalid_Options extends Mailchimp_Error {}
395
+
396
+ /**
397
+ * None
398
+ */
399
+ class Mailchimp_Invalid_Folder extends Mailchimp_Error {}
400
+
401
+ /**
402
+ * None
403
+ */
404
+ class Mailchimp_Invalid_URL extends Mailchimp_Error {}
405
+
406
+ /**
407
+ * None
408
+ */
409
+ class Mailchimp_Module_Unknown extends Mailchimp_Error {}
410
+
411
+ /**
412
+ * None
413
+ */
414
+ class Mailchimp_MonthlyPlan_Unknown extends Mailchimp_Error {}
415
+
416
+ /**
417
+ * None
418
+ */
419
+ class Mailchimp_Order_TypeUnknown extends Mailchimp_Error {}
420
+
421
+ /**
422
+ * None
423
+ */
424
+ class Mailchimp_Invalid_PagingLimit extends Mailchimp_Error {}
425
+
426
+ /**
427
+ * None
428
+ */
429
+ class Mailchimp_Invalid_PagingStart extends Mailchimp_Error {}
430
+
431
+ /**
432
+ * None
433
+ */
434
+ class Mailchimp_Max_Size_Reached extends Mailchimp_Error {}
435
+
436
+ /**
437
+ * None
438
+ */
439
+ class Mailchimp_MC_SearchException extends Mailchimp_Error {}
440
+
441
+
Mailchimp/Folders.php CHANGED
@@ -1,62 +1,62 @@
1
- <?php
2
-
3
- class Mailchimp_Folders {
4
- public function __construct(wpyksMCAPI $master) {
5
- $this->master = $master;
6
- }
7
-
8
- /**
9
- * Add a new folder to file campaigns, autoresponders, or templates in
10
- * @param string $name
11
- * @param string $type
12
- * @return associative_array with a single value:
13
- * - folder_id int the folder_id of the newly created folder.
14
- */
15
- public function add($name, $type) {
16
- $_params = array("name" => $name, "type" => $type);
17
- return $this->master->call('folders/add', $_params);
18
- }
19
-
20
- /**
21
- * Delete a campaign, autoresponder, or template folder. Note that this will simply make whatever was in the folder appear unfiled, no other data is removed
22
- * @param int $fid
23
- * @param string $type
24
- * @return associative_array with a single entry:
25
- * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
26
- */
27
- public function del($fid, $type) {
28
- $_params = array("fid" => $fid, "type" => $type);
29
- return $this->master->call('folders/del', $_params);
30
- }
31
-
32
- /**
33
- * List all the folders of a certain type
34
- * @param string $type
35
- * @return array structs for each folder, including:
36
- * - folder_id int Folder Id for the given folder, this can be used in the campaigns/list() function to filter on.
37
- * - name string Name of the given folder
38
- * - date_created string The date/time the folder was created
39
- * - type string The type of the folders being returned, just to make sure you know.
40
- * - cnt int number of items in the folder.
41
- */
42
- public function getList($type) {
43
- $_params = array("type" => $type);
44
- return $this->master->call('folders/list', $_params);
45
- }
46
-
47
- /**
48
- * Update the name of a folder for campaigns, autoresponders, or templates
49
- * @param int $fid
50
- * @param string $name
51
- * @param string $type
52
- * @return associative_array with a single entry:
53
- * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
54
- */
55
- public function update($fid, $name, $type) {
56
- $_params = array("fid" => $fid, "name" => $name, "type" => $type);
57
- return $this->master->call('folders/update', $_params);
58
- }
59
-
60
- }
61
-
62
-
1
+ <?php
2
+
3
+ class Mailchimp_Folders {
4
+ public function __construct(wpyksMCAPI $master) {
5
+ $this->master = $master;
6
+ }
7
+
8
+ /**
9
+ * Add a new folder to file campaigns, autoresponders, or templates in
10
+ * @param string $name
11
+ * @param string $type
12
+ * @return associative_array with a single value:
13
+ * - folder_id int the folder_id of the newly created folder.
14
+ */
15
+ public function add($name, $type) {
16
+ $_params = array("name" => $name, "type" => $type);
17
+ return $this->master->call('folders/add', $_params);
18
+ }
19
+
20
+ /**
21
+ * Delete a campaign, autoresponder, or template folder. Note that this will simply make whatever was in the folder appear unfiled, no other data is removed
22
+ * @param int $fid
23
+ * @param string $type
24
+ * @return associative_array with a single entry:
25
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
26
+ */
27
+ public function del($fid, $type) {
28
+ $_params = array("fid" => $fid, "type" => $type);
29
+ return $this->master->call('folders/del', $_params);
30
+ }
31
+
32
+ /**
33
+ * List all the folders of a certain type
34
+ * @param string $type
35
+ * @return array structs for each folder, including:
36
+ * - folder_id int Folder Id for the given folder, this can be used in the campaigns/list() function to filter on.
37
+ * - name string Name of the given folder
38
+ * - date_created string The date/time the folder was created
39
+ * - type string The type of the folders being returned, just to make sure you know.
40
+ * - cnt int number of items in the folder.
41
+ */
42
+ public function getList($type) {
43
+ $_params = array("type" => $type);
44
+ return $this->master->call('folders/list', $_params);
45
+ }
46
+
47
+ /**
48
+ * Update the name of a folder for campaigns, autoresponders, or templates
49
+ * @param int $fid
50
+ * @param string $name
51
+ * @param string $type
52
+ * @return associative_array with a single entry:
53
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
54
+ */
55
+ public function update($fid, $name, $type) {
56
+ $_params = array("fid" => $fid, "name" => $name, "type" => $type);
57
+ return $this->master->call('folders/update', $_params);
58
+ }
59
+
60
+ }
61
+
62
+
Mailchimp/Gallery.php CHANGED
@@ -1,33 +1,33 @@
1
- <?php
2
-
3
- class Mailchimp_Gallery {
4
- public function __construct(wpyksMCAPI $master) {
5
- $this->master = $master;
6
- }
7
-
8
- /**
9
- * Return a section of the image gallery
10
- * @param associative_array $opts
11
- * - type string optional the gallery type to return - images or files - default to images
12
- * - start int optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
13
- * - limit int optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100
14
- * - sort_by string optional field to sort by - one of size, time, name - defaults to time
15
- * - sort_dir string optional field to sort by - one of asc, desc - defaults to desc
16
- * - search_term string optional a term to search for in names
17
- * @return associative_array the matching gallery items
18
- * - total int the total matching items
19
- * - data array structs for each item included in the set, including:
20
- * - name string the file name
21
- * - time string the creation date for the item
22
- * - size int the file size in bytes
23
- * - full string the url to the actual item in the gallery
24
- * - thumb string a url for a thumbnail that can be used to represent the item, generally an image thumbnail or an icon for a file type
25
- */
26
- public function getList($opts=array()) {
27
- $_params = array("opts" => $opts);
28
- return $this->master->call('gallery/list', $_params);
29
- }
30
-
31
- }
32
-
33
-
1
+ <?php
2
+
3
+ class Mailchimp_Gallery {
4
+ public function __construct(wpyksMCAPI $master) {
5
+ $this->master = $master;
6
+ }
7
+
8
+ /**
9
+ * Return a section of the image gallery
10
+ * @param associative_array $opts
11
+ * - type string optional the gallery type to return - images or files - default to images
12
+ * - start int optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
13
+ * - limit int optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100
14
+ * - sort_by string optional field to sort by - one of size, time, name - defaults to time
15
+ * - sort_dir string optional field to sort by - one of asc, desc - defaults to desc
16
+ * - search_term string optional a term to search for in names
17
+ * @return associative_array the matching gallery items
18
+ * - total int the total matching items
19
+ * - data array structs for each item included in the set, including:
20
+ * - name string the file name
21
+ * - time string the creation date for the item
22
+ * - size int the file size in bytes
23
+ * - full string the url to the actual item in the gallery
24
+ * - thumb string a url for a thumbnail that can be used to represent the item, generally an image thumbnail or an icon for a file type
25
+ */
26
+ public function getList($opts=array()) {
27
+ $_params = array("opts" => $opts);
28
+ return $this->master->call('gallery/list', $_params);
29
+ }
30
+
31
+ }
32
+
33
+
Mailchimp/Helper.php CHANGED
@@ -1,238 +1,238 @@
1
- <?php
2
-
3
- class Mailchimp_Helper {
4
- public function __construct(wpyksMCAPI $master) {
5
- $this->master = $master;
6
- }
7
-
8
- /**
9
- * Retrieve lots of account information including payments made, plan info, some account stats, installed modules,
10
- contact info, and more. No private information like Credit Card numbers is available.
11
- * @param array $exclude
12
- * @return associative_array containing the details for the account tied to this API Key
13
- * - username string The Account username
14
- * - user_id string The Account user unique id (for building some links)
15
- * - is_trial bool Whether the Account is in Trial mode (can only send campaigns to less than 100 emails)
16
- * - is_approved bool Whether the Account has been approved for purchases
17
- * - has_activated bool Whether the Account has been activated
18
- * - timezone string The timezone for the Account - default is "US/Eastern"
19
- * - plan_type string Plan Type - "monthly", "payasyougo", or "free"
20
- * - plan_low int <em>only for Monthly plans</em> - the lower tier for list size
21
- * - plan_high int <em>only for Monthly plans</em> - the upper tier for list size
22
- * - plan_start_date string <em>only for Monthly plans</em> - the start date for a monthly plan
23
- * - emails_left int <em>only for Free and Pay-as-you-go plans</em> emails credits left for the account
24
- * - pending_monthly bool Whether the account is finishing Pay As You Go credits before switching to a Monthly plan
25
- * - first_payment string date of first payment
26
- * - last_payment string date of most recent payment
27
- * - times_logged_in int total number of times the account has been logged into via the web
28
- * - last_login string date/time of last login via the web
29
- * - affiliate_link string Monkey Rewards link for our Affiliate program
30
- * - industry string the user's selected industry
31
- * - contact associative_array Contact details for the account
32
- * - fname string First Name
33
- * - lname string Last Name
34
- * - email string Email Address
35
- * - company string Company Name
36
- * - address1 string Address Line 1
37
- * - address2 string Address Line 2
38
- * - city string City
39
- * - state string State or Province
40
- * - zip string Zip or Postal Code
41
- * - country string Country name
42
- * - url string Website URL
43
- * - phone string Phone number
44
- * - fax string Fax number
45
- * - modules array a struct for each addon module installed in the account
46
- * - id string An internal module id
47
- * - name string The module name
48
- * - added string The date the module was added
49
- * - data associative_array Any extra data associated with this module as key=>value pairs
50
- * - orders array a struct for each order for the account
51
- * - order_id int The order id
52
- * - type string The order type - either "monthly" or "credits"
53
- * - amount double The order amount
54
- * - date string The order date
55
- * - credits_used double The total credits used
56
- * - rewards associative_array Rewards details for the account including credits & inspections earned, number of referrals, referral details, and rewards used
57
- * - referrals_this_month int the total number of referrals this month
58
- * - notify_on string whether or not we notify the user when rewards are earned
59
- * - notify_email string the email address address used for rewards notifications
60
- * - credits associative_array Email credits earned:
61
- * - this_month int credits earned this month
62
- * - total_earned int credits earned all time
63
- * - remaining int credits remaining
64
- * - inspections associative_array Inbox Inspections earned:
65
- * - this_month int credits earned this month
66
- * - total_earned int credits earned all time
67
- * - remaining int credits remaining
68
- * - referrals array a struct for each referral, including:
69
- * - name string the name of the account
70
- * - email string the email address associated with the account
71
- * - signup_date string the signup date for the account
72
- * - type string the source for the referral
73
- * - applied array a struct for each applied rewards, including:
74
- * - value int the number of credits user
75
- * - date string the date applied
76
- * - order_id int the order number credits were applied to
77
- * - order_desc string the order description
78
- * - integrations array a struct for each connected integrations that can be used with campaigns, including:
79
- * - id int an internal id for the integration
80
- * - name string the integration name
81
- * - list_id string either "_any_" when globally accessible or the list id it's valid for use against
82
- * - user_id string if applicable, the user id for the integrated system
83
- * - account string if applicable, the user/account name for the integrated system
84
- * - profiles array For Facebook, users/page that can be posted to.
85
- * - id string the user or page id
86
- * - name string the user or page name
87
- * - is_page bool whether this is a user or a page
88
- */
89
- public function accountDetails($exclude=array()) {
90
- $_params = array("exclude" => $exclude);
91
- return $this->master->call('helper/account-details', $_params);
92
- }
93
-
94
- /**
95
- * Retrieve minimal data for all Campaigns a member was sent
96
- * @param associative_array $email
97
- * - email string an email address
98
- * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
99
- * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
100
- * @param associative_array $options
101
- * - list_id string optional A list_id to limit the campaigns to
102
- * @return array an array of structs containing campaign data for each matching campaign (ordered by send time ascending), including:
103
- * - id string the campaign unique id
104
- * - title string the campaign's title
105
- * - subject string the campaign's subject
106
- * - send_time string the time the campaign was sent
107
- * - type string the campaign type
108
- */
109
- public function campaignsForEmail($email, $options=null) {
110
- $_params = array("email" => $email, "options" => $options);
111
- return $this->master->call('helper/campaigns-for-email', $_params);
112
- }
113
-
114
- /**
115
- * Return the current Chimp Chatter messages for an account.
116
- * @return array An array of structs containing data for each chatter message
117
- * - message string The chatter message
118
- * - type string The type of the message - one of lists:new-subscriber, lists:unsubscribes, lists:profile-updates, campaigns:facebook-likes, campaigns:facebook-comments, campaigns:forward-to-friend, lists:imports, or campaigns:inbox-inspections
119
- * - url string a url into the web app that the message could link to, if applicable
120
- * - list_id string the list_id a message relates to, if applicable. Deleted lists will return -DELETED-
121
- * - campaign_id string the list_id a message relates to, if applicable. Deleted campaigns will return -DELETED-
122
- * - update_time string The date/time the message was last updated
123
- */
124
- public function chimpChatter() {
125
- $_params = array();
126
- return $this->master->call('helper/chimp-chatter', $_params);
127
- }
128
-
129
- /**
130
- * Have HTML content auto-converted to a text-only format. You can send: plain HTML, an existing Campaign Id, or an existing Template Id. Note that this will <strong>not</strong> save anything to or update any of your lists, campaigns, or templates.
131
- It's also not just Lynx and is very fine tuned for our template layouts - your mileage may vary.
132
- * @param string $type
133
- * @param associative_array $content
134
- * - html string optional a single string value,
135
- * - cid string a valid Campaign Id
136
- * - user_template_id string the id of a user template
137
- * - base_template_id string the id of a built in base/basic template
138
- * - gallery_template_id string the id of a built in gallery template
139
- * - url string a valid & public URL to pull html content from
140
- * @return associative_array the content pass in converted to text.
141
- * - text string the converted html
142
- */
143
- public function generateText($type, $content) {
144
- $_params = array("type" => $type, "content" => $content);
145
- return $this->master->call('helper/generate-text', $_params);
146
- }
147
-
148
- /**
149
- * Send your HTML content to have the CSS inlined and optionally remove the original styles.
150
- * @param string $html
151
- * @param bool $strip_css
152
- * @return associative_array with a "html" key
153
- * - html string Your HTML content with all CSS inlined, just like if we sent it.
154
- */
155
- public function inlineCss($html, $strip_css=false) {
156
- $_params = array("html" => $html, "strip_css" => $strip_css);
157
- return $this->master->call('helper/inline-css', $_params);
158
- }
159
-
160
- /**
161
- * Retrieve minimal List data for all lists a member is subscribed to.
162
- * @param associative_array $email
163
- * - email string an email address
164
- * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
165
- * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
166
- * @return array An array of structs with info on the list_id the member is subscribed to.
167
- * - id string the list unique id
168
- * - the web_id id referenced in web interface urls
169
- * - the name list name
170
- */
171
- public function listsForEmail($email) {
172
- $_params = array("email" => $email);
173
- return $this->master->call('helper/lists-for-email', $_params);
174
- }
175
-
176
- /**
177
- * "Ping" the MailChimp API - a simple method you can call that will return a constant value as long as everything is good. Note
178
- than unlike most all of our methods, we don't throw an Exception if we are having issues. You will simply receive a different
179
- string back that will explain our view on what is going on.
180
- * @return associative_array a with a "msg" key
181
- * - msg string containing "Everything's Chimpy!" if everything is chimpy, otherwise returns an error message
182
- */
183
- public function ping() {
184
- $_params = array();
185
- return $this->master->call('helper/ping', $_params);
186
- }
187
-
188
- /**
189
- * Search all campaigns for the specified query terms
190
- * @param string $query
191
- * @param int $offset
192
- * @param string $snip_start
193
- * @param string $snip_end
194
- * @return associative_array containing the total matches and current results
195
- * - total int total campaigns matching
196
- * - results array matching campaigns and snippets
197
- * - snippet string the matching snippet for the campaign
198
- * - campaign associative_array the matching campaign's details - will return same data as single campaign from campaigns/list()
199
- * - summary associative_array if available, the matching campaign's report/summary data, other wise empty
200
- */
201
- public function searchCampaigns($query, $offset=0, $snip_start=null, $snip_end=null) {
202
- $_params = array("query" => $query, "offset" => $offset, "snip_start" => $snip_start, "snip_end" => $snip_end);
203
- return $this->master->call('helper/search-campaigns', $_params);
204
- }
205
-
206
- /**
207
- * Search account wide or on a specific list using the specified query terms
208
- * @param string $query
209
- * @param string $id
210
- * @param int $offset
211
- * @return associative_array An array of both exact matches and partial matches over a full search
212
- * - exact_matches associative_array containing the total matches and current results
213
- * - total int total members matching
214
- * - members array each entry will be struct matching the data format for a single member as returned by lists/member-info()
215
- * - full_search associative_array containing the total matches and current results
216
- * - total int total members matching
217
- * - members array each entry will be struct matching the data format for a single member as returned by lists/member-info()
218
- */
219
- public function searchMembers($query, $id=null, $offset=0) {
220
- $_params = array("query" => $query, "id" => $id, "offset" => $offset);
221
- return $this->master->call('helper/search-members', $_params);
222
- }
223
-
224
- /**
225
- * Retrieve all domain verification records for an account
226
- * @return array structs for each domain verification has been attempted for
227
- * - domain string the verified domain
228
- * - status string the status of the verification - either "verified" or "pending"
229
- * - email string the email address used for verification - "pre-existing" if we automatically backfilled it at some point
230
- */
231
- public function verifiedDomains() {
232
- $_params = array();
233
- return $this->master->call('helper/verified-domains', $_params);
234
- }
235
-
236
- }
237
-
238
-
1
+ <?php
2
+
3
+ class Mailchimp_Helper {
4
+ public function __construct(wpyksMCAPI $master) {
5
+ $this->master = $master;
6
+ }
7
+
8
+ /**
9
+ * Retrieve lots of account information including payments made, plan info, some account stats, installed modules,
10
+ contact info, and more. No private information like Credit Card numbers is available.
11
+ * @param array $exclude
12
+ * @return associative_array containing the details for the account tied to this API Key
13
+ * - username string The Account username
14
+ * - user_id string The Account user unique id (for building some links)
15
+ * - is_trial bool Whether the Account is in Trial mode (can only send campaigns to less than 100 emails)
16
+ * - is_approved bool Whether the Account has been approved for purchases
17
+ * - has_activated bool Whether the Account has been activated
18
+ * - timezone string The timezone for the Account - default is "US/Eastern"
19
+ * - plan_type string Plan Type - "monthly", "payasyougo", or "free"
20
+ * - plan_low int <em>only for Monthly plans</em> - the lower tier for list size
21
+ * - plan_high int <em>only for Monthly plans</em> - the upper tier for list size
22
+ * - plan_start_date string <em>only for Monthly plans</em> - the start date for a monthly plan
23
+ * - emails_left int <em>only for Free and Pay-as-you-go plans</em> emails credits left for the account
24
+ * - pending_monthly bool Whether the account is finishing Pay As You Go credits before switching to a Monthly plan
25
+ * - first_payment string date of first payment
26
+ * - last_payment string date of most recent payment
27
+ * - times_logged_in int total number of times the account has been logged into via the web
28
+ * - last_login string date/time of last login via the web
29
+ * - affiliate_link string Monkey Rewards link for our Affiliate program
30
+ * - industry string the user's selected industry
31
+ * - contact associative_array Contact details for the account
32
+ * - fname string First Name
33
+ * - lname string Last Name
34
+ * - email string Email Address
35
+ * - company string Company Name
36
+ * - address1 string Address Line 1
37
+ * - address2 string Address Line 2
38
+ * - city string City
39
+ * - state string State or Province
40
+ * - zip string Zip or Postal Code
41
+ * - country string Country name
42
+ * - url string Website URL
43
+ * - phone string Phone number
44
+ * - fax string Fax number
45
+ * - modules array a struct for each addon module installed in the account
46
+ * - id string An internal module id
47
+ * - name string The module name
48
+ * - added string The date the module was added
49
+ * - data associative_array Any extra data associated with this module as key=>value pairs
50
+ * - orders array a struct for each order for the account
51
+ * - order_id int The order id
52
+ * - type string The order type - either "monthly" or "credits"
53
+ * - amount double The order amount
54
+ * - date string The order date
55
+ * - credits_used double The total credits used
56
+ * - rewards associative_array Rewards details for the account including credits & inspections earned, number of referrals, referral details, and rewards used
57
+ * - referrals_this_month int the total number of referrals this month
58
+ * - notify_on string whether or not we notify the user when rewards are earned
59
+ * - notify_email string the email address address used for rewards notifications
60
+ * - credits associative_array Email credits earned:
61
+ * - this_month int credits earned this month
62
+ * - total_earned int credits earned all time
63
+ * - remaining int credits remaining
64
+ * - inspections associative_array Inbox Inspections earned:
65
+ * - this_month int credits earned this month
66
+ * - total_earned int credits earned all time
67
+ * - remaining int credits remaining
68
+ * - referrals array a struct for each referral, including:
69
+ * - name string the name of the account
70
+ * - email string the email address associated with the account
71
+ * - signup_date string the signup date for the account
72
+ * - type string the source for the referral
73
+ * - applied array a struct for each applied rewards, including:
74
+ * - value int the number of credits user
75
+ * - date string the date applied
76
+ * - order_id int the order number credits were applied to
77
+ * - order_desc string the order description
78
+ * - integrations array a struct for each connected integrations that can be used with campaigns, including:
79
+ * - id int an internal id for the integration
80
+ * - name string the integration name
81
+ * - list_id string either "_any_" when globally accessible or the list id it's valid for use against
82
+ * - user_id string if applicable, the user id for the integrated system
83
+ * - account string if applicable, the user/account name for the integrated system
84
+ * - profiles array For Facebook, users/page that can be posted to.
85
+ * - id string the user or page id
86
+ * - name string the user or page name
87
+ * - is_page bool whether this is a user or a page
88
+ */
89
+ public function accountDetails($exclude=array()) {
90
+ $_params = array("exclude" => $exclude);
91
+ return $this->master->call('helper/account-details', $_params);
92
+ }
93
+
94
+ /**
95
+ * Retrieve minimal data for all Campaigns a member was sent
96
+ * @param associative_array $email
97
+ * - email string an email address
98
+ * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
99
+ * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
100
+ * @param associative_array $options
101
+ * - list_id string optional A list_id to limit the campaigns to
102
+ * @return array an array of structs containing campaign data for each matching campaign (ordered by send time ascending), including:
103
+ * - id string the campaign unique id
104
+ * - title string the campaign's title
105
+ * - subject string the campaign's subject
106
+ * - send_time string the time the campaign was sent
107
+ * - type string the campaign type
108
+ */
109
+ public function campaignsForEmail($email, $options=null) {
110
+ $_params = array("email" => $email, "options" => $options);
111
+ return $this->master->call('helper/campaigns-for-email', $_params);
112
+ }
113
+
114
+ /**
115
+ * Return the current Chimp Chatter messages for an account.
116
+ * @return array An array of structs containing data for each chatter message
117
+ * - message string The chatter message
118
+ * - type string The type of the message - one of lists:new-subscriber, lists:unsubscribes, lists:profile-updates, campaigns:facebook-likes, campaigns:facebook-comments, campaigns:forward-to-friend, lists:imports, or campaigns:inbox-inspections
119
+ * - url string a url into the web app that the message could link to, if applicable
120
+ * - list_id string the list_id a message relates to, if applicable. Deleted lists will return -DELETED-
121
+ * - campaign_id string the list_id a message relates to, if applicable. Deleted campaigns will return -DELETED-
122
+ * - update_time string The date/time the message was last updated
123
+ */
124
+ public function chimpChatter() {
125
+ $_params = array();
126
+ return $this->master->call('helper/chimp-chatter', $_params);
127
+ }
128
+
129
+ /**
130
+ * Have HTML content auto-converted to a text-only format. You can send: plain HTML, an existing Campaign Id, or an existing Template Id. Note that this will <strong>not</strong> save anything to or update any of your lists, campaigns, or templates.
131
+ It's also not just Lynx and is very fine tuned for our template layouts - your mileage may vary.
132
+ * @param string $type
133
+ * @param associative_array $content
134
+ * - html string optional a single string value,
135
+ * - cid string a valid Campaign Id
136
+ * - user_template_id string the id of a user template
137
+ * - base_template_id string the id of a built in base/basic template
138
+ * - gallery_template_id string the id of a built in gallery template
139
+ * - url string a valid & public URL to pull html content from
140
+ * @return associative_array the content pass in converted to text.
141
+ * - text string the converted html
142
+ */
143
+ public function generateText($type, $content) {
144
+ $_params = array("type" => $type, "content" => $content);
145
+ return $this->master->call('helper/generate-text', $_params);
146
+ }
147
+
148
+ /**
149
+ * Send your HTML content to have the CSS inlined and optionally remove the original styles.
150
+ * @param string $html
151
+ * @param bool $strip_css
152
+ * @return associative_array with a "html" key
153
+ * - html string Your HTML content with all CSS inlined, just like if we sent it.
154
+ */
155
+ public function inlineCss($html, $strip_css=false) {
156
+ $_params = array("html" => $html, "strip_css" => $strip_css);
157
+ return $this->master->call('helper/inline-css', $_params);
158
+ }
159
+
160
+ /**
161
+ * Retrieve minimal List data for all lists a member is subscribed to.
162
+ * @param associative_array $email
163
+ * - email string an email address
164
+ * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
165
+ * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
166
+ * @return array An array of structs with info on the list_id the member is subscribed to.
167
+ * - id string the list unique id
168
+ * - the web_id id referenced in web interface urls
169
+ * - the name list name
170
+ */
171
+ public function listsForEmail($email) {
172
+ $_params = array("email" => $email);
173
+ return $this->master->call('helper/lists-for-email', $_params);
174
+ }
175
+
176
+ /**
177
+ * "Ping" the MailChimp API - a simple method you can call that will return a constant value as long as everything is good. Note
178
+ than unlike most all of our methods, we don't throw an Exception if we are having issues. You will simply receive a different
179
+ string back that will explain our view on what is going on.
180
+ * @return associative_array a with a "msg" key
181
+ * - msg string containing "Everything's Chimpy!" if everything is chimpy, otherwise returns an error message
182
+ */
183
+ public function ping() {
184
+ $_params = array();
185
+ return $this->master->call('helper/ping', $_params);
186
+ }
187
+
188
+ /**
189
+ * Search all campaigns for the specified query terms
190
+ * @param string $query
191
+ * @param int $offset
192
+ * @param string $snip_start
193
+ * @param string $snip_end
194
+ * @return associative_array containing the total matches and current results
195
+ * - total int total campaigns matching
196
+ * - results array matching campaigns and snippets
197
+ * - snippet string the matching snippet for the campaign
198
+ * - campaign associative_array the matching campaign's details - will return same data as single campaign from campaigns/list()
199
+ * - summary associative_array if available, the matching campaign's report/summary data, other wise empty
200
+ */
201
+ public function searchCampaigns($query, $offset=0, $snip_start=null, $snip_end=null) {
202
+ $_params = array("query" => $query, "offset" => $offset, "snip_start" => $snip_start, "snip_end" => $snip_end);
203
+ return $this->master->call('helper/search-campaigns', $_params);
204
+ }
205
+
206
+ /**
207
+ * Search account wide or on a specific list using the specified query terms
208
+ * @param string $query
209
+ * @param string $id
210
+ * @param int $offset
211
+ * @return associative_array An array of both exact matches and partial matches over a full search
212
+ * - exact_matches associative_array containing the total matches and current results
213
+ * - total int total members matching
214
+ * - members array each entry will be struct matching the data format for a single member as returned by lists/member-info()
215
+ * - full_search associative_array containing the total matches and current results
216
+ * - total int total members matching
217
+ * - members array each entry will be struct matching the data format for a single member as returned by lists/member-info()
218
+ */
219
+ public function searchMembers($query, $id=null, $offset=0) {
220
+ $_params = array("query" => $query, "id" => $id, "offset" => $offset);
221
+ return $this->master->call('helper/search-members', $_params);
222
+ }
223
+
224
+ /**
225
+ * Retrieve all domain verification records for an account
226
+ * @return array structs for each domain verification has been attempted for
227
+ * - domain string the verified domain
228
+ * - status string the status of the verification - either "verified" or "pending"
229
+ * - email string the email address used for verification - "pre-existing" if we automatically backfilled it at some point
230
+ */
231
+ public function verifiedDomains() {
232
+ $_params = array();
233
+ return $this->master->call('helper/verified-domains', $_params);
234
+ }
235
+
236
+ }
237
+
238
+
Mailchimp/Lists.php CHANGED
@@ -1,895 +1,895 @@
1
- <?php
2
-
3
- class Mailchimp_Lists {
4
- public function __construct(wpyksMCAPI $master) {
5
- $this->master = $master;
6
- }
7
-
8
- /**
9
- * Get all email addresses that complained about a campaign sent to a list
10
- * @param string $id
11
- * @param int $start
12
- * @param int $limit
13
- * @param string $since
14
- * @return associative_array the total of all reports and the specific reports reports this page
15
- * - total int the total number of matching abuse reports
16
- * - data array structs for the actual data for each reports, including:
17
- * - date string date+time the abuse report was received and processed
18
- * - email string the email address that reported abuse
19
- * - campaign_id string the unique id for the campaign that report was made against
20
- * - type string an internal type generally specifying the originating mail provider - may not be useful outside of filling report views
21
- */
22
- public function abuseReports($id, $start=0, $limit=500, $since=null) {
23
- $_params = array("id" => $id, "start" => $start, "limit" => $limit, "since" => $since);
24
- return $this->master->call('lists/abuse-reports', $_params);
25
- }
26
-
27
- /**
28
- * Access up to the previous 180 days of daily detailed aggregated activity stats for a given list. Does not include AutoResponder activity.
29
- * @param string $id
30
- * @return array of structs containing daily values, each containing:
31
- */
32
- public function activity($id) {
33
- $_params = array("id" => $id);
34
- return $this->master->call('lists/activity', $_params);
35
- }
36
-
37
- /**
38
- * Subscribe a batch of email addresses to a list at once. If you are using a serialized version of the API, we strongly suggest that you
39
- only run this method as a POST request, and <em>not</em> a GET request. Maximum batch sizes vary based on the amount of data in each record,
40
- though you should cap them at 5k - 10k records, depending on your experience. These calls are also long, so be sure you increase your timeout values.
41
- * @param string $id
42
- * @param array $batch
43
- * - email associative_array a struct with one of the following keys - failing to provide anything will produce an error relating to the email address. Provide multiples and we'll use the first we see in this same order.
44
- * - email string an email address
45
- * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
46
- * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
47
- * - email_type string for the email type option (html or text)
48
- * - merge_vars associative_array data for the various list specific and special merge vars documented in lists/subscribe
49
- * @param boolean $double_optin
50
- * @param boolean $update_existing
51
- * @param boolean $replace_interests
52
- * @return associative_array struct of result counts and associated data
53
- * - add_count int Number of email addresses that were successfully added
54
- * - adds array array of structs for each add
55
- * - email string the email address added
56
- * - euid string the email unique id
57
- * - leid string the list member's truly unique id
58
- * - update_count int Number of email addresses that were successfully updated
59
- * - updates array array of structs for each update
60
- * - email string the email address added
61
- * - euid string the email unique id
62
- * - leid string the list member's truly unique id
63
- * - error_count int Number of email addresses that failed during addition/updating
64
- * - errors array array of error structs including:
65
- * - email string whatever was passed in the batch record's email parameter
66
- * - email string the email address added
67
- * - euid string the email unique id
68
- * - leid string the list member's truly unique id
69
- * - code int the error code
70
- * - error string the full error message
71
- * - row associative_array the row from the batch that caused the error
72
- */
73
- public function batchSubscribe($id, $batch, $double_optin=true, $update_existing=false, $replace_interests=true) {
74
- $_params = array("id" => $id, "batch" => $batch, "double_optin" => $double_optin, "update_existing" => $update_existing, "replace_interests" => $replace_interests);
75
- return $this->master->call('lists/batch-subscribe', $_params);
76
- }
77
-
78
- /**
79
- * Unsubscribe a batch of email addresses from a list
80
- * @param string $id
81
- * @param array $batch
82
- * - email string an email address
83
- * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
84
- * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
85
- * @param boolean $delete_member
86
- * @param boolean $send_goodbye
87
- * @param boolean $send_notify
88
- * @return array Array of structs containing results and any errors that occurred
89
- * - success_count int Number of email addresses that were successfully removed
90
- * - error_count int Number of email addresses that failed during addition/updating
91
- * - of array structs contain error details including:
92
- * - errors array array of error structs including:
93
- * - email string whatever was passed in the batch record's email parameter
94
- * - email string the email address added
95
- * - euid string the email unique id
96
- * - leid string the list member's truly unique id
97
- * - code int the error code
98
- * - error string the full error message
99
- */
100
- public function batchUnsubscribe($id, $batch, $delete_member=false, $send_goodbye=true, $send_notify=false) {
101
- $_params = array("id" => $id, "batch" => $batch, "delete_member" => $delete_member, "send_goodbye" => $send_goodbye, "send_notify" => $send_notify);
102
- return $this->master->call('lists/batch-unsubscribe', $_params);
103
- }
104
-
105
- /**
106
- * Retrieve the clients that the list's subscribers have been tagged as being used based on user agents seen. Made possible by <a href="http://user-agent-string.info" target="_blank">user-agent-string.info</a>
107
- * @param string $id
108
- * @return associative_array the desktop and mobile user agents in use on the list
109
- * - desktop associative_array desktop user agents and percentages
110
- * - penetration double the percent of desktop clients in use
111
- * - clients array array of structs for each client including:
112
- * - client string the common name for the client
113
- * - icon string a url to an image representing this client
114
- * - percent string percent of list using the client
115
- * - members string total members using the client
116
- * - mobile associative_array mobile user agents and percentages
117
- * - penetration double the percent of mobile clients in use
118
- * - clients array array of structs for each client including:
119
- * - client string the common name for the client
120
- * - icon string a url to an image representing this client
121
- * - percent string percent of list using the client
122
- * - members string total members using the client
123
- */
124
- public function clients($id) {
125
- $_params = array("id" => $id);
126
- return $this->master->call('lists/clients', $_params);
127
- }
128
-
129
- /**
130
- * Access the Growth History by Month in aggregate or for a given list.
131
- * @param string $id
132
- * @return array array of structs containing months and growth data
133
- * - month string The Year and Month in question using YYYY-MM format
134
- * - existing int number of existing subscribers to start the month
135
- * - imports int number of subscribers imported during the month
136
- * - optins int number of subscribers who opted-in during the month
137
- */
138
- public function growthHistory($id=null) {
139
- $_params = array("id" => $id);
140
- return $this->master->call('lists/growth-history', $_params);
141
- }
142
-
143
- /**
144
- * Get the list of interest groupings for a given list, including the label, form information, and included groups for each
145
- * @param string $id
146
- * @param bool $counts
147
- * @return array array of structs of the interest groupings for the list
148
- * - id int The id for the Grouping
149
- * - name string Name for the Interest groups
150
- * - form_field string Gives the type of interest group: checkbox,radio,select
151
- * - groups array Array structs of the grouping options (interest groups) including:
152
- * - bit string the bit value - not really anything to be done with this
153
- * - name string the name of the group
154
- * - display_order string the display order of the group, if set
155
- * - subscribers int total number of subscribers who have this group if "counts" is true. otherwise empty
156
- */
157
- public function interestGroupings($id, $counts=false) {
158
- $_params = array("id" => $id, "counts" => $counts);
159
- return $this->master->call('lists/interest-groupings', $_params);
160
- }
161
-
162
- /**
163
- * Add a single Interest Group - if interest groups for the List are not yet enabled, adding the first
164
- group will automatically turn them on.
165
- * @param string $id
166
- * @param string $group_name
167
- * @param int $grouping_id
168
- * @return associative_array with a single entry:
169
- * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
170
- */
171
- public function interestGroupAdd($id, $group_name, $grouping_id=null) {
172
- $_params = array("id" => $id, "group_name" => $group_name, "grouping_id" => $grouping_id);
173
- return $this->master->call('lists/interest-group-add', $_params);
174
- }
175
-
176
- /**
177
- * Delete a single Interest Group - if the last group for a list is deleted, this will also turn groups for the list off.
178
- * @param string $id
179
- * @param string $group_name
180
- * @param int $grouping_id
181
- * @return associative_array with a single entry:
182
- * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
183
- */
184
- public function interestGroupDel($id, $group_name, $grouping_id=null) {
185
- $_params = array("id" => $id, "group_name" => $group_name, "grouping_id" => $grouping_id);
186
- return $this->master->call('lists/interest-group-del', $_params);
187
- }
188
-
189
- /**
190
- * Change the name of an Interest Group
191
- * @param string $id
192
- * @param string $old_name
193
- * @param string $new_name
194
- * @param int $grouping_id
195
- * @return associative_array with a single entry:
196
- * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
197
- */
198
- public function interestGroupUpdate($id, $old_name, $new_name, $grouping_id=null) {
199
- $_params = array("id" => $id, "old_name" => $old_name, "new_name" => $new_name, "grouping_id" => $grouping_id);
200
- return $this->master->call('lists/interest-group-update', $_params);
201
- }
202
-
203
- /**
204
- * Add a new Interest Grouping - if interest groups for the List are not yet enabled, adding the first
205
- grouping will automatically turn them on.
206
- * @param string $id
207
- * @param string $name
208
- * @param string $type
209
- * @param array $groups
210
- * @return associative_array with a single entry:
211
- * - id int the new grouping id if the request succeeds, otherwise an error will be thrown
212
- */
213
- public function interestGroupingAdd($id, $name, $type, $groups) {
214
- $_params = array("id" => $id, "name" => $name, "type" => $type, "groups" => $groups);
215
- return $this->master->call('lists/interest-grouping-add', $_params);
216
- }
217
-
218
- /**
219
- * Delete an existing Interest Grouping - this will permanently delete all contained interest groups and will remove those selections from all list members
220
- * @param int $grouping_id
221
- * @return associative_array with a single entry:
222
- * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
223
- */
224
- public function interestGroupingDel($grouping_id) {
225
- $_params = array("grouping_id" => $grouping_id);
226
- return $this->master->call('lists/interest-grouping-del', $_params);
227
- }
228
-
229
- /**
230
- * Update an existing Interest Grouping
231
- * @param int $grouping_id
232
- * @param string $name
233
- * @param string $value
234
- * @return associative_array with a single entry:
235
- * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
236
- */
237
- public function interestGroupingUpdate($grouping_id, $name, $value) {
238
- $_params = array("grouping_id" => $grouping_id, "name" => $name, "value" => $value);
239
- return $this->master->call('lists/interest-grouping-update', $_params);
240
- }
241
-
242
- /**
243
- * Retrieve the locations (countries) that the list's subscribers have been tagged to based on geocoding their IP address
244
- * @param string $id
245
- * @return array array of locations
246
- * - country string the country name
247
- * - cc string the ISO 3166 2 digit country code
248
- * - percent double the percent of subscribers in the country
249
- * - total double the total number of subscribers in the country
250
- */
251
- public function locations($id) {
252
- $_params = array("id" => $id);
253
- return $this->master->call('lists/locations', $_params);
254
- }
255
-
256
- /**
257
- * Get the most recent 100 activities for particular list members (open, click, bounce, unsub, abuse, sent to, etc.)
258
- * @param string $id
259
- * @param array $emails
260
- * - email string an email address - for new subscribers obviously this should be used
261
- * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
262
- * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
263
- * @return associative_array of data and success/error counts
264
- * - success_count int the number of subscribers successfully found on the list
265
- * - error_count int the number of subscribers who were not found on the list
266
- * - errors array array of error structs including:
267
- * - email string whatever was passed in the email parameter
268
- * - email string the email address added
269
- * - euid string the email unique id
270
- * - leid string the list member's truly unique id
271
- * - error string the error message
272
- * - code string the error code
273
- * - data array an array of structs where each activity record has:
274
- * - email string whatever was passed in the email parameter
275
- * - email string the email address added
276
- * - euid string the email unique id
277
- * - leid string the list member's truly unique id
278
- * - activity array an array of structs containing the activity, including:
279
- * - action string The action name, one of: open, click, bounce, unsub, abuse, sent, queued, ecomm, mandrill_send, mandrill_hard_bounce, mandrill_soft_bounce, mandrill_open, mandrill_click, mandrill_spam, mandrill_unsub, mandrill_reject
280
- * - timestamp string The date+time of the action (GMT)
281
- * - url string For click actions, the url clicked, otherwise this is empty
282
- * - type string If there's extra bounce, unsub, etc data it will show up here.
283
- * - campaign_id string The campaign id the action was related to, if it exists - otherwise empty (ie, direct unsub from list)
284
- * - campaign_data associative_array If not deleted, the campaigns/list data for the campaign
285
- */
286
- public function memberActivity($id, $emails) {
287
- $_params = array("id" => $id, "emails" => $emails);
288
- return $this->master->call('lists/member-activity', $_params);
289
- }
290
-
291
- /**
292
- * Get all the information for particular members of a list
293
- * @param string $id
294
- * @param array $emails
295
- * - email string an email address - for new subscribers obviously this should be used
296
- * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
297
- * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
298
- * @return associative_array of data and success/error counts
299
- * - success_count int the number of subscribers successfully found on the list
300
- * - error_count int the number of subscribers who were not found on the list
301
- * - errors array array of error structs including:
302
- * - email associative_array whatever was passed in the email parameter
303
- * - email string the email address added
304
- * - euid string the email unique id
305
- * - leid string the list member's truly unique id
306
- * - error string the error message
307
- * - data array array of structs for each valid list member
308
- * - id string The unique id (euid) for this email address on an account
309
- * - email string The email address associated with this record
310
- * - email_type string The type of emails this customer asked to get: html or text
311
- * - merges associative_array a struct containing a key for each merge tags and the data for those tags for this email address, plus:
312
- * - GROUPINGS array if Interest groupings are enabled, this will exist with structs for each grouping:
313
- * - id int the grouping id
314
- * - name string the interest group name
315
- * - groups array structs for each group in the grouping
316
- * - name string the group name
317
- * - interested bool whether the member has this group selected
318
- * - status string The subscription status for this email address, either pending, subscribed, unsubscribed, or cleaned
319
- * - ip_signup string IP Address this address signed up from. This may be blank if single optin is used.
320
- * - timestamp_signup string The date+time the double optin was initiated. This may be blank if single optin is used.
321
- * - ip_opt string IP Address this address opted in from.
322
- * - timestamp_opt string The date+time the optin completed
323
- * - member_rating int the rating of the subscriber. This will be 1 - 5 as described <a href="http://eepurl.com/f-2P" target="_blank">here</a>
324
- * - campaign_id string If the user is unsubscribed and they unsubscribed from a specific campaign, that campaign_id will be listed, otherwise this is not returned.
325
- * - lists array An array of structs for the other lists this member belongs to
326
- * - id string the list id
327
- * - status string the members status on that list
328
- * - timestamp string The date+time this email address entered it's current status
329
- * - info_changed string The last time this record was changed. If the record is old enough, this may be blank.
330
- * - web_id int The Member id used in our web app, allows you to create a link directly to it
331
- * - leid int The Member id used in our web app, allows you to create a link directly to it
332
- * - list_id string The list id the for the member record being returned
333
- * - list_name string The list name the for the member record being returned
334
- * - language string if set/detected, a language code from <a href="http://kb.mailchimp.com/article/can-i-see-what-languages-my-subscribers-use#code" target="_blank">here</a>
335
- * - is_gmonkey bool Whether the member is a <a href="http://mailchimp.com/features/golden-monkeys/" target="_blank">Golden Monkey</a> or not.
336
- * - geo associative_array the geographic information if we have it. including:
337
- * - latitude string the latitude
338
- * - longitude string the longitude
339
- * - gmtoff string GMT offset
340
- * - dstoff string GMT offset during daylight savings (if DST not observered, will be same as gmtoff)
341
- * - timezone string the timezone we've place them in
342
- * - cc string 2 digit ISO-3166 country code
343
- * - region string generally state, province, or similar
344
- * - clients associative_array the client we've tracked the address as using with two keys:
345
- * - name string the common name of the client
346
- * - icon_url string a url representing a path to an icon representing this client
347
- * - static_segments array structs for each static segments the member is a part of including:
348
- * - id int the segment id
349
- * - name string the name given to the segment
350
- * - added string the date the member was added
351
- * - notes array structs for each note entered for this member. For each note:
352
- * - id int the note id
353
- * - note string the text entered
354
- * - created string the date the note was created
355
- * - updated string the date the note was last updated
356
- * - created_by_name string the name of the user who created the note. This can change as users update their profile.
357
- */
358
- public function memberInfo($id, $emails) {
359
- $_params = array("id" => $id, "emails" => $emails);
360
- return $this->master->call('lists/member-info', $_params);
361
- }
362
-
363
- /**
364
- * Get all of the list members for a list that are of a particular status and potentially matching a segment. This will cause locking, so don't run multiples at once. Are you trying to get a dump including lots of merge
365
- data or specific members of a list? If so, checkout the <a href="/export/1.0/list.func.php">List Export API</a>
366
- * @param string $id
367
- * @param string $status
368
- * @param associative_array $opts
369
- * - start int optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
370
- * - limit int optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100
371
- * - sort_field string optional the data field to sort by - mergeX (1-30), your custom merge tags, "email", "rating","last_update_time", or "optin_time" - invalid fields will be ignored
372
- * - sort_dir string optional the direct - ASC or DESC. defaults to ASC (case insensitive)
373
- * - segment associative_array a properly formatted segment that works with campaigns/segment-test
374
- * @return associative_array of the total records matched and limited list member data for this page
375
- * - total int the total matching records
376
- * - data array structs for each member as returned by member-info
377
- */
378
- public function members($id, $status='subscribed', $opts=array()) {
379
- $_params = array("id" => $id, "status" => $status, "opts" => $opts);
380
- return $this->master->call('lists/members', $_params);
381
- }
382
-
383
- /**
384
- * Add a new merge tag to a given list
385
- * @param string $id
386
- * @param string $tag
387
- * @param string $name
388
- * @param associative_array $options
389
- * - field_type string optional one of: text, number, radio, dropdown, date, address, phone, url, imageurl, zip, birthday - defaults to text
390
- * - req boolean optional indicates whether the field is required - defaults to false
391
- * - public boolean optional indicates whether the field is displayed in public - defaults to true
392
- * - show boolean optional indicates whether the field is displayed in the app's list member view - defaults to true
393
- * - order int The order this merge tag should be displayed in - this will cause existing values to be reset so this fits
394
- * - default_value string optional the default value for the field. See lists/subscribe() for formatting info. Defaults to blank - max 255 bytes
395
- * - helptext string optional the help text to be used with some newer forms. Defaults to blank - max 255 bytes
396
- * - choices array optional kind of - an array of strings to use as the choices for radio and dropdown type fields
397
- * - dateformat string optional only valid for birthday and date fields. For birthday type, must be "MM/DD" (default) or "DD/MM". For date type, must be "MM/DD/YYYY" (default) or "DD/MM/YYYY". Any other values will be converted to the default.
398
- * - phoneformat string optional "US" is the default - any other value will cause them to be unformatted (international)
399
- * - defaultcountry string optional the <a href="http://www.iso.org/iso/english_country_names_and_code_elements" target="_blank">ISO 3166 2 digit character code</a> for the default country. Defaults to "US". Anything unrecognized will be converted to the default.
400
- * @return associative_array the full data for the new merge var, just like merge-vars returns
401
- * - name string Name/description of the merge field
402
- * - req bool Denotes whether the field is required (true) or not (false)
403
- * - field_type string The "data type" of this merge var. One of: email, text, number, radio, dropdown, date, address, phone, url, imageurl
404
- * - public bool Whether or not this field is visible to list subscribers
405
- * - show bool Whether the field is displayed in thelist dashboard
406
- * - order string The order this field displays in on forms
407
- * - default string The default value for this field
408
- * - helptext string The helptext for this field
409
- * - size string The width of the field to be used
410
- * - tag string The merge tag that's used for forms and lists/subscribe() and lists/update-member()
411
- * - choices array the options available for radio and dropdown field types
412
- * - id int an unchanging id for the merge var
413
- */
414
- public function mergeVarAdd($id, $tag, $name, $options=array()) {
415
- $_params = array("id" => $id, "tag" => $tag, "name" => $name, "options" => $options);
416
- return $this->master->call('lists/merge-var-add', $_params);
417
- }
418
-
419
- /**
420
- * Delete a merge tag from a given list and all its members. Seriously - the data is removed from all members as well!
421
- Note that on large lists this method may seem a bit slower than calls you typically make.
422
- * @param string $id
423
- * @param string $tag
424
- * @return associative_array with a single entry:
425
- * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
426
- */
427
- public function mergeVarDel($id, $tag) {
428
- $_params = array("id" => $id, "tag" => $tag);
429
- return $this->master->call('lists/merge-var-del', $_params);
430
- }
431
-
432
- /**
433
- * Completely resets all data stored in a merge var on a list. All data is removed and this action can not be undone.
434
- * @param string $id
435
- * @param string $tag
436
- * @return associative_array with a single entry:
437
- * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
438
- */
439
- public function mergeVarReset($id, $tag) {
440
- $_params = array("id" => $id, "tag" => $tag);
441
- return $this->master->call('lists/merge-var-reset', $_params);
442
- }
443
-
444
- /**
445
- * Sets a particular merge var to the specified value for every list member. Only merge var ids 1 - 30 may be modified this way. This is generally a dirty method
446
- unless you're fixing data since you should probably be using default_values and/or conditional content. as with lists/merge-var-reset(), this can not be undone.
447
- * @param string $id
448
- * @param string $tag
449
- * @param string $value
450
- * @return associative_array with a single entry:
451
- * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
452
- */
453
- public function mergeVarSet($id, $tag, $value) {
454
- $_params = array("id" => $id, "tag" => $tag, "value" => $value);
455
- return $this->master->call('lists/merge-var-set', $_params);
456
- }
457
-
458
- /**
459
- * Update most parameters for a merge tag on a given list. You cannot currently change the merge type
460
- * @param string $id
461
- * @param string $tag
462
- * @param associative_array $options
463
- * @return associative_array the full data for the new merge var, just like merge-vars returns
464
- * - name string Name/description of the merge field
465
- * - req bool Denotes whether the field is required (true) or not (false)
466
- * - field_type string The "data type" of this merge var. One of: email, text, number, radio, dropdown, date, address, phone, url, imageurl
467
- * - public bool Whether or not this field is visible to list subscribers
468
- * - show bool Whether the field is displayed in thelist dashboard
469
- * - order string The order this field to displays in on forms
470
- * - default string The default value for this field
471
- * - helptext string The helptext for this field
472
- * - size string The width of the field to be used
473
- * - tag string The merge tag that's used for forms and lists/subscribe() and lists/update-member()
474
- * - choices array the options available for radio and dropdown field types
475
- * - id int an unchanging id for the merge var
476
- */
477
- public function mergeVarUpdate($id, $tag, $options) {
478
- $_params = array("id" => $id, "tag" => $tag, "options" => $options);
479
- return $this->master->call('lists/merge-var-update', $_params);
480
- }
481
-
482
- /**
483
- * Get the list of merge tags for a given list, including their name, tag, and required setting
484
- * @param array $id
485
- * @return associative_array of data and success/error counts
486
- * - success_count int the number of subscribers successfully found on the list
487
- * - error_count int the number of subscribers who were not found on the list
488
- * - data array of structs for the merge tags on each list
489
- * - id string the list id
490
- * - name string the list name
491
- * - merge_vars array of structs for each merge var
492
- * - name string Name of the merge field
493
- * - req bool Denotes whether the field is required (true) or not (false)
494
- * - field_type string The "data type" of this merge var. One of the options accepted by field_type in lists/merge-var-add
495
- * - public bool Whether or not this field is visible to list subscribers
496
- * - show bool Whether the list owner has this field displayed on their list dashboard
497
- * - order string The order the list owner has set this field to display in
498
- * - default string The default value the list owner has set for this field
499
- * - helptext string The helptext for this field
500
- * - size string The width of the field to be used
501
- * - tag string The merge tag that's used for forms and lists/subscribe() and listUpdateMember()
502
- * - choices array For radio and dropdown field types, an array of the options available
503
- * - id int an unchanging id for the merge var
504
- * - errors array of error structs
505
- * - id string the passed list id that failed
506
- * - code int the resulting error code
507
- * - msg string the resulting error message
508
- */
509
- public function mergeVars($id) {
510
- $_params = array("id" => $id);
511
- return $this->master->call('lists/merge-vars', $_params);
512
- }
513
-
514
- /**
515
- * Retrieve all of Segments for a list.
516
- * @param string $id
517
- * @param string $type
518
- * @return associative_array with 2 keys:
519
- * - static.id int the id of the segment
520
- * - created_date string the date+time the segment was created
521
- * - last_update string the date+time the segment was last updated (add or del)
522
- */
523
- public function segments($id, $type=null) {
524
- $_params = array("id" => $id, "type" => $type);
525
- return $this->master->call('lists/segments', $_params);
526
- }
527
-
528
- /**
529
- * Save a segment against a list for later use. There is no limit to the number of segments which can be saved. Static Segments <strong>are not</strong> tied
530
- to any merge data, interest groups, etc. They essentially allow you to configure an unlimited number of custom segments which will have standard performance.
531
- When using proper segments, Static Segments are one of the available options for segmentation just as if you used a merge var (and they can be used with other segmentation
532
- options), though performance may degrade at that point. Saved Segments (called "auto-updating" in the app) are essentially just the match+conditions typically
533
- used.
534
- * @param string $id
535
- * @param associative_array $opts
536
- * - type string either "static" or "saved"
537
- * - name string a unique name per list for the segment - 100 byte maximum length, anything longer will throw an error
538
- * - segment_opts associative_array for "saved" only, the standard segment match+conditions, just like campaigns/segment-test
539
- * - match string "any" or "all"
540
- * - conditions array structs for each condition, just like campaigns/segment-test
541
- * @return associative_array with a single entry:
542
- * - id int the id of the new segment, otherwise an error will be thrown.
543
- */
544
- public function segmentAdd($id, $opts) {
545
- $_params = array("id" => $id, "opts" => $opts);
546
- return $this->master->call('lists/segment-add', $_params);
547
- }
548
-
549
- /**
550
- * Delete a segment. Note that this will, of course, remove any member affiliations with any static segments deleted
551
- * @param string $id
552
- * @param int $seg_id
553
- * @return associative_array with a single entry:
554
- * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
555
- */
556
- public function segmentDel($id, $seg_id) {
557
- $_params = array("id" => $id, "seg_id" => $seg_id);
558
- return $this->master->call('lists/segment-del', $_params);
559
- }
560
-
561
- /**
562
- * Allows one to test their segmentation rules before creating a campaign using them - this is no different from campaigns/segment-test() and will eventually replace it.
563
- For the time being, the crazy segmenting condition documentation will continue to live over there.
564
- * @param string $list_id
565
- * @param associative_array $options
566
- * - saved_segment_id string a saved segment id from lists/segments() - this will take precendence, otherwise the match+conditions are required.
567
- * - match string controls whether to use AND or OR when applying your options - expects "<strong>any</strong>" (for OR) or "<strong>all</strong>" (for AND)
568
- * - conditions array of up to 5 structs for different criteria to apply while segmenting. Each criteria row must contain 3 keys - "<strong>field</strong>", "<strong>op</strong>", and "<strong>value</strong>" - and possibly a fourth, "<strong>extra</strong>", based on these definitions:
569
- * @return associative_array with a single entry:
570
- * - total int The total number of subscribers matching your segmentation options
571
- */
572
- public function segmentTest($list_id, $options) {
573
- $_params = array("list_id" => $list_id, "options" => $options);
574
- return $this->master->call('lists/segment-test', $_params);
575
- }
576
-
577
- /**
578
- * Update an existing segment. The list and type can not be changed.
579
- * @param string $id
580
- * @param int $seg_id
581
- * @param associative_array $opts
582
- * - name string a unique name per list for the segment - 100 byte maximum length, anything longer will throw an error
583
- * - segment_opts associative_array for "saved" only, the standard segment match+conditions, just like campaigns/segment-test
584
- * - match associative_array "any" or "all"
585
- * - conditions array structs for each condition, just like campaigns/segment-test
586
- * @return associative_array with a single entry:
587
- * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
588
- */
589
- public function segmentUpdate($id, $seg_id, $opts) {
590
- $_params = array("id" => $id, "seg_id" => $seg_id, "opts" => $opts);
591
- return $this->master->call('lists/segment-update', $_params);
592
- }
593
-
594
- /**
595
- * Save a segment against a list for later use. There is no limit to the number of segments which can be saved. Static Segments <strong>are not</strong> tied
596
- to any merge data, interest groups, etc. They essentially allow you to configure an unlimited number of custom segments which will have standard performance.
597
- When using proper segments, Static Segments are one of the available options for segmentation just as if you used a merge var (and they can be used with other segmentation
598
- options), though performance may degrade at that point.
599
- * @param string $id
600
- * @param string $name
601
- * @return associative_array with a single entry:
602
- * - id int the id of the new segment, otherwise an error will be thrown.
603
- */
604
- public function staticSegmentAdd($id, $name) {
605
- $_params = array("id" => $id, "name" => $name);
606
- return $this->master->call('lists/static-segment-add', $_params);
607
- }
608
-
609
- /**
610
- * Delete a static segment. Note that this will, of course, remove any member affiliations with the segment
611
- * @param string $id
612
- * @param int $seg_id
613
- * @return associative_array with a single entry:
614
- * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
615
- */
616
- public function staticSegmentDel($id, $seg_id) {
617
- $_params = array("id" => $id, "seg_id" => $seg_id);
618
- return $this->master->call('lists/static-segment-del', $_params);
619
- }
620
-
621
- /**
622
- * Add list members to a static segment. It is suggested that you limit batch size to no more than 10,000 addresses per call. Email addresses must exist on the list
623
- in order to be included - this <strong>will not</strong> subscribe them to the list!
624
- * @param string $id
625
- * @param int $seg_id
626
- * @param array $batch
627
- * - email string an email address
628
- * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
629
- * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
630
- * @return associative_array an array with the results of the operation
631
- * - success_count int the total number of successful updates (will include members already in the segment)
632
- * - errors array structs for each error including:
633
- * - email string whatever was passed in the email parameter
634
- * - email string the email address added
635
- * - euid string the email unique id
636
- * - leid string the list member's truly unique id
637
- * - code string the error code
638
- * - error string the full error message
639
- */
640
- public function staticSegmentMembersAdd($id, $seg_id, $batch) {
641
- $_params = array("id" => $id, "seg_id" => $seg_id, "batch" => $batch);
642
- return $this->master->call('lists/static-segment-members-add', $_params);
643
- }
644
-
645
- /**
646
- * Remove list members from a static segment. It is suggested that you limit batch size to no more than 10,000 addresses per call. Email addresses must exist on the list
647
- in order to be removed - this <strong>will not</strong> unsubscribe them from the list!
648
- * @param string $id
649
- * @param int $seg_id
650
- * @param array $batch
651
- * - email string an email address
652
- * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
653
- * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
654
- * @return associative_array an array with the results of the operation
655
- * - success_count int the total number of successful removals
656
- * - error_count int the total number of unsuccessful removals
657
- * - errors array structs for each error including:
658
- * - email string whatever was passed in the email parameter
659
- * - email string the email address added
660
- * - euid string the email unique id
661
- * - leid string the list member's truly unique id
662
- * - code string the error code
663
- * - error string the full error message
664
- */
665
- public function staticSegmentMembersDel($id, $seg_id, $batch) {
666
- $_params = array("id" => $id, "seg_id" => $seg_id, "batch" => $batch);
667
- return $this->master->call('lists/static-segment-members-del', $_params);
668
- }
669
-
670
- /**
671
- * Resets a static segment - removes <strong>all</strong> members from the static segment. Note: does not actually affect list member data
672
- * @param string $id
673
- * @param int $seg_id
674
- * @return associative_array with a single entry:
675
- * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
676
- */
677
- public function staticSegmentReset($id, $seg_id) {
678
- $_params = array("id" => $id, "seg_id" => $seg_id);
679
- return $this->master->call('lists/static-segment-reset', $_params);
680
- }
681
-
682
- /**
683
- * Retrieve all of the Static Segments for a list.
684
- * @param string $id
685
- * @return array an of structs with data for each static segment
686
- * - id int the id of the segment
687
- * - name string the name for the segment
688
- * - member_count int the total number of subscribed members currently in a segment
689
- * - created_date string the date+time the segment was created
690
- * - last_update string the date+time the segment was last updated (add or del)
691
- * - last_reset string the date+time the segment was last reset (ie had all members cleared from it)
692
- */
693
- public function staticSegments($id) {
694
- $_params = array("id" => $id);
695
- return $this->master->call('lists/static-segments', $_params);
696
- }
697
-
698
- /**
699
- * Subscribe the provided email to a list. By default this sends a confirmation email - you will not see new members until the link contained in it is clicked!
700
- * @param string $id
701
- * @param associative_array $email
702
- * - email string an email address - for new subscribers obviously this should be used
703
- * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
704
- * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
705
- * @param associative_array $merge_vars
706
- * - new-email string set this to change the email address. This is only respected on calls using update_existing or when passed to listUpdateMember().
707
- * - groupings array of Interest Grouping structs. Each should contain:
708
- * - id int Grouping "id" from lists/interest-groupings (either this or name must be present) - this id takes precedence and can't change (unlike the name)
709
- * - name string Grouping "name" from lists/interest-groupings (either this or id must be present)
710
- * - groups array an array of valid group names for this grouping.
711
- * - optin_ip string Set the Opt-in IP field. <em>Abusing this may cause your account to be suspended.</em> We do validate this and it must not be a private IP address.
712
- * - optin_time string Set the Opt-in Time field. <em>Abusing this may cause your account to be suspended.</em> We do validate this and it must be a valid date. Use - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00" to be safe. Generally, though, anything strtotime() understands we'll understand - <a href="http://us2.php.net/strtotime" target="_blank">http://us2.php.net/strtotime</a>
713
- * - mc_location associative_array Set the member's geographic location either by optin_ip or geo data.
714
- * - latitude string use the specified latitude (longitude must exist for this to work)
715
- * - longitude string use the specified longitude (latitude must exist for this to work)
716
- * - anything string if this (or any other key exists here) we'll try to use the optin ip. NOTE - this will slow down each subscribe call a bit, especially for lat/lng pairs in sparsely populated areas. Currently our automated background processes can and will overwrite this based on opens and clicks.
717
- * - mc_language string Set the member's language preference. Supported codes are fully case-sensitive and can be found <a href="http://kb.mailchimp.com/article/can-i-see-what-languages-my-subscribers-use#code" target="_new">here</a>.
718
- * - mc_notes array of structs for managing notes - it may contain:
719
- * - note string the note to set. this is required unless you're deleting a note
720
- * - id int the note id to operate on. not including this (or using an invalid id) causes a new note to be added
721
- * - action string if the "id" key exists and is valid, an "update" key may be set to "append" (default), "prepend", "replace", or "delete" to handle how we should update existing notes. "delete", obviously, will only work with a valid "id" - passing that along with "note" and an invalid "id" is wrong and will be ignored.
722
- * @param string $email_type
723
- * @param bool $double_optin
724
- * @param bool $update_existing
725
- * @param bool $replace_interests
726
- * @param bool $send_welcome
727
- * @return associative_array the ids for this subscriber
728
- * - email string the email address added
729
- * - euid string the email unique id
730
- * - leid string the list member's truly unique id
731
- */
732
- public function subscribe($id, $email, $merge_vars=null, $email_type='html', $double_optin=true, $update_existing=false, $replace_interests=true, $send_welcome=false) {
733
- $_params = array("id" => $id, "email" => $email, "merge_vars" => $merge_vars, "email_type" => $email_type, "double_optin" => $double_optin, "update_existing" => $update_existing, "replace_interests" => $replace_interests, "send_welcome" => $send_welcome);
734
- return $this->master->call('lists/subscribe', $_params);
735
- }
736
-
737
- /**
738
- * Unsubscribe the given email address from the list
739
- * @param string $id
740
- * @param associative_array $email
741
- * - email string an email address
742
- * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
743
- * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
744
- * @param boolean $delete_member
745
- * @param boolean $send_goodbye
746
- * @param boolean $send_notify
747
- * @return associative_array with a single entry:
748
- * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
749
- */
750
- public function unsubscribe($id, $email, $delete_member=false, $send_goodbye=true, $send_notify=true) {
751
- $_params = array("id" => $id, "email" => $email, "delete_member" => $delete_member, "send_goodbye" => $send_goodbye, "send_notify" => $send_notify);
752
- return $this->master->call('lists/unsubscribe', $_params);
753
- }
754
-
755
- /**
756
- * Edit the email address, merge fields, and interest groups for a list member. If you are doing a batch update on lots of users,
757
- consider using lists/batch-subscribe() with the update_existing and possible replace_interests parameter.
758
- * @param string $id
759
- * @param associative_array $email
760
- * - email string an email address
761
- * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
762
- * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
763
- * @param array $merge_vars
764
- * @param string $email_type
765
- * @param boolean $replace_interests
766
- * @return associative_array the ids for this subscriber
767
- * - email string the email address added
768
- * - euid string the email unique id
769
- * - leid string the list member's truly unique id
770
- */
771
- public function updateMember($id, $email, $merge_vars, $email_type='', $replace_interests=true) {
772
- $_params = array("id" => $id, "email" => $email, "merge_vars" => $merge_vars, "email_type" => $email_type, "replace_interests" => $replace_interests);
773
- return $this->master->call('lists/update-member', $_params);
774
- }
775
-
776
- /**
777
- * Add a new Webhook URL for the given list
778
- * @param string $id
779
- * @param string $url
780
- * @param associative_array $actions
781
- * - subscribe bool optional as subscribes occur, defaults to true
782
- * - unsubscribe bool optional as subscribes occur, defaults to true
783
- * - profile bool optional as profile updates occur, defaults to true
784
- * - cleaned bool optional as emails are cleaned from the list, defaults to true
785
- * - upemail bool optional when subscribers change their email address, defaults to true
786
- * - campaign bool option when a campaign is sent or canceled, defaults to true
787
- * @param associative_array $sources
788
- * - user bool optional user/subscriber initiated actions, defaults to true
789
- * - admin bool optional admin actions in our web app, defaults to true
790
- * - api bool optional actions that happen via API calls, defaults to false
791
- * @return associative_array with a single entry:
792
- * - id int the id of the new webhook, otherwise an error will be thrown.
793
- */
794
- public function webhookAdd($id, $url, $actions=array(), $sources=array()) {
795
- $_params = array("id" => $id, "url" => $url, "actions" => $actions, "sources" => $sources);
796
- return $this->master->call('lists/webhook-add', $_params);
797
- }
798
-
799
- /**
800
- * Delete an existing Webhook URL from a given list
801
- * @param string $id
802
- * @param string $url
803
- * @return associative_array with a single entry:
804
- * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
805
- */
806
- public function webhookDel($id, $url) {
807
- $_params = array("id" => $id, "url" => $url);
808
- return $this->master->call('lists/webhook-del', $_params);
809
- }
810
-
811
- /**
812
- * Return the Webhooks configured for the given list
813
- * @param string $id
814
- * @return array of structs for each webhook
815
- * - url string the URL for this Webhook
816
- * - actions associative_array the possible actions and whether they are enabled
817
- * - subscribe bool triggered when subscribes happen
818
- * - unsubscribe bool triggered when unsubscribes happen
819
- * - profile bool triggered when profile updates happen
820
- * - cleaned bool triggered when a subscriber is cleaned (bounced) from a list
821
- * - upemail bool triggered when a subscriber's email address is changed
822
- * - campaign bool triggered when a campaign is sent or canceled
823
- * - sources associative_array the possible sources and whether they are enabled
824
- * - user bool whether user/subscriber triggered actions are returned
825
- * - admin bool whether admin (manual, in-app) triggered actions are returned
826
- * - api bool whether api triggered actions are returned
827
- */
828
- public function webhooks($id) {
829
- $_params = array("id" => $id);
830
- return $this->master->call('lists/webhooks', $_params);
831
- }
832
-
833
- /**
834
- * Retrieve all of the lists defined for your user account
835
- * @param associative_array $filters
836
- * - list_id string optional - return a single list using a known list_id. Accepts multiples separated by commas when not using exact matching
837
- * - list_name string optional - only lists that match this name
838
- * - from_name string optional - only lists that have a default from name matching this
839
- * - from_email string optional - only lists that have a default from email matching this
840
- * - from_subject string optional - only lists that have a default from email matching this
841
- * - created_before string optional - only show lists that were created before this date+time - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00"
842
- * - created_after string optional - only show lists that were created since this date+time - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00"
843
- * - exact boolean optional - flag for whether to filter on exact values when filtering, or search within content for filter values - defaults to true
844
- * @param int $start
845
- * @param int $limit
846
- * @param string $sort_field
847
- * @param string $sort_dir
848
- * @return associative_array result of the operation including valid data and any errors
849
- * - total int the total number of lists which matched the provided filters
850
- * - data array structs for the lists which matched the provided filters, including the following
851
- * - id string The list id for this list. This will be used for all other list management functions.
852
- * - web_id int The list id used in our web app, allows you to create a link directly to it
853
- * - name string The name of the list.
854
- * - date_created string The date that this list was created.
855
- * - email_type_option boolean Whether or not the List supports multiple formats for emails or just HTML
856
- * - use_awesomebar boolean Whether or not campaigns for this list use the Awesome Bar in archives by default
857
- * - default_from_name string Default From Name for campaigns using this list
858
- * - default_from_email string Default From Email for campaigns using this list
859
- * - default_subject string Default Subject Line for campaigns using this list
860
- * - default_language string Default Language for this list's forms
861
- * - list_rating double An auto-generated activity score for the list (0 - 5)
862
- * - subscribe_url_short string Our eepurl shortened version of this list's subscribe form (will not change)
863
- * - subscribe_url_long string The full version of this list's subscribe form (host will vary)
864
- * - beamer_address string The email address to use for this list's <a href="http://kb.mailchimp.com/article/how-do-i-import-a-campaign-via-email-email-beamer/">Email Beamer</a>
865
- * - visibility string Whether this list is Public (pub) or Private (prv). Used internally for projects like <a href="http://blog.mailchimp.com/introducing-wavelength/" target="_blank">Wavelength</a>
866
- * - stats associative_array various stats and counts for the list - many of these are cached for at least 5 minutes
867
- * - member_count double The number of active members in the given list.
868
- * - unsubscribe_count double The number of members who have unsubscribed from the given list.
869
- * - cleaned_count double The number of members cleaned from the given list.
870
- * - member_count_since_send double The number of active members in the given list since the last campaign was sent
871
- * - unsubscribe_count_since_send double The number of members who have unsubscribed from the given list since the last campaign was sent
872
- * - cleaned_count_since_send double The number of members cleaned from the given list since the last campaign was sent
873
- * - campaign_count double The number of campaigns in any status that use this list
874
- * - grouping_count double The number of Interest Groupings for this list
875
- * - group_count double The number of Interest Groups (regardless of grouping) for this list
876
- * - merge_var_count double The number of merge vars for this list (not including the required EMAIL one)
877
- * - avg_sub_rate double the average number of subscribe per month for the list (empty value if we haven't calculated this yet)
878
- * - avg_unsub_rate double the average number of unsubscribe per month for the list (empty value if we haven't calculated this yet)
879
- * - target_sub_rate double the target subscription rate for the list to keep it growing (empty value if we haven't calculated this yet)
880
- * - open_rate double the average open rate per campaign for the list (empty value if we haven't calculated this yet)
881
- * - click_rate double the average click rate per campaign for the list (empty value if we haven't calculated this yet)
882
- * - modules array Any list specific modules installed for this list (example is SocialPro)
883
- * - errors array structs of any errors found while loading lists - usually just from providing invalid list ids
884
- * - param string the data that caused the failure
885
- * - code int the error code
886
- * - error int the error message
887
- */
888
- public function getList($filters=array(), $start=0, $limit=25, $sort_field='created', $sort_dir='DESC') {
889
- $_params = array("filters" => $filters, "start" => $start, "limit" => $limit, "sort_field" => $sort_field, "sort_dir" => $sort_dir);
890
- return $this->master->call('lists/list', $_params);
891
- }
892
-
893
- }
894
-
895
-
1
+ <?php
2
+
3
+ class Mailchimp_Lists {
4
+ public function __construct(wpyksMCAPI $master) {
5
+ $this->master = $master;
6
+ }
7
+
8
+ /**
9
+ * Get all email addresses that complained about a campaign sent to a list
10
+ * @param string $id
11
+ * @param int $start
12
+ * @param int $limit
13
+ * @param string $since
14
+ * @return associative_array the total of all reports and the specific reports reports this page
15
+ * - total int the total number of matching abuse reports
16
+ * - data array structs for the actual data for each reports, including:
17
+ * - date string date+time the abuse report was received and processed
18
+ * - email string the email address that reported abuse
19
+ * - campaign_id string the unique id for the campaign that report was made against
20
+ * - type string an internal type generally specifying the originating mail provider - may not be useful outside of filling report views
21
+ */
22
+ public function abuseReports($id, $start=0, $limit=500, $since=null) {
23
+ $_params = array("id" => $id, "start" => $start, "limit" => $limit, "since" => $since);
24
+ return $this->master->call('lists/abuse-reports', $_params);
25
+ }
26
+
27
+ /**
28
+ * Access up to the previous 180 days of daily detailed aggregated activity stats for a given list. Does not include AutoResponder activity.
29
+ * @param string $id
30
+ * @return array of structs containing daily values, each containing:
31
+ */
32
+ public function activity($id) {
33
+ $_params = array("id" => $id);
34
+ return $this->master->call('lists/activity', $_params);
35
+ }
36
+
37
+ /**
38
+ * Subscribe a batch of email addresses to a list at once. If you are using a serialized version of the API, we strongly suggest that you
39
+ only run this method as a POST request, and <em>not</em> a GET request. Maximum batch sizes vary based on the amount of data in each record,
40
+ though you should cap them at 5k - 10k records, depending on your experience. These calls are also long, so be sure you increase your timeout values.
41
+ * @param string $id
42
+ * @param array $batch
43
+ * - email associative_array a struct with one of the following keys - failing to provide anything will produce an error relating to the email address. Provide multiples and we'll use the first we see in this same order.
44
+ * - email string an email address
45
+ * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
46
+ * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
47
+ * - email_type string for the email type option (html or text)
48
+ * - merge_vars associative_array data for the various list specific and special merge vars documented in lists/subscribe
49
+ * @param boolean $double_optin
50
+ * @param boolean $update_existing
51
+ * @param boolean $replace_interests
52
+ * @return associative_array struct of result counts and associated data
53
+ * - add_count int Number of email addresses that were successfully added
54
+ * - adds array array of structs for each add
55
+ * - email string the email address added
56
+ * - euid string the email unique id
57
+ * - leid string the list member's truly unique id
58
+ * - update_count int Number of email addresses that were successfully updated
59
+ * - updates array array of structs for each update
60
+ * - email string the email address added
61
+ * - euid string the email unique id
62
+ * - leid string the list member's truly unique id
63
+ * - error_count int Number of email addresses that failed during addition/updating
64
+ * - errors array array of error structs including:
65
+ * - email string whatever was passed in the batch record's email parameter
66
+ * - email string the email address added
67
+ * - euid string the email unique id
68
+ * - leid string the list member's truly unique id
69
+ * - code int the error code
70
+ * - error string the full error message
71
+ * - row associative_array the row from the batch that caused the error
72
+ */
73
+ public function batchSubscribe($id, $batch, $double_optin=true, $update_existing=false, $replace_interests=true) {
74
+ $_params = array("id" => $id, "batch" => $batch, "double_optin" => $double_optin, "update_existing" => $update_existing, "replace_interests" => $replace_interests);
75
+ return $this->master->call('lists/batch-subscribe', $_params);
76
+ }
77
+
78
+ /**
79
+ * Unsubscribe a batch of email addresses from a list
80
+ * @param string $id
81
+ * @param array $batch
82
+ * - email string an email address
83
+ * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
84
+ * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
85
+ * @param boolean $delete_member
86
+ * @param boolean $send_goodbye
87
+ * @param boolean $send_notify
88
+ * @return array Array of structs containing results and any errors that occurred
89
+ * - success_count int Number of email addresses that were successfully removed
90
+ * - error_count int Number of email addresses that failed during addition/updating
91
+ * - of array structs contain error details including:
92
+ * - errors array array of error structs including:
93
+ * - email string whatever was passed in the batch record's email parameter
94
+ * - email string the email address added
95
+ * - euid string the email unique id
96
+ * - leid string the list member's truly unique id
97
+ * - code int the error code
98
+ * - error string the full error message
99
+ */
100
+ public function batchUnsubscribe($id, $batch, $delete_member=false, $send_goodbye=true, $send_notify=false) {
101
+ $_params = array("id" => $id, "batch" => $batch, "delete_member" => $delete_member, "send_goodbye" => $send_goodbye, "send_notify" => $send_notify);
102
+ return $this->master->call('lists/batch-unsubscribe', $_params);
103
+ }
104
+
105
+ /**
106
+ * Retrieve the clients that the list's subscribers have been tagged as being used based on user agents seen. Made possible by <a href="http://user-agent-string.info" target="_blank">user-agent-string.info</a>
107
+ * @param string $id
108
+ * @return associative_array the desktop and mobile user agents in use on the list
109
+ * - desktop associative_array desktop user agents and percentages
110
+ * - penetration double the percent of desktop clients in use
111
+ * - clients array array of structs for each client including:
112
+ * - client string the common name for the client
113
+ * - icon string a url to an image representing this client
114
+ * - percent string percent of list using the client
115
+ * - members string total members using the client
116
+ * - mobile associative_array mobile user agents and percentages
117
+ * - penetration double the percent of mobile clients in use
118
+ * - clients array array of structs for each client including:
119
+ * - client string the common name for the client
120
+ * - icon string a url to an image representing this client
121
+ * - percent string percent of list using the client
122
+ * - members string total members using the client
123
+ */
124
+ public function clients($id) {
125
+ $_params = array("id" => $id);
126
+ return $this->master->call('lists/clients', $_params);
127
+ }
128
+
129
+ /**
130
+ * Access the Growth History by Month in aggregate or for a given list.
131
+ * @param string $id
132
+ * @return array array of structs containing months and growth data
133
+ * - month string The Year and Month in question using YYYY-MM format
134
+ * - existing int number of existing subscribers to start the month
135
+ * - imports int number of subscribers imported during the month
136
+ * - optins int number of subscribers who opted-in during the month
137
+ */
138
+ public function growthHistory($id=null) {
139
+ $_params = array("id" => $id);
140
+ return $this->master->call('lists/growth-history', $_params);
141
+ }
142
+
143
+ /**
144
+ * Get the list of interest groupings for a given list, including the label, form information, and included groups for each
145
+ * @param string $id
146
+ * @param bool $counts
147
+ * @return array array of structs of the interest groupings for the list
148
+ * - id int The id for the Grouping
149
+ * - name string Name for the Interest groups
150
+ * - form_field string Gives the type of interest group: checkbox,radio,select
151
+ * - groups array Array structs of the grouping options (interest groups) including:
152
+ * - bit string the bit value - not really anything to be done with this
153
+ * - name string the name of the group
154
+ * - display_order string the display order of the group, if set
155
+ * - subscribers int total number of subscribers who have this group if "counts" is true. otherwise empty
156
+ */
157
+ public function interestGroupings($id, $counts=false) {
158
+ $_params = array("id" => $id, "counts" => $counts);
159
+ return $this->master->call('lists/interest-groupings', $_params);
160
+ }
161
+
162
+ /**
163
+ * Add a single Interest Group - if interest groups for the List are not yet enabled, adding the first
164
+ group will automatically turn them on.
165
+ * @param string $id
166
+ * @param string $group_name
167
+ * @param int $grouping_id
168
+ * @return associative_array with a single entry:
169
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
170
+ */
171
+ public function interestGroupAdd($id, $group_name, $grouping_id=null) {
172
+ $_params = array("id" => $id, "group_name" => $group_name, "grouping_id" => $grouping_id);
173
+ return $this->master->call('lists/interest-group-add', $_params);
174
+ }
175
+
176
+ /**
177
+ * Delete a single Interest Group - if the last group for a list is deleted, this will also turn groups for the list off.
178
+ * @param string $id
179
+ * @param string $group_name
180
+ * @param int $grouping_id
181
+ * @return associative_array with a single entry:
182
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
183
+ */
184
+ public function interestGroupDel($id, $group_name, $grouping_id=null) {
185
+ $_params = array("id" => $id, "group_name" => $group_name, "grouping_id" => $grouping_id);
186
+ return $this->master->call('lists/interest-group-del', $_params);
187
+ }
188
+
189
+ /**
190
+ * Change the name of an Interest Group
191
+ * @param string $id
192
+ * @param string $old_name
193
+ * @param string $new_name
194
+ * @param int $grouping_id
195
+ * @return associative_array with a single entry:
196
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
197
+ */
198
+ public function interestGroupUpdate($id, $old_name, $new_name, $grouping_id=null) {
199
+ $_params = array("id" => $id, "old_name" => $old_name, "new_name" => $new_name, "grouping_id" => $grouping_id);
200
+ return $this->master->call('lists/interest-group-update', $_params);
201
+ }
202
+
203
+ /**
204
+ * Add a new Interest Grouping - if interest groups for the List are not yet enabled, adding the first
205
+ grouping will automatically turn them on.
206
+ * @param string $id
207
+ * @param string $name
208
+ * @param string $type
209
+ * @param array $groups
210
+ * @return associative_array with a single entry:
211
+ * - id int the new grouping id if the request succeeds, otherwise an error will be thrown
212
+ */
213
+ public function interestGroupingAdd($id, $name, $type, $groups) {
214
+ $_params = array("id" => $id, "name" => $name, "type" => $type, "groups" => $groups);
215
+ return $this->master->call('lists/interest-grouping-add', $_params);
216
+ }
217
+
218
+ /**
219
+ * Delete an existing Interest Grouping - this will permanently delete all contained interest groups and will remove those selections from all list members
220
+ * @param int $grouping_id
221
+ * @return associative_array with a single entry:
222
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
223
+ */
224
+ public function interestGroupingDel($grouping_id) {
225
+ $_params = array("grouping_id" => $grouping_id);
226
+ return $this->master->call('lists/interest-grouping-del', $_params);
227
+ }
228
+
229
+ /**
230
+ * Update an existing Interest Grouping
231
+ * @param int $grouping_id
232
+ * @param string $name
233
+ * @param string $value
234
+ * @return associative_array with a single entry:
235
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
236
+ */
237
+ public function interestGroupingUpdate($grouping_id, $name, $value) {
238
+ $_params = array("grouping_id" => $grouping_id, "name" => $name, "value" => $value);
239
+ return $this->master->call('lists/interest-grouping-update', $_params);
240
+ }
241
+
242
+ /**
243
+ * Retrieve the locations (countries) that the list's subscribers have been tagged to based on geocoding their IP address
244
+ * @param string $id
245
+ * @return array array of locations
246
+ * - country string the country name
247
+ * - cc string the ISO 3166 2 digit country code
248
+ * - percent double the percent of subscribers in the country
249
+ * - total double the total number of subscribers in the country
250
+ */
251
+ public function locations($id) {
252
+ $_params = array("id" => $id);
253
+ return $this->master->call('lists/locations', $_params);
254
+ }
255
+
256
+ /**
257
+ * Get the most recent 100 activities for particular list members (open, click, bounce, unsub, abuse, sent to, etc.)
258
+ * @param string $id
259
+ * @param array $emails
260
+ * - email string an email address - for new subscribers obviously this should be used
261
+ * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
262
+ * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
263
+ * @return associative_array of data and success/error counts
264
+ * - success_count int the number of subscribers successfully found on the list
265
+ * - error_count int the number of subscribers who were not found on the list
266
+ * - errors array array of error structs including:
267
+ * - email string whatever was passed in the email parameter
268
+ * - email string the email address added
269
+ * - euid string the email unique id
270
+ * - leid string the list member's truly unique id
271
+ * - error string the error message
272
+ * - code string the error code
273
+ * - data array an array of structs where each activity record has:
274
+ * - email string whatever was passed in the email parameter
275
+ * - email string the email address added
276
+ * - euid string the email unique id
277
+ * - leid string the list member's truly unique id
278
+ * - activity array an array of structs containing the activity, including:
279
+ * - action string The action name, one of: open, click, bounce, unsub, abuse, sent, queued, ecomm, mandrill_send, mandrill_hard_bounce, mandrill_soft_bounce, mandrill_open, mandrill_click, mandrill_spam, mandrill_unsub, mandrill_reject
280
+ * - timestamp string The date+time of the action (GMT)
281
+ * - url string For click actions, the url clicked, otherwise this is empty
282
+ * - type string If there's extra bounce, unsub, etc data it will show up here.
283
+ * - campaign_id string The campaign id the action was related to, if it exists - otherwise empty (ie, direct unsub from list)
284
+ * - campaign_data associative_array If not deleted, the campaigns/list data for the campaign
285
+ */
286
+ public function memberActivity($id, $emails) {
287
+ $_params = array("id" => $id, "emails" => $emails);
288
+ return $this->master->call('lists/member-activity', $_params);
289
+ }
290
+
291
+ /**
292
+ * Get all the information for particular members of a list
293
+ * @param string $id
294
+ * @param array $emails
295
+ * - email string an email address - for new subscribers obviously this should be used
296
+ * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
297
+ * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
298
+ * @return associative_array of data and success/error counts
299
+ * - success_count int the number of subscribers successfully found on the list
300
+ * - error_count int the number of subscribers who were not found on the list
301
+ * - errors array array of error structs including:
302
+ * - email associative_array whatever was passed in the email parameter
303
+ * - email string the email address added
304
+ * - euid string the email unique id
305
+ * - leid string the list member's truly unique id
306
+ * - error string the error message
307
+ * - data array array of structs for each valid list member
308
+ * - id string The unique id (euid) for this email address on an account
309
+ * - email string The email address associated with this record
310
+ * - email_type string The type of emails this customer asked to get: html or text
311
+ * - merges associative_array a struct containing a key for each merge tags and the data for those tags for this email address, plus:
312
+ * - GROUPINGS array if Interest groupings are enabled, this will exist with structs for each grouping:
313
+ * - id int the grouping id
314
+ * - name string the interest group name
315
+ * - groups array structs for each group in the grouping
316
+ * - name string the group name
317
+ * - interested bool whether the member has this group selected
318
+ * - status string The subscription status for this email address, either pending, subscribed, unsubscribed, or cleaned
319
+ * - ip_signup string IP Address this address signed up from. This may be blank if single optin is used.
320
+ * - timestamp_signup string The date+time the double optin was initiated. This may be blank if single optin is used.
321
+ * - ip_opt string IP Address this address opted in from.
322
+ * - timestamp_opt string The date+time the optin completed
323
+ * - member_rating int the rating of the subscriber. This will be 1 - 5 as described <a href="http://eepurl.com/f-2P" target="_blank">here</a>
324
+ * - campaign_id string If the user is unsubscribed and they unsubscribed from a specific campaign, that campaign_id will be listed, otherwise this is not returned.
325
+ * - lists array An array of structs for the other lists this member belongs to
326
+ * - id string the list id
327
+ * - status string the members status on that list
328
+ * - timestamp string The date+time this email address entered it's current status
329
+ * - info_changed string The last time this record was changed. If the record is old enough, this may be blank.
330
+ * - web_id int The Member id used in our web app, allows you to create a link directly to it
331
+ * - leid int The Member id used in our web app, allows you to create a link directly to it
332
+ * - list_id string The list id the for the member record being returned
333
+ * - list_name string The list name the for the member record being returned
334
+ * - language string if set/detected, a language code from <a href="http://kb.mailchimp.com/article/can-i-see-what-languages-my-subscribers-use#code" target="_blank">here</a>
335
+ * - is_gmonkey bool Whether the member is a <a href="http://mailchimp.com/features/golden-monkeys/" target="_blank">Golden Monkey</a> or not.
336
+ * - geo associative_array the geographic information if we have it. including:
337
+ * - latitude string the latitude
338
+ * - longitude string the longitude
339
+ * - gmtoff string GMT offset
340
+ * - dstoff string GMT offset during daylight savings (if DST not observered, will be same as gmtoff)
341
+ * - timezone string the timezone we've place them in
342
+ * - cc string 2 digit ISO-3166 country code
343
+ * - region string generally state, province, or similar
344
+ * - clients associative_array the client we've tracked the address as using with two keys:
345
+ * - name string the common name of the client
346
+ * - icon_url string a url representing a path to an icon representing this client
347
+ * - static_segments array structs for each static segments the member is a part of including:
348
+ * - id int the segment id
349
+ * - name string the name given to the segment
350
+ * - added string the date the member was added
351
+ * - notes array structs for each note entered for this member. For each note:
352
+ * - id int the note id
353
+ * - note string the text entered
354
+ * - created string the date the note was created
355
+ * - updated string the date the note was last updated
356
+ * - created_by_name string the name of the user who created the note. This can change as users update their profile.
357
+ */
358
+ public function memberInfo($id, $emails) {
359
+ $_params = array("id" => $id, "emails" => $emails);
360
+ return $this->master->call('lists/member-info', $_params);
361
+ }
362
+
363
+ /**
364
+ * Get all of the list members for a list that are of a particular status and potentially matching a segment. This will cause locking, so don't run multiples at once. Are you trying to get a dump including lots of merge
365
+ data or specific members of a list? If so, checkout the <a href="/export/1.0/list.func.php">List Export API</a>
366
+ * @param string $id
367
+ * @param string $status
368
+ * @param associative_array $opts
369
+ * - start int optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
370
+ * - limit int optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100
371
+ * - sort_field string optional the data field to sort by - mergeX (1-30), your custom merge tags, "email", "rating","last_update_time", or "optin_time" - invalid fields will be ignored
372
+ * - sort_dir string optional the direct - ASC or DESC. defaults to ASC (case insensitive)
373
+ * - segment associative_array a properly formatted segment that works with campaigns/segment-test
374
+ * @return associative_array of the total records matched and limited list member data for this page
375
+ * - total int the total matching records
376
+ * - data array structs for each member as returned by member-info
377
+ */
378
+ public function members($id, $status='subscribed', $opts=array()) {
379
+ $_params = array("id" => $id, "status" => $status, "opts" => $opts);
380
+ return $this->master->call('lists/members', $_params);
381
+ }
382
+
383
+ /**
384
+ * Add a new merge tag to a given list
385
+ * @param string $id
386
+ * @param string $tag
387
+ * @param string $name
388
+ * @param associative_array $options
389
+ * - field_type string optional one of: text, number, radio, dropdown, date, address, phone, url, imageurl, zip, birthday - defaults to text
390
+ * - req boolean optional indicates whether the field is required - defaults to false
391
+ * - public boolean optional indicates whether the field is displayed in public - defaults to true
392
+ * - show boolean optional indicates whether the field is displayed in the app's list member view - defaults to true
393
+ * - order int The order this merge tag should be displayed in - this will cause existing values to be reset so this fits
394
+ * - default_value string optional the default value for the field. See lists/subscribe() for formatting info. Defaults to blank - max 255 bytes
395
+ * - helptext string optional the help text to be used with some newer forms. Defaults to blank - max 255 bytes
396
+ * - choices array optional kind of - an array of strings to use as the choices for radio and dropdown type fields
397
+ * - dateformat string optional only valid for birthday and date fields. For birthday type, must be "MM/DD" (default) or "DD/MM". For date type, must be "MM/DD/YYYY" (default) or "DD/MM/YYYY". Any other values will be converted to the default.
398
+ * - phoneformat string optional "US" is the default - any other value will cause them to be unformatted (international)
399
+ * - defaultcountry string optional the <a href="http://www.iso.org/iso/english_country_names_and_code_elements" target="_blank">ISO 3166 2 digit character code</a> for the default country. Defaults to "US". Anything unrecognized will be converted to the default.
400
+ * @return associative_array the full data for the new merge var, just like merge-vars returns
401
+ * - name string Name/description of the merge field
402
+ * - req bool Denotes whether the field is required (true) or not (false)
403
+ * - field_type string The "data type" of this merge var. One of: email, text, number, radio, dropdown, date, address, phone, url, imageurl
404
+ * - public bool Whether or not this field is visible to list subscribers
405
+ * - show bool Whether the field is displayed in thelist dashboard
406
+ * - order string The order this field displays in on forms
407
+ * - default string The default value for this field
408
+ * - helptext string The helptext for this field
409
+ * - size string The width of the field to be used
410
+ * - tag string The merge tag that's used for forms and lists/subscribe() and lists/update-member()
411
+ * - choices array the options available for radio and dropdown field types
412
+ * - id int an unchanging id for the merge var
413
+ */
414
+ public function mergeVarAdd($id, $tag, $name, $options=array()) {
415
+ $_params = array("id" => $id, "tag" => $tag, "name" => $name, "options" => $options);
416
+ return $this->master->call('lists/merge-var-add', $_params);
417
+ }
418
+
419
+ /**
420
+ * Delete a merge tag from a given list and all its members. Seriously - the data is removed from all members as well!
421
+ Note that on large lists this method may seem a bit slower than calls you typically make.
422
+ * @param string $id
423
+ * @param string $tag
424
+ * @return associative_array with a single entry:
425
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
426
+ */
427
+ public function mergeVarDel($id, $tag) {
428
+ $_params = array("id" => $id, "tag" => $tag);
429
+ return $this->master->call('lists/merge-var-del', $_params);
430
+ }
431
+
432
+ /**
433
+ * Completely resets all data stored in a merge var on a list. All data is removed and this action can not be undone.
434
+ * @param string $id
435
+ * @param string $tag
436
+ * @return associative_array with a single entry:
437
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
438
+ */
439
+ public function mergeVarReset($id, $tag) {
440
+ $_params = array("id" => $id, "tag" => $tag);
441
+ return $this->master->call('lists/merge-var-reset', $_params);
442
+ }
443
+
444
+ /**
445
+ * Sets a particular merge var to the specified value for every list member. Only merge var ids 1 - 30 may be modified this way. This is generally a dirty method
446
+ unless you're fixing data since you should probably be using default_values and/or conditional content. as with lists/merge-var-reset(), this can not be undone.
447
+ * @param string $id
448
+ * @param string $tag
449
+ * @param string $value
450
+ * @return associative_array with a single entry:
451
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
452
+ */
453
+ public function mergeVarSet($id, $tag, $value) {
454
+ $_params = array("id" => $id, "tag" => $tag, "value" => $value);
455
+ return $this->master->call('lists/merge-var-set', $_params);
456
+ }
457
+
458
+ /**
459
+ * Update most parameters for a merge tag on a given list. You cannot currently change the merge type
460
+ * @param string $id
461
+ * @param string $tag
462
+ * @param associative_array $options
463
+ * @return associative_array the full data for the new merge var, just like merge-vars returns
464
+ * - name string Name/description of the merge field
465
+ * - req bool Denotes whether the field is required (true) or not (false)
466
+ * - field_type string The "data type" of this merge var. One of: email, text, number, radio, dropdown, date, address, phone, url, imageurl
467
+ * - public bool Whether or not this field is visible to list subscribers
468
+ * - show bool Whether the field is displayed in thelist dashboard
469
+ * - order string The order this field to displays in on forms
470
+ * - default string The default value for this field
471
+ * - helptext string The helptext for this field
472
+ * - size string The width of the field to be used
473
+ * - tag string The merge tag that's used for forms and lists/subscribe() and lists/update-member()
474
+ * - choices array the options available for radio and dropdown field types
475
+ * - id int an unchanging id for the merge var
476
+ */
477
+ public function mergeVarUpdate($id, $tag, $options) {
478
+ $_params = array("id" => $id, "tag" => $tag, "options" => $options);
479
+ return $this->master->call('lists/merge-var-update', $_params);
480
+ }
481
+
482
+ /**
483
+ * Get the list of merge tags for a given list, including their name, tag, and required setting
484
+ * @param array $id
485
+ * @return associative_array of data and success/error counts
486
+ * - success_count int the number of subscribers successfully found on the list
487
+ * - error_count int the number of subscribers who were not found on the list
488
+ * - data array of structs for the merge tags on each list
489
+ * - id string the list id
490
+ * - name string the list name
491
+ * - merge_vars array of structs for each merge var
492
+ * - name string Name of the merge field
493
+ * - req bool Denotes whether the field is required (true) or not (false)
494
+ * - field_type string The "data type" of this merge var. One of the options accepted by field_type in lists/merge-var-add
495
+ * - public bool Whether or not this field is visible to list subscribers
496
+ * - show bool Whether the list owner has this field displayed on their list dashboard
497
+ * - order string The order the list owner has set this field to display in
498
+ * - default string The default value the list owner has set for this field
499
+ * - helptext string The helptext for this field
500
+ * - size string The width of the field to be used
501
+ * - tag string The merge tag that's used for forms and lists/subscribe() and listUpdateMember()
502
+ * - choices array For radio and dropdown field types, an array of the options available
503
+ * - id int an unchanging id for the merge var
504
+ * - errors array of error structs
505
+ * - id string the passed list id that failed
506
+ * - code int the resulting error code
507
+ * - msg string the resulting error message
508
+ */
509
+ public function mergeVars($id) {
510
+ $_params = array("id" => $id);
511
+ return $this->master->call('lists/merge-vars', $_params);
512
+ }
513
+
514
+ /**
515
+ * Retrieve all of Segments for a list.
516
+ * @param string $id
517
+ * @param string $type
518
+ * @return associative_array with 2 keys:
519
+ * - static.id int the id of the segment
520
+ * - created_date string the date+time the segment was created
521
+ * - last_update string the date+time the segment was last updated (add or del)
522
+ */
523
+ public function segments($id, $type=null) {
524
+ $_params = array("id" => $id, "type" => $type);
525
+ return $this->master->call('lists/segments', $_params);
526
+ }
527
+
528
+ /**
529
+ * Save a segment against a list for later use. There is no limit to the number of segments which can be saved. Static Segments <strong>are not</strong> tied
530
+ to any merge data, interest groups, etc. They essentially allow you to configure an unlimited number of custom segments which will have standard performance.
531
+ When using proper segments, Static Segments are one of the available options for segmentation just as if you used a merge var (and they can be used with other segmentation
532
+ options), though performance may degrade at that point. Saved Segments (called "auto-updating" in the app) are essentially just the match+conditions typically
533
+ used.
534
+ * @param string $id
535
+ * @param associative_array $opts
536
+ * - type string either "static" or "saved"
537
+ * - name string a unique name per list for the segment - 100 byte maximum length, anything longer will throw an error
538
+ * - segment_opts associative_array for "saved" only, the standard segment match+conditions, just like campaigns/segment-test
539
+ * - match string "any" or "all"
540
+ * - conditions array structs for each condition, just like campaigns/segment-test
541
+ * @return associative_array with a single entry:
542
+ * - id int the id of the new segment, otherwise an error will be thrown.
543
+ */
544
+ public function segmentAdd($id, $opts) {
545
+ $_params = array("id" => $id, "opts" => $opts);
546
+ return $this->master->call('lists/segment-add', $_params);
547
+ }
548
+
549
+ /**
550
+ * Delete a segment. Note that this will, of course, remove any member affiliations with any static segments deleted
551
+ * @param string $id
552
+ * @param int $seg_id
553
+ * @return associative_array with a single entry:
554
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
555
+ */
556
+ public function segmentDel($id, $seg_id) {
557
+ $_params = array("id" => $id, "seg_id" => $seg_id);
558
+ return $this->master->call('lists/segment-del', $_params);
559
+ }
560
+
561
+ /**
562
+ * Allows one to test their segmentation rules before creating a campaign using them - this is no different from campaigns/segment-test() and will eventually replace it.
563
+ For the time being, the crazy segmenting condition documentation will continue to live over there.
564
+ * @param string $list_id
565
+ * @param associative_array $options
566
+ * - saved_segment_id string a saved segment id from lists/segments() - this will take precendence, otherwise the match+conditions are required.
567
+ * - match string controls whether to use AND or OR when applying your options - expects "<strong>any</strong>" (for OR) or "<strong>all</strong>" (for AND)
568
+ * - conditions array of up to 5 structs for different criteria to apply while segmenting. Each criteria row must contain 3 keys - "<strong>field</strong>", "<strong>op</strong>", and "<strong>value</strong>" - and possibly a fourth, "<strong>extra</strong>", based on these definitions:
569
+ * @return associative_array with a single entry:
570
+ * - total int The total number of subscribers matching your segmentation options
571
+ */
572
+ public function segmentTest($list_id, $options) {
573
+ $_params = array("list_id" => $list_id, "options" => $options);
574
+ return $this->master->call('lists/segment-test', $_params);
575
+ }
576
+
577
+ /**
578
+ * Update an existing segment. The list and type can not be changed.
579
+ * @param string $id
580
+ * @param int $seg_id
581
+ * @param associative_array $opts
582
+ * - name string a unique name per list for the segment - 100 byte maximum length, anything longer will throw an error
583
+ * - segment_opts associative_array for "saved" only, the standard segment match+conditions, just like campaigns/segment-test
584
+ * - match associative_array "any" or "all"
585
+ * - conditions array structs for each condition, just like campaigns/segment-test
586
+ * @return associative_array with a single entry:
587
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
588
+ */
589
+ public function segmentUpdate($id, $seg_id, $opts) {
590
+ $_params = array("id" => $id, "seg_id" => $seg_id, "opts" => $opts);
591
+ return $this->master->call('lists/segment-update', $_params);
592
+ }
593
+
594
+ /**
595
+ * Save a segment against a list for later use. There is no limit to the number of segments which can be saved. Static Segments <strong>are not</strong> tied
596
+ to any merge data, interest groups, etc. They essentially allow you to configure an unlimited number of custom segments which will have standard performance.
597
+ When using proper segments, Static Segments are one of the available options for segmentation just as if you used a merge var (and they can be used with other segmentation
598
+ options), though performance may degrade at that point.
599
+ * @param string $id
600
+ * @param string $name
601
+ * @return associative_array with a single entry:
602
+ * - id int the id of the new segment, otherwise an error will be thrown.
603
+ */
604
+ public function staticSegmentAdd($id, $name) {
605
+ $_params = array("id" => $id, "name" => $name);
606
+ return $this->master->call('lists/static-segment-add', $_params);
607
+ }
608
+
609
+ /**
610
+ * Delete a static segment. Note that this will, of course, remove any member affiliations with the segment
611
+ * @param string $id
612
+ * @param int $seg_id
613
+ * @return associative_array with a single entry:
614
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
615
+ */
616
+ public function staticSegmentDel($id, $seg_id) {
617
+ $_params = array("id" => $id, "seg_id" => $seg_id);
618
+ return $this->master->call('lists/static-segment-del', $_params);
619
+ }
620
+
621
+ /**
622
+ * Add list members to a static segment. It is suggested that you limit batch size to no more than 10,000 addresses per call. Email addresses must exist on the list
623
+ in order to be included - this <strong>will not</strong> subscribe them to the list!
624
+ * @param string $id
625
+ * @param int $seg_id
626
+ * @param array $batch
627
+ * - email string an email address
628
+ * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
629
+ * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
630
+ * @return associative_array an array with the results of the operation
631
+ * - success_count int the total number of successful updates (will include members already in the segment)
632
+ * - errors array structs for each error including:
633
+ * - email string whatever was passed in the email parameter
634
+ * - email string the email address added
635
+ * - euid string the email unique id
636
+ * - leid string the list member's truly unique id
637
+ * - code string the error code
638
+ * - error string the full error message
639
+ */
640
+ public function staticSegmentMembersAdd($id, $seg_id, $batch) {
641
+ $_params = array("id" => $id, "seg_id" => $seg_id, "batch" => $batch);
642
+ return $this->master->call('lists/static-segment-members-add', $_params);
643
+ }
644
+
645
+ /**
646
+ * Remove list members from a static segment. It is suggested that you limit batch size to no more than 10,000 addresses per call. Email addresses must exist on the list
647
+ in order to be removed - this <strong>will not</strong> unsubscribe them from the list!
648
+ * @param string $id
649
+ * @param int $seg_id
650
+ * @param array $batch
651
+ * - email string an email address
652
+ * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
653
+ * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
654
+ * @return associative_array an array with the results of the operation
655
+ * - success_count int the total number of successful removals
656
+ * - error_count int the total number of unsuccessful removals
657
+ * - errors array structs for each error including:
658
+ * - email string whatever was passed in the email parameter
659
+ * - email string the email address added
660
+ * - euid string the email unique id
661
+ * - leid string the list member's truly unique id
662
+ * - code string the error code
663
+ * - error string the full error message
664
+ */
665
+ public function staticSegmentMembersDel($id, $seg_id, $batch) {
666
+ $_params = array("id" => $id, "seg_id" => $seg_id, "batch" => $batch);
667
+ return $this->master->call('lists/static-segment-members-del', $_params);
668
+ }
669
+
670
+ /**
671
+ * Resets a static segment - removes <strong>all</strong> members from the static segment. Note: does not actually affect list member data
672
+ * @param string $id
673
+ * @param int $seg_id
674
+ * @return associative_array with a single entry:
675
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
676
+ */
677
+ public function staticSegmentReset($id, $seg_id) {
678
+ $_params = array("id" => $id, "seg_id" => $seg_id);
679
+ return $this->master->call('lists/static-segment-reset', $_params);
680
+ }
681
+
682
+ /**
683
+ * Retrieve all of the Static Segments for a list.
684
+ * @param string $id
685
+ * @return array an of structs with data for each static segment
686
+ * - id int the id of the segment
687
+ * - name string the name for the segment
688
+ * - member_count int the total number of subscribed members currently in a segment
689
+ * - created_date string the date+time the segment was created
690
+ * - last_update string the date+time the segment was last updated (add or del)
691
+ * - last_reset string the date+time the segment was last reset (ie had all members cleared from it)
692
+ */
693
+ public function staticSegments($id) {
694
+ $_params = array("id" => $id);
695
+ return $this->master->call('lists/static-segments', $_params);
696
+ }
697
+
698
+ /**
699
+ * Subscribe the provided email to a list. By default this sends a confirmation email - you will not see new members until the link contained in it is clicked!
700
+ * @param string $id
701
+ * @param associative_array $email
702
+ * - email string an email address - for new subscribers obviously this should be used
703
+ * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
704
+ * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
705
+ * @param associative_array $merge_vars
706
+ * - new-email string set this to change the email address. This is only respected on calls using update_existing or when passed to listUpdateMember().
707
+ * - groupings array of Interest Grouping structs. Each should contain:
708
+ * - id int Grouping "id" from lists/interest-groupings (either this or name must be present) - this id takes precedence and can't change (unlike the name)
709
+ * - name string Grouping "name" from lists/interest-groupings (either this or id must be present)
710
+ * - groups array an array of valid group names for this grouping.
711
+ * - optin_ip string Set the Opt-in IP field. <em>Abusing this may cause your account to be suspended.</em> We do validate this and it must not be a private IP address.
712
+ * - optin_time string Set the Opt-in Time field. <em>Abusing this may cause your account to be suspended.</em> We do validate this and it must be a valid date. Use - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00" to be safe. Generally, though, anything strtotime() understands we'll understand - <a href="http://us2.php.net/strtotime" target="_blank">http://us2.php.net/strtotime</a>
713
+ * - mc_location associative_array Set the member's geographic location either by optin_ip or geo data.
714
+ * - latitude string use the specified latitude (longitude must exist for this to work)
715
+ * - longitude string use the specified longitude (latitude must exist for this to work)
716
+ * - anything string if this (or any other key exists here) we'll try to use the optin ip. NOTE - this will slow down each subscribe call a bit, especially for lat/lng pairs in sparsely populated areas. Currently our automated background processes can and will overwrite this based on opens and clicks.
717
+ * - mc_language string Set the member's language preference. Supported codes are fully case-sensitive and can be found <a href="http://kb.mailchimp.com/article/can-i-see-what-languages-my-subscribers-use#code" target="_new">here</a>.
718
+ * - mc_notes array of structs for managing notes - it may contain:
719
+ * - note string the note to set. this is required unless you're deleting a note
720
+ * - id int the note id to operate on. not including this (or using an invalid id) causes a new note to be added
721
+ * - action string if the "id" key exists and is valid, an "update" key may be set to "append" (default), "prepend", "replace", or "delete" to handle how we should update existing notes. "delete", obviously, will only work with a valid "id" - passing that along with "note" and an invalid "id" is wrong and will be ignored.
722
+ * @param string $email_type
723
+ * @param bool $double_optin
724
+ * @param bool $update_existing
725
+ * @param bool $replace_interests
726
+ * @param bool $send_welcome
727
+ * @return associative_array the ids for this subscriber
728
+ * - email string the email address added
729
+ * - euid string the email unique id
730
+ * - leid string the list member's truly unique id
731
+ */
732
+ public function subscribe($id, $email, $merge_vars=null, $email_type='html', $double_optin=true, $update_existing=false, $replace_interests=true, $send_welcome=false) {
733
+ $_params = array("id" => $id, "email" => $email, "merge_vars" => $merge_vars, "email_type" => $email_type, "double_optin" => $double_optin, "update_existing" => $update_existing, "replace_interests" => $replace_interests, "send_welcome" => $send_welcome);
734
+ return $this->master->call('lists/subscribe', $_params);
735
+ }
736
+
737
+ /**
738
+ * Unsubscribe the given email address from the list
739
+ * @param string $id
740
+ * @param associative_array $email
741
+ * - email string an email address
742
+ * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
743
+ * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
744
+ * @param boolean $delete_member
745
+ * @param boolean $send_goodbye
746
+ * @param boolean $send_notify
747
+ * @return associative_array with a single entry:
748
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
749
+ */
750
+ public function unsubscribe($id, $email, $delete_member=false, $send_goodbye=true, $send_notify=true) {
751
+ $_params = array("id" => $id, "email" => $email, "delete_member" => $delete_member, "send_goodbye" => $send_goodbye, "send_notify" => $send_notify);
752
+ return $this->master->call('lists/unsubscribe', $_params);
753
+ }
754
+
755
+ /**
756
+ * Edit the email address, merge fields, and interest groups for a list member. If you are doing a batch update on lots of users,
757
+ consider using lists/batch-subscribe() with the update_existing and possible replace_interests parameter.
758
+ * @param string $id
759
+ * @param associative_array $email
760
+ * - email string an email address
761
+ * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
762
+ * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
763
+ * @param array $merge_vars
764
+ * @param string $email_type
765
+ * @param boolean $replace_interests
766
+ * @return associative_array the ids for this subscriber
767
+ * - email string the email address added
768
+ * - euid string the email unique id
769
+ * - leid string the list member's truly unique id
770
+ */
771
+ public function updateMember($id, $email, $merge_vars, $email_type='', $replace_interests=true) {
772
+ $_params = array("id" => $id, "email" => $email, "merge_vars" => $merge_vars, "email_type" => $email_type, "replace_interests" => $replace_interests);
773
+ return $this->master->call('lists/update-member', $_params);
774
+ }
775
+
776
+ /**
777
+ * Add a new Webhook URL for the given list
778
+ * @param string $id
779
+ * @param string $url
780
+ * @param associative_array $actions
781
+ * - subscribe bool optional as subscribes occur, defaults to true
782
+ * - unsubscribe bool optional as subscribes occur, defaults to true
783
+ * - profile bool optional as profile updates occur, defaults to true
784
+ * - cleaned bool optional as emails are cleaned from the list, defaults to true
785
+ * - upemail bool optional when subscribers change their email address, defaults to true
786
+ * - campaign bool option when a campaign is sent or canceled, defaults to true
787
+ * @param associative_array $sources
788
+ * - user bool optional user/subscriber initiated actions, defaults to true
789
+ * - admin bool optional admin actions in our web app, defaults to true
790
+ * - api bool optional actions that happen via API calls, defaults to false
791
+ * @return associative_array with a single entry:
792
+ * - id int the id of the new webhook, otherwise an error will be thrown.
793
+ */
794
+ public function webhookAdd($id, $url, $actions=array(), $sources=array()) {
795
+ $_params = array("id" => $id, "url" => $url, "actions" => $actions, "sources" => $sources);
796
+ return $this->master->call('lists/webhook-add', $_params);
797
+ }
798
+
799
+ /**
800
+ * Delete an existing Webhook URL from a given list
801
+ * @param string $id
802
+ * @param string $url
803
+ * @return associative_array with a single entry:
804
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
805
+ */
806
+ public function webhookDel($id, $url) {
807
+ $_params = array("id" => $id, "url" => $url);
808
+ return $this->master->call('lists/webhook-del', $_params);
809
+ }
810
+
811
+ /**
812
+ * Return the Webhooks configured for the given list
813
+ * @param string $id
814
+ * @return array of structs for each webhook
815
+ * - url string the URL for this Webhook
816
+ * - actions associative_array the possible actions and whether they are enabled
817
+ * - subscribe bool triggered when subscribes happen
818
+ * - unsubscribe bool triggered when unsubscribes happen
819
+ * - profile bool triggered when profile updates happen
820
+ * - cleaned bool triggered when a subscriber is cleaned (bounced) from a list
821
+ * - upemail bool triggered when a subscriber's email address is changed
822
+ * - campaign bool triggered when a campaign is sent or canceled
823
+ * - sources associative_array the possible sources and whether they are enabled
824
+ * - user bool whether user/subscriber triggered actions are returned
825
+ * - admin bool whether admin (manual, in-app) triggered actions are returned
826
+ * - api bool whether api triggered actions are returned
827
+ */
828
+ public function webhooks($id) {
829
+ $_params = array("id" => $id);
830
+ return $this->master->call('lists/webhooks', $_params);
831
+ }
832
+
833
+ /**
834
+ * Retrieve all of the lists defined for your user account
835
+ * @param associative_array $filters
836
+ * - list_id string optional - return a single list using a known list_id. Accepts multiples separated by commas when not using exact matching
837
+ * - list_name string optional - only lists that match this name
838
+ * - from_name string optional - only lists that have a default from name matching this
839
+ * - from_email string optional - only lists that have a default from email matching this
840
+ * - from_subject string optional - only lists that have a default from email matching this
841
+ * - created_before string optional - only show lists that were created before this date+time - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00"
842
+ * - created_after string optional - only show lists that were created since this date+time - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00"
843
+ * - exact boolean optional - flag for whether to filter on exact values when filtering, or search within content for filter values - defaults to true
844
+ * @param int $start
845
+ * @param int $limit
846
+ * @param string $sort_field
847
+ * @param string $sort_dir
848
+ * @return associative_array result of the operation including valid data and any errors
849
+ * - total int the total number of lists which matched the provided filters
850
+ * - data array structs for the lists which matched the provided filters, including the following
851
+ * - id string The list id for this list. This will be used for all other list management functions.
852
+ * - web_id int The list id used in our web app, allows you to create a link directly to it
853
+ * - name string The name of the list.
854
+ * - date_created string The date that this list was created.
855
+ * - email_type_option boolean Whether or not the List supports multiple formats for emails or just HTML
856
+ * - use_awesomebar boolean Whether or not campaigns for this list use the Awesome Bar in archives by default
857
+ * - default_from_name string Default From Name for campaigns using this list
858
+ * - default_from_email string Default From Email for campaigns using this list
859
+ * - default_subject string Default Subject Line for campaigns using this list
860
+ * - default_language string Default Language for this list's forms
861
+ * - list_rating double An auto-generated activity score for the list (0 - 5)
862
+ * - subscribe_url_short string Our eepurl shortened version of this list's subscribe form (will not change)
863
+ * - subscribe_url_long string The full version of this list's subscribe form (host will vary)
864
+ * - beamer_address string The email address to use for this list's <a href="http://kb.mailchimp.com/article/how-do-i-import-a-campaign-via-email-email-beamer/">Email Beamer</a>
865
+ * - visibility string Whether this list is Public (pub) or Private (prv). Used internally for projects like <a href="http://blog.mailchimp.com/introducing-wavelength/" target="_blank">Wavelength</a>
866
+ * - stats associative_array various stats and counts for the list - many of these are cached for at least 5 minutes
867
+ * - member_count double The number of active members in the given list.
868
+ * - unsubscribe_count double The number of members who have unsubscribed from the given list.
869
+ * - cleaned_count double The number of members cleaned from the given list.
870
+ * - member_count_since_send double The number of active members in the given list since the last campaign was sent
871
+ * - unsubscribe_count_since_send double The number of members who have unsubscribed from the given list since the last campaign was sent
872
+ * - cleaned_count_since_send double The number of members cleaned from the given list since the last campaign was sent
873
+ * - campaign_count double The number of campaigns in any status that use this list
874
+ * - grouping_count double The number of Interest Groupings for this list
875
+ * - group_count double The number of Interest Groups (regardless of grouping) for this list
876
+ * - merge_var_count double The number of merge vars for this list (not including the required EMAIL one)
877
+ * - avg_sub_rate double the average number of subscribe per month for the list (empty value if we haven't calculated this yet)
878
+ * - avg_unsub_rate double the average number of unsubscribe per month for the list (empty value if we haven't calculated this yet)
879
+ * - target_sub_rate double the target subscription rate for the list to keep it growing (empty value if we haven't calculated this yet)
880
+ * - open_rate double the average open rate per campaign for the list (empty value if we haven't calculated this yet)
881
+ * - click_rate double the average click rate per campaign for the list (empty value if we haven't calculated this yet)
882
+ * - modules array Any list specific modules installed for this list (example is SocialPro)
883
+ * - errors array structs of any errors found while loading lists - usually just from providing invalid list ids
884
+ * - param string the data that caused the failure
885
+ * - code int the error code
886
+ * - error int the error message
887
+ */
888
+ public function getList($filters=array(), $start=0, $limit=25, $sort_field='created', $sort_dir='DESC') {
889
+ $_params = array("filters" => $filters, "start" => $start, "limit" => $limit, "sort_field" => $sort_field, "sort_dir" => $sort_dir);
890
+ return $this->master->call('lists/list', $_params);
891
+ }
892
+
893
+ }
894
+
895
+
Mailchimp/Mobile.php CHANGED
@@ -1,10 +1,10 @@
1
- <?php
2
-
3
- class Mailchimp_Mobile {
4
- public function __construct(wpyksMCAPI $master) {
5
- $this->master = $master;
6
- }
7
-
8
- }
9
-
10
-
1
+ <?php
2
+
3
+ class Mailchimp_Mobile {
4
+ public function __construct(wpyksMCAPI $master) {
5
+ $this->master = $master;
6
+ }
7
+
8
+ }
9
+
10
+
Mailchimp/Neapolitan.php CHANGED
@@ -1,10 +1,10 @@
1
- <?php
2
-
3
- class Mailchimp_Neapolitan {
4
- public function __construct(wpyksMCAPI $master) {
5
- $this->master = $master;
6
- }
7
-
8
- }
9
-
10
-
1
+ <?php
2
+
3
+ class Mailchimp_Neapolitan {
4
+ public function __construct(wpyksMCAPI $master) {
5
+ $this->master = $master;
6
+ }
7
+
8
+ }
9
+
10
+
Mailchimp/Reports.php CHANGED
@@ -1,459 +1,459 @@
1
- <?php
2
-
3
- class Mailchimp_Reports {
4
- public function __construct(wpyksMCAPI $master) {
5
- $this->master = $master;
6
- }
7
-
8
- /**
9
- * Get all email addresses that complained about a given campaign
10
- * @param string $cid
11
- * @param associative_array $opts
12
- * - start int optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
13
- * - limit int optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100
14
- * - since string optional pull only messages since this time - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00"
15
- * @return associative_array abuse report data for this campaign
16
- * - total int the total reports matched
17
- * - data array a struct for the each report, including:
18
- * - date string date/time the abuse report was received and processed
19
- * - member string the email address that reported abuse - will only contain email if the list or member has been removed
20
- * - type string an internal type generally specifying the originating mail provider - may not be useful outside of filling report views
21
- */
22
- public function abuse($cid, $opts=array()) {
23
- $_params = array("cid" => $cid, "opts" => $opts);
24
- return $this->master->call('reports/abuse', $_params);
25
- }
26
-
27
- /**
28
- * Retrieve the text presented in our app for how a campaign performed and any advice we may have for you - best
29
- suited for display in customized reports pages. Note: some messages will contain HTML - clean tags as necessary
30
- * @param string $cid
31
- * @return array of structs for advice on the campaign's performance, each containing:
32
- * - msg string the advice message
33
- * - type string the "type" of the message. one of: negative, positive, or neutral
34
- */
35
- public function advice($cid) {
36
- $_params = array("cid" => $cid);
37
- return $this->master->call('reports/advice', $_params);
38
- }
39
-
40
- /**
41
- * Retrieve the most recent full bounce message for a specific email address on the given campaign.
42
- Messages over 30 days old are subject to being removed
43
- * @param string $cid
44
- * @param associative_array $email
45
- * - email string an email address - this is recommended for this method
46
- * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
47
- * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
48
- * @return associative_array the full bounce message for this email+campaign along with some extra data.
49
- * - date string date the bounce was received and processed
50
- * - member associative_array the member record as returned by lists/member-info()
51
- * - message string the entire bounce message received
52
- */
53
- public function bounceMessage($cid, $email) {
54
- $_params = array("cid" => $cid, "email" => $email);
55
- return $this->master->call('reports/bounce-message', $_params);
56
- }
57
-
58
- /**
59
- * Retrieve the full bounce messages for the given campaign. Note that this can return very large amounts
60
- of data depending on how large the campaign was and how much cruft the bounce provider returned. Also,
61
- messages over 30 days old are subject to being removed
62
- * @param string $cid
63
- * @param associative_array $opts
64
- * - start int optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
65
- * - limit int optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100
66
- * - since string optional pull only messages since this time - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00"
67
- * @return associative_array data for the full bounce messages for this campaign
68
- * - total int that total number of bounce messages for the campaign
69
- * - data array structs containing the data for this page
70
- * - date string date the bounce was received and processed
71
- * - member associative_array the member record as returned by lists/member-info()
72
- * - message string the entire bounce message received
73
- */
74
- public function bounceMessages($cid, $opts=array()) {
75
- $_params = array("cid" => $cid, "opts" => $opts);
76
- return $this->master->call('reports/bounce-messages', $_params);
77
- }
78
-
79
- /**
80
- * Return the list of email addresses that clicked on a given url, and how many times they clicked
81
- * @param string $cid
82
- * @param int $tid
83
- * @param associative_array $opts
84
- * - start int optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
85
- * - limit int optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100
86
- * - sort_field string optional the data to sort by - "clicked" (order clicks occurred, default) or "clicks" (total number of opens). Invalid fields will fall back on the default.
87
- * - sort_dir string optional the direct - ASC or DESC. defaults to ASC (case insensitive)
88
- * @return associative_array containing the total records matched and the specific records for this page
89
- * - total int the total number of records matched
90
- * - data array structs for each email addresses that click the requested url
91
- * - member associative_array the member record as returned by lists/member-info()
92
- * - clicks int Total number of times the URL was clicked by this email address
93
- */
94
- public function clickDetail($cid, $tid, $opts=array()) {
95
- $_params = array("cid" => $cid, "tid" => $tid, "opts" => $opts);
96
- return $this->master->call('reports/click-detail', $_params);
97
- }
98
-
99
- /**
100
- * The urls tracked and their click counts for a given campaign.
101
- * @param string $cid
102
- * @return associative_array including:
103
- * - total array structs for each url tracked for the full campaign
104
- * - url string the url being tracked - urls are tracked individually, so duplicates can exist with vastly different stats
105
- * - clicks int Number of times the specific link was clicked
106
- * - clicks_percent double the percentage of total clicks "clicks" represents
107
- * - unique int Number of unique people who clicked on the specific link
108
- * - unique_percent double the percentage of unique clicks "unique" represents
109
- * - tid int the tracking id used in campaign links - used primarily for reports/click-activity. also can be used to order urls by the order they appeared in the campaign to recreate our heat map.
110
- * - a array if this was an absplit campaign, stat structs for the a group
111
- * - url string the url being tracked - urls are tracked individually, so duplicates can exist with vastly different stats
112
- * - clicks int Number of times the specific link was clicked
113
- * - clicks_percent double the percentage of total clicks "clicks" represents
114
- * - unique int Number of unique people who clicked on the specific link
115
- * - unique_percent double the percentage of unique clicks "unique" represents
116
- * - tid int the tracking id used in campaign links - used primarily for reports/click-activity. also can be used to order urls by the order they appeared in the campaign to recreate our heat map.
117
- * - b array if this was an absplit campaign, stat structs for the b group
118
- * - url string the url being tracked - urls are tracked individually, so duplicates can exist with vastly different stats
119
- * - clicks int Number of times the specific link was clicked
120
- * - clicks_percent double the percentage of total clicks "clicks" represents
121
- * - unique int Number of unique people who clicked on the specific link
122
- * - unique_percent double the percentage of unique clicks "unique" represents
123
- * - tid int the tracking id used in campaign links - used primarily for reports/click-activity. also can be used to order urls by the order they appeared in the campaign to recreate our heat map.
124
- */
125
- public function clicks($cid) {
126
- $_params = array("cid" => $cid);
127
- return $this->master->call('reports/clicks', $_params);
128
- }
129
-
130
- /**
131
- * Retrieve the Ecommerce Orders tracked by ecomm/order-add()
132
- * @param string $cid
133
- * @param associative_array $opts
134
- * - start int optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
135
- * - limit int optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100
136
- * - since string optional pull only messages since this time - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00"
137
- * @return associative_array the total matching orders and the specific orders for the requested page
138
- * - total int the total matching orders
139
- * - data array structs for the actual data for each order being returned
140
- * - store_id string the store id generated by the plugin used to uniquely identify a store
141
- * - store_name string the store name collected by the plugin - often the domain name
142
- * - order_id string the internal order id the store tracked this order by
143
- * - member associative_array the member record as returned by lists/member-info() that received this campaign and is associated with this order
144
- * - order_total double the order total
145
- * - tax_total double the total tax for the order (if collected)
146
- * - ship_total double the shipping total for the order (if collected)
147
- * - order_date string the date the order was tracked - from the store if possible, otherwise the GMT time we received it
148
- * - lines array structs containing details of the order:
149
- * - line_num int the line number assigned to this line
150
- * - product_id int the product id assigned to this item
151
- * - product_name string the product name
152
- * - product_sku string the sku for the product
153
- * - product_category_id int the id for the product category
154
- * - product_category_name string the product category name
155
- * - qty double optional the quantity of the item ordered - defaults to 1
156
- * - cost double optional the cost of a single item (ie, not the extended cost of the line) - defaults to 0
157
- */
158
- public function ecommOrders($cid, $opts=array()) {
159
- $_params = array("cid" => $cid, "opts" => $opts);
160
- return $this->master->call('reports/ecomm-orders', $_params);
161
- }
162
-
163
- /**
164
- * Retrieve the eepurl stats from the web/Twitter mentions for this campaign
165
- * @param string $cid
166
- * @return associative_array containing tweets, retweets, clicks, and referrer related to using the campaign's eepurl
167
- * - twitter associative_array various Twitter related stats
168
- * - tweets int Total number of tweets seen
169
- * - first_tweet string date and time of the first tweet seen
170
- * - last_tweet string date and time of the last tweet seen
171
- * - retweets int Total number of retweets seen
172
- * - first_retweet string date and time of the first retweet seen
173
- * - last_retweet string date and time of the last retweet seen
174
- * - statuses array an structs for statuses recorded including:
175
- * - status string the text of the tweet/update
176
- * - screen_name string the screen name as recorded when first seen
177
- * - status_id string the status id of the tweet (they are really unsigned 64 bit ints)
178
- * - datetime string the date/time of the tweet
179
- * - is_retweet bool whether or not this was a retweet
180
- * - clicks associative_array stats related to click-throughs on the eepurl
181
- * - clicks int Total number of clicks seen
182
- * - first_click string date and time of the first click seen
183
- * - last_click string date and time of the first click seen
184
- * - locations array structs for geographic locations including:
185
- * - country string the country name the click was tracked to
186
- * - region string the region in the country the click was tracked to (if available)
187
- * - referrers array structs for referrers, including
188
- * - referrer string the referrer, truncated to 100 bytes
189
- * - clicks int Total number of clicks seen from this referrer
190
- * - first_click string date and time of the first click seen from this referrer
191
- * - last_click string date and time of the first click seen from this referrer
192
- */
193
- public function eepurl($cid) {
194
- $_params = array("cid" => $cid);
195
- return $this->master->call('reports/eepurl', $_params);
196
- }
197
-
198
- /**
199
- * Given a campaign and email address, return the entire click and open history with timestamps, ordered by time. If you need to dump the full activity for a campaign
200
- and/or get incremental results, you should use the <a href="http://apidocs.mailchimp.com/export/1.0/campaignsubscriberactivity.func.php" targret="_new">campaignSubscriberActivity Export API method</a>,
201
- <strong>not</strong> this, especially for large campaigns.
202
- * @param string $cid
203
- * @param array $emails
204
- * - email string an email address
205
- * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
206
- * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
207
- * @return associative_array of data and success/error counts
208
- * - success_count int the number of subscribers successfully found on the list
209
- * - error_count int the number of subscribers who were not found on the list
210
- * - errors array array of error structs including:
211
- * - email string whatever was passed in the email parameter
212
- * - email string the email address added
213
- * - euid string the email unique id
214
- * - leid string the list member's truly unique id
215
- * - msg string the error message
216
- * - data array an array of structs where each activity record has:
217
- * - email string whatever was passed in the email parameter
218
- * - email string the email address added
219
- * - euid string the email unique id
220
- * - leid string the list member's truly unique id
221
- * - member associative_array the member record as returned by lists/member-info()
222
- * - activity array an array of structs containing the activity, including:
223
- * - action string The action name - either open or click
224
- * - timestamp string The date/time of the action (GMT)
225
- * - url string For click actions, the url clicked, otherwise this is empty
226
- * - ip string The IP address the activity came from
227
- */
228
- public function memberActivity($cid, $emails) {
229
- $_params = array("cid" => $cid, "emails" => $emails);
230
- return $this->master->call('reports/member-activity', $_params);
231
- }
232
-
233
- /**
234
- * Retrieve the list of email addresses that did not open a given campaign
235
- * @param string $cid
236
- * @param associative_array $opts
237
- * - start int optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
238
- * - limit int optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100
239
- * @return associative_array a total of all matching emails and the specific emails for this page
240
- * - total int the total number of members who didn't open the campaign
241
- * - data array structs for each campaign member matching as returned by lists/member-info()
242
- */
243
- public function notOpened($cid, $opts=array()) {
244
- $_params = array("cid" => $cid, "opts" => $opts);
245
- return $this->master->call('reports/not-opened', $_params);
246
- }
247
-
248
- /**
249
- * Retrieve the list of email addresses that opened a given campaign with how many times they opened
250
- * @param string $cid
251
- * @param associative_array $opts
252
- * - start int optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
253
- * - limit int optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100
254
- * - sort_field string optional the data to sort by - "opened" (order opens occurred, default) or "opens" (total number of opens). Invalid fields will fall back on the default.
255
- * - sort_dir string optional the direct - ASC or DESC. defaults to ASC (case insensitive)
256
- * @return associative_array containing the total records matched and the specific records for this page
257
- * - total int the total number of records matched
258
- * - data array structs for the actual opens data, including:
259
- * - member associative_array the member record as returned by lists/member-info()
260
- * - opens int Total number of times the campaign was opened by this email address
261
- */
262
- public function opened($cid, $opts=array()) {
263
- $_params = array("cid" => $cid, "opts" => $opts);
264
- return $this->master->call('reports/opened', $_params);
265
- }
266
-
267
- /**
268
- * Get the top 5 performing email domains for this campaign. Users wanting more than 5 should use campaign reports/member-activity()
269
- or campaignEmailStatsAIMAll() and generate any additional stats they require.
270
- * @param string $cid
271
- * @return array domains structs for each email domains and their associated stats
272
- * - domain string Domain name or special "Other" to roll-up stats past 5 domains
273
- * - total_sent int Total Email across all domains - this will be the same in every row
274
- * - emails int Number of emails sent to this domain
275
- * - bounces int Number of bounces
276
- * - opens int Number of opens
277
- * - clicks int Number of clicks
278
- * - unsubs int Number of unsubs
279
- * - delivered int Number of deliveries
280
- * - emails_pct int Percentage of emails that went to this domain (whole number)
281
- * - bounces_pct int Percentage of bounces from this domain (whole number)
282
- * - opens_pct int Percentage of opens from this domain (whole number)
283
- * - clicks_pct int Percentage of clicks from this domain (whole number)
284
- * - unsubs_pct int Percentage of unsubs from this domain (whole number)
285
- */
286
- public function domainPerformance($cid) {
287
- $_params = array("cid" => $cid);
288
- return $this->master->call('reports/domain-performance', $_params);
289
- }
290
-
291
- /**
292
- * Retrieve the countries/regions and number of opens tracked for each. Email address are not returned.
293
- * @param string $cid
294
- * @return array an array of country structs where opens occurred
295
- * - code string The ISO3166 2 digit country code
296
- * - name string A version of the country name, if we have it
297
- * - opens int The total number of opens that occurred in the country
298
- * - regions array structs of data for each sub-region in the country
299
- * - code string An internal code for the region. When this is blank, it indicates we know the country, but not the region
300
- * - name string The name of the region, if we have one. For blank "code" values, this will be "Rest of Country"
301
- * - opens int The total number of opens that occurred in the country
302
- */
303
- public function geoOpens($cid) {
304
- $_params = array("cid" => $cid);
305
- return $this->master->call('reports/geo-opens', $_params);
306
- }
307
-
308
- /**
309
- * Retrieve the Google Analytics data we've collected for this campaign. Note, requires Google Analytics Add-on to be installed and configured.
310
- * @param string $cid
311
- * @return array of structs for analytics we've collected for the passed campaign.
312
- * - visits int number of visits
313
- * - pages int number of page views
314
- * - new_visits int new visits recorded
315
- * - bounces int vistors who "bounced" from your site
316
- * - time_on_site double the total time visitors spent on your sites
317
- * - goal_conversions int number of goals converted
318
- * - goal_value double value of conversion in dollars
319
- * - revenue double revenue generated by campaign
320
- * - transactions int number of transactions tracked
321
- * - ecomm_conversions int number Ecommerce transactions tracked
322
- * - goals array structs containing goal names and number of conversions
323
- * - name string the name of the goal
324
- * - conversions int the number of conversions for the goal
325
- */
326
- public function googleAnalytics($cid) {
327
- $_params = array("cid" => $cid);
328
- return $this->master->call('reports/google-analytics', $_params);
329
- }
330
-
331
- /**
332
- * Get email addresses the campaign was sent to
333
- * @param string $cid
334
- * @param associative_array $opts
335
- * - status string optional the status to pull - one of 'sent', 'hard' (bounce), or 'soft' (bounce). By default, all records are returned
336
- * - start int optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
337
- * - limit int optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100
338
- * @return associative_array a total of all matching emails and the specific emails for this page
339
- * - total int the total number of members for the campaign and status
340
- * - data array structs for each campaign member matching
341
- * - member associative_array the member record as returned by lists/member-info()
342
- * - status string the status of the send - one of 'sent', 'hard', 'soft'
343
- * - absplit_group string if this was an absplit campaign, one of 'a','b', or 'winner'
344
- * - tz_group string if this was an timewarp campaign the timezone GMT offset the member was included in
345
- */
346
- public function sentTo($cid, $opts=array()) {
347
- $_params = array("cid" => $cid, "opts" => $opts);
348
- return $this->master->call('reports/sent-to', $_params);
349
- }
350
-
351
- /**
352
- * Get the URL to a customized <a href="http://eepurl.com/gKmL" target="_blank">VIP Report</a> for the specified campaign and optionally send an email to someone with links to it. Note subsequent calls will overwrite anything already set for the same campign (eg, the password)
353
- * @param string $cid
354
- * @param array $opts
355
- * - to_email string optional - optional, comma delimited list of email addresses to share the report with - no value means an email will not be sent
356
- * - theme_id int optional - either a global or a user-specific theme id. Currently this needs to be pulled out of either the Share Report or Cobranding web views by grabbing the "theme" attribute from the list presented.
357
- * - css_url string optional - a link to an external CSS file to be included after our default CSS (http://vip-reports.net/css/vip.css) <strong>only if</strong> loaded via the "secure_url" - max 255 bytes
358
- * @return associative_array details for the shared report, including:
359
- * - title string The Title of the Campaign being shared
360
- * - url string The URL to the shared report
361
- * - secure_url string The URL to the shared report, including the password (good for loading in an IFRAME). For non-secure reports, this will not be returned
362
- * - password string If secured, the password for the report, otherwise this field will not be returned
363
- */
364
- public function share($cid, $opts=array()) {
365
- $_params = array("cid" => $cid, "opts" => $opts);
366
- return $this->master->call('reports/share', $_params);
367
- }
368
-
369
- /**
370
- * Retrieve relevant aggregate campaign statistics (opens, bounces, clicks, etc.)
371
- * @param string $cid
372
- * @return associative_array the statistics for this campaign
373
- * - syntax_errors int Number of email addresses in campaign that had syntactical errors.
374
- * - hard_bounces int Number of email addresses in campaign that hard bounced.
375
- * - soft_bounces int Number of email addresses in campaign that soft bounced.
376
- * - unsubscribes int Number of email addresses in campaign that unsubscribed.
377
- * - abuse_reports int Number of email addresses in campaign that reported campaign for abuse.
378
- * - forwards int Number of times email was forwarded to a friend.
379
- * - forwards_opens int Number of times a forwarded email was opened.
380
- * - opens int Number of times the campaign was opened.
381
- * - last_open string Date of the last time the email was opened.
382
- * - unique_opens int Number of people who opened the campaign.
383
- * - clicks int Number of times a link in the campaign was clicked.
384
- * - unique_clicks int Number of unique recipient/click pairs for the campaign.
385
- * - last_click string Date of the last time a link in the email was clicked.
386
- * - users_who_clicked int Number of unique recipients who clicked on a link in the campaign.
387
- * - emails_sent int Number of email addresses campaign was sent to.
388
- * - unique_likes int total number of unique likes (Facebook)
389
- * - recipient_likes int total number of recipients who liked (Facebook) the campaign
390
- * - facebook_likes int total number of likes (Facebook) that came from Facebook
391
- * - industry associative_array Various rates/percentages for the account's selected industry - empty otherwise. These will vary across calls, do not use them for anything important.
392
- * - type string the selected industry
393
- * - open_rate float industry open rate
394
- * - click_rate float industry click rate
395
- * - bounce_rate float industry bounce rate
396
- * - unopen_rate float industry unopen rate
397
- * - unsub_rate float industry unsub rate
398
- * - abuse_rate float industry abuse rate
399
- * - absplit associative_array If this was an absplit campaign, stats for the A and B groups will be returned - otherwise this is empty
400
- * - bounces_a int bounces for the A group
401
- * - bounces_b int bounces for the B group
402
- * - forwards_a int forwards for the A group
403
- * - forwards_b int forwards for the B group
404
- * - abuse_reports_a int abuse reports for the A group
405
- * - abuse_reports_b int abuse reports for the B group
406
- * - unsubs_a int unsubs for the A group
407
- * - unsubs_b int unsubs for the B group
408
- * - recipients_click_a int clicks for the A group
409
- * - recipients_click_b int clicks for the B group
410
- * - forwards_opens_a int opened forwards for the A group
411
- * - forwards_opens_b int opened forwards for the B group
412
- * - opens_a int total opens for the A group
413
- * - opens_b int total opens for the B group
414
- * - last_open_a string date/time of last open for the A group
415
- * - last_open_b string date/time of last open for the BG group
416
- * - unique_opens_a int unique opens for the A group
417
- * - unique_opens_b int unique opens for the B group
418
- * - timewarp array If this campaign was a Timewarp campaign, an array of structs from each timezone stats exist for. Each will contain:
419
- * - opens int opens for this timezone
420
- * - last_open string the date/time of the last open for this timezone
421
- * - unique_opens int the unique opens for this timezone
422
- * - clicks int the total clicks for this timezone
423
- * - last_click string the date/time of the last click for this timezone
424
- * - unique_opens int the unique clicks for this timezone
425
- * - bounces int the total bounces for this timezone
426
- * - total int the total number of members sent to in this timezone
427
- * - sent int the total number of members delivered to in this timezone
428
- * - timeseries array structs for the first 24 hours of the campaign, per-hour stats:
429
- * - timestamp string The timestemp in Y-m-d H:00:00 format
430
- * - emails_sent int the total emails sent during the hour
431
- * - unique_opens int unique opens seen during the hour
432
- * - recipients_click int unique clicks seen during the hour
433
- */
434
- public function summary($cid) {
435
- $_params = array("cid" => $cid);
436
- return $this->master->call('reports/summary', $_params);
437
- }
438
-
439
- /**
440
- * Get all unsubscribed email addresses for a given campaign
441
- * @param string $cid
442
- * @param associative_array $opts
443
- * - start int optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
444
- * - limit int optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100
445
- * @return associative_array a total of all unsubscribed emails and the specific members for this page
446
- * - total int the total number of unsubscribes for the campaign
447
- * - data array structs for the email addresses that unsubscribed
448
- * - member string the member that unsubscribed as returned by lists/member-info()
449
- * - reason string the reason collected for the unsubscribe. If populated, one of 'NORMAL','NOSIGNUP','INAPPROPRIATE','SPAM','OTHER'
450
- * - reason_text string if the reason is OTHER, the text entered.
451
- */
452
- public function unsubscribes($cid, $opts=array()) {
453
- $_params = array("cid" => $cid, "opts" => $opts);
454
- return $this->master->call('reports/unsubscribes', $_params);
455
- }
456
-
457
- }
458
-
459
-
1
+ <?php
2
+
3
+ class Mailchimp_Reports {
4
+ public function __construct(wpyksMCAPI $master) {
5
+ $this->master = $master;
6
+ }
7
+
8
+ /**
9
+ * Get all email addresses that complained about a given campaign
10
+ * @param string $cid
11
+ * @param associative_array $opts
12
+ * - start int optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
13
+ * - limit int optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100
14
+ * - since string optional pull only messages since this time - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00"
15
+ * @return associative_array abuse report data for this campaign
16
+ * - total int the total reports matched
17
+ * - data array a struct for the each report, including:
18
+ * - date string date/time the abuse report was received and processed
19
+ * - member string the email address that reported abuse - will only contain email if the list or member has been removed
20
+ * - type string an internal type generally specifying the originating mail provider - may not be useful outside of filling report views
21
+ */
22
+ public function abuse($cid, $opts=array()) {
23
+ $_params = array("cid" => $cid, "opts" => $opts);
24
+ return $this->master->call('reports/abuse', $_params);
25
+ }
26
+
27
+ /**
28
+ * Retrieve the text presented in our app for how a campaign performed and any advice we may have for you - best
29
+ suited for display in customized reports pages. Note: some messages will contain HTML - clean tags as necessary
30
+ * @param string $cid
31
+ * @return array of structs for advice on the campaign's performance, each containing:
32
+ * - msg string the advice message
33
+ * - type string the "type" of the message. one of: negative, positive, or neutral
34
+ */
35
+ public function advice($cid) {
36
+ $_params = array("cid" => $cid);
37
+ return $this->master->call('reports/advice', $_params);
38
+ }
39
+
40
+ /**
41
+ * Retrieve the most recent full bounce message for a specific email address on the given campaign.
42
+ Messages over 30 days old are subject to being removed
43
+ * @param string $cid
44
+ * @param associative_array $email
45
+ * - email string an email address - this is recommended for this method
46
+ * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
47
+ * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
48
+ * @return associative_array the full bounce message for this email+campaign along with some extra data.
49
+ * - date string date the bounce was received and processed
50
+ * - member associative_array the member record as returned by lists/member-info()
51
+ * - message string the entire bounce message received
52
+ */
53
+ public function bounceMessage($cid, $email) {
54
+ $_params = array("cid" => $cid, "email" => $email);
55
+ return $this->master->call('reports/bounce-message', $_params);
56
+ }
57
+
58
+ /**
59
+ * Retrieve the full bounce messages for the given campaign. Note that this can return very large amounts
60
+ of data depending on how large the campaign was and how much cruft the bounce provider returned. Also,
61
+ messages over 30 days old are subject to being removed
62
+ * @param string $cid
63
+ * @param associative_array $opts
64
+ * - start int optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
65
+ * - limit int optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100
66
+ * - since string optional pull only messages since this time - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00"
67
+ * @return associative_array data for the full bounce messages for this campaign
68
+ * - total int that total number of bounce messages for the campaign
69
+ * - data array structs containing the data for this page
70
+ * - date string date the bounce was received and processed
71
+ * - member associative_array the member record as returned by lists/member-info()
72
+ * - message string the entire bounce message received
73
+ */
74
+ public function bounceMessages($cid, $opts=array()) {
75
+ $_params = array("cid" => $cid, "opts" => $opts);
76
+ return $this->master->call('reports/bounce-messages', $_params);
77
+ }
78
+
79
+ /**
80
+ * Return the list of email addresses that clicked on a given url, and how many times they clicked
81
+ * @param string $cid
82
+ * @param int $tid
83
+ * @param associative_array $opts
84
+ * - start int optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
85
+ * - limit int optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100
86
+ * - sort_field string optional the data to sort by - "clicked" (order clicks occurred, default) or "clicks" (total number of opens). Invalid fields will fall back on the default.
87
+ * - sort_dir string optional the direct - ASC or DESC. defaults to ASC (case insensitive)
88
+ * @return associative_array containing the total records matched and the specific records for this page
89
+ * - total int the total number of records matched
90
+ * - data array structs for each email addresses that click the requested url
91
+ * - member associative_array the member record as returned by lists/member-info()
92
+ * - clicks int Total number of times the URL was clicked by this email address
93
+ */
94
+ public function clickDetail($cid, $tid, $opts=array()) {
95
+ $_params = array("cid" => $cid, "tid" => $tid, "opts" => $opts);
96
+ return $this->master->call('reports/click-detail', $_params);
97
+ }
98
+
99
+ /**
100
+ * The urls tracked and their click counts for a given campaign.
101
+ * @param string $cid
102
+ * @return associative_array including:
103
+ * - total array structs for each url tracked for the full campaign
104
+ * - url string the url being tracked - urls are tracked individually, so duplicates can exist with vastly different stats
105
+ * - clicks int Number of times the specific link was clicked
106
+ * - clicks_percent double the percentage of total clicks "clicks" represents
107
+ * - unique int Number of unique people who clicked on the specific link
108
+ * - unique_percent double the percentage of unique clicks "unique" represents
109
+ * - tid int the tracking id used in campaign links - used primarily for reports/click-activity. also can be used to order urls by the order they appeared in the campaign to recreate our heat map.
110
+ * - a array if this was an absplit campaign, stat structs for the a group
111
+ * - url string the url being tracked - urls are tracked individually, so duplicates can exist with vastly different stats
112
+ * - clicks int Number of times the specific link was clicked
113
+ * - clicks_percent double the percentage of total clicks "clicks" represents
114
+ * - unique int Number of unique people who clicked on the specific link
115
+ * - unique_percent double the percentage of unique clicks "unique" represents
116
+ * - tid int the tracking id used in campaign links - used primarily for reports/click-activity. also can be used to order urls by the order they appeared in the campaign to recreate our heat map.
117
+ * - b array if this was an absplit campaign, stat structs for the b group
118
+ * - url string the url being tracked - urls are tracked individually, so duplicates can exist with vastly different stats
119
+ * - clicks int Number of times the specific link was clicked
120
+ * - clicks_percent double the percentage of total clicks "clicks" represents
121
+ * - unique int Number of unique people who clicked on the specific link
122
+ * - unique_percent double the percentage of unique clicks "unique" represents
123
+ * - tid int the tracking id used in campaign links - used primarily for reports/click-activity. also can be used to order urls by the order they appeared in the campaign to recreate our heat map.
124
+ */
125
+ public function clicks($cid) {
126
+ $_params = array("cid" => $cid);
127
+ return $this->master->call('reports/clicks', $_params);
128
+ }
129
+
130
+ /**
131
+ * Retrieve the Ecommerce Orders tracked by ecomm/order-add()
132
+ * @param string $cid
133
+ * @param associative_array $opts
134
+ * - start int optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
135
+ * - limit int optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100
136
+ * - since string optional pull only messages since this time - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00"
137
+ * @return associative_array the total matching orders and the specific orders for the requested page
138
+ * - total int the total matching orders
139
+ * - data array structs for the actual data for each order being returned
140
+ * - store_id string the store id generated by the plugin used to uniquely identify a store
141
+ * - store_name string the store name collected by the plugin - often the domain name
142
+ * - order_id string the internal order id the store tracked this order by
143
+ * - member associative_array the member record as returned by lists/member-info() that received this campaign and is associated with this order
144
+ * - order_total double the order total
145
+ * - tax_total double the total tax for the order (if collected)
146
+ * - ship_total double the shipping total for the order (if collected)
147
+ * - order_date string the date the order was tracked - from the store if possible, otherwise the GMT time we received it
148
+ * - lines array structs containing details of the order:
149
+ * - line_num int the line number assigned to this line
150
+ * - product_id int the product id assigned to this item
151
+ * - product_name string the product name
152
+ * - product_sku string the sku for the product
153
+ * - product_category_id int the id for the product category
154
+ * - product_category_name string the product category name
155
+ * - qty double optional the quantity of the item ordered - defaults to 1
156
+ * - cost double optional the cost of a single item (ie, not the extended cost of the line) - defaults to 0
157
+ */
158
+ public function ecommOrders($cid, $opts=array()) {
159
+ $_params = array("cid" => $cid, "opts" => $opts);
160
+ return $this->master->call('reports/ecomm-orders', $_params);
161
+ }
162
+
163
+ /**
164
+ * Retrieve the eepurl stats from the web/Twitter mentions for this campaign
165
+ * @param string $cid
166
+ * @return associative_array containing tweets, retweets, clicks, and referrer related to using the campaign's eepurl
167
+ * - twitter associative_array various Twitter related stats
168
+ * - tweets int Total number of tweets seen
169
+ * - first_tweet string date and time of the first tweet seen
170
+ * - last_tweet string date and time of the last tweet seen
171
+ * - retweets int Total number of retweets seen
172
+ * - first_retweet string date and time of the first retweet seen
173
+ * - last_retweet string date and time of the last retweet seen
174
+ * - statuses array an structs for statuses recorded including:
175
+ * - status string the text of the tweet/update
176
+ * - screen_name string the screen name as recorded when first seen
177
+ * - status_id string the status id of the tweet (they are really unsigned 64 bit ints)
178
+ * - datetime string the date/time of the tweet
179
+ * - is_retweet bool whether or not this was a retweet
180
+ * - clicks associative_array stats related to click-throughs on the eepurl
181
+ * - clicks int Total number of clicks seen
182
+ * - first_click string date and time of the first click seen
183
+ * - last_click string date and time of the first click seen
184
+ * - locations array structs for geographic locations including:
185
+ * - country string the country name the click was tracked to
186
+ * - region string the region in the country the click was tracked to (if available)
187
+ * - referrers array structs for referrers, including
188
+ * - referrer string the referrer, truncated to 100 bytes
189
+ * - clicks int Total number of clicks seen from this referrer
190
+ * - first_click string date and time of the first click seen from this referrer
191
+ * - last_click string date and time of the first click seen from this referrer
192
+ */
193
+ public function eepurl($cid) {
194
+ $_params = array("cid" => $cid);
195
+ return $this->master->call('reports/eepurl', $_params);
196
+ }
197
+
198
+ /**
199
+ * Given a campaign and email address, return the entire click and open history with timestamps, ordered by time. If you need to dump the full activity for a campaign
200
+ and/or get incremental results, you should use the <a href="http://apidocs.mailchimp.com/export/1.0/campaignsubscriberactivity.func.php" targret="_new">campaignSubscriberActivity Export API method</a>,
201
+ <strong>not</strong> this, especially for large campaigns.
202
+ * @param string $cid
203
+ * @param array $emails
204
+ * - email string an email address
205
+ * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
206
+ * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
207
+ * @return associative_array of data and success/error counts
208
+ * - success_count int the number of subscribers successfully found on the list
209
+ * - error_count int the number of subscribers who were not found on the list
210
+ * - errors array array of error structs including:
211
+ * - email string whatever was passed in the email parameter
212
+ * - email string the email address added
213
+ * - euid string the email unique id
214
+ * - leid string the list member's truly unique id
215
+ * - msg string the error message
216
+ * - data array an array of structs where each activity record has:
217
+ * - email string whatever was passed in the email parameter
218
+ * - email string the email address added
219
+ * - euid string the email unique id
220
+ * - leid string the list member's truly unique id
221
+ * - member associative_array the member record as returned by lists/member-info()
222
+ * - activity array an array of structs containing the activity, including:
223
+ * - action string The action name - either open or click
224
+ * - timestamp string The date/time of the action (GMT)
225
+ * - url string For click actions, the url clicked, otherwise this is empty
226
+ * - ip string The IP address the activity came from
227
+ */
228
+ public function memberActivity($cid, $emails) {
229
+ $_params = array("cid" => $cid, "emails" => $emails);
230
+ return $this->master->call('reports/member-activity', $_params);
231
+ }
232
+
233
+ /**
234
+ * Retrieve the list of email addresses that did not open a given campaign
235
+ * @param string $cid
236
+ * @param associative_array $opts
237
+ * - start int optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
238
+ * - limit int optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100
239
+ * @return associative_array a total of all matching emails and the specific emails for this page
240
+ * - total int the total number of members who didn't open the campaign
241
+ * - data array structs for each campaign member matching as returned by lists/member-info()
242
+ */
243
+ public function notOpened($cid, $opts=array()) {
244
+ $_params = array("cid" => $cid, "opts" => $opts);
245
+ return $this->master->call('reports/not-opened', $_params);
246
+ }
247
+
248
+ /**
249
+ * Retrieve the list of email addresses that opened a given campaign with how many times they opened
250
+ * @param string $cid
251
+ * @param associative_array $opts
252
+ * - start int optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
253
+ * - limit int optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100
254
+ * - sort_field string optional the data to sort by - "opened" (order opens occurred, default) or "opens" (total number of opens). Invalid fields will fall back on the default.
255
+ * - sort_dir string optional the direct - ASC or DESC. defaults to ASC (case insensitive)
256
+ * @return associative_array containing the total records matched and the specific records for this page
257
+ * - total int the total number of records matched
258
+ * - data array structs for the actual opens data, including:
259
+ * - member associative_array the member record as returned by lists/member-info()
260
+ * - opens int Total number of times the campaign was opened by this email address
261
+ */
262
+ public function opened($cid, $opts=array()) {
263
+ $_params = array("cid" => $cid, "opts" => $opts);
264
+ return $this->master->call('reports/opened', $_params);
265
+ }
266
+
267
+ /**
268
+ * Get the top 5 performing email domains for this campaign. Users wanting more than 5 should use campaign reports/member-activity()
269
+ or campaignEmailStatsAIMAll() and generate any additional stats they require.
270
+ * @param string $cid
271
+ * @return array domains structs for each email domains and their associated stats
272
+ * - domain string Domain name or special "Other" to roll-up stats past 5 domains
273
+ * - total_sent int Total Email across all domains - this will be the same in every row
274
+ * - emails int Number of emails sent to this domain
275
+ * - bounces int Number of bounces
276
+ * - opens int Number of opens
277
+ * - clicks int Number of clicks
278
+ * - unsubs int Number of unsubs
279
+ * - delivered int Number of deliveries
280
+ * - emails_pct int Percentage of emails that went to this domain (whole number)
281
+ * - bounces_pct int Percentage of bounces from this domain (whole number)
282
+ * - opens_pct int Percentage of opens from this domain (whole number)
283
+ * - clicks_pct int Percentage of clicks from this domain (whole number)
284
+ * - unsubs_pct int Percentage of unsubs from this domain (whole number)
285
+ */
286
+ public function domainPerformance($cid) {
287
+ $_params = array("cid" => $cid);
288
+ return $this->master->call('reports/domain-performance', $_params);
289
+ }
290
+
291
+ /**
292
+ * Retrieve the countries/regions and number of opens tracked for each. Email address are not returned.
293
+ * @param string $cid
294
+ * @return array an array of country structs where opens occurred
295
+ * - code string The ISO3166 2 digit country code
296
+ * - name string A version of the country name, if we have it
297
+ * - opens int The total number of opens that occurred in the country
298
+ * - regions array structs of data for each sub-region in the country
299
+ * - code string An internal code for the region. When this is blank, it indicates we know the country, but not the region
300
+ * - name string The name of the region, if we have one. For blank "code" values, this will be "Rest of Country"
301
+ * - opens int The total number of opens that occurred in the country
302
+ */
303
+ public function geoOpens($cid) {
304
+ $_params = array("cid" => $cid);
305
+ return $this->master->call('reports/geo-opens', $_params);
306
+ }
307
+
308
+ /**
309
+ * Retrieve the Google Analytics data we've collected for this campaign. Note, requires Google Analytics Add-on to be installed and configured.
310
+ * @param string $cid
311
+ * @return array of structs for analytics we've collected for the passed campaign.
312
+ * - visits int number of visits
313
+ * - pages int number of page views
314
+ * - new_visits int new visits recorded
315
+ * - bounces int vistors who "bounced" from your site
316
+ * - time_on_site double the total time visitors spent on your sites
317
+ * - goal_conversions int number of goals converted
318
+ * - goal_value double value of conversion in dollars
319
+ * - revenue double revenue generated by campaign
320
+ * - transactions int number of transactions tracked
321
+ * - ecomm_conversions int number Ecommerce transactions tracked
322
+ * - goals array structs containing goal names and number of conversions
323
+ * - name string the name of the goal
324
+ * - conversions int the number of conversions for the goal
325
+ */
326
+ public function googleAnalytics($cid) {
327
+ $_params = array("cid" => $cid);
328
+ return $this->master->call('reports/google-analytics', $_params);
329
+ }
330
+
331
+ /**
332
+ * Get email addresses the campaign was sent to
333
+ * @param string $cid
334
+ * @param associative_array $opts
335
+ * - status string optional the status to pull - one of 'sent', 'hard' (bounce), or 'soft' (bounce). By default, all records are returned
336
+ * - start int optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
337
+ * - limit int optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100
338
+ * @return associative_array a total of all matching emails and the specific emails for this page
339
+ * - total int the total number of members for the campaign and status
340
+ * - data array structs for each campaign member matching
341
+ * - member associative_array the member record as returned by lists/member-info()
342
+ * - status string the status of the send - one of 'sent', 'hard', 'soft'
343
+ * - absplit_group string if this was an absplit campaign, one of 'a','b', or 'winner'
344
+ * - tz_group string if this was an timewarp campaign the timezone GMT offset the member was included in
345
+ */
346
+ public function sentTo($cid, $opts=array()) {
347
+ $_params = array("cid" => $cid, "opts" => $opts);
348
+ return $this->master->call('reports/sent-to', $_params);
349
+ }
350
+
351
+ /**
352
+ * Get the URL to a customized <a href="http://eepurl.com/gKmL" target="_blank">VIP Report</a> for the specified campaign and optionally send an email to someone with links to it. Note subsequent calls will overwrite anything already set for the same campign (eg, the password)
353
+ * @param string $cid
354
+ * @param array $opts
355
+ * - to_email string optional - optional, comma delimited list of email addresses to share the report with - no value means an email will not be sent
356
+ * - theme_id int optional - either a global or a user-specific theme id. Currently this needs to be pulled out of either the Share Report or Cobranding web views by grabbing the "theme" attribute from the list presented.
357
+ * - css_url string optional - a link to an external CSS file to be included after our default CSS (http://vip-reports.net/css/vip.css) <strong>only if</strong> loaded via the "secure_url" - max 255 bytes
358
+ * @return associative_array details for the shared report, including:
359
+ * - title string The Title of the Campaign being shared
360
+ * - url string The URL to the shared report
361
+ * - secure_url string The URL to the shared report, including the password (good for loading in an IFRAME). For non-secure reports, this will not be returned
362
+ * - password string If secured, the password for the report, otherwise this field will not be returned
363
+ */
364
+ public function share($cid, $opts=array()) {
365
+ $_params = array("cid" => $cid, "opts" => $opts);
366
+ return $this->master->call('reports/share', $_params);
367
+ }
368
+
369
+ /**
370
+ * Retrieve relevant aggregate campaign statistics (opens, bounces, clicks, etc.)
371
+ * @param string $cid
372
+ * @return associative_array the statistics for this campaign
373
+ * - syntax_errors int Number of email addresses in campaign that had syntactical errors.
374
+ * - hard_bounces int Number of email addresses in campaign that hard bounced.
375
+ * - soft_bounces int Number of email addresses in campaign that soft bounced.
376
+ * - unsubscribes int Number of email addresses in campaign that unsubscribed.
377
+ * - abuse_reports int Number of email addresses in campaign that reported campaign for abuse.
378
+ * - forwards int Number of times email was forwarded to a friend.
379
+ * - forwards_opens int Number of times a forwarded email was opened.
380
+ * - opens int Number of times the campaign was opened.
381
+ * - last_open string Date of the last time the email was opened.
382
+ * - unique_opens int Number of people who opened the campaign.
383
+ * - clicks int Number of times a link in the campaign was clicked.
384
+ * - unique_clicks int Number of unique recipient/click pairs for the campaign.
385
+ * - last_click string Date of the last time a link in the email was clicked.
386
+ * - users_who_clicked int Number of unique recipients who clicked on a link in the campaign.
387
+ * - emails_sent int Number of email addresses campaign was sent to.
388
+ * - unique_likes int total number of unique likes (Facebook)
389
+ * - recipient_likes int total number of recipients who liked (Facebook) the campaign
390
+ * - facebook_likes int total number of likes (Facebook) that came from Facebook
391
+ * - industry associative_array Various rates/percentages for the account's selected industry - empty otherwise. These will vary across calls, do not use them for anything important.
392
+ * - type string the selected industry
393
+ * - open_rate float industry open rate
394
+ * - click_rate float industry click rate
395
+ * - bounce_rate float industry bounce rate
396
+ * - unopen_rate float industry unopen rate
397
+ * - unsub_rate float industry unsub rate
398
+ * - abuse_rate float industry abuse rate
399
+ * - absplit associative_array If this was an absplit campaign, stats for the A and B groups will be returned - otherwise this is empty
400
+ * - bounces_a int bounces for the A group
401
+ * - bounces_b int bounces for the B group
402
+ * - forwards_a int forwards for the A group
403
+ * - forwards_b int forwards for the B group
404
+ * - abuse_reports_a int abuse reports for the A group
405
+ * - abuse_reports_b int abuse reports for the B group
406
+ * - unsubs_a int unsubs for the A group
407
+ * - unsubs_b int unsubs for the B group
408
+ * - recipients_click_a int clicks for the A group
409
+ * - recipients_click_b int clicks for the B group
410
+ * - forwards_opens_a int opened forwards for the A group
411
+ * - forwards_opens_b int opened forwards for the B group
412
+ * - opens_a int total opens for the A group
413
+ * - opens_b int total opens for the B group
414
+ * - last_open_a string date/time of last open for the A group
415
+ * - last_open_b string date/time of last open for the BG group
416
+ * - unique_opens_a int unique opens for the A group
417
+ * - unique_opens_b int unique opens for the B group
418
+ * - timewarp array If this campaign was a Timewarp campaign, an array of structs from each timezone stats exist for. Each will contain:
419
+ * - opens int opens for this timezone
420
+ * - last_open string the date/time of the last open for this timezone
421
+ * - unique_opens int the unique opens for this timezone
422
+ * - clicks int the total clicks for this timezone
423
+ * - last_click string the date/time of the last click for this timezone
424
+ * - unique_opens int the unique clicks for this timezone
425
+ * - bounces int the total bounces for this timezone
426
+ * - total int the total number of members sent to in this timezone
427
+ * - sent int the total number of members delivered to in this timezone
428
+ * - timeseries array structs for the first 24 hours of the campaign, per-hour stats:
429
+ * - timestamp string The timestemp in Y-m-d H:00:00 format
430
+ * - emails_sent int the total emails sent during the hour
431
+ * - unique_opens int unique opens seen during the hour
432
+ * - recipients_click int unique clicks seen during the hour
433
+ */
434
+ public function summary($cid) {
435
+ $_params = array("cid" => $cid);
436
+ return $this->master->call('reports/summary', $_params);
437
+ }
438
+
439
+ /**
440
+ * Get all unsubscribed email addresses for a given campaign
441
+ * @param string $cid
442
+ * @param associative_array $opts
443
+ * - start int optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
444
+ * - limit int optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100
445
+ * @return associative_array a total of all unsubscribed emails and the specific members for this page
446
+ * - total int the total number of unsubscribes for the campaign
447
+ * - data array structs for the email addresses that unsubscribed
448
+ * - member string the member that unsubscribed as returned by lists/member-info()
449
+ * - reason string the reason collected for the unsubscribe. If populated, one of 'NORMAL','NOSIGNUP','INAPPROPRIATE','SPAM','OTHER'
450
+ * - reason_text string if the reason is OTHER, the text entered.
451
+ */
452
+ public function unsubscribes($cid, $opts=array()) {
453
+ $_params = array("cid" => $cid, "opts" => $opts);
454
+ return $this->master->call('reports/unsubscribes', $_params);
455
+ }
456
+
457
+ }
458
+
459
+
Mailchimp/Templates.php CHANGED
@@ -1,121 +1,121 @@
1
- <?php
2
-
3
- class Mailchimp_Templates {
4
- public function __construct(wpyksMCAPI $master) {
5
- $this->master = $master;
6
- }
7
-
8
- /**
9
- * Create a new user template, <strong>NOT</strong> campaign content. These templates can then be applied while creating campaigns.
10
- * @param string $name
11
- * @param string $html
12
- * @param int $folder_id
13
- * @return associative_array with a single element:
14
- * - template_id int the new template id, otherwise an error is thrown.
15
- */
16
- public function add($name, $html, $folder_id=null) {
17
- $_params = array("name" => $name, "html" => $html, "folder_id" => $folder_id);
18
- return $this->master->call('templates/add', $_params);
19
- }
20
-
21
- /**
22
- * Delete (deactivate) a user template
23
- * @param int $template_id
24
- * @return associative_array with a single entry:
25
- * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
26
- */
27
- public function del($template_id) {
28
- $_params = array("template_id" => $template_id);
29
- return $this->master->call('templates/del', $_params);
30
- }
31
-
32
- /**
33
- * Pull details for a specific template to help support editing
34
- * @param int $template_id
35
- * @param string $type
36
- * @return associative_array info to be used when editing
37
- * - default_content associative_array the default content broken down into the named editable sections for the template - dependant upon template, so not documented
38
- * - sections associative_array the valid editable section names - dependant upon template, so not documented
39
- * - source string the full source of the template as if you exported it via our template editor
40
- * - preview string similar to the source, but the rendered version of the source from our popup preview
41
- */
42
- public function info($template_id, $type='user') {
43
- $_params = array("template_id" => $template_id, "type" => $type);
44
- return $this->master->call('templates/info', $_params);
45
- }
46
-
47
- /**
48
- * Retrieve various templates available in the system, allowing some thing similar to our template gallery to be created.
49
- * @param associative_array $types
50
- * - user boolean Custom templates for this user account. Defaults to true.
51
- * - gallery boolean Templates from our Gallery. Note that some templates that require extra configuration are withheld. (eg, the Etsy template). Defaults to false.
52
- * - base boolean Our "start from scratch" extremely basic templates. Defaults to false.
53
- * @param associative_array $filters
54
- * - category string optional for Gallery templates only, limit to a specific template category
55
- * - folder_id string user templates, limit to this folder_id
56
- * - include_inactive boolean user templates are not deleted, only set inactive. defaults to false.
57
- * - inactive_only boolean only include inactive user templates. defaults to false.
58
- * @return associative_array for each type
59
- * - user array matching user templates, if requested.
60
- * - id int Id of the template
61
- * - name string Name of the template
62
- * - layout string General description of the layout of the template
63
- * - category string The category for the template, if there is one.
64
- * - preview_image string If we've generated it, the url of the preview image for the template. We do out best to keep these up to date, but Preview image urls are not guaranteed to be available
65
- * - date_created string The date/time the template was created
66
- * - active boolean whether or not the template is active and available for use.
67
- * - edit_source boolean Whether or not you are able to edit the source of a template.
68
- * - folder_id boolean if it's in one, the folder id
69
- * - gallery array matching gallery templates, if requested.
70
- * - id int Id of the template
71
- * - name string Name of the template
72
- * - layout string General description of the layout of the template
73
- * - category string The category for the template, if there is one.
74
- * - preview_image string If we've generated it, the url of the preview image for the template. We do out best to keep these up to date, but Preview image urls are not guaranteed to be available
75
- * - date_created string The date/time the template was created
76
- * - active boolean whether or not the template is active and available for use.
77
- * - edit_source boolean Whether or not you are able to edit the source of a template.
78
- * - base array matching base templates, if requested.
79
- * - id int Id of the template
80
- * - name string Name of the template
81
- * - layout string General description of the layout of the template
82
- * - category string The category for the template, if there is one.
83
- * - preview_image string If we've generated it, the url of the preview image for the template. We do out best to keep these up to date, but Preview image urls are not guaranteed to be available
84
- * - active boolean whether or not the template is active and available for use.
85
- * - date_created string The date/time the template was created
86
- * - edit_source boolean Whether or not you are able to edit the source of a template.
87
- */
88
- public function getList($types=array(), $filters=array()) {
89
- $_params = array("types" => $types, "filters" => $filters);
90
- return $this->master->call('templates/list', $_params);
91
- }
92
-
93
- /**
94
- * Undelete (reactivate) a user template
95
- * @param int $template_id
96
- * @return associative_array with a single entry:
97
- * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
98
- */
99
- public function undel($template_id) {
100
- $_params = array("template_id" => $template_id);
101
- return $this->master->call('templates/undel', $_params);
102
- }
103
-
104
- /**
105
- * Replace the content of a user template, <strong>NOT</strong> campaign content.
106
- * @param int $template_id
107
- * @param associative_array $values
108
- * - name string the name for the template - names must be unique and a max of 50 bytes
109
- * - html string a string specifying the entire template to be created. This is <strong>NOT</strong> campaign content. They are intended to utilize our <a href="http://www.mailchimp.com/resources/email-template-language/" target="_blank">template language</a>.
110
- * - folder_id int the folder to put this template in - 0 or a blank values will remove it from a folder.
111
- * @return associative_array with a single entry:
112
- * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
113
- */
114
- public function update($template_id, $values) {
115
- $_params = array("template_id" => $template_id, "values" => $values);
116
- return $this->master->call('templates/update', $_params);
117
- }
118
-
119
- }
120
-
121
-
1
+ <?php
2
+
3
+ class Mailchimp_Templates {
4
+ public function __construct(wpyksMCAPI $master) {
5
+ $this->master = $master;
6
+ }
7
+
8
+ /**
9
+ * Create a new user template, <strong>NOT</strong> campaign content. These templates can then be applied while creating campaigns.
10
+ * @param string $name
11
+ * @param string $html
12
+ * @param int $folder_id
13
+ * @return associative_array with a single element:
14
+ * - template_id int the new template id, otherwise an error is thrown.
15
+ */
16
+ public function add($name, $html, $folder_id=null) {
17
+ $_params = array("name" => $name, "html" => $html, "folder_id" => $folder_id);
18
+ return $this->master->call('templates/add', $_params);
19
+ }
20
+
21
+ /**
22
+ * Delete (deactivate) a user template
23
+ * @param int $template_id
24
+ * @return associative_array with a single entry:
25
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
26
+ */
27
+ public function del($template_id) {
28
+ $_params = array("template_id" => $template_id);
29
+ return $this->master->call('templates/del', $_params);
30
+ }
31
+
32
+ /**
33
+ * Pull details for a specific template to help support editing
34
+ * @param int $template_id
35
+ * @param string $type
36
+ * @return associative_array info to be used when editing
37
+ * - default_content associative_array the default content broken down into the named editable sections for the template - dependant upon template, so not documented
38
+ * - sections associative_array the valid editable section names - dependant upon template, so not documented
39
+ * - source string the full source of the template as if you exported it via our template editor
40
+ * - preview string similar to the source, but the rendered version of the source from our popup preview
41
+ */
42
+ public function info($template_id, $type='user') {
43
+ $_params = array("template_id" => $template_id, "type" => $type);
44
+ return $this->master->call('templates/info', $_params);
45
+ }
46
+
47
+ /**
48
+ * Retrieve various templates available in the system, allowing some thing similar to our template gallery to be created.
49
+ * @param associative_array $types
50
+ * - user boolean Custom templates for this user account. Defaults to true.
51
+ * - gallery boolean Templates from our Gallery. Note that some templates that require extra configuration are withheld. (eg, the Etsy template). Defaults to false.
52
+ * - base boolean Our "start from scratch" extremely basic templates. Defaults to false.
53
+ * @param associative_array $filters
54
+ * - category string optional for Gallery templates only, limit to a specific template category
55
+ * - folder_id string user templates, limit to this folder_id
56
+ * - include_inactive boolean user templates are not deleted, only set inactive. defaults to false.
57
+ * - inactive_only boolean only include inactive user templates. defaults to false.
58
+ * @return associative_array for each type
59
+ * - user array matching user templates, if requested.
60
+ * - id int Id of the template
61
+ * - name string Name of the template
62
+ * - layout string General description of the layout of the template
63
+ * - category string The category for the template, if there is one.
64
+ * - preview_image string If we've generated it, the url of the preview image for the template. We do out best to keep these up to date, but Preview image urls are not guaranteed to be available
65
+ * - date_created string The date/time the template was created
66
+ * - active boolean whether or not the template is active and available for use.
67
+ * - edit_source boolean Whether or not you are able to edit the source of a template.
68
+ * - folder_id boolean if it's in one, the folder id
69
+ * - gallery array matching gallery templates, if requested.
70
+ * - id int Id of the template
71
+ * - name string Name of the template
72
+ * - layout string General description of the layout of the template
73
+ * - category string The category for the template, if there is one.
74
+ * - preview_image string If we've generated it, the url of the preview image for the template. We do out best to keep these up to date, but Preview image urls are not guaranteed to be available
75
+ * - date_created string The date/time the template was created
76
+ * - active boolean whether or not the template is active and available for use.
77
+ * - edit_source boolean Whether or not you are able to edit the source of a template.
78
+ * - base array matching base templates, if requested.
79
+ * - id int Id of the template
80
+ * - name string Name of the template
81
+ * - layout string General description of the layout of the template
82
+ * - category string The category for the template, if there is one.
83
+ * - preview_image string If we've generated it, the url of the preview image for the template. We do out best to keep these up to date, but Preview image urls are not guaranteed to be available
84
+ * - active boolean whether or not the template is active and available for use.
85
+ * - date_created string The date/time the template was created
86
+ * - edit_source boolean Whether or not you are able to edit the source of a template.
87
+ */
88
+ public function getList($types=array(), $filters=array()) {
89
+ $_params = array("types" => $types, "filters" => $filters);
90
+ return $this->master->call('templates/list', $_params);
91
+ }
92
+
93
+ /**
94
+ * Undelete (reactivate) a user template
95
+ * @param int $template_id
96
+ * @return associative_array with a single entry:
97
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
98
+ */
99
+ public function undel($template_id) {
100
+ $_params = array("template_id" => $template_id);
101
+ return $this->master->call('templates/undel', $_params);
102
+ }
103
+
104
+ /**
105
+ * Replace the content of a user template, <strong>NOT</strong> campaign content.
106
+ * @param int $template_id
107
+ * @param associative_array $values
108
+ * - name string the name for the template - names must be unique and a max of 50 bytes
109
+ * - html string a string specifying the entire template to be created. This is <strong>NOT</strong> campaign content. They are intended to utilize our <a href="http://www.mailchimp.com/resources/email-template-language/" target="_blank">template language</a>.
110
+ * - folder_id int the folder to put this template in - 0 or a blank values will remove it from a folder.
111
+ * @return associative_array with a single entry:
112
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
113
+ */
114
+ public function update($template_id, $values) {
115
+ $_params = array("template_id" => $template_id, "values" => $values);
116
+ return $this->master->call('templates/update', $_params);
117
+ }
118
+
119
+ }
120
+
121
+
Mailchimp/Users.php CHANGED
@@ -1,100 +1,100 @@
1
- <?php
2
-
3
- class Mailchimp_Users {
4
- public function __construct(wpyksMCAPI $master) {
5
- $this->master = $master;
6
- }
7
-
8
- /**
9
- * Invite a user to your account
10
- * @param string $email
11
- * @param string $role
12
- * @param string $msg
13
- * @return associative_array the method completion status
14
- * - status string The status (success) of the call if it completed. Otherwise an error is thrown.
15
- */
16
- public function invite($email, $role='viewer', $msg='') {
17
- $_params = array("email" => $email, "role" => $role, "msg" => $msg);
18
- return $this->master->call('users/invite', $_params);
19
- }
20
-
21
- /**
22
- * Resend an invite a user to your account. Note, if the same address has been invited multiple times, this will simpy re-send the most recent invite
23
- * @param string $email
24
- * @return associative_array the method completion status
25
- * - status string The status (success) of the call if it completed. Otherwise an error is thrown.
26
- */
27
- public function inviteResend($email) {
28
- $_params = array("email" => $email);
29
- return $this->master->call('users/invite-resend', $_params);
30
- }
31
-
32
- /**
33
- * Revoke an invitation sent to a user to your account. Note, if the same address has been invited multiple times, this will simpy revoke the most recent invite
34
- * @param string $email
35
- * @return associative_array the method completion status
36
- * - status string The status (success) of the call if it completed. Otherwise an error is thrown.
37
- */
38
- public function inviteRevoke($email) {
39
- $_params = array("email" => $email);
40
- return $this->master->call('users/invite-revoke', $_params);
41
- }
42
-
43
- /**
44
- * Retrieve the list of pending users invitations have been sent for.
45
- * @return array structs for each invitation, including:
46
- * - email string the email address the invitation was sent to
47
- * - role string the role that will be assigned if they accept
48
- * - sent_at string the time the invitation was sent. this will change if it's resent.
49
- * - expiration string the expiration time for the invitation. this will change if it's resent.
50
- * - msg string the welcome message included with the invitation
51
- */
52
- public function invites() {
53
- $_params = array();
54
- return $this->master->call('users/invites', $_params);
55
- }
56
-
57
- /**
58
- * Revoke access for a specified login
59
- * @param string $username
60
- * @return associative_array the method completion status
61
- * - status string The status (success) of the call if it completed. Otherwise an error is thrown.
62
- */
63
- public function loginRevoke($username) {
64
- $_params = array("username" => $username);
65
- return $this->master->call('users/login-revoke', $_params);
66
- }
67
-
68
- /**
69
- * Retrieve the list of active logins.
70
- * @return array structs for each user, including:
71
- * - id int the login id for this login
72
- * - username string the username used to log in
73
- * - name string a display name for the account - empty first/last names will return the username
74
- * - email string the email tied to the account used for passwords resets and the ilk
75
- * - role string the role assigned to the account
76
- * - avatar string if available, the url for the login's avatar
77
- */
78
- public function logins() {
79
- $_params = array();
80
- return $this->master->call('users/logins', $_params);
81
- }
82
-
83
- /**
84
- * Retrieve the profile for the login owning the provided API Key
85
- * @return associative_array the current user's details, including:
86
- * - id int the login id for this login
87
- * - username string the username used to log in
88
- * - name string a display name for the account - empty first/last names will return the username
89
- * - email string the email tied to the account used for passwords resets and the ilk
90
- * - role string the role assigned to the account
91
- * - avatar string if available, the url for the login's avatar
92
- */
93
- public function profile() {
94
- $_params = array();
95
- return $this->master->call('users/profile', $_params);
96
- }
97
-
98
- }
99
-
100
-
1
+ <?php
2
+
3
+ class Mailchimp_Users {
4
+ public function __construct(wpyksMCAPI $master) {
5
+ $this->master = $master;
6
+ }
7
+
8
+ /**
9
+ * Invite a user to your account
10
+ * @param string $email
11
+ * @param string $role
12
+ * @param string $msg
13
+ * @return associative_array the method completion status
14
+ * - status string The status (success) of the call if it completed. Otherwise an error is thrown.
15
+ */
16
+ public function invite($email, $role='viewer', $msg='') {
17
+ $_params = array("email" => $email, "role" => $role, "msg" => $msg);
18
+ return $this->master->call('users/invite', $_params);
19
+ }
20
+
21
+ /**
22
+ * Resend an invite a user to your account. Note, if the same address has been invited multiple times, this will simpy re-send the most recent invite
23
+ * @param string $email
24
+ * @return associative_array the method completion status
25
+ * - status string The status (success) of the call if it completed. Otherwise an error is thrown.
26
+ */
27
+ public function inviteResend($email) {
28
+ $_params = array("email" => $email);
29
+ return $this->master->call('users/invite-resend', $_params);
30
+ }
31
+
32
+ /**
33
+ * Revoke an invitation sent to a user to your account. Note, if the same address has been invited multiple times, this will simpy revoke the most recent invite
34
+ * @param string $email
35
+ * @return associative_array the method completion status
36
+ * - status string The status (success) of the call if it completed. Otherwise an error is thrown.
37
+ */
38
+ public function inviteRevoke($email) {
39
+ $_params = array("email" => $email);
40
+ return $this->master->call('users/invite-revoke', $_params);
41
+ }
42
+
43
+ /**
44
+ * Retrieve the list of pending users invitations have been sent for.
45
+ * @return array structs for each invitation, including:
46
+ * - email string the email address the invitation was sent to
47
+ * - role string the role that will be assigned if they accept
48
+ * - sent_at string the time the invitation was sent. this will change if it's resent.
49
+ * - expiration string the expiration time for the invitation. this will change if it's resent.
50
+ * - msg string the welcome message included with the invitation
51
+ */
52
+ public function invites() {
53
+ $_params = array();
54
+ return $this->master->call('users/invites', $_params);
55
+ }
56
+
57
+ /**
58
+ * Revoke access for a specified login
59
+ * @param string $username
60
+ * @return associative_array the method completion status
61
+ * - status string The status (success) of the call if it completed. Otherwise an error is thrown.
62
+ */
63
+ public function loginRevoke($username) {
64
+ $_params = array("username" => $username);
65
+ return $this->master->call('users/login-revoke', $_params);
66
+ }
67
+
68
+ /**
69
+ * Retrieve the list of active logins.
70
+ * @return array structs for each user, including:
71
+ * - id int the login id for this login
72
+ * - username string the username used to log in
73
+ * - name string a display name for the account - empty first/last names will return the username
74
+ * - email string the email tied to the account used for passwords resets and the ilk
75
+ * - role string the role assigned to the account
76
+ * - avatar string if available, the url for the login's avatar
77
+ */
78
+ public function logins() {
79
+ $_params = array();
80
+ return $this->master->call('users/logins', $_params);
81
+ }
82
+
83
+ /**
84
+ * Retrieve the profile for the login owning the provided API Key
85
+ * @return associative_array the current user's details, including:
86
+ * - id int the login id for this login
87
+ * - username string the username used to log in
88
+ * - name string a display name for the account - empty first/last names will return the username
89
+ * - email string the email tied to the account used for passwords resets and the ilk
90
+ * - role string the role assigned to the account
91
+ * - avatar string if available, the url for the login's avatar
92
+ */
93
+ public function profile() {
94
+ $_params = array();
95
+ return $this->master->call('users/profile', $_params);
96
+ }
97
+
98
+ }
99
+
100
+
Mailchimp/Vip.php CHANGED
@@ -1,111 +1,111 @@
1
- <?php
2
-
3
- class Mailchimp_Vip {
4
- public function __construct(wpyksMCAPI $master) {
5
- $this->master = $master;
6
- }
7
-
8
- /**
9
- * Retrieve all Activity (opens/clicks) for VIPs over the past 10 days
10
- * @return array structs for each activity recorded.
11
- * - action string The action taken - either "open" or "click"
12
- * - timestamp string The datetime the action occurred in GMT
13
- * - url string IF the action is a click, the url that was clicked
14
- * - unique_id string The campaign_id of the List the Member appears on
15
- * - title string The campaign title
16
- * - list_name string The name of the List the Member appears on
17
- * - list_id string The id of the List the Member appears on
18
- * - email string The email address of the member
19
- * - fname string IF a FNAME merge field exists on the list, that value for the member
20
- * - lname string IF a LNAME merge field exists on the list, that value for the member
21
- * - member_rating int the rating of the subscriber. This will be 1 - 5 as described <a href="http://eepurl.com/f-2P" target="_blank">here</a>
22
- * - member_since string the datetime the member was added and/or confirmed
23
- * - geo associative_array the geographic information if we have it. including:
24
- * - latitude string the latitude
25
- * - longitude string the longitude
26
- * - gmtoff string GMT offset
27
- * - dstoff string GMT offset during daylight savings (if DST not observered, will be same as gmtoff
28
- * - timezone string the timezone we've place them in
29
- * - cc string 2 digit ISO-3166 country code
30
- * - region string generally state, province, or similar
31
- */
32
- public function activity() {
33
- $_params = array();
34
- return $this->master->call('vip/activity', $_params);
35
- }
36
-
37
- /**
38
- * Add VIPs (previously called Golden Monkeys)
39
- * @param string $id
40
- * @param array $emails
41
- * - email string an email address - for new subscribers obviously this should be used
42
- * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
43
- * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
44
- * @return associative_array of data and success/error counts
45
- * - success_count int the number of successful adds
46
- * - error_count int the number of unsuccessful adds
47
- * - errors array array of error structs including:
48
- * - email associative_array whatever was passed in the email parameter
49
- * - email string the email address added
50
- * - euid string the email unique id
51
- * - leid string the list member's truly unique id
52
- * - code string the error code
53
- * - error string the error message
54
- * - data array array of structs for each member added
55
- * - email associative_array whatever was passed in the email parameter
56
- * - email string the email address added
57
- * - euid string the email unique id
58
- * - leid string the list member's truly unique id
59
- */
60
- public function add($id, $emails) {
61
- $_params = array("id" => $id, "emails" => $emails);
62
- return $this->master->call('vip/add', $_params);
63
- }
64
-
65
- /**
66
- * Remove VIPs - this does not affect list membership
67
- * @param string $id
68
- * @param array $emails
69
- * - email string an email address - for new subscribers obviously this should be used
70
- * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
71
- * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
72
- * @return associative_array of data and success/error counts
73
- * - success_count int the number of successful deletions
74
- * - error_count int the number of unsuccessful deletions
75
- * - errors array array of error structs including:
76
- * - email associative_array whatever was passed in the email parameter
77
- * - email string the email address
78
- * - euid string the email unique id
79
- * - leid string the list member's truly unique id
80
- * - code string the error code
81
- * - msg string the error message
82
- * - data array array of structs for each member deleted
83
- * - email associative_array whatever was passed in the email parameter
84
- * - email string the email address
85
- * - euid string the email unique id
86
- * - leid string the list member's truly unique id
87
- */
88
- public function del($id, $emails) {
89
- $_params = array("id" => $id, "emails" => $emails);
90
- return $this->master->call('vip/del', $_params);
91
- }
92
-
93
- /**
94
- * Retrieve all Golden Monkey(s) for an account
95
- * @return array structs for each Golden Monkey, including:
96
- * - list_id string The id of the List the Member appears on
97
- * - list_name string The name of the List the Member appears on
98
- * - email string The email address of the member
99
- * - fname string IF a FNAME merge field exists on the list, that value for the member
100
- * - lname string IF a LNAME merge field exists on the list, that value for the member
101
- * - member_rating int the rating of the subscriber. This will be 1 - 5 as described <a href="http://eepurl.com/f-2P" target="_blank">here</a>
102
- * - member_since string the datetime the member was added and/or confirmed
103
- */
104
- public function members() {
105
- $_params = array();
106
- return $this->master->call('vip/members', $_params);
107
- }
108
-
109
- }
110
-
111
-
1
+ <?php
2
+
3
+ class Mailchimp_Vip {
4
+ public function __construct(wpyksMCAPI $master) {
5
+ $this->master = $master;
6
+ }
7
+
8
+ /**
9
+ * Retrieve all Activity (opens/clicks) for VIPs over the past 10 days
10
+ * @return array structs for each activity recorded.
11
+ * - action string The action taken - either "open" or "click"
12
+ * - timestamp string The datetime the action occurred in GMT
13
+ * - url string IF the action is a click, the url that was clicked
14
+ * - unique_id string The campaign_id of the List the Member appears on
15
+ * - title string The campaign title
16
+ * - list_name string The name of the List the Member appears on
17
+ * - list_id string The id of the List the Member appears on
18
+ * - email string The email address of the member
19
+ * - fname string IF a FNAME merge field exists on the list, that value for the member
20
+ * - lname string IF a LNAME merge field exists on the list, that value for the member
21
+ * - member_rating int the rating of the subscriber. This will be 1 - 5 as described <a href="http://eepurl.com/f-2P" target="_blank">here</a>
22
+ * - member_since string the datetime the member was added and/or confirmed
23
+ * - geo associative_array the geographic information if we have it. including:
24
+ * - latitude string the latitude
25
+ * - longitude string the longitude
26
+ * - gmtoff string GMT offset
27
+ * - dstoff string GMT offset during daylight savings (if DST not observered, will be same as gmtoff
28
+ * - timezone string the timezone we've place them in
29
+ * - cc string 2 digit ISO-3166 country code
30
+ * - region string generally state, province, or similar
31
+ */
32
+ public function activity() {
33
+ $_params = array();
34
+ return $this->master->call('vip/activity', $_params);
35
+ }
36
+
37
+ /**
38
+ * Add VIPs (previously called Golden Monkeys)
39
+ * @param string $id
40
+ * @param array $emails
41
+ * - email string an email address - for new subscribers obviously this should be used
42
+ * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
43
+ * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
44
+ * @return associative_array of data and success/error counts
45
+ * - success_count int the number of successful adds
46
+ * - error_count int the number of unsuccessful adds
47
+ * - errors array array of error structs including:
48
+ * - email associative_array whatever was passed in the email parameter
49
+ * - email string the email address added
50
+ * - euid string the email unique id
51
+ * - leid string the list member's truly unique id
52
+ * - code string the error code
53
+ * - error string the error message
54
+ * - data array array of structs for each member added
55
+ * - email associative_array whatever was passed in the email parameter
56
+ * - email string the email address added
57
+ * - euid string the email unique id
58
+ * - leid string the list member's truly unique id
59
+ */
60
+ public function add($id, $emails) {
61
+ $_params = array("id" => $id, "emails" => $emails);
62
+ return $this->master->call('vip/add', $_params);
63
+ }
64
+
65
+ /**
66
+ * Remove VIPs - this does not affect list membership
67
+ * @param string $id
68
+ * @param array $emails
69
+ * - email string an email address - for new subscribers obviously this should be used
70
+ * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
71
+ * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
72
+ * @return associative_array of data and success/error counts
73
+ * - success_count int the number of successful deletions
74
+ * - error_count int the number of unsuccessful deletions
75
+ * - errors array array of error structs including:
76
+ * - email associative_array whatever was passed in the email parameter
77
+ * - email string the email address
78
+ * - euid string the email unique id
79
+ * - leid string the list member's truly unique id
80
+ * - code string the error code
81
+ * - msg string the error message
82
+ * - data array array of structs for each member deleted
83
+ * - email associative_array whatever was passed in the email parameter
84
+ * - email string the email address
85
+ * - euid string the email unique id
86
+ * - leid string the list member's truly unique id
87
+ */
88
+ public function del($id, $emails) {
89
+ $_params = array("id" => $id, "emails" => $emails);
90
+ return $this->master->call('vip/del', $_params);
91
+ }
92
+
93
+ /**
94
+ * Retrieve all Golden Monkey(s) for an account
95
+ * @return array structs for each Golden Monkey, including:
96
+ * - list_id string The id of the List the Member appears on
97
+ * - list_name string The name of the List the Member appears on
98
+ * - email string The email address of the member
99
+ * - fname string IF a FNAME merge field exists on the list, that value for the member
100
+ * - lname string IF a LNAME merge field exists on the list, that value for the member
101
+ * - member_rating int the rating of the subscriber. This will be 1 - 5 as described <a href="http://eepurl.com/f-2P" target="_blank">here</a>
102
+ * - member_since string the datetime the member was added and/or confirmed
103
+ */
104
+ public function members() {
105
+ $_params = array();
106
+ return $this->master->call('vip/members', $_params);
107
+ }
108
+
109
+ }
110
+
111
+
classes/MCAPI_2.0.class.php CHANGED
@@ -1,355 +1,354 @@
1
- <?php
2
- require_once YKSEME_PATH.'/Mailchimp/Folders.php';
3
- require_once YKSEME_PATH.'/Mailchimp/Templates.php';
4
- require_once YKSEME_PATH.'/Mailchimp/Users.php';
5
- require_once YKSEME_PATH.'/Mailchimp/Helper.php';
6
- require_once YKSEME_PATH.'/Mailchimp/Mobile.php';
7
- require_once YKSEME_PATH.'/Mailchimp/Ecomm.php';
8
- require_once YKSEME_PATH.'/Mailchimp/Neapolitan.php';
9
- require_once YKSEME_PATH.'/Mailchimp/Lists.php';
10
- require_once YKSEME_PATH.'/Mailchimp/Campaigns.php';
11
- require_once YKSEME_PATH.'/Mailchimp/Vip.php';
12
- require_once YKSEME_PATH.'/Mailchimp/Reports.php';
13
- require_once YKSEME_PATH.'/Mailchimp/Gallery.php';
14
- require_once YKSEME_PATH.'/Mailchimp/Exceptions.php';
15
-
16
- if(!class_exists("wpyksMCAPI"))
17
- {
18
- class wpyksMCAPI {
19
-
20
- /**
21
- * Placeholder attribute for Mailchimp_Folders class
22
- *
23
- * @var Mailchimp_Folders
24
- * @access public
25
- */
26
- var $folders;
27
- /**
28
- * Placeholder attribute for Mailchimp_Templates class
29
- *
30
- * @var Mailchimp_Templates
31
- * @access public
32
- */
33
- var $templates;
34
- /**
35
- * Placeholder attribute for Mailchimp_Users class
36
- *
37
- * @var Mailchimp_Users
38
- * @access public
39
- */
40
- var $users;
41
- /**
42
- * Placeholder attribute for Mailchimp_Helper class
43
- *
44
- * @var Mailchimp_Helper
45
- * @access public
46
- */
47
- var $helper;
48
- /**
49
- * Placeholder attribute for Mailchimp_Mobile class
50
- *
51
- * @var Mailchimp_Mobile
52
- * @access public
53
- */
54
- var $mobile;
55
- /**
56
- * Placeholder attribute for Mailchimp_Ecomm class
57
- *
58
- * @var Mailchimp_Ecomm
59
- * @access public
60
- */
61
- var $ecomm;
62
- /**
63
- * Placeholder attribute for Mailchimp_Neapolitan class
64
- *
65
- * @var Mailchimp_Neapolitan
66
- * @access public
67
- */
68
- var $neapolitan;
69
- /**
70
- * Placeholder attribute for Mailchimp_Lists class
71
- *
72
- * @var Mailchimp_Lists
73
- * @access public
74
- */
75
- var $lists;
76
- /**
77
- * Placeholder attribute for Mailchimp_Campaigns class
78
- *
79
- * @var Mailchimp_Campaigns
80
- * @access public
81
- */
82
- var $campaigns;
83
- /**
84
- * Placeholder attribute for Mailchimp_Vip class
85
- *
86
- * @var Mailchimp_Vip
87
- * @access public
88
- */
89
- var $vip;
90
- /**
91
- * Placeholder attribute for Mailchimp_Reports class
92
- *
93
- * @var Mailchimp_Reports
94
- * @access public
95
- */
96
- var $reports;
97
- /**
98
- * Placeholder attribute for Mailchimp_Gallery class
99
- *
100
- * @var Mailchimp_Gallery
101
- * @access public
102
- */
103
- var $gallery;
104
-
105
- /**
106
- * CURLOPT_SSL_VERIFYPEER setting
107
- * @var bool
108
- */
109
- public $ssl_verifypeer = true;
110
- /**
111
- * CURLOPT_SSL_VERIFYHOST setting
112
- * @var bool
113
- */
114
- public $ssl_verifyhost = 2;
115
- /**
116
- * CURLOPT_CAINFO
117
- * @var string
118
- */
119
- public $ssl_cainfo = null;
120
-
121
- /**
122
- * the api key in use
123
- * @var string
124
- */
125
- public $apikey;
126
- public $ch;
127
- public $root = 'https://api.mailchimp.com/2.0';
128
- /**
129
- * whether debug mode is enabled
130
- * @var bool
131
- */
132
- public $debug = false;
133
-
134
- public static $error_map = array(
135
- "ValidationError" => "Mailchimp_ValidationError",
136
- "ServerError_MethodUnknown" => "Mailchimp_ServerError_MethodUnknown",
137
- "ServerError_InvalidParameters" => "Mailchimp_ServerError_InvalidParameters",
138
- "Unknown_Exception" => "Mailchimp_Unknown_Exception",
139
- "Request_TimedOut" => "Mailchimp_Request_TimedOut",
140
- "Zend_Uri_Exception" => "Mailchimp_Zend_Uri_Exception",
141
- "PDOException" => "Mailchimp_PDOException",
142
- "Avesta_Db_Exception" => "Mailchimp_Avesta_Db_Exception",
143
- "XML_RPC2_Exception" => "Mailchimp_XML_RPC2_Exception",
144
- "XML_RPC2_FaultException" => "Mailchimp_XML_RPC2_FaultException",
145
- "Too_Many_Connections" => "Mailchimp_Too_Many_Connections",
146
- "Parse_Exception" => "Mailchimp_Parse_Exception",
147
- "User_Unknown" => "Mailchimp_User_Unknown",
148
- "User_Disabled" => "Mailchimp_User_Disabled",
149
- "User_DoesNotExist" => "Mailchimp_User_DoesNotExist",
150
- "User_NotApproved" => "Mailchimp_User_NotApproved",
151
- "Invalid_ApiKey" => "Mailchimp_Invalid_ApiKey",
152
- "User_UnderMaintenance" => "Mailchimp_User_UnderMaintenance",
153
- "Invalid_AppKey" => "Mailchimp_Invalid_AppKey",
154
- "Invalid_IP" => "Mailchimp_Invalid_IP",
155
- "User_DoesExist" => "Mailchimp_User_DoesExist",
156
- "User_InvalidRole" => "Mailchimp_User_InvalidRole",
157
- "User_InvalidAction" => "Mailchimp_User_InvalidAction",
158
- "User_MissingEmail" => "Mailchimp_User_MissingEmail",
159
- "User_CannotSendCampaign" => "Mailchimp_User_CannotSendCampaign",
160
- "User_MissingModuleOutbox" => "Mailchimp_User_MissingModuleOutbox",
161
- "User_ModuleAlreadyPurchased" => "Mailchimp_User_ModuleAlreadyPurchased",
162
- "User_ModuleNotPurchased" => "Mailchimp_User_ModuleNotPurchased",
163
- "User_NotEnoughCredit" => "Mailchimp_User_NotEnoughCredit",
164
- "MC_InvalidPayment" => "Mailchimp_MC_InvalidPayment",
165
- "List_DoesNotExist" => "Mailchimp_List_DoesNotExist",
166
- "List_InvalidInterestFieldType" => "Mailchimp_List_InvalidInterestFieldType",
167
- "List_InvalidOption" => "Mailchimp_List_InvalidOption",
168
- "List_InvalidUnsubMember" => "Mailchimp_List_InvalidUnsubMember",
169
- "List_InvalidBounceMember" => "Mailchimp_List_InvalidBounceMember",
170
- "List_AlreadySubscribed" => "Mailchimp_List_AlreadySubscribed",
171
- "List_NotSubscribed" => "Mailchimp_List_NotSubscribed",
172
- "List_InvalidImport" => "Mailchimp_List_InvalidImport",
173
- "MC_PastedList_Duplicate" => "Mailchimp_MC_PastedList_Duplicate",
174
- "MC_PastedList_InvalidImport" => "Mailchimp_MC_PastedList_InvalidImport",
175
- "Email_AlreadySubscribed" => "Mailchimp_Email_AlreadySubscribed",
176
- "Email_AlreadyUnsubscribed" => "Mailchimp_Email_AlreadyUnsubscribed",
177
- "Email_NotExists" => "Mailchimp_Email_NotExists",
178
- "Email_NotSubscribed" => "Mailchimp_Email_NotSubscribed",
179
- "List_MergeFieldRequired" => "Mailchimp_List_MergeFieldRequired",
180
- "List_CannotRemoveEmailMerge" => "Mailchimp_List_CannotRemoveEmailMerge",
181
- "List_Merge_InvalidMergeID" => "Mailchimp_List_Merge_InvalidMergeID",
182
- "List_TooManyMergeFields" => "Mailchimp_List_TooManyMergeFields",
183
- "List_InvalidMergeField" => "Mailchimp_List_InvalidMergeField",
184
- "List_InvalidInterestGroup" => "Mailchimp_List_InvalidInterestGroup",
185
- "List_TooManyInterestGroups" => "Mailchimp_List_TooManyInterestGroups",
186
- "Campaign_DoesNotExist" => "Mailchimp_Campaign_DoesNotExist",
187
- "Campaign_StatsNotAvailable" => "Mailchimp_Campaign_StatsNotAvailable",
188
- "Campaign_InvalidAbsplit" => "Mailchimp_Campaign_InvalidAbsplit",
189
- "Campaign_InvalidContent" => "Mailchimp_Campaign_InvalidContent",
190
- "Campaign_InvalidOption" => "Mailchimp_Campaign_InvalidOption",
191
- "Campaign_InvalidStatus" => "Mailchimp_Campaign_InvalidStatus",
192
- "Campaign_NotSaved" => "Mailchimp_Campaign_NotSaved",
193
- "Campaign_InvalidSegment" => "Mailchimp_Campaign_InvalidSegment",
194
- "Campaign_InvalidRss" => "Mailchimp_Campaign_InvalidRss",
195
- "Campaign_InvalidAuto" => "Mailchimp_Campaign_InvalidAuto",
196
- "MC_ContentImport_InvalidArchive" => "Mailchimp_MC_ContentImport_InvalidArchive",
197
- "Campaign_BounceMissing" => "Mailchimp_Campaign_BounceMissing",
198
- "Campaign_InvalidTemplate" => "Mailchimp_Campaign_InvalidTemplate",
199
- "Invalid_EcommOrder" => "Mailchimp_Invalid_EcommOrder",
200
- "Absplit_UnknownError" => "Mailchimp_Absplit_UnknownError",
201
- "Absplit_UnknownSplitTest" => "Mailchimp_Absplit_UnknownSplitTest",
202
- "Absplit_UnknownTestType" => "Mailchimp_Absplit_UnknownTestType",
203
- "Absplit_UnknownWaitUnit" => "Mailchimp_Absplit_UnknownWaitUnit",
204
- "Absplit_UnknownWinnerType" => "Mailchimp_Absplit_UnknownWinnerType",
205
- "Absplit_WinnerNotSelected" => "Mailchimp_Absplit_WinnerNotSelected",
206
- "Invalid_Analytics" => "Mailchimp_Invalid_Analytics",
207
- "Invalid_DateTime" => "Mailchimp_Invalid_DateTime",
208
- "Invalid_Email" => "Mailchimp_Invalid_Email",
209
- "Invalid_SendType" => "Mailchimp_Invalid_SendType",
210
- "Invalid_Template" => "Mailchimp_Invalid_Template",
211
- "Invalid_TrackingOptions" => "Mailchimp_Invalid_TrackingOptions",
212
- "Invalid_Options" => "Mailchimp_Invalid_Options",
213
- "Invalid_Folder" => "Mailchimp_Invalid_Folder",
214
- "Invalid_URL" => "Mailchimp_Invalid_URL",
215
- "Module_Unknown" => "Mailchimp_Module_Unknown",
216
- "MonthlyPlan_Unknown" => "Mailchimp_MonthlyPlan_Unknown",
217
- "Order_TypeUnknown" => "Mailchimp_Order_TypeUnknown",
218
- "Invalid_PagingLimit" => "Mailchimp_Invalid_PagingLimit",
219
- "Invalid_PagingStart" => "Mailchimp_Invalid_PagingStart",
220
- "Max_Size_Reached" => "Mailchimp_Max_Size_Reached",
221
- "MC_SearchException" => "Mailchimp_MC_SearchException"
222
- );
223
-
224
- public function __construct($apikey=null, $opts=array()) {
225
- if(!$apikey) $apikey = getenv('MAILCHIMP_APIKEY');
226
- if(!$apikey) $apikey = $this->readConfigs();
227
- if(!$apikey) throw new Mailchimp_Error('You must provide a MailChimp API key');
228
- $this->apikey = $apikey;
229
- $dc = "us1";
230
- if (strstr($this->apikey,"-")){
231
- list($key, $dc) = explode("-",$this->apikey,2);
232
- if (!$dc) $dc = "us1";
233
- }
234
- $this->root = str_replace('https://api', 'https://'.$dc.'.api', $this->root);
235
- $this->root = rtrim($this->root, '/') . '/';
236
-
237
- if (!isset($opts['timeout']) || !is_int($opts['timeout'])){
238
- $opts['timeout']=600;
239
- }
240
- if (isset($opts['debug'])){
241
- $this->debug = true;
242
- }
243
- if (isset($opts['ssl_verifypeer'])){
244
- $this->ssl_verifypeer = $opts['ssl_verifypeer'];
245
- }
246
- if (isset($opts['ssl_verifyhost'])){
247
- $this->ssl_verifyhost = $opts['ssl_verifyhost'];
248
- }
249
- if (isset($opts['ssl_cainfo'])){
250
- $this->ssl_cainfo = $opts['ssl_cainfo'];
251
- }
252
-
253
-
254
- $this->ch = curl_init();
255
- curl_setopt($this->ch, CURLOPT_USERAGENT, 'MailChimp-PHP/2.0.4');
256
- curl_setopt($this->ch, CURLOPT_POST, true);
257
- // if open base directiory is set, toggle to false, else keep true
258
- if ( ini_get('open_basedir') ) {
259
- curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, false);
260
- } else {
261
- curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, true);
262
- }
263
- curl_setopt($this->ch, CURLOPT_HEADER, false);
264
- curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, true);
265
- curl_setopt($this->ch, CURLOPT_CONNECTTIMEOUT, 45);
266
- curl_setopt($this->ch, CURLOPT_TIMEOUT, $opts['timeout']);
267
-
268
-
269
- $this->folders = new Mailchimp_Folders($this);
270
- $this->templates = new Mailchimp_Templates($this);
271
- $this->users = new Mailchimp_Users($this);
272
- $this->helper = new Mailchimp_Helper($this);
273
- $this->mobile = new Mailchimp_Mobile($this);
274
- $this->ecomm = new Mailchimp_Ecomm($this);
275
- $this->neapolitan = new Mailchimp_Neapolitan($this);
276
- $this->lists = new Mailchimp_Lists($this);
277
- $this->campaigns = new Mailchimp_Campaigns($this);
278
- $this->vip = new Mailchimp_Vip($this);
279
- $this->reports = new Mailchimp_Reports($this);
280
- $this->gallery = new Mailchimp_Gallery($this);
281
-
282
- }
283
-
284
- public function __destruct() {
285
- curl_close($this->ch);
286
- }
287
-
288
- public function call($url, $params) {
289
- $params['apikey'] = $this->apikey;
290
- $params = json_encode($params);
291
- $ch = $this->ch;
292
-
293
- curl_setopt($ch, CURLOPT_URL, $this->root . $url . '.json');
294
- curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
295
- curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
296
- curl_setopt($ch, CURLOPT_VERBOSE, $this->debug);
297
- // SSL Options
298
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $this->ssl_verifypeer);
299
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, $this->ssl_verifyhost);
300
- if ($this->ssl_cainfo) curl_setopt($ch, CURLOPT_CAINFO, $this->ssl_cainfo);
301
-
302
- $start = microtime(true);
303
- $this->log('Call to ' . $this->root . $url . '.json: ' . $params);
304
- if($this->debug) {
305
- $curl_buffer = fopen('php://memory', 'w+');
306
- curl_setopt($ch, CURLOPT_STDERR, $curl_buffer);
307
- }
308
-
309
- $response_body = curl_exec($ch);
310
- $info = curl_getinfo($ch);
311
- $time = microtime(true) - $start;
312
- if($this->debug) {
313
- rewind($curl_buffer);
314
- $this->log(stream_get_contents($curl_buffer));
315
- fclose($curl_buffer);
316
- }
317
- $this->log('Completed in ' . number_format($time * 1000, 2) . 'ms');
318
- $this->log('Got response: ' . $response_body);
319
-
320
- if(curl_error($ch)) {
321
- throw new Mailchimp_HttpError("API call to $url failed: " . curl_error($ch));
322
- }
323
- $result = json_decode($response_body, true);
324
-
325
- if(floor($info['http_code'] / 100) >= 4) {
326
- throw $this->castError($result);
327
- }
328
-
329
- return $result;
330
- }
331
-
332
- public function readConfigs() {
333
- $paths = array('~/.mailchimp.key', '/etc/mailchimp.key');
334
- foreach($paths as $path) {
335
- if(file_exists($path)) {
336
- $apikey = trim(file_get_contents($path));
337
- if($apikey) return $apikey;
338
- }
339
- }
340
- return false;
341
- }
342
-
343
- public function castError($result) {
344
- if($result['status'] !== 'error' || !$result['name']) throw new Mailchimp_Error('We received an unexpected error: ' . json_encode($result));
345
-
346
- $class = (isset(self::$error_map[$result['name']])) ? self::$error_map[$result['name']] : 'Mailchimp_Error';
347
- return new $class($result['error'], $result['code']);
348
- }
349
-
350
- public function log($msg) {
351
- if($this->debug) error_log($msg);
352
- }
353
- }
354
- }
355
-
1
+ <?php
2
+ require_once YKSEME_PATH.'/Mailchimp/Folders.php';
3
+ require_once YKSEME_PATH.'/Mailchimp/Templates.php';
4
+ require_once YKSEME_PATH.'/Mailchimp/Users.php';
5
+ require_once YKSEME_PATH.'/Mailchimp/Helper.php';
6
+ require_once YKSEME_PATH.'/Mailchimp/Mobile.php';
7
+ require_once YKSEME_PATH.'/Mailchimp/Ecomm.php';
8
+ require_once YKSEME_PATH.'/Mailchimp/Neapolitan.php';
9
+ require_once YKSEME_PATH.'/Mailchimp/Lists.php';
10
+ require_once YKSEME_PATH.'/Mailchimp/Campaigns.php';
11
+ require_once YKSEME_PATH.'/Mailchimp/Vip.php';
12
+ require_once YKSEME_PATH.'/Mailchimp/Reports.php';
13
+ require_once YKSEME_PATH.'/Mailchimp/Gallery.php';
14
+ require_once YKSEME_PATH.'/Mailchimp/Exceptions.php';
15
+
16
+ if(!class_exists("wpyksMCAPI"))
17
+ {
18
+ class wpyksMCAPI {
19
+ /**
20
+ * Placeholder attribute for Mailchimp_Folders class
21
+ *
22
+ * @var Mailchimp_Folders
23
+ * @access public
24
+ */
25
+ var $folders;
26
+ /**
27
+ * Placeholder attribute for Mailchimp_Templates class
28
+ *
29
+ * @var Mailchimp_Templates
30
+ * @access public
31
+ */
32
+ var $templates;
33
+ /**
34
+ * Placeholder attribute for Mailchimp_Users class
35
+ *
36
+ * @var Mailchimp_Users
37
+ * @access public
38
+ */
39
+ var $users;
40
+ /**
41
+ * Placeholder attribute for Mailchimp_Helper class
42
+ *
43
+ * @var Mailchimp_Helper
44
+ * @access public
45
+ */
46
+ var $helper;
47
+ /**
48
+ * Placeholder attribute for Mailchimp_Mobile class
49
+ *
50
+ * @var Mailchimp_Mobile
51
+ * @access public
52
+ */
53
+ var $mobile;
54
+ /**
55
+ * Placeholder attribute for Mailchimp_Ecomm class
56
+ *
57
+ * @var Mailchimp_Ecomm
58
+ * @access public
59
+ */
60
+ var $ecomm;
61
+ /**
62
+ * Placeholder attribute for Mailchimp_Neapolitan class
63
+ *
64
+ * @var Mailchimp_Neapolitan
65
+ * @access public
66
+ */
67
+ var $neapolitan;
68
+ /**
69
+ * Placeholder attribute for Mailchimp_Lists class
70
+ *
71
+ * @var Mailchimp_Lists
72
+ * @access public
73
+ */
74
+ var $lists;
75
+ /**
76
+ * Placeholder attribute for Mailchimp_Campaigns class
77
+ *
78
+ * @var Mailchimp_Campaigns
79
+ * @access public
80
+ */
81
+ var $campaigns;
82
+ /**
83
+ * Placeholder attribute for Mailchimp_Vip class
84
+ *
85
+ * @var Mailchimp_Vip
86
+ * @access public
87
+ */
88
+ var $vip;
89
+ /**
90
+ * Placeholder attribute for Mailchimp_Reports class
91
+ *
92
+ * @var Mailchimp_Reports
93
+ * @access public
94
+ */
95
+ var $reports;
96
+ /**
97
+ * Placeholder attribute for Mailchimp_Gallery class
98
+ *
99
+ * @var Mailchimp_Gallery
100
+ * @access public
101
+ */
102
+ var $gallery;
103
+
104
+ /**
105
+ * CURLOPT_SSL_VERIFYPEER setting
106
+ * @var bool
107
+ */
108
+ public $ssl_verifypeer = true;
109
+ /**
110
+ * CURLOPT_SSL_VERIFYHOST setting
111
+ * @var bool
112
+ */
113
+ public $ssl_verifyhost = 2;
114
+ /**
115
+ * CURLOPT_CAINFO
116
+ * @var string
117
+ */
118
+ public $ssl_cainfo = null;
119
+
120
+ /**
121
+ * the api key in use
122
+ * @var string
123
+ */
124
+ public $apikey;
125
+ public $ch;
126
+ public $root = 'https://api.mailchimp.com/2.0';
127
+ /**
128
+ * whether debug mode is enabled
129
+ * @var bool
130
+ */
131
+ public $debug = false;
132
+
133
+ public static $error_map = array(
134
+ "ValidationError" => "Mailchimp_ValidationError",
135
+ "ServerError_MethodUnknown" => "Mailchimp_ServerError_MethodUnknown",
136
+ "ServerError_InvalidParameters" => "Mailchimp_ServerError_InvalidParameters",
137
+ "Unknown_Exception" => "Mailchimp_Unknown_Exception",
138
+ "Request_TimedOut" => "Mailchimp_Request_TimedOut",
139
+ "Zend_Uri_Exception" => "Mailchimp_Zend_Uri_Exception",
140
+ "PDOException" => "Mailchimp_PDOException",
141
+ "Avesta_Db_Exception" => "Mailchimp_Avesta_Db_Exception",
142
+ "XML_RPC2_Exception" => "Mailchimp_XML_RPC2_Exception",
143
+ "XML_RPC2_FaultException" => "Mailchimp_XML_RPC2_FaultException",
144
+ "Too_Many_Connections" => "Mailchimp_Too_Many_Connections",
145
+ "Parse_Exception" => "Mailchimp_Parse_Exception",
146
+ "User_Unknown" => "Mailchimp_User_Unknown",
147
+ "User_Disabled" => "Mailchimp_User_Disabled",
148
+ "User_DoesNotExist" => "Mailchimp_User_DoesNotExist",
149
+ "User_NotApproved" => "Mailchimp_User_NotApproved",
150
+ "Invalid_ApiKey" => "Mailchimp_Invalid_ApiKey",
151
+ "User_UnderMaintenance" => "Mailchimp_User_UnderMaintenance",
152
+ "Invalid_AppKey" => "Mailchimp_Invalid_AppKey",
153
+ "Invalid_IP" => "Mailchimp_Invalid_IP",
154
+ "User_DoesExist" => "Mailchimp_User_DoesExist",
155
+ "User_InvalidRole" => "Mailchimp_User_InvalidRole",
156
+ "User_InvalidAction" => "Mailchimp_User_InvalidAction",
157
+ "User_MissingEmail" => "Mailchimp_User_MissingEmail",
158
+ "User_CannotSendCampaign" => "Mailchimp_User_CannotSendCampaign",
159
+ "User_MissingModuleOutbox" => "Mailchimp_User_MissingModuleOutbox",
160
+ "User_ModuleAlreadyPurchased" => "Mailchimp_User_ModuleAlreadyPurchased",
161
+ "User_ModuleNotPurchased" => "Mailchimp_User_ModuleNotPurchased",
162
+ "User_NotEnoughCredit" => "Mailchimp_User_NotEnoughCredit",
163
+ "MC_InvalidPayment" => "Mailchimp_MC_InvalidPayment",
164
+ "List_DoesNotExist" => "Mailchimp_List_DoesNotExist",
165
+ "List_InvalidInterestFieldType" => "Mailchimp_List_InvalidInterestFieldType",
166
+ "List_InvalidOption" => "Mailchimp_List_InvalidOption",
167
+ "List_InvalidUnsubMember" => "Mailchimp_List_InvalidUnsubMember",
168
+ "List_InvalidBounceMember" => "Mailchimp_List_InvalidBounceMember",
169
+ "List_AlreadySubscribed" => "Mailchimp_List_AlreadySubscribed",
170
+ "List_NotSubscribed" => "Mailchimp_List_NotSubscribed",
171
+ "List_InvalidImport" => "Mailchimp_List_InvalidImport",
172
+ "MC_PastedList_Duplicate" => "Mailchimp_MC_PastedList_Duplicate",
173
+ "MC_PastedList_InvalidImport" => "Mailchimp_MC_PastedList_InvalidImport",
174
+ "Email_AlreadySubscribed" => "Mailchimp_Email_AlreadySubscribed",
175
+ "Email_AlreadyUnsubscribed" => "Mailchimp_Email_AlreadyUnsubscribed",
176
+ "Email_NotExists" => "Mailchimp_Email_NotExists",
177
+ "Email_NotSubscribed" => "Mailchimp_Email_NotSubscribed",
178
+ "List_MergeFieldRequired" => "Mailchimp_List_MergeFieldRequired",
179
+ "List_CannotRemoveEmailMerge" => "Mailchimp_List_CannotRemoveEmailMerge",
180
+ "List_Merge_InvalidMergeID" => "Mailchimp_List_Merge_InvalidMergeID",
181
+ "List_TooManyMergeFields" => "Mailchimp_List_TooManyMergeFields",
182
+ "List_InvalidMergeField" => "Mailchimp_List_InvalidMergeField",
183
+ "List_InvalidInterestGroup" => "Mailchimp_List_InvalidInterestGroup",
184
+ "List_TooManyInterestGroups" => "Mailchimp_List_TooManyInterestGroups",
185
+ "Campaign_DoesNotExist" => "Mailchimp_Campaign_DoesNotExist",
186
+ "Campaign_StatsNotAvailable" => "Mailchimp_Campaign_StatsNotAvailable",
187
+ "Campaign_InvalidAbsplit" => "Mailchimp_Campaign_InvalidAbsplit",
188
+ "Campaign_InvalidContent" => "Mailchimp_Campaign_InvalidContent",
189
+ "Campaign_InvalidOption" => "Mailchimp_Campaign_InvalidOption",
190
+ "Campaign_InvalidStatus" => "Mailchimp_Campaign_InvalidStatus",
191
+ "Campaign_NotSaved" => "Mailchimp_Campaign_NotSaved",
192
+ "Campaign_InvalidSegment" => "Mailchimp_Campaign_InvalidSegment",
193
+ "Campaign_InvalidRss" => "Mailchimp_Campaign_InvalidRss",
194
+ "Campaign_InvalidAuto" => "Mailchimp_Campaign_InvalidAuto",
195
+ "MC_ContentImport_InvalidArchive" => "Mailchimp_MC_ContentImport_InvalidArchive",
196
+ "Campaign_BounceMissing" => "Mailchimp_Campaign_BounceMissing",
197
+ "Campaign_InvalidTemplate" => "Mailchimp_Campaign_InvalidTemplate",
198
+ "Invalid_EcommOrder" => "Mailchimp_Invalid_EcommOrder",
199
+ "Absplit_UnknownError" => "Mailchimp_Absplit_UnknownError",
200
+ "Absplit_UnknownSplitTest" => "Mailchimp_Absplit_UnknownSplitTest",
201
+ "Absplit_UnknownTestType" => "Mailchimp_Absplit_UnknownTestType",
202
+ "Absplit_UnknownWaitUnit" => "Mailchimp_Absplit_UnknownWaitUnit",
203
+ "Absplit_UnknownWinnerType" => "Mailchimp_Absplit_UnknownWinnerType",
204
+ "Absplit_WinnerNotSelected" => "Mailchimp_Absplit_WinnerNotSelected",
205
+ "Invalid_Analytics" => "Mailchimp_Invalid_Analytics",
206
+ "Invalid_DateTime" => "Mailchimp_Invalid_DateTime",
207
+ "Invalid_Email" => "Mailchimp_Invalid_Email",
208
+ "Invalid_SendType" => "Mailchimp_Invalid_SendType",
209
+ "Invalid_Template" => "Mailchimp_Invalid_Template",
210
+ "Invalid_TrackingOptions" => "Mailchimp_Invalid_TrackingOptions",
211
+ "Invalid_Options" => "Mailchimp_Invalid_Options",
212
+ "Invalid_Folder" => "Mailchimp_Invalid_Folder",
213
+ "Invalid_URL" => "Mailchimp_Invalid_URL",
214
+ "Module_Unknown" => "Mailchimp_Module_Unknown",
215
+ "MonthlyPlan_Unknown" => "Mailchimp_MonthlyPlan_Unknown",
216
+ "Order_TypeUnknown" => "Mailchimp_Order_TypeUnknown",
217
+ "Invalid_PagingLimit" => "Mailchimp_Invalid_PagingLimit",
218
+ "Invalid_PagingStart" => "Mailchimp_Invalid_PagingStart",
219
+ "Max_Size_Reached" => "Mailchimp_Max_Size_Reached",
220
+ "MC_SearchException" => "Mailchimp_MC_SearchException"
221
+ );
222
+
223
+ public function __construct($apikey=null, $opts=array()) {
224
+ if(!$apikey) $apikey = getenv('MAILCHIMP_APIKEY');
225
+ if(!$apikey) $apikey = $this->readConfigs();
226
+ if(!$apikey) throw new Mailchimp_Error('You must provide a MailChimp API key');
227
+ $this->apikey = $apikey;
228
+ $dc = "us1";
229
+ if (strstr($this->apikey,"-")){
230
+ list($key, $dc) = explode("-",$this->apikey,2);
231
+ if (!$dc) $dc = "us1";
232
+ }
233
+ $this->root = str_replace('https://api', 'https://'.$dc.'.api', $this->root);
234
+ $this->root = rtrim($this->root, '/') . '/';
235
+
236
+ if (!isset($opts['timeout']) || !is_int($opts['timeout'])){
237
+ $opts['timeout']=600;
238
+ }
239
+ if (isset($opts['debug'])){
240
+ $this->debug = true;
241
+ }
242
+ if (isset($opts['ssl_verifypeer'])){
243
+ $this->ssl_verifypeer = $opts['ssl_verifypeer'];
244
+ }
245
+ if (isset($opts['ssl_verifyhost'])){
246
+ $this->ssl_verifyhost = $opts['ssl_verifyhost'];
247
+ }
248
+ if (isset($opts['ssl_cainfo'])){
249
+ $this->ssl_cainfo = $opts['ssl_cainfo'];
250
+ }
251
+
252
+
253
+ $this->ch = curl_init();
254
+ curl_setopt($this->ch, CURLOPT_USERAGENT, 'MailChimp-PHP/2.0.4');
255
+ curl_setopt($this->ch, CURLOPT_POST, true);
256
+ // if open base directiory is set, toggle to false, else keep true
257
+ if ( ini_get('open_basedir') ) {
258
+ curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, false);
259
+ } else {
260
+ curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, true);
261
+ }
262
+ curl_setopt($this->ch, CURLOPT_HEADER, false);
263
+ curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, true);
264
+ curl_setopt($this->ch, CURLOPT_CONNECTTIMEOUT, 45);
265
+ curl_setopt($this->ch, CURLOPT_TIMEOUT, $opts['timeout']);
266
+
267
+
268
+ $this->folders = new Mailchimp_Folders($this);
269
+ $this->templates = new Mailchimp_Templates($this);
270
+ $this->users = new Mailchimp_Users($this);
271
+ $this->helper = new Mailchimp_Helper($this);
272
+ $this->mobile = new Mailchimp_Mobile($this);
273
+ $this->ecomm = new Mailchimp_Ecomm($this);
274
+ $this->neapolitan = new Mailchimp_Neapolitan($this);
275
+ $this->lists = new Mailchimp_Lists($this);
276
+ $this->campaigns = new Mailchimp_Campaigns($this);
277
+ $this->vip = new Mailchimp_Vip($this);
278
+ $this->reports = new Mailchimp_Reports($this);
279
+ $this->gallery = new Mailchimp_Gallery($this);
280
+
281
+ }
282
+
283
+ public function __destruct() {
284
+ curl_close($this->ch);
285
+ }
286
+
287
+ public function call($url, $params) {
288
+ $params['apikey'] = $this->apikey;
289
+ $params = json_encode($params);
290
+ $ch = $this->ch;
291
+
292
+ curl_setopt($ch, CURLOPT_URL, $this->root . $url . '.json');
293
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
294
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
295
+ curl_setopt($ch, CURLOPT_VERBOSE, $this->debug);
296
+ // SSL Options
297
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $this->ssl_verifypeer);
298
+ curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, $this->ssl_verifyhost);
299
+ if ($this->ssl_cainfo) curl_setopt($ch, CURLOPT_CAINFO, $this->ssl_cainfo);
300
+
301
+ $start = microtime(true);
302
+ $this->log('Call to ' . $this->root . $url . '.json: ' . $params);
303
+ if($this->debug) {
304
+ $curl_buffer = fopen('php://memory', 'w+');
305
+ curl_setopt($ch, CURLOPT_STDERR, $curl_buffer);
306
+ }
307
+
308
+ $response_body = curl_exec($ch);
309
+ $info = curl_getinfo($ch);
310
+ $time = microtime(true) - $start;
311
+ if($this->debug) {
312
+ rewind($curl_buffer);
313
+ $this->log(stream_get_contents($curl_buffer));
314
+ fclose($curl_buffer);
315
+ }
316
+ $this->log('Completed in ' . number_format($time * 1000, 2) . 'ms');
317
+ $this->log('Got response: ' . $response_body);
318
+
319
+ if(curl_error($ch)) {
320
+ throw new Mailchimp_HttpError("API call to $url failed: " . curl_error($ch));
321
+ }
322
+ $result = json_decode($response_body, true);
323
+
324
+ if(floor($info['http_code'] / 100) >= 4) {
325
+ throw $this->castError($result);
326
+ }
327
+
328
+ return $result;
329
+ }
330
+
331
+ public function readConfigs() {
332
+ $paths = array('~/.mailchimp.key', '/etc/mailchimp.key');
333
+ foreach($paths as $path) {
334
+ if(file_exists($path)) {
335
+ $apikey = trim(file_get_contents($path));
336
+ if($apikey) return $apikey;
337
+ }
338
+ }
339
+ return false;
340
+ }
341
+
342
+ public function castError($result) {
343
+ if($result['status'] !== 'error' || !$result['name']) throw new Mailchimp_Error('We received an unexpected error: ' . json_encode($result));
344
+
345
+ $class = (isset(self::$error_map[$result['name']])) ? self::$error_map[$result['name']] : 'Mailchimp_Error';
346
+ return new $class($result['error'], $result['code']);
347
+ }
348
+
349
+ public function log($msg) {
350
+ if($this->debug) error_log($msg);
351
+ }
352
+ }
353
+ }
354
+
 
classes/MCAPI_2.0.class.verify_false.php ADDED
@@ -0,0 +1,354 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ require_once YKSEME_PATH.'/Mailchimp/Folders.php';
3
+ require_once YKSEME_PATH.'/Mailchimp/Templates.php';
4
+ require_once YKSEME_PATH.'/Mailchimp/Users.php';
5
+ require_once YKSEME_PATH.'/Mailchimp/Helper.php';
6
+ require_once YKSEME_PATH.'/Mailchimp/Mobile.php';
7
+ require_once YKSEME_PATH.'/Mailchimp/Ecomm.php';
8
+ require_once YKSEME_PATH.'/Mailchimp/Neapolitan.php';
9
+ require_once YKSEME_PATH.'/Mailchimp/Lists.php';
10
+ require_once YKSEME_PATH.'/Mailchimp/Campaigns.php';
11
+ require_once YKSEME_PATH.'/Mailchimp/Vip.php';
12
+ require_once YKSEME_PATH.'/Mailchimp/Reports.php';
13
+ require_once YKSEME_PATH.'/Mailchimp/Gallery.php';
14
+ require_once YKSEME_PATH.'/Mailchimp/Exceptions.php';
15
+
16
+ if(!class_exists("wpyksMCAPI"))
17
+ {
18
+ class wpyksMCAPI {
19
+ /**
20
+ * Placeholder attribute for Mailchimp_Folders class
21
+ *
22
+ * @var Mailchimp_Folders
23
+ * @access public
24
+ */
25
+ var $folders;
26
+ /**
27
+ * Placeholder attribute for Mailchimp_Templates class
28
+ *
29
+ * @var Mailchimp_Templates
30
+ * @access public
31
+ */
32
+ var $templates;
33
+ /**
34
+ * Placeholder attribute for Mailchimp_Users class
35
+ *
36
+ * @var Mailchimp_Users
37
+ * @access public
38
+ */
39
+ var $users;
40
+ /**
41
+ * Placeholder attribute for Mailchimp_Helper class
42
+ *
43
+ * @var Mailchimp_Helper
44
+ * @access public
45
+ */
46
+ var $helper;
47
+ /**
48
+ * Placeholder attribute for Mailchimp_Mobile class
49
+ *
50
+ * @var Mailchimp_Mobile
51
+ * @access public
52
+ */
53
+ var $mobile;
54
+ /**
55
+ * Placeholder attribute for Mailchimp_Ecomm class
56
+ *
57
+ * @var Mailchimp_Ecomm
58
+ * @access public
59
+ */
60
+ var $ecomm;
61
+ /**
62
+ * Placeholder attribute for Mailchimp_Neapolitan class
63
+ *
64
+ * @var Mailchimp_Neapolitan
65
+ * @access public
66
+ */
67
+ var $neapolitan;
68
+ /**
69
+ * Placeholder attribute for Mailchimp_Lists class
70
+ *
71
+ * @var Mailchimp_Lists
72
+ * @access public
73
+ */
74
+ var $lists;
75
+ /**
76
+ * Placeholder attribute for Mailchimp_Campaigns class
77
+ *
78
+ * @var Mailchimp_Campaigns
79
+ * @access public
80
+ */
81
+ var $campaigns;
82
+ /**
83
+ * Placeholder attribute for Mailchimp_Vip class
84
+ *
85
+ * @var Mailchimp_Vip
86
+ * @access public
87
+ */
88
+ var $vip;
89
+ /**
90
+ * Placeholder attribute for Mailchimp_Reports class
91
+ *
92
+ * @var Mailchimp_Reports
93
+ * @access public
94
+ */
95
+ var $reports;
96
+ /**
97
+ * Placeholder attribute for Mailchimp_Gallery class
98
+ *
99
+ * @var Mailchimp_Gallery
100
+ * @access public
101
+ */
102
+ var $gallery;
103
+
104
+ /**
105
+ * CURLOPT_SSL_VERIFYPEER setting
106
+ * @var bool
107
+ */
108
+ public $ssl_verifypeer = false;
109
+ /**
110
+ * CURLOPT_SSL_VERIFYHOST setting
111
+ * @var bool
112
+ */
113
+ public $ssl_verifyhost = 2;
114
+ /**
115
+ * CURLOPT_CAINFO
116
+ * @var string
117
+ */
118
+ public $ssl_cainfo = null;
119
+
120
+ /**
121
+ * the api key in use
122
+ * @var string
123
+ */
124
+ public $apikey;
125
+ public $ch;
126
+ public $root = 'https://api.mailchimp.com/2.0';
127
+ /**
128
+ * whether debug mode is enabled
129
+ * @var bool
130
+ */
131
+ public $debug = false;
132
+
133
+ public static $error_map = array(
134
+ "ValidationError" => "Mailchimp_ValidationError",
135
+ "ServerError_MethodUnknown" => "Mailchimp_ServerError_MethodUnknown",
136
+ "ServerError_InvalidParameters" => "Mailchimp_ServerError_InvalidParameters",
137
+ "Unknown_Exception" => "Mailchimp_Unknown_Exception",
138
+ "Request_TimedOut" => "Mailchimp_Request_TimedOut",
139
+ "Zend_Uri_Exception" => "Mailchimp_Zend_Uri_Exception",
140
+ "PDOException" => "Mailchimp_PDOException",
141
+ "Avesta_Db_Exception" => "Mailchimp_Avesta_Db_Exception",
142
+ "XML_RPC2_Exception" => "Mailchimp_XML_RPC2_Exception",
143
+ "XML_RPC2_FaultException" => "Mailchimp_XML_RPC2_FaultException",
144
+ "Too_Many_Connections" => "Mailchimp_Too_Many_Connections",
145
+ "Parse_Exception" => "Mailchimp_Parse_Exception",
146
+ "User_Unknown" => "Mailchimp_User_Unknown",
147
+ "User_Disabled" => "Mailchimp_User_Disabled",
148
+ "User_DoesNotExist" => "Mailchimp_User_DoesNotExist",
149
+ "User_NotApproved" => "Mailchimp_User_NotApproved",
150
+ "Invalid_ApiKey" => "Mailchimp_Invalid_ApiKey",
151
+ "User_UnderMaintenance" => "Mailchimp_User_UnderMaintenance",
152
+ "Invalid_AppKey" => "Mailchimp_Invalid_AppKey",
153
+ "Invalid_IP" => "Mailchimp_Invalid_IP",
154
+ "User_DoesExist" => "Mailchimp_User_DoesExist",
155
+ "User_InvalidRole" => "Mailchimp_User_InvalidRole",
156
+ "User_InvalidAction" => "Mailchimp_User_InvalidAction",
157
+ "User_MissingEmail" => "Mailchimp_User_MissingEmail",
158
+ "User_CannotSendCampaign" => "Mailchimp_User_CannotSendCampaign",
159
+ "User_MissingModuleOutbox" => "Mailchimp_User_MissingModuleOutbox",
160
+ "User_ModuleAlreadyPurchased" => "Mailchimp_User_ModuleAlreadyPurchased",
161
+ "User_ModuleNotPurchased" => "Mailchimp_User_ModuleNotPurchased",
162
+ "User_NotEnoughCredit" => "Mailchimp_User_NotEnoughCredit",
163
+ "MC_InvalidPayment" => "Mailchimp_MC_InvalidPayment",
164
+ "List_DoesNotExist" => "Mailchimp_List_DoesNotExist",
165
+ "List_InvalidInterestFieldType" => "Mailchimp_List_InvalidInterestFieldType",
166
+ "List_InvalidOption" => "Mailchimp_List_InvalidOption",
167
+ "List_InvalidUnsubMember" => "Mailchimp_List_InvalidUnsubMember",
168
+ "List_InvalidBounceMember" => "Mailchimp_List_InvalidBounceMember",
169
+ "List_AlreadySubscribed" => "Mailchimp_List_AlreadySubscribed",
170
+ "List_NotSubscribed" => "Mailchimp_List_NotSubscribed",
171
+ "List_InvalidImport" => "Mailchimp_List_InvalidImport",
172
+ "MC_PastedList_Duplicate" => "Mailchimp_MC_PastedList_Duplicate",
173
+ "MC_PastedList_InvalidImport" => "Mailchimp_MC_PastedList_InvalidImport",
174
+ "Email_AlreadySubscribed" => "Mailchimp_Email_AlreadySubscribed",
175
+ "Email_AlreadyUnsubscribed" => "Mailchimp_Email_AlreadyUnsubscribed",
176
+ "Email_NotExists" => "Mailchimp_Email_NotExists",
177
+ "Email_NotSubscribed" => "Mailchimp_Email_NotSubscribed",
178
+ "List_MergeFieldRequired" => "Mailchimp_List_MergeFieldRequired",
179
+ "List_CannotRemoveEmailMerge" => "Mailchimp_List_CannotRemoveEmailMerge",
180
+ "List_Merge_InvalidMergeID" => "Mailchimp_List_Merge_InvalidMergeID",
181
+ "List_TooManyMergeFields" => "Mailchimp_List_TooManyMergeFields",
182
+ "List_InvalidMergeField" => "Mailchimp_List_InvalidMergeField",
183
+ "List_InvalidInterestGroup" => "Mailchimp_List_InvalidInterestGroup",
184
+ "List_TooManyInterestGroups" => "Mailchimp_List_TooManyInterestGroups",
185
+ "Campaign_DoesNotExist" => "Mailchimp_Campaign_DoesNotExist",
186
+ "Campaign_StatsNotAvailable" => "Mailchimp_Campaign_StatsNotAvailable",
187
+ "Campaign_InvalidAbsplit" => "Mailchimp_Campaign_InvalidAbsplit",
188
+ "Campaign_InvalidContent" => "Mailchimp_Campaign_InvalidContent",
189
+ "Campaign_InvalidOption" => "Mailchimp_Campaign_InvalidOption",
190
+ "Campaign_InvalidStatus" => "Mailchimp_Campaign_InvalidStatus",
191
+ "Campaign_NotSaved" => "Mailchimp_Campaign_NotSaved",
192
+ "Campaign_InvalidSegment" => "Mailchimp_Campaign_InvalidSegment",
193
+ "Campaign_InvalidRss" => "Mailchimp_Campaign_InvalidRss",
194
+ "Campaign_InvalidAuto" => "Mailchimp_Campaign_InvalidAuto",
195
+ "MC_ContentImport_InvalidArchive" => "Mailchimp_MC_ContentImport_InvalidArchive",
196
+ "Campaign_BounceMissing" => "Mailchimp_Campaign_BounceMissing",
197
+ "Campaign_InvalidTemplate" => "Mailchimp_Campaign_InvalidTemplate",
198
+ "Invalid_EcommOrder" => "Mailchimp_Invalid_EcommOrder",
199
+ "Absplit_UnknownError" => "Mailchimp_Absplit_UnknownError",
200
+ "Absplit_UnknownSplitTest" => "Mailchimp_Absplit_UnknownSplitTest",
201
+ "Absplit_UnknownTestType" => "Mailchimp_Absplit_UnknownTestType",
202
+ "Absplit_UnknownWaitUnit" => "Mailchimp_Absplit_UnknownWaitUnit",
203
+ "Absplit_UnknownWinnerType" => "Mailchimp_Absplit_UnknownWinnerType",
204
+ "Absplit_WinnerNotSelected" => "Mailchimp_Absplit_WinnerNotSelected",
205
+ "Invalid_Analytics" => "Mailchimp_Invalid_Analytics",
206
+ "Invalid_DateTime" => "Mailchimp_Invalid_DateTime",
207
+ "Invalid_Email" => "Mailchimp_Invalid_Email",
208
+ "Invalid_SendType" => "Mailchimp_Invalid_SendType",
209
+ "Invalid_Template" => "Mailchimp_Invalid_Template",
210
+ "Invalid_TrackingOptions" => "Mailchimp_Invalid_TrackingOptions",
211
+ "Invalid_Options" => "Mailchimp_Invalid_Options",
212
+ "Invalid_Folder" => "Mailchimp_Invalid_Folder",
213
+ "Invalid_URL" => "Mailchimp_Invalid_URL",
214
+ "Module_Unknown" => "Mailchimp_Module_Unknown",
215
+ "MonthlyPlan_Unknown" => "Mailchimp_MonthlyPlan_Unknown",
216
+ "Order_TypeUnknown" => "Mailchimp_Order_TypeUnknown",
217
+ "Invalid_PagingLimit" => "Mailchimp_Invalid_PagingLimit",
218
+ "Invalid_PagingStart" => "Mailchimp_Invalid_PagingStart",
219
+ "Max_Size_Reached" => "Mailchimp_Max_Size_Reached",
220
+ "MC_SearchException" => "Mailchimp_MC_SearchException"
221
+ );
222
+
223
+ public function __construct($apikey=null, $opts=array()) {
224
+ if(!$apikey) $apikey = getenv('MAILCHIMP_APIKEY');
225
+ if(!$apikey) $apikey = $this->readConfigs();
226
+ if(!$apikey) throw new Mailchimp_Error('You must provide a MailChimp API key');
227
+ $this->apikey = $apikey;
228
+ $dc = "us1";
229
+ if (strstr($this->apikey,"-")){
230
+ list($key, $dc) = explode("-",$this->apikey,2);
231
+ if (!$dc) $dc = "us1";
232
+ }
233
+ $this->root = str_replace('https://api', 'https://'.$dc.'.api', $this->root);
234
+ $this->root = rtrim($this->root, '/') . '/';
235
+
236
+ if (!isset($opts['timeout']) || !is_int($opts['timeout'])){
237
+ $opts['timeout']=600;
238
+ }
239
+ if (isset($opts['debug'])){
240
+ $this->debug = true;
241
+ }
242
+ if (isset($opts['ssl_verifypeer'])){
243
+ $this->ssl_verifypeer = $opts['ssl_verifypeer'];
244
+ }
245
+ if (isset($opts['ssl_verifyhost'])){
246
+ $this->ssl_verifyhost = $opts['ssl_verifyhost'];
247
+ }
248
+ if (isset($opts['ssl_cainfo'])){
249
+ $this->ssl_cainfo = $opts['ssl_cainfo'];
250
+ }
251
+
252
+
253
+ $this->ch = curl_init();
254
+ curl_setopt($this->ch, CURLOPT_USERAGENT, 'MailChimp-PHP/2.0.4');
255
+ curl_setopt($this->ch, CURLOPT_POST, true);
256
+ // if open base directiory is set, toggle to false, else keep true
257
+ if ( ini_get('open_basedir') ) {
258
+ curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, false);
259
+ } else {
260
+ curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, true);
261
+ }
262
+ curl_setopt($this->ch, CURLOPT_HEADER, false);
263
+ curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, true);
264
+ curl_setopt($this->ch, CURLOPT_CONNECTTIMEOUT, 45);
265
+ curl_setopt($this->ch, CURLOPT_TIMEOUT, $opts['timeout']);
266
+
267
+
268
+ $this->folders = new Mailchimp_Folders($this);
269
+ $this->templates = new Mailchimp_Templates($this);
270
+ $this->users = new Mailchimp_Users($this);
271
+ $this->helper = new Mailchimp_Helper($this);
272
+ $this->mobile = new Mailchimp_Mobile($this);
273
+ $this->ecomm = new Mailchimp_Ecomm($this);
274
+ $this->neapolitan = new Mailchimp_Neapolitan($this);
275
+ $this->lists = new Mailchimp_Lists($this);
276
+ $this->campaigns = new Mailchimp_Campaigns($this);
277
+ $this->vip = new Mailchimp_Vip($this);
278
+ $this->reports = new Mailchimp_Reports($this);
279
+ $this->gallery = new Mailchimp_Gallery($this);
280
+
281
+ }
282
+
283
+ public function __destruct() {
284
+ curl_close($this->ch);
285
+ }
286
+
287
+ public function call($url, $params) {
288
+ $params['apikey'] = $this->apikey;
289
+ $params = json_encode($params);
290
+ $ch = $this->ch;
291
+
292
+ curl_setopt($ch, CURLOPT_URL, $this->root . $url . '.json');
293
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
294
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
295
+ curl_setopt($ch, CURLOPT_VERBOSE, $this->debug);
296
+ // SSL Options
297
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $this->ssl_verifypeer);
298
+ curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, $this->ssl_verifyhost);
299
+ if ($this->ssl_cainfo) curl_setopt($ch, CURLOPT_CAINFO, $this->ssl_cainfo);
300
+
301
+ $start = microtime(true);
302
+ $this->log('Call to ' . $this->root . $url . '.json: ' . $params);
303
+ if($this->debug) {
304
+ $curl_buffer = fopen('php://memory', 'w+');
305
+ curl_setopt($ch, CURLOPT_STDERR, $curl_buffer);
306
+ }
307
+
308
+ $response_body = curl_exec($ch);
309
+ $info = curl_getinfo($ch);
310
+ $time = microtime(true) - $start;
311
+ if($this->debug) {
312
+ rewind($curl_buffer);
313
+ $this->log(stream_get_contents($curl_buffer));
314
+ fclose($curl_buffer);
315
+ }
316
+ $this->log('Completed in ' . number_format($time * 1000, 2) . 'ms');
317
+ $this->log('Got response: ' . $response_body);
318
+
319
+ if(curl_error($ch)) {
320
+ throw new Mailchimp_HttpError("API call to $url failed: " . curl_error($ch));
321
+ }
322
+ $result = json_decode($response_body, true);
323
+
324
+ if(floor($info['http_code'] / 100) >= 4) {
325
+ throw $this->castError($result);
326
+ }
327
+
328
+ return $result;
329
+ }
330
+
331
+ public function readConfigs() {
332
+ $paths = array('~/.mailchimp.key', '/etc/mailchimp.key');
333
+ foreach($paths as $path) {
334
+ if(file_exists($path)) {
335
+ $apikey = trim(file_get_contents($path));
336
+ if($apikey) return $apikey;
337
+ }
338
+ }
339
+ return false;
340
+ }
341
+
342
+ public function castError($result) {
343
+ if($result['status'] !== 'error' || !$result['name']) throw new Mailchimp_Error('We received an unexpected error: ' . json_encode($result));
344
+
345
+ $class = (isset(self::$error_map[$result['name']])) ? self::$error_map[$result['name']] : 'Mailchimp_Error';
346
+ return new $class($result['error'], $result['code']);
347
+ }
348
+
349
+ public function log($msg) {
350
+ if($this->debug) error_log($msg);
351
+ }
352
+ }
353
+ }
354
+
classes/class.yksemeBase.php CHANGED
@@ -1,5028 +1,3876 @@
1
- <?php
2
- if(!class_exists("yksemeBase"))
3
- {
4
- class yksemeBase
5
- {
6
-
7
- /**
8
- * Variables
9
- */
10
- private $error = false;
11
- private $errorMsg = '';
12
- public $sessName = 'ykseme';
13
- public $optionVal = false;
14
- public $currentLists = false;
15
- public $currentListsCt = false;
16
-
17
- /**
18
- * Construct
19
- */
20
- public function __construct()
21
- {
22
- yksemeBase::initialize();
23
- add_action('init', array(&$this, 'ykes_mc_apply_filters'));
24
- }
25
-
26
- /**
27
- * Destruct
28
- */
29
- public function __destruct()
30
- {
31
- unset($this);
32
- }
33
-
34
- /**
35
- * ACTIONS
36
- * These are called when the plugin is initialized/deactivated/uninstalled
37
- */
38
- public function activate()
39
- {
40
- // redirect the user on plugin activation
41
- // to our MailChimp settings page
42
- add_option('yks_easy_mc_plugin_do_activation_redirect', true);
43
-
44
- // check if our option is already set
45
- // if it exists, return
46
- if( get_option( 'api_validation' ) ) {
47
- return;
48
- } else { // else create it
49
- add_option('api_validation' , 'invalid_api_key');
50
- }
51
- }
52
- public function deactivate()
53
- {
54
-
55
- }
56
- public function uninstall()
57
- { // delete options on plugin uninstall
58
- delete_option(YKSEME_OPTION);
59
- delete_option('api_validation');
60
- delete_option('imported_lists');
61
- }
62
-
63
- /***** INITIAL SETUP
64
- ****************************************************************************************************/
65
- public function initialize()
66
- {
67
- // If it's not already set up, initialize our plugin session
68
- if(session_id() == '') @session_start();
69
- if(!is_array(@$_SESSION[$this->sessName]))
70
- {
71
- $_SESSION[$this->sessName] = array();
72
- }
73
- // Add the CSS/JS files
74
- add_action('admin_print_styles', array(&$this, 'addStyles'));
75
- add_action('admin_print_scripts', array(&$this, 'addScripts'));
76
- add_action('admin_init', array( &$this, 'yks_easy_mc_plugin_activation_redirect' ) );
77
-
78
- // custom Dashboard MailChimp Account Activity Widget
79
- add_action( 'wp_dashboard_setup', array( &$this , 'yks_mc_add_chimp_chatter_dashboard_widget' ) );
80
-
81
- if ( is_admin() ) {
82
- // add a filter for our heartbeat response
83
- // only add it to the admin screen, to prevent
84
- // heartbeat from running on the front end
85
- add_filter('heartbeat_received', array( &$this , 'yks_mc_heartbeat_received' ) , 10, 2);
86
- add_action("init", array( &$this , "yks_mc_heartbeat_init" ) );
87
- add_filter( 'heartbeat_settings', array( &$this , 'yks_mc_tweak_heartbeat_settings') );
88
- }
89
-
90
- // adding our custom content action
91
- // used to prevent other plugins from hooking
92
- // into the_content (such as jetpack sharedadddy, sharethis etc.)
93
- add_action( 'init', array( &$this, 'yks_mc_content' ), 1 );
94
-
95
- // Custom Filter To Alter Submitted Data
96
- // before being sent off to MailChimp
97
- add_filter( 'yikes_mc_get_form_data', array( &$this , 'yikes_mc_get_form_data_filter' ) , 10 );
98
-
99
- // Custom Filter To Alter User Already Subscribed Message
100
- add_filter( 'yikes_mc_user_already_subscribed', array( &$this , 'yikes_mc_user_already_subscribed_error_message_filter' ) , 10 , 2 );
101
-
102
-
103
- // tinymce buttons
104
- // only add filters and actions on wp 3.9 and above
105
- if ( get_bloginfo( 'version' ) >= '3.9' ) {
106
- add_action( 'admin_head', array(&$this, 'yks_mc_add_tinyMCE') );
107
- add_filter( 'mce_external_plugins', array(&$this, 'yks_mc_add_tinymce_plugin') );
108
- add_filter( 'mce_buttons', array(&$this, 'yks_mc_add_tinymce_button') );
109
- // pass our lists data to tinyMCE button for use
110
- foreach( array('post.php','post-new.php') as $hook )
111
- add_action( "admin_head-$hook", array(&$this, 'yks_mc_js_admin_head') );
112
- } else {
113
- // if the WordPress is older than 3.9
114
- // load jQuery UI 1.10 CSS for dialogs
115
- wp_enqueue_style('yks_easy_mc_extender-admin-ui-css',
116
- '//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css'
117
- );
118
- wp_enqueue_style('yks_easy_mc_wp_3.8', plugin_dir_url(__FILE__).'../css/yks_easy_mc_wp_3point8.css');
119
- }
120
- if(!is_admin())
121
- {
122
- // add_action('wp_print_styles', array(&$this, 'addStyles_frontend'));
123
- // add_action('wp_print_scripts', array(&$this, 'addScripts_frontend'));
124
-
125
- // custom hooks to print scripts and styles only on pages
126
- // where the form is being displayed (performace enhancement)
127
- // hooked into shortcode_form.php
128
- add_action('yks_mc_enqueue_styles', array( &$this, 'addStyles_frontend' ) );
129
- add_action('yks_mc_enqueue_scripts', array( &$this, 'addScripts_frontend') ) ;
130
- }
131
- // Setup the administration menus
132
- add_action('admin_menu', array(&$this, 'addAdministrationMenu'));
133
- // Make sure the option exists
134
- if(!$this->optionVal) $this->getOptionValue();
135
- // Setup shortcodes
136
- $this->createShortcodes();
137
- // Initialize current list array
138
- $this->currentLists = array();
139
- $this->currentListsCt = array();
140
- // Do any update tasks if needed
141
- $this->runUpdateCheck();
142
- // Register Our Widget
143
- $this->registerMailChimpWidget($this->optionVal['lists']);
144
- }
145
-
146
- // register and add our shortcodes
147
- public function createShortcodes()
148
- {
149
- add_shortcode('yks-mailchimp-list', array(&$this, 'processShortcode'));
150
- add_shortcode('yks-mailchimp-subscriber-count', array(&$this, 'displaySubscriberCount'));
151
- }
152
-
153
- /** Custom Filter To Alter User Submitted Data **/
154
- public function yikes_mc_get_form_data_filter( $mv ) {
155
- return $mv;
156
- }
157
-
158
- /** Custom Filter To Alter User Already Subscribed Error Message **/
159
- public function yikes_mc_user_already_subscribed_error_message_filter( $errorMessage , $email ) {
160
- return $errorMessage;
161
- }
162
-
163
- // Create and store our initial plugin options
164
- public function getOptionValue()
165
- {
166
- $blog_title = get_bloginfo( 'name' );
167
- $defaultVals = array(
168
- 'version' => YKSEME_VERSION_CURRENT,
169
- 'api-key' => '',
170
- 'flavor' => '1',
171
- 'debug' => '0',
172
- 'optin' => 'true',
173
- 'single-optin-message' => __('Thank You for subscribing!', 'yikes-inc-easy-mailchimp-extender'),
174
- 'double-optin-message' => __('Thank You for subscribing! Check your email for the confirmation message.', 'yikes-inc-easy-mailchimp-extender'),
175
- 'interest-group-label' => __('Select Your Area of Interest', 'yikes-inc-easy-mailchimp-extender'),
176
- 'optIn-checkbox' => 'hide',
177
- 'yks-mailchimp-optIn-default-list' => 'select_list',
178
- 'yks-mailchimp-optin-checkbox-text' => 'Add me to the ' . $blog_title . ' mailing list',
179
- 'recaptcha-setting' => '0',
180
- 'recaptcha-api-key' => '',
181
- 'recaptcha-private-api-key' => '',
182
- 'recaptcha-style' => 'default',
183
- 'lists' => array()
184
- );
185
- $ov = get_option(YKSEME_OPTION, $defaultVals);
186
- $this->optionVal = $ov;
187
- return $ov;
188
- }
189
-
190
- private function runUpdateCheck()
191
- {
192
- if(!isset($this->optionVal['version'])
193
- || $this->optionVal['version'] < YKSEME_VERSION_CURRENT)
194
- {
195
- $this->runUpdateTasks();
196
- }
197
- }
198
-
199
-
200
- /***** FUNCTIONS
201
- ****************************************************************************************************/
202
- // check if were on the login page
203
- function is_login_page() {
204
- return in_array($GLOBALS['pagenow'], array('wp-login.php', 'wp-register.php'));
205
- }
206
- // create a slug like string, given some text (ie: this-is-the-name)
207
- public function slugify($text)
208
- {
209
- // replace non letter or digits by -
210
- $text = preg_replace('~[^\\pL\d]+~u', '-', $text);
211
- // trim
212
- $text = trim($text, '-');
213
- // transliterate
214
- $text = iconv('utf-8', 'us-ascii//TRANSLIT', $text);
215
- // lowercase
216
- $text = strtolower($text);
217
- // remove unwanted characters
218
- $text = preg_replace('~[^-\w]+~', '', $text);
219
- if(empty($text))
220
- {
221
- return 'n-a';
222
- }
223
- return $text;
224
- }
225
- // create an array for any fields left blank
226
- // not sure if still needed
227
- public function getBlankFieldsArray($lid='')
228
- {
229
- $fields = array();
230
- // Add Field
231
- $name = $this->slugify('Email Address'.'-'.'EMAIL');
232
- $addField = array(
233
- 'id' => $lid.'-'.$name,
234
- 'name' => $lid.'-'.$name,
235
- 'merge' => 'EMAIL',
236
- 'label' => 'Email Address',
237
- 'require' => '1',
238
- 'active' => '1',
239
- 'locked' => '1',
240
- 'sort' => '1',
241
- 'type' => 'email',
242
- 'help' => '',
243
- 'defalt' => '',
244
- 'choices' => ''
245
- );
246
- $fields[$addField['id']] = $addField;
247
- // return our fields
248
- return $fields;
249
- }
250
-
251
- // Create an array of data for imported fields based on the Merge Varaibles passed back from MailChimp
252
- public function getImportedFieldsArray($lid, $mv)
253
- {
254
- if(empty($mv)) {
255
- return false;
256
- } else {
257
- $fields = array();
258
-
259
- $num = 1;
260
- foreach($mv['data'][0]['merge_vars'] as $field)
261
- {
262
- // Add Field
263
- $name = $this->slugify(isset($field['label']).'-'.$field['tag']);
264
- $addField = array(
265
- 'id' => $lid.'-'.$name,
266
- 'name' => $lid.$field['tag'],
267
- 'merge' => $field['tag'],
268
- 'label' => $field['name'],
269
- 'require' => $field['req'],
270
- 'active' => '1',
271
- 'locked' => '1',
272
- 'sort' => $field['order'],
273
- 'type' => $field['field_type'],
274
- 'help' => $field['helptext'],
275
- 'default' => $field['default'],
276
- 'choices' => (isset($field['choices']) ? $field['choices'] : '')
277
- );
278
- $fields[$addField['id']] = $addField;
279
- $num++;
280
- }
281
- return $fields;
282
- }
283
- }
284
- // Get the current users browser information
285
- // Used specifically on the lists page
286
- public function getBrowser()
287
- {
288
- $u_agent = $_SERVER['HTTP_USER_AGENT'];
289
- $bname = 'Unknown';
290
- $platform = 'Unknown';
291
- $version = "";
292
- //First get the platform?
293
- if(preg_match('/linux/i', $u_agent))
294
- {
295
- $platform = 'Linux';
296
- }
297
- elseif(preg_match('/macintosh|mac os x/i', $u_agent))
298
- {
299
- $platform = 'Mac';
300
- }
301
- elseif(preg_match('/windows|win32/i', $u_agent))
302
- {
303
- $platform = 'Windows';
304
- }
305
-
306
- // Next get the name of the useragent yes seperately and for good reason
307
- if(preg_match('/MSIE/i',$u_agent) && !preg_match('/Opera/i',$u_agent))
308
- {
309
- $bname = 'Internet Explorer';
310
- $ub = "MSIE";
311
- }
312
- elseif(preg_match('/Firefox/i',$u_agent))
313
- {
314
- $bname = 'Mozilla Firefox';
315
- $ub = "Firefox";
316
- }
317
- elseif(preg_match('/Chrome/i',$u_agent))
318
- {
319
- $bname = 'Google Chrome';
320
- $ub = "Chrome";
321
- }
322
- elseif(preg_match('/Safari/i',$u_agent))
323
- {
324
- $bname = 'Apple Safari';
325
- $ub = "Safari";
326
- }
327
- elseif(preg_match('/Opera/i',$u_agent))
328
- {
329
- $bname = 'Opera';
330
- $ub = "Opera";
331
- }
332
- elseif(preg_match('/Netscape/i',$u_agent))
333
- {
334
- $bname = 'Netscape';
335
- $ub = "Netscape";
336
- }
337
-
338
- // finally get the correct version number
339
- $known = array('Version', $ub, 'other');
340
- $pattern = '#(?<browser>' . join('|', $known) .
341
- ')[/ ]+(?<version>[0-9.|a-zA-Z.]*)#';
342
- if(!preg_match_all($pattern, $u_agent, $matches))
343
- {
344
- // we have no matching number just continue
345
- }
346
-
347
- // see how many we have
348
- $i = count($matches['browser']);
349
- if($i != 1)
350
- {
351
- //we will have two since we are not using 'other' argument yet
352
- //see if version is before or after the name
353
- if(strripos($u_agent,"Version") < strripos($u_agent,$ub))
354
- {
355
- $version= $matches['version'][0];
356
- }
357
- else
358
- {
359
- $version= $matches['version'][1];
360
- }
361
- }
362
- else
363
- {
364
- $version= $matches['version'][0];
365
- }
366
-
367
- // check if we have a number
368
- if($version==null || $version=="") {$version="?";}
369
-
370
- return array(
371
- 'userAgent' => $u_agent,
372
- 'name' => $bname,
373
- 'version' => $version,
374
- 'platform' => $platform,
375
- 'pattern' => $pattern
376
- );
377
- }
378
-
379
- /***** Encryption/Decryption
380
- ******
381
- ****** Used to encrypt/decrypt
382
- ****** API Keys (MailChimp and reCaptcha)
383
- *****************************************************************************************************/
384
- function yikes_mc_encryptIt( $q ) {
385
- $cryptKey = 'qJB0rGtIn5UB1xG03efyCp';
386
- $qEncoded = base64_encode( mcrypt_encrypt( MCRYPT_RIJNDAEL_256, md5( $cryptKey ), $q, MCRYPT_MODE_CBC, md5( md5( $cryptKey ) ) ) );
387
- return( $qEncoded );
388
- }
389
-
390
- function yikes_mc_decryptIt( $q ) {
391
- $cryptKey = 'qJB0rGtIn5UB1xG03efyCp';
392
- $qDecoded = rtrim( mcrypt_decrypt( MCRYPT_RIJNDAEL_256, md5( $cryptKey ), base64_decode( $q ), MCRYPT_MODE_CBC, md5( md5( $cryptKey ) ) ), "\0");
393
- return( $qDecoded );
394
- }
395
-
396
-
397
- /***** CONFIGURATION
398
- ****************************************************************************************************/
399
- // Update our plugin options
400
- // Runs when the user updates the settings page with new values
401
- public function updateOptions($p)
402
- {
403
- if(!empty($p['form_data']))
404
- {
405
- parse_str($p['form_data'], $fd);
406
- // checking if the entered API key has copied out of the value field?
407
- if ( strlen( $fd['yks-mailchimp-api-key'] ) > 45 ) {
408
- $apiKey = $this->yikes_mc_decryptIt($fd['yks-mailchimp-api-key']);
409
- } else {
410
- $apiKey = $fd['yks-mailchimp-api-key'];
411
- }
412
- // check if the newly input API key differs from the previously stored one
413
- if ( $apiKey == $this->optionVal['api-key'] ) {
414
- $this->optionVal['api-key'] = $apiKey;
415
- $this->optionVal['flavor'] = $fd['yks-mailchimp-flavor'];
416
- $this->optionVal['optin'] = $fd['yks-mailchimp-optin'];
417
- $this->optionVal['single-optin-message'] = stripslashes($fd['single-optin-message']);
418
- $this->optionVal['double-optin-message'] = stripslashes($fd['double-optin-message']);
419
- $this->optionVal['interest-group-label'] = stripslashes($fd['interest-group-label']);
420
- $this->optionVal['optIn-checkbox'] = $fd['yks-mailchimp-optIn-checkbox'];
421
- $this->optionVal['yks-mailchimp-optIn-default-list'] = isset($fd['yks-mailchimp-optIn-default-list']) ? $fd['yks-mailchimp-optIn-default-list'] : null; // if its set, else set to null <- fixes save form settings bug
422
- $this->optionVal['yks-mailchimp-optin-checkbox-text'] = stripslashes($fd['yks-mailchimp-optin-checkbox-text']);
423
- $this->optionVal['yks-mailchimp-jquery-datepicker'] = isset( $fd['yks-mailchimp-jquery-datepicker'] ) ? '1' : '';
424
- // evan herman here
425
- update_option('api_validation', 'valid_api_key');
426
- return update_option(YKSEME_OPTION, $this->optionVal);
427
- } else {
428
- $this->optionVal['api-key'] = $apiKey;
429
- $this->optionVal['flavor'] = $fd['yks-mailchimp-flavor'];
430
- $this->optionVal['optin'] = $fd['yks-mailchimp-optin'];
431
- $this->optionVal['single-optin-message'] = stripslashes($fd['single-optin-message']);
432
- $this->optionVal['double-optin-message'] = stripslashes($fd['double-optin-message']);
433
- $this->optionVal['interest-group-label'] = stripslashes($fd['interest-group-label']);
434
- $this->optionVal['optIn-checkbox'] = $fd['yks-mailchimp-optIn-checkbox'];
435
- $this->optionVal['yks-mailchimp-optIn-default-list'] = isset($fd['yks-mailchimp-optIn-default-list']) ? $fd['yks-mailchimp-optIn-default-list'] : null; // if its set, else set to null <- fixes save form settings bug
436
- $this->optionVal['yks-mailchimp-optin-checkbox-text'] = stripslashes($fd['yks-mailchimp-optin-checkbox-text']);
437
- $this->optionVal['yks-mailchimp-jquery-datepicker'] = isset( $fd['yks-mailchimp-jquery-datepicker'] ) ? '1' : '';
438
- update_option('api_validation', 'valid_api_key');
439
- // if the new API key differs from the old one
440
- // we need to unset the previously set up widgets
441
- // and set up new erros if the API key doesn't exist
442
-
443
- // 1 - empty the lists array of imported lists
444
- $this->optionVal['lists'] = array();
445
- // 2 - unset our previously set up widgets
446
- update_option( 'widget_yikes_mc_widget' , '' );
447
- return update_option(YKSEME_OPTION, $this->optionVal);
448
- }
449
-
450
- }
451
- return false;
452
- }
453
- // Update our recaptcha options
454
- // Runs when the user updates the recaptcha settings page with new values
455
- public function updateRecaptchaOptions($p)
456
- {
457
- if(!empty($p['form_data']))
458
- {
459
- parse_str($p['form_data'], $fd);
460
- $this->optionVal['recaptcha-setting'] = isset($fd['yks-mailchimp-recaptcha-setting']) ? $fd['yks-mailchimp-recaptcha-setting'] : '0';
461
- $this->optionVal['recaptcha-api-key'] = isset($fd['yks-mailchimp-recaptcha-api-key']) ? $fd['yks-mailchimp-recaptcha-api-key'] : '';
462
- $this->optionVal['recaptcha-private-api-key'] = isset($fd['yks-mailchimp-recaptcha-private-api-key']) ? $fd['yks-mailchimp-recaptcha-private-api-key'] : '';
463
- $this->optionVal['recaptcha-style'] = isset($fd['yks-mailchimp-recaptcha-style']) ? $fd['yks-mailchimp-recaptcha-style'] : 'default';
464
- return update_option(YKSEME_OPTION, $this->optionVal);
465
- }
466
- return false;
467
- }
468
-
469
- // Update our debug plugin options
470
- // Runs when the user updates the debug settings page with new values
471
- public function updateDebugOptions($p)
472
- {
473
- if(!empty($p['form_data']))
474
- {
475
- parse_str($p['form_data'], $fd);
476
- $this->optionVal['debug'] = $fd['yks-mailchimp-debug'];
477
- return update_option(YKSEME_OPTION, $this->optionVal);
478
- }
479
- return false;
480
- }
481
-
482
- // Update the API Key
483
- public function updateApiKey($k)
484
- {
485
- $this->optionVal['api-key'] = $k;
486
- return update_option(YKSEME_OPTION, $this->optionVal);
487
- }
488
- // Update the version number
489
- public function updateVersion($k)
490
- {
491
- $this->optionVal['version'] = $k;
492
- return update_option(YKSEME_OPTION, $this->optionVal);
493
- }
494
-
495
-
496
- /********Mailchimp Error Codes
497
- *****************************************************************************************************/
498
- // not sure these are used any more
499
- // maybe remove
500
- public function YksMCErrorCodes ($error)
501
- {
502
- //Server Errors
503
- $errorcode['-32601'][1] = 'ServerError_MethodUnknown';
504
- $errorcode['-32602'][1] = 'ServerError_InvalidParameters';
505
- $errorcode['-99'][1] = 'Unknown_Exception';
506
- $errorcode['-98'][1] = 'Request_TimedOut';
507
- $errorcode['-92'][1] = 'Zend_Uri_Exception';
508
- $errorcode['-91'][1] = 'PDOException';
509
- $errorcode['-91'][1] = 'Avesta_Db_Exception';
510
- $errorcode['-90'][1] = 'XML_RPC2_Exception';
511
- $errorcode['-90'][1] = 'XML_RPC2_FaultException';
512
- $errorcode['-50'][1] = 'Too_Many_Connections';
513
- $errorcode['0'][1] = 'Parse_Exception';
514
-
515
- $errormessage[1] = "Sorry, we can't connect to MailChimp at this time. Please come back later and try again.";
516
-
517
- //API User or API Key error
518
- $errorcode['100'][2] = 'User_Unknown';
519
- $errorcode['101'][2] = 'User_Disabled';
520
- $errorcode['102'][2] = 'User_DoesNotExist';
521
- $errorcode['103'][2] = 'User_NotApproved';
522
- $errorcode['104'][2] = 'Invalid_ApiKey';
523
- $errorcode['105'][2] = 'User_UnderMaintenance';
524
- $errorcode['106'][2] = 'Invalid_AppKey';
525
- $errorcode['107'][2] = 'Invalid_IP';
526
- $errorcode['108'][2] = 'User_DoesExist';
527
- $errorcode['109'][2] = 'User_InvalidRole';
528
- $errorcode['120'][2] = 'User_InvalidAction';
529
- $errorcode['121'][2] = 'User_MissingEmail';
530
- $errorcode['122'][2] = 'User_CannotSendCampaign';
531
- $errorcode['123'][2] = 'User_MissingModuleOutbox';
532
- $errorcode['124'][2] = 'User_ModuleAlreadyPurchased';
533
- $errorcode['125'][2] = 'User_ModuleNotPurchased';
534
- $errorcode['126'][2] = 'User_NotEnoughCredit';
535
- $errorcode['127'][2] = 'MC_InvalidPayment';
536
-
537
- $errormessage[2] = "Sorry, this MailChimp account does not exist.";
538
-
539
- // List errors
540
- $errorcode['200'][3] = 'List_DoesNotExist';
541
- $errorcode['210'][3] = 'List_InvalidInterestFieldType';
542
- $errorcode['211'][3] = 'List_InvalidOption';
543
- $errorcode['212'][3] = 'List_InvalidUnsubMember';
544
- $errorcode['213'][3] = 'List_InvalidBounceMember';
545
-
546
- $errormessage[3] = "Sorry, this list does not exist.";
547
-
548
- //Already subscribed or unsubscribed
549
- $errorcode['214'][4] = 'List_AlreadySubscribed';
550
- $errorcode['215'][4] = 'List_NotSubscribed';
551
- $errorcode['220'][4] = 'List_InvalidImport';
552
- $errorcode['221'][4] = 'MC_PastedList_Duplicate';
553
- $errorcode['222'][4] = 'MC_PastedList_InvalidImport';
554
- $errorcode['230'][4] = 'Email_AlreadySubscribed';
555
- $errorcode['231'][4] = 'Email_AlreadyUnsubscribed';
556
- $errorcode['232'][4] = 'Email_NotExists';
557
- $errorcode['233'][4] = 'Email_NotSubscribed';
558
-
559
- $errormessage[4] = "Sorry, you are already subscribed to this list.";
560
-
561
- // General Message
562
- $errorcode['250'][5] = 'List_MergeFieldRequired';
563
- $errorcode['251'][5] = 'List_CannotRemoveEmailMerge';
564
- $errorcode['252'][5] = 'List_Merge_InvalidMergeID';
565
- $errorcode['253'][5] = 'List_TooManyMergeFields';
566
- $errorcode['254'][5] = 'List_InvalidMergeField';
567
- $errorcode['270'][5] = 'List_InvalidInterestGroup';
568
- $errorcode['271'][5] = 'List_TooManyInterestGroups';
569
- $errorcode['300'][5] = 'Campaign_DoesNotExist';
570
- $errorcode['301'][5] = 'Campaign_StatsNotAvailable';
571
- $errorcode['310'][5] = 'Campaign_InvalidAbsplit';
572
- $errorcode['311'][5] = 'Campaign_InvalidContent';
573
- $errorcode['312'][5] = 'Campaign_InvalidOption';
574
- $errorcode['313'][5] = 'Campaign_InvalidStatus';
575
- $errorcode['314'][5] = 'Campaign_NotSaved';
576
- $errorcode['315'][5] = 'Campaign_InvalidSegment';
577
- $errorcode['316'][5] = 'Campaign_InvalidRss';
578
- $errorcode['317'][5] = 'Campaign_InvalidAuto';
579
- $errorcode['318'][5] = 'MC_ContentImport_InvalidArchive';
580
- $errorcode['319'][5] = 'Campaign_BounceMissing';
581
- $errorcode['330'][5] = 'Invalid_EcommOrder';
582
- $errorcode['350'][5] = 'Absplit_UnknownError';
583
- $errorcode['351'][5] = 'Absplit_UnknownSplitTest';
584
- $errorcode['352'][5] = 'Absplit_UnknownTestType';
585
- $errorcode['353'][5] = 'Absplit_UnknownWaitUnit';
586
- $errorcode['354'][5] = 'Absplit_UnknownWinnerType';
587
- $errorcode['355'][5] = 'Absplit_WinnerNotSelected';
588
-
589
- $errormessage[5] = 'Sorry, MailChimp could not process your signup.';
590
-
591
- // Validation errors
592
- $errorcode['500'][6] = 'Invalid_Analytics';
593
- $errorcode['503'][6] = 'Invalid_SendType';
594
- $errorcode['504'][6] = 'Invalid_Template';
595
- $errorcode['505'][6] = 'Invalid_TrackingOptions';
596
- $errorcode['506'][6] = 'Invalid_Options';
597
- $errorcode['507'][6] = 'Invalid_Folder';
598
- $errorcode['550'][6] = 'Module_Unknown';
599
- $errorcode['551'][6] = 'MonthlyPlan_Unknown';
600
- $errorcode['552'][6] = 'Order_TypeUnknown';
601
- $errorcode['553'][6] = 'Invalid_PagingLimit';
602
- $errorcode['554'][6] = 'Invalid_PagingStart';
603
- $errorcode['555'][6] = 'Max_Size_Reached';
604
- $errorcode['556'][6] = 'MC_SearchException';
605
-
606
- $errormessage[6] = "Sorry, MailChimp doesn't like the data you are trying to send.";
607
-
608
- // Validate date and time field
609
- $errorcode['501'][7] = 'Invalid_DateTimel';
610
-
611
- $errormessage[7] = "Sorry, that date and time is invalid. Please try again.";
612
-
613
- //Validate Email
614
- $errorcode['502'][8] = 'Invalid_Email';
615
-
616
- $errormessage[8] = "Sorry, that email address is invalid. Please try again.";
617
-
618
- // Validate URL fields
619
- $errorcode['508'][9] = 'Invalid_URL';
620
-
621
- $errormessage[9] = "Sorry, that URL is invalid. Please try again.";
622
-
623
- // Get error message
624
- foreach ($errorcode as $eid => $value )
625
- {
626
- if ($eid == $error)
627
- {
628
- foreach ($value as $key => $mssg)
629
- {
630
- $Message = $errormessage[$key];
631
- if ( $this->optionVal['debug'] == '1')
632
- {
633
- $Message .= '<br /><strong>Error Code: '.$error.' - '.$mssg.'</strong><br />';
634
- $Message .= 'For more info, <a href="http://apidocs.mailchimp.com/api/1.3/exceptions.field.php">visit the MailChimp website</a> or <a href="http://kb.mailchimp.com/home">contact MailChimp</a>';
635
- }
636
- }
637
- }
638
- }
639
- return $Message;
640
-
641
- }
642
-
643
-
644
- /***** LIST ACTIONS
645
- ****************************************************************************************************/
646
- // Import a list from MailChimp and add it to the lists page
647
- // Runs when user add's a list from the drop down on the list page
648
- // Sending a call to MailChimp api to retrieve list data
649
- public function addList($lid='' , $name='')
650
- {
651
- if($lid == '' || isset($this->optionVal['lists'][$lid])) return false;
652
- $api = new wpyksMCAPI($this->optionVal['api-key']);
653
-
654
- $mv = $api->call('lists/merge-vars', array(
655
- 'id' => array($lid)
656
- )
657
- );
658
-
659
- if($mv)
660
- {
661
- $list = array(
662
- 'id' => $lid,
663
- 'list-id' => $lid,
664
- 'name' => $name,
665
- 'fields' => $this->getImportedFieldsArray($lid, $mv)
666
- );
667
-
668
- $this->optionVal['lists'][$list['id']] = $list;
669
-
670
- // store newly retreived list array in imported_list global option
671
- update_option('imported_lists', $this->optionVal['lists']);
672
-
673
- if(update_option(YKSEME_OPTION, $this->optionVal))
674
- {
675
- return $this->generateListContainers(array($list));
676
- }
677
- }
678
- return false;
679
- }
680
-
681
- ///////////////////////////////////////////////////
682
- /* Get Interest Groups */
683
- ///////////////////////////////////////////////////
684
- // Send request to MailChimp API to retreive interest groups associated to a sepcific list
685
- public function getInterestGroups($list_id)
686
- {
687
- // store our API key
688
- $api = new wpyksMCAPI($this->optionVal['api-key']);
689
-
690
- // setup switch for div/table
691
- $yikes_mc_flavor = $this->optionVal['flavor'];
692
-
693
- // try the request, and catch any errors
694
- try {
695
- $interest_groups = $api->call('lists/interest-groupings', array( 'id' => $list_id ));
696
- // if the list has an interest group
697
- if ($interest_groups) {
698
- // json_encode the data, and store it in optionVal['interest-groups']
699
- $this->optionVal['interest-groups'] = json_encode($interest_groups);
700
-
701
- $num = 0;
702
-
703
- switch($yikes_mc_flavor)
704
- {
705
- // table flavor
706
- case '0':
707
- // loop over each interest group returned
708
- foreach($interest_groups as $interest_group) {
709
- // if the interest group label is set to '' on the settings page
710
- if ( $this->optionVal['interest-group-label'] == '' ) {
711
- $user_set_interest_group_label = '<label class="prompt yks_table_label yks-mailchimpFormTableRowLabel yks-mailchimpFormTableRowLabel-required font-secondary label-text">'.$interest_group['name'].'</label>'; // display the interest group name from MailChimp
712
- } else {
713
- $user_set_interest_group_label = '<label class="prompt yks_table_label yks-mailchimpFormTableRowLabel yks-mailchimpFormTableRowLabel-required font-secondary label-text">'.$this->optionVal['interest-group-label'].'</label>'; // else display the custom name set in the settings page
714
- }
715
- ?>
716
- <!-- pass interest group data in a hidden form field , required to pass the data back to the correct interest-group -->
717
- <input type='hidden' name='interest-group-data' value='<?php echo $this->optionVal["interest-groups"]; ?>' />
718
- <?php
719
- // get form type
720
- $list_form_type = $interest_group['form_field'];
721
- $interestGroupID = $interest_group['id'];
722
-
723
- switch($list_form_type)
724
- {
725
-
726
- // checkbox interest groups
727
- case 'checkboxes':
728
- echo '<tr class="yks_mc_table_interest_group_holder yks_mc_table_checkbox_holder">';
729
- echo '<td class="yks_mc_table_td">';
730
- // display the label
731
- echo $user_set_interest_group_label;
732
- foreach ($interest_group['groups'] as $singleGrouping) {
733
- $checkboxValue = $interest_group['name'];
734
- echo '<label class="yks_mc_interest_group_label" for="'.$singleGrouping['name'].'"><input type="checkbox" id="'.$singleGrouping['name'].'" class="yikes_mc_interest_group_checkbox" name="'.$interest_group['form_field'].'-'.$interest_group['id'].'[]" value="'.$singleGrouping['name'].'"><span>'.$singleGrouping['name'].'</span></label>';
735
- }
736
- echo '</td>';
737
- echo '</tr>';
738
- break;
739
-
740
- // radiobuttons interest groups
741
- case 'radio':
742
- echo '<tr class="yks_mc_table_interest_group_holder yks_mc_table_radio_holder">';
743
- echo '<td class="yks_mc_interest_radio_button_holder yks_mc_table_td">';
744
- // display the label
745
- echo $user_set_interest_group_label;
746
- foreach ($interest_group['groups'] as $singleGrouping) {
747
- $radioValue = $interest_group['name'];
748
- echo '<label class="yks_mc_interest_group_label" for="'.$singleGrouping['name'].'"><input type="radio" id="'.$singleGrouping['name'].'" class="yikes_mc_interest_group_radio" name="'.$interest_group['form_field'].'-'.$interest_group['id'].'" value="'.$singleGrouping['name'].'"><span>'.$singleGrouping['name'].'</span></label>';
749
- }
750
- echo '</td>';
751
- echo '</tr>';
752
- break;
753
-
754
- // drop down interest groups
755
- case 'dropdown':
756
- echo '<tr class="yks_mc_table_interest_group_holder yks_mc_table_dropdown_holder">';
757
- echo '<td class="yks_mc_table_dropdown_interest_group_holder yks_mc_table_td">';
758
- // display the label
759
- echo $user_set_interest_group_label;
760
- echo '<select id="yks_mc_interest_dropdown" name="'.$interest_group['form_field'].'-'.$interest_group['id'].'" class="yks_mc_interest_group_select">';
761
- foreach ($interest_group['groups'] as $singleGrouping) {
762
- $dropDownValue = $interest_group['name'];
763
- echo '<option value="'.$singleGrouping['name'].'" name="'.$dropDownValue.'">'.$singleGrouping['name'].'</option>';
764
- }
765
- echo '</select>';
766
- echo '</td>';
767
- echo '</tr>';
768
- break;
769
- }
770
- $num++;
771
- }
772
-
773
- break;
774
-
775
- // div flavor
776
- case '1':
777
- // loop over each interest group returned
778
- foreach($interest_groups as $interest_group) {
779
- // if the interest group label is set to '' on the settings page
780
- if ( $this->optionVal['interest-group-label'] == '' ) {
781
- echo '<b class="yks_mc_interest_group_text">'.$interest_group['name'].'</b>'; // display the interest group name from MailChimp
782
- } else {
783
- echo '<b class="yks_mc_interest_group_text">'.$this->optionVal['interest-group-label'].'</b>'; // else display the custom name set in the settings page
784
- }
785
- ?>
786
- <!-- pass interest group data in a hidden form field , required to pass the data back to the correct interest-group -->
787
- <input type='hidden' name='interest-group-data' value='<?php echo $this->optionVal["interest-groups"]; ?>' />
788
- <?php
789
- // get form type
790
- $list_form_type = $interest_group['form_field'];
791
- $interestGroupID = $interest_group['id'];
792
-
793
- switch($list_form_type)
794
- {
795
-
796
- // checkbox interest groups
797
- case 'checkboxes':
798
- echo '<div class="yks_mc_interest_group_holder">';
799
- foreach ($interest_group['groups'] as $singleGrouping) {
800
- $checkboxValue = $interest_group['name'];
801
- echo '<label class="yks_mc_interest_group_label" for="'.$singleGrouping['name'].'"><input type="checkbox" id="'.$singleGrouping['name'].'" class="yikes_mc_interest_group_checkbox" name="'.$interest_group['form_field'].'-'.$interest_group['id'].'[]" value="'.$singleGrouping['name'].'"><span></span>'.$singleGrouping['name'].'</label>';
802
- }
803
- echo '</div>';
804
- break;
805
-
806
- // radiobuttons interest groups
807
- case 'radio':
808
- echo '<div class="yks_mc_interest_group_holder">';
809
- echo '<div class="yks_mc_interest_radio_button_holder">';
810
- foreach ($interest_group['groups'] as $singleGrouping) {
811
- $radioValue = $interest_group['name'];
812
- echo '<label class="yks_mc_interest_group_label" for="'.$singleGrouping['name'].'"><input type="radio" id="'.$singleGrouping['name'].'" class="yikes_mc_interest_group_radio" name="'.$interest_group['form_field'].'-'.$interest_group['id'].'" value="'.$singleGrouping['name'].'"><span></span>'.$singleGrouping['name'].'</label>';
813
- }
814
- echo '</div>';
815
- echo '</div>';
816
- break;
817
-
818
- // drop down interest groups
819
- case 'dropdown':
820
- echo '<div class="yks_mc_interest_group_holder">';
821
- echo '<select id="yks_mc_interest_dropdown" name="'.$interest_group['form_field'].'-'.$interest_group['id'].'" class="yks_mc_interest_group_select">';
822
- foreach ($interest_group['groups'] as $singleGrouping) {
823
- $dropDownValue = $interest_group['name'];
824
- echo '<option value="'.$singleGrouping['name'].'" name="'.$dropDownValue.'">'.$singleGrouping['name'].'</option>';
825
- }
826
- echo '</select>';
827
- echo '</div>';
828
- break;
829
- }
830
- $num++;
831
- }
832
- break;
833
-
834
- }
835
- }
836
- } catch( Exception $e ) {
837
- return;
838
- }
839
- return false;
840
- }
841
- // Send a call to the MailChimp API to retreive all lists on the account
842
- public function getLists()
843
- {
844
- $api = new wpyksMCAPI($this->optionVal['api-key']);
845
- $lists = $this->getListsData();
846
- $listArr = (!isset($listArr) ? $this->optionVal['lists'] : $listArr);
847
- $theusedlist = array();
848
- if(count($listArr) > 0)
849
- {
850
- foreach($listArr as $list)
851
- {
852
- $theusedlist[] = $list['id'];
853
- }
854
- }
855
- if($lists)
856
- {
857
- echo "<select id='yks-list-select' name='yks-list-select'>";
858
- echo "<option value=''> Select List</option>";
859
-
860
- foreach ($lists as $lkey => $lvalue)
861
- {
862
- if (!in_array($lkey, $theusedlist))
863
- {
864
- echo "<option value='".$lkey."'>".$lvalue."</option>";
865
- }
866
- }
867
- echo "</select>";
868
- echo '<input type="submit" name="submit" class="button-primary" id="yks-submit-list-add" value="' .__ ("Create a Form For This List" , "yikes-inc-easy-mailchimp-extender" ) .'" >';
869
- } else {
870
- echo '<strong>' . __('Error - No Lists Found On Your Account. Please create at least one list on your MailChimp account.' , 'yikes-inc-easy-mailchimp-extender' ) . '</strong>';
871
- }
872
- return false;
873
- }
874
- // Get lists for the settings page
875
- // Used for default subscription list
876
- public function getOptionsLists()
877
- {
878
- $api = new wpyksMCAPI($this->optionVal['api-key']);
879
- $lists = $this->getListsData();
880
- $listArr = (!isset($listArr) ? $this->optionVal['lists'] : $listArr);
881
- if($lists)
882
- {
883
- echo "<select id='yks-mailchimp-optIn-default-list' name='yks-mailchimp-optIn-default-list'>";
884
- echo "<option value='select_list'> Select List</option>";
885
- foreach ($lists as $lkey => $list_name)
886
- {
887
- echo "<option ".selected( isset($this->optionVal['yks-mailchimp-optIn-default-list']) ? $this->optionVal['yks-mailchimp-optIn-default-list'] : "select_list", $lkey )." value='".$lkey."'>".$list_name."</option>";
888
- }
889
- echo "</select>";
890
- }
891
- return false;
892
- }
893
- // Send a call to MailChimp API to get the data associated with a specific list (in this instance: the fields, and the subscriber count)
894
- public function getListsData()
895
- {
896
- /*
897
- $theListItems = get_transient('yks-mcp-listdata-retrieved');
898
- if (!$theListItems)
899
- {
900
- */
901
- $api = new wpyksMCAPI($this->optionVal['api-key']);
902
- $lists = $api->call('lists/list', array( 'limit' => 100 ));
903
- if($lists)
904
- {
905
- foreach ($lists['data'] as $list)
906
- {
907
- $theListItems[$list['id']] = $list['name'];
908
- $theListItems['subscriber-count']['subscriber-count-'.$list['id']] = $list['stats']['member_count'];
909
- }
910
-
911
- }
912
- /* set_transient( 'yks-mcp-listdata-retrieved', $theListItems, 60/60 ); //cache lists for 15 seconds for testing, originally 5 mins 60*5 */
913
- /* } */
914
- if ( isset ( $theListItems ) ) {
915
- return $theListItems;
916
- }
917
- }
918
- // Send a call to MailChimp API to get the data associated with a specific list (in this instance: the fields, and the subscriber count)
919
- // Send a call to the MailChimp API to retreive all lists on the account
920
- public function getListsForStats()
921
- {
922
- $api = new wpyksMCAPI($this->optionVal['api-key']);
923
- $lists = $this->getListsData();
924
- $listArr = (!isset($listArr) ? $this->optionVal['lists'] : $listArr);
925
- $theusedlist = array();
926
- if(count($listArr) > 0)
927
- {
928
- foreach($listArr as $list)
929
- {
930
- $theusedlist[] = $list['id'];
931
- }
932
- }
933
- if($lists)
934
- {
935
-
936
- foreach ( $lists as $list ) {
937
-
938
-
939
-
940
- }
941
- // Drop Down to switch form stats
942
- echo '<h3>Select list to view stats</h3>';
943
- echo '<div class="list_container_for_stats">';
944
- echo "<a alt='' href='#' class='stats_list_name' onclick='return false;'><input type='button' class='asbestos-flat-button active_button' value='".__( 'All Lists' , 'yikes-inc-easy-mailchimp-extender')."'></a>";
945
- foreach ($lists as $lkey => $lvalue)
946
- {
947
- if ( is_array($lvalue) ) {
948
- continue;
949
- } else {
950
- // if ( is_array( $lvalue ) ) { $lvalue = '<em style="color:rgba(245, 79, 79, 0.74);">Error</em>'; } else { $lvalue = $lvalue; }
951
- echo "<a alt='".$lkey."' href='#' class='stats_list_name' onclick='return false;'><input type='button' class='asbestos-flat-button' value='".$lvalue."'></a>";
952
- }
953
- }
954
- echo '</div>';
955
- }
956
- return false;
957
- }
958
-
959
- // Sort through the returned data
960
- public function sortList($p)
961
- {
962
- if(empty($p['update_string'])
963
- || empty($p['list_id'])) return false;
964
- else
965
- {
966
- // Setup fields
967
- $a = explode(';', $p['update_string']);
968
- if($a !== false)
969
- {
970
- foreach($a as $f)
971
- {
972
- $d = explode(':', $f);
973
- $this->optionVal['lists'][$p['list_id']]['fields'][$d[0]]['sort'] = $d[1];
974
- }
975
- }
976
- uasort($this->optionVal['lists'][$p['list_id']]['fields'], array(&$this, 'sortListFields'));
977
- return update_option(YKSEME_OPTION, $this->optionVal);
978
- }
979
- return false;
980
- }
981
-
982
- private function sortListfields($a,$b)
983
- {
984
- $a = $a['sort'];
985
- $b = $b['sort'];
986
- if($a == $b)
987
- {
988
- return 0;
989
- }
990
- return ($a < $b) ? -1 : 1;
991
- }
992
-
993
- // Update a single list on the lists page
994
- // This function fires when the user clicks 'save settings' for a specific form on the lists page
995
- public function updateList($p)
996
- {
997
- if(!empty($p['form_data']))
998
- {
999
- parse_str($p['form_data'], $fd);
1000
- if(!empty($fd['yks-mailchimp-unique-id']))
1001
- {
1002
- $num = 1;
1003
- foreach($this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['fields'] as $k => $v)
1004
- {
1005
- // Only proceed if the field is not locked
1006
- if($v['require'] == 0)
1007
- {
1008
- // Make sure this field was included in the update
1009
- $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['fields'][$k]['active'] = (isset($fd[$v['name']]) ? '1' : '0');
1010
- }
1011
- // $name = $this->slugify($field['label'].'-'.$field['tag']);
1012
- $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['fields'][$k]['placeholder-'.$fd['yks-mailchimp-unique-id'].'-'.$num] = $fd['placeholder-'.$fd['yks-mailchimp-unique-id'].'-'.$num];
1013
-
1014
- $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['fields'][$k]['custom-field-class-'.$fd['yks-mailchimp-unique-id'].'-'.$num] = $fd['custom-field-class-'.$fd['yks-mailchimp-unique-id'].'-'.$num];
1015
-
1016
-
1017
- $num++;
1018
-
1019
- $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['fields'][$k]['yks_mailchimp_redirect_'.$fd['yks-mailchimp-unique-id']] = (isset($fd['yks_mailchimp_redirect_'.$fd['yks-mailchimp-unique-id']]) ? '1' : '');
1020
-
1021
- if(isset($fd['yks_mailchimp_redirect_'.$fd['yks-mailchimp-unique-id']])) {
1022
- $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['fields'][$k]['page_id_'.$fd['yks-mailchimp-unique-id']] = $fd['page_id_'.$fd['yks-mailchimp-unique-id']];
1023
- }
1024
-
1025
- // custom style setting
1026
- // $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['fields'][$k]['yks_mailchimp_custom_styles_'.$fd['yks-mailchimp-unique-id']] = (isset($fd['yks_mailchimp_custom_styles_'.$fd['yks-mailchimp-unique-id']]) ? '1' : '');
1027
- $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['active'] = (isset($fd['yks_mailchimp_custom_styles_'.$fd['yks-mailchimp-unique-id']]) ? '1' : '0');
1028
-
1029
- $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_template']['active'] = (isset($fd['yks_mailchimp_custom_template_'.$fd['yks-mailchimp-unique-id']]) ? '1' : '0');
1030
-
1031
- }
1032
-
1033
- // save the selected form template, if custom template was set
1034
- if ( $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_template']['active'] == 1 ) {
1035
- $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_template']['template_file'] = $fd['yks-mc-template-file-selection'];
1036
- }
1037
-
1038
- // save the color styles
1039
- if ( $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['active'] == 1 ) {
1040
- // save the custom styles colors here!
1041
- $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_submit_button_color'] = $fd['yks-mc-submit-button-color'];
1042
- $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_submit_button_text_color'] = $fd['yks-mc-submit-button-text-color'];
1043
- $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_form_background_color'] = $fd['yks-mc-background-color'];
1044
- $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_form_text_color'] = $fd['yks-mc-text-color'];
1045
-
1046
- // if the form width is left blank,
1047
- // we'll just set it to 100%
1048
- if ( $fd['yks-mc-form-width'] != '' ) {
1049
- $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_form_width'] = $fd['yks-mc-form-width'];
1050
- } else {
1051
- $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_form_width'] = '100%';
1052
- }
1053
-
1054
- $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_form_alignment'] = $fd['yks-mc-form-alignment'];
1055
-
1056
- $padding_matches = array();
1057
- $matching_array = array( 'px' , 'em' , 'rem' , '%' );
1058
-
1059
- if ( preg_match( '/([0-9.]+)([^0-9]+)/', $fd['yks-mc-form-padding'], $padding_matches ) ) {
1060
- // $padding_explosion = preg_split( '/[a-zA-Z]/' , $fd['yks-mc-form-padding'] );
1061
- $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_form_padding'] = $padding_matches[1];
1062
- if ( in_array( $padding_matches[2] , $matching_array ) ) {
1063
- $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_form_padding_measurement'] = $padding_matches[2];
1064
- } else {
1065
- $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_form_padding_measurement'] = 'px';
1066
- }
1067
- } else {
1068
- if ( trim( $fd['yks-mc-form-padding'] ) != '' ) {
1069
- $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_form_padding'] = $fd['yks-mc-form-padding'];
1070
- } else {
1071
- $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_form_padding'] = '0';
1072
- }
1073
- $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_form_padding_measurement'] = 'px';
1074
- }
1075
-
1076
- }
1077
- return update_option(YKSEME_OPTION, $this->optionVal);
1078
- }
1079
- }
1080
- return false;
1081
- }
1082
- // Remove a list from the lists page
1083
- // Runs when a user clicks 'delete list' on the lists page
1084
- public function deleteList($i=false)
1085
- {
1086
- if($i == false) return false;
1087
- else
1088
- {
1089
- unset($this->optionVal['lists'][$i]);
1090
- update_option('imported_lists', $this->optionVal['lists']);
1091
- return update_option(YKSEME_OPTION, $this->optionVal);
1092
- }
1093
- }
1094
- // Import a list to the lists page
1095
- // Runs when a user adds a list from the drop down on the lists page
1096
- public function importList($i=false)
1097
- {
1098
- if($i == false) return false;
1099
- else
1100
- {
1101
- // create our variables
1102
- $lid = $this->optionVal['lists'][$i]['list-id'];
1103
- $name = $this->optionVal['lists'][$i]['name'];
1104
- $api = new wpyksMCAPI($this->optionVal['api-key']);
1105
- $mv = $api->call('lists/merge-vars', array(
1106
- 'id' => array( $lid )
1107
- )
1108
- );
1109
- // if merge variables are returned
1110
- $mv = $this->getImportedFieldsArray($lid, $mv);
1111
- if($mv)
1112
- {
1113
- // Save the new list
1114
- $this->optionVal['lists'][$i]['fields'] = $mv;
1115
- if(update_option(YKSEME_OPTION, $this->optionVal))
1116
- {
1117
- return $this->generateListContainers(array($this->optionVal['lists'][$i]));
1118
- }
1119
- }
1120
-
1121
- }
1122
- return false;
1123
- }
1124
-
1125
- // reImport a list to the lists page
1126
- // Runs when a user adds a list from the drop down on the lists page
1127
- public function reImportMergeVariables($i=false)
1128
- // evan herman here
1129
- {
1130
- if($i == false) return false;
1131
- else
1132
- {
1133
- // create our variables
1134
- $lid = $this->optionVal['lists'][$i]['list-id'];
1135
- $name = $this->optionVal['lists'][$i]['name'];
1136
- $api = new wpyksMCAPI($this->optionVal['api-key']);
1137
- $mv = $api->call('lists/merge-vars', array(
1138
- 'id' => array( $lid )
1139
- )
1140
- );
1141
- // if merge variables are returned
1142
- $mv = $this->getImportedFieldsArray($lid, $mv);
1143
- if($mv)
1144
- {
1145
- // Save the new list
1146
- $this->optionVal['lists'][$i]['fields'] = $mv;
1147
- // update the list with the new fields
1148
- if(update_option(YKSEME_OPTION, $this->optionVal))
1149
- {
1150
- return $this->generateMergeVariableContainers(array($this->optionVal['lists'][$i]));
1151
- }
1152
- }
1153
-
1154
- }
1155
- return false;
1156
- }
1157
-
1158
- // Make a call to the MailChimp API to retrieve all subscribers to a given list
1159
- // Runs when the user clicks 'view' next to the subscriber count on the list page
1160
- public function listAllSubscribers($lid, $list_name) {
1161
- $api = new wpyksMCAPI($this->optionVal['api-key']);
1162
- $subscribers_list = $api->call('lists/members',
1163
- array(
1164
- 'id' => $lid,
1165
- 'opts' => array(
1166
- 'limit' => '100',
1167
- 'sort_field' => 'optin_time',
1168
- 'sort_dir' => 'DESC'
1169
- )
1170
- )
1171
- );
1172
- // if the subscriber count is greater than 0
1173
- // display all subscribers in a table
1174
- if($subscribers_list['total'] > 0) {
1175
- ?>
1176
- <h2><?php echo $list_name; echo ' <span class="subscriber-count" style="font-size:11px;">(<span class="number">'.$subscribers_list['total'].'</span> '.__(" subscribers" , "yikes-inc-easy-mailchimp-extender").')</span>'; ?></h2>
1177
- <p><?php _e( 'Click on a subscriber to see further information' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
1178
-
1179
- <table id="yikes-mailchimp-subscribers-table" class="yks-mailchimp-fields-list" style="width:100%;">
1180
- <thead class="yikes-mailchimp-subscribers-table-head">
1181
- <tr>
1182
- <th width="50%"><?php _e( 'E-Mail' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
1183
- <th width="50%"><?php _e( 'Date Subscribed' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
1184
- </tr>
1185
- </thead>
1186
- <?php
1187
- foreach ( $subscribers_list['data'] as $subscriber ) {
1188
- $timeStamp = explode(' ', $subscriber['timestamp_opt'] );
1189
- echo '<tr class="yks-mailchimp-subscribers-list-row" id="yks-mailchimp-subscribers-list-row">';
1190
- echo '<td><a class="subscriber-mail-link" rel="'.$subscriber["email"].'" class="subscriberEmailAddress">'.$subscriber['email'].'</a></td>';
1191
- // echo '<td>'.str_replace('-', ' ', date("M-jS-Y", strtotime($subscriber['timestamp_opt']))).'</td>';
1192
- echo '<td>'.str_replace('-', ' ', date("M-jS-Y", strtotime($timeStamp[0]))).'</td></tr>';
1193
- }
1194
- ?>
1195
- </table>
1196
-
1197
- <!-- display a single user profile in this div -->
1198
- <div id="individual_subscriber_information" style="display:none;"></div>
1199
- <?php
1200
- } else { // else display an error of sorts
1201
- ?>
1202
- <h2><?php echo $list_name; echo ' <span class="subscriber-count" style="font-size:11px;">(<span class="number">0</span> '.__(" subscribers" , "yikes-inc-easy-mailchimp-extender").')</span>'; ?></h2>
1203
- <?php
1204
- _e( "Sorry You Don't Currently Have Any Subscribers In This List!" , "yikes-inc-easy-mailchimp-extender" );
1205
- }
1206
- wp_die();
1207
- }
1208
-
1209
- // Make a call to the MailChimp API to retrieve information about a specific user
1210
- // Runs when the user clicks a subscribers email address
1211
- public function getSubscriberInfo($lid, $email) {
1212
- $api = new wpyksMCAPI($this->optionVal['api-key']);
1213
- $subscriber_info = $api->call('lists/member-info',
1214
- array(
1215
- 'id' => $lid,
1216
- 'emails' => array(
1217
- 0 => array(
1218
- 'email' => $email,
1219
- ),
1220
- )
1221
- )
1222
- );
1223
- // if the subscriber count is greater than 0
1224
- // display all subscribers in a table
1225
- if($subscriber_info) {
1226
- // store user data into variables
1227
- $subscriber_data = $subscriber_info['data'][0];
1228
- $member_rating = $subscriber_data['member_rating'];
1229
- // firstname/lastname data inside of new array
1230
- $subscriber_data_merges = $subscriber_data['merges'];
1231
- // seperate date+time
1232
- $subscriber_data_info_changed = explode(' ' , $subscriber_data['info_changed']);
1233
- $subscriber_data_timestamp_opt = explode (' ', $subscriber_data['timestamp_opt']);
1234
- // store date+time in seperate variables
1235
- $subscriber_data_info_changed_date = $subscriber_data_info_changed[0];
1236
- $subscriber_data_info_changed_time = $subscriber_data_info_changed[1];
1237
- // store optin-time+date in seperate variables
1238
- $subscriber_data_info_optin_date = $subscriber_data_timestamp_opt[0];
1239
- $subscriber_data_info_optin_time = $subscriber_data_timestamp_opt[1];
1240
-
1241
- // create our language variable dependent on what is set in MailChimp
1242
- include_once('set_language.php');
1243
-
1244
- // create star rating variable, based on returned member_rating value
1245
- if(isset($member_rating)) {
1246
- if ($member_rating == 1) {
1247
- $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
1248
- } else if ($member_rating == 2) {
1249
- $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
1250
- } else if ($member_rating == 3) {
1251
- $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
1252
- } else if ($member_rating == 4) {
1253
- $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
1254
- } else if ($member_rating == 5) {
1255
- $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span></div>';
1256
- }
1257
- }
1258
- ?>
1259
-
1260
- <div class="yks-mc-subscriber-top">
1261
- <span class="button-primary dashicons dashicons-arrow-left-alt2 yks-mc-subscriber-go-back"><?php _e( 'Back to Subscriber List' , 'yikes-inc-easy-mailchimp-extender' ); ?></span>
1262
- <h2 class="yks-mc-subscriber-header"><?php _e( 'Subscriber Details' , 'yikes-inc-easy-mailchimp-extender' ); ?> </h2>
1263
- <!-- display users email address -->
1264
- <h3 id="yks-subscriber-info-email-address"><?php echo $subscriber_data['email']; ?></h3>
1265
- <!-- display member star rating pulled from MailChimp -->
1266
- <?php echo $member_rating_stars; ?>
1267
- <!-- user optin time and date -->
1268
- <span class="yks-subscriber-info-optin-data">
1269
- <?php echo 'Subscribed on : '.date('m/d/Y',strtotime($subscriber_data_info_optin_date)); ?><?php echo ' at '.date('g:i A',strtotime($subscriber_data_info_optin_time)); ?>
1270
- </span>
1271
- </div>
1272
-
1273
- <h2 class="yks-mc-subscriber-header"><?php _e( 'Overview' , 'yikes-inc-easy-mailchimp-extender' ); ?></h2>
1274
- <div class="yks-mc-subscriber-overview">
1275
-
1276
- <div class="yks-mc-subscriber-left-container">
1277
-
1278
- <label class="yks-mc-overview-title"><?php _e( 'First Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></label>
1279
- <p class="yks-mc-overview-info-value yks-mc-subscriber-firstName"><?php if(!empty($subscriber_data_merges['FNAME'])) { echo $subscriber_data_merges['FNAME']; } else { echo 'not provided'; } ?></p>
1280
-
1281
- <label class="yks-mc-overview-title"><?php _e( 'Last Updated' , 'yikes-inc-easy-mailchimp-extender' ); ?></label>
1282
- <p class="yks-mc-overview-info-value"><?php echo date('m/d/Y',strtotime($subscriber_data_info_changed_date)); ?><?php echo ' at '.date('g:i A',strtotime($subscriber_data_info_changed_time)); ?></p>
1283
-
1284
- <label class="yks-mc-overview-title"><?php _e( 'Preferred Email Type' , 'yikes-inc-easy-mailchimp-extender' ); ?></label>
1285
- <p class="yks-mc-overview-info-value"><?php if(!empty($subscriber_data['email_type'])) { echo $subscriber_data['email_type']; } else { echo 'No Preference.'; } ?></p>
1286
-
1287
- </div>
1288
-
1289
- <div class="yks-mc-subscriber-right-container">
1290
-
1291
- <label class="yks-mc-overview-title"><?php _e( 'Last Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></label>
1292
- <p class="yks-mc-overview-info-value yks-mc-subscriber-lastName"><?php if(!empty($subscriber_data_merges['LNAME'])) { echo $subscriber_data_merges['LNAME']; } else { echo 'not provided'; } ?></p>
1293
-
1294
- <label class="yks-mc-overview-title"><?php _e( 'Language' , 'yikes-inc-easy-mailchimp-extender' ); ?></label>
1295
- <p class="yks-mc-overview-info-value"><?php echo $subscriber_data_language; ?></p>
1296
-
1297
- </div>
1298
-
1299
-
1300
- </div>
1301
-
1302
-
1303
- <?php
1304
- // build our segment array to determine if the user is subscribed to any segments
1305
- $segment_count = array();
1306
- // check if groupings data is set (for segment and interest groups)
1307
- // this avoids an error being thrown when no segment/interest groups have been selected
1308
- if ( isset( $subscriber_data_merges['GROUPINGS'] ) ) {
1309
- foreach ($subscriber_data_merges['GROUPINGS'] as $group1) {
1310
- foreach ($group1['groups'] as $group2) {
1311
- if ($group2['interested'] == 1) {
1312
- array_push($segment_count, $group2['name']);
1313
- }
1314
- }
1315
- }
1316
- }
1317
- // test $segment_count array
1318
- // print_r($segment_count);
1319
- ?>
1320
- <!-- returns true always, groupings gets stored, but segments do not // need to check if there are any segments stored in the groupings array -->
1321
- <h2 class="yks-mc-subscriber-header"><?php _e( 'Groups Subscribed To' , 'yikes-inc-easy-mailchimp-extender' ); ?></h2>
1322
- <!-- display what groups/segments the subscriber is subscribed too -->
1323
- <?php
1324
-
1325
- // if the user is subscribed to some segment
1326
- if(!empty($segment_count)) {
1327
-
1328
- $groups_array = array(
1329
- 'group_name' => '',
1330
- 'segments' => array()
1331
- );
1332
-
1333
- $num = 0;
1334
- foreach ($subscriber_data_merges['GROUPINGS'] as $group_name) {
1335
- $groups_array[$num]['group_name'] = $group_name['name'];
1336
- foreach ($group_name['groups'] as $groupData ) {
1337
- if ($groupData['interested'] == 1) {
1338
- $groups_array[$num]['segments'] = $groupData['name'];
1339
- }
1340
- }
1341
- $num++;
1342
- }
1343
-
1344
- // build up the segments array that the user is subscribed too
1345
- foreach ( $groups_array as $group_data ) {
1346
- if(!empty($group_data['segments'])) {
1347
- ?>
1348
- <ul>
1349
- <?php
1350
- echo '<li style="font-size:16px; color:#333;">'.$group_data['group_name'].'</li>';
1351
- if(!empty($group_data['group_name']) && isset($group_data['segments'])) {
1352
- echo 'Segments : '; echo implode(' ,', array($group_data['segments']));
1353
- } elseif (count($group_data['segments']) == 0) {
1354
- echo 'n/a';
1355
- }
1356
- ?>
1357
- </ul>
1358
- <?php
1359
- }
1360
- }
1361
-
1362
- } else {
1363
- // if there are no segments subscribed too
1364
- // just print a message none specified
1365
- echo 'none specified';
1366
- }
1367
-
1368
- // display the notes associated with a user if there are any returned
1369
- if(!empty($subscriber_data['notes'])) { ?>
1370
- <div class="yks-mc-subscriber-bottom">
1371
- <h2 class="yks-mc-subscriber-header"><?php _e( 'Subscriber Notes' , 'yikes-inc-easy-mailchimp-extender' ); ?></h2>
1372
- <?php
1373
- foreach ( $subscriber_data['notes'] as $note ) {
1374
- ?>
1375
- <textarea style="width:100%; height:100px; resize:none;" id="yks-mc-subscriber-notes" disabled><?php echo $note['note']; ?></textarea>
1376
- <span style="font-size:11px; opacity:.75;"><?php _e( 'Written by' , 'yikes-inc-easy-mailchimp-extender' ); ?>: <?php echo $note['created_by_name']; ?> // <?php _e( 'Created on' , 'yikes-inc-easy-mailchimp-extender' ); ?>: <?php echo date('m/d/Y',strtotime($note['created'])); ?></span>
1377
- <?php
1378
- }
1379
- ?>
1380
- </div>
1381
- <?php } ?>
1382
-
1383
- <!-- <h2>Var Dump</h2> -->
1384
- <?php /* print_r($subscriber_info); // testing the returned subscriber info data */
1385
-
1386
- }
1387
- wp_die();
1388
- }
1389
-
1390
- // Make a call to the MailChimp API to remove a specified user from a given list
1391
- // Runs when the user clicks the 'X' next to a subscriber when viewing all subscribers on the lists page
1392
- public function yks_removeSubscriber($lid, $user_email) {
1393
- $api = new wpyksMCAPI($this->optionVal['api-key']);
1394
- $subscribers_list = $api->call('lists/unsubscribe', array(
1395
- 'id' => $lid,
1396
- 'email' => array(
1397
- 'email' => $user_email
1398
- )
1399
- ));
1400
- }
1401
-
1402
- /***** SCRIPTS/STYLES
1403
- ****************************************************************************************************/
1404
- public function addStyles()
1405
- {
1406
-
1407
- $screen_base = get_current_screen()->base;
1408
- if ( $screen_base == __( 'toplevel_page_yks-mailchimp-form' , 'yikes-inc-easy-mailchimp-extender' ) || $screen_base == __( 'mailchimp-forms_page_yks-mailchimp-my-mailchimp', 'yikes-inc-easy-mailchimp-extender' )
1409
- || $screen_base == __( 'mailchimp-forms_page_yks-mailchimp-form-lists', 'yikes-inc-easy-mailchimp-extender' ) || $screen_base == 'widgets' || $screen_base == 'post' || $screen_base == __( 'mailchimp-forms_page_yks-mailchimp-about-yikes' , 'yikes-inc-easy-mailchimp-extender' ) ) {
1410
- // Register Styles
1411
- wp_register_style('ykseme-css-base', YKSEME_URL.'css/style.ykseme.css', array(), '1.0.0', 'all');
1412
- wp_register_style('jquery-datatables-pagination', YKSEME_URL.'css/jquery.dataTables.css', array(), '1.0.0', 'all');
1413
- // Enqueue Styles
1414
- wp_enqueue_style('thickbox');
1415
- wp_enqueue_style('ykseme-css-base');
1416
- wp_enqueue_style('jquery-datatables-pagination');
1417
- // just load the animate.css class on all admin pages
1418
- wp_register_style('ykseme-animate-css', YKSEME_URL.'css/animate.css', array(), '1.0.0', 'all');
1419
- wp_enqueue_style('ykseme-animate-css');
1420
- }
1421
-
1422
-
1423
-
1424
- if ( $screen_base == 'admin_page_yks-mailchimp-welcome' || $screen_base == 'mailchimp-forms_page_yks-mailchimp-form-lists' ) {
1425
- wp_enqueue_style('bootstrap-css', '//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css' );
1426
- wp_enqueue_style( 'wp-color-picker' );
1427
- }
1428
-
1429
- }
1430
-
1431
- public function addStyles_frontend()
1432
- {
1433
- // Register Styles
1434
- wp_register_style('ykseme-css-base', YKSEME_URL.'css/style.ykseme.css', array(), '1.0.0', 'all');
1435
- // enqueue our jQuery UI styles only when
1436
- // the datepicker enqueue is enabled in the settings field
1437
- if( isset( $this->optionVal['yks-mailchimp-jquery-datepicker'] ) && $this->optionVal['yks-mailchimp-jquery-datepicker'] == '1' ) {
1438
- wp_register_style('ykseme-css-smoothness', '//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css', array(), '1.0.0', 'all');
1439
- }
1440
- wp_register_style('ykseme-animate-css', YKSEME_URL.'css/animate.css', array(), '1.0.0', 'all');
1441
- // Enqueue Styles
1442
- wp_enqueue_style('ykseme-css-base');
1443
- wp_enqueue_style('ykseme-css-smoothness');
1444
- wp_enqueue_style('ykseme-animate-css');
1445
- }
1446
-
1447
-
1448
- public function addScripts()
1449
- {
1450
-
1451
- $screen_base = get_current_screen()->base;
1452
- if ( $screen_base == __( 'toplevel_page_yks-mailchimp-form', 'yikes-inc-easy-mailchimp-extender' ) || $screen_base == __( 'mailchimp-forms_page_yks-mailchimp-my-mailchimp' , 'yikes-inc-easy-mailchimp-extender' ) ) {
1453
- // Everything else
1454
- // load our scripts in the dashboard
1455
- wp_enqueue_script('jquery-ui-core');
1456
- wp_enqueue_script('thickbox');
1457
-
1458
- wp_enqueue_script('jquery-ui-sortable');
1459
- wp_enqueue_script('jquery-ui-tabs');
1460
- wp_enqueue_script('ykseme-base', YKSEME_URL.'js/script.ykseme.js', array('jquery'));
1461
- wp_enqueue_script('jquery-datatables-pagination', YKSEME_URL.'js/jquery.dataTables.js', array('jquery'));
1462
- wp_enqueue_script('jquery-highcharts-js', YKSEME_URL.'js/highcharts.js', array('jquery'));
1463
- wp_enqueue_script('jquery-highcharts-exporting-js', YKSEME_URL.'js/exporting.js', array('jquery'));
1464
- wp_enqueue_script('jquery-highcharts-3d-js', YKSEME_URL.'js/highcharts-3d.js', array('jquery'));
1465
-
1466
- wp_enqueue_script('jquery-highmaps-js', YKSEME_URL.'js/map.js', array('jquery'));
1467
- wp_enqueue_script('jquery-map-data-js', 'http://code.highcharts.com/mapdata/custom/world.js', array('jquery'));
1468
- wp_enqueue_script('jquery-highmaps-data-js', YKSEME_URL.'js/data.js', array('jquery'));
1469
- } else if ( $screen_base == 'admin_page_yks-mailchimp-welcome' ) {
1470
- wp_enqueue_script('bootstrap-js', '//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js', array('jquery')) ;
1471
- } else if ( $screen_base == 'mailchimp-forms_page_yks-mailchimp-form-lists' ) {
1472
- wp_enqueue_script( 'wp-color-picker' );
1473
- wp_enqueue_script('bootstrap-js', '//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js', array('jquery')) ;
1474
- wp_enqueue_script('jquery-ui-core');
1475
- wp_enqueue_script('thickbox');
1476
-
1477
- wp_enqueue_script('jquery-ui-sortable');
1478
- wp_enqueue_script('jquery-ui-tabs');
1479
- wp_enqueue_script('ykseme-base', YKSEME_URL.'js/script.ykseme.js', array('jquery'));
1480
- wp_enqueue_script('jquery-datatables-pagination', YKSEME_URL.'js/jquery.dataTables.js', array('jquery'));
1481
- wp_enqueue_script('jquery-highcharts-js', YKSEME_URL.'js/highcharts.js', array('jquery'));
1482
- wp_enqueue_script('jquery-highcharts-exporting-js', YKSEME_URL.'js/exporting.js', array('jquery'));
1483
- wp_enqueue_script('jquery-highcharts-3d-js', YKSEME_URL.'js/highcharts-3d.js', array('jquery'));
1484
-
1485
- wp_enqueue_script('jquery-highmaps-js', YKSEME_URL.'js/map.js', array('jquery'));
1486
- wp_enqueue_script('jquery-map-data-js', 'http://code.highcharts.com/mapdata/custom/world.js', array('jquery'));
1487
- wp_enqueue_script('jquery-highmaps-data-js', YKSEME_URL.'js/data.js', array('jquery'));
1488
- } else {
1489
- return;
1490
- }
1491
-
1492
- }
1493
-
1494
- // redirect the user to the settings page on initial activation
1495
- function yks_easy_mc_plugin_activation_redirect() {
1496
- if (get_option('yks_easy_mc_plugin_do_activation_redirect', false)) {
1497
- delete_option('yks_easy_mc_plugin_do_activation_redirect');
1498
- // redirect to settings page
1499
- wp_redirect(admin_url('/admin.php?page=yks-mailchimp-welcome'));
1500
- }
1501
- }
1502
-
1503
- public function addScripts_frontend()
1504
- {
1505
- /* - we shouldn't be enqueueing our own version of jQuery
1506
- - it's just irresponsible! :o
1507
-
1508
- global $wp_scripts;
1509
-
1510
- $version ='1.9.0';
1511
- // compare the registered version of jQuery with 1.9.0
1512
- if ( ( version_compare( @$wp_scripts->registered['jquery']->ver, $version ) >= 0 ) && !is_admin() )
1513
- {
1514
- wp_enqueue_script( 'jquery' );
1515
- }
1516
- else
1517
- {
1518
- if ( !is_admin() && !$this->is_login_page() ) {
1519
- // if its older, or non-existent, load the newest version from google CDN
1520
- wp_deregister_script('jquery');
1521
- wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/'.$version.'/jquery.min.js', false, $version );
1522
- wp_enqueue_script( 'jquery' );
1523
- }
1524
- }
1525
- */
1526
- // Everything else
1527
- // wp_enqueue_script('jquery-ui-core');
1528
-
1529
- // enqueue jQuery datepicker only when the user has specified to do so
1530
- if( isset( $this->optionVal['yks-mailchimp-jquery-datepicker'] ) && $this->optionVal['yks-mailchimp-jquery-datepicker'] == '1' ) {
1531
- wp_enqueue_script('jquery-ui-datepicker');
1532
- }
1533
-
1534
- }
1535
-
1536
-
1537
- /***** SHORTCODES
1538
- ****************************************************************************************************/
1539
- // Function to process the shortcode provided by the plugin
1540
- // $p is the data associated with the shortcode (ie: form id and submit button text)
1541
- public function processShortcode($p)
1542
- {
1543
- ob_start();
1544
- // check if the list is set, to prevent errors from being thrown
1545
- if ( isset( $this->optionVal['lists'][$p['id']] ) ) {
1546
-
1547
- if( $this->optionVal['api-key'] != '' && ( is_array( $this->optionVal['lists'][$p['id']] ) && !empty( $this->optionVal['lists'][$p['id']] ) ) ) {
1548
- // Setup this list
1549
- $list = $this->optionVal['lists'][$p['id']];
1550
- $submit_text = $p['submit_text'];
1551
- // Which form are we on?
1552
- if(!isset($this->currentLists[$p['id']]))
1553
- $this->currentLists[$p['id']] = 0;
1554
- else
1555
- $this->currentLists[$p['id']]++;
1556
- $listCt = $this->currentLists[$p['id']];
1557
- // Add the count to the list vars
1558
- $list['id'] = $listCt.'-'.$list['id'];
1559
- if(count($list['fields']))
1560
- {
1561
- foreach($list['fields'] as $fieldId => $field)
1562
- {
1563
- $list['fields'][$fieldId]['id'] = $listCt.'-'.$field['id'];
1564
- }
1565
- }
1566
-
1567
- // List form
1568
- include YKSEME_PATH.'templates/shortcode_form.php';
1569
- }
1570
-
1571
- // if there is no api key entered, or it's an invalid api key
1572
- } else if ( $this->optionVal['api-key'] == '' || get_option( 'api_validation' ) == 'invalid_api_key' ) {
1573
- include YKSEME_PATH.'templates/shortcode_error_no_API_key.php';
1574
- // else if the form was removed from the lists page
1575
- } else {
1576
- include YKSEME_PATH.'templates/shortcode_error_data.php';
1577
- }
1578
- $shortcode = ob_get_contents();
1579
- ob_end_clean();
1580
- return $shortcode;
1581
- }
1582
-
1583
- /* New Function to Display Subscriber Count for a given list */
1584
- public function displaySubscriberCount($p)
1585
- {
1586
- ob_start();
1587
- if($this->optionVal['api-key'] != ''
1588
- && (is_array($this->optionVal['lists'][$p['id']]) && !empty($this->optionVal['lists'][$p['id']])))
1589
- {
1590
- // Setup this list
1591
- $list = $this->optionVal['lists'][$p['id']];
1592
- $mailChimp = new yksemeBase();
1593
- $list = $mailChimp->getListsData();
1594
- $list_id = key($list);
1595
- // echo '<h4>Join <strong>' . $list['subscriber-count']['subscriber-count-'.$list_id] . '</strong> others, and sign up for our mailing list!</h4>';
1596
- // return just the subscriber count so the user can easily customize it!
1597
- echo $list['subscriber-count']['subscriber-count-'.$list_id];
1598
- }
1599
- // if there is no api key entered, or it's an invalid api key
1600
- else if ( $this->optionVal['api-key'] == '' || get_option( 'api_validation' ) == 'invalid_api_key' )
1601
- {
1602
- include YKSEME_PATH.'templates/shortcode_error_no_API_key.php';
1603
- // else if the form was removed from the lists page
1604
- } else {
1605
- include YKSEME_PATH.'templates/shortcode_error_data.php';
1606
- }
1607
- $shortcode = ob_get_contents();
1608
- ob_end_clean();
1609
- return $shortcode;
1610
- }
1611
- // Function to process the PHP snippet provided by the plugin
1612
- // Again the data passed in, is the shortcode/php snippet paramaters (form id, submit button text)
1613
- public function processSnippet($list=false, $submit_text)
1614
- {
1615
- $p = array(
1616
- 'id' => $list,
1617
- 'submit_text' => $submit_text
1618
- );
1619
- return $this->processShortcode($p);
1620
- }
1621
-
1622
-
1623
- /***** ADMINISTRATION MENUS
1624
- ****************************************************************************************************/
1625
- public function addAdministrationMenu()
1626
- {
1627
- // Top Level Menu
1628
- add_menu_page( __('MailChimp Forms','yikes-inc-easy-mailchimp-extender'), 'MailChimp Forms', 'manage_options', 'yks-mailchimp-form', array(&$this, 'generatePageOptions'), 'dashicons-welcome-write-blog', 400);
1629
- // Sub Items
1630
- add_submenu_page('yks-mailchimp-form', __('MailChimp Forms','yikes-inc-easy-mailchimp-extender'), __('MailChimp Settings','yikes-inc-easy-mailchimp-extender'), 'manage_options', 'yks-mailchimp-form', array(&$this, 'generatePageOptions'));
1631
- // if the user has entered a VALID API key
1632
- if ( get_option('api_validation') == 'valid_api_key') {
1633
- add_submenu_page('yks-mailchimp-form', __('My MailChimp','yikes-inc-easy-mailchimp-extender'), __('My MailChimp','yikes-inc-easy-mailchimp-extender'), 'manage_options', 'yks-mailchimp-my-mailchimp', array(&$this, 'generateUserMailChimpPage'));
1634
- }
1635
- add_submenu_page('yks-mailchimp-form', __('Manage List Forms','yikes-inc-easy-mailchimp-extender'), __('Manage List Forms','yikes-inc-easy-mailchimp-extender'), 'manage_options', 'yks-mailchimp-form-lists', array(&$this, 'generatePageLists'));
1636
- add_submenu_page('yks-mailchimp-form', __('About YIKES, Inc.','yikes-inc-easy-mailchimp-extender'), __('About YIKES, Inc.','yikes-inc-easy-mailchimp-extender'), 'manage_options', 'yks-mailchimp-about-yikes', array(&$this, 'generatePageAboutYikes'));
1637
- add_submenu_page('options.php', __('Welcome','yikes-inc-easy-mailchimp-extender'), __('Welcome','yikes-inc-easy-mailchimp-extender'), 'manage_options', 'yks-mailchimp-welcome', array(&$this, 'generateWelcomePage'));
1638
- }
1639
-
1640
-
1641
- /***** ADMINISTRATION PAGES
1642
- ****************************************************************************************************/
1643
- public function generatePageOptions()
1644
- {
1645
- require_once YKSEME_PATH.'pages/options.php'; // include our options page
1646
- }
1647
- public function generatePageLists()
1648
- {
1649
- require_once YKSEME_PATH.'pages/lists.php'; // include our lists page
1650
- }
1651
- public function generatePageAboutYikes()
1652
- {
1653
- require_once YKSEME_PATH.'pages/about.php'; // include our about page
1654
- }
1655
- public function registerMailChimpWidget()
1656
- {
1657
- require_once YKSEME_PATH.'templates/yikes-mailchimp-widget.php'; // include our widget
1658
- }
1659
- public function includeRECAPTCHAlib()
1660
- {
1661
- require_once YKSEME_PATH.'lib/recaptchalib.php'; // include our widget
1662
- }
1663
- public function generateUserMailChimpPage()
1664
- {
1665
- require_once YKSEME_PATH.'pages/myMailChimp.php'; // include our widget
1666
- }
1667
- public function generateWelcomePage()
1668
- {
1669
- require_once YKSEME_PATH.'pages/welcome.php'; // include our widget
1670
- }
1671
-
1672
- /***** FORM DATA
1673
- ****************************************************************************************************/
1674
- public function yks_resetPluginSettings() {
1675
- $blog_title = get_bloginfo( 'name' );
1676
- // reset the plugin settings back to defaults
1677
- $this->optionVal['api-key'] = '';
1678
- $this->optionVal['flavor'] = '1';
1679
- $this->optionVal['debug'] = '0';
1680
- $this->optionVal['optin'] = 'true';
1681
- $this->optionVal['single-optin-message'] = __('Thank You for subscribing!', 'yikes-inc-easy-mailchimp-extender');
1682
- $this->optionVal['double-optin-message'] = __('Thank You for subscribing! Check your email for the confirmation message.', 'yikes-inc-easy-mailchimp-extender');
1683
- $this->optionVal['interest-group-label'] = '';
1684
- $this->optionVal['optIn-checkbox'] = 'hide';
1685
- $this->optionVal['yks-mailchimp-optIn-default-list'] = 'select_list';
1686
- $this->optionVal['yks-mailchimp-optin-checkbox-text'] = 'Add me to the ' . $blog_title . ' mailing list';
1687
- $this->optionVal['recaptcha-setting'] = '0';
1688
- $this->optionVal['recaptcha-api-key'] = '';
1689
- $this->optionVal['recaptcha-private-api-key'] = '';
1690
- $this->optionVal['recaptcha-style'] = 'default';
1691
- $this->optionVal['yks-mailchimp-jquery-datepicker'] = '';
1692
- $this->optionVal['version'] = YKSEME_VERSION_CURRENT;
1693
- update_option('api_validation' , 'invalid_api_key');
1694
- // we need to unset the previously set up widgets
1695
- // and set up new erros if the API key doesn't exist
1696
-
1697
- // 1 - empty the lists array of imported lists
1698
- $this->optionVal['lists'] = array();
1699
- // 2 - unset our previously set up widgets
1700
- update_option( 'widget_yikes_mc_widget' , '' );
1701
-
1702
- return update_option(YKSEME_OPTION, $this->optionVal);
1703
-
1704
- }
1705
-
1706
- // Make a call to MailChimp API to validate the provided API key
1707
- // calls the helper/ping method, and returns true or false
1708
- public function validateAPIkeySettings()
1709
- {
1710
-
1711
- // figure out a better way to detect a
1712
- // base_64 encoded password
1713
- // right now we just check the length of the API key being passed in
1714
- // mailchimp api keys are around 30-40 characters
1715
- // we check if the string length is greater than 45...
1716
- if ( strlen($_POST['api_key']) > 45 ) {
1717
- // Create and store our variables to pass to MailChimp
1718
- $apiKey = $this->yikes_mc_decryptIt($_POST['api_key']); // api key
1719
- $apiKey_explosion = explode( "-" , $apiKey);
1720
- $dataCenter = $apiKey_explosion[0]; // data center (ie: us3)
1721
- $api = new wpyksMCAPI($apiKey);
1722
- // try the call, catch any errors that may be thrown
1723
- try {
1724
- $resp = $api->call('helper/ping', array('apikey' => $apiKey));
1725
- echo $resp['msg'];
1726
- $this->getOptionsLists();
1727
- } catch( Exception $e ) {
1728
- $errorMessage = str_replace('API call to helper/ping failed:', '', $e->getMessage());
1729
- echo $errorMessage;
1730
- // update_option('api_validation', 'invalid_api_key');
1731
- }
1732
- return $apiKey;
1733
- // always die or it will always return 1
1734
- wp_die();
1735
- } else {
1736
- $apiKey = $this->yikes_mc_encryptIt($_POST['api_key']);
1737
- // Create and store our variables to pass to MailChimp
1738
- $decryped_api_key = $this->yikes_mc_decryptIt($apiKey); // api key
1739
- $apiKey_explosion = explode( "-" , $decryped_api_key);
1740
- $dataCenter = $apiKey_explosion[0]; // data center (ie: us3)
1741
- $api = new wpyksMCAPI($decryped_api_key);
1742
- // try the call, catch any errors that may be thrown
1743
- try {
1744
- $resp = $api->call('helper/ping', array('apikey' => $decryped_api_key));
1745
- echo $resp['msg'];
1746
- } catch( Exception $e ) {
1747
- $errorMessage = str_replace('API call to helper/ping failed:', '', $e->getMessage());
1748
- echo $errorMessage;
1749
- // update_option('api_validation', 'invalid_api_key');
1750
- }
1751
- // always die or it will always return 1
1752
- return $apiKey;
1753
- wp_die();
1754
- }
1755
- }
1756
-
1757
-
1758
-
1759
-
1760
- // Make a call to MailChimp API to get the current users PROFILE
1761
- public function getUserProfileDetails()
1762
- {
1763
- // Create and store our variables to pass to MailChimp
1764
- $apiKey = $_POST['api_key']; // api key
1765
- $api = new wpyksMCAPI($apiKey);
1766
- // try the call, catch any errors that may be thrown
1767
- try {
1768
- $profile_response = $api->call('users/profile', array('apikey' => $apiKey));
1769
- include_once YKSEME_PATH.'templates/mailChimp-profile-template.php';
1770
- } catch( Exception $e ) {
1771
- $errorMessage = str_replace('API call to helper/ping failed:', '', $e->getMessage());
1772
- echo $errorMessage;
1773
- }
1774
-
1775
- // try the call, catch any errors that may be thrown
1776
- try {
1777
- $account_details = $api->call('helper/account-details', array('apikey' => $apiKey));
1778
- include_once YKSEME_PATH.'templates/mailChimp-account-overview.php';
1779
- } catch( Exception $e ) {
1780
- $errorMessage = str_replace('API call to helper/ping failed:', '', $e->getMessage());
1781
- echo $errorMessage;
1782
- }
1783
- // always die or it will always return 1
1784
- wp_die();
1785
- }
1786
-
1787
-
1788
-
1789
-
1790
-
1791
- // Make a call to MailChimp API to validate the provided API key
1792
- // calls the helper/chimp-chatter method, and returns Account Activity
1793
- public function getMailChimpChatter()
1794
- {
1795
- // Create and store our variables to pass to MailChimp
1796
- $apiKey = $this->optionVal['api-key']; // api key
1797
- $api = new wpyksMCAPI($apiKey);
1798
- // try the call, catch any errors that may be thrown
1799
- try {
1800
- $resp = $api->call('helper/chimp-chatter', array('apikey' => $apiKey));
1801
- include_once YKSEME_PATH.'templates/mailChimpChatter-template.php';
1802
- } catch( Exception $e ) {
1803
- echo '<strong>'.$e->getMessage().'</strong>';
1804
- }
1805
- // always die or it will always return 1
1806
- wp_die();
1807
- }
1808
-
1809
-
1810
- // Make a call to MailChimp API to validate the provided API key
1811
- // calls the helper/chimp-chatter method, and returns Account Activity
1812
- public function getMailChimpChatterForWidget()
1813
- {
1814
- // Create and store our variables to pass to MailChimp
1815
- $apiKey = $this->optionVal['api-key']; // api key
1816
- $api = new wpyksMCAPI($apiKey);
1817
- // try the call, catch any errors that may be thrown
1818
- try {
1819
- $resp = $api->call('helper/chimp-chatter', array('apikey' => $apiKey));
1820
- include_once YKSEME_PATH.'templates/mailChimpChatter-widget-template.php';
1821
- } catch( Exception $e ) {
1822
- echo '<strong>'.$e->getMessage().'</strong>';
1823
- }
1824
- // always die or it will always return 1
1825
- wp_die();
1826
- }
1827
-
1828
- // Make a call to MailChimp API to
1829
- // the lists/growth history method
1830
- // for statistics
1831
- public function getListGrowthHistory()
1832
- {
1833
- // Create and store our variables to pass to MailChimp
1834
- $apiKey = $_POST['api_key']; // api key
1835
- if ( isset($_POST['list_id']) ) { $listID = $_POST['list_id']; } else { $listID = NULL; }
1836
- $api = new wpyksMCAPI($apiKey);
1837
- // try the call, catch any errors that may be thrown
1838
- try {
1839
- $resp = $api->call('lists/growth-history', array( 'apikey' => $apiKey , 'id' => $listID ));
1840
- // include our Stats Template
1841
- include_once YKSEME_PATH.'templates/mailChimp-list-growth-template.php';
1842
- // Working File
1843
- // date is returned out of order tho...
1844
- // include_once YKSEME_PATH.'templates/mailChimp-list-growth-template.php';
1845
- } catch( Exception $e ) {
1846
- echo '<strong>'.$e->getMessage().'</strong>';
1847
- }
1848
- // always die or it will always return 1
1849
- wp_die();
1850
- }
1851
-
1852
- // Make a call to MailChimp API to
1853
- // get a specified all campaigns or specified list campaign data
1854
- // used for both overall aggregate stats AND single list stats
1855
- public function getCapmpaignData()
1856
- {
1857
- // Create and store our variables to pass to MailChimp
1858
- $apiKey = $_POST['api_key']; // api key
1859
- $api = new wpyksMCAPI($apiKey);
1860
- // try the call, catch any errors that may be thrown
1861
- try {
1862
- $resp = $api->call('campaigns/list', array( 'apikey' => $apiKey , 'limit' => 1000 ));
1863
- // include our Stats Template
1864
- include_once YKSEME_PATH.'templates/mailChimp-campaign-stats-template.php';
1865
- } catch( Exception $e ) {
1866
- echo '<strong>'.$e->getMessage().'</strong>';
1867
- }
1868
- // always die or it will always return 1
1869
- wp_die();
1870
- }
1871
-
1872
- // Make a call to MailChimp API to
1873
- // To get our piechart for the link stats page
1874
- public function getPieChart()
1875
- {
1876
- // Create and store our variables to pass to MailChimp
1877
- $pie_chart_link_data_array = $_POST['pie_chart_data_array']; // link data
1878
- // include our Stats Template
1879
- include YKSEME_PATH.'templates/mailChimp-campaign-clicks-pie-chart.php';
1880
-
1881
- // always die or it will always return 1
1882
- wp_die();
1883
- }
1884
-
1885
- // Make a call to MailChimp API to
1886
- // get a specified all campaigns or specified list campaign data
1887
- // used for both overall aggregate stats AND single list stats
1888
- public function getSpecificCapmpaignData()
1889
- {
1890
- // Create and store our variables to pass to MailChimp
1891
- $apiKey = $_POST['api_key']; // api key
1892
- $api = new wpyksMCAPI($apiKey);
1893
- $campaign_id = $_POST['campaign_id'];
1894
- $campaign_title = $_POST['campaign_title'];
1895
- $campaign_email_subject = $_POST['campaign_subject'];
1896
- $campaign_send_date = $_POST['campaign_send_date'];
1897
- $campaign_send_time = $_POST['campaign_send_time'];
1898
- $campaign_view_email_link = $_POST['campaign_view_email_link'];
1899
- $campaign_web_Id = $_POST['campaign_web_Id'];
1900
- // try the call, catch any errors that may be thrown
1901
- try {
1902
- $resp = $api->call('reports/summary', array( 'apikey' => $apiKey , 'cid' => $campaign_id ));
1903
- // include our Stats Template
1904
- include_once YKSEME_PATH.'templates/mailChimp-campaign-report.php';
1905
- // print_r($resp);
1906
- } catch( Exception $e ) {
1907
- echo '<strong>'.$e->getMessage().'</strong>';
1908
- }
1909
- // always die or it will always return 1
1910
- wp_die();
1911
- }
1912
-
1913
- // Send a call to MailChimp API to get the email recipients of a specific campaign
1914
- public function getCampaignEmailToTable()
1915
- {
1916
- // Create and store our variables to pass to MailChimp
1917
- $apiKey = $_POST['api_key']; // api key
1918
- $api = new wpyksMCAPI($apiKey);
1919
- $campaign_id = $_POST['campaign_id'];
1920
- // try the call, catch any errors that may be thrown
1921
- try {
1922
- $resp = $api->call('reports/sent-to', array( 'apikey' => $apiKey , 'cid' => $campaign_id , 'opts' => array('limit' => '100') ));
1923
- // include our Stats Template
1924
- // include_once YKSEME_PATH.'templates/mailChimp-campaign-report.php';
1925
- // print_r($resp);
1926
- if ( $resp ) {
1927
- ?>
1928
- <script type="text/javascript">
1929
- jQuery(document).ready(function() {
1930
- jQuery('#yikes-mailchimp-emailed-subscribers').dataTable();
1931
- });
1932
- </script>
1933
-
1934
- <style>
1935
- .subscriber_rating_star { font-size:15px; }
1936
- </style>
1937
-
1938
- <table id="yikes-mailchimp-emailed-subscribers" class="yks-mailchimp-fields-list" style="width:100%;">
1939
- <thead class="yikes-mailchimp-subscribers-table-head">
1940
- <tr>
1941
- <th style="width:20%;"><?php _e( 'E-Mail' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
1942
- <th style="width:19%;"><?php _e( 'First Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
1943
- <th style="width:18%;"><?php _e( 'Last Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
1944
- <th style="width:25%;"><?php _e( 'Member Rating' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
1945
- <th style="width:18%;"><?php _e( 'Last Changed' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
1946
- </tr>
1947
- </thead>
1948
- <?php
1949
- foreach ( $resp['data'] as $recipient ) {
1950
-
1951
- // create the name variable, dependant on first and last name being stored
1952
- if ( isset ( $recipient['member']['merges']['FNAME'] ) && $recipient['member']['merges']['FNAME'] != '' ) {
1953
- $user_first_name = $recipient['member']['merges']['FNAME'];
1954
- } else {
1955
- $user_first_name = '';
1956
- }
1957
- if ( isset ( $recipient['member']['merges']['LNAME'] ) && $recipient['member']['merges']['LNAME'] != '' ) {
1958
- $user_last_name = $recipient['member']['merges']['LNAME'];
1959
- } else {
1960
- $user_last_name = '';
1961
- }
1962
-
1963
- $user_email = $recipient['member']['email'];
1964
- $user_id = $recipient['member']['id'];
1965
- $email_type = $recipient['member']['email_type'];
1966
- $user_rating = $recipient['member']['member_rating'];
1967
- $user_last_changed = $recipient['member']['info_changed'];
1968
- $exploded_change = explode( ' ' , $user_last_changed);
1969
- $user_last_changed_date = date( 'm/d/Y' , strtotime( $exploded_change[0] ) );
1970
- $user_last_changed_time = date( 'g:i a' , strtotime( $exploded_change[1] ) );
1971
-
1972
- if(isset($user_rating)) {
1973
- if ($user_rating == 1) {
1974
- $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
1975
- } else if ($user_rating == 2) {
1976
- $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
1977
- } else if ($user_rating == 3) {
1978
- $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
1979
- } else if ($user_rating == 4) {
1980
- $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
1981
- } else if ($user_rating == 5) {
1982
- $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span></div>';
1983
- }
1984
- }
1985
-
1986
- // $timeStamp = explode(' ', $subscriber['timestamp_opt'] );
1987
- echo '<tr class="yks-mailchimp-subscribers-list-row" id="yks-mailchimp-subscribers-list-row">';
1988
- echo '<td><a class="subscriber-mail-link" rel="'.$user_email.'" class="subscriberEmailAddress">'.$user_email.'</a></td>';
1989
- echo '<td>'.ucfirst(strtolower($user_first_name)).'</td>';
1990
- echo '<td>'.ucfirst(strtolower($user_last_name)).'</td>';
1991
- echo '<td><span style="display:none;">'.$user_rating.'</span>'.$member_rating_stars.'</td>';
1992
- echo '<td>'.$user_last_changed_date . ' at ' . $user_last_changed_time .'</td>';
1993
- echo '</tr>';
1994
-
1995
- }
1996
- ?>
1997
- </table>
1998
- <?php
1999
- }
2000
- } catch( Exception $e ) {
2001
- echo '<strong>'.$e->getMessage().'</strong>';
2002
- }
2003
- // always die or it will always return 1
2004
- wp_die();
2005
- }
2006
-
2007
- // Send a call to MailChimp API to get the geo location of users who opened links
2008
- public function getGeoDataForCampaignOpenLinks()
2009
- {
2010
- // Create and store our variables to pass to MailChimp
2011
- $apiKey = $_POST['api_key']; // api key
2012
- $api = new wpyksMCAPI($apiKey);
2013
- $campaign_id = $_POST['campaign_id'];
2014
- // try the call, catch any errors that may be thrown
2015
- try {
2016
- $resp = $api->call('reports/geo-opens', array( 'apikey' => $apiKey , 'cid' => $campaign_id ) );
2017
- // include our Stats Template
2018
- // include_once YKSEME_PATH.'templates/mailChimp-campaign-report.php';
2019
- // print_r($resp);
2020
- if ( $resp ) {
2021
- include_once YKSEME_PATH.'templates/mailChimp-campaign-click-geo-map.php';
2022
- }
2023
- } catch( Exception $e ) {
2024
- ?>
2025
- <script>
2026
- jQuery(document).ready(function() {
2027
- setTimeout(function() {
2028
- var mailChimpError = '<?php echo "<strong class=yks-mc-report-error>".$e->getMessage()."</strong>"; ?>';
2029
- jQuery('#open_tracking_disabled_warning').fadeIn();
2030
- jQuery('#geo_map_no_data').append('<p class="geo_map_no_data_error">'+mailChimpError+'</p>');
2031
- }, 600);
2032
- });
2033
- </script>
2034
-
2035
- <section class="overview_information_section">
2036
-
2037
- <div class="overview_information">
2038
-
2039
- <h2>Campaign Activity Geo Map</h2>
2040
-
2041
- <div id="geo_map_no_data" style="max-width: 100%;min-width: 100%; background:#fff;">
2042
- <div id="geo_map_no_data_overlay"></div>
2043
- <img src="<?php echo plugins_url( '/../images/highcharts-worldmap-disabled.png' , __FILE__ ); ?>" alt="World Map Disabled" title="World Map Disabled">
2044
- </div>
2045
- </div>
2046
-
2047
- </section>
2048
-
2049
- <?php
2050
- }
2051
- // always die or it will always return 1
2052
- wp_die();
2053
- }
2054
-
2055
- // Make a call to MailChimp API to
2056
- // get link tracking information for a
2057
- // specified campaign
2058
- // used in the world map on the campaign stats page
2059
- public function getCampaignLinkStats()
2060
- {
2061
- // Create and store our variables to pass to MailChimp
2062
- $apiKey = $_POST['api_key']; // api key
2063
- $api = new wpyksMCAPI($apiKey);
2064
- $campaign_id = $_POST['campaign_id'];
2065
- // try the call, catch any errors that may be thrown
2066
- try {
2067
- $campaign_click_stats = $api->call( '/reports/clicks' , array( 'apikey' => $apiKey , 'cid' => $campaign_id ) );
2068
- // include our Stats Template
2069
- include_once YKSEME_PATH.'templates/mailChimp-campaign-click-report.php';
2070
- } catch( Exception $e ) {
2071
- echo '<strong>'.$e->getMessage().'</strong>';
2072
- }
2073
- // always die or it will always return 1
2074
- wp_die();
2075
- }
2076
-
2077
- // Make a call to MailChimp API to
2078
- // get users who opened a specific campaign
2079
- // used in the stats page modal
2080
- public function getCampaignOpenedData()
2081
- {
2082
- // Create and store our variables to pass to MailChimp
2083
- $apiKey = $_POST['api_key']; // api key
2084
- $api = new wpyksMCAPI($apiKey);
2085
- $campaign_id = $_POST['campaign_id'];
2086
- // try the call, catch any errors that may be thrown
2087
- try {
2088
- // create our interactive data table
2089
- // and initialize it here...
2090
-
2091
- $campaign_open_stats = $api->call( '/reports/opened' , array( 'apikey' => $apiKey , 'cid' => $campaign_id , 'opts' => array( 'sort_field' => 'opens' , 'sort_dir' => 'DESC' ) ) );
2092
-
2093
- // create an empty array
2094
- $total_opens_array = array();
2095
- // build our total opens array
2096
- foreach ( $campaign_open_stats['data'] as $opened_data ) {
2097
- $total_opens_array[] = $opened_data['opens'];
2098
- }
2099
-
2100
- // display total unique opens
2101
- echo '<h2 style="float:left;">' . __( 'Unique Opens' , 'yikes-inc-easy-mailchimp-extender' ) . ' - ' . $campaign_open_stats["total"] . '</h2>';
2102
- // display total opens
2103
- echo '<h2 style="float:right;">' . __( 'Total Opens' , 'yikes-inc-easy-mailchimp-extender' ) . ' - ' . array_sum($total_opens_array) . '</h2>';
2104
-
2105
- // echo '<h2>' . __( 'Total Opens' 'yikes-inc-easy-mailchimp-extender' ) . $campaign_open_stats["total"] . '</h2>';
2106
-
2107
- ?>
2108
- <!-- initialize o ur data table -->
2109
- <script type="text/javascript">
2110
- jQuery(document).ready(function() {
2111
- jQuery('#yikes-mailchimp-subscribers-opens').dataTable({
2112
- "aaSorting": [[ 1, "desc" ]]
2113
- });
2114
- });
2115
- </script>
2116
-
2117
- <style>
2118
- .subscriber_rating_star { font-size:15px; }
2119
- </style>
2120
-
2121
- <!-- build our opened user table -->
2122
- <table id="yikes-mailchimp-subscribers-opens" class="yks-mailchimp-fields-list" style="width:100%;">
2123
- <thead class="yikes-mailchimp-subscribers-table-head">
2124
- <tr>
2125
- <th style="width:31%;"><?php _e( 'E-Mail' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
2126
- <th style="width:14%;"><?php _e( 'Opens' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
2127
- <th style="width:20%;"><?php _e( 'First Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
2128
- <th style="width:20%;"><?php _e( 'Last Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
2129
- <th style="width:15%;"><?php _e( 'Member Rating' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
2130
- </tr>
2131
- </thead>
2132
- <?php
2133
- // loop over to build create and store our user variables
2134
- // returned by mailchimp
2135
- foreach ( $campaign_open_stats['data'] as $opened_data ) {
2136
-
2137
- // checking if FNAME is set as a merge variable
2138
- // if not, we'll just make it an empty string
2139
- if ( isset ( $opened_data['member']['merges']['LNAME'] ) ) {
2140
- $opened_data['member']['merges']['LNAME'] = $opened_data['member']['merges']['LNAME'];
2141
- } else {
2142
- $opened_data['member']['merges']['LNAME'] = '';
2143
- }
2144
-
2145
- // checking if LNAME is set as a merge variable
2146
- // if not, we'll just make it an empty string
2147
- if ( isset ( $opened_data['member']['merges']['FNAME'] ) ) {
2148
- $opened_data['member']['merges']['FNAME'] = $opened_data['member']['merges']['FNAME'];
2149
- } else {
2150
- $opened_data['member']['merges']['FNAME'] = '';
2151
- }
2152
-
2153
-
2154
- if(isset($opened_data['member']['member_rating'])) {
2155
- if ($opened_data['member']['member_rating'] == 1) {
2156
- $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
2157
- } else if ($opened_data['member']['member_rating'] == 2) {
2158
- $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
2159
- } else if ($opened_data['member']['member_rating'] == 3) {
2160
- $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
2161
- } else if ($opened_data['member']['member_rating'] == 4) {
2162
- $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
2163
- } else if ($opened_data['member']['member_rating'] == 5) {
2164
- $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span></div>';
2165
- }
2166
- }
2167
- // build our table inside the loop
2168
- echo '<tr>';
2169
- echo '<td><a href="mailto:'.$opened_data['member']['email'].'">'.$opened_data['member']['email'].'</a></td>';
2170
- echo '<td>'.$opened_data['opens'].'</td>';
2171
- echo '<td>'.ucfirst(strtolower($opened_data['member']['merges']['FNAME'])).'</td>';
2172
- echo '<td>'.ucfirst(strtolower($opened_data['member']['merges']['LNAME'])).'</td>';
2173
- echo '<td><span style="display:none;">'.$opened_data['member']['member_rating'].'</span>'.$member_rating_stars.'</td>';
2174
- echo '</tr>';
2175
- }
2176
-
2177
- // print_r($campaign_open_stats);
2178
-
2179
- } catch( Exception $e ) {
2180
- // if there is some error, lets return it
2181
- echo '<strong>'.$e->getMessage().'</strong>';
2182
- }
2183
- // always die or it will always return 1
2184
- wp_die();
2185
- }
2186
-
2187
- // Make a call to MailChimp API to
2188
- // get bounced email addressed for this campaign
2189
- // used in the stats page modal
2190
- public function getCampaignBouncedEmailData()
2191
- {
2192
- // Create and store our variables to pass to MailChimp
2193
- $apiKey = $_POST['api_key']; // api key
2194
- $api = new wpyksMCAPI($apiKey);
2195
- $campaign_id = $_POST['campaign_id'];
2196
- // try the call, catch any errors that may be thrown
2197
- try {
2198
- // create our interactive data table
2199
- // and initialize it here...
2200
-
2201
- $campaign_bounce_stats = $api->call( '/reports/bounce-messages' , array( 'apikey' => $apiKey , 'cid' => $campaign_id , 'opts' => array( 'limit' => '100' ) ) );
2202
-
2203
- // print_r($campaign_bounce_stats);
2204
-
2205
- // display total unique opens
2206
- echo '<h2 style="float:left;">' . __( 'Total Bounced Emails' , 'yikes-inc-easy-mailchimp-extender' ) . ' - ' . $campaign_bounce_stats["total"] . '</h2>';
2207
-
2208
- // echo '<h2>' . __( 'Total Opens' 'yikes-inc-easy-mailchimp-extender' ) . $campaign_open_stats["total"] . '</h2>';
2209
-
2210
- ?>
2211
- <!-- initialize o ur data table -->
2212
- <script type="text/javascript">
2213
- jQuery(document).ready(function() {
2214
- jQuery('#yikes-mailchimp-subscribers-bounced').dataTable({
2215
- "aaSorting": [[ 1, "desc" ]]
2216
- });
2217
- });
2218
- </script>
2219
-
2220
- <style>
2221
- .subscriber_rating_star { font-size:15px; }
2222
- </style>
2223
-
2224
- <!-- build our opened user table -->
2225
- <table id="yikes-mailchimp-subscribers-bounced" class="yks-mailchimp-fields-list" style="width:100%;">
2226
- <thead class="yikes-mailchimp-subscribers-table-head">
2227
- <tr>
2228
- <th style="width:31%;"><?php _e( 'E-Mail' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
2229
- <th style="width:20%;"><?php _e( 'First Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
2230
- <th style="width:20%;"><?php _e( 'Last Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
2231
- <th style="width:15%;"><?php _e( 'Member Rating' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
2232
- </tr>
2233
- </thead>
2234
- <?php
2235
- // loop over to build create and store our user variables
2236
- // returned by mailchimp
2237
- foreach ( $campaign_bounce_stats['data'] as $opened_data ) {
2238
-
2239
- // checking if FNAME is set as a merge variable
2240
- // if not, we'll just make it an empty string
2241
- if ( isset ( $opened_data['member']['merges']['LNAME'] ) ) {
2242
- $opened_data['member']['merges']['LNAME'] = $opened_data['member']['merges']['LNAME'];
2243
- } else {
2244
- $opened_data['member']['merges']['LNAME'] = '';
2245
- }
2246
-
2247
- // checking if LNAME is set as a merge variable
2248
- // if not, we'll just make it an empty string
2249
- if ( isset ( $opened_data['member']['merges']['FNAME'] ) ) {
2250
- $opened_data['member']['merges']['FNAME'] = $opened_data['member']['merges']['FNAME'];
2251
- } else {
2252
- $opened_data['member']['merges']['FNAME'] = '';
2253
- }
2254
-
2255
-
2256
- if(isset($opened_data['member']['member_rating'])) {
2257
- if ($opened_data['member']['member_rating'] == 1) {
2258
- $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
2259
- } else if ($opened_data['member']['member_rating'] == 2) {
2260
- $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
2261
- } else if ($opened_data['member']['member_rating'] == 3) {
2262
- $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
2263
- } else if ($opened_data['member']['member_rating'] == 4) {
2264
- $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
2265
- } else if ($opened_data['member']['member_rating'] == 5) {
2266
- $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span></div>';
2267
- }
2268
- }
2269
- // build our table inside the loop
2270
- echo '<tr>';
2271
- echo '<td><a href="mailto:'.$opened_data['member']['email'].'">'.$opened_data['member']['email'].'</a></td>';
2272
- echo '<td>'.ucfirst(strtolower($opened_data['member']['merges']['FNAME'])).'</td>';
2273
- echo '<td>'.ucfirst(strtolower($opened_data['member']['merges']['LNAME'])).'</td>';
2274
- echo '<td><span style="display:none;">'.$opened_data['member']['member_rating'].'</span>'.$member_rating_stars.'</td>';
2275
- echo '</tr>';
2276
- }
2277
-
2278
- // print_r($campaign_open_stats);
2279
-
2280
- } catch( Exception $e ) {
2281
- // if there is some error, lets return it
2282
- echo '<strong>'.$e->getMessage().'</strong>';
2283
- }
2284
- // always die or it will always return 1
2285
- wp_die();
2286
- }
2287
-
2288
-
2289
- // Make a call to MailChimp API to
2290
- // get unsubscribed email addressed for this campaign
2291
- // used in the stats page modal
2292
- public function getCampaignUnsubscribeData()
2293
- {
2294
- // Create and store our variables to pass to MailChimp
2295
- $apiKey = $_POST['api_key']; // api key
2296
- $api = new wpyksMCAPI($apiKey);
2297
- $campaign_id = $_POST['campaign_id'];
2298
- // try the call, catch any errors that may be thrown
2299
- try {
2300
- // create our interactive data table
2301
- // and initialize it here...
2302
-
2303
- $campaign_unsubscribe_stats = $api->call( '/reports/unsubscribes' , array( 'apikey' => $apiKey , 'cid' => $campaign_id , 'opts' => array( 'limit' => '100' ) ) );
2304
-
2305
- // print_r($campaign_bounce_stats);
2306
-
2307
- // display total unique opens
2308
- echo '<h2 style="float:left;">' . __( 'Total Unsubscribes' , 'yikes-inc-easy-mailchimp-extender' ) . ' - ' . $campaign_unsubscribe_stats["total"] . '</h2>';
2309
-
2310
- // echo '<h2>' . __( 'Total Opens' 'yikes-inc-easy-mailchimp-extender' ) . $campaign_open_stats["total"] . '</h2>';
2311
-
2312
- ?>
2313
- <!-- initialize o ur data table -->
2314
- <script type="text/javascript">
2315
- jQuery(document).ready(function() {
2316
- jQuery('#yikes-mailchimp-unsubscribe-table').dataTable({
2317
- "aaSorting": [[ 0, "desc" ]]
2318
- });
2319
- });
2320
- </script>
2321
-
2322
- <style>
2323
- .subscriber_rating_star { font-size:15px; }
2324
- </style>
2325
-
2326
- <!-- build our opened user table -->
2327
- <table id="yikes-mailchimp-unsubscribe-table" class="yks-mailchimp-fields-list" style="width:100%;">
2328
- <thead class="yikes-mailchimp-subscribers-table-head">
2329
- <tr>
2330
- <th style="width:31%;"><?php _e( 'E-Mail' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
2331
- <th style="width:20%;"><?php _e( 'First Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
2332
- <th style="width:20%;"><?php _e( 'Last Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
2333
- <th style="width:15%;"><?php _e( 'Member Rating' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
2334
- <th style="width:15%;"><?php _e( 'Reason' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
2335
- </tr>
2336
- </thead>
2337
- <?php
2338
- // loop over to build create and store our user variables
2339
- // returned by mailchimp
2340
- foreach ( $campaign_unsubscribe_stats['data'] as $opened_data ) {
2341
-
2342
- // checking if FNAME is set as a merge variable
2343
- // if not, we'll just make it an empty string
2344
- if ( isset ( $opened_data['member']['merges']['LNAME'] ) ) {
2345
- $opened_data['member']['merges']['LNAME'] = $opened_data['member']['merges']['LNAME'];
2346
- } else {
2347
- $opened_data['member']['merges']['LNAME'] = '';
2348
- }
2349
-
2350
- // checking if LNAME is set as a merge variable
2351
- // if not, we'll just make it an empty string
2352
- if ( isset ( $opened_data['member']['merges']['FNAME'] ) ) {
2353
- $opened_data['member']['merges']['FNAME'] = $opened_data['member']['merges']['FNAME'];
2354
- } else {
2355
- $opened_data['member']['merges']['FNAME'] = '';
2356
- }
2357
-
2358
-
2359
- if(isset($opened_data['member']['member_rating'])) {
2360
- if ($opened_data['member']['member_rating'] == 1) {
2361
- $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
2362
- } else if ($opened_data['member']['member_rating'] == 2) {
2363
- $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
2364
- } else if ($opened_data['member']['member_rating'] == 3) {
2365
- $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
2366
- } else if ($opened_data['member']['member_rating'] == 4) {
2367
- $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
2368
- } else if ($opened_data['member']['member_rating'] == 5) {
2369
- $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span></div>';
2370
- }
2371
- }
2372
- // build our table inside the loop
2373
- echo '<tr>';
2374
- echo '<td><a href="mailto:'.$opened_data['member']['email'].'">'.$opened_data['member']['email'].'</a></td>';
2375
- echo '<td>'.ucfirst(strtolower($opened_data['member']['merges']['FNAME'])).'</td>';
2376
- echo '<td>'.ucfirst(strtolower($opened_data['member']['merges']['LNAME'])).'</td>';
2377
- echo '<td><span style="display:none;">'.$opened_data['member']['member_rating'].'</span>'.$member_rating_stars.'</td>';
2378
- echo '<td>'.strtolower($opened_data['reason']).'</td>';
2379
- echo '</tr>';
2380
- }
2381
-
2382
- // print_r($campaign_open_stats);
2383
-
2384
- } catch( Exception $e ) {
2385
- // if there is some error, lets return it
2386
- echo '<strong>'.$e->getMessage().'</strong>';
2387
- }
2388
- // always die or it will always return 1
2389
- wp_die();
2390
- }
2391
-
2392
- // Make a call to MailChimp API to add a new subscriber to a specified list
2393
- // Runs when a user fills out the form on the frontend of the site
2394
- public function addUserToMailchimp($p,$update_existing)
2395
- {
2396
- if(!empty($p['form_data']))
2397
- {
2398
-
2399
- parse_str($p['form_data'], $fd);
2400
-
2401
- // grab and store our nonce field
2402
- // for security purposes
2403
- $yks_mc_form_submission_nonce = $fd['_wpnonce'];
2404
-
2405
-
2406
-
2407
- // cross check our nonce
2408
- // passing in the action used when we created the nonce field
2409
- // if the nonce does not match, we need to die()
2410
- if ( !wp_verify_nonce( $yks_mc_form_submission_nonce , 'yks_mc_front_end_form_'.$fd['yks-mailchimp-list-id'] ) ) {
2411
- die( __( 'Failed nonce security check. Please reload the page and submit this form again.' , 'yikes-inc-easy-mailchimp-extender' ) );
2412
- }
2413
-
2414
-
2415
- if( !empty( $fd['yks-mailchimp-list-id'] ) )
2416
- {
2417
-
2418
- // if reCAPTCHA is enabled
2419
- if ( $this->optionVal['recaptcha-setting'] == '1' ) {
2420
-
2421
- $this->includeRECAPTCHAlib();
2422
- $privatekey = $this->optionVal['recaptcha-private-api-key'];
2423
-
2424
- $resp = recaptcha_check_answer (
2425
- $privatekey,
2426
- $_SERVER["REMOTE_ADDR"],
2427
- $fd["recaptcha_challenge_field"],
2428
- $fd["recaptcha_response_field"]
2429
- );
2430
-
2431
- // if the CAPTCHA was entered properly
2432
- if (!$resp->is_valid) {
2433
- // if the response returns invalid,
2434
- // lets add the animated shake and error fields
2435
- // to the captcha fields
2436
- ?>
2437
- <script>
2438
- jQuery(document).ready(function() {
2439
- jQuery('#recaptcha_response_field').addClass('yks_error_field_required shake animated').delay(800).queue(function(next){
2440
- jQuery(this).removeClass('shake animated');
2441
- next();
2442
- });
2443
- });
2444
- </script>
2445
- <?php
2446
- // What happens when the CAPTCHA was entered incorrectly
2447
- // reCAPTCHA not being sent correctly, validation always returns invalid captcha key
2448
- die ("<p>Error - The reCAPTCHA was entered incorrectly.</p>" /* . "(reCAPTCHA said: " . $resp->error . ") "*/ );
2449
-
2450
- // if it returns valid...
2451
- // continue sending data to MailChimp
2452
- } else {
2453
-
2454
- // Create and store the variables needed to add a new subscriber
2455
- $email = false;
2456
- $lid = $fd['yks-mailchimp-list-id'];
2457
- $api = new wpyksMCAPI($this->optionVal['api-key']);
2458
- $mv = array();
2459
- $optin = $this->optionVal['optin'];
2460
-
2461
- foreach($this->optionVal['lists'][$lid]['fields'] as $field) : if($field['active'] == '1') :
2462
-
2463
- // Check to see if the field is in the post
2464
- if(isset($fd[$field['name']])) :
2465
-
2466
- // Grab the primary email
2467
- if(strtolower($field['merge']) == 'email')
2468
- $email = $fd[$field['name']];
2469
-
2470
- // It exists, set the merge var that we send to mailchimp
2471
- switch($field['type'])
2472
- {
2473
- default:
2474
- $mv[$field['merge']] = $fd[$field['name']];
2475
- break;
2476
-
2477
- case 'address':
2478
- $mv[$field['merge']] = array(
2479
- 'addr1' => $fd[$field['name']],
2480
- 'addr2' => $fd[$field['name'].'-add2'],
2481
- 'city' => $fd[$field['name'].'-city'],
2482
- 'state' => $fd[$field['name'].'-state'],
2483
- 'zip' => $fd[$field['name'].'-zip'],
2484
- 'country' => 'US'
2485
- );
2486
- break;
2487
-
2488
- }
2489
-
2490
-
2491
-
2492
- endif;
2493
- endif; endforeach;
2494
-
2495
- // Interest group loop to build the GROUPINGS array
2496
- // The GROUPINGS array passes our interest group, and values back to the specific form
2497
- if ( isset($fd['interest-group-data']) ) {
2498
- $interest_group_option = json_decode($fd['interest-group-data'], true);
2499
- }
2500
- // if interest groups exist, continue and form an array
2501
- if ( isset($interest_group_option) ) {
2502
-
2503
- // print_r($interest_group_option);
2504
- $mv['GROUPINGS'] = array();
2505
-
2506
- // loop over each interest group
2507
- foreach ($interest_group_option as $group ) :
2508
-
2509
- switch($group['form_field'])
2510
- {
2511
- case 'radio':
2512
- case 'dropdown':
2513
- array_push($mv['GROUPINGS'], array(
2514
- 'id' => $group['id'],
2515
- // 'groups' => array($fd['interest-group'])
2516
- 'groups' => array(isset($fd[$group['form_field'].'-'.$group['id']]) ? $fd[$group['form_field'].'-'.$group['id']] : '')
2517
- )
2518
- );
2519
- break;
2520
-
2521
- case 'checkboxes':
2522
- array_push($mv['GROUPINGS'], array(
2523
- 'id' => $group['id'],
2524
- // 'groups' => array($fd['interest-group'])
2525
- 'groups' => (isset($fd[$group['form_field'].'-'.$group['id']]) ? $fd[$group['form_field'].'-'.$group['id']] : '')
2526
- // $fd[$group['form_field'].'-'.$group['id']]
2527
-
2528
- )
2529
- );
2530
- break;
2531
- }
2532
- endforeach; // end loop
2533
-
2534
- }
2535
-
2536
- // If no email provided, fail
2537
- $noemail = "The email address is blank";
2538
- if($email === false) return $noemail;
2539
-
2540
- // Add custom filter here, to capture user submitted
2541
- // data before it's sent off to MailChimp
2542
- $form_data = apply_filters( 'yikes_mc_get_form_data' , $mv );
2543
-
2544
- $specific_form_data = apply_filters( 'yikes_mc_get_form_data_'.$lid, $lid, $mv );
2545
-
2546
-
2547
- // try adding subscriber, catch any error thrown
2548
- try {
2549
- $retval = $api->call('lists/subscribe', array(
2550
- 'id' => $lid, // form id
2551
- 'email' => array( 'email' => $email ), // user email
2552
- 'merge_vars' => $form_data, // merge variables (ie: fields and interest groups)
2553
- 'double_optin' => $optin, // double optin value (retreived from the settings page)
2554
- 'update_existing' => $update_existing
2555
- ));
2556
- return "done";
2557
- } catch( Exception $e ) { // catch any errors returned from MailChimp
2558
- $errorCode = $e->getCode();
2559
- if ( $errorCode = '214' ) {
2560
- $errorMessage = str_replace('Click here to update your profile.', '', $e->getMessage());
2561
- $error_catch = explode('to list', $errorMessage);
2562
- echo $error_catch[0].'.';
2563
- die();
2564
- } else {
2565
- echo '<strong>'.$e->getMessage().'</strong>';
2566
- die();
2567
- }
2568
- }
2569
- }
2570
-
2571
- // if reCAPTCHA is not active, we will just send the request
2572
- // without further verification
2573
- } else {
2574
-
2575
- // Create and store the variables needed to add a new subscriber
2576
- $email = false;
2577
- $lid = $fd['yks-mailchimp-list-id'];
2578
- $api = new wpyksMCAPI($this->optionVal['api-key']);
2579
- $mv = array();
2580
- $optin = $this->optionVal['optin'];
2581
-
2582
- foreach($this->optionVal['lists'][$lid]['fields'] as $field) : if($field['active'] == '1') :
2583
-
2584
- // Check to see if the field is in the post
2585
- if(isset($fd[$field['name']])) :
2586
-
2587
- // Grab the primary email
2588
- if(strtolower($field['merge']) == 'email')
2589
- $email = $fd[$field['name']];
2590
-
2591
- // It exists, set the merge var that we send to mailchimp
2592
- switch($field['type'])
2593
- {
2594
- default:
2595
- $mv[$field['merge']] = $fd[$field['name']];
2596
- break;
2597
-
2598
- case 'address':
2599
- $mv[$field['merge']] = array(
2600
- 'addr1' => $fd[$field['name']],
2601
- 'addr2' => $fd[$field['name'].'-add2'],
2602
- 'city' => $fd[$field['name'].'-city'],
2603
- 'state' => $fd[$field['name'].'-state'],
2604
- 'zip' => $fd[$field['name'].'-zip'],
2605
- 'country' => 'US'
2606
- );
2607
- break;
2608
-
2609
- }
2610
-
2611
-
2612
-
2613
- endif;
2614
- endif; endforeach;
2615
-
2616
- // Interest group loop to build the GROUPINGS array
2617
- // The GROUPINGS array passes our interest group, and values back to the specific form
2618
- if ( isset($fd['interest-group-data']) ) {
2619
- $interest_group_option = json_decode($fd['interest-group-data'], true);
2620
- }
2621
- // if interest groups exist, continue and form an array
2622
- if ( isset($interest_group_option) ) {
2623
-
2624
- // print_r($interest_group_option);
2625
- $mv['GROUPINGS'] = array();
2626
-
2627
- // loop over each interest group
2628
- foreach ($interest_group_option as $group ) :
2629
-
2630
- switch($group['form_field'])
2631
- {
2632
- case 'radio':
2633
- case 'dropdown':
2634
- array_push($mv['GROUPINGS'], array(
2635
- 'id' => $group['id'],
2636
- // 'groups' => array($fd['interest-group'])
2637
- 'groups' => array(isset($fd[$group['form_field'].'-'.$group['id']]) ? $fd[$group['form_field'].'-'.$group['id']] : '')
2638
- )
2639
- );
2640
- break;
2641
-
2642
- case 'checkboxes':
2643
- array_push($mv['GROUPINGS'], array(
2644
- 'id' => $group['id'],
2645
- // 'groups' => array($fd['interest-group'])
2646
- 'groups' => (isset($fd[$group['form_field'].'-'.$group['id']]) ? $fd[$group['form_field'].'-'.$group['id']] : '')
2647
- // $fd[$group['form_field'].'-'.$group['id']]
2648
-
2649
- )
2650
- );
2651
- break;
2652
- }
2653
- endforeach; // end loop
2654
-
2655
- }
2656
-
2657
- // If no email provided, fail
2658
- $noemail = "The email address is blank";
2659
- if($email === false) return $noemail;
2660
-
2661
- // Add custom filter here, to capture user submitted
2662
- // data before it's sent off to MailChimp
2663
- $form_data = apply_filters( 'yikes_mc_get_form_data' , $mv );
2664
- $specific_form_data = apply_filters( 'yikes_mc_get_form_data_'.$lid, $lid, $mv );
2665
-
2666
-
2667
- // try adding subscriber, catch any error thrown
2668
- try {
2669
- $retval = $api->call('lists/subscribe', array(
2670
- 'id' => $lid, // form id
2671
- 'email' => array( 'email' => $email ), // user email
2672
- 'merge_vars' => $form_data, // merge variables (ie: fields and interest groups)
2673
- 'double_optin' => $optin, // double optin value (retreived from the settings page)
2674
- 'send_welcome' => true,
2675
- 'update_existing' => $update_existing
2676
- ));
2677
- return "done";
2678
- } catch( Exception $e ) { // catch any errors returned from MailChimp
2679
- $errorCode = $e->getCode();
2680
- if ( $errorCode = '214' ) {
2681
- $errorMessage = $e->getMessage();
2682
- return apply_filters( 'yikes_mc_user_already_subscribed' , $errorMessage , $email );
2683
- die();
2684
- } else {
2685
- echo '<strong>'.$e->getMessage().'</strong>';
2686
- die();
2687
- }
2688
- }
2689
- }
2690
-
2691
- }
2692
- } else {
2693
- return __('One or more fields are empty','yikes-inc-easy-mailchimp-extender'); // return an error if your leaving any necessary fields empty
2694
- }
2695
- }
2696
-
2697
-
2698
- // Generate the lists containers on the lists page
2699
- // This function gets any imported lists, and builds up the lists page
2700
- public function generateListContainers($listArr=false)
2701
- {
2702
- $listArr = ($listArr == false ? $this->optionVal['lists'] : $listArr);
2703
- $thelistdata = $this->getListsData(); //Get list names from API
2704
- // if there are any imported lists in the array
2705
- if(count($listArr) > 0)
2706
- {
2707
- ob_start();
2708
- // loop over each lists and build the page
2709
- $i = 1;
2710
- foreach($listArr as $list)
2711
- {
2712
-
2713
- $get_list_data = $this->getListsData();
2714
- ?>
2715
- <!-- title -->
2716
- <a data-toggle="collapse" data-parent="#accordion" href="#collapse_<?php echo $i; ?>" class="panel-heading yks-mc-list-title-toggle panel panel-default">
2717
-
2718
- <span class="yks_mc_list_title">
2719
- <?php
2720
- if ($list['name']) {
2721
- $thename = $list['name'];
2722
- //echo $thename;
2723
- printf( __( '%1$s', 'yikes-inc-easy-mailchimp-extender' ), $thename );
2724
- } else {
2725
- foreach ($thelistdata as $lkey => $lval) {
2726
- if ($lkey == $list['id']) {
2727
- $thename = $lval;
2728
- //echo $thename;
2729
- printf( __( '%1$s', 'yikes-inc-easy-mailchimp-extender' ), $thename );
2730
- }
2731
- }
2732
- }
2733
- ?>
2734
- </span>
2735
-
2736
- <span class="yks_mc_subscriber_count"><?php if ( $get_list_data['subscriber-count']['subscriber-count-'.$list['id']] > 1 || $get_list_data['subscriber-count']['subscriber-count-'.$list['id']] == 0 ) { echo $get_list_data['subscriber-count']['subscriber-count-'.$list['id']] . __( ' subscribers' , 'yikes-inc-easy-mailchimp-extender' ); } else { echo $get_list_data['subscriber-count']['subscriber-count-'.$list['id']] . __( ' subscriber' , 'yikes-inc-easy-mailchimp-extender' ); } ?></span>
2737
-
2738
- </a>
2739
-
2740
- <div id="collapse_<?php echo $i; ?>" class="panel-collapse collapse panel-body">
2741
- <div class="yks-list-container" id="yks-list-container_<?php echo $list['id']; ?>">
2742
- <div class="yks-status" id="yks-status" style="display: none;">
2743
- <div class="yks-success" style="padding:.25em;"><p>&nbsp;<?php _e( 'Your List Was Successfully Saved!' , 'yikes-inc-easy-mailchimp-extender' ); ?></p></div>
2744
- </div>
2745
- <div class="yks-status-error" id="yks-status-error" style="display: none;">
2746
- <div class="yks-error" style="padding:.25em;"><p>&nbsp;<?php _e( 'Your settings were not saved (or you did not change them).' , 'yikes-inc-easy-mailchimp-extender' ); ?></p></div>
2747
- </div>
2748
- <span class="yikes-lists-error" style="display:none;"><?php _e( "I'm sorry there was an error with your request." , "yikes-inc-easy-mailchimp-extender" ); ?></span>
2749
- <form method="post" name="yks-mailchimp-form" id="yks-mailchimp-form_<?php echo $list['id']; ?>" rel="<?php echo $list['id']; ?>">
2750
- <input type="hidden" name="yks-mailchimp-unique-id" id="yks-mailchimp-unique-id_<?php echo $list['id']; ?>" value="<?php echo $list['id']; ?>" />
2751
- <table class="form-table yks-admin-form">
2752
- <tbody>
2753
- <!-- display the specific MailChimp list ID back to the user -->
2754
- <tr valign="top">
2755
- <th scope="row"><label for="yks-mailchimp-api-key"><?php _e( 'MailChimp List ID' , 'yikes-inc-easy-mailchimp-extender' ); ?></label></th>
2756
- <td><?php echo $list['list-id']; ?>
2757
- </td>
2758
- </tr>
2759
- <!-- display the shortcode with the specific list ID -->
2760
- <tr valign="top">
2761
- <th scope="row"><label for="yks-mailchimp-shortcode"><?php _e( 'Shortcode' , 'yikes-inc-easy-mailchimp-extender' ); ?></label></th>
2762
- <td class="yks-mailchimp-shortcode">
2763
- <span class="shortcode-code">[yks-mailchimp-list id="<?php echo $list['id']; ?>" submit_text="Submit"]</span>
2764
- <span class="description yks-margin-left"><?php _e( 'Paste this shortcode into whatever page or post you want to add this form to' , 'yikes-inc-easy-mailchimp-extender' ); ?></span>
2765
- </td>
2766
- </tr>
2767
- <!-- display the PHP snippet with the specific list ID -->
2768
- <tr valign="top">
2769
- <th scope="row"><label for="yks-mailchimp-api-key"><?php _e( 'PHP Snippet' , 'yikes-inc-easy-mailchimp-extender' ); ?></label></th>
2770
- <td>
2771
- <?php /* echo htmlentities('<?php echo yksemeProcessSnippet(\''.$list['id'].'\', \'Submit\'); ?>'); */ ?>
2772
- <?php echo htmlentities('<?php echo yksemeProcessSnippet( "'.$list['id'].'" , "Submit" ); ?>'); ?>
2773
- <span class="description yks-margin-left"><?php _e( 'Use this code to add this form to a template file' , 'yikes-inc-easy-mailchimp-extender' ); ?></span>
2774
- </td>
2775
- </tr>
2776
- <!-- display subscriber count here -->
2777
- <tr valign="top">
2778
- <th scope="row"><label for="yks-mailchimp-api-key"><?php _e( 'Number of Subscribers' , 'yikes-inc-easy-mailchimp-extender' ); ?></label></th>
2779
- <td>
2780
- <!-- rel contains list id that we pass along to our function to ajax retreive all subscribers -->
2781
- <span class="number-of-subscribers-<?php echo $list['id']; ?>"><?php echo $get_list_data['subscriber-count']['subscriber-count-'.$list['id']]; ?>&nbsp;</span><a href="#TB_inline?width=600&height=550&inlineId=yikes-mailchimp-subscribers-box" class="thickbox displayListSubscribers button-secondary" rel="<?php echo $list['id']; ?>">View</a>
2782
- </td>
2783
- </tr>
2784
- <!-- display the forms fields, with options to customize -->
2785
- <tr valign="top">
2786
- <td scope="row">
2787
- <label for="api-key"><strong><?php _e( 'Form Fields' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label>
2788
- <p class="description">
2789
- <?php _e( 'Check the fields you want included in your form (Email Address is required).' , 'yikes-inc-easy-mailchimp-extender' ); ?>
2790
- </p>
2791
-
2792
- <p class="description">
2793
- <?php _e( 'Use the green arrows to drag-and-drop the fields and rearrange their order.' , 'yikes-inc-easy-mailchimp-extender' ); ?>
2794
- <span class="yks-mailchimp-sorthandle-img"></span>
2795
- </p>
2796
- <!-- add our add new form field button here!
2797
- To Do --
2798
- - Create new forms
2799
- - Add + Remove merge fields from existing forms on the fly
2800
- - Add+ Remove interest groups etc from existing forms on the fly
2801
- <p class="description">
2802
- <a class="button-secondary thickbox" onclick="return false;" href="#TB_inline?width=auto&height=175&inlineId=newMergeVariableContainer">Add New Field</a>
2803
- </p>
2804
- -->
2805
- </th>
2806
- <td class="yks-mailchimp-fields-td" id="yks-mailchimp-fields-td_<?php echo $list['id']; ?>">
2807
- <fieldset class="yks-mailchimp-fields-container" id="yks-mailchimp-fields-container_<?php echo $list['id']; ?>">
2808
- <legend class="screen-reader-text"><span><?php _e( 'Active Fields' , 'yikes-inc-easy-mailchimp-extender' ); ?></span></legend>
2809
- <div class="yks-mailchimp-fields-list" id="yks-mailchimp-fields-list_<?php echo $list['id']; ?>" rel="<?php echo $list['id']; ?>">
2810
-
2811
- <!-- create sortable rows populated with mailchimp data -->
2812
- <?php
2813
- $num = 1;
2814
- foreach($list['fields'] as $field) { ?>
2815
- <div class="yks-mailchimp-fields-list-row">
2816
- <label title="<?php echo $field['name']; ?>" rel="<?php echo $field['id']; ?>">
2817
- <span class="yks-mailchimp-sorthandle"><?php _e( 'Drag' , 'yikes-inc-easy-mailchimp-extender' ); ?> &amp; <?php _e( 'drop' , 'yikes-inc-easy-mailchimp-extender' ); ?></span>
2818
- <input type="checkbox" name="<?php echo $field['name']; ?>" id="<?php echo $field['id']; ?>" value="1" <?php echo ($field['active'] == 1 ? 'checked="checked"' : ''); ?><?php echo ($field['require'] == 1 ? 'disabled="disabled"' : ''); ?> />
2819
- &nbsp;
2820
- <div class="yks-mailchimp-field-name"><?php echo $field['label']; ?></div>
2821
- </label>
2822
- <span class="yks-mailchimp-field-merge"><span class="description"><?php _e( 'Merge field' , 'yikes-inc-easy-mailchimp-extender' ); ?>:</span> &nbsp; *|<input type="text" class="merge_field_input" name="<?php echo $field['name']; ?>-merge" id="<?php echo $field['id']; ?>-merge" value="<?php echo $field['merge']; ?>"<?php echo (($field['locked'] == 1 || $field['merge'] == false) ? ' disabled="disabled"' : ''); ?> />|*</span>
2823
- <span class="yks-mailchimp-field-placeholder"><span class="description"><?php _e( 'Placeholder' , 'yikes-inc-easy-mailchimp-extender' ); ?>:</span> &nbsp; *|<input type="text" name="placeholder-<?php echo $list['id'].'-'.$num; ?>" id="<?php echo $field['id']; ?>-placeholder" placeholder="<?php echo $field['label']; ?>" value="<?php if(isset($field['placeholder-'.$list['id'].'-'.$num])) { echo $field['placeholder-'.$list['id'].'-'.$num]; } ?>" />|*</span>
2824
- <span class="yks-mailchimp-field-custom-field-class"><span class="description"><?php _e( 'Custom Class' , 'yikes-inc-easy-mailchimp-extender' ); ?>:</span> &nbsp; *|<input type="text" name="custom-field-class-<?php echo $list['id'].'-'.$num; ?>" id="<?php echo $field['id']; ?>-custom-field-class" value="<?php if(isset($field['custom-field-class-'.$list['id'].'-'.$num])) { echo $field['custom-field-class-'.$list['id'].'-'.$num]; } ?>" />|*</span>
2825
- </div>
2826
- <?php
2827
- $num++;
2828
- } ?>
2829
- </div>
2830
- </fieldset>
2831
- <!-- display redirect checkbox here -->
2832
- <tr valign="top">
2833
- <th scope="row"><label for="yks-mailchimp-url-redirect"><?php _e( 'Redirect User On Submission' , 'yikes-inc-easy-mailchimp-extender' ); ?></label></th>
2834
- <td>
2835
- <span class="yks-mailchimp-redirect-checkbox-holder">
2836
- <input type="checkbox" name="yks_mailchimp_redirect_<?php echo $list['id']; ?>" class="yks_mailchimp_redirect" id="yks-mailchimp-redirect-<?php echo $list['id']; ?>" value="1" <?php if(isset($field['yks_mailchimp_redirect_'.$list['id']])) { echo ($field['yks_mailchimp_redirect_'.$list['id']] == 1 ? 'checked="checked"' : ''); } ?> />
2837
- <span class="description yks-margin-left"><?php _e( 'choose a page to redirect the user to after they submit the form.' , 'yikes-inc-easy-mailchimp-extender' ); ?></span>
2838
- <!-- drop down of registered posts/pages -->
2839
- <li id="pages" class="yks_mc_pages_dropdown_<?php echo $list['id']; ?>" <?php if(!isset($field['yks_mailchimp_redirect_'.$list['id']]) || $field['yks_mailchimp_redirect_'.$list['id']] == '' ) { echo 'style="list-style:none;display:none;"'; } else { echo 'style="list-style:none;"'; } ?> >
2840
- <h4><?php _e( 'Select A Post/Page' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4>
2841
- <form action="<? bloginfo('url'); ?>" method="get">
2842
- <select id="page_id" name="page_id_<?php echo $list['id']; ?>" >
2843
- <?php
2844
- // set up variables for the queries
2845
- global $post;
2846
- global $page;
2847
- $post_types = apply_filters( 'yks_redirect_add_post_types' , array( 'post' ) , 10 );
2848
- $args_posts = array( 'post_type' => $post_types , 'numberposts' => -1);
2849
- $args_pages = array(
2850
- 'sort_order' => 'ASC',
2851
- 'sort_column' => 'post_title',
2852
- 'hierarchical' => 1,
2853
- 'exclude' => '',
2854
- 'include' => '',
2855
- 'meta_key' => '',
2856
- 'meta_value' => '',
2857
- 'authors' => '',
2858
- 'child_of' => 0,
2859
- 'parent' => -1,
2860
- 'exclude_tree' => '',
2861
- 'number' => '',
2862
- 'offset' => 0,
2863
- 'post_type' => 'page',
2864
- 'post_status' => 'publish'
2865
- );
2866
- $pages = get_pages($args_pages);
2867
- // print_r($pages);
2868
-
2869
- $posts = get_posts($args_posts);
2870
- // print_r($posts);
2871
- ?>
2872
- <optgroup label="Posts"><?php
2873
-
2874
- // throwing error -> must resolve
2875
- foreach( $posts as $post ) : setup_postdata($post); ?>
2876
- <option <?php if(isset($field['page_id_'.$list['id']])) { selected( $field['page_id_'.$list['id']], $post->ID ); } ?> value="<?php echo $post->ID; ?>"><?php the_title(); ?></option>
2877
- <?php endforeach; ?>
2878
-
2879
- </optgroup>
2880
- <optgroup label="Pages">
2881
- <?php
2882
- foreach( $pages as $page ) : ?>
2883
- <option <?php if(isset($field['page_id_'.$list['id']])) { selected( $field['page_id_'.$list['id']], $page->ID ); } ?> value="<?php echo $page->ID; ?>"><?php echo $page->post_title; ?></option>
2884
- <?php endforeach; ?>
2885
- </optgroup>
2886
- </select>
2887
- </form>
2888
- </li>
2889
- </span>
2890
- </td>
2891
- </tr>
2892
- <!-- display color picker here, to customize the form styles! -->
2893
- <tr valign="top">
2894
- <th scope="row"><label for="yks-mailchimp-url-redirect"><?php _e( 'Custom Styles' , 'yikes-inc-easy-mailchimp-extender' ); ?></label></th>
2895
- <td>
2896
- <span class="yks-mailchimp-custom-styles-holder">
2897
- <input type="checkbox" name="yks_mailchimp_custom_styles_<?php echo $list['id']; ?>" class="yks_mailchimp_custom_styles" id="yks-mailchimp-custom-styles-<?php echo $list['id']; ?>" value="1" <?php if ( isset( $list['custom_styles']['active'] ) && $list['custom_styles']['active'] == 1 ) { echo 'checked=checked'; } ?> <?php if ( isset( $list['custom_template']['active'] ) && $list['custom_template']['active'] == 1 ) { echo 'disabled=disabled'; } ?> />
2898
- <span class="description yks-margin-left"><?php _e( 'set custom styles for this form.' , 'yikes-inc-easy-mailchimp-extender' ); ?></span>
2899
- <!-- drop down of registered posts/pages -->
2900
- <li id="custom-style-list" class="yks_mc_pages_dropdown_<?php echo $list['id']; ?>" <?php if( !isset($list['custom_styles']) || $list['custom_styles']['active'] == '0') { echo 'style="list-style:none;display:none;"'; } else { echo 'style="list-style:none;"'; } ?> >
2901
-
2902
- <h4><?php _e( 'Custom Form Styles' , 'yikes-inc-easy-mailchimp-extender' ); ?>&nbsp;<a href="#TB_inline?width=600&inlineId=formPreviewContainer" class="thickbox button-secondary populatePreviewFormContainer">preview form</a></h4>
2903
-
2904
- <table class="custom_style_table style_table_left yks-mailchimp-fields-container yks-mailchimp-fields-list">
2905
-
2906
- <tr class="yks-mailchimp-fields-list-row">
2907
- <td><?php _e( 'Form Background Color' , 'yikes-inc-easy-mailchimp-extender' ); ?></td>
2908
- <td class="custom-styles-input-td"><input type="text" value="<?php if ( isset( $list['custom_styles']['yks_mc_form_background_color'] ) ) { echo $list['custom_styles']['yks_mc_form_background_color']; } else { echo '#fff'; } ?>" class="yks-mc-color-picker" name="yks-mc-background-color" data-default-color="#fff" /></td>
2909
- </tr>
2910
- <tr class="yks-mailchimp-fields-list-row">
2911
- <td><?php _e( 'Text Color' , 'yikes-inc-easy-mailchimp-extender' ); ?></td>
2912
- <td class="custom-styles-input-td"><input type="text" value="<?php if ( isset( $list['custom_styles']['yks_mc_form_text_color'] ) ) { echo $list['custom_styles']['yks_mc_form_text_color']; } else { echo '#333'; } ?>" class="yks-mc-color-picker" name="yks-mc-text-color" data-default-color="#333" /></td>
2913
- </tr>
2914
- <tr class="yks-mailchimp-fields-list-row">
2915
- <td><?php _e( 'Submit Button Color' , 'yikes-inc-easy-mailchimp-extender' ); ?></td>
2916
- <td class="custom-styles-input-td"><input type="text" value="<?php if ( isset( $list['custom_styles']['yks_mc_submit_button_color'] ) ) { echo $list['custom_styles']['yks_mc_submit_button_color']; } else { echo '#3ed664'; } ?>" class="yks-mc-color-picker" name="yks-mc-submit-button-color" data-default-color="#3ed664" /></td>
2917
- </tr>
2918
- <tr class="yks-mailchimp-fields-list-row">
2919
- <td><?php _e( 'Submit Button Text Color' , 'yikes-inc-easy-mailchimp-extender' ); ?></td>
2920
- <td class="custom-styles-input-td"><input type="text" value="<?php if ( isset( $list['custom_styles']['yks_mc_submit_button_text_color'] ) ) { echo $list['custom_styles']['yks_mc_submit_button_text_color']; } else { echo '#fff'; } ?>" class="yks-mc-color-picker" name="yks-mc-submit-button-text-color" data-default-color="#fff" /></td>
2921
- </tr>
2922
- </table>
2923
-
2924
-
2925
-
2926
- <table class="custom_style_table style_table_right yks-mailchimp-fields-container yks-mailchimp-fields-list">
2927
- <tr class="yks-mailchimp-fields-list-row">
2928
- <td><?php _e( 'Form Padding' , 'yikes-inc-easy-mailchimp-extender' ); ?></td>
2929
- <td class="custom-styles-input-td"><input type="text" value="<?php if ( isset( $list['custom_styles']['yks_mc_form_padding'] ) ) { echo $list['custom_styles']['yks_mc_form_padding'].$list['custom_styles']['yks_mc_form_padding_measurement']; } else { echo '1em'; } ?>" name="yks-mc-form-padding" /></td>
2930
- </tr>
2931
- <tr class="yks-mailchimp-fields-list-row">
2932
- <td><?php _e( 'Form Width (% works best)' , 'yikes-inc-easy-mailchimp-extender' ); ?></td>
2933
- <td class="custom-styles-input-td"><input type="text" value="<?php if ( isset( $list['custom_styles']['yks_mc_form_width'] ) ) { echo $list['custom_styles']['yks_mc_form_width']; } else { echo '100%'; } ?>" name="yks-mc-form-width" /></td>
2934
- </tr>
2935
- <tr class="yks-mailchimp-fields-list-row">
2936
- <td><?php _e( 'Form Alignment' , 'yikes-inc-easy-mailchimp-extender' ); ?></td>
2937
- <td class="custom-styles-input-td">
2938
- <select name="yks-mc-form-alignment">
2939
-
2940
- <option value="none" <?php if ( !isset( $list['custom_styles']['yks_mc_form_alignment'] ) || $list['custom_styles']['yks_mc_form_alignment'] == 'none' ) { echo 'selected="selected"'; } ?>><?php _e( 'None' , 'yikes-inc-easy-mailchimp-extender' ); ?></option>
2941
- <option value="left" <?php if ( isset( $list['custom_styles']['yks_mc_form_alignment'] ) && $list['custom_styles']['yks_mc_form_alignment'] == 'left' ) { echo 'selected="selected"'; } ?>><?php _e( 'Left' , 'yikes-inc-easy-mailchimp-extender' ); ?></option>
2942
- <option value="center" <?php if ( isset( $list['custom_styles']['yks_mc_form_alignment'] ) && $list['custom_styles']['yks_mc_form_alignment'] == 'center' ) { echo 'selected="selected"'; } ?>><?php _e( 'Center' , 'yikes-inc-easy-mailchimp-extender' ); ?></option>
2943
- <option value="right" <?php if ( isset( $list['custom_styles']['yks_mc_form_alignment'] ) && $list['custom_styles']['yks_mc_form_alignment'] == 'right' ) { echo 'selected="selected"'; } ?>><?php _e( 'Right' , 'yikes-inc-easy-mailchimp-extender' ); ?></option>
2944
- </select>
2945
- </td>
2946
- </tr>
2947
- </table>
2948
-
2949
- </li>
2950
- </span>
2951
- </td>
2952
- </tr>
2953
- <tr valign="top">
2954
- <th scope="row"><label for="yks-mailchimp-url-redirect"><?php _e( 'Form Template' , 'yikes-inc-easy-mailchimp-extender' ); ?></label></th>
2955
- <td>
2956
- <span class="yks-mailchimp-custom-template-holder">
2957
- <input type="checkbox" name="yks_mailchimp_custom_template_<?php echo $list['id']; ?>" class="yks_mailchimp_custom_template" id="yks-mailchimp-custom-template-<?php echo $list['id']; ?>" value="1" <?php if ( isset( $list['custom_template']['active'] ) && $list['custom_template']['active'] == 1 ) { echo 'checked=checked'; } ?> <?php if ( isset( $list['custom_styles']['active'] ) && $list['custom_styles']['active']== 1 ) { echo 'disabled=disabled'; } ?> />
2958
- <span class="description yks-margin-left"><?php _e( 'set a template for this form.' , 'yikes-inc-easy-mailchimp-extender' ); ?></span>
2959
- <!-- template selection dropdown -->
2960
- <li id="custom-template-list" class="yks_mc_template_dropdown_<?php echo $list['id']; ?>" <?php if( !isset($list['custom_template']) || $list['custom_template']['active'] == '0') { echo 'style="list-style:none;display:none;"'; } else { echo 'style="list-style:none;"'; } ?> >
2961
- <span class="template-dropdown-list">
2962
-
2963
- <h4><?php _e( 'Select a Template' , 'yikes-inc-easy-mailchimp-extender' ); ?>&nbsp;<a href="#TB_inline?width=600&inlineId=formPreviewContainer" class="thickbox button-secondary populatePreviewFormContainer custom_template">preview form</a> <?php if( !is_dir( get_stylesheet_directory() . '/yikes-mailchimp-user-templates' ) ) { ?>&nbsp;<a href="#" onclick="return false;" class="button-secondary import_template_boilerplates">import boilerplate files</a><a href="#TB_inline?width=600&height=550&inlineId=user_template_how_to" class="thickbox whats-this-help">whats this?</a><?php } ?></h4>
2964
- <?php
2965
- // build our custom template dropdown
2966
- $this->buildCustomTemplateDropdown($list);
2967
- ?>
2968
- </span>
2969
- </li>
2970
- <li style="list-style:none;margin-top:1em;">
2971
- <span class="description"><?php _e( 'note : some light css styling may be necessary to fit in with your theme.' , 'yikes-inc-easy-mailchimp-extender' ); ?></span>
2972
- </li>
2973
-
2974
- </span>
2975
- </td>
2976
-
2977
-
2978
- </tr>
2979
- <!-- end custom template selection -->
2980
- </td>
2981
- </tr>
2982
- <tr>
2983
- <td></td>
2984
- <td>
2985
- <input type="submit" name="submit" class="yks-mailchimp-list-update button-primary" value="<?php _e( 'Save Form Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?>" rel="<?php echo $list['id']; ?>" />
2986
- <input type="button" name="delete" class="yks-mailchimp-delete button-primary" value="<?php _e( 'Delete Form' , 'yikes-inc-easy-mailchimp-extender' ); ?>" rel="<?php echo $list['id']; ?>" data-title="<?php echo $thename; ?>" />
2987
- <input type="button" name="import" class="yks-mailchimp-import button-primary" value="<?php _e( 'Re-Import Form Fields from MailChimp' , 'yikes-inc-easy-mailchimp-extender' ); ?>" rel="<?php echo $list['id']; ?>" />
2988
- </td>
2989
- </tr>
2990
- </tbody>
2991
- </table>
2992
- </form>
2993
- </div>
2994
- </div>
2995
- <?php
2996
- $i++;
2997
- }
2998
- ?>
2999
- <!-- run loop to display content here -->
3000
- <!-- thickbox for our hidden content, we will display subscribed peoples here based on which link is clicked -->
3001
- <?php add_thickbox(); ?>
3002
- <div id="yikes-mailchimp-subscribers-box" style="display:none;">
3003
- <img class="mailChimp_get_subscribers_preloader" src="<?php echo admin_url().'/images/wpspin_light.gif'; ?>" alt="preloader" >
3004
- <div class="yks_mc_subscribers">
3005
- </div>
3006
- </div>
3007
- <?php
3008
- }
3009
- $output = ob_get_contents();
3010
- ob_end_clean();
3011
- return $output;
3012
- }
3013
-
3014
- // Generate the Merge Variable containers on the lists page
3015
- // we use this function to re-import merge variables from mailchimp
3016
- public function generateMergeVariableContainers($listArr=false)
3017
- {
3018
- $listArr = ($listArr == false ? $this->optionVal['lists'] : $listArr);
3019
- $thelistdata = $this->getListsData(); //Get list names from API
3020
- // if there are any imported lists in the array
3021
- if(count($listArr) > 0)
3022
- {
3023
- ob_start();
3024
- // loop over each lists and build the page
3025
- $i = 1;
3026
- foreach($listArr as $list)
3027
- {
3028
-
3029
- $get_list_data = $this->getListsData();
3030
- ?>
3031
- <td class="yks-mailchimp-fields-td" id="yks-mailchimp-fields-td_<?php echo $list['id']; ?>">
3032
- <fieldset class="yks-mailchimp-fields-container" id="yks-mailchimp-fields-container_<?php echo $list['id']; ?>">
3033
- <legend class="screen-reader-text"><span><?php _e( 'Active Fields' , 'yikes-inc-easy-mailchimp-extender' ); ?></span></legend>
3034
- <div class="yks-mailchimp-fields-list" id="yks-mailchimp-fields-list_<?php echo $list['id']; ?>" rel="<?php echo $list['id']; ?>">
3035
- <!-- create sortable rows populated with mailchimp data -->
3036
- <?php
3037
- $num = 1;
3038
- foreach($list['fields'] as $field) { ?>
3039
- <div class="yks-mailchimp-fields-list-row">
3040
- <label title="<?php echo $field['name']; ?>" rel="<?php echo $field['id']; ?>">
3041
- <span class="yks-mailchimp-sorthandle"><?php _e( 'Drag' , 'yikes-inc-easy-mailchimp-extender' ); ?> &amp; <?php _e( 'drop' , 'yikes-inc-easy-mailchimp-extender' ); ?></span>
3042
- <input type="checkbox" name="<?php echo $field['name']; ?>" id="<?php echo $field['id']; ?>" value="1" <?php echo ($field['active'] == 1 ? 'checked="checked"' : ''); ?><?php echo ($field['require'] == 1 ? 'disabled="disabled"' : ''); ?> />
3043
- &nbsp;
3044
- <div class="yks-mailchimp-field-name"><?php echo $field['label']; ?></div>
3045
- </label>
3046
- <span class="yks-mailchimp-field-merge"><span class="description"><?php _e( 'Merge field' , 'yikes-inc-easy-mailchimp-extender' ); ?>:</span> &nbsp; *|<input type="text" class="merge_field_input" name="<?php echo $field['name']; ?>-merge" id="<?php echo $field['id']; ?>-merge" value="<?php echo $field['merge']; ?>"<?php echo (($field['locked'] == 1 || $field['merge'] == false) ? ' disabled="disabled"' : ''); ?> />|*</span>
3047
- <span class="yks-mailchimp-field-placeholder"><span class="description"><?php _e( 'Placeholder' , 'yikes-inc-easy-mailchimp-extender' ); ?>:</span> &nbsp; *|<input type="text" name="placeholder-<?php echo $list['id'].'-'.$num; ?>" id="<?php echo $field['id']; ?>-placeholder" placeholder="<?php echo $field['label']; ?>" value="<?php if(isset($field['placeholder-'.$list['id'].'-'.$num])) { echo $field['placeholder-'.$list['id'].'-'.$num]; } ?>" />|*</span>
3048
- <span class="yks-mailchimp-field-custom-field-class"><span class="description"><?php _e( 'Custom Class' , 'yikes-inc-easy-mailchimp-extender' ); ?>:</span> &nbsp; *|<input type="text" name="custom-field-class-<?php echo $list['id'].'-'.$num; ?>" id="<?php echo $field['id']; ?>-custom-field-class" value="<?php if(isset($field['custom-field-class-'.$list['id'].'-'.$num])) { echo $field['custom-field-class-'.$list['id'].'-'.$num]; } ?>" />|*</span>
3049
- </div>
3050
- <?php
3051
- $num++;
3052
- } ?>
3053
- </div>
3054
- </fieldset>
3055
- </td>
3056
- <?php
3057
- $i++;
3058
- }
3059
- }
3060
- $output = ob_get_contents();
3061
- ob_end_clean();
3062
- return $output;
3063
- }
3064
- // end merge variable container
3065
-
3066
- // Generate our front end JavaScript , used to submit forms
3067
- public function getFrontendFormJavascript($list='')
3068
- {
3069
- if($list === '') return false;
3070
- $js = false;
3071
- foreach($list['fields'] as $field) : if($field['active'] == 1) :
3072
- // Setup JavaScript
3073
- if($field['require'] == '1') :
3074
- $prefix = "ymce";
3075
- $js .= "\n";
3076
- switch($field['type'])
3077
- {
3078
- // default
3079
- default:
3080
- $prefixa = "ymce";
3081
- $js .= "if ($".$prefixa."('#".$field['id']."').val() == '')";
3082
- $js .= "{
3083
- msg += '<li>".$field['label']."'+'\\n</li>';
3084
- err++;
3085
- $".$prefixa."('#".$field['id']."').addClass('yks_error_field_required shake animated').delay(1200).queue(function(next){
3086
- $".$prefixa."(this).removeClass('shake animated');
3087
- next();
3088
- });
3089
- } else {
3090
- $".$prefixa."('#".$field['id']."').removeClass('yks_error_field_required');
3091
- }";
3092
- break;
3093
- // address
3094
- case 'address':
3095
- $js .= "if($".$prefix."('#".$field['id']."').val() == '')
3096
- {
3097
- msg += '<li>Street Address'+'\\n</li>';
3098
- err++;
3099
- $".$prefixa."('#".$field['id']."').addClass('yks_error_field_required shake animated').delay(800).queue(function(next){
3100
- $".$prefixa."(this).removeClass('shake animated');
3101
- next();
3102
- });
3103
- } else {
3104
- $".$prefixa."('#".$field['id']."').removeClass('yks_error_field_required')
3105
- }
3106
- if($".$prefix."('#".$field['id']."-city').val() == '')
3107
- {
3108
- msg += '<li>City'+'\\n</li>';
3109
- err++;
3110
- $".$prefixa."('#".$field['id']."-city').addClass('yks_error_field_required shake animated').delay(800).queue(function(next){
3111
- $".$prefixa."(this).removeClass('shake animated');
3112
- next();
3113
- });
3114
- } else {
3115
- $".$prefixa."('#".$field['id']."-city').removeClass('yks_error_field_required')
3116
- }
3117
- if($".$prefix."('#".$field['id']."-state').val() == '')
3118
- {
3119
- msg += '<li>State'+'\\n</li>';
3120
- err++;
3121
- $".$prefixa."('#".$field['id']."-state').addClass('yks_error_field_required shake animated').delay(800).queue(function(next){
3122
- $".$prefixa."(this).removeClass('shake animated');
3123
- next();
3124
- });
3125
- } else {
3126
- $".$prefixa."('#".$field['id']."-state').removeClass('yks_error_field_required')
3127
- }
3128
- if($".$prefix."('#".$field['id']."-zip').val() == '')
3129
- {
3130
- msg += '<li>Zip Code'+'\\n</li>';
3131
- err++;
3132
- $".$prefixa."('#".$field['id']."-zip').addClass('yks_error_field_required shake animated').delay(800).queue(function(next){
3133
- $".$prefixa."(this).removeClass('shake animated');
3134
- next();
3135
- });
3136
- } else {
3137
- $".$prefixa."('#".$field['id']."-zip').removeClass('yks_error_field_required')
3138
- }";
3139
- break;
3140
- // radio
3141
- case 'radio':
3142
- $js .= "if($".$prefix."('.".$field['name'].":checked').length <= 0)
3143
- {
3144
- msg += '<li>".$field['label']."\\n</li>';
3145
- err++;
3146
- $".$prefixa."('label[for=".$field['id']."]').next().find('input').addClass('yks_error_field_required shake animated').delay(800).queue(function(next){
3147
- $".$prefixa."(this).removeClass('shake animated');
3148
- next();
3149
- });
3150
- } else {
3151
- $".$prefixa."('#".$field['id']."').removeClass('yks_error_field_required')
3152
- }";
3153
- break;
3154
- }
3155
- $js .= "\n";
3156
- endif;
3157
- endif; endforeach;
3158
- return $js;
3159
- }
3160
- // Generate the form on the front end of the site
3161
- // this is what the user will see, and interact with
3162
- public function getFrontendFormDisplay($list='', $submit_text)
3163
- {
3164
- if($list === '') return false;
3165
- ob_start();
3166
- switch($this->optionVal['flavor'])
3167
- {
3168
- default:
3169
- // Display the form inside of a table
3170
- // if the user has selected table as their flavor on the settings page
3171
- // make sure this matches exactly with the div flavor below (currently does not)
3172
- case '0':
3173
- ?>
3174
- <!-- BEGIN TABLE FLAVOR -->
3175
- <table class="yks-mailchimpFormTable">
3176
- <?php
3177
- /* if reCAPTCHA is enabled, we want to display the CAPTCHA form */
3178
- if ( $this->optionVal['recaptcha-setting'] == '1' && $this->optionVal['recaptcha-api-key'] != '' && $this->optionVal['recaptcha-private-api-key'] != '' ) {
3179
-
3180
- $reCAPTCHA_style = $this->optionVal['recaptcha-style'];
3181
-
3182
- // if on localhost , we should replace backward slash (\) with forward slashes (/) to prevent escaped characters
3183
- if ( $this->yks_mc_is_user_localhost() ) {
3184
- $reCAPTCHA_lib_path = str_replace( '\\' , '/' , YKSEME_PATH."lib/recaptchalib.php" );
3185
- } else {
3186
- $reCAPTCHA_lib_path = YKSEME_PATH."lib/recaptchalib.php.";
3187
- }
3188
- // set up the CAPTCHA theme
3189
- ?>
3190
- <script>var RecaptchaOptions = {
3191
- theme : '<?php echo $reCAPTCHA_style; ?>'
3192
- };
3193
- </script>
3194
- <?php
3195
- $this->includeRECAPTCHAlib();
3196
- $reCAPTCHA_api_key = $this->optionVal['recaptcha-api-key'];
3197
- $reCAPTCHA_image = recaptcha_get_html($reCAPTCHA_api_key);
3198
-
3199
- }
3200
- $num = 1;
3201
- foreach($list['fields'] as $field) : if($field['active'] == 1) :
3202
- // get field placeholders
3203
- $form_id = explode( '-', $field['id']);
3204
- $field_placeholder_ = (isset($field['placeholder-'.$form_id[1].'-'.$num]) ? $field['placeholder-'.$form_id[1].'-'.$num] : '');
3205
- echo '<input type="hidden" class="'.$field['name'].'_placeholder_value" value="'.$field_placeholder_.'">';
3206
-
3207
- // add our nonce field for security purposes
3208
- ?>
3209
- <tr class="yks-mailchimpFormTableRow">
3210
- <?php wp_nonce_field( 'yks_mc_front_end_form_'.$form_id[1] ); ?>
3211
- </tr>
3212
-
3213
- <!-- javascript to populate the correct form fields, with the specified place-holder value, on the lists page -->
3214
- <script>
3215
- jQuery(document).ready(function() {
3216
- var hiddenInputClass = '<?php echo $field['name']; ?>';
3217
- // alert('<?php echo $num; ?>');
3218
- var hiddenInputClassValue = jQuery('.'+hiddenInputClass+'_placeholder_value').val();
3219
- jQuery('input[name="'+hiddenInputClass+'"]').attr("placeholder", hiddenInputClassValue);
3220
- });
3221
- </script>
3222
- <?php
3223
- if ($field['require'] == 1) // if the field is required (set in MailChimp), display the red required star
3224
- {
3225
- $reqindicator = " <span class='yks-required-label'>*</span>";
3226
- $reqlabel = " yks-mailchimpFormTableRowLabel-required";
3227
- }
3228
- else // else don't
3229
- {
3230
- $reqindicator = "";
3231
- $reqlabel = "";
3232
- }
3233
- ?>
3234
- <tr class="yks-mailchimpFormTableRow">
3235
- <td class="prompt yks-mailchimpFormTableRowLabel"><label class="prompt yks-mailchimpFormTableRowLabel<?php echo $reqlabel; ?>" for="<?php echo $field['id']; ?>"><?php echo $field['label']; ?><?php echo $reqindicator; ?></label>
3236
- <!-- run our function to generate the input fields for the form, passing in the field -->
3237
- <?php echo $this->getFrontendFormDisplay_field($field,$num); ?>
3238
- </td>
3239
- </tr>
3240
- <?php
3241
- $num++;
3242
- endif; endforeach;
3243
- ?>
3244
- <tr class="yks-mailchimpFormTableRow">
3245
- <!-- run our function to generate the interest group fields for the form, passing in the form id -->
3246
- <?php echo $this->getInterestGroups($form_id[1]); ?>
3247
- <td class="yks-mailchimpFormTableSubmit">
3248
- <?php
3249
- if ( $this->optionVal['recaptcha-setting'] == '1' && $this->optionVal['recaptcha-api-key'] != '' && $this->optionVal['recaptcha-private-api-key'] != '' ) {
3250
- echo $reCAPTCHA_image;
3251
- } else if ( $this->optionVal['recaptcha-setting'] == '1' && $this->optionVal['recaptcha-api-key'] == '' || $this->optionVal['recaptcha-setting'] == '1' && $this->optionVal['recaptcha-private-api-key'] == '') {
3252
- echo '<div class="yks_mc_recaptcha_api_key_error">'. __('reCAPTCHA API Key Error. Please double check your API Keys.' , 'yikes-inc-easy-mailchimp-extender') . '</div>';
3253
- }
3254
- ?>
3255
- <input type="submit" class="ykfmc-submit" id="ykfmc-submit_<?php echo $list['id']; ?>" value="<?php if($submit_text != '') { echo $submit_text; } else { echo 'Sign Up'; } ?>" />
3256
- </td>
3257
- </tr>
3258
- </table>
3259
- <?php
3260
- // Create and store our variables for the redirection
3261
- $form_id = explode('-', $field['id']); // get the form ID
3262
- $redirect_value = (isset($field['yks_mailchimp_redirect_'.$form_id[1]]) ? $field['yks_mailchimp_redirect_'.$form_id[1]] : ''); // get the redirect value from the lists page redirect checkbox
3263
- $redirect_page = (isset($field['page_id_'.$form_id[1]]) ? $field['page_id_'.$form_id[1]] : '') ; // get the redirect page that was set in the pages dropdown on the lists page
3264
- $site_url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; // grab and store the current sites URL
3265
- $redirect_url = get_permalink($redirect_page); // get the permalink of the page we are going to redirect too
3266
- // if redirection was set up for this form, print out our javascript to complete the redirect
3267
- if ($redirect_value == 1) { // only redirect if successful form submission <-----
3268
- ?>
3269
- <script>
3270
- jQuery(document).ready(function() {
3271
- // jquery redirect on form submission
3272
- var formRedirectPage = '<?php echo $redirect_url ?>';
3273
- var formID = '<?php echo $form_id[0].'-'.$form_id[1]; ?>';
3274
- jQuery('#yks-mailchimp-form_'+formID).submit(function() {
3275
- var interval = setInterval(function() {
3276
- if ( jQuery('.yks-success').is(':visible') ) {
3277
- window.location.replace(formRedirectPage);
3278
- clearInterval(interval);
3279
- return;
3280
- }
3281
- //do whatever here..
3282
- }, 2000);
3283
- });
3284
- });
3285
- </script>
3286
- <?php
3287
- }
3288
- break;
3289
-
3290
- // END TABLE FLAVOR
3291
-
3292
- // Display the form inside of a div
3293
- // if the user has selected div as their flavor on the settings page
3294
- case '1':
3295
- ?>
3296
- <div class="yks-mailchimpFormDiv">
3297
- <?php
3298
- /* if reCAPTCHA is enabled, we want to display the CAPTCHA form */
3299
- if ( $this->optionVal['recaptcha-setting'] == '1' && $this->optionVal['recaptcha-api-key'] != '' && $this->optionVal['recaptcha-private-api-key'] != '' ) {
3300
- $reCAPTCHA_style = $this->optionVal['recaptcha-style'];
3301
-
3302
- // if on localhost , we should replace backward slash (\) with forward slashes (/) to prevent escaped characters
3303
- if ( $this->yks_mc_is_user_localhost() ) {
3304
- $reCAPTCHA_lib_path = str_replace( '\\' , '/' , YKSEME_PATH."lib/recaptchalib.php" );
3305
- } else {
3306
- $reCAPTCHA_lib_path = YKSEME_PATH."lib/recaptchalib.php.";
3307
- }
3308
- // set up the CAPTCHA theme
3309
- ?>
3310
- <script>var RecaptchaOptions = {
3311
- theme : '<?php echo $reCAPTCHA_style; ?>'
3312
- };
3313
- </script>
3314
- <?php
3315
- $this->includeRECAPTCHAlib();
3316
- $reCAPTCHA_api_key = $this->optionVal['recaptcha-api-key'];
3317
- $reCAPTCHA_image = recaptcha_get_html($reCAPTCHA_api_key);
3318
- }
3319
- $num = 1;
3320
-
3321
- foreach($list['fields'] as $field) : if($field['active'] == 1) :
3322
-
3323
- // get field placeholders
3324
- $form_id = explode( '-', $field['id']);
3325
-
3326
- $field_placeholder_ = (isset($field['placeholder-'.$form_id[1].'-'.$num]) ? $field['placeholder-'.$form_id[1].'-'.$num] : '');
3327
- echo '<input type="hidden" class="'.$field['name'].'_placeholder_value" value="'.$field_placeholder_.'">';
3328
- ?>
3329
- <!-- javascript to populate the correct form fields, with the specified place-holder value, on the lists page -->
3330
- <script>
3331
- jQuery(document).ready(function() {
3332
- var hiddenInputClass = '<?php echo $field['name']; ?>';
3333
- // alert('<?php echo $num; ?>');
3334
- var hiddenInputClassValue = jQuery('.'+hiddenInputClass+'_placeholder_value').val();
3335
- jQuery('input[name="'+hiddenInputClass+'"]').attr("placeholder", hiddenInputClassValue);
3336
- });
3337
- </script>
3338
- <?php
3339
- if ($field['require'] == 1) // if the field is required (set in MailChimp), display the red required star
3340
- {
3341
- $reqindicator = " <span class='yks-required-label'>*</span>";
3342
- $reqlabel = " yks-mailchimpFormDivRowLabel-required";
3343
- }
3344
- else // else don't
3345
- {
3346
- $reqindicator = "";
3347
- $reqlabel = "";
3348
- }
3349
- ?>
3350
- <div class="yks-mailchimpFormDivRow">
3351
- <label class="prompt yks-mailchimpFormDivRowLabel<?php echo $reqlabel; ?>" for="<?php echo $field['id']; ?>"><?php echo $field['label']; ?><?php echo $reqindicator; ?></label>
3352
- <div class="yks-mailchimpFormDivRowField">
3353
- <!-- run our function to generate the input fields for the form, passing in the field -->
3354
- <?php echo $this->getFrontendFormDisplay_field($field,$num); ?>
3355
- </div>
3356
- </div>
3357
- <?php
3358
- $num++;
3359
- endif; endforeach;
3360
- ?>
3361
- <!-- add our nonce field for security purposes -->
3362
- <div class="yks-mailchimpFormDivRow">
3363
- <?php wp_nonce_field( 'yks_mc_front_end_form_'.$form_id[1] ); ?>
3364
- </div>
3365
-
3366
- <div class="yks-mailchimpFormDivRow">
3367
- <!-- run our function to generate the interest group fields for the form, passing in the form id -->
3368
- <?php $this->getInterestGroups($form_id[1]); ?>
3369
- <div class="yks-mailchimpFormDivSubmit">
3370
- <?php
3371
- if ( $this->optionVal['recaptcha-setting'] == '1' && $this->optionVal['recaptcha-api-key'] != '' && $this->optionVal['recaptcha-private-api-key'] != '' ) {
3372
- echo $reCAPTCHA_image;
3373
- } else if ( $this->optionVal['recaptcha-setting'] == '1' && $this->optionVal['recaptcha-api-key'] == '' || $this->optionVal['recaptcha-setting'] == '1' && $this->optionVal['recaptcha-private-api-key'] == '') {
3374
- echo '<div class="yks_mc_recaptcha_api_key_error">'. __('reCAPTCHA API Key Error. Please double check your API Keys.' , 'yikes-inc-easy-mailchimp-extender') . '</div>';
3375
- }
3376
- ?>
3377
- <p><input type="submit" class="ykfmc-submit" id="ykfmc-submit_<?php echo $list['id']; ?>" value="<?php if($submit_text != '') { echo $submit_text; } else { echo 'Sign Up'; } ?>" /></p>
3378
- </div>
3379
- </div>
3380
- </div>
3381
- <?php
3382
- // Create and store our variables for the redirection
3383
- $form_id = explode('-', $field['id']); // get the form ID
3384
- $redirect_value = (isset($field['yks_mailchimp_redirect_'.$form_id[1]]) ? $field['yks_mailchimp_redirect_'.$form_id[1]] : ''); // get the redirect value from the lists page redirect checkbox
3385
- $redirect_page = (isset($field['page_id_'.$form_id[1]]) ? $field['page_id_'.$form_id[1]] : '') ; // get the redirect page that was set in the pages dropdown on the lists page
3386
- $site_url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; // grab and store the current sites URL
3387
- $redirect_url = get_permalink($redirect_page); // get the permalink of the page we are going to redirect too
3388
- // if redirection was set up for this form, print out our javascript to complete the redirect
3389
- if ($redirect_value == 1) {
3390
- ?>
3391
- <script>
3392
- jQuery(document).ready(function() {
3393
- // jquery redirect on form submission
3394
- var formRedirectPage = '<?php echo $redirect_url ?>';
3395
- var formID = '<?php echo $form_id[0].'-'.$form_id[1]; ?>';
3396
- jQuery('#yks-mailchimp-form_'+formID).submit(function() {
3397
- var interval = setInterval(function() {
3398
- if ( jQuery('.yks-success').is(':visible') ) {
3399
- window.location.replace(formRedirectPage);
3400
- clearInterval(interval);
3401
- return;
3402
- }
3403
- //do whatever here..
3404
- }, 2000);
3405
- });
3406
- });
3407
- </script>
3408
- <?php
3409
- }
3410
- break;
3411
- }
3412
- $output = ob_get_contents();
3413
- ob_end_clean();
3414
- return $output;
3415
- }
3416
-
3417
- // Generate the form on the front end of the site
3418
- // this is what the user will see, and interact with
3419
- public function getFrontendFormDisplay_placeholder_labels($list='', $submit_text)
3420
- {
3421
- if($list === '') return false;
3422
- ob_start();
3423
- switch($this->optionVal['flavor'])
3424
- {
3425
- default:
3426
- // Display the form inside of a table
3427
- // if the user has selected table as their flavor on the settings page
3428
- // make sure this matches exactly with the div flavor below (currently does not)
3429
- case '0':
3430
- ?>
3431
- <!-- BEGIN TABLE FLAVOR -->
3432
- <table class="yks-mailchimpFormTable">
3433
- <?php
3434
- /* if reCAPTCHA is enabled, we want to display the CAPTCHA form */
3435
- if ( $this->optionVal['recaptcha-setting'] == '1' && $this->optionVal['recaptcha-api-key'] != '' && $this->optionVal['recaptcha-private-api-key'] != '' ) {
3436
-
3437
- $reCAPTCHA_style = $this->optionVal['recaptcha-style'];
3438
-
3439
- // if on localhost , we should replace backward slash (\) with forward slashes (/) to prevent escaped characters
3440
- if ( $this->yks_mc_is_user_localhost() ) {
3441
- $reCAPTCHA_lib_path = str_replace( '\\' , '/' , YKSEME_PATH."lib/recaptchalib.php" );
3442
- } else {
3443
- $reCAPTCHA_lib_path = YKSEME_PATH."lib/recaptchalib.php.";
3444
- }
3445
- // set up the CAPTCHA theme
3446
- ?>
3447
- <script>var RecaptchaOptions = {
3448
- theme : '<?php echo $reCAPTCHA_style; ?>'
3449
- };
3450
- </script>
3451
- <?php
3452
- $this->includeRECAPTCHAlib();
3453
- $reCAPTCHA_api_key = $this->optionVal['recaptcha-api-key'];
3454
- $reCAPTCHA_image = recaptcha_get_html($reCAPTCHA_api_key);
3455
-
3456
- }
3457
- $num = 1;
3458
- foreach($list['fields'] as $field) : if($field['active'] == 1) :
3459
- // get field placeholders
3460
- $form_id = explode( '-', $field['id']);
3461
- $field_placeholder_ = (isset($field['placeholder-'.$form_id[1].'-'.$num]) ? $field['placeholder-'.$form_id[1].'-'.$num] : '');
3462
- echo '<input type="hidden" class="'.$field['name'].'_placeholder_value" value="'.$field_placeholder_.'">';
3463
-
3464
- // add our nonce field for security purposes
3465
- ?>
3466
- <tr class="yks-mailchimpFormTableRow">
3467
- <?php wp_nonce_field( 'yks_mc_front_end_form_'.$form_id[1] ); ?>
3468
- </tr>
3469
-
3470
- <!-- javascript to populate the correct form fields, with the specified place-holder value, on the lists page -->
3471
- <script>
3472
- jQuery(document).ready(function() {
3473
- var hiddenInputClass = '<?php echo $field['name']; ?>';
3474
- // alert('<?php echo $num; ?>');
3475
- var hiddenInputClassValue = jQuery('.'+hiddenInputClass+'_placeholder_value').val();
3476
- jQuery('input[name="'+hiddenInputClass+'"]').attr("placeholder", hiddenInputClassValue);
3477
- });
3478
- </script>
3479
- <?php
3480
- if ($field['require'] == 1) // if the field is required (set in MailChimp), display the red required star
3481
- {
3482
- $reqindicator = " <span class='yks-required-label'>*</span>";
3483
- $reqlabel = " yks-mailchimpFormTableRowLabel-required";
3484
- }
3485
- else // else don't
3486
- {
3487
- $reqindicator = "";
3488
- $reqlabel = "";
3489
- }
3490
- ?>
3491
- <tr class="yks-mailchimpFormTableRow">
3492
- <!-- run our function to generate the input fields for the form, passing in the field -->
3493
- <?php echo $this->getFrontendFormDisplay_field($field,$num); ?>
3494
- </tr>
3495
- <?php
3496
- $num++;
3497
- endif; endforeach;
3498
- ?>
3499
- <tr class="yks-mailchimpFormTableRow">
3500
- <!-- run our function to generate the interest group fields for the form, passing in the form id -->
3501
- <?php echo $this->getInterestGroups($form_id[1]); ?>
3502
- <td class="yks-mailchimpFormTableSubmit">
3503
- <?php
3504
- if ( $this->optionVal['recaptcha-setting'] == '1' && $this->optionVal['recaptcha-api-key'] != '' && $this->optionVal['recaptcha-private-api-key'] != '' ) {
3505
- echo $reCAPTCHA_image;
3506
- } else if ( $this->optionVal['recaptcha-setting'] == '1' && $this->optionVal['recaptcha-api-key'] == '' || $this->optionVal['recaptcha-setting'] == '1' && $this->optionVal['recaptcha-private-api-key'] == '') {
3507
- echo '<div class="yks_mc_recaptcha_api_key_error">'. __('reCAPTCHA API Key Error. Please double check your API Keys.' , 'yikes-inc-easy-mailchimp-extender') . '</div>';
3508
- }
3509
- ?>
3510
- <input type="submit" class="ykfmc-submit" id="ykfmc-submit_<?php echo $list['id']; ?>" value="<?php if($submit_text != '') { echo $submit_text; } else { echo 'Sign Up'; } ?>" />
3511
- </td>
3512
- </tr>
3513
- </table>
3514
- <?php
3515
- // Create and store our variables for the redirection
3516
- $form_id = explode('-', $field['id']); // get the form ID
3517
- $redirect_value = (isset($field['yks_mailchimp_redirect_'.$form_id[1]]) ? $field['yks_mailchimp_redirect_'.$form_id[1]] : ''); // get the redirect value from the lists page redirect checkbox
3518
- $redirect_page = (isset($field['page_id_'.$form_id[1]]) ? $field['page_id_'.$form_id[1]] : '') ; // get the redirect page that was set in the pages dropdown on the lists page
3519
- $site_url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; // grab and store the current sites URL
3520
- $redirect_url = get_permalink($redirect_page); // get the permalink of the page we are going to redirect too
3521
- // if redirection was set up for this form, print out our javascript to complete the redirect
3522
- if ($redirect_value == 1) { // only redirect if successful form submission <-----
3523
- ?>
3524
- <script>
3525
- jQuery(document).ready(function() {
3526
- // jquery redirect on form submission
3527
- var formRedirectPage = '<?php echo $redirect_url ?>';
3528
- var formID = '<?php echo $form_id[0].'-'.$form_id[1]; ?>';
3529
- jQuery('#yks-mailchimp-form_'+formID).submit(function() {
3530
- var interval = setInterval(function() {
3531
- if ( jQuery('.yks-success').is(':visible') ) {
3532
- window.location.replace(formRedirectPage);
3533
- clearInterval(interval);
3534
- return;
3535
- }
3536
- //do whatever here..
3537
- }, 2000);
3538
- });
3539
- });
3540
- </script>
3541
- <?php
3542
- }
3543
- break;
3544
-
3545
- // END TABLE FLAVOR
3546
-
3547
- // Display the form inside of a div
3548
- // if the user has selected div as their flavor on the settings page
3549
- case '1':
3550
- ?>
3551
- <div class="yks-mailchimpFormDiv">
3552
- <?php
3553
- /* if reCAPTCHA is enabled, we want to display the CAPTCHA form */
3554
- if ( $this->optionVal['recaptcha-setting'] == '1' && $this->optionVal['recaptcha-api-key'] != '' && $this->optionVal['recaptcha-private-api-key'] != '' ) {
3555
- $reCAPTCHA_style = $this->optionVal['recaptcha-style'];
3556
-
3557
- // if on localhost , we should replace backward slash (\) with forward slashes (/) to prevent escaped characters
3558
- if ( $this->yks_mc_is_user_localhost() ) {
3559
- $reCAPTCHA_lib_path = str_replace( '\\' , '/' , YKSEME_PATH."lib/recaptchalib.php" );
3560
- } else {
3561
- $reCAPTCHA_lib_path = YKSEME_PATH."lib/recaptchalib.php.";
3562
- }
3563
- // set up the CAPTCHA theme
3564
- ?>
3565
- <script>var RecaptchaOptions = {
3566
- theme : '<?php echo $reCAPTCHA_style; ?>'
3567
- };
3568
- </script>
3569
- <?php
3570
- $this->includeRECAPTCHAlib();
3571
- $reCAPTCHA_api_key = $this->optionVal['recaptcha-api-key'];
3572
- $reCAPTCHA_image = recaptcha_get_html($reCAPTCHA_api_key);
3573
- }
3574
- $num = 1;
3575
-
3576
- foreach($list['fields'] as $field) : if($field['active'] == 1) :
3577
-
3578
- // get field placeholders
3579
- $form_id = explode( '-', $field['id']);
3580
-
3581
- $field_placeholder_ = (isset($field['placeholder-'.$form_id[1].'-'.$num]) ? $field['placeholder-'.$form_id[1].'-'.$num] : '');
3582
- echo '<input type="hidden" class="'.$field['name'].'_placeholder_value" value="'.$field_placeholder_.'">';
3583
- ?>
3584
- <!-- javascript to populate the correct form fields, with the specified place-holder value, on the lists page -->
3585
- <script>
3586
- jQuery(document).ready(function() {
3587
- var hiddenInputClass = '<?php echo $field['name']; ?>';
3588
- // alert('<?php echo $num; ?>');
3589
- var hiddenInputClassValue = jQuery('.'+hiddenInputClass+'_placeholder_value').val();
3590
- jQuery('input[name="'+hiddenInputClass+'"]').attr("placeholder", hiddenInputClassValue);
3591
- });
3592
- </script>
3593
- <?php
3594
- if ($field['require'] == 1) // if the field is required (set in MailChimp), display the red required star
3595
- {
3596
- $reqindicator = " <span class='yks-required-label'>*</span>";
3597
- $reqlabel = " yks-mailchimpFormDivRowLabel-required";
3598
- }
3599
- else // else don't
3600
- {
3601
- $reqindicator = "";
3602
- $reqlabel = "";
3603
- }
3604
- ?>
3605
- <div class="yks-mailchimpFormDivRow">
3606
- <div class="yks-mailchimpFormDivRowField">
3607
- <!-- run our function to generate the input fields for the form, passing in the field -->
3608
- <?php echo $this->getFrontendFormDisplay_field($field,$num); ?>
3609
- </div>
3610
- </div>
3611
- <?php
3612
- $num++;
3613
- endif; endforeach;
3614
- ?>
3615
- <!-- add our nonce field for security purposes -->
3616
- <div class="yks-mailchimpFormDivRow">
3617
- <?php wp_nonce_field( 'yks_mc_front_end_form_'.$form_id[1] ); ?>
3618
- </div>
3619
-
3620
- <div class="yks-mailchimpFormDivRow">
3621
- <!-- run our function to generate the interest group fields for the form, passing in the form id -->
3622
- <?php $this->getInterestGroups($form_id[1]); ?>
3623
- <div class="yks-mailchimpFormDivSubmit">
3624
- <?php
3625
- if ( $this->optionVal['recaptcha-setting'] == '1' && $this->optionVal['recaptcha-api-key'] != '' && $this->optionVal['recaptcha-private-api-key'] != '' ) {
3626
- echo $reCAPTCHA_image;
3627
- } else if ( $this->optionVal['recaptcha-setting'] == '1' && $this->optionVal['recaptcha-api-key'] == '' || $this->optionVal['recaptcha-setting'] == '1' && $this->optionVal['recaptcha-private-api-key'] == '') {
3628
- echo '<div class="yks_mc_recaptcha_api_key_error">'. __('reCAPTCHA API Key Error. Please double check your API Keys.' , 'yikes-inc-easy-mailchimp-extender') . '</div>';
3629
- }
3630
- ?>
3631
- <p><input type="submit" class="ykfmc-submit" id="ykfmc-submit_<?php echo $list['id']; ?>" value="<?php if($submit_text != '') { echo $submit_text; } else { echo 'Sign Up'; } ?>" /></p>
3632
- </div>
3633
- </div>
3634
- </div>
3635
- <?php
3636
- // Create and store our variables for the redirection
3637
- $form_id = explode('-', $field['id']); // get the form ID
3638
- $redirect_value = (isset($field['yks_mailchimp_redirect_'.$form_id[1]]) ? $field['yks_mailchimp_redirect_'.$form_id[1]] : ''); // get the redirect value from the lists page redirect checkbox
3639
- $redirect_page = (isset($field['page_id_'.$form_id[1]]) ? $field['page_id_'.$form_id[1]] : '') ; // get the redirect page that was set in the pages dropdown on the lists page
3640
- $site_url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; // grab and store the current sites URL
3641
- $redirect_url = get_permalink($redirect_page); // get the permalink of the page we are going to redirect too
3642
- // if redirection was set up for this form, print out our javascript to complete the redirect
3643
- if ($redirect_value == 1) {
3644
- ?>
3645
- <script>
3646
- jQuery(document).ready(function() {
3647
- // jquery redirect on form submission
3648
- var formRedirectPage = '<?php echo $redirect_url ?>';
3649
- var formID = '<?php echo $form_id[0].'-'.$form_id[1]; ?>';
3650
- jQuery('#yks-mailchimp-form_'+formID).submit(function() {
3651
- var interval = setInterval(function() {
3652
- if ( jQuery('.yks-success').is(':visible') ) {
3653
- window.location.replace(formRedirectPage);
3654
- clearInterval(interval);
3655
- return;
3656
- }
3657
- //do whatever here..
3658
- }, 2000);
3659
- });
3660
- });
3661
- </script>
3662
- <?php
3663
- }
3664
- break;
3665
- }
3666
- $output = ob_get_contents();
3667
- ob_end_clean();
3668
- return $output;
3669
- }
3670
-
3671
- // Generate the input fields for the form on the front end of the site
3672
- // based on the $field['type'] that is returned from MailChimp
3673
- private function getFrontendFormDisplay_field($field=false,$num)
3674
- {
3675
- if($field === false) return false;
3676
- $o = '';
3677
- $fieldID = $field['id'];
3678
- $exploded_field_id = explode( '-' , $fieldID );
3679
- $form_id = $exploded_field_id[1];
3680
-
3681
- // check to see if the custom class has been set up...
3682
- if ( isset( $field['custom-field-class-'.$form_id.'-'.$num] ) ) {
3683
- $custom_class = $field['custom-field-class-'.$form_id.'-'.$num];
3684
- } else {
3685
- $custom_class = '';
3686
- }
3687
-
3688
- switch($field['type'])
3689
- {
3690
- default:
3691
- case 'email':
3692
- case 'text':
3693
- case 'number':
3694
- case 'zipcode':
3695
- case 'phone':
3696
- case 'website':
3697
- case 'imageurl':
3698
- // custom placeholder value goes here
3699
- $o .= '<input type="text" name="'.$field['name'].'" class="'.$field['name'].($field['require'] == 1 ? ' yks-require' : '') . ' ' . $custom_class . '" id="'.$field['id'].'" value="" />';
3700
-
3701
- break;
3702
- case 'dropdown':
3703
- $o .= '<select name="'.$field['name'].'" class="'.$field['name'].($field['require'] == 1 ? ' yks-require' : ''). ' ' . $custom_class .'" id="'.$field['id'].'">';
3704
- if(count($field['choices']) > 0) : foreach($field['choices'] as $ok => $ov) :
3705
- $o .= '<option value="'.htmlentities($ov, ENT_QUOTES).'">'.$ov.'</option>';
3706
- endforeach; endif;
3707
- $o .= '</select>';
3708
- break;
3709
- case 'address':
3710
-
3711
- $o .= '<input type="text" name="'.$field['name'].'" class="'.$field['name'].($field['require'] == 1 ? ' yks-require' : ''). ' ' . $custom_class .'" id="'.$field['id'].'" value="" /><span class="yks-mailchimp-form-tooltip">Street Address</span>';
3712
- $o .= '<input type="text" name="'.$field['name'].'-add2" class="'.$field['name'].'-add2'.($field['require'] == 1 ? ' yks-require' : ''). ' ' . $custom_class .'" id="'.$field['id'].'-add2" value="" /><span class="yks-mailchimp-form-tooltip">Apt/Suite</span>';
3713
- $o .= '<input type="text" name="'.$field['name'].'-city" class="'.$field['name'].'-city'.($field['require'] == 1 ? ' yks-require' : ''). ' ' . $custom_class .'" id="'.$field['id'].'-city" value="" /><span class="yks-mailchimp-form-tooltip">City</span>';
3714
- $o .= '<input type="text" name="'.$field['name'].'-state" class="'.$field['name'].'-state'.($field['require'] == 1 ? ' yks-require' : ''). ' ' . $custom_class .'" id="'.$field['id'].'-state" value="" /><span class="yks-mailchimp-form-tooltip">State</span>';
3715
- $o .= '<input type="text" name="'.$field['name'].'-zip" class="'.$field['name'].'-zip'.($field['require'] == 1 ? ' yks-require' : ''). ' ' . $custom_class .'" id="'.$field['id'].'-zip" value="" /><span class="yks-mailchimp-form-tooltip">Zip</span>';
3716
- break;
3717
- case 'radio':
3718
- if(count($field['choices']) > 0) : $ct=0; foreach($field['choices'] as $ok => $ov) :
3719
- $ct++;
3720
- $o .= '<label for="'.$field['id'].'-'.$ok.'"><input type="radio" name="'.$field['name'].'" class="'.$field['name'].($field['require'] == 1 ? ' yks-require' : ''). ' ' . $custom_class .'" id="'.$field['id'].'-'.$ok.'" value="'.htmlentities($ov, ENT_QUOTES).'" />'.$ov.'</label>';
3721
- if($ct < count($field['choices']))
3722
- $o .= '<br />';
3723
- endforeach; endif;
3724
- break;
3725
- case 'date':
3726
- case 'birthday':
3727
- $o .= '<input type="text" name="'.$field['name'].'" class="'.$field['name'].' yks-field-type-date'.($field['require'] == 1 ? ' yks-require' : ''). ' ' . $custom_class .'" id="'.$field['id'].'" value="" />';
3728
- break;
3729
-
3730
-
3731
- }
3732
-
3733
- return $o;
3734
- }
3735
-
3736
-
3737
- /***** DROPDOWNS
3738
- ****************************************************************************************************/
3739
- // not sure we need these any more
3740
- // generate some dropdowns (not sure where)
3741
- public function generateDropdown($name, $html='', $sel='', $type=false, $zopt=false)
3742
- {
3743
- switch($type)
3744
- {
3745
- case 'yes_no':
3746
- return yksemeBase::yesNoDropdown($name, $html, $sel);
3747
- break;
3748
- case 'and_or':
3749
- return yksemeBase::andOrDropdown($name, $html, $sel);
3750
- break;
3751
- case 'wpsc_products':
3752
- return yksemeBase::wpscProductDropdown($name, $html, $sel, $zopt);
3753
- break;
3754
-
3755
- default:
3756
- break;
3757
- }
3758
- }
3759
- private function yesNoDropdown($name, $html, $sel)
3760
- {
3761
- // Options
3762
- $ddo = '<option value="0"'.($sel == '0' ? ' selected' : '').'>No</option>';
3763
- $ddo .= '<option value="1"'.($sel == '1' ? ' selected' : '').'>Yes</option>';
3764
- // Dropdown
3765
- $dd = '<select name="'.$name.'" id="'.$name.'"'.(!empty($html) ? ' '.$html : '').'>'.$ddo.'</select>';
3766
- return $dd;
3767
- }
3768
- private function andOrDropdown($name, $html, $sel)
3769
- {
3770
- // Options
3771
- $ddo = '<option value="0"'.($sel != '0' ? ' selected' : '').'>Or</option>';
3772
- $ddo .= '<option value="1"'.($sel == '1' ? ' selected' : '').'>And</option>';
3773
- // Dropdown
3774
- $dd = '<select name="'.$name.'" id="'.$name.'"'.(!empty($html) ? ' '.$html : '').'>'.$ddo.'</select>';
3775
- return $dd;
3776
- }
3777
-
3778
-
3779
- /***** UPDATES
3780
- ****************************************************************************************************/
3781
- public function runUpdateTasks()
3782
- {
3783
- $currentVersion = (!isset($this->optionVal['version']) || empty($this->optionVal['version']) ? '5.0.3' : $this->optionVal['version']);
3784
- $latestVersion = YKSEME_VERSION_CURRENT;
3785
- if($currentVersion < $latestVersion)
3786
- {
3787
- $updateFunction = 'runUpdateTasks_'.str_replace('.', '_', $currentVersion);
3788
- if(!method_exists($this, $updateFunction)) return false;
3789
- else
3790
- {
3791
- if(call_user_func(array(&$this, $updateFunction)))
3792
- {
3793
- update_option( YKSEME_OPTION, YKSEME_VERSION_CURRENT );
3794
- $this->runUpdateTasks();
3795
- }
3796
- }
3797
- }
3798
- else return false;
3799
- }
3800
-
3801
- /**
3802
- * This update makes the first name and last name optional
3803
- * To do this we need to loop through the existing fields and
3804
- * change the 'require' key to 0
3805
- *
3806
- * 1.1.0 => 1.2.0
3807
- */
3808
- private function runUpdateTasks_1_1_0()
3809
- {
3810
- if($this->optionVal['lists'])
3811
- {
3812
- foreach($this->optionVal['lists'] as $lid => $list)
3813
- {
3814
- foreach($list['fields'] as $fid => $field)
3815
- {
3816
- switch($field['name'])
3817
- {
3818
- case 'yks-mailchimp-field-name-first':
3819
- case 'yks-mailchimp-field-name-last':
3820
- $this->optionVal['lists'][$lid]['fields'][$fid]['locked'] = 0;
3821
- break;
3822
- }
3823
- }
3824
- }
3825
- }
3826
- $this->optionVal['version'] = '1.2.0';
3827
- return true;
3828
- }
3829
-
3830
- /**
3831
- * This update adds a merge_vars key to each
3832
- * field array so that users can specify their
3833
- * own merge_var names
3834
- *
3835
- * 1.2.0 => 1.3.0
3836
- */
3837
- private function runUpdateTasks_1_2_0()
3838
- {
3839
- if($this->optionVal['lists'])
3840
- {
3841
- foreach($this->optionVal['lists'] as $lid => $list)
3842
- {
3843
- $fct = 1;
3844
- foreach($list['fields'] as $fid => $field)
3845
- {
3846
- switch($field['name'])
3847
- {
3848
- case 'yks-mailchimp-field-email':
3849
- $this->optionVal['lists'][$lid]['fields'][$fid]['merge'] = 'EMAIL';
3850
- break;
3851
-
3852
- case 'yks-mailchimp-field-apt-suite':
3853
- case 'yks-mailchimp-field-city':
3854
- case 'yks-mailchimp-field-state':
3855
- case 'yks-mailchimp-field-zip':
3856
- $this->optionVal['lists'][$lid]['fields'][$fid]['merge'] = false;
3857
- break;
3858
-
3859
- default:
3860
- if(empty($this->optionVal['lists'][$lid]['fields'][$fid]['merge']) || !isset($this->optionVal['lists'][$lid]['fields'][$fid]['merge']))
3861
- $this->optionVal['lists'][$lid]['fields'][$fid]['merge'] = 'MERGE'.$fct;
3862
- $fct++;
3863
- break;
3864
- }
3865
- }
3866
- }
3867
- }
3868
- $this->optionVal['version'] = '1.3.0';
3869
- return true;
3870
- }
3871
-
3872
- // generate a thickbox container
3873
- // to display our new merge variable
3874
- // buttons
3875
- // To Do : version 5.2
3876
- function generateNewMergeVariableContainer() {
3877
- ?>
3878
- <div id="newMergeVariableContainer" style="display:none;">
3879
- <p>
3880
- <h4 style="width:100%;text-align:center;">Select New Field</h4>
3881
- <p>
3882
- <a href="#" onclick="return false;" class="button-secondary">Text</a>
3883
- <a href="#" onclick="return false;" class="button-secondary">First Name</a>
3884
- <a href="#" onclick="return false;" class="button-secondary">Last Name</a>
3885
- <a href="#" onclick="return false;" class="button-secondary">Number</a>
3886
- <a href="#" onclick="return false;" class="button-secondary">Date</a>
3887
- <a href="#" onclick="return false;" class="button-secondary">Dropdown</a>
3888
- <a href="#" onclick="return false;" class="button-secondary">Birthday</a>
3889
- <a href="#" onclick="return false;" class="button-secondary">Address</a>
3890
- <a href="#" onclick="return false;" class="button-secondary">Zip Code</a>
3891
- <a href="#" onclick="return false;" class="button-secondary">Phone</a>
3892
- <a href="#" onclick="return false;" class="button-secondary">Website</a>
3893
- <a href="#" onclick="return false;" class="button-secondary">Image</a>
3894
- </p>
3895
- </p>
3896
- </div>
3897
- <?php
3898
- }
3899
-
3900
- // generate a thickbox container
3901
- // to display a preview of the form
3902
- function generateFormPreviewContainer() {
3903
- ?>
3904
- <div id="formPreviewContainer" style="display:none;">
3905
- <?php echo '<img src="' . admin_url() . '/images/wpspin_light.gif" alt="preloader" style="margin-left: 50%; margin-top: 25%;">'; ?>
3906
- </div>
3907
- <?php
3908
- }
3909
-
3910
- // generate a thickbox container
3911
- // to display a how to in using custom template files
3912
- function generateUserTemplateHowTo() {
3913
- ?>
3914
- <div id="user_template_how_to" style="display:none;">
3915
- <a href="http://www.yikesinc.com" title="YIKES, Inc." target="_blank"><img style="float:left;margin-bottom:0;width:75px;" src="<?php echo YKSEME_URL; ?>/images/yikes_logo.png" alt="YIKES, Inc." id="yksme-yikes-logo" /></a>
3916
- <h4 class="user_template_how_to_title"><?php _e( 'Custom User Template Files' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4>
3917
-
3918
- <p style="margin-top: 2.5em;" ><?php _e( 'With the latest version of YIKES Inc. Easy MailChimp Extender you can now extend the plugin beyond what it can do out of the box. Now you can create your own MailChimp sign up template files and use them with any list , anywhere on your site. We have provided you with a few bundled templates, as well as two boilerplate template files for easy customization.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
3919
-
3920
- <p><?php _e( 'You can create your own templates in two ways.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
3921
- <hr />
3922
- <ul>
3923
- <li><h4><?php _e( 'Automatic Method :' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4><p><?php _e( "The easiest way is to import the template files from the plugin automatically. You can do this by clicking on the 'import boilerplate files' button. This will copy over the necessary files right into your theme. From there you can start editing the template files found in your theme root inside of the newly created 'yikes-inc-easy-mailchimp-extender' directory." , "yikes-inc-easy-mailchimp-extender" ); ?></p></li>
3924
- <a href="#" onclick="return false;" class="button-secondary import_template_boilerplates" style="width:148px;display:block;margin:0 auto;"><?php _e( "import boilerplate files" , "yikes-inc-easy-mailchimp-extender" ); ?></a>
3925
- <hr />
3926
- <li><h4><?php _e( 'Manual Method' , 'yikes-inc-easy-mailchimp-extender' ); ?> :</h4><p><?php _e( "If the automatic method doesn't work for you, you can manually copy over the necessary files." , 'yikes-inc-easy-mailchimp-extender' ); ?></p> <p><?php _e( "Copy the following directory" , "yikes-inc-easy-mailchimp-extender" ); ?> :<br /> <em class="yks-mc-file-path"><?php echo YKSEME_PATH . 'templates/yikes-mailchimp-user-templates'; ?></em> <br /><?php _e( " into your theme root, found at " , "yikes-inc-easy-mailchimp-extender" ); ?><br /> <em class="yks-mc-file-path"><?php echo get_stylesheet_directory_uri(); ?></em></p></li>
3927
- <hr />
3928
- <li><h5><?php _e( "Notes" , "yikes-inc-easy-mailchimp-extender" ); ?></h5></li>
3929
- <ul>
3930
- <li><p><?php _e( "You can also copy over any of the default bundled themes into the 'yikes-mailchimp-user-templates' directory to customize the look and feel of a default bundled template file." , "yikes-inc-easy-mailchimp-extender" ); ?></p></li>
3931
- <li><p><?php _e( "If you are having any difficulties copying over the template files, or need help using them please open a support ticket on our" , "yikes-inc-easy-mailchimp-extender" ); ?> <a href="https://github.com/yikesinc/yikes-inc-easy-mailchimp-extender/issues" target="_blank"><?php _e( "github issue tracker" , "yikes-inc-easy-mailchimp-extender" ); ?></a>.</p></li>
3932
- </ul>
3933
- </div>
3934
- <?php
3935
- }
3936
-
3937
-
3938
- // generate a thickbox container
3939
- // to display a preview of the form
3940
- function getFormPreview($shortcode,$form_title,$form_bg_color,$form_text_color,$form_submit_button_color,$form_submit_button_text_color,$form_padding,$form_width,$form_alignment) {
3941
- ?>
3942
- <h4 style="width:100%;text-align:center;">"<?php echo trim( $form_title ); ?>" Form Preview</h4>
3943
- <div class="yks_mc_preview_form_container"><?php echo do_shortcode( stripslashes( $shortcode ) ); ?></div>
3944
- <!-- override the styles for our preview container -->
3945
- <style>
3946
- .yks-mailchimpFormContainer {
3947
- background: <?php echo $form_bg_color; ?> !important;
3948
- padding: <?php echo $form_padding; ?> !important;
3949
- color: <?php echo $form_text_color; ?> !important;
3950
- width: <?php echo $form_width; ?> !important;
3951
- <?php
3952
- if ( $form_alignment == 'left' ) {
3953
- ?>
3954
- display: block;
3955
- float: left;
3956
- <?php
3957
- } elseif ( $form_alignment == 'center' ) {
3958
- ?>
3959
- display: block;
3960
- margin: 0 auto;
3961
- <?php
3962
- } elseif ( $form_alignment == 'right' ) {
3963
- ?>
3964
- display: block;
3965
- float: right;
3966
- <?php
3967
- }
3968
- ?>
3969
- }
3970
- .yks-mailchimpFormDivRowLabel, .yks_mc_interest_group_label {
3971
- color: <?php echo $form_text_color; ?> !important;
3972
- }
3973
- .ykfmc-submit {
3974
- background: <?php echo $form_submit_button_color; ?> !important;
3975
- color: <?php echo $form_submit_button_text_color; ?> !important;
3976
- }
3977
- .yks_mc_interest_group_holder input[type=radio], .yks_mc_interest_group_holder input[type=checkbox] {
3978
- margin:0 5px 0 0 !important;
3979
- }
3980
- body.mailchimp-forms_page_yks-mailchimp-form-lists form[name="yks-mailchimp-form"] {
3981
- padding: 0 !important;
3982
- }
3983
- </style>
3984
- <?php
3985
- }
3986
-
3987
-
3988
- // Get the selected form template screenshot
3989
- function getTemplateScreenshot( $template_name , $template_screenshot , $template_path ) {
3990
-
3991
- $default_headers = array(
3992
- 'YIKES Inc. MailChimp Template',
3993
- 'YIKES Inc. MailChimp Template Author',
3994
- 'YIKES Inc. MailChimp Template Description'
3995
- );
3996
- // end pre-packaged templates
3997
- $template_file_data = get_file_data( $template_path , $default_headers );
3998
-
3999
- ?>
4000
- <div id="selected_template_preview_container">
4001
- <span class="selected_template_preview_header">
4002
- <h3 class="template_name"><?php echo $template_name; ?></h3>
4003
-
4004
- <p class="template_author"><strong><?php _e( "Author " , "yikes-inc-easy-mailchimp-extender" ); ?> :</strong> <em> <?php echo $template_file_data[1]; ?></em></p>
4005
- </span>
4006
-
4007
- <p><strong><?php _e( "Description" , "yikes-inc-easy-mailchimp-extender" ); ?> :</strong> <?php echo $template_file_data[2]; ?></p>
4008
-
4009
- <hr />
4010
-
4011
- <img class="template_screenshot preview_template_screenshot" style="max-width:100%;" src="<?php echo YKSEME_URL . 'templates/yikes-mailchimp-bundled-templates/' . str_replace( ' ' , '_' , $template_name ) . '/' . $template_screenshot; ?>">
4012
- </div>
4013
- <?php
4014
- }
4015
-
4016
- /**
4017
- * This update needs to pull in all of the custom form
4018
- * data for each of the lists, unfortunately it has to replace
4019
- * just about all of the data with the new schema. We also
4020
- * add in the flavor key (for table/div usage)
4021
- *
4022
- * 1.3.0 => 2.0.0
4023
- */
4024
- private function runUpdateTasks_1_3_0()
4025
- {
4026
- $this->optionVal['flavor'] = '0';
4027
- $this->optionVal['debug'] = '0';
4028
- if($this->optionVal['lists'])
4029
- {
4030
- foreach($this->optionVal['lists'] as $uid => $list)
4031
- {
4032
- unset($this->optionVal['lists'][$uid]);
4033
- $this->addList($list['list-id']);
4034
- }
4035
- }
4036
- $this->optionVal['version'] = '2.2.1';
4037
- return true;
4038
- }
4039
-
4040
- // Copy the user template file from within the plugin
4041
- // into the users theme root
4042
- public function copyUserTemplatesToUserTheme() {
4043
- $src = YKSEME_PATH . 'templates/yikes-mailchimp-user-templates';
4044
- $dst = get_stylesheet_directory() . '/yikes-mailchimp-user-templates';
4045
-
4046
- function recurse_copy($src,$dst) {
4047
- $dir = opendir($src);
4048
- // mkdir( $dst . '/yiks-mailchimp-user-templates/' );
4049
- mkdir( $dst );
4050
- while(false !== ( $file = readdir($dir)) ) {
4051
- if (( $file != '.' ) && ( $file != '..' )) {
4052
- if ( is_dir($src . '/' . $file) ) {
4053
- recurse_copy($src . '/' . $file,$dst . '/' . $file);
4054
- }
4055
- else {
4056
- copy($src . '/' . $file,$dst . '/' . $file);
4057
- }
4058
- }
4059
- }
4060
- closedir($dir);
4061
- }
4062
- recurse_copy( $src , $dst );
4063
-
4064
-
4065
- }
4066
-
4067
-
4068
- // recursive directory scanning
4069
- // used to retreive template files from bundled+user template directories
4070
- function buildCustomTemplateDropdown($list) {
4071
-
4072
- $bundled_template_directory = YKSEME_PATH . 'templates/yikes-mailchimp-bundled-templates/';
4073
- $bundled_template_scan = scandir($bundled_template_directory);
4074
-
4075
- $custom_template_directory = get_stylesheet_directory() . '/yikes-mailchimp-user-templates/';
4076
-
4077
- // only scan the directory when files DO exist
4078
- if( is_dir( $custom_template_directory ) ) {
4079
- $custom_template_scan = scandir($custom_template_directory);
4080
- }
4081
-
4082
- echo '<select class="template-selection-dropdown" name="yks-mc-template-file-selection" >';
4083
-
4084
- /* Bundled Template Dropdown Loop */
4085
- echo '<optgroup label="Bundled Templates">';
4086
- foreach( $bundled_template_scan as $bundled_template ) {
4087
- if( $bundled_template != '.' && $bundled_template != '..' ) {
4088
- if( is_dir( $bundled_template_directory . $bundled_template ) ) {
4089
- $template_path = $this->getTemplateFilePath($bundled_template_directory.$bundled_template);
4090
- }
4091
- // set the selected option
4092
- if ( $list['custom_template']['template_file'] == $template_path ) {
4093
- echo '<option value="' . $template_path . '" selected="selected" >' . str_replace( '_' , ' ' , $bundled_template ) . '</option>';
4094
- } else {
4095
- echo '<option value="' . $template_path . '">' . str_replace( '_' , ' ' , $bundled_template ) . '</option>';
4096
- }
4097
-
4098
- }
4099
- }
4100
- echo '</optgroup>';
4101
-
4102
-
4103
- echo '<optgroup label="Custom Templates">';
4104
-
4105
- /* Custom Template Dropdown Loop */
4106
- if( is_dir( get_stylesheet_directory() . '/yikes-mailchimp-user-templates' ) && count( $custom_template_scan ) >= 1 ) {
4107
-
4108
- foreach( $custom_template_scan as $custom_template ) {
4109
- if( $custom_template != '.' && $custom_template != '..' ) {
4110
- if( is_dir( $custom_template_directory . $custom_template ) ) {
4111
- $custom_template_path = $this->getTemplateFilePath($custom_template_directory.$custom_template);
4112
- }
4113
- // set the selected option
4114
- if ( $list['custom_template']['template_file'] == $custom_template_path ) {
4115
- echo '<option value="' . $custom_template_path . '" selected="selected" >' . str_replace( '_' , ' ' , $custom_template ) . '</option>';
4116
- } else {
4117
- echo '<option value="' . $custom_template_path . '">' . str_replace( '_' , ' ' , $custom_template ) . '</option>';
4118
- }
4119
-
4120
- }
4121
- }
4122
-
4123
- } else {
4124
- echo '<option value="" disabled="disabled">None Found</option>';
4125
- }
4126
-
4127
- echo '</optgroup>';
4128
-
4129
- echo '</select>';
4130
-
4131
-
4132
-
4133
- }
4134
-
4135
- // function to return our form template path
4136
- function getTemplateFilePath($directory) {
4137
-
4138
- $get_files = scandir($directory);
4139
- $sub_files = array();
4140
-
4141
- foreach( $get_files as $file ) {
4142
-
4143
- if($file != '.' && $file != '..') {
4144
- $explode_file = explode( '.' , $file );
4145
- $file_extension = $explode_file[1];
4146
- if ( $file_extension == 'php' ) {
4147
- $file_extension_path = $directory . '/' . $file;
4148
- }
4149
-
4150
- }
4151
- }
4152
-
4153
- return $file_extension_path;
4154
-
4155
- }
4156
-
4157
- /**
4158
- * This update needs to pull in all of the custom form
4159
- * data for each of the lists, unfortunately it has to replace
4160
- * just about all of the data with the new schema. We also
4161
- * add in the flavor key (for table/div usage)
4162
- *
4163
- * 4.3 => 5.0.4
4164
- */
4165
- private function runUpdateTasks_4_3()
4166
- {
4167
- if ( !isset( $this->optionVal['recaptcha-setting'] ) ) {
4168
- $this->optionVal['recaptcha-setting'] = '0';
4169
- }
4170
- if ( !isset( $this->optionVal['recaptcha-api-key'] ) ) {
4171
- $this->optionVal['recaptcha-api-key'] = '';
4172
- }
4173
- if ( !isset( $this->optionVal['recaptcha-private-api-key'] ) ) {
4174
- $this->optionVal['recaptcha-private-api-key'] = '';
4175
- }
4176
- if ( !isset( $this->optionVal['recaptcha-style'] ) ) {
4177
- $this->optionVal['recaptcha-style'] = 'default';
4178
- }
4179
- $this->optionVal['version'] = '5.0.4';
4180
- return true;
4181
- }
4182
-
4183
-
4184
- //
4185
- // Adding Opt-In Checkbox to comment forms
4186
- // To Do : Add setting to show/hide checkbox on frontend
4187
- //
4188
- // display a checkbox in the comment form
4189
- // submit the user to mailchimp on a successful comment submission
4190
- function ymc_add_meta_settings($comment_id) {
4191
- add_comment_meta(
4192
- $comment_id,
4193
- 'mailchimp_subscribe',
4194
- $_POST['mailchimp_subscribe'],
4195
- true
4196
- );
4197
- }
4198
-
4199
- function add_after_comment_form($arg) {
4200
-
4201
- $custom_text = trim($this->optionVal['yks-mailchimp-optin-checkbox-text']);
4202
- if ( $custom_text == '' ) {
4203
- $custom_text = __("Sign Me Up For MAILCHIMP-REPLACE-THIS-TEXT's Newsletter", "gettext");
4204
- } else {
4205
- $custom_text = $custom_text;
4206
- }
4207
-
4208
- // set the default checked state here...
4209
- $arg['comment_notes_after'] = '<label for="yikes_mailchimp_comment_subscribe">
4210
- <input type="checkbox" name="mailchimp_subscribe" id="yikes_mailchimp_comment_subscribe" checked="checked" />
4211
- '.$custom_text.'
4212
- </label>';
4213
- return $arg;
4214
-
4215
- }
4216
-
4217
- // Replacing 'MAILCHIMP-REPLACE-THIS-TEXT' text with sitename
4218
- function yikes_mc_replace_this_text( $text ) {
4219
- $newtext = get_bloginfo('name');
4220
- $text = str_replace( 'MAILCHIMP-REPLACE-THIS-TEXT', $newtext, $text );
4221
- return $text;
4222
- }
4223
-
4224
-
4225
- function ymc_subscription_add( $cid, $comment='' ) {
4226
- $cid = (int) $cid;
4227
- $yikes_api_key = $this->optionVal['api-key'];
4228
- $exploded_api_key = explode('-',$yikes_api_key);
4229
- $yikes_data_center = $exploded_api_key[1];
4230
-
4231
- if ( !is_object($comment) )
4232
- $comment = get_comment($cid);
4233
-
4234
- if ( $comment->comment_karma == 0 ) {
4235
- $subscribe = get_comment_meta($cid, 'mailchimp_subscribe', true);
4236
- if ( $subscribe == 'on' ) {
4237
- global $current_user;
4238
- get_currentuserinfo();
4239
- $commenter_first_name = trim($current_user->user_firstname);
4240
- $commenter_last_name = trim($current_user->user_lastname);
4241
-
4242
- if( isset( $commenter_first_name ) && $commenter_first_name != '' ) {
4243
- $commenter_first_name = $commenter_first_name; // use the users first name set in the profile
4244
- } else {
4245
- $commenter_first_name = $comment->comment_author; // if no first name is set in the user profile, we will use the account name
4246
- }
4247
-
4248
- if( isset( $commenter_last_name ) && $commenter_last_name != '' ) {
4249
- $commenter_last_name = $commenter_last_name; // use the users last name set in the profile
4250
- } else {
4251
- $commenter_last_name = 'n/a'; // if the user has not set a last name in their profile, we set it to n/a
4252
- }
4253
-
4254
- // store our API key
4255
- // on the settings page, if they have chosen to display the checkbox
4256
- $api = new wpyksMCAPI($this->optionVal['api-key']);
4257
-
4258
- $apikey = $yikes_api_key;
4259
- $listid = $this->optionVal['yks-mailchimp-optIn-default-list']; // Need to set up a default list to subscribe all users to
4260
- $endpoint = 'https://api.mailchimp.com';
4261
- $optin = $this->optionVal['optin'];
4262
-
4263
- // try adding subscriber, catch any error thrown
4264
- try {
4265
- $retval = $api->call('lists/subscribe', array(
4266
- 'id' => $listid, // form id
4267
- 'email' => array(
4268
- 'email' => $comment->comment_author_email
4269
- ),
4270
- 'merge_vars' => array(
4271
- 'FNAME' => $commenter_first_name,
4272
- 'LNAME' => $commenter_last_name,
4273
- 'NAME' => $commenter_first_name
4274
- ),
4275
- 'double_optin' => $optin, // double optin value (retreived from the settings page)
4276
- 'send_welcome' => true
4277
- ));
4278
- return "done";
4279
- } catch( Exception $e ) { // catch any errors returned from MailChimp
4280
- $error_message = $e->getMessage();
4281
- if (strpos($error_message,'Click here to update your profile.') !== false) {
4282
- $errorMessage = str_replace('Click here to update your profile.', '', $e->getMessage());
4283
- $errorMessage_explode = explode('to list', $errorMessage);
4284
- echo $errorMessage_explode[0].'.';
4285
- die();
4286
- }
4287
- if (strpos($error_message,'Invalid') !== false) {
4288
- $display_errorMessage = str_replace('Invalid MailChimp List ID:', "Oops! The Webmaster hasn't set up the default MailChimp list to subscribe you too. Please contact them and let them know of this error. In the meantime, un-check the subscription checkbox in the comment form when submitting comments.", $error_message);
4289
- echo $display_errorMessage;
4290
- die();
4291
- } else {
4292
- // str_replace('Invalid MailChimp List ID: .', 'The Webmaster hasn\t set up the default MailChimp list to subscribe you too. Please contact them and let them know of this error. In the meantime, un-check the subscription checkbox in the comment form when submitting comments.', $e->getMessage());
4293
- echo $errorMessage;
4294
- die();
4295
- }
4296
- }
4297
-
4298
-
4299
- }
4300
- }
4301
- }
4302
-
4303
- // add our actions on initialize
4304
- // inside of __construct()
4305
- public function ykes_mc_apply_filters() {
4306
- // if the optin checkbox setting is set to show
4307
- // we wiill display the checkbox on the front end
4308
- if ( $this->optionVal['optIn-checkbox'] == 1 ) {
4309
- add_action('comment_post', array(&$this, 'ymc_add_meta_settings'), 10, 2);
4310
- add_action('comment_approved_', array(&$this, 'ymc_subscription_add'), 60, 2);
4311
- add_action('comment_post', array(&$this, 'ymc_subscription_add'));
4312
- add_filter('gettext', array(&$this, 'yikes_mc_replace_this_text'));
4313
- // only display the checkbox if the user is logged in, and the default list is set
4314
- if( is_user_logged_in() && isset( $this->optionVal['yks-mailchimp-optIn-default-list'] ) && $this->optionVal['yks-mailchimp-optIn-default-list'] != 'select_value' ) {
4315
- add_filter('comment_form_defaults', array(&$this, 'add_after_comment_form'));
4316
- }
4317
- }
4318
- }
4319
-
4320
-
4321
- /****
4322
- **
4323
- ** Custom The_Content filter
4324
- ** used to prevent other plugins from hooking here
4325
- **
4326
- ****/
4327
- function yks_mc_content() {
4328
- //Create our own version of the_content so that others can't accidentally loop into our output - Taken from default-filters.php, shortcodes.php, and media.php
4329
- if ( !has_filter( 'yks_mc_content', 'wptexturize' ) ) {
4330
- add_filter( 'yks_mc_content', 'wptexturize' );
4331
- add_filter( 'yks_mc_content', 'convert_smilies' );
4332
- add_filter( 'yks_mc_content', 'convert_chars' );
4333
- add_filter( 'yks_mc_content', 'wpautop' );
4334
- add_filter( 'yks_mc_content', 'shortcode_unautop' );
4335
- add_filter( 'yks_mc_content', 'prepend_attachment' );
4336
- $vidembed = new WP_Embed();
4337
- add_filter( 'yks_mc_content', array( &$vidembed, 'run_shortcode'), 8 );
4338
- add_filter( 'yks_mc_content', array( &$vidembed, 'autoembed'), 8 );
4339
- add_filter( 'yks_mc_content', 'do_shortcode', 11);
4340
- } //end has_filter
4341
- } //end yks_mc_content
4342
-
4343
-
4344
- // Check if cURL is enabled at the server level
4345
- // used on the options.php page
4346
- public function yikes_curl_check() {
4347
- if (in_array ('curl', get_loaded_extensions())) {
4348
- return true;
4349
- }
4350
- else {
4351
- return false;
4352
- }
4353
- }
4354
-
4355
- // check if php.ini exists in the site root
4356
- function yks_check_if_php_ini_exists() {
4357
-
4358
- // get php ini path from
4359
- // the actively loaded php ini file
4360
- $wordpress_site_root = str_replace('php.ini','',php_ini_loaded_file());
4361
- // file name
4362
- $filename = '/php.ini';
4363
-
4364
- $php_ini_location = php_ini_loaded_file();
4365
-
4366
- if (file_exists($wordpress_site_root.$filename)) {
4367
- echo "<span class='yks_mc_no_phpini_success'>Good News </span>: We have located your <strong>".str_replace('/','',$filename)."</strong> file inside the directory <strong>".$wordpress_site_root."</strong>";
4368
- $filename = '/php.ini';
4369
- } else {
4370
- echo "<span class='yks_mc_no_phpini_alert'>Alert </span>: No <strong>".str_replace('/','',$filename)."</strong> was located in <strong>".$wordpress_site_root.'/'."</strong>.";
4371
- $filename = '/php.ini';
4372
- }
4373
-
4374
-
4375
- }
4376
-
4377
- // display the php.ini location to the user
4378
- function yks_display_php_ini_location() {
4379
- echo php_ini_loaded_file();
4380
- }
4381
-
4382
-
4383
- //
4384
- // Add TinyMCE Buttons to the TinyMCE Editor
4385
- // We'll use the button to place form shortcodes!
4386
- // NOTE: This only runs on 3.9 or greater -> due to tinyMCE 4.0
4387
- //
4388
- // Custom TinyMCE Button to insert form shortcodes onto pages and posts
4389
- function yks_mc_add_tinyMCE() {
4390
-
4391
- global $typenow;
4392
- // only on Post Type: post and page
4393
- if( ! in_array( $typenow, array( 'post', 'page' ) ) )
4394
- return ;
4395
-
4396
- }
4397
-
4398
- // inlcude the js for tinymce
4399
- function yks_mc_add_tinymce_plugin( $plugin_array ) {
4400
-
4401
- $plugin_array['yks_mc_tinymce_button'] = plugins_url( '/../js/yks_mc_tinymce_button.js', __FILE__ );
4402
- // Print all plugin js path
4403
- // var_dump( $plugin_array );
4404
- return $plugin_array;
4405
-
4406
- }
4407
-
4408
- // Add the button key for address via JS
4409
- function yks_mc_add_tinymce_button( $buttons ) {
4410
-
4411
- array_push( $buttons, 'yks_mc_tinymce_button_key' );
4412
- // Print all buttons
4413
- // var_dump( $buttons );
4414
- return $buttons;
4415
-
4416
- }
4417
-
4418
- /**
4419
- * Localize Script
4420
- * Pass our imported list data, to the JS file
4421
- * to build the dropdown list in the modal
4422
- */
4423
- function yks_mc_js_admin_head()
4424
- {
4425
-
4426
- $yks_mc_imported_list_data = $this->optionVal['lists'];
4427
- // our list data array, we will pass to the js file
4428
- $list_value_array = array();
4429
- $i = 0;
4430
- // loop over the list data
4431
- foreach ( $yks_mc_imported_list_data as $single_list ) {
4432
- // store it temporarily and push it back to our array
4433
- $list_value_array[$i]['text'] = $single_list['name'];
4434
- $list_value_array[$i]['value'] = $single_list['id'];
4435
- $i++;
4436
- }
4437
- ?>
4438
- <!-- TinyMCE Shortcode Plugin -->
4439
- <script type='text/javascript'>
4440
- var yks_mc_lists_data = {
4441
- 'lists': <?php echo json_encode($list_value_array); ?>
4442
- };
4443
- </script>
4444
- <!-- TinyMCE Shortcode Plugin -->
4445
- <?php
4446
-
4447
- }
4448
-
4449
-
4450
- /* Checking if the user is on localhost */
4451
- /* If they are we want to display a warning about SSL on localhost */
4452
- function yks_mc_is_user_localhost() {
4453
- $whitelist = array( '127.0.0.1', '::1' );
4454
- if( in_array( $_SERVER['REMOTE_ADDR'], $whitelist) )
4455
- return true;
4456
- }
4457
-
4458
- /*******************************************************/
4459
- /* Helper Functions */
4460
- /******************************************************/
4461
- /*
4462
- *
4463
- * Helper function when testing user submitted data
4464
- * to be used inside of the yikes_mc_get_form_data filter
4465
- *
4466
- */
4467
- function yks_mc_print_user_data( $form_ID, $merge_variables ) {
4468
-
4469
- echo '<h3>The Data Returned From This Form</h3>';
4470
-
4471
- echo '<strong>MailChimp List ID : </strong> '.$form_ID.' <br />';
4472
-
4473
- echo '<hr />';
4474
-
4475
- if ( isset( $merge_variables['FNAME'] ) && $merge_variables['FNAME'] != '' ) {
4476
- echo '<strong>User\'s Name : </strong> '.$merge_variables['FNAME'].' <br />';
4477
-
4478
- echo '<hr />';
4479
-
4480
- }
4481
-
4482
- if ( isset( $merge_variables['LNAME'] ) && $merge_variables['LNAME'] != '' ) {
4483
- echo '<strong>User\'s Name : </strong> '.$merge_variables['LNAME'].' <br />';
4484
-
4485
- echo '<hr />';
4486
-
4487
- }
4488
-
4489
- echo '<strong>Users Email : </strong>'.$merge_variables['EMAIL'].' <br />';
4490
-
4491
- if ( isset( $merge_variables['GROUPINGS'] ) ) {
4492
-
4493
- echo '<hr />';
4494
-
4495
- echo '<strong>Interest Group Data : </strong><br /><br />';
4496
-
4497
- foreach ( $merge_variables['GROUPINGS'] as $grouping_variable ) {
4498
-
4499
- echo '<ol style="list-style:none;">Interest Group : '.$grouping_variable['id'].'</ol>';
4500
-
4501
- if ( !isset($grouping_variable['groups'][0]) || $grouping_variable['groups'][0] == '' ) {
4502
-
4503
- echo '<li style="list-style:none;">No interest groups selected</li><br />';
4504
-
4505
- } else {
4506
-
4507
- // loop over interest groups to build array
4508
- $interest_group_array = array();
4509
- foreach ( $grouping_variable['groups'] as $interest_group ) {
4510
- array_push( $interest_group_array , $interest_group );
4511
- }
4512
-
4513
- if ( count($interest_group_array) > 0 ) {
4514
- foreach ( $interest_group_array as $interest_group_label ) {
4515
- echo '<li style="list-style:none;">'.$interest_group_label.'</li>';
4516
- }
4517
- echo '<br />';
4518
- }
4519
-
4520
- }
4521
- }
4522
-
4523
- }
4524
-
4525
- echo '<em style="color:rgb(238, 93, 93);">Form data has not been sent to MailChimp</em><br />';
4526
-
4527
- die(); // die to prevent data being sent over to MailChimp
4528
-
4529
- }
4530
- /*
4531
- *
4532
- * Helper function when testing user submitted data
4533
- * print_r($merge_variables) is returned
4534
- *
4535
- */
4536
- function yks_mc_dump_user_data( $form_ID, $merge_variables ) {
4537
- echo '<strong>Form ID :</strong> '.$form_ID. '<br />';
4538
- echo '<strong>Merge Variables :</strong><br />';
4539
- print_r($merge_variables);
4540
- echo '<br /><em style="color:rgb(238, 93, 93);">Form data has not been sent to MailChimp</em>';
4541
- die(); // die to prevent data being sent over to MailChimp
4542
- }
4543
-
4544
-
4545
-
4546
-
4547
- /****************************************************************************************
4548
- *
4549
- * Begin Heartbeat API Code
4550
- * - Used on the Account Activity page for lilve updates
4551
- *
4552
- ****************************************************************************************/
4553
-
4554
- /*
4555
- Client-side code. First we enqueue the Heartbeat API and our Javascript.
4556
-
4557
- Our Javascript is then setup to always send the message 'marco' to the server.
4558
- If a message comes back, the Javascript logs it (polo) to console.
4559
- */
4560
-
4561
- //enqueue heartbeat.js and our Javascript
4562
- function yks_mc_heartbeat_init()
4563
- {
4564
- /*
4565
- //Add your conditionals here so this runs on the pages you want, e.g.
4566
- if(is_admin())
4567
- return; //don't run this in the admin
4568
- */
4569
-
4570
- //enqueue the Heartbeat API
4571
- wp_enqueue_script('heartbeat');
4572
-
4573
- //load our Javascript in the footer
4574
- add_action("admin_print_footer_scripts", array( &$this ,"yks_mc_heartbeat_admin_footer" ) );
4575
- }
4576
-
4577
-
4578
- //our Javascript to send/process from the client side
4579
- function yks_mc_heartbeat_admin_footer()
4580
- {
4581
-
4582
- $request_uri = "$_SERVER[REQUEST_URI]";
4583
- global $pagenow;
4584
-
4585
- // Only proceed if on the the my mailchimp page
4586
- // and the chimp-chatter tab
4587
- if( 'admin.php?page=yks-mailchimp-my-mailchimp&tab=chimp_chatter' != basename($request_uri) && 'index.php' != $pagenow )
4588
- return;
4589
-
4590
- ?>
4591
- <script>
4592
- jQuery(document).ready(function() {
4593
-
4594
- //hook into heartbeat-send: client will send the message 'marco' in the 'client' var inside the data array
4595
- jQuery(document).on('heartbeat-send', function(e, data) {
4596
- <?php if( 'index.php' == $pagenow ) { ?>
4597
- // send some data
4598
- // to begin the ajax
4599
- data['yks_mc_chimp_chatter_heartbeat'] = 'get_chimp_chatter_widget_data';
4600
- <?php } else { ?>
4601
- // send some data
4602
- // to begin the ajax
4603
- data['yks_mc_chimp_chatter_heartbeat'] = 'get_chimp_chatter_data';
4604
- <?php } ?>
4605
- });
4606
-
4607
- //hook into heartbeat-tick: client looks for a 'server' var in the data array and logs it to console
4608
- jQuery(document).on('heartbeat-tick', function(e, data) {
4609
-
4610
- // pass our API key along
4611
- var apiKey = '<?php echo $this->optionVal['api-key']; ?>';
4612
-
4613
- // store datacenter value, from end of api key
4614
- var dataCenter = apiKey.substr(apiKey.indexOf("-") + 1);
4615
-
4616
- if(data['yks_mc_chimp_chatter_data'] == 'Get MailChimp Chatter Data' ) {
4617
-
4618
- // update the chimp chatter div with new info
4619
- // heartbeat api
4620
- jQuery.ajax({
4621
- type: 'POST',
4622
- url: ajaxurl,
4623
- data: {
4624
- action: 'yks_mailchimp_form',
4625
- form_action: 'yks_get_chimp_chatter',
4626
- api_key: apiKey,
4627
- data_center: dataCenter
4628
- },
4629
- dataType: 'html',
4630
- success: function(response) {
4631
-
4632
- // store the new response, in the new response hidden div, for comparison
4633
- jQuery('#new_chimp_chatter_response').html(response);
4634
-
4635
- // wrap our emails in the hidden new response with
4636
- // <a> to match the original response
4637
- jQuery("#new_chimp_chatter_response").find("td:nth-child(4)").each(function() {
4638
- jQuery(this).filter(function(){
4639
- var html = jQuery(this).html();
4640
- // regex email pattern,
4641
- // to wrap our emails in a link
4642
- var emailPattern = /[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}/g;
4643
- var matched_str = jQuery(this).html().match(emailPattern);
4644
- var matched_str = jQuery(this).html().match(emailPattern);
4645
- if(matched_str){
4646
- var text = jQuery(this).html();
4647
- jQuery.each(matched_str, function(index, value){
4648
- text = text.replace(value,"<a href='mailto:"+value+"'>"+value+"</a>");
4649
- });
4650
- jQuery(this).html(text);
4651
- return jQuery(this)
4652
- }
4653
- });
4654
- });
4655
-
4656
- // checking if the response is new...
4657
- if ( jQuery('#new_chimp_chatter_response').html() == jQuery('#original_chimp_chatter_response').html() ) {
4658
-
4659
- console.log('the data is the same. no action taken.');
4660
-
4661
- } else {
4662
-
4663
- // remove the new stars
4664
- jQuery('.fadeInDown').each(function() {
4665
- jQuery(this).removeClass('animated').removeClass('fadeInDown').removeClass('new-chatter-item');
4666
- });
4667
-
4668
- // count the new chatter items ( divide by 2 , for the spacer tr )
4669
- var new_chatter_count = parseInt( jQuery('#new_chimp_chatter_response').find('.chatter-table-row').length / 2 );
4670
- // count the original chatter items ( divide by 2 , for the spacer tr )
4671
- var original_chatter_count = parseInt( jQuery('#original_chimp_chatter_response').find('.chatter-table-row').length / 2 );
4672
-
4673
- // calculate the number of new items
4674
- var number_of_new_items = parseInt( new_chatter_count - original_chatter_count );
4675
-
4676
- // test the count of items,
4677
- // console.log('The original count is : '+original_chatter_count);
4678
- // console.log('The new count is : '+new_chatter_count);
4679
-
4680
-
4681
- // give feedback that new data was found
4682
- console.log('new mailchimp chatter data found. Re-populating....');
4683
-
4684
- // store the new response, in the original response
4685
- // field for comparison when heartbeat runs again
4686
- jQuery('#original_chimp_chatter_response').html(response);
4687
-
4688
-
4689
- // up next -- growl notifications!
4690
- // for real time subscribes/unsubscribes/shares notifications all over the dashboard
4691
-
4692
-
4693
- var i = 1;
4694
-
4695
- function new_chatter_loop_and_append() {
4696
-
4697
- setInterval(function() {
4698
-
4699
- // this code is executed every 5 seconds:
4700
- // animate the new items in
4701
- // .....badass....
4702
- while (i <= number_of_new_items) {
4703
-
4704
- var item_to_append = jQuery('#new_chimp_chatter_response').find('.chatter-content-row:nth-child('+i+')');
4705
-
4706
- jQuery('.mailChimpChatterDiv').find('.chatter-table-row:first-child').before('<tr class="chatter-table-row chatter-spacer-row"><td>&nbsp;</td></tr>');
4707
- jQuery('.mailChimpChatterDiv').find('.chatter-table-row:first-child').before( item_to_append.addClass('fadeInDown animated new-chatter-item') );
4708
-
4709
- i++;
4710
-
4711
- }
4712
-
4713
- }, 6000 );
4714
-
4715
- }
4716
-
4717
- // loop over our new items and append them to the current page
4718
- new_chatter_loop_and_append();
4719
-
4720
-
4721
-
4722
- // re-apply the link wrapping the new items
4723
- // so the new items match the old items
4724
- jQuery("#original_chimp_chatter_response table#yks-admin-chimp-chatter .chatter-table-row td:nth-child(4)").each(function() {
4725
- jQuery(this).filter(function(){
4726
- var html = jQuery(this).html();
4727
- // regex email pattern,
4728
- // to wrap our emails in a link
4729
- var emailPattern = /[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}/g;
4730
- var matched_str = jQuery(this).html().match(emailPattern);
4731
- var matched_str = jQuery(this).html().match(emailPattern);
4732
- if(matched_str){
4733
- var text = jQuery(this).html();
4734
- jQuery.each(matched_str, function(index, value){
4735
- text = text.replace(value,"<a href='mailto:"+value+"'>"+value+"</a>");
4736
- });
4737
- jQuery(this).html(text);
4738
- return jQuery(this)
4739
- }
4740
- });
4741
- });
4742
-
4743
- // give some feedback
4744
- console.log( "Populated the chimpchatter div with new content." );
4745
-
4746
- }
4747
-
4748
- // let user know heartbeat is running
4749
- console.log('heartbeat found...');
4750
-
4751
- },
4752
- error: function(response) {
4753
- // do nothing here,
4754
- // incase we inturrupt it with a page change
4755
- }
4756
-
4757
- });
4758
-
4759
- // Run this on the Dashboard, to re-populate the
4760
- // mailchimp activity widget!
4761
- } else if(data['yks_mc_chimp_chatter_data'] == 'Get MailChimp Chatter Widget Data' ) {
4762
-
4763
-
4764
- // update the chimp chatter div with new info
4765
- // heartbeat api
4766
- jQuery.ajax({
4767
- type: 'POST',
4768
- url: ajaxurl,
4769
- data: {
4770
- action: 'yks_mailchimp_form',
4771
- form_action: 'yks_get_widget_chimp_chatter',
4772
- api_key: apiKey,
4773
- data_center: dataCenter
4774
- },
4775
- dataType: 'html',
4776
- success: function(response) {
4777
-
4778
-
4779
- // store the new response, in the new response hidden div, for comparison
4780
- jQuery('#new_chimp_chatter_response').html(response);
4781
-
4782
-
4783
- // checking if the response is new...
4784
- if ( jQuery('#new_chimp_chatter_response').html() == jQuery('#original_chimp_chatter_response').html() ) {
4785
-
4786
- console.log('the data is the same. no action taken.');
4787
-
4788
- } else {
4789
-
4790
- // remove the new stars
4791
- jQuery('.fadeInDown').each(function() {
4792
- jQuery(this).removeClass('animated').removeClass('fadeInDown').removeClass('new-chatter-item');
4793
- });
4794
-
4795
- // count the new chatter items ( divide by 2 , for the spacer tr )
4796
- var new_chatter_count = parseInt( jQuery('#new_chimp_chatter_response').find('.chatter-content-row').length );
4797
- // count the original chatter items ( divide by 2 , for the spacer tr )
4798
- var original_chatter_count = parseInt( jQuery('#original_chimp_chatter_response').find('.chatter-content-row').length );
4799
-
4800
- // calculate the number of new items
4801
- var number_of_new_items = parseInt( new_chatter_count - original_chatter_count );
4802
-
4803
- // test the count of items,
4804
- // console.log('The original count is : '+original_chatter_count);
4805
- // console.log('The new count is : '+new_chatter_count);
4806
-
4807
-
4808
- // give feedback that new data was found
4809
- console.log('new mailchimp chatter data found. Re-populating....');
4810
-
4811
- // store the new response, in the original response
4812
- // field for comparison when heartbeat runs again
4813
- jQuery('#original_chimp_chatter_response').html(response);
4814
-
4815
-
4816
- // up next -- growl notifications!
4817
- // for real time subscribes/unsubscribes/shares notifications all over the dashboard
4818
-
4819
-
4820
- var i = 1;
4821
-
4822
- function new_chatter_loop_and_append() {
4823
-
4824
- setInterval(function() {
4825
-
4826
- // this code is executed every 5 seconds:
4827
- // animate the new items in
4828
- // .....badass....
4829
- while (i <= number_of_new_items) {
4830
-
4831
- var item_to_append = jQuery('#new_chimp_chatter_response').find('.chatter-content-row:nth-child('+i+')');
4832
-
4833
- jQuery('.yks_mailChimp_Chatter').find('.chatter-table-row:first-child').before( item_to_append.addClass('fadeInDown animated new-chatter-item') );
4834
-
4835
- i++;
4836
-
4837
- }
4838
-
4839
- }, 6000 );
4840
-
4841
- }
4842
-
4843
- // loop over our new items and append them to the current page
4844
- new_chatter_loop_and_append();
4845
-
4846
-
4847
-
4848
- // re-apply the link wrapping the new items
4849
- // so the new items match the old items
4850
- jQuery("#original_chimp_chatter_response table#yks-admin-chimp-chatter .chatter-table-row td:nth-child(4)").each(function() {
4851
- jQuery(this).filter(function(){
4852
- var html = jQuery(this).html();
4853
- // regex email pattern,
4854
- // to wrap our emails in a link
4855
- var emailPattern = /[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}/g;
4856
- var matched_str = jQuery(this).html().match(emailPattern);
4857
- var matched_str = jQuery(this).html().match(emailPattern);
4858
- if(matched_str){
4859
- var text = jQuery(this).html();
4860
- jQuery.each(matched_str, function(index, value){
4861
- text = text.replace(value,"<a href='mailto:"+value+"'>"+value+"</a>");
4862
- });
4863
- jQuery(this).html(text);
4864
- return jQuery(this)
4865
- }
4866
- });
4867
- });
4868
-
4869
- // give some feedback
4870
- console.log( "Populated the chimpchatter div with new content." );
4871
-
4872
- }
4873
-
4874
- // let user know heartbeat is running
4875
- console.log('heartbeat found...');
4876
-
4877
- },
4878
- error: function(response) {
4879
- // do nothing here,
4880
- // incase we inturrupt it with a page change
4881
- }
4882
-
4883
- });
4884
-
4885
-
4886
- }
4887
-
4888
-
4889
- });
4890
-
4891
- //hook into heartbeat-error: in case of error, let's log some stuff
4892
- jQuery(document).on('heartbeat-error', function(e, jqXHR, textStatus, error) {
4893
- console.log('<< BEGIN ERROR');
4894
- console.log(textStatus);
4895
- console.log(error);
4896
- console.log('END ERROR >>');
4897
- });
4898
-
4899
- });
4900
- </script>
4901
- <?php
4902
- }
4903
-
4904
-
4905
- /*
4906
- Our server-side code.
4907
- ------------------------------
4908
- This hooks into the heartbeat_received filter.
4909
- It checks for a key 'client' in the data array. If it is set to 'get_chimp_chatter_data',
4910
- a key 'server' is set to 'Get MailChimp Chatter Data' in the response array.
4911
- */
4912
- function yks_mc_heartbeat_received($response, $data) {
4913
-
4914
- // if the client returns get chimp chatter data, popluate
4915
- // the response with some data
4916
- if( $data['yks_mc_chimp_chatter_heartbeat'] == 'get_chimp_chatter_data' ) {
4917
- // populate the response with something
4918
- $response['yks_mc_chimp_chatter_data'] = 'Get MailChimp Chatter Data';
4919
- } else if ( $data['yks_mc_chimp_chatter_heartbeat'] == 'get_chimp_chatter_widget_data' ) {
4920
- $response['yks_mc_chimp_chatter_data'] = 'Get MailChimp Chatter Widget Data';
4921
- }
4922
-
4923
- return $response;
4924
-
4925
- }
4926
-
4927
- /** Change Default HeartBeat API Pulse Time */
4928
- function yks_mc_tweak_heartbeat_settings( $settings ) {
4929
- $settings['interval'] = 45; //Anything between 15-60
4930
- return $settings;
4931
- }
4932
-
4933
-
4934
-
4935
-
4936
- /*******************************************************
4937
- Custom Dashboard MailChimp Account Activity Widget
4938
- ********************************************************/
4939
- /**
4940
- * Add a widget to the dashboard.
4941
- *
4942
- * This function is hooked into the 'wp_dashboard_setup' action below.
4943
- */
4944
- function yks_mc_add_chimp_chatter_dashboard_widget() {
4945
-
4946
- wp_add_dashboard_widget(
4947
- 'yks_mc_account_activity_widget', // Widget slug.
4948
- 'MailChimp Account Activity', // Title.
4949
- array( &$this , 'yks_mc_chimp_chatter_dashboard_widget_function' ) // Display function.
4950
- );
4951
-
4952
- }
4953
-
4954
-
4955
- /**
4956
- * Create the function to output the contents of our Dashboard Widget.
4957
- */
4958
- function yks_mc_chimp_chatter_dashboard_widget_function() {
4959
- // Trigger our ajax call, and then include our ChimpChatter template
4960
- // to properly populate the data
4961
- ?>
4962
- <!--
4963
- apply our styles on initial page load,
4964
- this is for adding our icon to the widget title,
4965
- for a little branding action
4966
- -->
4967
- <style>
4968
- #yks_mc_account_activity_widget > h3 > span:before {
4969
- content: url('<?php echo plugins_url(); ?>/yikes-inc-easy-mailchimp-extender/images/yikes_logo_widget_icon.png');
4970
- width:33px;
4971
- float:left;
4972
- height:10px;
4973
- margin: -3px 10px 0 0px;
4974
- }
4975
- </style>
4976
- <script type="text/javascript">
4977
- jQuery(document).ready(function() {
4978
- // add the preloader to the widget
4979
- jQuery('#yks-admin-chimp-chatter').html();
4980
-
4981
- var apiKey = '<?php echo $this->optionVal['api-key']; ?>';
4982
- jQuery('#yks-mailchimp-api-key').val();
4983
- // store datacenter value, from end of api key
4984
- var dataCenter = apiKey.substr(apiKey.indexOf("-") + 1);
4985
-
4986
- // post the data to our MailChimp Chatter function inside of lib.ajax.php
4987
- jQuery.ajax({
4988
- type: 'POST',
4989
- url: ajaxurl,
4990
- data: {
4991
- action: 'yks_mailchimp_form',
4992
- form_action: 'yks_get_widget_chimp_chatter',
4993
- api_key: apiKey,
4994
- data_center: dataCenter
4995
- },
4996
- dataType: 'html',
4997
- success: function(response) {
4998
-
4999
- // populate the original chimp chatter input with our original response
5000
- jQuery('#yks_mc_account_activity_widget').find('.inside').html(response);
5001
-
5002
- // create hidden input fields to store our returned data for comparison
5003
- // create our new chimp chatter response field
5004
- jQuery('#yks-admin-chimp-chatter').before('<div style="display:none;" id="new_chimp_chatter_response"></div>');
5005
- // create our original chimp chatter response
5006
- jQuery('#yks-admin-chimp-chatter').before('<div style="display:none;" id="original_chimp_chatter_response"></div>');
5007
-
5008
- // populate the visible chimp chatter div with the content
5009
- // on original page load
5010
- jQuery('#yks-admin-chimp-chatter').not('#new_chimp_chatter_response').html(response);
5011
- jQuery('#original_chimp_chatter_response').html(response);
5012
-
5013
-
5014
- },
5015
- error: function(response) {
5016
- jQuery('.nav-tab-wrapper').after('<p style="width:100%;text-align:center;margin:1em 0;">There was an error processing your request. Please try again. If this error persists, please open a support thread <a href="https://github.com/yikesinc/yikes-inc-easy-mailchimp-extender" title="Yikes Inc Easy MailChimp GitHub Issue Tracker" target="_blank">here</a>.</p>');
5017
- }
5018
- });
5019
- });
5020
- </script>
5021
- <?php
5022
-
5023
- ?><img style="display:block;margin:0 auto;margin-top:2em;margin-bottom:1em;" class="mailChimp_get_subscribers_preloader" src="<?php echo admin_url().'/images/wpspin_light.gif'; ?>" alt="preloader" ><?php
5024
- }
5025
-
5026
- }
5027
- }
5028
  ?>
1
+ <?php
2
+ if(!class_exists("yksemeBase")) {
3
+ class yksemeBase {
4
+
5
+ /**
6
+ * Variables
7
+ */
8
+ private $error = false;
9
+ private $errorMsg = '';
10
+ public $sessName = 'ykseme';
11
+ public $optionVal = false;
12
+ public $currentLists = false;
13
+ public $currentListsCt = false;
14
+
15
+ /**
16
+ * Construct
17
+ */
18
+ public function __construct() {
19
+ yksemeBase::initialize();
20
+ add_action('init', array(&$this, 'ykes_mc_apply_filters'));
21
+ }
22
+
23
+ /**
24
+ * Destruct
25
+ */
26
+ public function __destruct() {
27
+ unset($this);
28
+ }
29
+
30
+ /**
31
+ * Actions
32
+ * These are called when the plug in is initialized/deactivated/un-installed
33
+ */
34
+ public function activate() {
35
+ // redirect the user on plugin activation
36
+ // to our MailChimp settings page
37
+ add_option('yks_easy_mc_plugin_do_activation_redirect', true);
38
+
39
+ // check if our option is already set
40
+ // if it exists, return
41
+ if( get_option( 'api_validation' ) ) {
42
+ return;
43
+ } else { // else create it
44
+ add_option('api_validation' , 'invalid_api_key');
45
+ }
46
+
47
+ }
48
+
49
+ public function deactivate() {
50
+
51
+ }
52
+
53
+ public function uninstall() { // delete options on plugin uninstall
54
+ delete_option(YKSEME_OPTION);
55
+ delete_option('api_validation');
56
+ delete_option('imported_lists');
57
+ }
58
+
59
+ /***** INITIAL SETUP
60
+ ****************************************************************************************************/
61
+ public function initialize() {
62
+ // include our initialization file
63
+ include YKSEME_PATH . 'lib/inc/yks-mc-init.php';
64
+
65
+ /*
66
+ Conditionally Include the MailChimp Class File
67
+ */
68
+ if ( $this->optionVal['ssl_verify_peer'] == 'true' ) {
69
+ require_once YKSEME_PATH.'classes/MCAPI_2.0.class.php';
70
+ } else {
71
+ require_once YKSEME_PATH.'classes/MCAPI_2.0.class.verify_false.php';
72
+ }
73
+ /*
74
+ * add our new ssl_verify_peer debug option, if it doesn't already exist
75
+ * @since v5.2
76
+ */
77
+ if ( !isset( $this->optionVal['ssl_verify_peer'] ) ) {
78
+ $options = get_option( YKSEME_OPTION );
79
+ $options['ssl_verify_peer'] = 'true';
80
+ update_option( YKSEME_OPTION , $options );
81
+ }
82
+
83
+ }
84
+
85
+ // register and add our shortcodes
86
+ public function createShortcodes() {
87
+ add_shortcode( 'yks-mailchimp-list' , array( &$this, 'processShortcode' ) );
88
+ add_shortcode( 'yks-mailchimp-subscriber-count' , array( &$this, 'displaySubscriberCount') );
89
+ }
90
+
91
+ /** Custom Filter To Alter User Submitted Data **/
92
+ public function yikes_mc_get_form_data_filter( $mv ) {
93
+ return $mv;
94
+ }
95
+
96
+ /** Custom Filter To Alter User Already Subscribed Error Message **/
97
+ public function yikes_mc_user_already_subscribed_error_message_filter( $errorMessage , $email ) {
98
+ return $errorMessage;
99
+ }
100
+
101
+ // Create and store our initial plugin options
102
+ public function getOptionValue() {
103
+ $blog_title = get_bloginfo( 'name' );
104
+ $defaultVals = array(
105
+ 'version' => YKSEME_VERSION_CURRENT,
106
+ 'api-key' => '',
107
+ 'flavor' => '1',
108
+ 'debug' => '0',
109
+ 'optin' => 'true',
110
+ 'single-optin-message' => __('Thank You for subscribing!', 'yikes-inc-easy-mailchimp-extender'),
111
+ 'double-optin-message' => __('Thank You for subscribing! Check your email for the confirmation message.', 'yikes-inc-easy-mailchimp-extender'),
112
+ 'optIn-checkbox' => 'hide',
113
+ 'yks-mailchimp-optIn-default-list' => 'select_list',
114
+ 'yks-mailchimp-optin-checkbox-text' => 'Add me to the ' . $blog_title . ' mailing list',
115
+ 'recaptcha-setting' => '0',
116
+ 'recaptcha-api-key' => '',
117
+ 'recaptcha-private-api-key' => '',
118
+ 'ssl_verify_peer' => 'true',
119
+ 'lists' => array()
120
+ );
121
+ $ov = get_option(YKSEME_OPTION, $defaultVals);
122
+ $this->optionVal = $ov;
123
+ return $ov;
124
+ }
125
+
126
+ // run our update check to make sure the user is up to date
127
+ private function runUpdateCheck() {
128
+ if( ! isset( $this->optionVal['version'] ) || $this->optionVal['version'] < YKSEME_VERSION_CURRENT ) {
129
+ $this->runUpdateTasks();
130
+ }
131
+ }
132
+
133
+
134
+ /***** FUNCTIONS
135
+ ****************************************************************************************************/
136
+ // check if were on the login page
137
+ function is_login_page() {
138
+ return in_array( $GLOBALS['pagenow'] , array( 'wp-login.php', 'wp-register.php' ) );
139
+ }
140
+
141
+ // create a slug like string, given some text (ie: this-is-the-name)
142
+ public function slugify( $text ) {
143
+ // replace non letter or digits by -
144
+ $text = preg_replace( '~[^\\pL\d]+~u', '-', $text );
145
+ // trim
146
+ $text = trim( $text, '-' );
147
+ // transliterate
148
+ $text = iconv( 'utf-8' , 'us-ascii//TRANSLIT' , $text );
149
+ // lowercase
150
+ $text = strtolower( $text);
151
+ // remove unwanted characters
152
+ $text = preg_replace( '~[^-\w]+~' , '' , $text );
153
+ if(empty($text))
154
+ {
155
+ return 'n-a';
156
+ }
157
+ return $text;
158
+ }
159
+
160
+ // create an array for any fields left blank
161
+ // not sure if still needed (CHECK)
162
+ public function getBlankFieldsArray( $lid='' ) {
163
+ $fields = array();
164
+ // Add Field
165
+ $name = $this->slugify('Email Address'.'-'.'EMAIL');
166
+ $addField = array(
167
+ 'id' => $lid.'-'.$name,
168
+ 'name' => $lid.'-'.$name,
169
+ 'merge' => 'EMAIL',
170
+ 'label' => 'Email Address',
171
+ 'require' => '1',
172
+ 'active' => '1',
173
+ 'locked' => '1',
174
+ 'sort' => '1',
175
+ 'type' => 'email',
176
+ 'help' => '',
177
+ 'defalt' => '',
178
+ 'choices' => ''
179
+ );
180
+ $fields[$addField['id']] = $addField;
181
+ // return our fields
182
+ return $fields;
183
+ }
184
+
185
+ // Create an array of data for imported fields based on the Merge Varaibles passed back from MailChimp
186
+ public function getImportedFieldsArray( $lid, $mv ) {
187
+ if( empty( $mv ) ) {
188
+ return false;
189
+ } else {
190
+ $fields = array();
191
+ $num = 1;
192
+ foreach($mv['data'][0]['merge_vars'] as $field) {
193
+ // Add Field
194
+ $name = $this->slugify(isset($field['label']).'-'.$field['tag']);
195
+ $addField = array(
196
+ 'id' => $lid.'-'.$name,
197
+ 'name' => $lid.$field['tag'],
198
+ 'merge' => $field['tag'],
199
+ 'label' => $field['name'],
200
+ 'require' => $field['req'],
201
+ 'active' => '1',
202
+ 'locked' => '1',
203
+ 'sort' => $field['order'],
204
+ 'type' => $field['field_type'],
205
+ 'help' => $field['helptext'],
206
+ 'default' => $field['default'],
207
+ 'choices' => (isset($field['choices']) ? $field['choices'] : '')
208
+ );
209
+ $fields[$addField['id']] = $addField;
210
+ $num++;
211
+ }
212
+ return $fields;
213
+ }
214
+ }
215
+
216
+ // Get the current users browser information
217
+ // Used specifically on the lists page
218
+ public function getBrowser() {
219
+ $u_agent = $_SERVER['HTTP_USER_AGENT'];
220
+ $bname = 'Unknown';
221
+ $platform = 'Unknown';
222
+ $version = "";
223
+ //First get the platform?
224
+ if( preg_match( '/linux/i', $u_agent ) ) {
225
+ $platform = 'Linux';
226
+ } elseif( preg_match( '/macintosh|mac os x/i', $u_agent ) ) {
227
+ $platform = 'Mac';
228
+ } elseif( preg_match( '/windows|win32/i' , $u_agent ) ) {
229
+ $platform = 'Windows';
230
+ }
231
+
232
+ // Next get the name of the useragent yes seperately and for good reason
233
+ if( preg_match( '/MSIE/i' , $u_agent ) && ! preg_match( '/Opera/i' , $u_agent ) ) {
234
+ $bname = 'Internet Explorer';
235
+ $ub = "MSIE";
236
+ } elseif( preg_match( '/Firefox/i' , $u_agent ) ) {
237
+ $bname = 'Mozilla Firefox';
238
+ $ub = "Firefox";
239
+ } elseif( preg_match( '/Chrome/i' , $u_agent ) ) {
240
+ $bname = 'Google Chrome';
241
+ $ub = "Chrome";
242
+ } elseif( preg_match( '/Safari/i' , $u_agent ) ) {
243
+ $bname = 'Apple Safari';
244
+ $ub = "Safari";
245
+ } elseif( preg_match( '/Opera/i' , $u_agent ) ) {
246
+ $bname = 'Opera';
247
+ $ub = "Opera";
248
+ } elseif( preg_match( '/Netscape/i' , $u_agent ) ) {
249
+ $bname = 'Netscape';
250
+ $ub = "Netscape";
251
+ }
252
+
253
+ // finally get the correct version number
254
+ $known = array('Version', $ub, 'other');
255
+ $pattern = '#(?<browser>' . join( '|' , $known ) . ')[/ ]+(?<version>[0-9.|a-zA-Z.]*)#';
256
+ if( ! preg_match_all( $pattern, $u_agent, $matches) ) {
257
+ // we have no matching number just continue
258
+ }
259
+
260
+ // see how many we have
261
+ $i = count($matches['browser']);
262
+ if( $i != 1 ) {
263
+ //we will have two since we are not using 'other' argument yet
264
+ //see if version is before or after the name
265
+ if( strripos( $u_agent ,"Version" ) < strripos( $u_agent , $ub ) ) {
266
+ $version= $matches['version'][0];
267
+ } else {
268
+ $version= $matches['version'][1];
269
+ }
270
+ } else {
271
+ $version= $matches['version'][0];
272
+ }
273
+
274
+ // check if we have a number
275
+ if( $version==null || $version=="" ) { $version="?"; }
276
+
277
+ return array(
278
+ 'userAgent' => $u_agent,
279
+ 'name' => $bname,
280
+ 'version' => $version,
281
+ 'platform' => $platform,
282
+ 'pattern' => $pattern
283
+ );
284
+ }
285
+
286
+ /***** Encryption/Decryption
287
+ ****** API Keys (MailChimp and reCaptcha)
288
+ *****************************************************************************************************/
289
+ function yikes_mc_encryptIt( $q ) {
290
+ $cryptKey = 'qJB0rGtIn5UB1xG03efyCp';
291
+ $qEncoded = base64_encode( mcrypt_encrypt( MCRYPT_RIJNDAEL_256, md5( $cryptKey ), $q, MCRYPT_MODE_CBC, md5( md5( $cryptKey ) ) ) );
292
+ return( $qEncoded );
293
+ }
294
+
295
+ function yikes_mc_decryptIt( $q ) {
296
+ $cryptKey = 'qJB0rGtIn5UB1xG03efyCp';
297
+ $qDecoded = rtrim( mcrypt_decrypt( MCRYPT_RIJNDAEL_256, md5( $cryptKey ), base64_decode( $q ), MCRYPT_MODE_CBC, md5( md5( $cryptKey ) ) ), "\0");
298
+ return( $qDecoded );
299
+ }
300
+
301
+
302
+ /***** CONFIGURATION
303
+ ****************************************************************************************************/
304
+ // Update our plug in options
305
+ // Runs when the user updates the settings page with new values
306
+ public function updateOptions( $p ) {
307
+ if( ! empty( $p['form_data'] ) ) {
308
+ parse_str( $p['form_data'] , $fd );
309
+ // checking if the entered API key has copied out of the value field?
310
+ if ( strlen( $fd['yks-mailchimp-api-key'] ) > 45 ) {
311
+ $apiKey = $this->yikes_mc_decryptIt($fd['yks-mailchimp-api-key']);
312
+ } else {
313
+ $apiKey = $fd['yks-mailchimp-api-key'];
314
+ }
315
+ // check if the newly input API key differs from the previously stored one
316
+ if ( $apiKey == $this->optionVal['api-key'] ) {
317
+ $this->optionVal['api-key'] = $apiKey;
318
+ $this->optionVal['flavor'] = $fd['yks-mailchimp-flavor'];
319
+ $this->optionVal['optin'] = $fd['yks-mailchimp-optin'];
320
+ $this->optionVal['single-optin-message'] = stripslashes($fd['single-optin-message']);
321
+ $this->optionVal['double-optin-message'] = stripslashes($fd['double-optin-message']);
322
+ $this->optionVal['optIn-checkbox'] = $fd['yks-mailchimp-optIn-checkbox'];
323
+ $this->optionVal['yks-mailchimp-optIn-default-list'] = isset($fd['yks-mailchimp-optIn-default-list']) ? $fd['yks-mailchimp-optIn-default-list'] : null; // if its set, else set to null <- fixes save form settings bug
324
+ $this->optionVal['yks-mailchimp-optin-checkbox-text'] = stripslashes($fd['yks-mailchimp-optin-checkbox-text']);
325
+ $this->optionVal['yks-mailchimp-jquery-datepicker'] = isset( $fd['yks-mailchimp-jquery-datepicker'] ) ? '1' : '';
326
+ update_option('api_validation', 'valid_api_key');
327
+ return update_option( YKSEME_OPTION , $this->optionVal );
328
+ } else {
329
+ $this->optionVal['api-key'] = $apiKey;
330
+ $this->optionVal['flavor'] = $fd['yks-mailchimp-flavor'];
331
+ $this->optionVal['optin'] = $fd['yks-mailchimp-optin'];
332
+ $this->optionVal['single-optin-message'] = stripslashes($fd['single-optin-message']);
333
+ $this->optionVal['double-optin-message'] = stripslashes($fd['double-optin-message']);
334
+ $this->optionVal['optIn-checkbox'] = $fd['yks-mailchimp-optIn-checkbox'];
335
+ $this->optionVal['yks-mailchimp-optIn-default-list'] = isset($fd['yks-mailchimp-optIn-default-list']) ? $fd['yks-mailchimp-optIn-default-list'] : null; // if its set, else set to null <- fixes save form settings bug
336
+ $this->optionVal['yks-mailchimp-optin-checkbox-text'] = stripslashes($fd['yks-mailchimp-optin-checkbox-text']);
337
+ $this->optionVal['yks-mailchimp-jquery-datepicker'] = isset( $fd['yks-mailchimp-jquery-datepicker'] ) ? '1' : '';
338
+ update_option('api_validation', 'valid_api_key');
339
+ // if the new API key differs from the old one
340
+ // we need to unset the previously set up widgets
341
+ // 1 - empty the lists array of imported lists
342
+ $this->optionVal['lists'] = array();
343
+ // 2 - unset our previously set up widgets
344
+ update_option( 'widget_yikes_mc_widget' , '' );
345
+ return update_option( YKSEME_OPTION , $this->optionVal );
346
+ }
347
+ }
348
+ return false;
349
+ }
350
+
351
+ // Update our recaptcha options
352
+ // Runs when the user updates the recaptcha settings page with new values
353
+ public function updateRecaptchaOptions( $p ) {
354
+ if( !empty( $p['form_data'] ) ) {
355
+ parse_str($p['form_data'], $fd);
356
+ $this->optionVal['recaptcha-setting'] = isset($fd['yks-mailchimp-recaptcha-setting']) ? $fd['yks-mailchimp-recaptcha-setting'] : '0';
357
+ $this->optionVal['recaptcha-api-key'] = isset($fd['yks-mailchimp-recaptcha-api-key']) ? $fd['yks-mailchimp-recaptcha-api-key'] : '';
358
+ $this->optionVal['recaptcha-private-api-key'] = isset($fd['yks-mailchimp-recaptcha-private-api-key']) ? $fd['yks-mailchimp-recaptcha-private-api-key'] : '';
359
+ return update_option( YKSEME_OPTION , $this->optionVal );
360
+ }
361
+ return false;
362
+ }
363
+
364
+ // Update our debug plugin options
365
+ // Runs when the user updates the debug settings page with new values
366
+ public function updateDebugOptions( $p ) {
367
+ if( !empty( $p['form_data'] ) ) {
368
+ parse_str($p['form_data'], $fd);
369
+ $this->optionVal['debug'] = $fd['yks-mailchimp-debug'];
370
+ $this->optionVal['ssl_verify_peer'] = $fd['yks-mailchimp-ssl-verify-peer'];
371
+ return update_option(YKSEME_OPTION, $this->optionVal);
372
+ }
373
+ return false;
374
+ }
375
+
376
+ // Update the API Key
377
+ public function updateApiKey( $k ) {
378
+ $this->optionVal['api-key'] = $k;
379
+ return update_option( YKSEME_OPTION , $this->optionVal );
380
+ }
381
+
382
+ // Update the version number
383
+ public function updateVersion( $k ) {
384
+ $this->optionVal['version'] = $k;
385
+ return update_option( YKSEME_OPTION , $this->optionVal );
386
+ }
387
+
388
+ /***** LIST ACTIONS
389
+ ****************************************************************************************************/
390
+ // Import a list from MailChimp and add it to the lists page
391
+ // Runs when user adds a list from the drop down on the list page
392
+ // Sends a call to MailChimp api to retrieve list data
393
+ public function addList( $lid='' , $name='' ) {
394
+
395
+ if( $lid == '' || isset( $this->optionVal['lists'][$lid] ) ) return false;
396
+
397
+ $api = new wpyksMCAPI($this->optionVal['api-key']);
398
+
399
+ $mv = $api->call('lists/merge-vars', array(
400
+ 'id' => array($lid)
401
+ )
402
+ );
403
+
404
+ // if merge variables are found
405
+ if( $mv) {
406
+ $list = array(
407
+ 'id' => $lid,
408
+ 'list-id' => $lid,
409
+ 'name' => $name,
410
+ 'fields' => $this->getImportedFieldsArray( $lid , $mv )
411
+ );
412
+
413
+ $this->optionVal['lists'][$list['id']] = $list;
414
+
415
+ // store newly retreived list array in imported_list global option
416
+ update_option( 'imported_lists' , $this->optionVal['lists'] );
417
+
418
+ if( update_option( YKSEME_OPTION, $this->optionVal ) ) {
419
+ return $this->generateListContainers( array( $list ) );
420
+ }
421
+ }
422
+
423
+ return false;
424
+ }
425
+
426
+
427
+ /* Get Interest Groups */
428
+ // Send request to MailChimp API to retreive interest groups associated to a specific list
429
+ public function getInterestGroups( $list_id ) {
430
+ // store our API key
431
+ $api = new wpyksMCAPI($this->optionVal['api-key']);
432
+
433
+ // setup switch for div/table
434
+ $yikes_mc_flavor = $this->optionVal['flavor'];
435
+
436
+ // try the request, and catch any errors
437
+ try {
438
+
439
+ $interest_groups = $api->call('lists/interest-groupings', array( 'id' => $list_id ));
440
+
441
+ // if the list has an interest group
442
+ if ($interest_groups) {
443
+ // json_encode the data, and store it in optionVal['interest-groups']
444
+ $this->optionVal['interest-groups'] = json_encode($interest_groups);
445
+
446
+ $num = 0;
447
+
448
+ switch( $yikes_mc_flavor ) {
449
+
450
+ // table flavor
451
+ case '0':
452
+
453
+ // loop over each interest group returned
454
+ foreach($interest_groups as $interest_group) {
455
+
456
+ ?> <!-- pass interest group data in a hidden form field , required to pass the data back to the correct interest-group -->
457
+ <input type='hidden' name='interest-group-data' value='<?php echo $this->optionVal["interest-groups"]; ?>' /> <?php
458
+
459
+ // get form type
460
+ $list_form_type = $interest_group['form_field'];
461
+ $interestGroupID = $interest_group['id'];
462
+
463
+ switch( $list_form_type ) {
464
+
465
+ // checkbox interest groups
466
+ case 'checkboxes':
467
+ echo '<tr class="yks_mc_table_interest_group_holder yks_mc_table_checkbox_holder">';
468
+ echo '<td class="yks_mc_table_td">';
469
+ // display the label
470
+ echo '<label class="prompt yks_table_label yks-mailchimpFormTableRowLabel yks-mailchimpFormTableRowLabel-required font-secondary label-text">'.$interest_group['name'].'</label>'; // display the interest group name from MailChimp
471
+ foreach ($interest_group['groups'] as $singleGrouping) {
472
+ $checkboxValue = $interest_group['name'];
473
+ echo '<label class="yks_mc_interest_group_label" for="'.$singleGrouping['name'].'"><input type="checkbox" id="'.$singleGrouping['name'].'" class="yikes_mc_interest_group_checkbox" name="'.$interest_group['form_field'].'-'.$interest_group['id'].'[]" value="'.$singleGrouping['name'].'"><span>'.$singleGrouping['name'].'</span></label>';
474
+ }
475
+ echo '</td>';
476
+ echo '</tr>';
477
+ break;
478
+
479
+ // radiobuttons interest groups
480
+ case 'radio':
481
+ echo '<tr class="yks_mc_table_interest_group_holder yks_mc_table_radio_holder">';
482
+ echo '<td class="yks_mc_interest_radio_button_holder yks_mc_table_td">';
483
+ // display the label
484
+ echo $user_set_interest_group_label;
485
+ foreach ($interest_group['groups'] as $singleGrouping) {
486
+ $radioValue = $interest_group['name'];
487
+ echo '<label class="yks_mc_interest_group_label" for="'.$singleGrouping['name'].'"><input type="radio" id="'.$singleGrouping['name'].'" class="yikes_mc_interest_group_radio" name="'.$interest_group['form_field'].'-'.$interest_group['id'].'" value="'.$singleGrouping['name'].'"><span>'.$singleGrouping['name'].'</span></label>';
488
+ }
489
+ echo '</td>';
490
+ echo '</tr>';
491
+ break;
492
+
493
+ // drop down interest groups
494
+ case 'dropdown':
495
+ echo '<tr class="yks_mc_table_interest_group_holder yks_mc_table_dropdown_holder">';
496
+ echo '<td class="yks_mc_table_dropdown_interest_group_holder yks_mc_table_td">';
497
+ // display the label
498
+ echo $user_set_interest_group_label;
499
+ echo '<select id="yks_mc_interest_dropdown" name="'.$interest_group['form_field'].'-'.$interest_group['id'].'" class="yks_mc_interest_group_select">';
500
+ foreach ($interest_group['groups'] as $singleGrouping) {
501
+ $dropDownValue = $interest_group['name'];
502
+ echo '<option value="'.$singleGrouping['name'].'" name="'.$dropDownValue.'">'.$singleGrouping['name'].'</option>';
503
+ }
504
+ echo '</select>';
505
+ echo '</td>';
506
+ echo '</tr>';
507
+ break;
508
+
509
+ // hidden dropdown interest groups
510
+ case 'hidden':
511
+ echo '<div class="yks_mc_interest_group_holder" style="display:none;">';
512
+ echo '<select id="yks_mc_interest_dropdown" name="'.$interest_group['form_field'].'-'.$interest_group['id'].'" class="yks_mc_interest_group_select">';
513
+ foreach ($interest_group['groups'] as $singleGrouping) {
514
+ $dropDownValue = $interest_group['name'];
515
+ echo '<option value="'.$singleGrouping['name'].'" name="'.$dropDownValue.'">'.$singleGrouping['name'].'</option>';
516
+ }
517
+ echo '</select>';
518
+ echo '</div>';
519
+ break; //break dropdown interest group type
520
+
521
+ }
522
+
523
+ $num++;
524
+ }
525
+
526
+ break; // break case: 0;
527
+
528
+ // div flavor
529
+ case '1':
530
+ // loop over each interest group returned
531
+ foreach($interest_groups as $interest_group) {
532
+
533
+ // get form type
534
+ $list_form_type = $interest_group['form_field'];
535
+ $interestGroupID = $interest_group['id'];
536
+ if ( $list_form_type == 'hidden' ) { $hidden = 'style="display:none;"'; } else { $hidden = ''; }
537
+
538
+ echo '<b class="yks_mc_interest_group_text" ' . $hidden . '>'.$interest_group['name'].'</b>';
539
+ ?>
540
+
541
+ <input type='hidden' name='interest-group-data' value='<?php echo $this->optionVal["interest-groups"]; ?>' />
542
+
543
+ <?php
544
+
545
+ switch($list_form_type) {
546
+
547
+ // checkbox interest groups
548
+ case 'checkboxes':
549
+ echo '<div class="yks_mc_interest_group_holder">';
550
+ foreach ($interest_group['groups'] as $singleGrouping) {
551
+ $checkboxValue = $interest_group['name'];
552
+ echo '<label class="yks_mc_interest_group_label" for="'.$singleGrouping['name'].'"><input type="checkbox" id="'.$singleGrouping['name'].'" class="yikes_mc_interest_group_checkbox" name="'.$interest_group['form_field'].'-'.$interest_group['id'].'[]" value="'.$singleGrouping['name'].'"><span></span>'.$singleGrouping['name'].'</label>';
553
+ }
554
+ echo '</div>';
555
+ break; // break checkbox interest group type
556
+
557
+ // radiobuttons interest groups
558
+ case 'radio':
559
+ echo '<div class="yks_mc_interest_group_holder">';
560
+ echo '<div class="yks_mc_interest_radio_button_holder">';
561
+ foreach ($interest_group['groups'] as $singleGrouping) {
562
+ $radioValue = $interest_group['name'];
563
+ echo '<label class="yks_mc_interest_group_label" for="'.$singleGrouping['name'].'"><input type="radio" id="'.$singleGrouping['name'].'" class="yikes_mc_interest_group_radio" name="'.$interest_group['form_field'].'-'.$interest_group['id'].'" value="'.$singleGrouping['name'].'"><span></span>'.$singleGrouping['name'].'</label>';
564
+ }
565
+ echo '</div>';
566
+ echo '</div>';
567
+ break; //break radio buttons interest group type
568
+
569
+ // drop down interest groups
570
+ case 'dropdown':
571
+ echo '<div class="yks_mc_interest_group_holder">';
572
+ echo '<select id="yks_mc_interest_dropdown" name="'.$interest_group['form_field'].'-'.$interest_group['id'].'" class="yks_mc_interest_group_select">';
573
+ foreach ($interest_group['groups'] as $singleGrouping) {
574
+ $dropDownValue = $interest_group['name'];
575
+ echo '<option value="'.$singleGrouping['name'].'" name="'.$dropDownValue.'">'.$singleGrouping['name'].'</option>';
576
+ }
577
+ echo '</select>';
578
+ echo '</div>';
579
+ break; //break dropdown interest group type
580
+
581
+ // hidden dropdown interest groups
582
+ case 'hidden':
583
+ echo '<div class="yks_mc_interest_group_holder" style="display:none;">';
584
+ echo '<select id="yks_mc_interest_dropdown" name="'.$interest_group['form_field'].'-'.$interest_group['id'].'" class="yks_mc_interest_group_select">';
585
+ foreach ($interest_group['groups'] as $singleGrouping) {
586
+ $dropDownValue = $interest_group['name'];
587
+ echo '<option value="'.$singleGrouping['name'].'" name="'.$dropDownValue.'">'.$singleGrouping['name'].'</option>';
588
+ }
589
+ echo '</select>';
590
+ echo '</div>';
591
+ break; //break dropdown interest group type
592
+
593
+ }
594
+ $num++;
595
+ }
596
+ break; //break case: 1;
597
+
598
+ }
599
+ }
600
+ // catch any errors if thrown
601
+ } catch( Exception $e ) {
602
+ if ( $this->optionVal['debug'] == 1 ) {
603
+ $this->writeErrorToErrorLog( $e );
604
+ }
605
+ return;
606
+ }
607
+ return false;
608
+ } // end getInterestGroups();
609
+
610
+ // Send a call to the MailChimp API to retreive all lists on the account
611
+ public function getLists() {
612
+ $api = new wpyksMCAPI($this->optionVal['api-key']);
613
+ $lists = $this->getListsData();
614
+ $listArr = (!isset($listArr) ? $this->optionVal['lists'] : $listArr);
615
+ $theusedlist = array();
616
+ if( count( $listArr ) > 0 ) {
617
+ foreach( $listArr as $list ) {
618
+ $theusedlist[] = $list['id'];
619
+ }
620
+ }
621
+ if( $lists ) { // if list data is returned
622
+ echo "<select id='yks-list-select' name='yks-list-select'>";
623
+ echo "<option value=''> Select List</option>";
624
+
625
+ foreach ( $lists as $lkey => $lvalue ) {
626
+ if ( !in_array( $lkey , $theusedlist ) ) {
627
+ echo "<option value='".$lkey."'>".$lvalue."</option>";
628
+ }
629
+ }
630
+
631
+ echo "</select>";
632
+ echo '<input type="submit" name="submit" class="button-primary" id="yks-submit-list-add" value="' .__ ("Create a Form For This List" , "yikes-inc-easy-mailchimp-extender" ) .'" >';
633
+
634
+ // not currently possible to create new lists via API
635
+ // echo '&nbsp;<a href="#" onclick="return false;" class="button-secondary"><span class="dashicons dashicons-plus" style="line-height:1.3"></span> Create New List</a>';
636
+
637
+ } else {
638
+ echo '<strong>' . __('Error - No Lists Found On Your Account. Please create at least one list on your MailChimp account.' , 'yikes-inc-easy-mailchimp-extender' ) . '</strong>';
639
+ }
640
+ return false;
641
+ } // end getLists();
642
+
643
+ // Get lists for the settings page
644
+ // Used for default subscription list
645
+ public function getOptionsLists() {
646
+ $api = new wpyksMCAPI($this->optionVal['api-key']);
647
+ $lists = $this->getListsData();
648
+ $listArr = (!isset($listArr) ? $this->optionVal['lists'] : $listArr);
649
+ if( $lists ) {
650
+ echo "<select id='yks-mailchimp-optIn-default-list' name='yks-mailchimp-optIn-default-list'>";
651
+ echo "<option value='select_list'> Select List</option>";
652
+ foreach ( $lists as $lkey => $list_name) {
653
+ echo "<option ".selected( isset($this->optionVal['yks-mailchimp-optIn-default-list']) ? $this->optionVal['yks-mailchimp-optIn-default-list'] : "select_list", $lkey )." value='".$lkey."'>".$list_name."</option>";
654
+ }
655
+ echo "</select>";
656
+ }
657
+ return false;
658
+ } // end getOptionsLists()
659
+
660
+ // Send a call to MailChimp API to get the data associated with a specific list (in this instance: the fields, and the subscriber count)
661
+ public function getListsData() {
662
+ $api = new wpyksMCAPI($this->optionVal['api-key']);
663
+ $lists = $api->call('lists/list', array( 'limit' => 100 ));
664
+ if( $lists ) {
665
+ foreach ( $lists['data'] as $list ) {
666
+ $theListItems[$list['id']] = $list['name'];
667
+ $theListItems['subscriber-count']['subscriber-count-'.$list['id']] = $list['stats']['member_count'];
668
+ }
669
+ }
670
+
671
+ if ( isset ( $theListItems ) ) {
672
+ return $theListItems;
673
+ }
674
+ } // end getListsData();
675
+
676
+ /*
677
+ Send a call to MailChimp API to get the data associated with a specific list (in this instance: the fields, and the subscriber count)
678
+ @since v5.2
679
+ */
680
+ public function getInterstGroupInfo( $list_id ) {
681
+ $api = new wpyksMCAPI($this->optionVal['api-key']);
682
+ try {
683
+ $interest_groups = $api->call('lists/interest-groupings', array( 'id' => $list_id ));
684
+ return $interest_groups;
685
+ } catch( Exception $e ) { // catch any errors returned from MailChimp
686
+ return $e->getMessage();
687
+ // write our error to the error log, when advanced debug is enabled
688
+ if ( $this->optionVal['debug'] == 1 ) {
689
+ $this->writeErrorToErrorLog( $e );
690
+ }
691
+ die();
692
+ }
693
+ }
694
+
695
+ /*
696
+ Get Interest Group Response
697
+ @sinve v5.2
698
+ */
699
+ public function getListInterestGroups( $list_id ) {
700
+ $interest_groups = $this->getInterstGroupInfo( $list_id );
701
+ if ( is_array( $interest_groups ) ) {
702
+ foreach ( $interest_groups as $interest_group ) {
703
+ $interest_group_id = $interest_group['id'];
704
+ $interest_group_type = $interest_group['form_field'];
705
+ $interest_group_name = $interest_group['name'];
706
+ echo '<div class="yks-mailchimp-fields-list-row" alt="' . $interest_group_id . '">
707
+
708
+ <span class="yks-mc-interest-group-delete" title="Delete ' . $interest_group_name . '">
709
+ <span class="dashicons dashicons-no-alt"></span>
710
+ </span>
711
+
712
+ <span class="yks-mc-interest-group-edit" title="Edit ' . $interest_group_name . '">
713
+ <span class="dashicons dashicons-edit"></span>
714
+ </span>
715
+
716
+ <span class="yks-mc-interest-group-name">' . $interest_group_name . '</span>
717
+
718
+ <span class="yks-mc-interest-group-type">' . $interest_group_type . '</span>
719
+
720
+ </div>';
721
+ }
722
+ } else {
723
+ ?>
724
+ <style>
725
+ #yks-mailchimp-interest-groups-container_<?php echo $list_id; ?> {
726
+ background-color: transparent !important;
727
+ border: none !important;
728
+ }
729
+ </style>
730
+ <span class="no-interest-groups-found"><em><?php echo __( 'No interest groups have been setup for this form yet' , 'yikes-inc-easy-mailchimp-extender' ); ?></em></span>
731
+ <?php
732
+ }
733
+ } // end getListInterestGroups();
734
+
735
+ /*
736
+ Get Specific Interest Group Response
737
+ @since v5.2
738
+ */
739
+ public function getSpecificInterestGroupData( $list_id , $mc_interest_group_id ) {
740
+ // get interest group info,
741
+ $interest_groups = $this->getInterstGroupInfo( $list_id );
742
+ if ( $interest_groups ) {
743
+ foreach ( $interest_groups as $key ) {
744
+ if ( $key['id'] == $mc_interest_group_id ) {
745
+ echo json_encode( $key );
746
+ }
747
+ }
748
+ } else {
749
+ echo 'error retreiving group information...please try again';
750
+ }
751
+ }
752
+
753
+ // Send a call to MailChimp API to get the data associated with a specific list (in this instance: the fields, and the subscriber count)
754
+ public function getListsForStats() {
755
+ $api = new wpyksMCAPI($this->optionVal['api-key']);
756
+ $lists = $this->getListsData();
757
+ $listArr = (!isset($listArr) ? $this->optionVal['lists'] : $listArr);
758
+ $theusedlist = array();
759
+ if( count( $listArr ) > 0 ) {
760
+ foreach( $listArr as $list ) {
761
+ $theusedlist[] = $list['id'];
762
+ }
763
+ }
764
+ if( $lists ) {
765
+ // Drop Down to switch form stats
766
+ echo '<h3>Select list to view stats</h3>';
767
+ echo '<div class="list_container_for_stats">';
768
+ echo "<a alt='' href='#' class='stats_list_name' onclick='return false;'><input type='button' class='asbestos-flat-button active_button' value='".__( 'All Lists' , 'yikes-inc-easy-mailchimp-extender')."'></a>";
769
+ foreach ($lists as $lkey => $lvalue) {
770
+ if ( is_array($lvalue) ) {
771
+ continue;
772
+ } else {
773
+ // if ( is_array( $lvalue ) ) { $lvalue = '<em style="color:rgba(245, 79, 79, 0.74);">Error</em>'; } else { $lvalue = $lvalue; }
774
+ echo "<a alt='".$lkey."' href='#' class='stats_list_name' onclick='return false;'><input type='button' class='asbestos-flat-button' value='".$lvalue."'></a>";
775
+ }
776
+ }
777
+ echo '</div>';
778
+ }
779
+ return false;
780
+ } // end getListsForStats()
781
+
782
+ // Sort through the returned data
783
+ public function sortList( $p ) {
784
+ if( empty( $p['update_string'] ) || empty( $p['list_id'] ) ) {
785
+ return false;
786
+ } else {
787
+ // Setup fields
788
+ $a = explode( ';' , $p['update_string'] );
789
+ if( $a !== false ) {
790
+ foreach( $a as $f ) {
791
+ $d = explode( ':' , $f );
792
+ $this->optionVal['lists'][$p['list_id']]['fields'][$d[0]]['sort'] = $d[1];
793
+ }
794
+ }
795
+ uasort($this->optionVal['lists'][$p['list_id']]['fields'], array(&$this, 'sortListFields'));
796
+ return update_option(YKSEME_OPTION, $this->optionVal);
797
+ }
798
+ return false;
799
+ } // end sortList();
800
+
801
+ private function sortListfields( $a , $b ) {
802
+ $a = $a['sort'];
803
+ $b = $b['sort'];
804
+ if( $a == $b ) {
805
+ return 0;
806
+ }
807
+ return ( $a < $b ) ? -1 : 1;
808
+ } // end sortListfields();
809
+
810
+ // Update a single list on the lists page
811
+ // This function fires when the user clicks 'save settings' for a specific form on the lists page
812
+ public function updateList( $p ) {
813
+ if( !empty( $p['form_data'] ) ) {
814
+ parse_str($p['form_data'], $fd);
815
+ if( !empty( $fd['yks-mailchimp-unique-id'] ) ) {
816
+ $num = 1;
817
+ foreach( $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['fields'] as $k => $v ) {
818
+ // Only proceed if the field is not locked
819
+ if( $v['require'] == 0 ) {
820
+ // Make sure this field was included in the update
821
+ $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['fields'][$k]['active'] = (isset($fd[$v['name']]) ? '1' : '0');
822
+ }
823
+
824
+ $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['fields'][$k]['placeholder-'.$fd['yks-mailchimp-unique-id'].'-'.$num] = $fd['placeholder-'.$fd['yks-mailchimp-unique-id'].'-'.$num];
825
+ $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['fields'][$k]['custom-field-class-'.$fd['yks-mailchimp-unique-id'].'-'.$num] = $fd['custom-field-class-'.$fd['yks-mailchimp-unique-id'].'-'.$num];
826
+ $num++;
827
+
828
+ $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['fields'][$k]['yks_mailchimp_redirect_'.$fd['yks-mailchimp-unique-id']] = (isset($fd['yks_mailchimp_redirect_'.$fd['yks-mailchimp-unique-id']]) ? '1' : '');
829
+
830
+ if(isset($fd['yks_mailchimp_redirect_'.$fd['yks-mailchimp-unique-id']])) {
831
+ $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['fields'][$k]['page_id_'.$fd['yks-mailchimp-unique-id']] = $fd['page_id_'.$fd['yks-mailchimp-unique-id']];
832
+ }
833
+
834
+ // custom style setting
835
+ $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['active'] = (isset($fd['yks_mailchimp_custom_styles_'.$fd['yks-mailchimp-unique-id']]) ? '1' : '0');
836
+ $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_template']['active'] = (isset($fd['yks_mailchimp_custom_template_'.$fd['yks-mailchimp-unique-id']]) ? '1' : '0');
837
+ }
838
+
839
+ // save the selected form template, if custom template was set
840
+ if ( $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_template']['active'] == 1 ) {
841
+ $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_template']['template_file'] = $fd['yks-mc-template-file-selection'];
842
+ }
843
+
844
+ // save the color styles
845
+ if ( $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['active'] == 1 ) {
846
+
847
+ // save the custom styles colors here!
848
+ $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_submit_button_color'] = $fd['yks-mc-submit-button-color'];
849
+ $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_submit_button_text_color'] = $fd['yks-mc-submit-button-text-color'];
850
+ $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_form_background_color'] = $fd['yks-mc-background-color'];
851
+ $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_form_text_color'] = $fd['yks-mc-text-color'];
852
+
853
+ // if the form width is left blank,
854
+ // we'll just set it to 100%
855
+ if ( $fd['yks-mc-form-width'] != '' ) {
856
+ $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_form_width'] = $fd['yks-mc-form-width'];
857
+ } else {
858
+ $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_form_width'] = '100%';
859
+ }
860
+
861
+ $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_form_alignment'] = $fd['yks-mc-form-alignment'];
862
+
863
+ $padding_matches = array();
864
+ $matching_array = array( 'px' , 'em' , 'rem' , '%' );
865
+
866
+ if ( preg_match( '/([0-9.]+)([^0-9]+)/', $fd['yks-mc-form-padding'], $padding_matches ) ) {
867
+ // $padding_explosion = preg_split( '/[a-zA-Z]/' , $fd['yks-mc-form-padding'] );
868
+ $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_form_padding'] = $padding_matches[1];
869
+ if ( in_array( $padding_matches[2] , $matching_array ) ) {
870
+ $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_form_padding_measurement'] = $padding_matches[2];
871
+ } else {
872
+ $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_form_padding_measurement'] = 'px';
873
+ }
874
+ } else {
875
+ if ( trim( $fd['yks-mc-form-padding'] ) != '' ) {
876
+ $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_form_padding'] = $fd['yks-mc-form-padding'];
877
+ } else {
878
+ $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_form_padding'] = '0';
879
+ }
880
+ $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_form_padding_measurement'] = 'px';
881
+ }
882
+ }
883
+
884
+ return update_option(YKSEME_OPTION, $this->optionVal);
885
+ }
886
+ }
887
+ return false;
888
+ } // end updateList();
889
+
890
+ // Remove a list from the lists page
891
+ // Runs when a user clicks 'delete list' on the lists page
892
+ public function deleteList( $i=false ) {
893
+ if( $i == false ) {
894
+ return false;
895
+ } else {
896
+ unset( $this->optionVal['lists'][$i] );
897
+ update_option( 'imported_lists' , $this->optionVal['lists'] );
898
+ return update_option( YKSEME_OPTION , $this->optionVal );
899
+ }
900
+ } // end deleteList();
901
+
902
+ // Import a list to the lists page
903
+ // Runs when a user adds a list from the drop down on the lists page
904
+ public function importList( $i = false ) {
905
+ if( $i == false ) {
906
+ return false;
907
+ } else {
908
+ // create our variables
909
+ $lid = $this->optionVal['lists'][$i]['list-id'];
910
+ $name = $this->optionVal['lists'][$i]['name'];
911
+ $api = new wpyksMCAPI($this->optionVal['api-key']);
912
+ $mv = $api->call('lists/merge-vars', array(
913
+ 'id' => array( $lid )
914
+ )
915
+ );
916
+ // if merge variables are returned
917
+ $mv = $this->getImportedFieldsArray($lid, $mv);
918
+ if( $mv ) {
919
+ // Save the new list
920
+ $this->optionVal['lists'][$i]['fields'] = $mv;
921
+ if( update_option( YKSEME_OPTION , $this->optionVal ) ) {
922
+ return $this->generateListContainers(array($this->optionVal['lists'][$i]));
923
+ }
924
+ }
925
+ }
926
+ return false;
927
+ } // end importList();
928
+
929
+ // reImport a list to the lists page
930
+ // Runs when a user adds a list from the drop down on the lists page
931
+ public function reImportMergeVariables( $i = false ) {
932
+ if( $i == false ) {
933
+ return false;
934
+ } else {
935
+ // create our variables
936
+ $lid = $this->optionVal['lists'][$i]['list-id'];
937
+ $name = $this->optionVal['lists'][$i]['name'];
938
+ $api = new wpyksMCAPI($this->optionVal['api-key']);
939
+ $mv = $api->call('lists/merge-vars', array(
940
+ 'id' => array( $lid )
941
+ )
942
+ );
943
+ // if merge variables are returned
944
+ $mv = $this->getImportedFieldsArray($lid, $mv);
945
+ if( $mv ) {
946
+ // Save the new list
947
+ $this->optionVal['lists'][$i]['fields'] = $mv;
948
+ // update the list with the new fields
949
+ if( update_option( YKSEME_OPTION , $this->optionVal ) ) {
950
+ return $this->generateMergeVariableContainers(array($this->optionVal['lists'][$i]));
951
+ }
952
+ }
953
+ }
954
+ return false;
955
+ } // end reImportMergeVariables();
956
+
957
+ // Make a call to the MailChimp API to retrieve all subscribers to a given list
958
+ // Runs when the user clicks 'view' next to the subscriber count on the list page
959
+ public function listAllSubscribers( $lid, $list_name ) {
960
+ $api = new wpyksMCAPI($this->optionVal['api-key']);
961
+ $subscribers_list = $api->call('lists/members',
962
+ array(
963
+ 'id' => $lid,
964
+ 'opts' => array(
965
+ 'limit' => '100',
966
+ 'sort_field' => 'optin_time',
967
+ 'sort_dir' => 'DESC'
968
+ )
969
+ )
970
+ );
971
+ // if the subscriber count is greater than 0
972
+ // display all subscribers in a table
973
+ if( $subscribers_list['total'] > 0 ) { ?>
974
+ <h2><?php echo $list_name; echo ' <span class="subscriber-count" style="font-size:11px;">(<span class="number">'.$subscribers_list['total'].'</span> '.__(" subscribers" , "yikes-inc-easy-mailchimp-extender").')</span>'; ?></h2>
975
+ <p><?php _e( 'Click on a subscriber to see further information' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
976
+
977
+ <table id="yikes-mailchimp-subscribers-table" class="yks-mailchimp-fields-list" style="width:100%;">
978
+ <thead class="yikes-mailchimp-subscribers-table-head">
979
+ <tr>
980
+ <th width="50%"><?php _e( 'E-Mail' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
981
+ <th width="50%"><?php _e( 'Date Subscribed' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
982
+ </tr>
983
+ </thead>
984
+ <?php foreach ( $subscribers_list['data'] as $subscriber ) {
985
+ $timeStamp = explode(' ', $subscriber['timestamp_opt'] );
986
+ echo '<tr class="yks-mailchimp-subscribers-list-row" id="yks-mailchimp-subscribers-list-row">';
987
+ echo '<td><a class="subscriber-mail-link" rel="'.$subscriber["email"].'" class="subscriberEmailAddress">'.$subscriber['email'].'</a></td>';
988
+ // echo '<td>'.str_replace('-', ' ', date("M-jS-Y", strtotime($subscriber['timestamp_opt']))).'</td>';
989
+ echo '<td>'.str_replace('-', ' ', date("M-jS-Y", strtotime($timeStamp[0]))).'</td></tr>';
990
+ } ?>
991
+ </table>
992
+
993
+ <!-- display a single user profile in this div -->
994
+ <div id="individual_subscriber_information" style="display:none;"></div>
995
+ <?php
996
+ } else { // else display an error of sorts
997
+ ?>
998
+ <h2><?php echo $list_name; echo ' <span class="subscriber-count" style="font-size:11px;">(<span class="number">0</span> '.__(" subscribers" , "yikes-inc-easy-mailchimp-extender").')</span>'; ?></h2>
999
+ <?php
1000
+ _e( "Sorry You Don't Currently Have Any Subscribers In This List!" , "yikes-inc-easy-mailchimp-extender" );
1001
+ }
1002
+ wp_die();
1003
+ } // end listAllSubscribers();
1004
+
1005
+ // Make a call to the MailChimp API to retrieve information about a specific user
1006
+ // Runs when the user clicks a subscribers email address
1007
+ public function getSubscriberInfo($lid, $email) {
1008
+ $api = new wpyksMCAPI($this->optionVal['api-key']);
1009
+ $subscriber_info = $api->call('lists/member-info',
1010
+ array(
1011
+ 'id' => $lid,
1012
+ 'emails' => array(
1013
+ 0 => array(
1014
+ 'email' => $email,
1015
+ ),
1016
+ )
1017
+ )
1018
+ );
1019
+ // if the subscriber count is greater than 0
1020
+ // display all subscribers in a table
1021
+ if($subscriber_info) {
1022
+ // store user data into variables
1023
+ $subscriber_data = $subscriber_info['data'][0];
1024
+ $member_rating = $subscriber_data['member_rating'];
1025
+ // firstname/lastname data inside of new array
1026
+ $subscriber_data_merges = $subscriber_data['merges'];
1027
+ // seperate date+time
1028
+ $subscriber_data_info_changed = explode(' ' , $subscriber_data['info_changed']);
1029
+ $subscriber_data_timestamp_opt = explode (' ', $subscriber_data['timestamp_opt']);
1030
+ // store date+time in seperate variables
1031
+ $subscriber_data_info_changed_date = $subscriber_data_info_changed[0];
1032
+ $subscriber_data_info_changed_time = $subscriber_data_info_changed[1];
1033
+ // store optin-time+date in seperate variables
1034
+ $subscriber_data_info_optin_date = $subscriber_data_timestamp_opt[0];
1035
+ $subscriber_data_info_optin_time = $subscriber_data_timestamp_opt[1];
1036
+ // create our language variable dependent on what is set in MailChimp
1037
+ include_once('set_language.php');
1038
+
1039
+ // create star rating variable, based on returned member_rating value
1040
+ if(isset($member_rating)) {
1041
+ if ($member_rating == 1) {
1042
+ $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
1043
+ } else if ($member_rating == 2) {
1044
+ $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
1045
+ } else if ($member_rating == 3) {
1046
+ $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
1047
+ } else if ($member_rating == 4) {
1048
+ $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
1049
+ } else if ($member_rating == 5) {
1050
+ $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span></div>';
1051
+ }
1052
+ } ?>
1053
+
1054
+ <div class="yks-mc-subscriber-top">
1055
+ <span class="button-primary dashicons dashicons-arrow-left-alt2 yks-mc-subscriber-go-back"><?php _e( 'Back to Subscriber List' , 'yikes-inc-easy-mailchimp-extender' ); ?></span>
1056
+ <h2 class="yks-mc-subscriber-header"><?php _e( 'Subscriber Details' , 'yikes-inc-easy-mailchimp-extender' ); ?> </h2>
1057
+ <!-- display users email address -->
1058
+ <h3 id="yks-subscriber-info-email-address"><?php echo $subscriber_data['email']; ?></h3>
1059
+ <!-- display member star rating pulled from MailChimp -->
1060
+ <?php echo $member_rating_stars; ?>
1061
+ <!-- user optin time and date -->
1062
+ <span class="yks-subscriber-info-optin-data">
1063
+ <?php echo 'Subscribed on : '.date('m/d/Y',strtotime($subscriber_data_info_optin_date)); ?><?php echo ' at '.date('g:i A',strtotime($subscriber_data_info_optin_time)); ?>
1064
+ </span>
1065
+ </div>
1066
+
1067
+ <h2 class="yks-mc-subscriber-header"><?php _e( 'Overview' , 'yikes-inc-easy-mailchimp-extender' ); ?></h2>
1068
+ <div class="yks-mc-subscriber-overview">
1069
+
1070
+ <div class="yks-mc-subscriber-left-container">
1071
+
1072
+ <label class="yks-mc-overview-title"><?php _e( 'First Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></label>
1073
+ <p class="yks-mc-overview-info-value yks-mc-subscriber-firstName"><?php if(!empty($subscriber_data_merges['FNAME'])) { echo $subscriber_data_merges['FNAME']; } else { echo 'not provided'; } ?></p>
1074
+
1075
+ <label class="yks-mc-overview-title"><?php _e( 'Last Updated' , 'yikes-inc-easy-mailchimp-extender' ); ?></label>
1076
+ <p class="yks-mc-overview-info-value"><?php echo date('m/d/Y',strtotime($subscriber_data_info_changed_date)); ?><?php echo ' at '.date('g:i A',strtotime($subscriber_data_info_changed_time)); ?></p>
1077
+
1078
+ <label class="yks-mc-overview-title"><?php _e( 'Preferred Email Type' , 'yikes-inc-easy-mailchimp-extender' ); ?></label>
1079
+ <p class="yks-mc-overview-info-value"><?php if(!empty($subscriber_data['email_type'])) { echo $subscriber_data['email_type']; } else { echo 'No Preference.'; } ?></p>
1080
+
1081
+ </div>
1082
+
1083
+ <div class="yks-mc-subscriber-right-container">
1084
+
1085
+ <label class="yks-mc-overview-title"><?php _e( 'Last Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></label>
1086
+ <p class="yks-mc-overview-info-value yks-mc-subscriber-lastName"><?php if(!empty($subscriber_data_merges['LNAME'])) { echo $subscriber_data_merges['LNAME']; } else { echo 'not provided'; } ?></p>
1087
+
1088
+ <label class="yks-mc-overview-title"><?php _e( 'Language' , 'yikes-inc-easy-mailchimp-extender' ); ?></label>
1089
+ <p class="yks-mc-overview-info-value"><?php echo $subscriber_data_language; ?></p>
1090
+
1091
+ </div>
1092
+
1093
+ </div>
1094
+
1095
+ <?php
1096
+ // build our segment array to determine if the user is subscribed to any segments
1097
+ $segment_count = array();
1098
+ // check if groupings data is set (for segment and interest groups)
1099
+ // this avoids an error being thrown when no segment/interest groups have been selected
1100
+ if ( isset( $subscriber_data_merges['GROUPINGS'] ) ) {
1101
+ foreach ($subscriber_data_merges['GROUPINGS'] as $group1) {
1102
+ foreach ($group1['groups'] as $group2) {
1103
+ if ($group2['interested'] == 1) {
1104
+ array_push($segment_count, $group2['name']);
1105
+ }
1106
+ }
1107
+ }
1108
+ }
1109
+ ?>
1110
+
1111
+ <h2 class="yks-mc-subscriber-header"><?php _e( 'Groups Subscribed To' , 'yikes-inc-easy-mailchimp-extender' ); ?></h2>
1112
+ <!-- display what groups/segments the subscriber is subscribed too -->
1113
+ <?php
1114
+ // if the user is subscribed to some segment
1115
+ if(!empty($segment_count)) {
1116
+ $groups_array = array(
1117
+ 'group_name' => '',
1118
+ 'segments' => array()
1119
+ );
1120
+ $num = 0;
1121
+ foreach ($subscriber_data_merges['GROUPINGS'] as $group_name) {
1122
+ $groups_array[$num]['group_name'] = $group_name['name'];
1123
+ foreach ($group_name['groups'] as $groupData ) {
1124
+ if ($groupData['interested'] == 1) {
1125
+ $groups_array[$num]['segments'] = $groupData['name'];
1126
+ }
1127
+ }
1128
+ $num++;
1129
+ }
1130
+ // build up the segments array that the user is subscribed too
1131
+ foreach ( $groups_array as $group_data ) {
1132
+ if(!empty($group_data['segments'])) { ?>
1133
+ <ul>
1134
+ <?php
1135
+ echo '<li style="font-size:16px; color:#333;">'.$group_data['group_name'].'</li>';
1136
+ if(!empty($group_data['group_name']) && isset($group_data['segments'])) {
1137
+ echo 'Segments : '; echo implode(' ,', array($group_data['segments']));
1138
+ } elseif (count($group_data['segments']) == 0) {
1139
+ echo 'n/a';
1140
+ }
1141
+ ?>
1142
+ </ul>
1143
+ <?php
1144
+ }
1145
+ }
1146
+ } else {
1147
+ // if there are no segments subscribed too
1148
+ // just print a message none specified
1149
+ echo 'none specified';
1150
+ }
1151
+
1152
+ // display the notes associated with a user if there are any returned
1153
+ if(!empty($subscriber_data['notes'])) { ?>
1154
+ <div class="yks-mc-subscriber-bottom">
1155
+ <h2 class="yks-mc-subscriber-header"><?php _e( 'Subscriber Notes' , 'yikes-inc-easy-mailchimp-extender' ); ?></h2>
1156
+ <?php
1157
+ foreach ( $subscriber_data['notes'] as $note ) {
1158
+ ?>
1159
+ <textarea style="width:100%; height:100px; resize:none;" id="yks-mc-subscriber-notes" disabled><?php echo $note['note']; ?></textarea>
1160
+ <span style="font-size:11px; opacity:.75;"><?php _e( 'Written by' , 'yikes-inc-easy-mailchimp-extender' ); ?>: <?php echo $note['created_by_name']; ?> // <?php _e( 'Created on' , 'yikes-inc-easy-mailchimp-extender' ); ?>: <?php echo date('m/d/Y',strtotime($note['created'])); ?></span>
1161
+ <?php
1162
+ }
1163
+ ?>
1164
+ </div>
1165
+ <?php
1166
+ }
1167
+ }
1168
+ wp_die();
1169
+ } // end getSubscriberInfo();
1170
+
1171
+ // Make a call to the MailChimp API to remove a specified user from a given list
1172
+ // Runs when the user clicks the 'X' next to a subscriber when viewing all subscribers on the lists page
1173
+ public function yks_removeSubscriber($lid, $user_email) {
1174
+ $api = new wpyksMCAPI($this->optionVal['api-key']);
1175
+ $subscribers_list = $api->call('lists/unsubscribe', array(
1176
+ 'id' => $lid,
1177
+ 'email' => array(
1178
+ 'email' => $user_email
1179
+ )
1180
+ ));
1181
+ } // end yks_removeSubscriber();
1182
+
1183
+ /***** SCRIPTS/STYLES
1184
+ ****************************************************************************************************/
1185
+
1186
+ // enqueue dashboard styles
1187
+ public function addStyles() {
1188
+ include YKSEME_PATH . 'lib/inc/yks-mc-dashboard-styles.php';
1189
+ } // end addStyles();
1190
+
1191
+ // enqueue dashboard scripts
1192
+ public function addScripts() {
1193
+ include YKSEME_PATH . 'lib/inc/yks-mc-dashboard-scripts.php';
1194
+ } // end addScripts();
1195
+
1196
+ // enqueue our styles on the front end
1197
+ public function addStyles_frontend() {
1198
+ include YKSEME_PATH . 'lib/inc/yks-mc-frontend-styles.php';
1199
+ } // end addStyles_frontend();
1200
+
1201
+ // enqueue front end scripts
1202
+ public function addScripts_frontend() {
1203
+ // enqueue jQuery datepicker only when the user has specified to do so
1204
+ if( isset( $this->optionVal['yks-mailchimp-jquery-datepicker'] ) && $this->optionVal['yks-mailchimp-jquery-datepicker'] == '1' ) {
1205
+ wp_enqueue_script('jquery-ui-datepicker');
1206
+ }
1207
+ } // addScripts_frontend();
1208
+
1209
+ // redirect the user to the settings page on initial activation
1210
+ function yks_easy_mc_plugin_activation_redirect() {
1211
+ if (get_option('yks_easy_mc_plugin_do_activation_redirect', false)) {
1212
+ delete_option('yks_easy_mc_plugin_do_activation_redirect');
1213
+ // redirect to settings page
1214
+ wp_redirect(admin_url('/admin.php?page=yks-mailchimp-welcome'));
1215
+ }
1216
+ } // end yks_easy_mc_plugin_activation_redirect();
1217
+
1218
+
1219
+ /***** SHORTCODES
1220
+ ****************************************************************************************************/
1221
+ // Function to process the shortcode provided by the plugin
1222
+ // $p is the data associated with the shortcode (ie: form id and submit button text)
1223
+ public function processShortcode( $p ) {
1224
+ ob_start();
1225
+ // check if the list is set, to prevent errors from being thrown
1226
+ if ( isset( $this->optionVal['lists'][$p['id']] ) ) {
1227
+
1228
+ if( $this->optionVal['api-key'] != '' && ( is_array( $this->optionVal['lists'][$p['id']] ) && !empty( $this->optionVal['lists'][$p['id']] ) ) ) {
1229
+ // Setup this list
1230
+ $list = $this->optionVal['lists'][$p['id']];
1231
+ $submit_text = $p['submit_text'];
1232
+ // Which form are we on?
1233
+ if( !isset( $this->currentLists[$p['id']] ) ) {
1234
+ $this->currentLists[$p['id']] = 0;
1235
+ } else {
1236
+ $this->currentLists[$p['id']]++;
1237
+ }
1238
+ $listCt = $this->currentLists[$p['id']];
1239
+ // Add the count to the list vars
1240
+ $list['id'] = $listCt.'-'.$list['id'];
1241
+ if( count( $list['fields'] ) ) {
1242
+ foreach( $list['fields'] as $fieldId => $field ) {
1243
+ $list['fields'][$fieldId]['id'] = $listCt.'-'.$field['id'];
1244
+ }
1245
+ }
1246
+ // List form
1247
+ include YKSEME_PATH.'templates/shortcode_form.php';
1248
+ }
1249
+
1250
+ // if there is no api key entered, or it's an invalid api key
1251
+ } else if ( $this->optionVal['api-key'] == '' || get_option( 'api_validation' ) == 'invalid_api_key' ) {
1252
+ include YKSEME_PATH.'templates/shortcode_error_no_API_key.php';
1253
+ // else if the form was removed from the lists page
1254
+ } else {
1255
+ include YKSEME_PATH.'templates/shortcode_error_data.php';
1256
+ }
1257
+ $shortcode = ob_get_contents();
1258
+ ob_end_clean();
1259
+ return $shortcode;
1260
+ } // end processShortcode();
1261
+
1262
+ /* New Function to Display Subscriber Count for a given list */
1263
+ public function displaySubscriberCount( $p ) {
1264
+ ob_start();
1265
+ if( $this->optionVal['api-key'] != '' && ( is_array( $this->optionVal['lists'][$p['id']] ) && !empty( $this->optionVal['lists'][$p['id']] ) ) ) {
1266
+ // Setup this list
1267
+ $list = $this->optionVal['lists'][$p['id']];
1268
+ $mailChimp = new yksemeBase();
1269
+ $list = $mailChimp->getListsData();
1270
+ $list_id = key($list);
1271
+ // return just the subscriber count so the user can easily customize it!
1272
+ echo $list['subscriber-count']['subscriber-count-'.$list_id];
1273
+ } else if ( $this->optionVal['api-key'] == '' || get_option( 'api_validation' ) == 'invalid_api_key' ) {
1274
+ include YKSEME_PATH.'templates/shortcode_error_no_API_key.php';
1275
+ // else if the form was removed from the lists page
1276
+ } else {
1277
+ include YKSEME_PATH.'templates/shortcode_error_data.php';
1278
+ }
1279
+ $shortcode = ob_get_contents();
1280
+ ob_end_clean();
1281
+ return $shortcode;
1282
+ } // end displaySubscriberCount();
1283
+
1284
+ // Function to process the PHP snippet provided by the plugin
1285
+ // Again the data passed in, is the shortcode/php snippet paramaters (form id, submit button text)
1286
+ public function processSnippet($list=false, $submit_text) {
1287
+ $p = array(
1288
+ 'id' => $list,
1289
+ 'submit_text' => $submit_text
1290
+ );
1291
+ return $this->processShortcode($p);
1292
+ } // end processSnippet();
1293
+
1294
+
1295
+ /***** ADMINISTRATION MENUS => Continue Editing Downward!
1296
+ ****************************************************************************************************/
1297
+ public function addAdministrationMenu() {
1298
+ // Top Level Menu
1299
+ add_menu_page( __('MailChimp Forms','yikes-inc-easy-mailchimp-extender'), 'MailChimp Forms', 'manage_options', 'yks-mailchimp-form', array(&$this, 'generatePageOptions'), 'dashicons-welcome-write-blog', 400);
1300
+ // Sub Items
1301
+ add_submenu_page('yks-mailchimp-form', __('MailChimp Forms','yikes-inc-easy-mailchimp-extender'), __('MailChimp Settings','yikes-inc-easy-mailchimp-extender'), 'manage_options', 'yks-mailchimp-form', array(&$this, 'generatePageOptions'));
1302
+ // if the user has entered a VALID API key
1303
+ if ( get_option('api_validation') == 'valid_api_key') {
1304
+ add_submenu_page('yks-mailchimp-form', __('My MailChimp','yikes-inc-easy-mailchimp-extender'), __('My MailChimp','yikes-inc-easy-mailchimp-extender'), 'manage_options', 'yks-mailchimp-my-mailchimp', array(&$this, 'generateUserMailChimpPage'));
1305
+ }
1306
+ add_submenu_page('yks-mailchimp-form', __('Manage List Forms','yikes-inc-easy-mailchimp-extender'), __('Manage List Forms','yikes-inc-easy-mailchimp-extender'), 'manage_options', 'yks-mailchimp-form-lists', array(&$this, 'generatePageLists'));
1307
+ add_submenu_page('yks-mailchimp-form', __('About YIKES, Inc.','yikes-inc-easy-mailchimp-extender'), __('About YIKES, Inc.','yikes-inc-easy-mailchimp-extender'), 'manage_options', 'yks-mailchimp-about-yikes', array(&$this, 'generatePageAboutYikes'));
1308
+ add_submenu_page('options.php', __('Welcome','yikes-inc-easy-mailchimp-extender'), __('Welcome','yikes-inc-easy-mailchimp-extender'), 'manage_options', 'yks-mailchimp-welcome', array(&$this, 'generateWelcomePage'));
1309
+ } // end addAdministrationMenu();
1310
+
1311
+
1312
+ /***** ADMINISTRATION PAGES
1313
+ ****************************************************************************************************/
1314
+ public function generatePageOptions() {
1315
+ require_once YKSEME_PATH.'pages/options.php'; // include our options page
1316
+ } // end generatePageOptions();
1317
+
1318
+ public function generatePageLists() {
1319
+ require_once YKSEME_PATH.'pages/lists.php'; // include our lists page
1320
+ } // end generatePageLists();
1321
+
1322
+ public function generatePageAboutYikes() {
1323
+ require_once YKSEME_PATH.'pages/about.php'; // include our about page
1324
+ } // end generatePageAboutYikes();
1325
+
1326
+ public function registerMailChimpWidget() {
1327
+ require_once YKSEME_PATH.'templates/yikes-mailchimp-widget.php'; // include our widget
1328
+ } // end registerMailChimpWidget();
1329
+
1330
+ public function includeRECAPTCHAlib() {
1331
+ require_once YKSEME_PATH.'lib/recaptchalib.php'; // include our widget
1332
+ } // end includeRECAPTCHAlib();
1333
+
1334
+ public function generateUserMailChimpPage() {
1335
+ require_once YKSEME_PATH.'pages/myMailChimp.php'; // include our widget
1336
+ } // end generateUserMailChimpPage();
1337
+
1338
+ public function generateWelcomePage() {
1339
+ require_once YKSEME_PATH.'pages/welcome.php'; // include our widget
1340
+ } // end generateWelcomePage();
1341
+
1342
+ /***** FORM DATA
1343
+ ****************************************************************************************************/
1344
+ public function yks_resetPluginSettings() {
1345
+ $blog_title = get_bloginfo( 'name' );
1346
+ // reset the plugin settings back to defaults
1347
+ $this->optionVal['api-key'] = '';
1348
+ $this->optionVal['flavor'] = '1';
1349
+ $this->optionVal['debug'] = '0';
1350
+ $this->optionVal['optin'] = 'true';
1351
+ $this->optionVal['single-optin-message'] = __('Thank You for subscribing!', 'yikes-inc-easy-mailchimp-extender');
1352
+ $this->optionVal['double-optin-message'] = __('Thank You for subscribing! Check your email for the confirmation message.', 'yikes-inc-easy-mailchimp-extender');
1353
+ $this->optionVal['optIn-checkbox'] = 'hide';
1354
+ $this->optionVal['yks-mailchimp-optIn-default-list'] = 'select_list';
1355
+ $this->optionVal['yks-mailchimp-optin-checkbox-text'] = 'Add me to the ' . $blog_title . ' mailing list';
1356
+ $this->optionVal['recaptcha-setting'] = '0';
1357
+ $this->optionVal['recaptcha-api-key'] = '';
1358
+ $this->optionVal['recaptcha-private-api-key'] = '';
1359
+ $this->optionVal['yks-mailchimp-jquery-datepicker'] = '';
1360
+ $this->optionVal['version'] = YKSEME_VERSION_CURRENT;
1361
+ $this->optionVal['ssl_verify_peer'] = 'true';
1362
+ update_option('api_validation' , 'invalid_api_key');
1363
+ // we need to unset the previously set up widgets
1364
+ // and set up new erros if the API key doesn't exist
1365
+
1366
+ // 1 - empty the lists array of imported lists
1367
+ $this->optionVal['lists'] = array();
1368
+ // 2 - unset our previously set up widgets
1369
+ update_option( 'widget_yikes_mc_widget' , '' );
1370
+ // update our options
1371
+ return update_option( YKSEME_OPTION, $this->optionVal );
1372
+ } // end yks_resetPluginSettings();
1373
+
1374
+ // Make a call to MailChimp API to validate the provided API key - send request to helper/ping, returns a boolean
1375
+ public function validateAPIkeySettings() {
1376
+
1377
+ // right now we just check the length of the API key being passed in
1378
+ // mailchimp api keys are around 30-40 characters
1379
+ // we check if the string length is greater than 45...
1380
+ if ( strlen($_POST['api_key']) > 45 ) {
1381
+ // Create and store our variables to pass to MailChimp
1382
+ $apiKey = $this->yikes_mc_decryptIt($_POST['api_key']); // api key
1383
+ $apiKey_explosion = explode( "-" , $apiKey);
1384
+ $dataCenter = $apiKey_explosion[0]; // data center (ie: us3)
1385
+ $api = new wpyksMCAPI($apiKey);
1386
+ // try the call, catch any errors that may be thrown
1387
+ try {
1388
+ $resp = $api->call('helper/ping', array('apikey' => $apiKey));
1389
+ echo $resp['msg'];
1390
+ $this->getOptionsLists();
1391
+ } catch( Exception $e ) {
1392
+ $errorMessage = str_replace('API call to helper/ping failed:', '', $e->getMessage());
1393
+ echo $errorMessage;
1394
+ // log our error message for display back to the user
1395
+ $this->writeErrorToErrorLog( $e );
1396
+ }
1397
+ return $apiKey;
1398
+ // always die or it will always return 1
1399
+ wp_die();
1400
+ } else {
1401
+ $apiKey = $this->yikes_mc_encryptIt($_POST['api_key']);
1402
+ // Create and store our variables to pass to MailChimp
1403
+ $decryped_api_key = $this->yikes_mc_decryptIt($apiKey); // api key
1404
+ $apiKey_explosion = explode( "-" , $decryped_api_key);
1405
+ $dataCenter = $apiKey_explosion[0]; // data center (ie: us3)
1406
+ $api = new wpyksMCAPI($decryped_api_key);
1407
+ // try the call, catch any errors that may be thrown
1408
+ try {
1409
+ $resp = $api->call('helper/ping', array('apikey' => $decryped_api_key));
1410
+ echo $resp['msg'];
1411
+ } catch( Exception $e ) {
1412
+ $errorMessage = str_replace('API call to helper/ping failed:', '', $e->getMessage());
1413
+ echo $errorMessage;
1414
+ // log our error message for display back to the user
1415
+ $this->writeErrorToErrorLog( $e );
1416
+ }
1417
+ // always die or it will always return 1
1418
+ return $apiKey;
1419
+ wp_die();
1420
+ }
1421
+ } // end validateAPIkeySettings();
1422
+
1423
+ // Make a call to MailChimp API to get the current users PROFILE
1424
+ public function getUserProfileDetails() {
1425
+ // Create and store our variables to pass to MailChimp
1426
+ $apiKey = $_POST['api_key']; // api key
1427
+ $api = new wpyksMCAPI($apiKey);
1428
+ // try the call, catch any errors that may be thrown
1429
+ try {
1430
+ $profile_response = $api->call('users/profile', array('apikey' => $apiKey));
1431
+ include_once YKSEME_PATH.'templates/mailChimp-profile-template.php';
1432
+ } catch( Exception $e ) {
1433
+ $errorMessage = str_replace('API call to helper/ping failed:', '', $e->getMessage());
1434
+ echo $errorMessage;
1435
+ // write our error to the error log,
1436
+ // when advanced debug is enabled
1437
+ if ( $this->optionVal['debug'] == 1 ) {
1438
+ $this->writeErrorToErrorLog( $e );
1439
+ }
1440
+ }
1441
+
1442
+ // try the call, catch any errors that may be thrown
1443
+ try {
1444
+ $account_details = $api->call('helper/account-details', array('apikey' => $apiKey));
1445
+ include_once YKSEME_PATH.'templates/mailChimp-account-overview.php';
1446
+ } catch( Exception $e ) {
1447
+ $errorMessage = str_replace('API call to helper/ping failed:', '', $e->getMessage());
1448
+ echo $errorMessage;
1449
+ // write our error to the error log,
1450
+ // when advanced debug is enabled
1451
+ if ( $this->optionVal['debug'] == 1 ) {
1452
+ $this->writeErrorToErrorLog( $e );
1453
+ }
1454
+ }
1455
+ // always die or it will always return 1
1456
+ wp_die();
1457
+ } // end getUserProfileDetails();
1458
+
1459
+ /*
1460
+ Send Update Profile Email
1461
+ @since v5.2
1462
+ */
1463
+ public function sendUpdateProfileEmail( $user_email , $list_id ) {
1464
+ $api = new wpyksMCAPI($this->optionVal['api-key']);
1465
+ $explode_key = explode( '-' , $this->optionVal['api-key'] );
1466
+ $data_center = $explode_key[1];
1467
+ $full_site_url = get_bloginfo('url');
1468
+ $extracted_url = str_replace( 'https://' , '' , str_replace( 'www.' , '' , str_replace( 'http://' , '' , $full_site_url ) ) );
1469
+ $site_name = str_replace( ' ' , '' , get_bloginfo('name') ) ;
1470
+ try {
1471
+ // get the site URL
1472
+ // not sure this needs its own API call
1473
+ $account_details = $api->call( 'helper/account-details', array('apikey' => $this->optionVal['api-key'] ) );
1474
+ // get the list details (default from name, default from email)
1475
+ $list_details = $api->call( 'lists/list',
1476
+ array(
1477
+ 'apikey' => $this->optionVal['api-key'],
1478
+ 'filters' => array(
1479
+ 'list_id' => $list_id
1480
+ )
1481
+ )
1482
+ );
1483
+ // get the subscribers info
1484
+ $subscriber_account_details = $api->call('lists/member-info',
1485
+ array(
1486
+ 'id' => $list_id,
1487
+ 'emails' => array(
1488
+ 0 => array(
1489
+ 'email' => $user_email,
1490
+ ),
1491
+ )
1492
+ )
1493
+ );
1494
+ $subscriber_id = $subscriber_account_details['data'][0]['id'];
1495
+ $explode_url = explode( '.' , $account_details['contact']['url'] );
1496
+ $subject = 'MailChimp Profile Update';
1497
+ $headers = 'From: ' . $list_details['data'][0]['default_from_name'] . ' <' . $list_details['data'][0]['default_from_email'] . '>' . "\r\n";
1498
+ $headers .= 'Content-type: text/html';
1499
+ $email_content = '<p>Dear user,</p> <p>A request has been made to update your account information. To do so use the following link: <a href="http://' . $explode_url[1] . '.' . $data_center . '.list-manage1.com/profile?u=' . $account_details['user_id'] . '&id=' . $list_id .'&e=' . $subscriber_id . '" title="Update MailChimp Profile">Update Profile Info.</a>';
1500
+ $email_content .= "<p>If you didn't request this update, please disregard this email.</p>";
1501
+ $email_content .= '<p>&nbsp;</p>';
1502
+ $email_content .= '<p>This email was sent from : ' . $full_site_url . '</p>';
1503
+ $email_content .= '<p>&nbsp;</p>';
1504
+ $email_content .= '<p>&nbsp;</p>';
1505
+ $email_content .= '<p style="font-size:13px;margin-top:5em;float:right;"><em>this email was generated by the <a href="http://www.wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/" target="_blank">YIKES Inc. Easy MailChimp Extender</a> plugin, created by <a href="http://www.yikesinc.com" target="_blank">YIKES Inc.</a></em></p>';
1506
+ if ( wp_mail( $user_email, $subject, $email_content, $headers ) ) {
1507
+ echo '<span class="preloader-confirmation-box success">' . __( 'Update email successfully sent. Please check your inbox for the message.' , 'yikes-inc-easy-mailchimp-extender' ) . '</span>';
1508
+ } else {
1509
+ echo '<span class="preloader-confirmation-box error">' . __( 'Email failed to send. Please contact the site administrator.' , 'yikes-inc-easy-mailchimp-extender' ) . '</span>';
1510
+ }
1511
+ // print_r($account_details);
1512
+ } catch( Exception $e ) {
1513
+ $errorMessage = '<span class="error">' . __( 'Error sending update profile email. Please contact the site administrator.' , 'yikes-inc-easy-mailchimp-extender' ) . '</span>';
1514
+ echo $errorMessage;
1515
+ // write our error to the error log,
1516
+ // when advanced debug is enabled
1517
+ if ( $this->optionVal['debug'] == 1 ) {
1518
+ $this->writeErrorToErrorLog( $e );
1519
+ }
1520
+ }
1521
+ } // end sendUpdateProfileEmail();
1522
+
1523
+
1524
+ // Make a call to MailChimp API to validate the provided API key - api request to helper/chimp-chatter, returns Account Activity
1525
+ public function getMailChimpChatter() {
1526
+ // Create and store our variables to pass to MailChimp
1527
+ $apiKey = $this->optionVal['api-key']; // api key
1528
+ $api = new wpyksMCAPI($apiKey);
1529
+ // try the call, catch any errors that may be thrown
1530
+ try {
1531
+ $resp = $api->call('helper/chimp-chatter', array('apikey' => $apiKey));
1532
+ include_once YKSEME_PATH.'templates/mailChimpChatter-template.php';
1533
+ } catch( Exception $e ) {
1534
+ echo '<strong>'.$e->getMessage().'</strong>';
1535
+ // write our error to the error log,
1536
+ // when advanced debug is enabled
1537
+ if ( $this->optionVal['debug'] == 1 ) {
1538
+ $this->writeErrorToErrorLog( $e );
1539
+ }
1540
+
1541
+ }
1542
+ // always die or it will always return 1
1543
+ wp_die();
1544
+ } // end getMailChimpChatter();
1545
+
1546
+
1547
+ // Make a call to MailChimp API to validate the provided API key
1548
+ // calls the helper/chimp-chatter method, and returns Account Activity
1549
+ public function getMailChimpChatterForWidget() {
1550
+ // Create and store our variables to pass to MailChimp
1551
+ $apiKey = $this->optionVal['api-key']; // api key
1552
+ $api = new wpyksMCAPI($apiKey);
1553
+ // try the call, catch any errors that may be thrown
1554
+ try {
1555
+ $resp = $api->call('helper/chimp-chatter', array('apikey' => $apiKey));
1556
+ include_once YKSEME_PATH.'templates/mailChimpChatter-widget-template.php';
1557
+ } catch( Exception $e ) {
1558
+ echo '<strong>'.$e->getMessage().'</strong>';
1559
+ // write our error to the error log,
1560
+ // when advanced debug is enabled
1561
+ if ( $this->optionVal['debug'] == 1 ) {
1562
+ $this->writeErrorToErrorLog( $e );
1563
+ }
1564
+
1565
+ }
1566
+ // always die or it will always return 1
1567
+ wp_die();
1568
+ } // end getMailChimpChatterForWidget();
1569
+
1570
+
1571
+ // Make a call to MailChimp API to lists/growth history
1572
+ public function getListGrowthHistory() {
1573
+ // Create and store our variables to pass to MailChimp
1574
+ $apiKey = $_POST['api_key']; // api key
1575
+ if ( isset($_POST['list_id']) ) { $listID = $_POST['list_id']; } else { $listID = NULL; }
1576
+ $api = new wpyksMCAPI($apiKey);
1577
+ // try the call, catch any errors that may be thrown
1578
+ try {
1579
+ $resp = $api->call('lists/growth-history', array( 'apikey' => $apiKey , 'id' => $listID ));
1580
+ // include our Stats Template
1581
+ include_once YKSEME_PATH.'templates/mailChimp-list-growth-template.php';
1582
+ // Working File
1583
+ // date is returned out of order tho...
1584
+ // include_once YKSEME_PATH.'templates/mailChimp-list-growth-template.php';
1585
+ } catch( Exception $e ) {
1586
+ echo '<strong>'.$e->getMessage().'</strong>';
1587
+ // write our error to the error log,
1588
+ // when advanced debug is enabled
1589
+ if ( $this->optionVal['debug'] == 1 ) {
1590
+ $this->writeErrorToErrorLog( $e );
1591
+ }
1592
+
1593
+ }
1594
+ // always die or it will always return 1
1595
+ wp_die();
1596
+ } // end getListGrowthHistory();
1597
+
1598
+
1599
+ // Make a call to MailChimp API to
1600
+ // get a specified all campaigns or specified list campaign data
1601
+ // used for both overall aggregate stats AND single list stats
1602
+ public function getCapmpaignData() {
1603
+ // Create and store our variables to pass to MailChimp
1604
+ $apiKey = $_POST['api_key']; // api key
1605
+ $api = new wpyksMCAPI($apiKey);
1606
+ // try the call, catch any errors that may be thrown
1607
+ try {
1608
+ $resp = $api->call('campaigns/list', array( 'apikey' => $apiKey , 'limit' => 1000 ));
1609
+ // include our Stats Template
1610
+ include_once YKSEME_PATH.'templates/mailChimp-campaign-stats-template.php';
1611
+ } catch( Exception $e ) {
1612
+ echo '<strong>'.$e->getMessage().'</strong>';
1613
+ // write our error to the error log,
1614
+ // when advanced debug is enabled
1615
+ if ( $this->optionVal['debug'] == 1 ) {
1616
+ $this->writeErrorToErrorLog( $e );
1617
+ }
1618
+
1619
+ }
1620
+ // always die or it will always return 1
1621
+ wp_die();
1622
+ } // end getCapmpaignData();
1623
+
1624
+
1625
+ // Make a call to MailChimp API to
1626
+ // To get our piechart for the link stats page
1627
+ public function getPieChart() {
1628
+ // Create and store our variables to pass to MailChimp
1629
+ $pie_chart_link_data_array = $_POST['pie_chart_data_array']; // link data
1630
+ // include our Stats Template
1631
+ include YKSEME_PATH.'templates/mailChimp-campaign-clicks-pie-chart.php';
1632
+
1633
+ // always die or it will always return 1
1634
+ wp_die();
1635
+ }
1636
+
1637
+ // Make a call to MailChimp API to
1638
+ // get a specified all campaigns or specified list campaign data
1639
+ // used for both overall aggregate stats AND single list stats
1640
+ public function getSpecificCapmpaignData() {
1641
+ // Create and store our variables to pass to MailChimp
1642
+ $apiKey = $_POST['api_key']; // api key
1643
+ $api = new wpyksMCAPI($apiKey);
1644
+ $campaign_id = $_POST['campaign_id'];
1645
+ $campaign_title = $_POST['campaign_title'];
1646
+ $campaign_email_subject = $_POST['campaign_subject'];
1647
+ $campaign_send_date = $_POST['campaign_send_date'];
1648
+ $campaign_send_time = $_POST['campaign_send_time'];
1649
+ $campaign_view_email_link = $_POST['campaign_view_email_link'];
1650
+ $campaign_web_Id = $_POST['campaign_web_Id'];
1651
+ // try the call, catch any errors that may be thrown
1652
+ try {
1653
+ $resp = $api->call('reports/summary', array( 'apikey' => $apiKey , 'cid' => $campaign_id ));
1654
+ // include our Stats Template
1655
+ include_once YKSEME_PATH.'templates/mailChimp-campaign-report.php';
1656
+ // print_r($resp);
1657
+ } catch( Exception $e ) {
1658
+ echo '<strong>'.$e->getMessage().'</strong>';
1659
+ // write our error to the error log,
1660
+ // when advanced debug is enabled
1661
+ if ( $this->optionVal['debug'] == 1 ) {
1662
+ $this->writeErrorToErrorLog( $e );
1663
+ }
1664
+ }
1665
+ // always die or it will always return 1
1666
+ wp_die();
1667
+ } // end getSpecificCapmpaignData();
1668
+
1669
+ // Send a call to MailChimp API to get the email recipients of a specific campaign
1670
+ public function getCampaignEmailToTable() {
1671
+ // Create and store our variables to pass to MailChimp
1672
+ $apiKey = $_POST['api_key']; // api key
1673
+ $api = new wpyksMCAPI($apiKey);
1674
+ $campaign_id = $_POST['campaign_id'];
1675
+ // try the call, catch any errors that may be thrown
1676
+ try {
1677
+ $resp = $api->call('reports/sent-to', array( 'apikey' => $apiKey , 'cid' => $campaign_id , 'opts' => array('limit' => '100') ));
1678
+ // include our Stats Template
1679
+ // include_once YKSEME_PATH.'templates/mailChimp-campaign-report.php';
1680
+ // print_r($resp);
1681
+ if ( $resp ) {
1682
+ ?>
1683
+ <script type="text/javascript">
1684
+ jQuery(document).ready(function() {
1685
+ jQuery('#yikes-mailchimp-emailed-subscribers').dataTable();
1686
+ });
1687
+ </script>
1688
+
1689
+ <style>
1690
+ .subscriber_rating_star { font-size:15px; }
1691
+ </style>
1692
+
1693
+ <table id="yikes-mailchimp-emailed-subscribers" class="yks-mailchimp-fields-list" style="width:100%;">
1694
+ <thead class="yikes-mailchimp-subscribers-table-head">
1695
+ <tr>
1696
+ <th style="width:20%;"><?php _e( 'E-Mail' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
1697
+ <th style="width:19%;"><?php _e( 'First Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
1698
+ <th style="width:18%;"><?php _e( 'Last Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
1699
+ <th style="width:25%;"><?php _e( 'Member Rating' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
1700
+ <th style="width:18%;"><?php _e( 'Last Changed' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
1701
+ </tr>
1702
+ </thead>
1703
+ <?php
1704
+ foreach ( $resp['data'] as $recipient ) {
1705
+
1706
+ // create the name variable, dependant on first and last name being stored
1707
+ if ( isset ( $recipient['member']['merges']['FNAME'] ) && $recipient['member']['merges']['FNAME'] != '' ) {
1708
+ $user_first_name = $recipient['member']['merges']['FNAME'];
1709
+ } else {
1710
+ $user_first_name = '';
1711
+ }
1712
+ if ( isset ( $recipient['member']['merges']['LNAME'] ) && $recipient['member']['merges']['LNAME'] != '' ) {
1713
+ $user_last_name = $recipient['member']['merges']['LNAME'];
1714
+ } else {
1715
+ $user_last_name = '';
1716
+ }
1717
+
1718
+ $user_email = $recipient['member']['email'];
1719
+ $user_id = $recipient['member']['id'];
1720
+ $email_type = $recipient['member']['email_type'];
1721
+ $user_rating = $recipient['member']['member_rating'];
1722
+ $user_last_changed = $recipient['member']['info_changed'];
1723
+ $exploded_change = explode( ' ' , $user_last_changed);
1724
+ $user_last_changed_date = date( 'm/d/Y' , strtotime( $exploded_change[0] ) );
1725
+ $user_last_changed_time = date( 'g:i a' , strtotime( $exploded_change[1] ) );
1726
+
1727
+ if(isset($user_rating)) {
1728
+ if ($user_rating == 1) {
1729
+ $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
1730
+ } else if ($user_rating == 2) {
1731
+ $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
1732
+ } else if ($user_rating == 3) {
1733
+ $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
1734
+ } else if ($user_rating == 4) {
1735
+ $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
1736
+ } else if ($user_rating == 5) {
1737
+ $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span></div>';
1738
+ }
1739
+ }
1740
+
1741
+ // $timeStamp = explode(' ', $subscriber['timestamp_opt'] );
1742
+ echo '<tr class="yks-mailchimp-subscribers-list-row" id="yks-mailchimp-subscribers-list-row">';
1743
+ echo '<td><a class="subscriber-mail-link" rel="'.$user_email.'" class="subscriberEmailAddress">'.$user_email.'</a></td>';
1744
+ echo '<td>'.ucfirst(strtolower($user_first_name)).'</td>';
1745
+ echo '<td>'.ucfirst(strtolower($user_last_name)).'</td>';
1746
+ echo '<td><span style="display:none;">'.$user_rating.'</span>'.$member_rating_stars.'</td>';
1747
+ echo '<td>'.$user_last_changed_date . ' at ' . $user_last_changed_time .'</td>';
1748
+ echo '</tr>';
1749
+
1750
+ }
1751
+ ?>
1752
+ </table>
1753
+ <?php
1754
+ }
1755
+ } catch( Exception $e ) {
1756
+ echo '<strong>'.$e->getMessage().'</strong>';
1757
+ // write our error to the error log,
1758
+ // when advanced debug is enabled
1759
+ if ( $this->optionVal['debug'] == 1 ) {
1760
+ $this->writeErrorToErrorLog( $e );
1761
+ }
1762
+
1763
+ }
1764
+ // always die or it will always return 1
1765
+ wp_die();
1766
+ } // end getCampaignEmailToTable();
1767
+
1768
+
1769
+ // Send a call to MailChimp API to get the geo location of users who opened links
1770
+ public function getGeoDataForCampaignOpenLinks() {
1771
+ // Create and store our variables to pass to MailChimp
1772
+ $apiKey = $_POST['api_key']; // api key
1773
+ $api = new wpyksMCAPI($apiKey);
1774
+ $campaign_id = $_POST['campaign_id'];
1775
+ // try the call, catch any errors that may be thrown
1776
+ try {
1777
+ $resp = $api->call('reports/geo-opens', array( 'apikey' => $apiKey , 'cid' => $campaign_id ) );
1778
+ // include our Stats Template
1779
+ // include_once YKSEME_PATH.'templates/mailChimp-campaign-report.php';
1780
+ // print_r($resp);
1781
+ if ( $resp ) {
1782
+ include_once YKSEME_PATH.'templates/mailChimp-campaign-click-geo-map.php';
1783
+ }
1784
+ } catch( Exception $e ) {
1785
+ // write our error to the error log,
1786
+ // when advanced debug is enabled
1787
+ if ( $this->optionVal['debug'] == 1 ) {
1788
+ $this->writeErrorToErrorLog( $e );
1789
+ }
1790
+ ?>
1791
+ <script>
1792
+ jQuery(document).ready(function() {
1793
+ setTimeout(function() {
1794
+ var mailChimpError = '<?php echo "<strong class=yks-mc-report-error>".$e->getMessage()."</strong>"; ?>';
1795
+ jQuery('#open_tracking_disabled_warning').fadeIn();
1796
+ jQuery('#geo_map_no_data').append('<p class="geo_map_no_data_error">'+mailChimpError+'</p>');
1797
+ }, 600);
1798
+ });
1799
+ </script>
1800
+
1801
+ <section class="overview_information_section">
1802
+
1803
+ <div class="overview_information">
1804
+
1805
+ <h2>Campaign Activity Geo Map</h2>
1806
+
1807
+ <div id="geo_map_no_data" style="max-width: 100%;min-width: 100%; background:#fff;">
1808
+ <div id="geo_map_no_data_overlay"></div>
1809
+ <img src="<?php echo plugins_url( '/../images/highcharts-worldmap-disabled.png' , __FILE__ ); ?>" alt="World Map Disabled" title="World Map Disabled">
1810
+ </div>
1811
+ </div>
1812
+
1813
+ </section>
1814
+
1815
+ <?php
1816
+ }
1817
+ // always die or it will always return 1
1818
+ wp_die();
1819
+ } // end getGeoDataForCampaignOpenLinks();
1820
+
1821
+
1822
+ // Make a call to MailChimp API to
1823
+ // get link tracking information for a specified campaign
1824
+ // used in the world map on the campaign stats page
1825
+ public function getCampaignLinkStats() {
1826
+ // Create and store our variables to pass to MailChimp
1827
+ $apiKey = $_POST['api_key']; // api key
1828
+ $api = new wpyksMCAPI($apiKey);
1829
+ $campaign_id = $_POST['campaign_id'];
1830
+ // try the call, catch any errors that may be thrown
1831
+ try {
1832
+ $campaign_click_stats = $api->call( '/reports/clicks' , array( 'apikey' => $apiKey , 'cid' => $campaign_id ) );
1833
+ // include our Stats Template
1834
+ include_once YKSEME_PATH.'templates/mailChimp-campaign-click-report.php';
1835
+ } catch( Exception $e ) {
1836
+ echo '<strong>'.$e->getMessage().'</strong>';
1837
+ // write our error to the error log,
1838
+ // when advanced debug is enabled
1839
+ if ( $this->optionVal['debug'] == 1 ) {
1840
+ $this->writeErrorToErrorLog( $e );
1841
+ }
1842
+ }
1843
+ // always die or it will always return 1
1844
+ wp_die();
1845
+ } // end getCampaignLinkStats();
1846
+
1847
+
1848
+ // Make a call to MailChimp API to
1849
+ // get users who opened a specific campaign
1850
+ // used in the stats page modal
1851
+ public function getCampaignOpenedData() {
1852
+ // Create and store our variables to pass to MailChimp
1853
+ $apiKey = $_POST['api_key']; // api key
1854
+ $api = new wpyksMCAPI($apiKey);
1855
+ $campaign_id = $_POST['campaign_id'];
1856
+ // try the call, catch any errors that may be thrown
1857
+ try {
1858
+ // create our interactive data table
1859
+ // and initialize it here...
1860
+
1861
+ $campaign_open_stats = $api->call( '/reports/opened' , array( 'apikey' => $apiKey , 'cid' => $campaign_id , 'opts' => array( 'sort_field' => 'opens' , 'sort_dir' => 'DESC' ) ) );
1862
+
1863
+ // create an empty array
1864
+ $total_opens_array = array();
1865
+ // build our total opens array
1866
+ foreach ( $campaign_open_stats['data'] as $opened_data ) {
1867
+ $total_opens_array[] = $opened_data['opens'];
1868
+ }
1869
+
1870
+ // display total unique opens
1871
+ echo '<h2 style="float:left;">' . __( 'Unique Opens' , 'yikes-inc-easy-mailchimp-extender' ) . ' - ' . $campaign_open_stats["total"] . '</h2>';
1872
+ // display total opens
1873
+ echo '<h2 style="float:right;">' . __( 'Total Opens' , 'yikes-inc-easy-mailchimp-extender' ) . ' - ' . array_sum($total_opens_array) . '</h2>';
1874
+
1875
+ // echo '<h2>' . __( 'Total Opens' 'yikes-inc-easy-mailchimp-extender' ) . $campaign_open_stats["total"] . '</h2>';
1876
+
1877
+ ?>
1878
+ <!-- initialize o ur data table -->
1879
+ <script type="text/javascript">
1880
+ jQuery(document).ready(function() {
1881
+ jQuery('#yikes-mailchimp-subscribers-opens').dataTable({
1882
+ "aaSorting": [[ 1, "desc" ]]
1883
+ });
1884
+ });
1885
+ </script>
1886
+
1887
+ <style>
1888
+ .subscriber_rating_star { font-size:15px; }
1889
+ </style>
1890
+
1891
+ <!-- build our opened user table -->
1892
+ <table id="yikes-mailchimp-subscribers-opens" class="yks-mailchimp-fields-list" style="width:100%;">
1893
+ <thead class="yikes-mailchimp-subscribers-table-head">
1894
+ <tr>
1895
+ <th style="width:31%;"><?php _e( 'E-Mail' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
1896
+ <th style="width:14%;"><?php _e( 'Opens' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
1897
+ <th style="width:20%;"><?php _e( 'First Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
1898
+ <th style="width:20%;"><?php _e( 'Last Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
1899
+ <th style="width:15%;"><?php _e( 'Member Rating' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
1900
+ </tr>
1901
+ </thead>
1902
+ <?php
1903
+ // loop over to build create and store our user variables returned by mailchimp
1904
+ foreach ( $campaign_open_stats['data'] as $opened_data ) {
1905
+
1906
+ // checking if FNAME is set as a merge variable
1907
+ // if not, we'll just make it an empty string
1908
+ if ( isset ( $opened_data['member']['merges']['LNAME'] ) ) {
1909
+ $opened_data['member']['merges']['LNAME'] = $opened_data['member']['merges']['LNAME'];
1910
+ } else {
1911
+ $opened_data['member']['merges']['LNAME'] = '';
1912
+ }
1913
+
1914
+ // checking if LNAME is set as a merge variable
1915
+ // if not, we'll just make it an empty string
1916
+ if ( isset ( $opened_data['member']['merges']['FNAME'] ) ) {
1917
+ $opened_data['member']['merges']['FNAME'] = $opened_data['member']['merges']['FNAME'];
1918
+ } else {
1919
+ $opened_data['member']['merges']['FNAME'] = '';
1920
+ }
1921
+
1922
+
1923
+ if(isset($opened_data['member']['member_rating'])) {
1924
+ if ($opened_data['member']['member_rating'] == 1) {
1925
+ $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
1926
+ } else if ($opened_data['member']['member_rating'] == 2) {
1927
+ $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
1928
+ } else if ($opened_data['member']['member_rating'] == 3) {
1929
+ $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
1930
+ } else if ($opened_data['member']['member_rating'] == 4) {
1931
+ $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
1932
+ } else if ($opened_data['member']['member_rating'] == 5) {
1933
+ $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span></div>';
1934
+ }
1935
+ }
1936
+ // build our table inside the loop
1937
+ echo '<tr>';
1938
+ echo '<td><a href="mailto:'.$opened_data['member']['email'].'">'.$opened_data['member']['email'].'</a></td>';
1939
+ echo '<td>'.$opened_data['opens'].'</td>';
1940
+ echo '<td>'.ucfirst(strtolower($opened_data['member']['merges']['FNAME'])).'</td>';
1941
+ echo '<td>'.ucfirst(strtolower($opened_data['member']['merges']['LNAME'])).'</td>';
1942
+ echo '<td><span style="display:none;">'.$opened_data['member']['member_rating'].'</span>'.$member_rating_stars.'</td>';
1943
+ echo '</tr>';
1944
+ }
1945
+
1946
+ } catch( Exception $e ) {
1947
+ // if there is some error, lets return it
1948
+ echo '<strong>'.$e->getMessage().'</strong>';
1949
+ // write our error to the error log,
1950
+ // when advanced debug is enabled
1951
+ if ( $this->optionVal['debug'] == 1 ) {
1952
+ $this->writeErrorToErrorLog( $e );
1953
+ }
1954
+ }
1955
+ // always die or it will always return 1
1956
+ wp_die();
1957
+ } // end getCampaignOpenedData();
1958
+
1959
+
1960
+ // Make a call to MailChimp API to
1961
+ // get bounced email addressed for this campaign
1962
+ // used in the stats page modal
1963
+ public function getCampaignBouncedEmailData() {
1964
+ // Create and store our variables to pass to MailChimp
1965
+ $apiKey = $_POST['api_key']; // api key
1966
+ $api = new wpyksMCAPI($apiKey);
1967
+ $campaign_id = $_POST['campaign_id'];
1968
+ // try the call, catch any errors that may be thrown
1969
+ try {
1970
+ // create our interactive data table
1971
+ // and initialize it here...
1972
+
1973
+ $campaign_bounce_stats = $api->call( '/reports/bounce-messages' , array( 'apikey' => $apiKey , 'cid' => $campaign_id , 'opts' => array( 'limit' => '100' ) ) );
1974
+
1975
+ // print_r($campaign_bounce_stats);
1976
+
1977
+ // display total unique opens
1978
+ echo '<h2 style="float:left;">' . __( 'Total Bounced Emails' , 'yikes-inc-easy-mailchimp-extender' ) . ' - ' . $campaign_bounce_stats["total"] . '</h2>';
1979
+
1980
+ // echo '<h2>' . __( 'Total Opens' 'yikes-inc-easy-mailchimp-extender' ) . $campaign_open_stats["total"] . '</h2>';
1981
+
1982
+ ?>
1983
+ <!-- initialize o ur data table -->
1984
+ <script type="text/javascript">
1985
+ jQuery(document).ready(function() {
1986
+ jQuery('#yikes-mailchimp-subscribers-bounced').dataTable({
1987
+ "aaSorting": [[ 1, "desc" ]]
1988
+ });
1989
+ });
1990
+ </script>
1991
+
1992
+ <style>
1993
+ .subscriber_rating_star { font-size:15px; }
1994
+ </style>
1995
+
1996
+ <!-- build our opened user table -->
1997
+ <table id="yikes-mailchimp-subscribers-bounced" class="yks-mailchimp-fields-list" style="width:100%;">
1998
+ <thead class="yikes-mailchimp-subscribers-table-head">
1999
+ <tr>
2000
+ <th style="width:31%;"><?php _e( 'E-Mail' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
2001
+ <th style="width:20%;"><?php _e( 'First Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
2002
+ <th style="width:20%;"><?php _e( 'Last Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
2003
+ <th style="width:15%;"><?php _e( 'Member Rating' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
2004
+ </tr>
2005
+ </thead>
2006
+ <?php
2007
+ // loop over to build create and store our user variables
2008
+ // returned by mailchimp
2009
+ foreach ( $campaign_bounce_stats['data'] as $opened_data ) {
2010
+
2011
+ // checking if FNAME is set as a merge variable
2012
+ // if not, we'll just make it an empty string
2013
+ if ( isset ( $opened_data['member']['merges']['LNAME'] ) ) {
2014
+ $opened_data['member']['merges']['LNAME'] = $opened_data['member']['merges']['LNAME'];
2015
+ } else {
2016
+ $opened_data['member']['merges']['LNAME'] = '';
2017
+ }
2018
+
2019
+ // checking if LNAME is set as a merge variable
2020
+ // if not, we'll just make it an empty string
2021
+ if ( isset ( $opened_data['member']['merges']['FNAME'] ) ) {
2022
+ $opened_data['member']['merges']['FNAME'] = $opened_data['member']['merges']['FNAME'];
2023
+ } else {
2024
+ $opened_data['member']['merges']['FNAME'] = '';
2025
+ }
2026
+
2027
+
2028
+ if(isset($opened_data['member']['member_rating'])) {
2029
+ if ($opened_data['member']['member_rating'] == 1) {
2030
+ $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
2031
+ } else if ($opened_data['member']['member_rating'] == 2) {
2032
+ $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
2033
+ } else if ($opened_data['member']['member_rating'] == 3) {
2034
+ $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
2035
+ } else if ($opened_data['member']['member_rating'] == 4) {
2036
+ $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
2037
+ } else if ($opened_data['member']['member_rating'] == 5) {
2038
+ $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span></div>';
2039
+ }
2040
+ }
2041
+ // build our table inside the loop
2042
+ echo '<tr>';
2043
+ echo '<td><a href="mailto:'.$opened_data['member']['email'].'">'.$opened_data['member']['email'].'</a></td>';
2044
+ echo '<td>'.ucfirst(strtolower($opened_data['member']['merges']['FNAME'])).'</td>';
2045
+ echo '<td>'.ucfirst(strtolower($opened_data['member']['merges']['LNAME'])).'</td>';
2046
+ echo '<td><span style="display:none;">'.$opened_data['member']['member_rating'].'</span>'.$member_rating_stars.'</td>';
2047
+ echo '</tr>';
2048
+ }
2049
+
2050
+ // print_r($campaign_open_stats);
2051
+
2052
+ } catch( Exception $e ) {
2053
+ // if there is some error, lets return it
2054
+ echo '<strong>'.$e->getMessage().'</strong>';
2055
+ // write our error to the error log,
2056
+ // when advanced debug is enabled
2057
+ if ( $this->optionVal['debug'] == 1 ) {
2058
+ $this->writeErrorToErrorLog( $e );
2059
+ }
2060
+ }
2061
+ // always die or it will always return 1
2062
+ wp_die();
2063
+ } // end getCampaignBouncedEmailData();
2064
+
2065
+
2066
+ // Make a call to MailChimp API to
2067
+ // get unsubscribed email addressed for this campaign
2068
+ // used in the stats page modal
2069
+ public function getCampaignUnsubscribeData() {
2070
+ // Create and store our variables to pass to MailChimp
2071
+ $apiKey = $_POST['api_key']; // api key
2072
+ $api = new wpyksMCAPI($apiKey);
2073
+ $campaign_id = $_POST['campaign_id'];
2074
+ // try the call, catch any errors that may be thrown
2075
+ try {
2076
+ // create our interactive data table
2077
+ // and initialize it here...
2078
+
2079
+ $campaign_unsubscribe_stats = $api->call( '/reports/unsubscribes' , array( 'apikey' => $apiKey , 'cid' => $campaign_id , 'opts' => array( 'limit' => '100' ) ) );
2080
+
2081
+ // print_r($campaign_bounce_stats);
2082
+
2083
+ // display total unique opens
2084
+ echo '<h2 style="float:left;">' . __( 'Total Unsubscribes' , 'yikes-inc-easy-mailchimp-extender' ) . ' - ' . $campaign_unsubscribe_stats["total"] . '</h2>';
2085
+
2086
+ // echo '<h2>' . __( 'Total Opens' 'yikes-inc-easy-mailchimp-extender' ) . $campaign_open_stats["total"] . '</h2>';
2087
+
2088
+ ?>
2089
+ <!-- initialize o ur data table -->
2090
+ <script type="text/javascript">
2091
+ jQuery(document).ready(function() {
2092
+ jQuery('#yikes-mailchimp-unsubscribe-table').dataTable({
2093
+ "aaSorting": [[ 0, "desc" ]]
2094
+ });
2095
+ });
2096
+ </script>
2097
+
2098
+ <style>
2099
+ .subscriber_rating_star { font-size:15px; }
2100
+ </style>
2101
+
2102
+ <!-- build our opened user table -->
2103
+ <table id="yikes-mailchimp-unsubscribe-table" class="yks-mailchimp-fields-list" style="width:100%;">
2104
+ <thead class="yikes-mailchimp-subscribers-table-head">
2105
+ <tr>
2106
+ <th style="width:31%;"><?php _e( 'E-Mail' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
2107
+ <th style="width:20%;"><?php _e( 'First Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
2108
+ <th style="width:20%;"><?php _e( 'Last Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
2109
+ <th style="width:15%;"><?php _e( 'Member Rating' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
2110
+ <th style="width:15%;"><?php _e( 'Reason' , 'yikes-inc-easy-mailchimp-extender' ); ?></th>
2111
+ </tr>
2112
+ </thead>
2113
+ <?php
2114
+ // loop over to build create and store our user variables
2115
+ // returned by mailchimp
2116
+ foreach ( $campaign_unsubscribe_stats['data'] as $opened_data ) {
2117
+
2118
+ // checking if FNAME is set as a merge variable
2119
+ // if not, we'll just make it an empty string
2120
+ if ( isset ( $opened_data['member']['merges']['LNAME'] ) ) {
2121
+ $opened_data['member']['merges']['LNAME'] = $opened_data['member']['merges']['LNAME'];
2122
+ } else {
2123
+ $opened_data['member']['merges']['LNAME'] = '';
2124
+ }
2125
+
2126
+ // checking if LNAME is set as a merge variable
2127
+ // if not, we'll just make it an empty string
2128
+ if ( isset ( $opened_data['member']['merges']['FNAME'] ) ) {
2129
+ $opened_data['member']['merges']['FNAME'] = $opened_data['member']['merges']['FNAME'];
2130
+ } else {
2131
+ $opened_data['member']['merges']['FNAME'] = '';
2132
+ }
2133
+
2134
+
2135
+ if(isset($opened_data['member']['member_rating'])) {
2136
+ if ($opened_data['member']['member_rating'] == 1) {
2137
+ $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
2138
+ } else if ($opened_data['member']['member_rating'] == 2) {
2139
+ $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
2140
+ } else if ($opened_data['member']['member_rating'] == 3) {
2141
+ $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
2142
+ } else if ($opened_data['member']['member_rating'] == 4) {
2143
+ $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-empty"></span></div>';
2144
+ } else if ($opened_data['member']['member_rating'] == 5) {
2145
+ $member_rating_stars = '<div class="yks-mc-subscriber-rating"><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span><span class="subscriber_rating_star dashicons dashicons-star-filled"></span></div>';
2146
+ }
2147
+ }
2148
+ // build our table inside the loop
2149
+ echo '<tr>';
2150
+ echo '<td><a href="mailto:'.$opened_data['member']['email'].'">'.$opened_data['member']['email'].'</a></td>';
2151
+ echo '<td>'.ucfirst(strtolower($opened_data['member']['merges']['FNAME'])).'</td>';
2152
+ echo '<td>'.ucfirst(strtolower($opened_data['member']['merges']['LNAME'])).'</td>';
2153
+ echo '<td><span style="display:none;">'.$opened_data['member']['member_rating'].'</span>'.$member_rating_stars.'</td>';
2154
+ echo '<td>'.strtolower($opened_data['reason']).'</td>';
2155
+ echo '</tr>';
2156
+ }
2157
+
2158
+ } catch( Exception $e ) {
2159
+ // if there is some error, lets return it
2160
+ echo '<strong>'.$e->getMessage().'</strong>';
2161
+ // write our error to the error log,
2162
+ // when advanced debug is enabled
2163
+ if ( $this->optionVal['debug'] == 1 ) {
2164
+ $this->writeErrorToErrorLog( $e );
2165
+ }
2166
+ }
2167
+ // always die or it will always return 1
2168
+ wp_die();
2169
+ } // end getCampaignUnsubscribeData();
2170
+
2171
+
2172
+ // Make a call to MailChimp API to add a new subscriber to a specified list
2173
+ // Runs when a user fills out the form on the frontend of the site
2174
+ public function addUserToMailchimp( $p , $update_existing ) {
2175
+
2176
+ if( !empty( $p['form_data'] ) ) {
2177
+
2178
+ parse_str($p['form_data'], $fd);
2179
+
2180
+ // grab and store our nonce field
2181
+ // for security purposes
2182
+ $yks_mc_form_submission_nonce = $fd['_wpnonce'];
2183
+
2184
+ // cross check our nonce
2185
+ // passing in the action used when we created the nonce field
2186
+ // if the nonce does not match, we need to die()
2187
+ if ( !wp_verify_nonce( $yks_mc_form_submission_nonce , 'yks_mc_front_end_form_'.$fd['yks-mailchimp-list-id'] ) ) {
2188
+ die( __( 'Failed nonce security check. Please reload the page and submit this form again.' , 'yikes-inc-easy-mailchimp-extender' ) );
2189
+ }
2190
+
2191
+
2192
+ if( !empty( $fd['yks-mailchimp-list-id'] ) ) {
2193
+
2194
+ // if reCAPTCHA is enabled
2195
+ if ( $this->optionVal['recaptcha-setting'] == '1' ) {
2196
+
2197
+ if ( isset( $fd['g-recaptcha-response'] ) && $fd['g-recaptcha-response'] == '' ) {
2198
+ die( __( 'Please check off that you are not a robot.' , 'yikes-inc-easy-mailchimp-extender' ) );
2199
+ }
2200
+
2201
+ $privatekey = $this->optionVal['recaptcha-private-api-key'];
2202
+ $response = $fd['g-recaptcha-response'];
2203
+
2204
+ // if the CAPTCHA was entered properly
2205
+ if ( $fd['g-recaptcha-response'] == '' ) {
2206
+ // if the response returns invalid,
2207
+ // lets add the animated shake and error fields
2208
+ // to the captcha fields
2209
+ ?>
2210
+ <script>
2211
+ jQuery(document).ready(function() {
2212
+ jQuery('.g-recaptcha').addClass('yks_error_field_required shake animated').delay(800).queue(function(next){
2213
+ jQuery(this).removeClass('shake animated');
2214
+ next();
2215
+ });
2216
+ });
2217
+ </script>
2218
+ <?php
2219
+
2220
+ // if it returns valid...
2221
+ // continue sending data to MailChimp
2222
+ } else {
2223
+
2224
+ // Create and store the variables needed to add a new subscriber
2225
+ $email = false;
2226
+ $lid = $fd['yks-mailchimp-list-id'];
2227
+ $api = new wpyksMCAPI($this->optionVal['api-key']);
2228
+ $mv = array();
2229
+ $optin = $this->optionVal['optin'];
2230
+
2231
+ foreach($this->optionVal['lists'][$lid]['fields'] as $field) : if($field['active'] == '1') :
2232
+
2233
+ // Check to see if the field is in the post
2234
+ if(isset($fd[$field['name']])) :
2235
+
2236
+ // Grab the primary email
2237
+ if(strtolower($field['merge']) == 'email')
2238
+ $email = $fd[$field['name']];
2239
+
2240
+ // It exists, set the merge var that we send to mailchimp
2241
+ switch($field['type'])
2242
+ {
2243
+ default:
2244
+ $mv[$field['merge']] = $fd[$field['name']];
2245
+ break;
2246
+
2247
+ case 'address':
2248
+ $mv[$field['merge']] = array(
2249
+ 'addr1' => $fd[$field['name']],
2250
+ 'addr2' => $fd[$field['name'].'-add2'],
2251
+ 'city' => $fd[$field['name'].'-city'],
2252
+ 'state' => $fd[$field['name'].'-state'],
2253
+ 'zip' => $fd[$field['name'].'-zip'],
2254
+ 'country' => 'US'
2255
+ );
2256
+ break;
2257
+
2258
+ }
2259
+
2260
+
2261
+
2262
+ endif;
2263
+ endif; endforeach;
2264
+
2265
+ // Interest group loop to build the GROUPINGS array
2266
+ // The GROUPINGS array passes our interest group, and values back to the specific form
2267
+ if ( isset($fd['interest-group-data']) ) {
2268
+ $interest_group_option = json_decode($fd['interest-group-data'], true);
2269
+ }
2270
+ // if interest groups exist, continue and form an array
2271
+ if ( isset($interest_group_option) ) {
2272
+
2273
+ // print_r($interest_group_option);
2274
+ $mv['GROUPINGS'] = array();
2275
+
2276
+ // loop over each interest group
2277
+ foreach ($interest_group_option as $group ) :
2278
+
2279
+ switch($group['form_field'])
2280
+ {
2281
+ case 'radio':
2282
+ case 'dropdown':
2283
+ array_push($mv['GROUPINGS'], array(
2284
+ 'id' => $group['id'],
2285
+ // 'groups' => array($fd['interest-group'])
2286
+ 'groups' => array(isset($fd[$group['form_field'].'-'.$group['id']]) ? $fd[$group['form_field'].'-'.$group['id']] : '')
2287
+ )
2288
+ );
2289
+ break;
2290
+
2291
+ case 'checkboxes':
2292
+ array_push($mv['GROUPINGS'], array(
2293
+ 'id' => $group['id'],
2294
+ // 'groups' => array($fd['interest-group'])
2295
+ 'groups' => (isset($fd[$group['form_field'].'-'.$group['id']]) ? $fd[$group['form_field'].'-'.$group['id']] : '')
2296
+ // $fd[$group['form_field'].'-'.$group['id']]
2297
+
2298
+ )
2299
+ );
2300
+ break;
2301
+ }
2302
+ endforeach; // end loop
2303
+
2304
+ }
2305
+
2306
+ // If no email provided, fail
2307
+ $noemail = "The email address is blank";
2308
+ if($email === false) return $noemail;
2309
+
2310
+ // Add custom filter here, to capture user submitted
2311
+ // data before it's sent off to MailChimp
2312
+ $form_data = apply_filters( 'yikes_mc_get_form_data' , $mv );
2313
+
2314
+ $form_data = apply_filters( 'yikes_mc_get_form_data_'.$lid, $mv );
2315
+
2316
+
2317
+ // try adding subscriber, catch any error thrown
2318
+ try {
2319
+ $retval = $api->call('lists/subscribe', array(
2320
+ 'id' => $lid, // form id
2321
+ 'email' => array( 'email' => $email ), // user email
2322
+ 'merge_vars' => $form_data, // merge variables (ie: fields and interest groups)
2323
+ 'double_optin' => $optin, // double optin value (retreived from the settings page)
2324
+ 'update_existing' => $update_existing
2325
+ ));
2326
+ return "done";
2327
+ } catch( Exception $e ) { // catch any errors returned from MailChimp
2328
+ $errorCode = $e->getCode();
2329
+ if ( $errorCode = '214' ) {
2330
+ $errorMessage = $e->getMessage();
2331
+ return json_encode( array( 'errorCode' => $errorCode , 'errorResponse' => apply_filters( 'yikes_mc_user_already_subscribed' , $errorMessage , $email ) ) );
2332
+ die();
2333
+ } else {
2334
+ echo '<strong>'.$e->getMessage().'</strong>';
2335
+ die();
2336
+ }
2337
+ }
2338
+ }
2339
+
2340
+ // if reCAPTCHA is not active, we will just send the request
2341
+ // without further verification
2342
+ } else {
2343
+
2344
+ // Create and store the variables needed to add a new subscriber
2345
+ $email = false;
2346
+ $lid = $fd['yks-mailchimp-list-id'];
2347
+ $api = new wpyksMCAPI($this->optionVal['api-key']);
2348
+ $mv = array();
2349
+ $optin = $this->optionVal['optin'];
2350
+
2351
+ foreach($this->optionVal['lists'][$lid]['fields'] as $field) : if($field['active'] == '1') :
2352
+
2353
+ // Check to see if the field is in the post
2354
+ if(isset($fd[$field['name']])) :
2355
+
2356
+ // Grab the primary email
2357
+ if(strtolower($field['merge']) == 'email')
2358
+ $email = $fd[$field['name']];
2359
+
2360
+ // It exists, set the merge var that we send to mailchimp
2361
+ switch($field['type'])
2362
+ {
2363
+ default:
2364
+ $mv[$field['merge']] = $fd[$field['name']];
2365
+ break;
2366
+
2367
+ case 'address':
2368
+ $mv[$field['merge']] = array(
2369
+ 'addr1' => $fd[$field['name']],
2370
+ 'addr2' => $fd[$field['name'].'-add2'],
2371
+ 'city' => $fd[$field['name'].'-city'],
2372
+ 'state' => $fd[$field['name'].'-state'],
2373
+ 'zip' => $fd[$field['name'].'-zip'],
2374
+ 'country' => 'US'
2375
+ );
2376
+ break;
2377
+
2378
+ }
2379
+
2380
+
2381
+
2382
+ endif;
2383
+ endif; endforeach;
2384
+
2385
+ // Interest group loop to build the GROUPINGS array
2386
+ // The GROUPINGS array passes our interest group, and values back to the specific form
2387
+ if ( isset($fd['interest-group-data']) ) {
2388
+ $interest_group_option = json_decode($fd['interest-group-data'], true);
2389
+ }
2390
+ // if interest groups exist, continue and form an array
2391
+ if ( isset($interest_group_option) ) {
2392
+
2393
+ // print_r($interest_group_option);
2394
+ $mv['GROUPINGS'] = array();
2395
+
2396
+ // loop over each interest group
2397
+ foreach ($interest_group_option as $group ) :
2398
+
2399
+ switch($group['form_field'])
2400
+ {
2401
+ case 'radio':
2402
+ case 'dropdown':
2403
+ array_push($mv['GROUPINGS'], array(
2404
+ 'id' => $group['id'],
2405
+ // 'groups' => array($fd['interest-group'])
2406
+ 'groups' => array(isset($fd[$group['form_field'].'-'.$group['id']]) ? $fd[$group['form_field'].'-'.$group['id']] : '')
2407
+ )
2408
+ );
2409
+ break;
2410
+
2411
+ case 'checkboxes':
2412
+ array_push($mv['GROUPINGS'], array(
2413
+ 'id' => $group['id'],
2414
+ // 'groups' => array($fd['interest-group'])
2415
+ 'groups' => (isset($fd[$group['form_field'].'-'.$group['id']]) ? $fd[$group['form_field'].'-'.$group['id']] : '')
2416
+ // $fd[$group['form_field'].'-'.$group['id']]
2417
+
2418
+ )
2419
+ );
2420
+ break;
2421
+ }
2422
+ endforeach; // end loop
2423
+
2424
+ }
2425
+
2426
+ // If no email provided, fail
2427
+ $noemail = "The email address is blank";
2428
+ if($email === false) return $noemail;
2429
+
2430
+ // Add custom filter here, to capture user submitted
2431
+ // data before it's sent off to MailChimp
2432
+ $form_data = apply_filters( 'yikes_mc_get_form_data' , $mv );
2433
+ $specific_form_data = apply_filters( 'yikes_mc_get_form_data_'.$lid, $lid, $mv );
2434
+
2435
+
2436
+ // try adding subscriber, catch any error thrown
2437
+ try {
2438
+ $retval = $api->call('lists/subscribe', array(
2439
+ 'id' => $lid, // form id
2440
+ 'email' => array( 'email' => $email ), // user email
2441
+ 'merge_vars' => $form_data, // merge variables (ie: fields and interest groups)
2442
+ 'double_optin' => $optin, // double optin value (retreived from the settings page)
2443
+ 'send_welcome' => true,
2444
+ 'update_existing' => $update_existing
2445
+ ));
2446
+ return "done";
2447
+ } catch( Exception $e ) { // catch any errors returned from MailChimp
2448
+ $errorCode = $e->getCode();
2449
+ if ( $errorCode = '214' ) {
2450
+ $errorMessage = $e->getMessage();
2451
+ return json_encode( array( 'errorCode' => $errorCode , 'errorResponse' => apply_filters( 'yikes_mc_user_already_subscribed' , $errorMessage , $email ) ) );
2452
+ die();
2453
+ } else {
2454
+ echo '<strong>'.$e->getMessage().'</strong>';
2455
+ die();
2456
+ }
2457
+ }
2458
+ }
2459
+
2460
+ }
2461
+ } else {
2462
+ return __('One or more fields are empty','yikes-inc-easy-mailchimp-extender'); // return an error if your leaving any necessary fields empty
2463
+ }
2464
+ } // end addUserToMailchimp();
2465
+
2466
+
2467
+ // Generate the lists containers on the lists page
2468
+ // This function gets any imported lists, and builds up the lists page
2469
+ public function generateListContainers($listArr=false) {
2470
+ $listArr = ($listArr == false ? $this->optionVal['lists'] : $listArr);
2471
+ $thelistdata = $this->getListsData(); //Get list names from API
2472
+ // if there are any imported lists in the array
2473
+ if( count( $listArr ) > 0) {
2474
+ include YKSEME_PATH . 'lib/inc/yks-mc-manage-list-form-table.php';
2475
+ }
2476
+ $output = ob_get_contents();
2477
+ ob_end_clean();
2478
+ return $output;
2479
+ } // end generateListContainers();
2480
+
2481
+
2482
+ // Generate the Merge Variable containers on the lists page
2483
+ // we use this function to re-import merge variables from mailchimp
2484
+ public function generateMergeVariableContainers($listArr=false) {
2485
+ $listArr = ($listArr == false ? $this->optionVal['lists'] : $listArr);
2486
+ $thelistdata = $this->getListsData(); //Get list names from API
2487
+ // if there are any imported lists in the array
2488
+ if(count($listArr) > 0) {
2489
+ ob_start();
2490
+ // loop over each lists and build the page
2491
+ $i = 1;
2492
+ foreach($listArr as $list) {
2493
+ $get_list_data = $this->getListsData();
2494
+ ?>
2495
+ <td class="yks-mailchimp-fields-td" id="yks-mailchimp-fields-td_<?php echo $list['id']; ?>">
2496
+ <fieldset class="yks-mailchimp-fields-container" id="yks-mailchimp-fields-container_<?php echo $list['id']; ?>">
2497
+ <legend class="screen-reader-text"><span><?php _e( 'Active Fields' , 'yikes-inc-easy-mailchimp-extender' ); ?></span></legend>
2498
+ <div class="yks-mailchimp-fields-list" id="yks-mailchimp-fields-list_<?php echo $list['id']; ?>" rel="<?php echo $list['id']; ?>">
2499
+ <!-- create sortable rows populated with mailchimp data -->
2500
+ <?php
2501
+ $num = 1;
2502
+ foreach($list['fields'] as $field) { ?>
2503
+ <div class="yks-mailchimp-fields-list-row" alt="<?php echo $field['merge']; ?>" rel="<?php echo $field['id']; ?>">
2504
+ <!-- update labels on initial creation as well! to do-->
2505
+ <label title="Delete <?php echo $field['label']; ?> Field">
2506
+ <span class="yks-mc-delete-merge-var"><span class="dashicons dashicons-no-alt"></span></span>
2507
+ </label>
2508
+ <label title="Edit <?php echo $field['label']; ?> Field">
2509
+ <span class="yks-mc-merge-var-change"><span class="dashicons dashicons-edit"></span></span>
2510
+ </label>
2511
+ <label title="Reorder <?php echo $field['label']; ?>">
2512
+ <span class="yks-mailchimp-sorthandle"><?php _e( 'Drag' , 'yikes-inc-easy-mailchimp-extender' ); ?> &amp; <?php _e( 'drop' , 'yikes-inc-easy-mailchimp-extender' ); ?></span>
2513
+ </label>
2514
+ <label title="Toggle Visibility of <?php echo $field['label']; ?>">
2515
+ <input type="checkbox" name="<?php echo $field['name']; ?>" id="<?php echo $field['id']; ?>" value="1" <?php echo ($field['active'] == 1 ? 'checked="checked"' : ''); ?><?php echo ($field['require'] == 1 ? 'disabled="disabled"' : ''); ?> />
2516
+ </label>
2517
+ &nbsp;
2518
+ <label>
2519
+ <div class="yks-mailchimp-field-name"><?php echo $field['label']; ?></div>
2520
+ </label>
2521
+
2522
+ <!-- <span class="yks-mailchimp-field-merge"><span class="description"><?php _e( 'Merge field' , 'yikes-inc-easy-mailchimp-extender' ); ?>:</span> &nbsp; <input type="text" class="merge_field_input" name="<?php echo $field['name']; ?>-merge" id="<?php echo $field['id']; ?>-merge" value="<?php echo $field['merge']; ?>"<?php echo (($field['locked'] == 1 || $field['merge'] == false) ? ' disabled="disabled"' : ''); ?> /></span> -->
2523
+ <span class="yks-mailchimp-field-placeholder"><span class="description"><?php _e( 'Placeholder' , 'yikes-inc-easy-mailchimp-extender' ); ?>:</span> &nbsp; <input type="text" class="custom-placeholder-field" name="placeholder-<?php echo $list['id'].'-'.$num; ?>" id="<?php echo $field['id']; ?>-placeholder" placeholder="<?php echo $field['label']; ?>" value="<?php if(isset($field['placeholder-'.$list['id'].'-'.$num])) { echo $field['placeholder-'.$list['id'].'-'.$num]; } ?>" /></span>
2524
+ <span class="yks-mailchimp-field-custom-field-class"><span class="description"><?php _e( 'Custom Class' , 'yikes-inc-easy-mailchimp-extender' ); ?>:</span> &nbsp; <input type="text" name="custom-field-class-<?php echo $list['id'].'-'.$num; ?>" id="<?php echo $field['id']; ?>-custom-field-class" value="<?php if(isset($field['custom-field-class-'.$list['id'].'-'.$num])) { echo $field['custom-field-class-'.$list['id'].'-'.$num]; } ?>" /></span>
2525
+ </div>
2526
+ <?php
2527
+ $num++;
2528
+ } ?>
2529
+ </div>
2530
+ </fieldset>
2531
+ </td>
2532
+ <?php
2533
+ $i++;
2534
+ }
2535
+ }
2536
+ $output = ob_get_contents();
2537
+ ob_end_clean();
2538
+ return $output;
2539
+ } // end generateMergeVariableContainers();
2540
+
2541
+ // Get list data
2542
+ public function getListDataRightMeow() {
2543
+ echo json_encode( $this->optionVal['lists'] );
2544
+ } // end getListDataRightMeow();
2545
+
2546
+ // Generate our front end JavaScript , used to submit forms
2547
+ public function getFrontendFormJavascript($list='') {
2548
+ if($list === '') return false;
2549
+ $js = false;
2550
+ foreach($list['fields'] as $field) : if($field['active'] == 1) :
2551
+ // Setup JavaScript
2552
+ if($field['require'] == '1') :
2553
+ $prefix = "ymce";
2554
+ $js .= "\n";
2555
+ switch($field['type']) {
2556
+
2557
+ // default
2558
+ default:
2559
+ $prefixa = "ymce";
2560
+ $js .= "if ($".$prefixa."('#".$field['id']."').val() == '')";
2561
+ $js .= "{
2562
+ msg += '<li>".$field['label']."'+'\\n</li>';
2563
+ err++;
2564
+ $".$prefixa."('#".$field['id']."').addClass('yks_error_field_required shake animated').delay(1200).queue(function(next){
2565
+ $".$prefixa."(this).removeClass('shake animated');
2566
+ next();
2567
+ });
2568
+ } else {
2569
+ $".$prefixa."('#".$field['id']."').removeClass('yks_error_field_required');
2570
+ }";
2571
+ break;
2572
+
2573
+ // address
2574
+ case 'address':
2575
+ $js .= "if($".$prefix."('#".$field['id']."').val() == '') {
2576
+ msg += '<li>Street Address'+'\\n</li>';
2577
+ err++;
2578
+ $".$prefixa."('#".$field['id']."').addClass('yks_error_field_required shake animated').delay(800).queue(function(next){
2579
+ $".$prefixa."(this).removeClass('shake animated');
2580
+ next();
2581
+ });
2582
+ } else {
2583
+ $".$prefixa."('#".$field['id']."').removeClass('yks_error_field_required')
2584
+ }
2585
+
2586
+ if($".$prefix."('#".$field['id']."-city').val() == '') {
2587
+ msg += '<li>City'+'\\n</li>';
2588
+ err++;
2589
+ $".$prefixa."('#".$field['id']."-city').addClass('yks_error_field_required shake animated').delay(800).queue(function(next){
2590
+ $".$prefixa."(this).removeClass('shake animated');
2591
+ next();
2592
+ });
2593
+ } else {
2594
+ $".$prefixa."('#".$field['id']."-city').removeClass('yks_error_field_required')
2595
+ }
2596
+ if($".$prefix."('#".$field['id']."-state').val() == '') {
2597
+ msg += '<li>State'+'\\n</li>';
2598
+ err++;
2599
+ $".$prefixa."('#".$field['id']."-state').addClass('yks_error_field_required shake animated').delay(800).queue(function(next){
2600
+ $".$prefixa."(this).removeClass('shake animated');
2601
+ next();
2602
+ });
2603
+ } else {
2604
+ $".$prefixa."('#".$field['id']."-state').removeClass('yks_error_field_required')
2605
+ }
2606
+ if($".$prefix."('#".$field['id']."-zip').val() == '') {
2607
+ msg += '<li>Zip Code'+'\\n</li>';
2608
+ err++;
2609
+ $".$prefixa."('#".$field['id']."-zip').addClass('yks_error_field_required shake animated').delay(800).queue(function(next){
2610
+ $".$prefixa."(this).removeClass('shake animated');
2611
+ next();
2612
+ });
2613
+ } else {
2614
+ $".$prefixa."('#".$field['id']."-zip').removeClass('yks_error_field_required')
2615
+ }";
2616
+ break;
2617
+
2618
+ // radio
2619
+ case 'radio':
2620
+ $js .= "if($".$prefix."('.".$field['name'].":checked').length <= 0) {
2621
+ msg += '<li>".$field['label']."\\n</li>';
2622
+ err++;
2623
+ $".$prefixa."('label[for=".$field['id']."]').next().find('input').addClass('yks_error_field_required shake animated').delay(800).queue(function(next){
2624
+ $".$prefixa."(this).removeClass('shake animated');
2625
+ next();
2626
+ });
2627
+ } else {
2628
+ $".$prefixa."('#".$field['id']."').removeClass('yks_error_field_required')
2629
+ }";
2630
+ break;
2631
+ }
2632
+
2633
+ $js .= "\n";
2634
+ endif;
2635
+ endif; endforeach;
2636
+ return $js;
2637
+ } // end getFrontendFormJavascript();
2638
+
2639
+ // Generate the form on the front end of the site
2640
+ // this is what the user will see, and interact with
2641
+ public function getFrontendFormDisplay($list='', $submit_text) {
2642
+ if($list === '') return false;
2643
+ ob_start();
2644
+ include YKSEME_PATH . 'lib/inc/yks-mc-frontend-form-display.php';
2645
+ $output = ob_get_contents();
2646
+ ob_end_clean();
2647
+ return $output;
2648
+ }
2649
+
2650
+ // Generate the input fields for the form on the front end of the site
2651
+ // based on the $field['type'] that is returned from MailChimp
2652
+ private function getFrontendFormDisplay_field( $field = false , $num ) {
2653
+ if($field === false) return false;
2654
+ $o = '';
2655
+ $fieldID = $field['id'];
2656
+ $exploded_field_id = explode( '-' , $fieldID );
2657
+ $form_id = $exploded_field_id[1];
2658
+ // print_r($field);
2659
+
2660
+ $class_title = 'yks-mc-input-' . sanitize_title( $field['label'] );
2661
+
2662
+ // check to see if the custom class has been set up...
2663
+ if ( isset( $field['custom-field-class-'.$form_id.'-'.$num] ) ) {
2664
+ $custom_class = $field['custom-field-class-'.$form_id.'-'.$num];
2665
+ } else {
2666
+ $custom_class = '';
2667
+ }
2668
+
2669
+ // check to see if the placeholder value has been stored
2670
+ // setup the placeholder field
2671
+ if ( isset( $field['placeholder-'.$form_id.'-'.$num] ) ) {
2672
+ $placeholder = $field['placeholder-'.$form_id.'-'.$num];
2673
+ } else {
2674
+ $placeholder = '';
2675
+ }
2676
+
2677
+ switch( $field['type'] ) {
2678
+ default:
2679
+ case 'email':
2680
+ case 'number':
2681
+ case 'zipcode':
2682
+ case 'phone':
2683
+ case 'website':
2684
+ case 'imageurl':
2685
+ // custom placeholder value goes here
2686
+ $o .= '<input type="text" name="'.$field['name'].'" placeholder="'.$placeholder.'" class="'.$field['name'].($field['require'] == 1 ? ' yks-require' : '') . ' ' . $custom_class . $class_title .'" id="'.$field['id'].'" value="" />';
2687
+ break;
2688
+
2689
+ case 'text':
2690
+ if ( $field['default'] ) {
2691
+
2692
+ $custom_tag_array = apply_filters( 'yikes_mailchimp_default_value_tag' , $custom_tag_array=array() );
2693
+
2694
+ /*
2695
+ Lets Setup The Default Merge Variables Here
2696
+ example : {post_title} , {post_id} , {page_url} , {user_logged_in}, {blog_name}
2697
+ */
2698
+ global $post;
2699
+
2700
+ switch ( $field['default'] ) {
2701
+
2702
+ case '{post_title}' :
2703
+ $field['default'] = get_the_title( $post->ID );
2704
+ break;
2705
+
2706
+ case '{post_id}' :
2707
+ $field['default'] = $post->ID;
2708
+ break;
2709
+
2710
+ case '{page_url}' :
2711
+ $field['default'] = get_bloginfo( 'url' ) . $_SERVER['REQUEST_URI'];
2712
+ break;
2713
+
2714
+ case '{blog_name}' :
2715
+ $field['default'] = get_bloginfo( 'name' );
2716
+ break;
2717
+
2718
+ case '{user_logged_in}' :
2719
+ if ( is_user_logged_in() ) {
2720
+ $field['default'] = 'Registered User';
2721
+ } else {
2722
+ $field['default'] = 'Guest';
2723
+ }
2724
+ break;
2725
+
2726
+ case in_array( $field['default'] , $custom_tag_array ) :
2727
+ $field['default'] = apply_filters( 'yikes_mailchimp_process_default_value_tag' , $field );
2728
+ break;
2729
+
2730
+ default:
2731
+ $field['default'] = $field['default'];
2732
+ break;
2733
+
2734
+ }
2735
+
2736
+ }
2737
+ $o .= '<input type="text" placeholder="'.$placeholder.'" name="'.$field['name'].'" class="'.$field['name'].($field['require'] == 1 ? ' yks-require' : '') . ' ' . $custom_class . $class_title .'" id="'.$field['id'].'" value="'.$field['default'].'" />';
2738
+ break;
2739
+
2740
+ case 'dropdown':
2741
+ $o .= '<select name="'.$field['name'].'" class="'.$field['name'].($field['require'] == 1 ? ' yks-require' : ''). ' ' . $custom_class . $class_title .'" id="'.$field['id'].'">';
2742
+ if(count($field['choices']) > 0) : foreach($field['choices'] as $ok => $ov) :
2743
+ $o .= '<option value="'.htmlentities($ov, ENT_QUOTES).'">'.$ov.'</option>';
2744
+ endforeach; endif;
2745
+ $o .= '</select>';
2746
+ break;
2747
+ case 'address':
2748
+ $o .= '<input type="text" placeholder="'.$placeholder.'" name="'.$field['name'].'" class="'.$field['name'].($field['require'] == 1 ? ' yks-require' : ''). ' ' . $custom_class . $class_title .'" id="'.$field['id'].'" value="" /><span class="yks-mailchimp-form-tooltip">Street Address</span>';
2749
+ $o .= '<input type="text" name="'.$field['name'].'-add2" class="'.$field['name'].'-add2'.($field['require'] == 1 ? ' yks-require' : ''). ' ' . $custom_class . $class_title .'" id="'.$field['id'].'-add2" value="" /><span class="yks-mailchimp-form-tooltip">Apt/Suite</span>';
2750
+ $o .= '<input type="text" name="'.$field['name'].'-city" class="'.$field['name'].'-city'.($field['require'] == 1 ? ' yks-require' : ''). ' ' . $custom_class . $class_title .'" id="'.$field['id'].'-city" value="" /><span class="yks-mailchimp-form-tooltip">City</span>';
2751
+ $o .= '<input type="text" name="'.$field['name'].'-state" class="'.$field['name'].'-state'.($field['require'] == 1 ? ' yks-require' : ''). ' ' . $custom_class . $class_title .'" id="'.$field['id'].'-state" value="" /><span class="yks-mailchimp-form-tooltip">State</span>';
2752
+ $o .= '<input type="text" name="'.$field['name'].'-zip" class="'.$field['name'].'-zip'.($field['require'] == 1 ? ' yks-require' : ''). ' ' . $custom_class . $class_title .'" id="'.$field['id'].'-zip" value="" /><span class="yks-mailchimp-form-tooltip">Zip</span>';
2753
+ break;
2754
+ case 'radio':
2755
+ if(count($field['choices']) > 0) : $ct=0; foreach($field['choices'] as $ok => $ov) :
2756
+ $ct++;
2757
+ $o .= '<label for="'.$field['id'].'-'.$ok.'"><input type="radio" name="'.$field['name'].'" class="'.$field['name'].($field['require'] == 1 ? ' yks-require' : ''). ' ' . $custom_class . $class_title .'" id="'.$field['id'].'-'.$ok.'" value="'.htmlentities($ov, ENT_QUOTES).'" />'.$ov.'</label>';
2758
+ if($ct < count($field['choices']))
2759
+ $o .= '<br />';
2760
+ endforeach; endif;
2761
+ break;
2762
+ case 'date':
2763
+ case 'birthday':
2764
+ $o .= '<input placeholder="'.$placeholder.'" type="text" name="'.$field['name'].'" class="'.$field['name'].' yks-field-type-date'.($field['require'] == 1 ? ' yks-require' : ''). ' ' . $custom_class . $class_title .'" id="'.$field['id'].'" value="" />';
2765
+ break;
2766
+
2767
+ }
2768
+
2769
+ return $o;
2770
+ }
2771
+
2772
+
2773
+ /***** UPDATES
2774
+ ****************************************************************************************************/
2775
+ public function runUpdateTasks() {
2776
+ $currentVersion = (!isset($this->optionVal['version']) || empty($this->optionVal['version']) ? '5.0.3' : $this->optionVal['version']);
2777
+ $latestVersion = YKSEME_VERSION_CURRENT;
2778
+ if($currentVersion < $latestVersion)
2779
+ {
2780
+ $updateFunction = 'runUpdateTasks_'.str_replace('.', '_', $currentVersion);
2781
+ if(!method_exists($this, $updateFunction)) return false;
2782
+ else
2783
+ {
2784
+ if(call_user_func(array(&$this, $updateFunction)))
2785
+ {
2786
+ update_option( YKSEME_OPTION, YKSEME_VERSION_CURRENT );
2787
+ $this->runUpdateTasks();
2788
+ }
2789
+ }
2790
+ }
2791
+ else return false;
2792
+ }
2793
+
2794
+ /**
2795
+ * This update makes the first name and last name optional
2796
+ * To do this we need to loop through the existing fields and
2797
+ * change the 'require' key to 0
2798
+ *
2799
+ * 1.1.0 => 1.2.0
2800
+ */
2801
+ private function runUpdateTasks_1_1_0() {
2802
+ if($this->optionVal['lists']) {
2803
+ foreach($this->optionVal['lists'] as $lid => $list) {
2804
+ foreach($list['fields'] as $fid => $field) {
2805
+ switch($field['name']) {
2806
+ case 'yks-mailchimp-field-name-first':
2807
+ case 'yks-mailchimp-field-name-last':
2808
+ $this->optionVal['lists'][$lid]['fields'][$fid]['locked'] = 0;
2809
+ break;
2810
+ }
2811
+ }
2812
+ }
2813
+ }
2814
+ $this->optionVal['version'] = '1.2.0';
2815
+ return true;
2816
+ }
2817
+
2818
+ /**
2819
+ * This update adds a merge_vars key to each
2820
+ * field array so that users can specify their
2821
+ * own merge_var names
2822
+ *
2823
+ * 1.2.0 => 1.3.0
2824
+ */
2825
+ private function runUpdateTasks_1_2_0() {
2826
+ if($this->optionVal['lists']) {
2827
+ foreach($this->optionVal['lists'] as $lid => $list) {
2828
+ $fct = 1;
2829
+ foreach($list['fields'] as $fid => $field) {
2830
+ switch($field['name']) {
2831
+
2832
+ case 'yks-mailchimp-field-email':
2833
+ $this->optionVal['lists'][$lid]['fields'][$fid]['merge'] = 'EMAIL';
2834
+ break;
2835
+
2836
+ case 'yks-mailchimp-field-apt-suite':
2837
+ case 'yks-mailchimp-field-city':
2838
+ case 'yks-mailchimp-field-state':
2839
+ case 'yks-mailchimp-field-zip':
2840
+ $this->optionVal['lists'][$lid]['fields'][$fid]['merge'] = false;
2841
+ break;
2842
+
2843
+ default:
2844
+ if(empty($this->optionVal['lists'][$lid]['fields'][$fid]['merge']) || !isset($this->optionVal['lists'][$lid]['fields'][$fid]['merge']))
2845
+ $this->optionVal['lists'][$lid]['fields'][$fid]['merge'] = 'MERGE'.$fct;
2846
+ $fct++;
2847
+ break;
2848
+ }
2849
+ }
2850
+ }
2851
+ }
2852
+ $this->optionVal['version'] = '1.3.0';
2853
+ return true;
2854
+ }
2855
+
2856
+ /**
2857
+ * This update needs to pull in all of the custom form
2858
+ * data for each of the lists, unfortunately it has to replace
2859
+ * just about all of the data with the new schema. We also
2860
+ * add in the flavor key (for table/div usage)
2861
+ *
2862
+ * 4.3 => 5.0.4
2863
+ */
2864
+ private function runUpdateTasks_4_3() {
2865
+ if ( !isset( $this->optionVal['recaptcha-setting'] ) ) {
2866
+ $this->optionVal['recaptcha-setting'] = '0';
2867
+ }
2868
+ if ( !isset( $this->optionVal['recaptcha-api-key'] ) ) {
2869
+ $this->optionVal['recaptcha-api-key'] = '';
2870
+ }
2871
+ if ( !isset( $this->optionVal['recaptcha-private-api-key'] ) ) {
2872
+ $this->optionVal['recaptcha-private-api-key'] = '';
2873
+ }
2874
+ $this->optionVal['version'] = '5.0.4';
2875
+ return true;
2876
+ }
2877
+
2878
+ /** Update/Add New Merge Variables and Interest Group Containers */
2879
+
2880
+ // generate a container to allow for creating new merge variables (form fields)
2881
+ function generateNewMergeVariableContainer() {
2882
+ include YKSEME_PATH . 'lib/inc/yks-mc-new-merge-variable-container.php';
2883
+ }
2884
+
2885
+ // generate a container to allow for editing merge variables
2886
+ function generateMergeVariableUpdateContainer() {
2887
+ $delete_icon = '<span class="dashicons dashicons-no-alt remove-radio-dropdown-option"></span>';
2888
+ include YKSEME_PATH . 'lib/inc/yks-mc-update-merge-variable-container.php';
2889
+ }
2890
+
2891
+ // generate a container to allow for creating new interest groups
2892
+ public function generateCreateInterestGroupContainer() {
2893
+ include YKSEME_PATH . 'lib/inc/yks-mc-create-interest-group-container.php';
2894
+ }
2895
+
2896
+ // end merge variable and interest group containers
2897
+
2898
+ // generate a thickbox container
2899
+ // to display a preview of the form
2900
+ function generateFormPreviewContainer() {
2901
+ ?>
2902
+ <div id="formPreviewContainer" style="display:none;">
2903
+ <?php echo '<img src="' . admin_url() . '/images/wpspin_light.gif" alt="preloader" style="margin-left: 50%; margin-top: 25%;">'; ?>
2904
+ </div>
2905
+ <?php
2906
+ }
2907
+
2908
+ // generate a thickbox container
2909
+ // to display a how to in using custom template files
2910
+ function generateUserTemplateHowTo() {
2911
+ ?>
2912
+ <div id="user_template_how_to" style="display:none;">
2913
+ <a href="http://www.yikesinc.com" title="YIKES, Inc." target="_blank"><img style="float:left;margin-bottom:0;width:75px;" src="<?php echo YKSEME_URL; ?>/images/yikes_logo.png" alt="YIKES, Inc." id="yksme-yikes-logo" /></a>
2914
+ <h4 class="user_template_how_to_title"><?php _e( 'Custom User Template Files' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4>
2915
+
2916
+ <p style="margin-top: 2.5em;" ><?php _e( 'With the latest version of YIKES Inc. Easy MailChimp Extender you can now extend the plugin beyond what it can do out of the box. Now you can create your own MailChimp sign up template files and use them with any list , anywhere on your site. We have provided you with a few bundled templates, as well as two boilerplate template files for easy customization.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
2917
+
2918
+ <p><?php _e( 'You can create your own templates in two ways.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
2919
+ <hr />
2920
+ <ul>
2921
+ <li><h4><?php _e( 'Automatic Method :' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4><p><?php _e( "The easiest way is to import the template files from the plugin automatically. You can do this by clicking on the 'import boilerplate files' button. This will copy over the necessary files right into your theme. From there you can start editing the template files found in your theme root inside of the newly created 'yikes-inc-easy-mailchimp-extender' directory." , "yikes-inc-easy-mailchimp-extender" ); ?></p></li>
2922
+ <a href="#" onclick="return false;" class="button-secondary import_template_boilerplates" style="width:148px;display:block;margin:0 auto;"><?php _e( "import boilerplate files" , "yikes-inc-easy-mailchimp-extender" ); ?></a>
2923
+ <hr />
2924
+ <li><h4><?php _e( 'Manual Method' , 'yikes-inc-easy-mailchimp-extender' ); ?> :</h4><p><?php _e( "If the automatic method doesn't work for you, you can manually copy over the necessary files." , 'yikes-inc-easy-mailchimp-extender' ); ?></p> <p><?php _e( "Copy the following directory" , "yikes-inc-easy-mailchimp-extender" ); ?> :<br /> <em class="yks-mc-file-path"><?php echo YKSEME_PATH . 'templates/yikes-mailchimp-user-templates'; ?></em> <br /><?php _e( " into your theme root, found at " , "yikes-inc-easy-mailchimp-extender" ); ?><br /> <em class="yks-mc-file-path"><?php echo get_stylesheet_directory_uri(); ?></em></p></li>
2925
+ <hr />
2926
+ <li><h5><?php _e( "Notes" , "yikes-inc-easy-mailchimp-extender" ); ?></h5></li>
2927
+ <ul>
2928
+ <li><p><?php _e( "You can also copy over any of the default bundled themes into the 'yikes-mailchimp-user-templates' directory to customize the look and feel of a default bundled template file." , "yikes-inc-easy-mailchimp-extender" ); ?></p></li>
2929
+ <li><p><?php _e( "If you are having any difficulties copying over the template files, or need help using them please open a support ticket on our" , "yikes-inc-easy-mailchimp-extender" ); ?> <a href="https://github.com/yikesinc/yikes-inc-easy-mailchimp-extender/issues" target="_blank"><?php _e( "github issue tracker" , "yikes-inc-easy-mailchimp-extender" ); ?></a>.</p></li>
2930
+ </ul>
2931
+ </div>
2932
+ <?php
2933
+ }
2934
+
2935
+ // generate a thickbox container
2936
+ // to display a preview of the form
2937
+ function getFormPreview($shortcode,$form_title,$form_bg_color,$form_text_color,$form_submit_button_color,$form_submit_button_text_color,$form_padding,$form_width,$form_alignment) {
2938
+ ?>
2939
+ <h4 style="width:100%;text-align:center;">"<?php echo trim( $form_title ); ?>" Form Preview</h4>
2940
+ <div class="yks_mc_preview_form_container"><?php echo do_shortcode( stripslashes( $shortcode ) ); ?></div>
2941
+ <!-- override the styles for our preview container -->
2942
+ <style>
2943
+ .yks-mailchimpFormContainer {
2944
+ background: <?php echo $form_bg_color; ?> !important;
2945
+ padding: <?php echo $form_padding; ?> !important;
2946
+ color: <?php echo $form_text_color; ?> !important;
2947
+ width: <?php echo $form_width; ?> !important;
2948
+ <?php
2949
+ if ( $form_alignment == 'left' ) {
2950
+ ?>
2951
+ display: block;
2952
+ float: left;
2953
+ <?php
2954
+ } elseif ( $form_alignment == 'center' ) {
2955
+ ?>
2956
+ display: block;
2957
+ margin: 0 auto;
2958
+ <?php
2959
+ } elseif ( $form_alignment == 'right' ) {
2960
+ ?>
2961
+ display: block;
2962
+ float: right;
2963
+ <?php
2964
+ }
2965
+ ?>
2966
+ }
2967
+ .yks-mailchimpFormDivRowLabel, .yks_mc_interest_group_label, .yks-mailchimp-form-tooltip {
2968
+ color: <?php echo $form_text_color; ?> !important;
2969
+ }
2970
+ .ykfmc-submit {
2971
+ background: <?php echo $form_submit_button_color; ?> !important;
2972
+ color: <?php echo $form_submit_button_text_color; ?> !important;
2973
+ }
2974
+ .yks_mc_interest_group_holder input[type=radio], .yks_mc_interest_group_holder input[type=checkbox] {
2975
+ margin:0 5px 0 0 !important;
2976
+ }
2977
+ body.mailchimp-forms_page_yks-mailchimp-form-lists form[name="yks-mailchimp-form"] {
2978
+ padding: 0 !important;
2979
+ }
2980
+ </style>
2981
+ <?php
2982
+ }
2983
+
2984
+ // Get the selected form template screenshot
2985
+ function getTemplateScreenshot( $template_name , $template_screenshot , $template_path ) {
2986
+
2987
+ $default_headers = array(
2988
+ 'YIKES Inc. MailChimp Template',
2989
+ 'YIKES Inc. MailChimp Template Author',
2990
+ 'YIKES Inc. MailChimp Template Description'
2991
+ );
2992
+ // end pre-packaged templates
2993
+ $template_file_data = get_file_data( $template_path , $default_headers );
2994
+
2995
+ ?>
2996
+ <div id="selected_template_preview_container">
2997
+ <span class="selected_template_preview_header">
2998
+ <h3 class="template_name"><?php echo $template_name; ?></h3>
2999
+
3000
+ <p class="template_author"><strong><?php _e( "Author " , "yikes-inc-easy-mailchimp-extender" ); ?> :</strong> <em> <?php echo $template_file_data[1]; ?></em></p>
3001
+ </span>
3002
+
3003
+ <p><strong><?php _e( "Description" , "yikes-inc-easy-mailchimp-extender" ); ?> :</strong> <?php echo $template_file_data[2]; ?></p>
3004
+
3005
+ <hr />
3006
+
3007
+ <img class="template_screenshot preview_template_screenshot" style="max-width:100%;" src="<?php echo YKSEME_URL . 'templates/yikes-mailchimp-bundled-templates/' . str_replace( ' ' , '_' , $template_name ) . '/' . $template_screenshot; ?>">
3008
+ </div>
3009
+ <?php
3010
+ }
3011
+
3012
+ /**
3013
+ * This update needs to pull in all of the custom form
3014
+ * data for each of the lists, unfortunately it has to replace
3015
+ * just about all of the data with the new schema. We also
3016
+ * add in the flavor key (for table/div usage)
3017
+ *
3018
+ * 1.3.0 => 2.0.0
3019
+ */
3020
+ private function runUpdateTasks_1_3_0() {
3021
+ $this->optionVal['flavor'] = '0';
3022
+ $this->optionVal['debug'] = '0';
3023
+ if( $this->optionVal['lists'] ) {
3024
+ foreach($this->optionVal['lists'] as $uid => $list) {
3025
+ unset($this->optionVal['lists'][$uid]);
3026
+ $this->addList($list['list-id']);
3027
+ }
3028
+ }
3029
+ $this->optionVal['version'] = '2.2.1';
3030
+ return true;
3031
+ }
3032
+
3033
+ // Copy the user template file from within the plugin
3034
+ // into the users theme root
3035
+ public function copyUserTemplatesToUserTheme() {
3036
+ $src = YKSEME_PATH . 'templates/yikes-mailchimp-user-templates';
3037
+ $dst = get_stylesheet_directory() . '/yikes-mailchimp-user-templates';
3038
+
3039
+ function recurse_copy($src,$dst) {
3040
+ $dir = opendir($src);
3041
+ // mkdir( $dst . '/yiks-mailchimp-user-templates/' );
3042
+ mkdir( $dst );
3043
+ while(false !== ( $file = readdir($dir)) ) {
3044
+ if (( $file != '.' ) && ( $file != '..' )) {
3045
+ if ( is_dir($src . '/' . $file) ) {
3046
+ recurse_copy($src . '/' . $file,$dst . '/' . $file);
3047
+ }
3048
+ else {
3049
+ copy($src . '/' . $file,$dst . '/' . $file);
3050
+ }
3051
+ }
3052
+ }
3053
+ closedir($dir);
3054
+ }
3055
+ recurse_copy( $src , $dst );
3056
+ }
3057
+
3058
+ /*
3059
+ generateRandomString();
3060
+ @since v5.2
3061
+ Generate a random string of text and numbers for merge variable creation
3062
+ */
3063
+ public function randomMergeVarString($length = 5) {
3064
+ $characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
3065
+ $randomString = '';
3066
+ for ($i = 0; $i < $length; $i++) {
3067
+ $randomString .= $characters[rand(0, strlen($characters) - 1)];
3068
+ }
3069
+ echo $randomString;
3070
+ }
3071
+
3072
+ /*
3073
+ deleteInterestGroupFromList();
3074
+ @since v5.2
3075
+ Delete an interest group from a given list
3076
+ */
3077
+ public function deleteInterestGroupFromList($mc_list_id,$interest_group_id) {
3078
+ $api = new wpyksMCAPI($this->optionVal['api-key']);
3079
+ try {
3080
+ $retval = $api->call('lists/interest-grouping-del', array(
3081
+ 'id' => $mc_list_id,
3082
+ 'grouping_id' => $interest_group_id
3083
+ ));
3084
+ return "done";
3085
+ } catch( Exception $e ) { // catch any errors returned from MailChimp
3086
+ $errorMessage = $e->getMessage();
3087
+ echo $errorMessage;
3088
+ // write our error to the error log,
3089
+ // when advanced debug is enabled
3090
+ if ( $this->optionVal['debug'] == 1 ) {
3091
+ $this->writeErrorToErrorLog( $e );
3092
+ }
3093
+ die();
3094
+ }
3095
+ }
3096
+
3097
+ /*
3098
+ createNewInterestGroup();
3099
+ @since v5.2
3100
+ Delete an interest group from a given list
3101
+ */
3102
+ public function createNewInterestGroup($p) {
3103
+
3104
+ $api = new wpyksMCAPI($this->optionVal['api-key']);
3105
+ parse_str( $p['form_data'], $formData );
3106
+ $list_id = $formData['mc-list-id'];
3107
+ $grouping_name = $formData['add-interest-group-name'];
3108
+ $grouping_type = $formData['add-interest-group-type'];
3109
+ $grouping_groups = $formData['radio-dropdown-option'];
3110
+
3111
+ try {
3112
+ $retval = $api->call('lists/interest-grouping-add', array(
3113
+ 'id' => $list_id,
3114
+ 'name' => $grouping_name,
3115
+ 'type' => $grouping_type,
3116
+ 'groups' => $grouping_groups
3117
+ ));
3118
+ return "done";
3119
+ } catch( Exception $e ) { // catch any errors returned from MailChimp
3120
+ $errorMessage = $e->getMessage();
3121
+ echo $errorMessage;
3122
+ // write our error to the error log,
3123
+ // when advanced debug is enabled
3124
+ if ( $this->optionVal['debug'] == 1 ) {
3125
+ $this->writeErrorToErrorLog( $e );
3126
+ }
3127
+ die();
3128
+ }
3129
+ }
3130
+
3131
+ /*
3132
+ updateInterestGroup();
3133
+ @since v5.2
3134
+ Update an interest group from a given list
3135
+ */
3136
+ public function updateInterestGroup( $mailchimp_list_id , $grouping_id , $previous_value , $new_value ) {
3137
+
3138
+ $api = new wpyksMCAPI($this->optionVal['api-key']);
3139
+
3140
+ try {
3141
+ $retval = $api->call('lists/interest-group-update', array(
3142
+ 'id' => $mailchimp_list_id,
3143
+ 'old_name' => $previous_value,
3144
+ 'new_name' => $new_value,
3145
+ 'grouping_id' => $grouping_id
3146
+ ));
3147
+ return "done";
3148
+ } catch( Exception $e ) { // catch any errors returned from MailChimp
3149
+ if ( $e->getCode() == 211 ) {
3150
+ return "done";
3151
+ } else {
3152
+ $errorMessage = $e->getMessage();
3153
+ echo $errorMessage;
3154
+ // write our error to the error log,
3155
+ // when advanced debug is enabled
3156
+ if ( $this->optionVal['debug'] == 1 ) {
3157
+ $this->writeErrorToErrorLog( $e );
3158
+ }
3159
+ }
3160
+ die();
3161
+ }
3162
+ }
3163
+
3164
+ /*
3165
+ updateInterestGroupingTitle();
3166
+ @since v5.2
3167
+ Update an interest group from a given list
3168
+ */
3169
+ public function updateInterestGroupingTitle( $mailchimp_list_id , $grouping_id , $value ) {
3170
+
3171
+ $api = new wpyksMCAPI($this->optionVal['api-key']);
3172
+
3173
+ try {
3174
+ $retval = $api->call('lists/interest-grouping-update', array(
3175
+ 'grouping_id' => $grouping_id,
3176
+ 'name' => 'name',
3177
+ 'value' => $value
3178
+ ));
3179
+ return "done";
3180
+ } catch( Exception $e ) { // catch any errors returned from MailChimp
3181
+ $errorMessage = $e->getMessage();
3182
+ $errorCode = $e->getCode();
3183
+ echo $errorMessage;
3184
+ // write our error to the error log,
3185
+ // when advanced debug is enabled
3186
+ if ( $this->optionVal['debug'] == 1 ) {
3187
+ $this->writeErrorToErrorLog( $e );
3188
+ }
3189
+ die();
3190
+ }
3191
+ }
3192
+
3193
+ /*
3194
+ addInterestGroupOption();
3195
+ @since v5.2
3196
+ Update an interest group from a given list
3197
+ */
3198
+ public function addInterestGroupOption( $mailchimp_list_id , $group_name , $grouping_id ) {
3199
+
3200
+ $api = new wpyksMCAPI($this->optionVal['api-key']);
3201
+
3202
+ try {
3203
+ $retval = $api->call('lists/interest-group-add', array(
3204
+ 'id' => $mailchimp_list_id,
3205
+ 'group_name' => $group_name,
3206
+ 'grouping_id' => $grouping_id
3207
+ ));
3208
+ return "done";
3209
+ } catch( Exception $e ) { // catch any errors returned from MailChimp
3210
+ $errorMessage = $e->getMessage();
3211
+ echo $errorMessage;
3212
+ // write our error to the error log,
3213
+ // when advanced debug is enabled
3214
+ if ( $this->optionVal['debug'] == 1 ) {
3215
+ $this->writeErrorToErrorLog( $e );
3216
+ }
3217
+ die();
3218
+ }
3219
+
3220
+ }
3221
+
3222
+ /*
3223
+ deleteInterestGroupOption();
3224
+ @since v5.2
3225
+ Update an interest group from a given list
3226
+ */
3227
+ public function deleteInterestGroupOption( $mailchimp_list_id , $group_name , $grouping_id ) {
3228
+
3229
+ $api = new wpyksMCAPI($this->optionVal['api-key']);
3230
+
3231
+ try {
3232
+ $retval = $api->call('lists/interest-group-del', array(
3233
+ 'id' => $mailchimp_list_id,
3234
+ 'group_name' => $group_name,
3235
+ 'grouping_id' => $grouping_id
3236
+ ));
3237
+ return "done";
3238
+ } catch( Exception $e ) { // catch any errors returned from MailChimp
3239
+ $errorMessage = $e->getMessage();
3240
+ echo $errorMessage;
3241
+ // write our error to the error log,
3242
+ // when advanced debug is enabled
3243
+ if ( $this->optionVal['debug'] == 1 ) {
3244
+ $this->writeErrorToErrorLog( $e );
3245
+ }
3246
+ die();
3247
+ }
3248
+ }
3249
+
3250
+ /*
3251
+ addNewFieldToList();
3252
+ @since v5.2
3253
+ MailChimp API Request to Add new field to a list
3254
+ */
3255
+ public function addNewFieldToList( $p ) {
3256
+ include YKSEME_PATH . 'lib/inc/yks-mc-add-new-field-to-list.php';
3257
+ }
3258
+
3259
+ /*
3260
+ @since v5.2
3261
+ MailChimp API Request to Add new field to a list
3262
+ */
3263
+ public function deleteFieldFromList( $mailchimp_list_id , $merge_tag ) {
3264
+ $api = new wpyksMCAPI($this->optionVal['api-key']);
3265
+ try {
3266
+ $retval = $api->call('lists/merge-var-del', array(
3267
+ 'id' => $mailchimp_list_id, // list id to delete merge tag from
3268
+ 'tag' => $merge_tag // merge tag to be delete
3269
+ ));
3270
+ return "done";
3271
+ } catch( Exception $e ) { // catch any errors returned from MailChimp
3272
+ $errorMessage = $e->getMessage();
3273
+ echo $errorMessage;
3274
+ // write our error to the error log,
3275
+ // when advanced debug is enabled
3276
+ if ( $this->optionVal['debug'] == 1 ) {
3277
+ $this->writeErrorToErrorLog( $e );
3278
+ }
3279
+ die();
3280
+ }
3281
+ }
3282
+
3283
+ /*
3284
+ @since v5.2
3285
+ Change the interest group type
3286
+ */
3287
+ public function changeListInterestGroupType( $grouping_id , $value ) {
3288
+ $api = new wpyksMCAPI($this->optionVal['api-key']);
3289
+ try {
3290
+ $retval = $api->call('lists/interest-grouping-update', array(
3291
+ 'grouping_id' => $grouping_id, // list id to delete merge tag from
3292
+ 'name' => 'type', // merge tag to be delete
3293
+ 'value' => $value
3294
+ ));
3295
+ return "done";
3296
+ } catch( Exception $e ) { // catch any errors returned from MailChimp
3297
+ $errorMessage = $e->getMessage();
3298
+ echo $errorMessage;
3299
+ // write our error to the error log,
3300
+ // when advanced debug is enabled
3301
+ if ( $this->optionVal['debug'] == 1 ) {
3302
+ $this->writeErrorToErrorLog( $e );
3303
+ }
3304
+ die();
3305
+ }
3306
+ }
3307
+
3308
+ /*
3309
+ @since v5.2
3310
+ MailChimp API Request to Update an existing field on a given list
3311
+ */
3312
+ public function updateListField( $p ) {
3313
+ include YKSEME_PATH . 'lib/inc/yks-mc-update-list-field.php';
3314
+ }
3315
+
3316
+ // recursive directory scanning
3317
+ // used to retreive template files from bundled+user template directories
3318
+ function buildCustomTemplateDropdown($list) {
3319
+
3320
+ $bundled_template_directory = YKSEME_PATH . 'templates/yikes-mailchimp-bundled-templates/';
3321
+ $bundled_template_scan = scandir($bundled_template_directory);
3322
+ $custom_template_directory = get_stylesheet_directory() . '/yikes-mailchimp-user-templates/';
3323
+
3324
+ // only scan the directory when files DO exist
3325
+ if( is_dir( $custom_template_directory ) ) {
3326
+ $custom_template_scan = scandir($custom_template_directory);
3327
+ }
3328
+
3329
+ echo '<select class="template-selection-dropdown" name="yks-mc-template-file-selection" >';
3330
+
3331
+ /* Bundled Template Dropdown Loop */
3332
+ echo '<optgroup label="Bundled Templates">';
3333
+ foreach( $bundled_template_scan as $bundled_template ) {
3334
+ if( $bundled_template != '.' && $bundled_template != '..' ) {
3335
+
3336
+ if( is_dir( $bundled_template_directory . $bundled_template ) ) {
3337
+ $template_path = $this->getTemplateFilePath($bundled_template_directory.$bundled_template);
3338
+ }
3339
+
3340
+ // set the selected option
3341
+ if ( $list['custom_template']['template_file'] == $template_path ) {
3342
+ echo '<option value="' . $template_path . '" selected="selected" >' . str_replace( '_' , ' ' , $bundled_template ) . '</option>';
3343
+ } else {
3344
+ echo '<option value="' . $template_path . '">' . str_replace( '_' , ' ' , $bundled_template ) . '</option>';
3345
+ }
3346
+
3347
+ }
3348
+ }
3349
+ echo '</optgroup>';
3350
+
3351
+ echo '<optgroup label="Custom Templates">';
3352
+ /* Custom Template Dropdown Loop */
3353
+ if( is_dir( get_stylesheet_directory() . '/yikes-mailchimp-user-templates' ) && count( $custom_template_scan ) >= 1 ) {
3354
+ foreach( $custom_template_scan as $custom_template ) {
3355
+ if( $custom_template != '.' && $custom_template != '..' ) {
3356
+ if( is_dir( $custom_template_directory . $custom_template ) ) {
3357
+ $custom_template_path = $this->getTemplateFilePath($custom_template_directory.$custom_template);
3358
+ }
3359
+ // set the selected option
3360
+ if ( $list['custom_template']['template_file'] == $custom_template_path ) {
3361
+ echo '<option value="' . $custom_template_path . '" selected="selected" >' . str_replace( '_' , ' ' , $custom_template ) . '</option>';
3362
+ } else {
3363
+ echo '<option value="' . $custom_template_path . '">' . str_replace( '_' , ' ' , $custom_template ) . '</option>';
3364
+ }
3365
+ }
3366
+ }
3367
+ } else {
3368
+ echo '<option value="" disabled="disabled">None Found</option>';
3369
+ }
3370
+ echo '</optgroup>';
3371
+ echo '</select>';
3372
+ }
3373
+
3374
+ // function to return our form template path
3375
+ function getTemplateFilePath($directory) {
3376
+ $get_files = scandir($directory);
3377
+ $sub_files = array();
3378
+ foreach( $get_files as $file ) {
3379
+ if($file != '.' && $file != '..') {
3380
+ $explode_file = explode( '.' , $file );
3381
+ $file_extension = $explode_file[1];
3382
+ if ( $file_extension == 'php' ) {
3383
+ $file_extension_path = $directory . '/' . $file;
3384
+ }
3385
+ }
3386
+ }
3387
+ return $file_extension_path;
3388
+ }
3389
+
3390
+ // Adding Opt-In Checkbox to comment forms
3391
+ // submit the user to mailchimp on a successful comment submission
3392
+ function ymc_add_meta_settings($comment_id) {
3393
+ add_comment_meta(
3394
+ $comment_id,
3395
+ 'mailchimp_subscribe',
3396
+ $_POST['mailchimp_subscribe'],
3397
+ true
3398
+ );
3399
+ }
3400
+
3401
+ // add the checkbox after the comment form
3402
+ function add_after_comment_form($arg) {
3403
+ $custom_text = trim($this->optionVal['yks-mailchimp-optin-checkbox-text']);
3404
+ if ( $custom_text == '' ) {
3405
+ $custom_text = __("Sign Me Up For MAILCHIMP-REPLACE-THIS-TEXT's Newsletter", "gettext");
3406
+ } else {
3407
+ $custom_text = $custom_text;
3408
+ }
3409
+ // set the default checked state here...
3410
+ $arg['comment_notes_after'] = '<label for="yikes_mailchimp_comment_subscribe">
3411
+ <input type="checkbox" name="mailchimp_subscribe" id="yikes_mailchimp_comment_subscribe" checked="checked" />
3412
+ '.$custom_text.'
3413
+ </label>';
3414
+ return $arg;
3415
+ }
3416
+
3417
+ // Replacing 'MAILCHIMP-REPLACE-THIS-TEXT' text with sitename
3418
+ function yikes_mc_replace_this_text( $text ) {
3419
+ $newtext = get_bloginfo('name');
3420
+ $text = str_replace( 'MAILCHIMP-REPLACE-THIS-TEXT', $newtext, $text );
3421
+ return $text;
3422
+ }
3423
+
3424
+ // Add our commenter to the list, when comment is submitted
3425
+ function ymc_subscription_add( $cid, $comment='' ) {
3426
+ $cid = (int) $cid;
3427
+ $yikes_api_key = $this->optionVal['api-key'];
3428
+ $exploded_api_key = explode('-',$yikes_api_key);
3429
+ $yikes_data_center = $exploded_api_key[1];
3430
+
3431
+ if ( !is_object($comment) )
3432
+ $comment = get_comment($cid);
3433
+
3434
+ if ( $comment->comment_karma == 0 ) {
3435
+ $subscribe = get_comment_meta($cid, 'mailchimp_subscribe', true);
3436
+ if ( $subscribe == 'on' ) {
3437
+ global $current_user;
3438
+ get_currentuserinfo();
3439
+ $commenter_first_name = trim($current_user->user_firstname);
3440
+ $commenter_last_name = trim($current_user->user_lastname);
3441
+
3442
+ if( isset( $commenter_first_name ) && $commenter_first_name != '' ) {
3443
+ $commenter_first_name = $commenter_first_name; // use the users first name set in the profile
3444
+ } else {
3445
+ $commenter_first_name = $comment->comment_author; // if no first name is set in the user profile, we will use the account name
3446
+ }
3447
+
3448
+ if( isset( $commenter_last_name ) && $commenter_last_name != '' ) {
3449
+ $commenter_last_name = $commenter_last_name; // use the users last name set in the profile
3450
+ } else {
3451
+ $commenter_last_name = 'n/a'; // if the user has not set a last name in their profile, we set it to n/a
3452
+ }
3453
+
3454
+ // store our API key
3455
+ // on the settings page, if they have chosen to display the checkbox
3456
+ $api = new wpyksMCAPI($this->optionVal['api-key']);
3457
+
3458
+ $apikey = $yikes_api_key;
3459
+ $listid = $this->optionVal['yks-mailchimp-optIn-default-list']; // Need to set up a default list to subscribe all users to
3460
+ $endpoint = 'https://api.mailchimp.com';
3461
+ $optin = $this->optionVal['optin'];
3462
+
3463
+ // try adding subscriber, catch any error thrown
3464
+ try {
3465
+ $retval = $api->call('lists/subscribe', array(
3466
+ 'id' => $listid, // form id
3467
+ 'email' => array(
3468
+ 'email' => $comment->comment_author_email
3469
+ ),
3470
+ 'merge_vars' => array(
3471
+ 'FNAME' => $commenter_first_name,
3472
+ 'LNAME' => $commenter_last_name,
3473
+ 'NAME' => $commenter_first_name
3474
+ ),
3475
+ 'double_optin' => $optin, // double optin value (retreived from the settings page)
3476
+ 'send_welcome' => true
3477
+ ));
3478
+ return "done";
3479
+ } catch( Exception $e ) { // catch any errors returned from MailChimp
3480
+ $error_message = $e->getMessage();
3481
+ if (strpos($error_message,'Click here to update your profile.') !== false) {
3482
+ $errorMessage = str_replace('Click here to update your profile.', '', $e->getMessage());
3483
+ $errorMessage_explode = explode('to list', $errorMessage);
3484
+ echo $errorMessage_explode[0].'.';
3485
+ die();
3486
+ }
3487
+ if (strpos($error_message,'Invalid') !== false) {
3488
+ $display_errorMessage = str_replace('Invalid MailChimp List ID:', "Oops! The Webmaster hasn't set up the default MailChimp list to subscribe you too. Please contact them and let them know of this error. In the meantime, un-check the subscription checkbox in the comment form when submitting comments.", $error_message);
3489
+ echo $display_errorMessage;
3490
+ die();
3491
+ } else {
3492
+ // str_replace('Invalid MailChimp List ID: .', 'The Webmaster hasn\t set up the default MailChimp list to subscribe you too. Please contact them and let them know of this error. In the meantime, un-check the subscription checkbox in the comment form when submitting comments.', $e->getMessage());
3493
+ echo $errorMessage;
3494
+ die();
3495
+ }
3496
+ }
3497
+ }
3498
+ }
3499
+ }
3500
+
3501
+ // add our actions on initialize
3502
+ // inside of __construct()
3503
+ public function ykes_mc_apply_filters() {
3504
+ // if the optin checkbox setting is set to show
3505
+ // we wiill display the checkbox on the front end
3506
+ if ( $this->optionVal['optIn-checkbox'] == 1 ) {
3507
+ add_action('comment_post', array(&$this, 'ymc_add_meta_settings'), 10, 2);
3508
+ add_action('comment_approved_', array(&$this, 'ymc_subscription_add'), 60, 2);
3509
+ add_action('comment_post', array(&$this, 'ymc_subscription_add'));
3510
+ add_filter('gettext', array(&$this, 'yikes_mc_replace_this_text'));
3511
+ // only display the checkbox if the user is logged in, and the default list is set
3512
+ if( is_user_logged_in() && isset( $this->optionVal['yks-mailchimp-optIn-default-list'] ) && $this->optionVal['yks-mailchimp-optIn-default-list'] != 'select_value' ) {
3513
+ add_filter('comment_form_defaults', array(&$this, 'add_after_comment_form'));
3514
+ }
3515
+ }
3516
+ }
3517
+
3518
+
3519
+ /****
3520
+ **
3521
+ ** Custom The_Content filter
3522
+ ** used to prevent other plugins from hooking here
3523
+ **
3524
+ ****/
3525
+ function yks_mc_content() {
3526
+ //Create our own version of the_content so that others can't accidentally loop into our output - Taken from default-filters.php, shortcodes.php, and media.php
3527
+ if ( !has_filter( 'yks_mc_content', 'wptexturize' ) ) {
3528
+ add_filter( 'yks_mc_content', 'wptexturize' );
3529
+ add_filter( 'yks_mc_content', 'convert_smilies' );
3530
+ add_filter( 'yks_mc_content', 'convert_chars' );
3531
+ add_filter( 'yks_mc_content', 'wpautop' );
3532
+ add_filter( 'yks_mc_content', 'shortcode_unautop' );
3533
+ add_filter( 'yks_mc_content', 'prepend_attachment' );
3534
+ $vidembed = new WP_Embed();
3535
+ add_filter( 'yks_mc_content', array( &$vidembed, 'run_shortcode'), 8 );
3536
+ add_filter( 'yks_mc_content', array( &$vidembed, 'autoembed'), 8 );
3537
+ add_filter( 'yks_mc_content', 'do_shortcode', 11);
3538
+ } //end has_filter
3539
+ } //end yks_mc_content
3540
+
3541
+
3542
+ // Check if cURL is enabled at the server level
3543
+ // used on the options.php page
3544
+ public function yikes_curl_check() {
3545
+ if (in_array ('curl', get_loaded_extensions())) {
3546
+ return true;
3547
+ } else {
3548
+ return false;
3549
+ }
3550
+ }
3551
+
3552
+ // check if php.ini exists in the site root
3553
+ function yks_check_if_php_ini_exists() {
3554
+
3555
+ // get php ini path from the actively loaded php ini file
3556
+ $wordpress_site_root = str_replace('php.ini','',php_ini_loaded_file());
3557
+ // file name
3558
+ $filename = '/php.ini';
3559
+
3560
+ $php_ini_location = php_ini_loaded_file();
3561
+
3562
+ if (file_exists($wordpress_site_root.$filename)) {
3563
+ echo "<span class='yks_mc_no_phpini_success'>Good News </span>: We have located your <strong>".str_replace('/','',$filename)."</strong> file inside the directory <strong>".$wordpress_site_root."</strong>";
3564
+ $filename = '/php.ini';
3565
+ } else {
3566
+ echo "<span class='yks_mc_no_phpini_alert'>Alert </span>: No <strong>".str_replace('/','',$filename)."</strong> was located in <strong>".$wordpress_site_root.'/'."</strong>.";
3567
+ $filename = '/php.ini';
3568
+ }
3569
+
3570
+ }
3571
+
3572
+ // display the php.ini location to the user
3573
+ function yks_display_php_ini_location() {
3574
+ echo php_ini_loaded_file();
3575
+ }
3576
+
3577
+
3578
+ // Add TinyMCE Buttons to the TinyMCE Editor
3579
+ // We'll use the button to place form shortcodes!
3580
+ // NOTE: This only runs on 3.9 or greater -> due to tinyMCE 4.0
3581
+ // Custom TinyMCE Button to insert form shortcodes onto pages and posts
3582
+ function yks_mc_add_tinyMCE() {
3583
+ global $typenow;
3584
+ // only on Post Type: post and page
3585
+ if( ! in_array( $typenow, array( 'post', 'page' ) ) ) {
3586
+ return ;
3587
+ }
3588
+ }
3589
+
3590
+ // inlcude the js for tinymce
3591
+ function yks_mc_add_tinymce_plugin( $plugin_array ) {
3592
+ $plugin_array['yks_mc_tinymce_button'] = plugins_url( '/../js/yks_mc_tinymce_button.js', __FILE__ );
3593
+ // Print all plugin js path
3594
+ // var_dump( $plugin_array );
3595
+ return $plugin_array;
3596
+ }
3597
+
3598
+ // Add the button key for address via JS
3599
+ function yks_mc_add_tinymce_button( $buttons ) {
3600
+ array_push( $buttons, 'yks_mc_tinymce_button_key' );
3601
+ // Print all buttons
3602
+ return $buttons;
3603
+ }
3604
+
3605
+ /**
3606
+ * Localize Script
3607
+ * Pass our imported list data, to the JS file
3608
+ * to build the dropdown list in the modal
3609
+ */
3610
+ function yks_mc_js_admin_head() {
3611
+ $yks_mc_imported_list_data = $this->optionVal['lists'];
3612
+ // our list data array, we will pass to the js file
3613
+ $list_value_array = array();
3614
+ $i = 0;
3615
+ // loop over the list data
3616
+ foreach ( $yks_mc_imported_list_data as $single_list ) {
3617
+ // store it temporarily and push it back to our array
3618
+ $list_value_array[$i]['text'] = $single_list['name'];
3619
+ $list_value_array[$i]['value'] = $single_list['id'];
3620
+ $i++;
3621
+ }
3622
+ ?>
3623
+ <!-- TinyMCE Shortcode Plugin -->
3624
+ <script type='text/javascript'>
3625
+ var yks_mc_lists_data = {
3626
+ 'lists': <?php echo json_encode($list_value_array); ?>
3627
+ };
3628
+ </script>
3629
+ <!-- TinyMCE Shortcode Plugin -->
3630
+ <?php
3631
+ }
3632
+
3633
+
3634
+ /* Checking if the user is on localhost */
3635
+ /* If they are we want to display a warning about SSL on localhost */
3636
+ function yks_mc_is_user_localhost() {
3637
+ $whitelist = array( '127.0.0.1', '::1' );
3638
+ if( in_array( $_SERVER['REMOTE_ADDR'], $whitelist) ) {
3639
+ return true;
3640
+ }
3641
+ }
3642
+
3643
+ /*******************************************************/
3644
+ /* Helper Functions */
3645
+ /******************************************************/
3646
+ /*
3647
+ *
3648
+ * Helper function when testing user submitted data
3649
+ * to be used inside of the yikes_mc_get_form_data filter
3650
+ *
3651
+ */
3652
+ function yks_mc_print_user_data( $form_ID, $merge_variables ) {
3653
+ echo '<h3>The Data Returned From This Form</h3>';
3654
+ echo '<strong>MailChimp List ID : </strong> '.$form_ID.' <br />';
3655
+ echo '<hr />';
3656
+ if ( isset( $merge_variables['FNAME'] ) && $merge_variables['FNAME'] != '' ) {
3657
+ echo '<strong>User\'s Name : </strong> '.$merge_variables['FNAME'].' <br />';
3658
+ echo '<hr />';
3659
+ }
3660
+ if ( isset( $merge_variables['LNAME'] ) && $merge_variables['LNAME'] != '' ) {
3661
+ echo '<strong>User\'s Name : </strong> '.$merge_variables['LNAME'].' <br />';
3662
+ echo '<hr />';
3663
+ }
3664
+ echo '<strong>Users Email : </strong>'.$merge_variables['EMAIL'].' <br />';
3665
+ if ( isset( $merge_variables['GROUPINGS'] ) ) {
3666
+ echo '<hr />';
3667
+ echo '<strong>Interest Group Data : </strong><br /><br />';
3668
+ foreach ( $merge_variables['GROUPINGS'] as $grouping_variable ) {
3669
+ echo '<ol style="list-style:none;">Interest Group : '.$grouping_variable['id'].'</ol>';
3670
+ if ( !isset($grouping_variable['groups'][0]) || $grouping_variable['groups'][0] == '' ) {
3671
+ echo '<li style="list-style:none;">No interest groups selected</li><br />';
3672
+ } else {
3673
+ // loop over interest groups to build array
3674
+ $interest_group_array = array();
3675
+ foreach ( $grouping_variable['groups'] as $interest_group ) {
3676
+ array_push( $interest_group_array , $interest_group );
3677
+ }
3678
+ if ( count($interest_group_array) > 0 ) {
3679
+ foreach ( $interest_group_array as $interest_group_label ) {
3680
+ echo '<li style="list-style:none;">'.$interest_group_label.'</li>';
3681
+ }
3682
+ echo '<br />';
3683
+ }
3684
+ }
3685
+ }
3686
+ }
3687
+ echo '<em style="color:rgb(238, 93, 93);">Form data has not been sent to MailChimp</em><br />';
3688
+ die(); // die to prevent data being sent over to MailChimp
3689
+ }
3690
+
3691
+ /*
3692
+ * Helper function when testing user submitted data
3693
+ * print_r($merge_variables) is returned
3694
+ */
3695
+ function yks_mc_dump_user_data( $form_ID, $merge_variables ) {
3696
+ echo '<strong>Form ID :</strong> '.$form_ID. '<br />';
3697
+ echo '<strong>Merge Variables :</strong><br />';
3698
+ print_r($merge_variables);
3699
+ echo '<br /><em style="color:rgb(238, 93, 93);">Form data has not been sent to MailChimp</em>';
3700
+ die(); // die to prevent data being sent over to MailChimp
3701
+ }
3702
+
3703
+ /****************************************************************************************
3704
+ * Begin Heartbeat API Code
3705
+ * - Used on the Account Activity page for lilve updates
3706
+ ****************************************************************************************/
3707
+
3708
+ /*
3709
+ Client-side code. First we enqueue the Heartbeat API and our Javascript.
3710
+ Our Javascript is then setup to always send the message 'marco' to the server.
3711
+ If a message comes back, the Javascript logs it (polo) to console.
3712
+ */
3713
+
3714
+ //enqueue heartbeat.js and our Javascript
3715
+ function yks_mc_heartbeat_init() {
3716
+ //enqueue the Heartbeat API
3717
+ wp_enqueue_script('heartbeat');
3718
+
3719
+ //load our Javascript in the footer
3720
+ add_action("admin_print_footer_scripts", array( &$this ,"yks_mc_heartbeat_admin_footer" ) );
3721
+ }
3722
+
3723
+
3724
+ //our Javascript to send/process from the client side
3725
+ function yks_mc_heartbeat_admin_footer() {
3726
+ include YKSEME_PATH . 'lib/inc/yks-mc-heartbeat-api.php';
3727
+ }
3728
+
3729
+ /*
3730
+ Our server-side code.
3731
+ ------------------------------
3732
+ This hooks into the heartbeat_received filter.
3733
+ It checks for a key 'client' in the data array. If it is set to 'get_chimp_chatter_data',
3734
+ a key 'server' is set to 'Get MailChimp Chatter Data' in the response array.
3735
+ */
3736
+ function yks_mc_heartbeat_received($response, $data) {
3737
+ // if the client returns get chimp chatter data, popluate
3738
+ // the response with some data
3739
+ if( $data['yks_mc_chimp_chatter_heartbeat'] == 'get_chimp_chatter_data' ) {
3740
+ // populate the response with something
3741
+ $response['yks_mc_chimp_chatter_data'] = 'Get MailChimp Chatter Data';
3742
+ } else if ( $data['yks_mc_chimp_chatter_heartbeat'] == 'get_chimp_chatter_widget_data' ) {
3743
+ $response['yks_mc_chimp_chatter_data'] = 'Get MailChimp Chatter Widget Data';
3744
+ }
3745
+ return $response;
3746
+ }
3747
+
3748
+ /** Change Default HeartBeat API Pulse Time */
3749
+ function yks_mc_tweak_heartbeat_settings( $settings ) {
3750
+ $settings['interval'] = 45; //Anything between 15-60
3751
+ return $settings;
3752
+ }
3753
+
3754
+ /*******************************************************
3755
+ Custom Dashboard MailChimp Account Activity Widget
3756
+ ********************************************************/
3757
+ /**
3758
+ * Add a widget to the dashboard.
3759
+ *
3760
+ * This function is hooked into the 'wp_dashboard_setup' action below.
3761
+ */
3762
+ function yks_mc_add_chimp_chatter_dashboard_widget() {
3763
+ wp_add_dashboard_widget(
3764
+ 'yks_mc_account_activity_widget', // Widget slug.
3765
+ 'MailChimp Account Activity', // Title.
3766
+ array( &$this , 'yks_mc_chimp_chatter_dashboard_widget_function' ) // Display function.
3767
+ );
3768
+ }
3769
+
3770
+ /**
3771
+ * Create the function to output the contents of our Dashboard Widget.
3772
+ */
3773
+ function yks_mc_chimp_chatter_dashboard_widget_function() {
3774
+ include YKSEME_PATH . 'lib/inc/yks-mc-heartbeat-widget-functions.php';
3775
+ }
3776
+
3777
+
3778
+ // help , review container
3779
+ public function help_review_container() {
3780
+ ?>
3781
+ <div id="yks_mc_review_this_plugin_container">
3782
+ <a href="https://github.com/yikesinc/yikes-inc-easy-mailchimp-extender/issues?state=open" target="_blank">
3783
+ <span class="yks_mc_need_support">
3784
+ <strong>
3785
+ <?php _e( 'Need Help?', 'yikes-inc-easy-mailchimp-extender' ); ?> <br />
3786
+ <?php _e( 'Get In Contact!', 'yikes-inc-easy-mailchimp-extender' ); ?> <br />
3787
+ <div class="dashicons dashicons-plus-alt"></div>
3788
+ </strong>
3789
+ </span>
3790
+ </a>
3791
+ <a href="http://wordpress.org/support/view/plugin-reviews/yikes-inc-easy-mailchimp-extender" target="_blank">
3792
+ <span class="yks_mc_leave_us_a_review">
3793
+ <strong>
3794
+ <?php _e( 'Loving the plugin?', 'yikes-inc-easy-mailchimp-extender' ); ?> <br />
3795
+ <?php _e( 'Leave us a nice review', 'yikes-inc-easy-mailchimp-extender' ); ?> <br />
3796
+ <div class="dashicons dashicons-star-filled"></div><div class="dashicons dashicons-star-filled"></div><div class="dashicons dashicons-star-filled"></div><div class="dashicons dashicons-star-filled"></div><div class="dashicons dashicons-star-filled"></div>
3797
+ </strong>
3798
+ </span>
3799
+ </a>
3800
+ <a href="http://www.yikesinc.com" target="_blank" class="yks_header_logo">
3801
+ <img src="<?php echo plugins_url().'/yikes-inc-easy-mailchimp-extender/images/yikes_logo.png'; ?>" alt="YIKES Inc. Logo" width=85 title="YIKES Inc. Logo" />
3802
+ </a>
3803
+ </div>
3804
+ <?php
3805
+ }
3806
+
3807
+
3808
+ /**
3809
+ Write our errors to an error log for display to the user
3810
+ - should help minimize number of requests we receive, or at least help us diagnose user issues better
3811
+ **/
3812
+
3813
+ /*
3814
+ * writeErrorToErrorLog()
3815
+ * parameters: $errorResponse
3816
+ * writes a returned API error to our log for display
3817
+ *
3818
+ * @since 5.2
3819
+ */
3820
+ public function writeErrorToErrorLog( $errorResponse ) {
3821
+ // make sure file_get_contents and file_put_contents are available
3822
+ if ( function_exists( 'file_get_contents' ) && function_exists( 'file_put_contents' ) ) {
3823
+ $error_occurance_time = current_time( 'M' ) . '. ' . current_time( 'jS' ) . ', ' . current_time( 'Y' ) . ' - ' . current_time( 'g:i:sa' );
3824
+ $error_log_location = YKSEME_PATH . 'lib/error_log/yks_mc_error_log.php';
3825
+ $current_contents = file_get_contents( $error_log_location );
3826
+ // get total count of errors, we only want to limit to 8 latest errors
3827
+ $total_errors = explode( '<tr>' , $current_contents );
3828
+ $error_array = array();
3829
+ $i = 0;
3830
+ foreach( $total_errors as $error ) {
3831
+ $error_array[] = $error;
3832
+ // limit the error log to the latest 10 errors
3833
+ if ( ++$i == 11 ) {
3834
+ break;
3835
+ }
3836
+ }
3837
+ $new_content = '<tr>
3838
+ <td>' . $errorResponse->getMessage() . '</td>
3839
+ <td>' . $error_occurance_time . '</td>
3840
+ </tr>' . implode( '<tr>' , $error_array );
3841
+ file_put_contents( $error_log_location , $new_content );
3842
+ }
3843
+ }
3844
+
3845
+ /*
3846
+ * ytks_mc_generate_error_log_table()
3847
+ * generate our erorr log table on the options settings page
3848
+ *
3849
+ * @since 5.2
3850
+ */
3851
+ public function yks_mc_generate_error_log_table() {
3852
+ $error_log_contents = file_get_contents( YKSEME_PATH . 'lib/error_log/yks_mc_error_log.php' , true );
3853
+ if ( $error_log_contents != '' ) {
3854
+ return $error_log_contents;
3855
+ }
3856
+ }
3857
+
3858
+ /*
3859
+ * clearYksMCErrorLog()
3860
+ * clear the error log of all errors
3861
+ *
3862
+ * @since 5.2
3863
+ */
3864
+ public function clearYksMCErrorLog() {
3865
+ echo 'running';
3866
+ try {
3867
+ $clear_contents = file_put_contents( YKSEME_PATH . 'lib/error_log/yks_mc_error_log.php' , '' );
3868
+ } catch ( Exception $e ) {
3869
+ return $e->getMessage();
3870
+ $this->writeErrorToErrorLog( $e );
3871
+ }
3872
+ }
3873
+
3874
+ } // end class
3875
+ } // end class check
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3876
  ?>
classes/set_language.php CHANGED
@@ -1,111 +1,111 @@
1
- <?php
2
-
3
- // create our language variable dependent on what is set in MailChimp
4
- if(!empty($subscriber_data['language'])) {
5
- $subscriber_data_language = $subscriber_data['language'];
6
- if ( $subscriber_data_language == 'en' ) {
7
- $subscriber_data_language = 'English';
8
- } elseif ( $subscriber_data_language == 'ar' ) {
9
- $subscriber_data_language = 'Arabic';
10
- } elseif ( $subscriber_data_language == 'af' ) {
11
- $subscriber_data_language = 'Afrikaans';
12
- } elseif ( $subscriber_data_language == 'be' ) {
13
- $subscriber_data_language = 'Belarusian';
14
- } elseif ( $subscriber_data_language == 'bg' ) {
15
- $subscriber_data_language = 'Bulgarian';
16
- } elseif ( $subscriber_data_language == 'ca' ) {
17
- $subscriber_data_language = 'Catalan';
18
- } elseif ( $subscriber_data_language == 'zh' ) {
19
- $subscriber_data_language = 'Chinese';
20
- } elseif ( $subscriber_data_language == 'hr' ) {
21
- $subscriber_data_language = 'Croatian';
22
- } elseif ( $subscriber_data_language == 'cs' ) {
23
- $subscriber_data_language = 'Czech';
24
- } elseif ( $subscriber_data_language == 'da' ) {
25
- $subscriber_data_language = 'Danish';
26
- } elseif ( $subscriber_data_language == 'nl' ) {
27
- $subscriber_data_language = 'Dutch';
28
- } elseif ( $subscriber_data_language == 'et' ) {
29
- $subscriber_data_language = 'Estonian';
30
- } elseif ( $subscriber_data_language == 'fa' ) {
31
- $subscriber_data_language = 'Farsi';
32
- } elseif ( $subscriber_data_language == 'fi' ) {
33
- $subscriber_data_language = 'Finnish';
34
- } elseif ( $subscriber_data_language == 'fr' ) {
35
- $subscriber_data_language = 'French';
36
- } elseif ( $subscriber_data_language == 'fr_CA' ) {
37
- $subscriber_data_language = 'French (Canada)';
38
- } elseif ( $subscriber_data_language == 'de' ) {
39
- $subscriber_data_language = 'German';
40
- } elseif ( $subscriber_data_language == 'el' ) {
41
- $subscriber_data_language = 'Greek';
42
- } elseif ( $subscriber_data_language == 'he' ) {
43
- $subscriber_data_language = 'Hebrew';
44
- } elseif ( $subscriber_data_language == 'hi' ) {
45
- $subscriber_data_language = 'Hindi';
46
- } elseif ( $subscriber_data_language == 'hu' ) {
47
- $subscriber_data_language = 'Hungarian';
48
- } elseif ( $subscriber_data_language == 'is' ) {
49
- $subscriber_data_language = 'Icelandic';
50
- } elseif ( $subscriber_data_language == 'id' ) {
51
- $subscriber_data_language = 'Indonesian';
52
- } elseif ( $subscriber_data_language == 'ga' ) {
53
- $subscriber_data_language = 'Irish';
54
- } elseif ( $subscriber_data_language == 'it' ) {
55
- $subscriber_data_language = 'Italian';
56
- } elseif ( $subscriber_data_language == 'ja' ) {
57
- $subscriber_data_language = 'Japanese';
58
- } elseif ( $subscriber_data_language == 'km' ) {
59
- $subscriber_data_language = 'Khmer';
60
- } elseif ( $subscriber_data_language == 'ko' ) {
61
- $subscriber_data_language = 'Korean';
62
- } elseif ( $subscriber_data_language == 'lv' ) {
63
- $subscriber_data_language = 'Latvian';
64
- } elseif ( $subscriber_data_language == 'lt' ) {
65
- $subscriber_data_language = 'Lithuanian';
66
- } elseif ( $subscriber_data_language == 'mt' ) {
67
- $subscriber_data_language = 'Maltese';
68
- } elseif ( $subscriber_data_language == 'ms' ) {
69
- $subscriber_data_language = 'Malay';
70
- } elseif ( $subscriber_data_language == 'mk' ) {
71
- $subscriber_data_language = 'Macedonian';
72
- } elseif ( $subscriber_data_language == 'no' ) {
73
- $subscriber_data_language = 'Norwegian';
74
- } elseif ( $subscriber_data_language == 'pl' ) {
75
- $subscriber_data_language = 'Polish';
76
- } elseif ( $subscriber_data_language == 'pt' ) {
77
- $subscriber_data_language = 'Portuguese (Brazil)';
78
- } elseif ( $subscriber_data_language == 'pt_PT' ) {
79
- $subscriber_data_language = 'Portuguese (Portugal)';
80
- } elseif ( $subscriber_data_language == 'ro' ) {
81
- $subscriber_data_language = 'Romanian';
82
- } elseif ( $subscriber_data_language == 'ru' ) {
83
- $subscriber_data_language = 'Russian';
84
- } elseif ( $subscriber_data_language == 'sr' ) {
85
- $subscriber_data_language = 'Serbian';
86
- } elseif ( $subscriber_data_language == 'sl' ) {
87
- $subscriber_data_language = 'Slovak';
88
- } elseif ( $subscriber_data_language == 'sl' ) {
89
- $subscriber_data_language = 'Slovenian';
90
- } elseif ( $subscriber_data_language == 'es' ) {
91
- $subscriber_data_language = 'Spanish (Mexico)';
92
- } elseif ( $subscriber_data_language == 'es_ES' ) {
93
- $subscriber_data_language = 'Spanish (Spain)';
94
- } elseif ( $subscriber_data_language == 'sw' ) {
95
- $subscriber_data_language = 'Swahili';
96
- } elseif ( $subscriber_data_language == 'sv' ) {
97
- $subscriber_data_language = 'Swedish';
98
- } elseif ( $subscriber_data_language == 'ta' ) {
99
- $subscriber_data_language = 'Tamil';
100
- } elseif ( $subscriber_data_language == 'th' ) {
101
- $subscriber_data_language = 'Thai';
102
- } elseif ( $subscriber_data_language == 'tr' ) {
103
- $subscriber_data_language = 'Turkish';
104
- } elseif ( $subscriber_data_language == 'uk' ) {
105
- $subscriber_data_language = 'Ukrainian';
106
- } elseif ( $subscriber_data_language == 'vi' ) {
107
- $subscriber_data_language = 'Vietnamese';
108
- }
109
- } else {
110
- $subscriber_data_language = 'Not Set.';
111
  }
1
+ <?php
2
+
3
+ // create our language variable dependent on what is set in MailChimp
4
+ if(!empty($subscriber_data['language'])) {
5
+ $subscriber_data_language = $subscriber_data['language'];
6
+ if ( $subscriber_data_language == 'en' ) {
7
+ $subscriber_data_language = 'English';
8
+ } elseif ( $subscriber_data_language == 'ar' ) {
9
+ $subscriber_data_language = 'Arabic';
10
+ } elseif ( $subscriber_data_language == 'af' ) {
11
+ $subscriber_data_language = 'Afrikaans';
12
+ } elseif ( $subscriber_data_language == 'be' ) {
13
+ $subscriber_data_language = 'Belarusian';
14
+ } elseif ( $subscriber_data_language == 'bg' ) {
15
+ $subscriber_data_language = 'Bulgarian';
16
+ } elseif ( $subscriber_data_language == 'ca' ) {
17
+ $subscriber_data_language = 'Catalan';
18
+ } elseif ( $subscriber_data_language == 'zh' ) {
19
+ $subscriber_data_language = 'Chinese';
20
+ } elseif ( $subscriber_data_language == 'hr' ) {
21
+ $subscriber_data_language = 'Croatian';
22
+ } elseif ( $subscriber_data_language == 'cs' ) {
23
+ $subscriber_data_language = 'Czech';
24
+ } elseif ( $subscriber_data_language == 'da' ) {
25
+ $subscriber_data_language = 'Danish';
26
+ } elseif ( $subscriber_data_language == 'nl' ) {
27
+ $subscriber_data_language = 'Dutch';
28
+ } elseif ( $subscriber_data_language == 'et' ) {
29
+ $subscriber_data_language = 'Estonian';
30
+ } elseif ( $subscriber_data_language == 'fa' ) {
31
+ $subscriber_data_language = 'Farsi';
32
+ } elseif ( $subscriber_data_language == 'fi' ) {
33
+ $subscriber_data_language = 'Finnish';
34
+ } elseif ( $subscriber_data_language == 'fr' ) {
35
+ $subscriber_data_language = 'French';
36
+ } elseif ( $subscriber_data_language == 'fr_CA' ) {
37
+ $subscriber_data_language = 'French (Canada)';
38
+ } elseif ( $subscriber_data_language == 'de' ) {
39
+ $subscriber_data_language = 'German';
40
+ } elseif ( $subscriber_data_language == 'el' ) {
41
+ $subscriber_data_language = 'Greek';
42
+ } elseif ( $subscriber_data_language == 'he' ) {
43
+ $subscriber_data_language = 'Hebrew';
44
+ } elseif ( $subscriber_data_language == 'hi' ) {
45
+ $subscriber_data_language = 'Hindi';
46
+ } elseif ( $subscriber_data_language == 'hu' ) {
47
+ $subscriber_data_language = 'Hungarian';
48
+ } elseif ( $subscriber_data_language == 'is' ) {
49
+ $subscriber_data_language = 'Icelandic';
50
+ } elseif ( $subscriber_data_language == 'id' ) {
51
+ $subscriber_data_language = 'Indonesian';
52
+ } elseif ( $subscriber_data_language == 'ga' ) {
53
+ $subscriber_data_language = 'Irish';
54
+ } elseif ( $subscriber_data_language == 'it' ) {
55
+ $subscriber_data_language = 'Italian';
56
+ } elseif ( $subscriber_data_language == 'ja' ) {
57
+ $subscriber_data_language = 'Japanese';
58
+ } elseif ( $subscriber_data_language == 'km' ) {
59
+ $subscriber_data_language = 'Khmer';
60
+ } elseif ( $subscriber_data_language == 'ko' ) {
61
+ $subscriber_data_language = 'Korean';
62
+ } elseif ( $subscriber_data_language == 'lv' ) {
63
+ $subscriber_data_language = 'Latvian';
64
+ } elseif ( $subscriber_data_language == 'lt' ) {
65
+ $subscriber_data_language = 'Lithuanian';
66
+ } elseif ( $subscriber_data_language == 'mt' ) {
67
+ $subscriber_data_language = 'Maltese';
68
+ } elseif ( $subscriber_data_language == 'ms' ) {
69
+ $subscriber_data_language = 'Malay';
70
+ } elseif ( $subscriber_data_language == 'mk' ) {
71
+ $subscriber_data_language = 'Macedonian';
72
+ } elseif ( $subscriber_data_language == 'no' ) {
73
+ $subscriber_data_language = 'Norwegian';
74
+ } elseif ( $subscriber_data_language == 'pl' ) {
75
+ $subscriber_data_language = 'Polish';
76
+ } elseif ( $subscriber_data_language == 'pt' ) {
77
+ $subscriber_data_language = 'Portuguese (Brazil)';
78
+ } elseif ( $subscriber_data_language == 'pt_PT' ) {
79
+ $subscriber_data_language = 'Portuguese (Portugal)';
80
+ } elseif ( $subscriber_data_language == 'ro' ) {
81
+ $subscriber_data_language = 'Romanian';
82
+ } elseif ( $subscriber_data_language == 'ru' ) {
83
+ $subscriber_data_language = 'Russian';
84
+ } elseif ( $subscriber_data_language == 'sr' ) {
85
+ $subscriber_data_language = 'Serbian';
86
+ } elseif ( $subscriber_data_language == 'sl' ) {
87
+ $subscriber_data_language = 'Slovak';
88
+ } elseif ( $subscriber_data_language == 'sl' ) {
89
+ $subscriber_data_language = 'Slovenian';
90
+ } elseif ( $subscriber_data_language == 'es' ) {
91
+ $subscriber_data_language = 'Spanish (Mexico)';
92
+ } elseif ( $subscriber_data_language == 'es_ES' ) {
93
+ $subscriber_data_language = 'Spanish (Spain)';
94
+ } elseif ( $subscriber_data_language == 'sw' ) {
95
+ $subscriber_data_language = 'Swahili';
96
+ } elseif ( $subscriber_data_language == 'sv' ) {
97
+ $subscriber_data_language = 'Swedish';
98
+ } elseif ( $subscriber_data_language == 'ta' ) {
99
+ $subscriber_data_language = 'Tamil';
100
+ } elseif ( $subscriber_data_language == 'th' ) {
101
+ $subscriber_data_language = 'Thai';
102
+ } elseif ( $subscriber_data_language == 'tr' ) {
103
+ $subscriber_data_language = 'Turkish';
104
+ } elseif ( $subscriber_data_language == 'uk' ) {
105
+ $subscriber_data_language = 'Ukrainian';
106
+ } elseif ( $subscriber_data_language == 'vi' ) {
107
+ $subscriber_data_language = 'Vietnamese';
108
+ }
109
+ } else {
110
+ $subscriber_data_language = 'Not Set.';
111
  }
css/animate.css CHANGED
@@ -1,3303 +1,3303 @@
1
- @charset "UTF-8";
2
-
3
- /*!
4
- Animate.css - http://daneden.me/animate
5
- Licensed under the MIT license
6
-
7
- Copyright (c) 2013 Daniel Eden
8
-
9
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14
- */
15
-
16
- .animated {
17
- -webkit-animation-duration: 1s;
18
- animation-duration: 1s;
19
- -webkit-animation-fill-mode: both;
20
- animation-fill-mode: both;
21
- }
22
-
23
- .animated.infinite {
24
- -webkit-animation-iteration-count: infinite;
25
- animation-iteration-count: infinite;
26
- }
27
-
28
- .animated.hinge {
29
- -webkit-animation-duration: 2s;
30
- animation-duration: 2s;
31
- }
32
-
33
- @-webkit-keyframes bounce {
34
- 0%, 20%, 50%, 80%, 100% {
35
- -webkit-transform: translateY(0);
36
- transform: translateY(0);
37
- }
38
-
39
- 40% {
40
- -webkit-transform: translateY(-30px);
41
- transform: translateY(-30px);
42
- }
43
-
44
- 60% {
45
- -webkit-transform: translateY(-15px);
46
- transform: translateY(-15px);
47
- }
48
- }
49
-
50
- @keyframes bounce {
51
- 0%, 20%, 50%, 80%, 100% {
52
- -webkit-transform: translateY(0);
53
- -ms-transform: translateY(0);
54
- transform: translateY(0);
55
- }
56
-
57
- 40% {
58
- -webkit-transform: translateY(-30px);
59
- -ms-transform: translateY(-30px);
60
- transform: translateY(-30px);
61
- }
62
-
63
- 60% {
64
- -webkit-transform: translateY(-15px);
65
- -ms-transform: translateY(-15px);
66
- transform: translateY(-15px);
67
- }
68
- }
69
-
70
- .bounce {
71
- -webkit-animation-name: bounce;
72
- animation-name: bounce;
73
- }
74
-
75
- @-webkit-keyframes flash {
76
- 0%, 50%, 100% {
77
- opacity: 1;
78
- }
79
-
80
- 25%, 75% {
81
- opacity: 0;
82
- }
83
- }
84
-
85
- @keyframes flash {
86
- 0%, 50%, 100% {
87
- opacity: 1;
88
- }
89
-
90
- 25%, 75% {
91
- opacity: 0;
92
- }
93
- }
94
-
95
- .flash {
96
- -webkit-animation-name: flash;
97
- animation-name: flash;
98
- }
99
-
100
- /* originally authored by Nick Pettit - https://github.com/nickpettit/glide */
101
-
102
- @-webkit-keyframes pulse {
103
- 0% {
104
- -webkit-transform: scale(1);
105
- transform: scale(1);
106
- }
107
-
108
- 50% {
109
- -webkit-transform: scale(1.1);
110
- transform: scale(1.1);
111
- }
112
-
113
- 100% {
114
- -webkit-transform: scale(1);
115
- transform: scale(1);
116
- }
117
- }
118
-
119
- @keyframes pulse {
120
- 0% {
121
- -webkit-transform: scale(1);
122
- -ms-transform: scale(1);
123
- transform: scale(1);
124
- }
125
-
126
- 50% {
127
- -webkit-transform: scale(1.1);
128
- -ms-transform: scale(1.1);
129
- transform: scale(1.1);
130
- }
131
-
132
- 100% {
133
- -webkit-transform: scale(1);
134
- -ms-transform: scale(1);
135
- transform: scale(1);
136
- }
137
- }
138
-
139
- .pulse {
140
- -webkit-animation-name: pulse;
141
- animation-name: pulse;
142
- }
143
-
144
- @-webkit-keyframes rubberBand {
145
- 0% {
146
- -webkit-transform: scale(1);
147
- transform: scale(1);
148
- }
149
-
150
- 30% {
151
- -webkit-transform: scaleX(1.25) scaleY(0.75);
152
- transform: scaleX(1.25) scaleY(0.75);
153
- }
154
-
155
- 40% {
156
- -webkit-transform: scaleX(0.75) scaleY(1.25);
157
- transform: scaleX(0.75) scaleY(1.25);
158
- }
159
-
160
- 60% {
161
- -webkit-transform: scaleX(1.15) scaleY(0.85);
162
- transform: scaleX(1.15) scaleY(0.85);
163
- }
164
-
165
- 100% {
166
- -webkit-transform: scale(1);
167
- transform: scale(1);
168
- }
169
- }
170
-
171
- @keyframes rubberBand {
172
- 0% {
173
- -webkit-transform: scale(1);
174
- -ms-transform: scale(1);
175
- transform: scale(1);
176
- }
177
-
178
- 30% {
179
- -webkit-transform: scaleX(1.25) scaleY(0.75);
180
- -ms-transform: scaleX(1.25) scaleY(0.75);
181
- transform: scaleX(1.25) scaleY(0.75);
182
- }
183
-
184
- 40% {
185
- -webkit-transform: scaleX(0.75) scaleY(1.25);
186
- -ms-transform: scaleX(0.75) scaleY(1.25);
187
- transform: scaleX(0.75) scaleY(1.25);
188
- }
189
-
190
- 60% {
191
- -webkit-transform: scaleX(1.15) scaleY(0.85);
192
- -ms-transform: scaleX(1.15) scaleY(0.85);
193
- transform: scaleX(1.15) scaleY(0.85);
194
- }
195
-
196
- 100% {
197
- -webkit-transform: scale(1);
198
- -ms-transform: scale(1);
199
- transform: scale(1);
200
- }
201
- }
202
-
203
- .rubberBand {
204
- -webkit-animation-name: rubberBand;
205
- animation-name: rubberBand;
206
- }
207
-
208
- @-webkit-keyframes shake {
209
- 0%, 100% {
210
- -webkit-transform: translateX(0);
211
- transform: translateX(0);
212
- }
213
-
214
- 10%, 30%, 50%, 70%, 90% {
215
- -webkit-transform: translateX(-10px);
216
- transform: translateX(-10px);
217
- }
218
-
219
- 20%, 40%, 60%, 80% {
220
- -webkit-transform: translateX(10px);
221
- transform: translateX(10px);
222
- }
223
- }
224
-
225
- @keyframes shake {
226
- 0%, 100% {
227
- -webkit-transform: translateX(0);
228
- -ms-transform: translateX(0);
229
- transform: translateX(0);
230
- }
231
-
232
- 10%, 30%, 50%, 70%, 90% {
233
- -webkit-transform: translateX(-10px);
234
- -ms-transform: translateX(-10px);
235
- transform: translateX(-10px);
236
- }
237
-
238
- 20%, 40%, 60%, 80% {
239
- -webkit-transform: translateX(10px);
240
- -ms-transform: translateX(10px);
241
- transform: translateX(10px);
242
- }
243
- }
244
-
245
- .shake {
246
- -webkit-animation-name: shake;
247
- animation-name: shake;
248
- }
249
-
250
- @-webkit-keyframes swing {
251
- 20% {
252
- -webkit-transform: rotate(15deg);
253
- transform: rotate(15deg);
254
- }
255
-
256
- 40% {
257
- -webkit-transform: rotate(-10deg);
258
- transform: rotate(-10deg);
259
- }
260
-
261
- 60% {
262
- -webkit-transform: rotate(5deg);
263
- transform: rotate(5deg);
264
- }
265
-
266
- 80% {
267
- -webkit-transform: rotate(-5deg);
268
- transform: rotate(-5deg);
269
- }
270
-
271
- 100% {
272
- -webkit-transform: rotate(0deg);
273
- transform: rotate(0deg);
274
- }
275
- }
276
-
277
- @keyframes swing {
278
- 20% {
279
- -webkit-transform: rotate(15deg);
280
- -ms-transform: rotate(15deg);
281
- transform: rotate(15deg);
282
- }
283
-
284
- 40% {
285
- -webkit-transform: rotate(-10deg);
286
- -ms-transform: rotate(-10deg);
287
- transform: rotate(-10deg);
288
- }
289
-
290
- 60% {
291
- -webkit-transform: rotate(5deg);
292
- -ms-transform: rotate(5deg);
293
- transform: rotate(5deg);
294
- }
295
-
296
- 80% {
297
- -webkit-transform: rotate(-5deg);
298
- -ms-transform: rotate(-5deg);
299
- transform: rotate(-5deg);
300
- }
301
-
302
- 100% {
303
- -webkit-transform: rotate(0deg);
304
- -ms-transform: rotate(0deg);
305
- transform: rotate(0deg);
306
- }
307
- }
308
-
309
- .swing {
310
- -webkit-transform-origin: top center;
311
- -ms-transform-origin: top center;
312
- transform-origin: top center;
313
- -webkit-animation-name: swing;
314
- animation-name: swing;
315
- }
316
-
317
- @-webkit-keyframes tada {
318
- 0% {
319
- -webkit-transform: scale(1);
320
- transform: scale(1);
321
- }
322
-
323
- 10%, 20% {
324
- -webkit-transform: scale(0.9) rotate(-3deg);
325
- transform: scale(0.9) rotate(-3deg);
326
- }
327
-
328
- 30%, 50%, 70%, 90% {
329
- -webkit-transform: scale(1.1) rotate(3deg);
330
- transform: scale(1.1) rotate(3deg);
331
- }
332
-
333
- 40%, 60%, 80% {
334
- -webkit-transform: scale(1.1) rotate(-3deg);
335
- transform: scale(1.1) rotate(-3deg);
336
- }
337
-
338
- 100% {
339
- -webkit-transform: scale(1) rotate(0);
340
- transform: scale(1) rotate(0);
341
- }
342
- }
343
-
344
- @keyframes tada {
345
- 0% {
346
- -webkit-transform: scale(1);
347
- -ms-transform: scale(1);
348
- transform: scale(1);
349
- }
350
-
351
- 10%, 20% {
352
- -webkit-transform: scale(0.9) rotate(-3deg);
353
- -ms-transform: scale(0.9) rotate(-3deg);
354
- transform: scale(0.9) rotate(-3deg);
355
- }
356
-
357
- 30%, 50%, 70%, 90% {
358
- -webkit-transform: scale(1.1) rotate(3deg);
359
- -ms-transform: scale(1.1) rotate(3deg);
360
- transform: scale(1.1) rotate(3deg);
361
- }
362
-
363
- 40%, 60%, 80% {
364
- -webkit-transform: scale(1.1) rotate(-3deg);
365
- -ms-transform: scale(1.1) rotate(-3deg);
366
- transform: scale(1.1) rotate(-3deg);
367
- }
368
-
369
- 100% {
370
- -webkit-transform: scale(1) rotate(0);
371
- -ms-transform: scale(1) rotate(0);
372
- transform: scale(1) rotate(0);
373
- }
374
- }
375
-
376
- .tada {
377
- -webkit-animation-name: tada;
378
- animation-name: tada;
379
- }
380
-
381
- /* originally authored by Nick Pettit - https://github.com/nickpettit/glide */
382
-
383
- @-webkit-keyframes wobble {
384
- 0% {
385
- -webkit-transform: translateX(0%);
386
- transform: translateX(0%);
387
- }
388
-
389
- 15% {
390
- -webkit-transform: translateX(-25%) rotate(-5deg);
391
- transform: translateX(-25%) rotate(-5deg);
392
- }
393
-
394
- 30% {
395
- -webkit-transform: translateX(20%) rotate(3deg);
396
- transform: translateX(20%) rotate(3deg);
397
- }
398
-
399
- 45% {
400
- -webkit-transform: translateX(-15%) rotate(-3deg);
401
- transform: translateX(-15%) rotate(-3deg);
402
- }
403
-
404
- 60% {
405
- -webkit-transform: translateX(10%) rotate(2deg);
406
- transform: translateX(10%) rotate(2deg);
407
- }
408
-
409
- 75% {
410
- -webkit-transform: translateX(-5%) rotate(-1deg);
411
- transform: translateX(-5%) rotate(-1deg);
412
- }
413
-
414
- 100% {
415
- -webkit-transform: translateX(0%);
416
- transform: translateX(0%);
417
- }
418
- }
419
-
420
- @keyframes wobble {
421
- 0% {
422
- -webkit-transform: translateX(0%);
423
- -ms-transform: translateX(0%);
424
- transform: translateX(0%);
425
- }
426
-
427
- 15% {
428
- -webkit-transform: translateX(-25%) rotate(-5deg);
429
- -ms-transform: translateX(-25%) rotate(-5deg);
430
- transform: translateX(-25%) rotate(-5deg);
431
- }
432
-
433
- 30% {
434
- -webkit-transform: translateX(20%) rotate(3deg);
435
- -ms-transform: translateX(20%) rotate(3deg);
436
- transform: translateX(20%) rotate(3deg);
437
- }
438
-
439
- 45% {
440
- -webkit-transform: translateX(-15%) rotate(-3deg);
441
- -ms-transform: translateX(-15%) rotate(-3deg);
442
- transform: translateX(-15%) rotate(-3deg);
443
- }
444
-
445
- 60% {
446
- -webkit-transform: translateX(10%) rotate(2deg);
447
- -ms-transform: translateX(10%) rotate(2deg);
448
- transform: translateX(10%) rotate(2deg);
449
- }
450
-
451
- 75% {
452
- -webkit-transform: translateX(-5%) rotate(-1deg);
453
- -ms-transform: translateX(-5%) rotate(-1deg);
454
- transform: translateX(-5%) rotate(-1deg);
455
- }
456
-
457
- 100% {
458
- -webkit-transform: translateX(0%);
459
- -ms-transform: translateX(0%);
460
- transform: translateX(0%);
461
- }
462
- }
463
-
464
- .wobble {
465
- -webkit-animation-name: wobble;
466
- animation-name: wobble;
467
- }
468
-
469
- @-webkit-keyframes bounceIn {
470
- 0% {
471
- opacity: 0;
472
- -webkit-transform: scale(.3);
473
- transform: scale(.3);
474
- }
475
-
476
- 50% {
477
- opacity: 1;
478
- -webkit-transform: scale(1.05);
479
- transform: scale(1.05);
480
- }
481
-
482
- 70% {
483
- -webkit-transform: scale(.9);
484
- transform: scale(.9);
485
- }
486
-
487
- 100% {
488
- opacity: 1;
489
- -webkit-transform: scale(1);
490
- transform: scale(1);
491
- }
492
- }
493
-
494
- @keyframes bounceIn {
495
- 0% {
496
- opacity: 0;
497
- -webkit-transform: scale(.3);
498
- -ms-transform: scale(.3);
499
- transform: scale(.3);
500
- }
501
-
502
- 50% {
503
- opacity: 1;
504
- -webkit-transform: scale(1.05);
505
- -ms-transform: scale(1.05);
506
- transform: scale(1.05);
507
- }
508
-
509
- 70% {
510
- -webkit-transform: scale(.9);
511
- -ms-transform: scale(.9);
512
- transform: scale(.9);
513
- }
514
-
515
- 100% {
516
- opacity: 1;
517
- -webkit-transform: scale(1);
518
- -ms-transform: scale(1);
519
- transform: scale(1);
520
- }
521
- }
522
-
523
- .bounceIn {
524
- -webkit-animation-name: bounceIn;
525
- animation-name: bounceIn;
526
- }
527
-
528
- @-webkit-keyframes bounceInDown {
529
- 0% {
530
- opacity: 0;
531
- -webkit-transform: translateY(-2000px);
532
- transform: translateY(-2000px);
533
- }
534
-
535
- 60% {
536
- opacity: 1;
537
- -webkit-transform: translateY(30px);
538
- transform: translateY(30px);
539
- }
540
-
541
- 80% {
542
- -webkit-transform: translateY(-10px);
543
- transform: translateY(-10px);
544
- }
545
-
546
- 100% {
547
- -webkit-transform: translateY(0);
548
- transform: translateY(0);
549
- }
550
- }
551
-
552
- @keyframes bounceInDown {
553
- 0% {
554
- opacity: 0;
555
- -webkit-transform: translateY(-2000px);
556
- -ms-transform: translateY(-2000px);
557
- transform: translateY(-2000px);
558
- }
559
-
560
- 60% {
561
- opacity: 1;
562
- -webkit-transform: translateY(30px);
563
- -ms-transform: translateY(30px);
564
- transform: translateY(30px);
565
- }
566
-
567
- 80% {
568
- -webkit-transform: translateY(-10px);
569
- -ms-transform: translateY(-10px);
570
- transform: translateY(-10px);
571
- }
572
-
573
- 100% {
574
- -webkit-transform: translateY(0);
575
- -ms-transform: translateY(0);
576
- transform: translateY(0);
577
- }
578
- }
579
-
580
- .bounceInDown {
581
- -webkit-animation-name: bounceInDown;
582
- animation-name: bounceInDown;
583
- }
584
-
585
- @-webkit-keyframes bounceInLeft {
586
- 0% {
587
- opacity: 0;
588
- -webkit-transform: translateX(-2000px);
589
- transform: translateX(-2000px);
590
- }
591
-
592
- 60% {
593
- opacity: 1;
594
- -webkit-transform: translateX(30px);
595
- transform: translateX(30px);
596
- }
597
-
598
- 80% {
599
- -webkit-transform: translateX(-10px);
600
- transform: translateX(-10px);
601
- }
602
-
603
- 100% {
604
- -webkit-transform: translateX(0);
605
- transform: translateX(0);
606
- }
607
- }
608
-
609
- @keyframes bounceInLeft {
610
- 0% {
611
- opacity: 0;
612
- -webkit-transform: translateX(-2000px);
613
- -ms-transform: translateX(-2000px);
614
- transform: translateX(-2000px);
615
- }
616
-
617
- 60% {
618
- opacity: 1;
619
- -webkit-transform: translateX(30px);
620
- -ms-transform: translateX(30px);
621
- transform: translateX(30px);
622
- }
623
-
624
- 80% {
625
- -webkit-transform: translateX(-10px);
626
- -ms-transform: translateX(-10px);
627
- transform: translateX(-10px);
628
- }
629
-
630
- 100% {
631
- -webkit-transform: translateX(0);
632
- -ms-transform: translateX(0);
633
- transform: translateX(0);
634
- }
635
- }
636
-
637
- .bounceInLeft {
638
- -webkit-animation-name: bounceInLeft;
639
- animation-name: bounceInLeft;
640
- }
641
-
642
- @-webkit-keyframes bounceInRight {
643
- 0% {
644
- opacity: 0;
645
- -webkit-transform: translateX(2000px);
646
- transform: translateX(2000px);
647
- }
648
-
649
- 60% {
650
- opacity: 1;
651
- -webkit-transform: translateX(-30px);
652
- transform: translateX(-30px);
653
- }
654
-
655
- 80% {
656
- -webkit-transform: translateX(10px);
657
- transform: translateX(10px);
658
- }
659
-
660
- 100% {
661
- -webkit-transform: translateX(0);
662
- transform: translateX(0);
663
- }
664
- }
665
-
666
- @keyframes bounceInRight {
667
- 0% {
668
- opacity: 0;
669
- -webkit-transform: translateX(2000px);
670
- -ms-transform: translateX(2000px);
671
- transform: translateX(2000px);
672
- }
673
-
674
- 60% {
675
- opacity: 1;
676
- -webkit-transform: translateX(-30px);
677
- -ms-transform: translateX(-30px);
678
- transform: translateX(-30px);
679
- }
680
-
681
- 80% {
682
- -webkit-transform: translateX(10px);
683
- -ms-transform: translateX(10px);
684
- transform: translateX(10px);
685
- }
686
-
687
- 100% {
688
- -webkit-transform: translateX(0);
689
- -ms-transform: translateX(0);
690
- transform: translateX(0);
691
- }
692
- }
693
-
694
- .bounceInRight {
695
- -webkit-animation-name: bounceInRight;
696
- animation-name: bounceInRight;
697
- }
698
-
699
- @-webkit-keyframes bounceInUp {
700
- 0% {
701
- opacity: 0;
702
- -webkit-transform: translateY(2000px);
703
- transform: translateY(2000px);
704
- }
705
-
706
- 60% {
707
- opacity: 1;
708
- -webkit-transform: translateY(-30px);
709
- transform: translateY(-30px);
710
- }
711
-
712
- 80% {
713
- -webkit-transform: translateY(10px);
714
- transform: translateY(10px);
715
- }
716
-
717
- 100% {
718
- -webkit-transform: translateY(0);
719
- transform: translateY(0);
720
- }
721
- }
722
-
723
- @keyframes bounceInUp {
724
- 0% {
725
- opacity: 0;
726
- -webkit-transform: translateY(2000px);
727
- -ms-transform: translateY(2000px);
728
- transform: translateY(2000px);
729
- }
730
-
731
- 60% {
732
- opacity: 1;
733
- -webkit-transform: translateY(-30px);
734
- -ms-transform: translateY(-30px);
735
- transform: translateY(-30px);
736
- }
737
-
738
- 80% {
739
- -webkit-transform: translateY(10px);
740
- -ms-transform: translateY(10px);
741
- transform: translateY(10px);
742
- }
743
-
744
- 100% {
745
- -webkit-transform: translateY(0);
746
- -ms-transform: translateY(0);
747
- transform: translateY(0);
748
- }
749
- }
750
-
751
- .bounceInUp {
752
- -webkit-animation-name: bounceInUp;
753
- animation-name: bounceInUp;
754
- }
755
-
756
- @-webkit-keyframes bounceOut {
757
- 0% {
758
- -webkit-transform: scale(1);
759
- transform: scale(1);
760
- }
761
-
762
- 25% {
763
- -webkit-transform: scale(.95);
764
- transform: scale(.95);
765
- }
766
-
767
- 50% {
768
- opacity: 1;
769
- -webkit-transform: scale(1.1);
770
- transform: scale(1.1);
771
- }
772
-
773
- 100% {
774
- opacity: 0;
775
- -webkit-transform: scale(.3);
776
- transform: scale(.3);
777
- }
778
- }
779
-
780
- @keyframes bounceOut {
781
- 0% {
782
- -webkit-transform: scale(1);
783
- -ms-transform: scale(1);
784
- transform: scale(1);
785
- }
786
-
787
- 25% {
788
- -webkit-transform: scale(.95);
789
- -ms-transform: scale(.95);
790
- transform: scale(.95);
791
- }
792
-
793
- 50% {
794
- opacity: 1;
795
- -webkit-transform: scale(1.1);
796
- -ms-transform: scale(1.1);
797
- transform: scale(1.1);
798
- }
799
-
800
- 100% {
801
- opacity: 0;
802
- -webkit-transform: scale(.3);
803
- -ms-transform: scale(.3);
804
- transform: scale(.3);
805
- }
806
- }
807
-
808
- .bounceOut {
809
- -webkit-animation-name: bounceOut;
810
- animation-name: bounceOut;
811
- }
812
-
813
- @-webkit-keyframes bounceOutDown {
814
- 0% {
815
- -webkit-transform: translateY(0);
816
- transform: translateY(0);
817
- }
818
-
819
- 20% {
820
- opacity: 1;
821
- -webkit-transform: translateY(-20px);
822
- transform: translateY(-20px);
823
- }
824
-
825
- 100% {
826
- opacity: 0;
827
- -webkit-transform: translateY(2000px);
828
- transform: translateY(2000px);
829
- }
830
- }
831
-
832
- @keyframes bounceOutDown {
833
- 0% {
834
- -webkit-transform: translateY(0);
835
- -ms-transform: translateY(0);
836
- transform: translateY(0);
837
- }
838
-
839
- 20% {
840
- opacity: 1;
841
- -webkit-transform: translateY(-20px);
842
- -ms-transform: translateY(-20px);
843
- transform: translateY(-20px);
844
- }
845
-
846
- 100% {
847
- opacity: 0;
848
- -webkit-transform: translateY(2000px);
849
- -ms-transform: translateY(2000px);
850
- transform: translateY(2000px);
851
- }
852
- }
853
-
854
- .bounceOutDown {
855
- -webkit-animation-name: bounceOutDown;
856
- animation-name: bounceOutDown;
857
- }
858
-
859
- @-webkit-keyframes bounceOutLeft {
860
- 0% {
861
- -webkit-transform: translateX(0);
862
- transform: translateX(0);
863
- }
864
-
865
- 20% {
866
- opacity: 1;
867
- -webkit-transform: translateX(20px);
868
- transform: translateX(20px);
869
- }
870
-
871
- 100% {
872
- opacity: 0;
873
- -webkit-transform: translateX(-2000px);
874
- transform: translateX(-2000px);
875
- }
876
- }
877
-
878
- @keyframes bounceOutLeft {
879
- 0% {
880
- -webkit-transform: translateX(0);
881
- -ms-transform: translateX(0);
882
- transform: translateX(0);
883
- }
884
-
885
- 20% {
886
- opacity: 1;
887
- -webkit-transform: translateX(20px);
888
- -ms-transform: translateX(20px);
889
- transform: translateX(20px);
890
- }
891
-
892
- 100% {
893
- opacity: 0;
894
- -webkit-transform: translateX(-2000px);
895
- -ms-transform: translateX(-2000px);
896
- transform: translateX(-2000px);
897
- }
898
- }
899
-
900
- .bounceOutLeft {
901
- -webkit-animation-name: bounceOutLeft;
902
- animation-name: bounceOutLeft;
903
- }
904
-
905
- @-webkit-keyframes bounceOutRight {
906
- 0% {
907
- -webkit-transform: translateX(0);
908
- transform: translateX(0);
909
- }
910
-
911
- 20% {
912
- opacity: 1;
913
- -webkit-transform: translateX(-20px);
914
- transform: translateX(-20px);
915
- }
916
-
917
- 100% {
918
- opacity: 0;
919
- -webkit-transform: translateX(2000px);
920
- transform: translateX(2000px);
921
- }
922
- }
923
-
924
- @keyframes bounceOutRight {
925
- 0% {
926
- -webkit-transform: translateX(0);
927
- -ms-transform: translateX(0);
928
- transform: translateX(0);
929
- }
930
-
931
- 20% {
932
- opacity: 1;
933
- -webkit-transform: translateX(-20px);
934
- -ms-transform: translateX(-20px);
935
- transform: translateX(-20px);
936
- }
937
-
938
- 100% {
939
- opacity: 0;
940
- -webkit-transform: translateX(2000px);
941
- -ms-transform: translateX(2000px);
942
- transform: translateX(2000px);
943
- }
944
- }
945
-
946
- .bounceOutRight {
947
- -webkit-animation-name: bounceOutRight;
948
- animation-name: bounceOutRight;
949
- }
950
-
951
- @-webkit-keyframes bounceOutUp {
952
- 0% {
953
- -webkit-transform: translateY(0);
954
- transform: translateY(0);
955
- }
956
-
957
- 20% {
958
- opacity: 1;
959
- -webkit-transform: translateY(20px);
960
- transform: translateY(20px);
961
- }
962
-
963
- 100% {
964
- opacity: 0;
965
- -webkit-transform: translateY(-2000px);
966
- transform: translateY(-2000px);
967
- }
968
- }
969
-
970
- @keyframes bounceOutUp {
971
- 0% {
972
- -webkit-transform: translateY(0);
973
- -ms-transform: translateY(0);
974
- transform: translateY(0);
975
- }
976
-
977
- 20% {
978
- opacity: 1;
979
- -webkit-transform: translateY(20px);
980
- -ms-transform: translateY(20px);
981
- transform: translateY(20px);
982
- }
983
-
984
- 100% {
985
- opacity: 0;
986
- -webkit-transform: translateY(-2000px);
987
- -ms-transform: translateY(-2000px);
988
- transform: translateY(-2000px);
989
- }
990
- }
991
-
992
- .bounceOutUp {
993
- -webkit-animation-name: bounceOutUp;
994
- animation-name: bounceOutUp;
995
- }
996
-
997
- @-webkit-keyframes fadeIn {
998
- 0% {
999
- opacity: 0;
1000
- }
1001
-
1002
- 100% {
1003
- opacity: 1;
1004
- }
1005
- }
1006
-
1007
- @keyframes fadeIn {
1008
- 0% {
1009
- opacity: 0;
1010
- }
1011
-
1012
- 100% {
1013
- opacity: 1;
1014
- }
1015
- }
1016
-
1017
- .fadeIn {
1018
- -webkit-animation-name: fadeIn;
1019
- animation-name: fadeIn;
1020
- }
1021
-
1022
- @-webkit-keyframes fadeInDown {
1023
- 0% {
1024
- opacity: 0;
1025
- -webkit-transform: translateY(-20px);
1026
- transform: translateY(-20px);
1027
- }
1028
-
1029
- 100% {
1030
- opacity: 1;
1031
- -webkit-transform: translateY(0);
1032
- transform: translateY(0);
1033
- }
1034
- }
1035
-
1036
- @keyframes fadeInDown {
1037
- 0% {
1038
- opacity: 0;
1039
- -webkit-transform: translateY(-20px);
1040
- -ms-transform: translateY(-20px);
1041
- transform: translateY(-20px);
1042
- }
1043
-
1044
- 100% {
1045
- opacity: 1;
1046
- -webkit-transform: translateY(0);
1047
- -ms-transform: translateY(0);
1048
- transform: translateY(0);
1049
- }
1050
- }
1051
-
1052
- .fadeInDown {
1053
- -webkit-animation-name: fadeInDown;
1054
- animation-name: fadeInDown;
1055
- }
1056
-
1057
- @-webkit-keyframes fadeInDownBig {
1058
- 0% {
1059
- opacity: 0;
1060
- -webkit-transform: translateY(-2000px);
1061
- transform: translateY(-2000px);
1062
- }
1063
-
1064
- 100% {
1065
- opacity: 1;
1066
- -webkit-transform: translateY(0);
1067
- transform: translateY(0);
1068
- }
1069
- }
1070
-
1071
- @keyframes fadeInDownBig {
1072
- 0% {
1073
- opacity: 0;
1074
- -webkit-transform: translateY(-2000px);
1075
- -ms-transform: translateY(-2000px);
1076
- transform: translateY(-2000px);
1077
- }
1078
-
1079
- 100% {
1080
- opacity: 1;
1081
- -webkit-transform: translateY(0);
1082
- -ms-transform: translateY(0);
1083
- transform: translateY(0);
1084
- }
1085
- }
1086
-
1087
- .fadeInDownBig {
1088
- -webkit-animation-name: fadeInDownBig;
1089
- animation-name: fadeInDownBig;
1090
- }
1091
-
1092
- @-webkit-keyframes fadeInLeft {
1093
- 0% {
1094
- opacity: 0;
1095
- -webkit-transform: translateX(-20px);
1096
- transform: translateX(-20px);
1097
- }
1098
-
1099
- 100% {
1100
- opacity: 1;
1101
- -webkit-transform: translateX(0);
1102
- transform: translateX(0);
1103
- }
1104
- }
1105
-
1106
- @keyframes fadeInLeft {
1107
- 0% {
1108
- opacity: 0;
1109
- -webkit-transform: translateX(-20px);
1110
- -ms-transform: translateX(-20px);
1111
- transform: translateX(-20px);
1112
- }
1113
-
1114
- 100% {
1115
- opacity: 1;
1116
- -webkit-transform: translateX(0);
1117
- -ms-transform: translateX(0);
1118
- transform: translateX(0);
1119
- }
1120
- }
1121
-
1122
- .fadeInLeft {
1123
- -webkit-animation-name: fadeInLeft;
1124
- animation-name: fadeInLeft;
1125
- }
1126
-
1127
- @-webkit-keyframes fadeInLeftBig {
1128
- 0% {
1129
- opacity: 0;
1130
- -webkit-transform: translateX(-2000px);
1131
- transform: translateX(-2000px);
1132
- }
1133
-
1134
- 100% {
1135
- opacity: 1;
1136
- -webkit-transform: translateX(0);
1137
- transform: translateX(0);
1138
- }
1139
- }
1140
-
1141
- @keyframes fadeInLeftBig {
1142
- 0% {
1143
- opacity: 0;
1144
- -webkit-transform: translateX(-2000px);
1145
- -ms-transform: translateX(-2000px);
1146
- transform: translateX(-2000px);
1147
- }
1148
-
1149
- 100% {
1150
- opacity: 1;
1151
- -webkit-transform: translateX(0);
1152
- -ms-transform: translateX(0);
1153
- transform: translateX(0);
1154
- }
1155
- }
1156
-
1157
- .fadeInLeftBig {
1158
- -webkit-animation-name: fadeInLeftBig;
1159
- animation-name: fadeInLeftBig;
1160
- }
1161
-
1162
- @-webkit-keyframes fadeInRight {
1163
- 0% {
1164
- opacity: 0;
1165
- -webkit-transform: translateX(20px);
1166
- transform: translateX(20px);
1167
- }
1168
-
1169
- 100% {
1170
- opacity: 1;
1171
- -webkit-transform: translateX(0);
1172
- transform: translateX(0);
1173
- }
1174
- }
1175
-
1176
- @keyframes fadeInRight {
1177
- 0% {
1178
- opacity: 0;
1179
- -webkit-transform: translateX(20px);
1180
- -ms-transform: translateX(20px);
1181
- transform: translateX(20px);
1182
- }
1183
-
1184
- 100% {
1185
- opacity: 1;
1186
- -webkit-transform: translateX(0);
1187
- -ms-transform: translateX(0);
1188
- transform: translateX(0);
1189
- }
1190
- }
1191
-
1192
- .fadeInRight {
1193
- -webkit-animation-name: fadeInRight;
1194
- animation-name: fadeInRight;
1195
- }
1196
-
1197
- @-webkit-keyframes fadeInRightBig {
1198
- 0% {
1199
- opacity: 0;
1200
- -webkit-transform: translateX(2000px);
1201
- transform: translateX(2000px);
1202
- }
1203
-
1204
- 100% {
1205
- opacity: 1;
1206
- -webkit-transform: translateX(0);
1207
- transform: translateX(0);
1208
- }
1209
- }
1210
-
1211
- @keyframes fadeInRightBig {
1212
- 0% {
1213
- opacity: 0;
1214
- -webkit-transform: translateX(2000px);
1215
- -ms-transform: translateX(2000px);
1216
- transform: translateX(2000px);
1217
- }
1218
-
1219
- 100% {
1220
- opacity: 1;
1221
- -webkit-transform: translateX(0);
1222
- -ms-transform: translateX(0);
1223
- transform: translateX(0);
1224
- }
1225
- }
1226
-
1227
- .fadeInRightBig {
1228
- -webkit-animation-name: fadeInRightBig;
1229
- animation-name: fadeInRightBig;
1230
- }
1231
-
1232
- @-webkit-keyframes fadeInUp {
1233
- 0% {
1234
- opacity: 0;
1235
- -webkit-transform: translateY(20px);
1236
- transform: translateY(20px);
1237
- }
1238
-
1239
- 100% {
1240
- opacity: 1;
1241
- -webkit-transform: translateY(0);
1242
- transform: translateY(0);
1243
- }
1244
- }
1245
-
1246
- @keyframes fadeInUp {
1247
- 0% {
1248
- opacity: 0;
1249
- -webkit-transform: translateY(20px);
1250
- -ms-transform: translateY(20px);
1251
- transform: translateY(20px);
1252
- }
1253
-
1254
- 100% {
1255
- opacity: 1;
1256
- -webkit-transform: translateY(0);
1257
- -ms-transform: translateY(0);
1258
- transform: translateY(0);
1259
- }
1260
- }
1261
-
1262
- .fadeInUp {
1263
- -webkit-animation-name: fadeInUp;
1264
- animation-name: fadeInUp;
1265
- }
1266
-
1267
- @-webkit-keyframes fadeInUpBig {
1268
- 0% {
1269
- opacity: 0;
1270
- -webkit-transform: translateY(2000px);
1271
- transform: translateY(2000px);
1272
- }
1273
-
1274
- 100% {
1275
- opacity: 1;
1276
- -webkit-transform: translateY(0);
1277
- transform: translateY(0);
1278
- }
1279
- }
1280
-
1281
- @keyframes fadeInUpBig {
1282
- 0% {
1283
- opacity: 0;
1284
- -webkit-transform: translateY(2000px);
1285
- -ms-transform: translateY(2000px);
1286
- transform: translateY(2000px);
1287
- }
1288
-
1289
- 100% {
1290
- opacity: 1;
1291
- -webkit-transform: translateY(0);
1292
- -ms-transform: translateY(0);
1293
- transform: translateY(0);
1294
- }
1295
- }
1296
-
1297
- .fadeInUpBig {
1298
- -webkit-animation-name: fadeInUpBig;
1299
- animation-name: fadeInUpBig;
1300
- }
1301
-
1302
- @-webkit-keyframes fadeOut {
1303
- 0% {
1304
- opacity: 1;
1305
- }
1306
-
1307
- 100% {
1308
- opacity: 0;
1309
- }
1310
- }
1311
-
1312
- @keyframes fadeOut {
1313
- 0% {
1314
- opacity: 1;
1315
- }
1316
-
1317
- 100% {
1318
- opacity: 0;
1319
- }
1320
- }
1321
-
1322
- .fadeOut {
1323
- -webkit-animation-name: fadeOut;
1324
- animation-name: fadeOut;
1325
- }
1326
-
1327
- @-webkit-keyframes fadeOutDown {
1328
- 0% {
1329
- opacity: 1;
1330
- -webkit-transform: translateY(0);
1331
- transform: translateY(0);
1332
- }
1333
-
1334
- 100% {
1335
- opacity: 0;
1336
- -webkit-transform: translateY(20px);
1337
- transform: translateY(20px);
1338
- }
1339
- }
1340
-
1341
- @keyframes fadeOutDown {
1342
- 0% {
1343
- opacity: 1;
1344
- -webkit-transform: translateY(0);
1345
- -ms-transform: translateY(0);
1346
- transform: translateY(0);
1347
- }
1348
-
1349
- 100% {
1350
- opacity: 0;
1351
- -webkit-transform: translateY(20px);
1352
- -ms-transform: translateY(20px);
1353
- transform: translateY(20px);
1354
- }
1355
- }
1356
-
1357
- .fadeOutDown {
1358
- -webkit-animation-name: fadeOutDown;
1359
- animation-name: fadeOutDown;
1360
- }
1361
-
1362
- @-webkit-keyframes fadeOutDownBig {
1363
- 0% {
1364
- opacity: 1;
1365
- -webkit-transform: translateY(0);
1366
- transform: translateY(0);
1367
- }
1368
-
1369
- 100% {
1370
- opacity: 0;
1371
- -webkit-transform: translateY(2000px);
1372
- transform: translateY(2000px);
1373
- }
1374
- }
1375
-
1376
- @keyframes fadeOutDownBig {
1377
- 0% {
1378
- opacity: 1;
1379
- -webkit-transform: translateY(0);
1380
- -ms-transform: translateY(0);
1381
- transform: translateY(0);
1382
- }
1383
-
1384
- 100% {
1385
- opacity: 0;
1386
- -webkit-transform: translateY(2000px);
1387
- -ms-transform: translateY(2000px);
1388
- transform: translateY(2000px);
1389
- }
1390
- }
1391
-
1392
- .fadeOutDownBig {
1393
- -webkit-animation-name: fadeOutDownBig;
1394
- animation-name: fadeOutDownBig;
1395
- }
1396
-
1397
- @-webkit-keyframes fadeOutLeft {
1398
- 0% {
1399
- opacity: 1;
1400
- -webkit-transform: translateX(0);
1401
- transform: translateX(0);
1402
- }
1403
-
1404
- 100% {
1405
- opacity: 0;
1406
- -webkit-transform: translateX(-20px);
1407
- transform: translateX(-20px);
1408
- }
1409
- }
1410
-
1411
- @keyframes fadeOutLeft {
1412
- 0% {
1413
- opacity: 1;
1414
- -webkit-transform: translateX(0);
1415
- -ms-transform: translateX(0);
1416
- transform: translateX(0);
1417
- }
1418
-
1419
- 100% {
1420
- opacity: 0;
1421
- -webkit-transform: translateX(-20px);
1422
- -ms-transform: translateX(-20px);
1423
- transform: translateX(-20px);
1424
- }
1425
- }
1426
-
1427
- .fadeOutLeft {
1428
- -webkit-animation-name: fadeOutLeft;
1429
- animation-name: fadeOutLeft;
1430
- }
1431
-
1432
- @-webkit-keyframes fadeOutLeftBig {
1433
- 0% {
1434
- opacity: 1;
1435
- -webkit-transform: translateX(0);
1436
- transform: translateX(0);
1437
- }
1438
-
1439
- 100% {
1440
- opacity: 0;
1441
- -webkit-transform: translateX(-2000px);
1442
- transform: translateX(-2000px);
1443
- }
1444
- }
1445
-
1446
- @keyframes fadeOutLeftBig {
1447
- 0% {
1448
- opacity: 1;
1449
- -webkit-transform: translateX(0);
1450
- -ms-transform: translateX(0);
1451
- transform: translateX(0);
1452
- }
1453
-
1454
- 100% {
1455
- opacity: 0;
1456
- -webkit-transform: translateX(-2000px);
1457
- -ms-transform: translateX(-2000px);
1458
- transform: translateX(-2000px);
1459
- }
1460
- }
1461
-
1462
- .fadeOutLeftBig {
1463
- -webkit-animation-name: fadeOutLeftBig;
1464
- animation-name: fadeOutLeftBig;
1465
- }
1466
-
1467
- @-webkit-keyframes fadeOutRight {
1468
- 0% {
1469
- opacity: 1;
1470
- -webkit-transform: translateX(0);
1471
- transform: translateX(0);
1472
- }
1473
-
1474
- 100% {
1475
- opacity: 0;
1476
- -webkit-transform: translateX(20px);
1477
- transform: translateX(20px);
1478
- }
1479
- }
1480
-
1481
- @keyframes fadeOutRight {
1482
- 0% {
1483
- opacity: 1;
1484
- -webkit-transform: translateX(0);
1485
- -ms-transform: translateX(0);
1486
- transform: translateX(0);
1487
- }
1488
-
1489
- 100% {
1490
- opacity: 0;
1491
- -webkit-transform: translateX(20px);
1492
- -ms-transform: translateX(20px);
1493
- transform: translateX(20px);
1494
- }
1495
- }
1496
-
1497
- .fadeOutRight {
1498
- -webkit-animation-name: fadeOutRight;
1499
- animation-name: fadeOutRight;
1500
- }
1501
-
1502
- @-webkit-keyframes fadeOutRightBig {
1503
- 0% {
1504
- opacity: 1;
1505
- -webkit-transform: translateX(0);
1506
- transform: translateX(0);
1507
- }
1508
-
1509
- 100% {
1510
- opacity: 0;
1511
- -webkit-transform: translateX(2000px);
1512
- transform: translateX(2000px);
1513
- }
1514
- }
1515
-
1516
- @keyframes fadeOutRightBig {
1517
- 0% {
1518
- opacity: 1;
1519
- -webkit-transform: translateX(0);
1520
- -ms-transform: translateX(0);
1521
- transform: translateX(0);
1522
- }
1523
-
1524
- 100% {
1525
- opacity: 0;
1526
- -webkit-transform: translateX(2000px);
1527
- -ms-transform: translateX(2000px);
1528
- transform: translateX(2000px);
1529
- }
1530
- }
1531
-
1532
- .fadeOutRightBig {
1533
- -webkit-animation-name: fadeOutRightBig;
1534
- animation-name: fadeOutRightBig;
1535
- }
1536
-
1537
- @-webkit-keyframes fadeOutUp {
1538
- 0% {
1539
- opacity: 1;
1540
- -webkit-transform: translateY(0);
1541
- transform: translateY(0);
1542
- }
1543
-
1544
- 100% {
1545
- opacity: 0;
1546
- -webkit-transform: translateY(-20px);
1547
- transform: translateY(-20px);
1548
- }
1549
- }
1550
-
1551
- @keyframes fadeOutUp {
1552
- 0% {
1553
- opacity: 1;
1554
- -webkit-transform: translateY(0);
1555
- -ms-transform: translateY(0);
1556
- transform: translateY(0);
1557
- }
1558
-
1559
- 100% {
1560
- opacity: 0;
1561
- -webkit-transform: translateY(-20px);
1562
- -ms-transform: translateY(-20px);
1563
- transform: translateY(-20px);
1564
- }
1565
- }
1566
-
1567
- .fadeOutUp {
1568
- -webkit-animation-name: fadeOutUp;
1569
- animation-name: fadeOutUp;
1570
- }
1571
-
1572
- @-webkit-keyframes fadeOutUpBig {
1573
- 0% {
1574
- opacity: 1;
1575
- -webkit-transform: translateY(0);
1576
- transform: translateY(0);
1577
- }
1578
-
1579
- 100% {
1580
- opacity: 0;
1581
- -webkit-transform: translateY(-2000px);
1582
- transform: translateY(-2000px);
1583
- }
1584
- }
1585
-
1586
- @keyframes fadeOutUpBig {
1587
- 0% {
1588
- opacity: 1;
1589
- -webkit-transform: translateY(0);
1590
- -ms-transform: translateY(0);
1591
- transform: translateY(0);
1592
- }
1593
-
1594
- 100% {
1595
- opacity: 0;
1596
- -webkit-transform: translateY(-2000px);
1597
- -ms-transform: translateY(-2000px);
1598
- transform: translateY(-2000px);
1599
- }
1600
- }
1601
-
1602
- .fadeOutUpBig {
1603
- -webkit-animation-name: fadeOutUpBig;
1604
- animation-name: fadeOutUpBig;
1605
- }
1606
-
1607
- @-webkit-keyframes flip {
1608
- 0% {
1609
- -webkit-transform: perspective(400px) translateZ(0) rotateY(0) scale(1);
1610
- transform: perspective(400px) translateZ(0) rotateY(0) scale(1);
1611
- -webkit-animation-timing-function: ease-out;
1612
- animation-timing-function: ease-out;
1613
- }
1614
-
1615
- 40% {
1616
- -webkit-transform: perspective(400px) translateZ(150px) rotateY(170deg) scale(1);
1617
- transform: perspective(400px) translateZ(150px) rotateY(170deg) scale(1);
1618
- -webkit-animation-timing-function: ease-out;
1619
- animation-timing-function: ease-out;
1620
- }
1621
-
1622
- 50% {
1623
- -webkit-transform: perspective(400px) translateZ(150px) rotateY(190deg) scale(1);
1624
- transform: perspective(400px) translateZ(150px) rotateY(190deg) scale(1);
1625
- -webkit-animation-timing-function: ease-in;
1626
- animation-timing-function: ease-in;
1627
- }
1628
-
1629
- 80% {
1630
- -webkit-transform: perspective(400px) translateZ(0) rotateY(360deg) scale(.95);
1631
- transform: perspective(400px) translateZ(0) rotateY(360deg) scale(.95);
1632
- -webkit-animation-timing-function: ease-in;
1633
- animation-timing-function: ease-in;
1634
- }
1635
-
1636
- 100% {
1637
- -webkit-transform: perspective(400px) translateZ(0) rotateY(360deg) scale(1);
1638
- transform: perspective(400px) translateZ(0) rotateY(360deg) scale(1);
1639
- -webkit-animation-timing-function: ease-in;
1640
- animation-timing-function: ease-in;
1641
- }
1642
- }
1643
-
1644
- @keyframes flip {
1645
- 0% {
1646
- -webkit-transform: perspective(400px) translateZ(0) rotateY(0) scale(1);
1647
- -ms-transform: perspective(400px) translateZ(0) rotateY(0) scale(1);
1648
- transform: perspective(400px) translateZ(0) rotateY(0) scale(1);
1649
- -webkit-animation-timing-function: ease-out;
1650
- animation-timing-function: ease-out;
1651
- }
1652
-
1653
- 40% {
1654
- -webkit-transform: perspective(400px) translateZ(150px) rotateY(170deg) scale(1);
1655
- -ms-transform: perspective(400px) translateZ(150px) rotateY(170deg) scale(1);
1656
- transform: perspective(400px) translateZ(150px) rotateY(170deg) scale(1);
1657
- -webkit-animation-timing-function: ease-out;
1658
- animation-timing-function: ease-out;
1659
- }
1660
-
1661
- 50% {
1662
- -webkit-transform: perspective(400px) translateZ(150px) rotateY(190deg) scale(1);
1663
- -ms-transform: perspective(400px) translateZ(150px) rotateY(190deg) scale(1);
1664
- transform: perspective(400px) translateZ(150px) rotateY(190deg) scale(1);
1665
- -webkit-animation-timing-function: ease-in;
1666
- animation-timing-function: ease-in;
1667
- }
1668
-
1669
- 80% {
1670
- -webkit-transform: perspective(400px) translateZ(0) rotateY(360deg) scale(.95);
1671
- -ms-transform: perspective(400px) translateZ(0) rotateY(360deg) scale(.95);
1672
- transform: perspective(400px) translateZ(0) rotateY(360deg) scale(.95);
1673
- -webkit-animation-timing-function: ease-in;
1674
- animation-timing-function: ease-in;
1675
- }
1676
-
1677
- 100% {
1678
- -webkit-transform: perspective(400px) translateZ(0) rotateY(360deg) scale(1);
1679
- -ms-transform: perspective(400px) translateZ(0) rotateY(360deg) scale(1);
1680
- transform: perspective(400px) translateZ(0) rotateY(360deg) scale(1);
1681
- -webkit-animation-timing-function: ease-in;
1682
- animation-timing-function: ease-in;
1683
- }
1684
- }
1685
-
1686
- .animated.flip {
1687
- -webkit-backface-visibility: visible;
1688
- -ms-backface-visibility: visible;
1689
- backface-visibility: visible;
1690
- -webkit-animation-name: flip;
1691
- animation-name: flip;
1692
- }
1693
-
1694
- @-webkit-keyframes flipInX {
1695
- 0% {
1696
- -webkit-transform: perspective(400px) rotateX(90deg);
1697
- transform: perspective(400px) rotateX(90deg);
1698
- opacity: 0;
1699
- }
1700
-
1701
- 40% {
1702
- -webkit-transform: perspective(400px) rotateX(-10deg);
1703
- transform: perspective(400px) rotateX(-10deg);
1704
- }
1705
-
1706
- 70% {
1707
- -webkit-transform: perspective(400px) rotateX(10deg);
1708
- transform: perspective(400px) rotateX(10deg);
1709
- }
1710
-
1711
- 100% {
1712
- -webkit-transform: perspective(400px) rotateX(0deg);
1713
- transform: perspective(400px) rotateX(0deg);
1714
- opacity: 1;
1715
- }
1716
- }
1717
-
1718
- @keyframes flipInX {
1719
- 0% {
1720
- -webkit-transform: perspective(400px) rotateX(90deg);
1721
- -ms-transform: perspective(400px) rotateX(90deg);
1722
- transform: perspective(400px) rotateX(90deg);
1723
- opacity: 0;
1724
- }
1725
-
1726
- 40% {
1727
- -webkit-transform: perspective(400px) rotateX(-10deg);
1728
- -ms-transform: perspective(400px) rotateX(-10deg);
1729
- transform: perspective(400px) rotateX(-10deg);
1730
- }
1731
-
1732
- 70% {
1733
- -webkit-transform: perspective(400px) rotateX(10deg);
1734
- -ms-transform: perspective(400px) rotateX(10deg);
1735
- transform: perspective(400px) rotateX(10deg);
1736
- }
1737
-
1738
- 100% {
1739
- -webkit-transform: perspective(400px) rotateX(0deg);
1740
- -ms-transform: perspective(400px) rotateX(0deg);
1741
- transform: perspective(400px) rotateX(0deg);
1742
- opacity: 1;
1743
- }
1744
- }
1745
-
1746
- .flipInX {
1747
- -webkit-backface-visibility: visible !important;
1748
- -ms-backface-visibility: visible !important;
1749
- backface-visibility: visible !important;
1750
- -webkit-animation-name: flipInX;
1751
- animation-name: flipInX;
1752
- }
1753
-
1754
- @-webkit-keyframes flipInY {
1755
- 0% {
1756
- -webkit-transform: perspective(400px) rotateY(90deg);
1757
- transform: perspective(400px) rotateY(90deg);
1758
- opacity: 0;
1759
- }
1760
-
1761
- 40% {
1762
- -webkit-transform: perspective(400px) rotateY(-10deg);
1763
- transform: perspective(400px) rotateY(-10deg);
1764
- }
1765
-
1766
- 70% {
1767
- -webkit-transform: perspective(400px) rotateY(10deg);
1768
- transform: perspective(400px) rotateY(10deg);
1769
- }
1770
-
1771
- 100% {
1772
- -webkit-transform: perspective(400px) rotateY(0deg);
1773
- transform: perspective(400px) rotateY(0deg);
1774
- opacity: 1;
1775
- }
1776
- }
1777
-
1778
- @keyframes flipInY {
1779
- 0% {
1780
- -webkit-transform: perspective(400px) rotateY(90deg);
1781
- -ms-transform: perspective(400px) rotateY(90deg);
1782
- transform: perspective(400px) rotateY(90deg);
1783
- opacity: 0;
1784
- }
1785
-
1786
- 40% {
1787
- -webkit-transform: perspective(400px) rotateY(-10deg);
1788
- -ms-transform: perspective(400px) rotateY(-10deg);
1789
- transform: perspective(400px) rotateY(-10deg);
1790
- }
1791
-
1792
- 70% {
1793
- -webkit-transform: perspective(400px) rotateY(10deg);
1794
- -ms-transform: perspective(400px) rotateY(10deg);
1795
- transform: perspective(400px) rotateY(10deg);
1796
- }
1797
-
1798
- 100% {
1799
- -webkit-transform: perspective(400px) rotateY(0deg);
1800
- -ms-transform: perspective(400px) rotateY(0deg);
1801
- transform: perspective(400px) rotateY(0deg);
1802
- opacity: 1;
1803
- }
1804
- }
1805
-
1806
- .flipInY {
1807
- -webkit-backface-visibility: visible !important;
1808
- -ms-backface-visibility: visible !important;
1809
- backface-visibility: visible !important;
1810
- -webkit-animation-name: flipInY;
1811
- animation-name: flipInY;
1812
- }
1813
-
1814
- @-webkit-keyframes flipOutX {
1815
- 0% {
1816
- -webkit-transform: perspective(400px) rotateX(0deg);
1817
- transform: perspective(400px) rotateX(0deg);
1818
- opacity: 1;
1819
- }
1820
-
1821
- 100% {
1822
- -webkit-transform: perspective(400px) rotateX(90deg);
1823
- transform: perspective(400px) rotateX(90deg);
1824
- opacity: 0;
1825
- }
1826
- }
1827
-
1828
- @keyframes flipOutX {
1829
- 0% {
1830
- -webkit-transform: perspective(400px) rotateX(0deg);
1831
- -ms-transform: perspective(400px) rotateX(0deg);
1832
- transform: perspective(400px) rotateX(0deg);
1833
- opacity: 1;
1834
- }
1835
-
1836
- 100% {
1837
- -webkit-transform: perspective(400px) rotateX(90deg);
1838
- -ms-transform: perspective(400px) rotateX(90deg);
1839
- transform: perspective(400px) rotateX(90deg);
1840
- opacity: 0;
1841
- }
1842
- }
1843
-
1844
- .flipOutX {
1845
- -webkit-animation-name: flipOutX;
1846
- animation-name: flipOutX;
1847
- -webkit-backface-visibility: visible !important;
1848
- -ms-backface-visibility: visible !important;
1849
- backface-visibility: visible !important;
1850
- }
1851
-
1852
- @-webkit-keyframes flipOutY {
1853
- 0% {
1854
- -webkit-transform: perspective(400px) rotateY(0deg);
1855
- transform: perspective(400px) rotateY(0deg);
1856
- opacity: 1;
1857
- }
1858
-
1859
- 100% {
1860
- -webkit-transform: perspective(400px) rotateY(90deg);
1861
- transform: perspective(400px) rotateY(90deg);
1862
- opacity: 0;
1863
- }
1864
- }
1865
-
1866
- @keyframes flipOutY {
1867
- 0% {
1868
- -webkit-transform: perspective(400px) rotateY(0deg);
1869
- -ms-transform: perspective(400px) rotateY(0deg);
1870
- transform: perspective(400px) rotateY(0deg);
1871
- opacity: 1;
1872
- }
1873
-
1874
- 100% {
1875
- -webkit-transform: perspective(400px) rotateY(90deg);
1876
- -ms-transform: perspective(400px) rotateY(90deg);
1877
- transform: perspective(400px) rotateY(90deg);
1878
- opacity: 0;
1879
- }
1880
- }
1881
-
1882
- .flipOutY {
1883
- -webkit-backface-visibility: visible !important;
1884
- -ms-backface-visibility: visible !important;
1885
- backface-visibility: visible !important;
1886
- -webkit-animation-name: flipOutY;
1887
- animation-name: flipOutY;
1888
- }
1889
-
1890
- @-webkit-keyframes lightSpeedIn {
1891
- 0% {
1892
- -webkit-transform: translateX(100%) skewX(-30deg);
1893
- transform: translateX(100%) skewX(-30deg);
1894
- opacity: 0;
1895
- }
1896
-
1897
- 60% {
1898
- -webkit-transform: translateX(-20%) skewX(30deg);
1899
- transform: translateX(-20%) skewX(30deg);
1900
- opacity: 1;
1901
- }
1902
-
1903
- 80% {
1904
- -webkit-transform: translateX(0%) skewX(-15deg);
1905
- transform: translateX(0%) skewX(-15deg);
1906
- opacity: 1;
1907
- }
1908
-
1909
- 100% {
1910
- -webkit-transform: translateX(0%) skewX(0deg);
1911
- transform: translateX(0%) skewX(0deg);
1912
- opacity: 1;
1913
- }
1914
- }
1915
-
1916
- @keyframes lightSpeedIn {
1917
- 0% {
1918
- -webkit-transform: translateX(100%) skewX(-30deg);
1919
- -ms-transform: translateX(100%) skewX(-30deg);
1920
- transform: translateX(100%) skewX(-30deg);
1921
- opacity: 0;
1922
- }
1923
-
1924
- 60% {
1925
- -webkit-transform: translateX(-20%) skewX(30deg);
1926
- -ms-transform: translateX(-20%) skewX(30deg);
1927
- transform: translateX(-20%) skewX(30deg);
1928
- opacity: 1;
1929
- }
1930
-
1931
- 80% {
1932
- -webkit-transform: translateX(0%) skewX(-15deg);
1933
- -ms-transform: translateX(0%) skewX(-15deg);
1934
- transform: translateX(0%) skewX(-15deg);
1935
- opacity: 1;
1936
- }
1937
-
1938
- 100% {
1939
- -webkit-transform: translateX(0%) skewX(0deg);
1940
- -ms-transform: translateX(0%) skewX(0deg);
1941
- transform: translateX(0%) skewX(0deg);
1942
- opacity: 1;
1943
- }
1944
- }
1945
-
1946
- .lightSpeedIn {
1947
- -webkit-animation-name: lightSpeedIn;
1948
- animation-name: lightSpeedIn;
1949
- -webkit-animation-timing-function: ease-out;
1950
- animation-timing-function: ease-out;
1951
- }
1952
-
1953
- @-webkit-keyframes lightSpeedOut {
1954
- 0% {
1955
- -webkit-transform: translateX(0%) skewX(0deg);
1956
- transform: translateX(0%) skewX(0deg);
1957
- opacity: 1;
1958
- }
1959
-
1960
- 100% {
1961
- -webkit-transform: translateX(100%) skewX(-30deg);
1962
- transform: translateX(100%) skewX(-30deg);
1963
- opacity: 0;
1964
- }
1965
- }
1966
-
1967
- @keyframes lightSpeedOut {
1968
- 0% {
1969
- -webkit-transform: translateX(0%) skewX(0deg);
1970
- -ms-transform: translateX(0%) skewX(0deg);
1971
- transform: translateX(0%) skewX(0deg);
1972
- opacity: 1;
1973
- }
1974
-
1975
- 100% {
1976
- -webkit-transform: translateX(100%) skewX(-30deg);
1977
- -ms-transform: translateX(100%) skewX(-30deg);
1978
- transform: translateX(100%) skewX(-30deg);
1979
- opacity: 0;
1980
- }
1981
- }
1982
-
1983
- .lightSpeedOut {
1984
- -webkit-animation-name: lightSpeedOut;
1985
- animation-name: lightSpeedOut;
1986
- -webkit-animation-timing-function: ease-in;
1987
- animation-timing-function: ease-in;
1988
- }
1989
-
1990
- @-webkit-keyframes rotateIn {
1991
- 0% {
1992
- -webkit-transform-origin: center center;
1993
- transform-origin: center center;
1994
- -webkit-transform: rotate(-200deg);
1995
- transform: rotate(-200deg);
1996
- opacity: 0;
1997
- }
1998
-
1999
- 100% {
2000
- -webkit-transform-origin: center center;
2001
- transform-origin: center center;
2002
- -webkit-transform: rotate(0);
2003
- transform: rotate(0);
2004
- opacity: 1;
2005
- }
2006
- }
2007
-
2008
- @keyframes rotateIn {
2009
- 0% {
2010
- -webkit-transform-origin: center center;
2011
- -ms-transform-origin: center center;
2012
- transform-origin: center center;
2013
- -webkit-transform: rotate(-200deg);
2014
- -ms-transform: rotate(-200deg);
2015
- transform: rotate(-200deg);
2016
- opacity: 0;
2017
- }
2018
-
2019
- 100% {
2020
- -webkit-transform-origin: center center;
2021
- -ms-transform-origin: center center;
2022
- transform-origin: center center;
2023
- -webkit-transform: rotate(0);
2024
- -ms-transform: rotate(0);
2025
- transform: rotate(0);
2026
- opacity: 1;
2027
- }
2028
- }
2029
-
2030
- .rotateIn {
2031
- -webkit-animation-name: rotateIn;
2032
- animation-name: rotateIn;
2033
- }
2034
-
2035
- @-webkit-keyframes rotateInDownLeft {
2036
- 0% {
2037
- -webkit-transform-origin: left bottom;
2038
- transform-origin: left bottom;
2039
- -webkit-transform: rotate(-90deg);
2040
- transform: rotate(-90deg);
2041
- opacity: 0;
2042
- }
2043
-
2044
- 100% {
2045
- -webkit-transform-origin: left bottom;
2046
- transform-origin: left bottom;
2047
- -webkit-transform: rotate(0);
2048
- transform: rotate(0);
2049
- opacity: 1;
2050
- }
2051
- }
2052
-
2053
- @keyframes rotateInDownLeft {
2054
- 0% {
2055
- -webkit-transform-origin: left bottom;
2056
- -ms-transform-origin: left bottom;
2057
- transform-origin: left bottom;
2058
- -webkit-transform: rotate(-90deg);
2059
- -ms-transform: rotate(-90deg);
2060
- transform: rotate(-90deg);
2061
- opacity: 0;
2062
- }
2063
-
2064
- 100% {
2065
- -webkit-transform-origin: left bottom;
2066
- -ms-transform-origin: left bottom;
2067
- transform-origin: left bottom;
2068
- -webkit-transform: rotate(0);
2069
- -ms-transform: rotate(0);
2070
- transform: rotate(0);
2071
- opacity: 1;
2072
- }
2073
- }
2074
-
2075
- .rotateInDownLeft {
2076
- -webkit-animation-name: rotateInDownLeft;
2077
- animation-name: rotateInDownLeft;
2078
- }
2079
-
2080
- @-webkit-keyframes rotateInDownRight {
2081
- 0% {
2082
- -webkit-transform-origin: right bottom;
2083
- transform-origin: right bottom;
2084
- -webkit-transform: rotate(90deg);
2085
- transform: rotate(90deg);
2086
- opacity: 0;
2087
- }
2088
-
2089
- 100% {
2090
- -webkit-transform-origin: right bottom;
2091
- transform-origin: right bottom;
2092
- -webkit-transform: rotate(0);
2093
- transform: rotate(0);
2094
- opacity: 1;
2095
- }
2096
- }
2097
-
2098
- @keyframes rotateInDownRight {
2099
- 0% {
2100
- -webkit-transform-origin: right bottom;
2101
- -ms-transform-origin: right bottom;
2102
- transform-origin: right bottom;
2103
- -webkit-transform: rotate(90deg);
2104
- -ms-transform: rotate(90deg);
2105
- transform: rotate(90deg);
2106
- opacity: 0;
2107
- }
2108
-
2109
- 100% {
2110
- -webkit-transform-origin: right bottom;
2111
- -ms-transform-origin: right bottom;
2112
- transform-origin: right bottom;
2113
- -webkit-transform: rotate(0);
2114
- -ms-transform: rotate(0);
2115
- transform: rotate(0);
2116
- opacity: 1;
2117
- }
2118
- }
2119
-
2120
- .rotateInDownRight {
2121
- -webkit-animation-name: rotateInDownRight;
2122
- animation-name: rotateInDownRight;
2123
- }
2124
-
2125
- @-webkit-keyframes rotateInUpLeft {
2126
- 0% {
2127
- -webkit-transform-origin: left bottom;
2128
- transform-origin: left bottom;
2129
- -webkit-transform: rotate(90deg);
2130
- transform: rotate(90deg);
2131
- opacity: 0;
2132
- }
2133
-
2134
- 100% {
2135
- -webkit-transform-origin: left bottom;
2136
- transform-origin: left bottom;
2137
- -webkit-transform: rotate(0);
2138
- transform: rotate(0);
2139
- opacity: 1;
2140
- }
2141
- }
2142
-
2143
- @keyframes rotateInUpLeft {
2144
- 0% {
2145
- -webkit-transform-origin: left bottom;
2146
- -ms-transform-origin: left bottom;
2147
- transform-origin: left bottom;
2148
- -webkit-transform: rotate(90deg);
2149
- -ms-transform: rotate(90deg);
2150
- transform: rotate(90deg);
2151
- opacity: 0;
2152
- }
2153
-
2154
- 100% {
2155
- -webkit-transform-origin: left bottom;
2156
- -ms-transform-origin: left bottom;
2157
- transform-origin: left bottom;
2158
- -webkit-transform: rotate(0);
2159
- -ms-transform: rotate(0);
2160
- transform: rotate(0);
2161
- opacity: 1;
2162
- }
2163
- }
2164
-
2165
- .rotateInUpLeft {
2166
- -webkit-animation-name: rotateInUpLeft;
2167
- animation-name: rotateInUpLeft;
2168
- }
2169
-
2170
- @-webkit-keyframes rotateInUpRight {
2171
- 0% {
2172
- -webkit-transform-origin: right bottom;
2173
- transform-origin: right bottom;
2174
- -webkit-transform: rotate(-90deg);
2175
- transform: rotate(-90deg);
2176
- opacity: 0;
2177
- }
2178
-
2179
- 100% {
2180
- -webkit-transform-origin: right bottom;
2181
- transform-origin: right bottom;
2182
- -webkit-transform: rotate(0);
2183
- transform: rotate(0);
2184
- opacity: 1;
2185
- }
2186
- }
2187
-
2188
- @keyframes rotateInUpRight {
2189
- 0% {
2190
- -webkit-transform-origin: right bottom;
2191
- -ms-transform-origin: right bottom;
2192
- transform-origin: right bottom;
2193
- -webkit-transform: rotate(-90deg);
2194
- -ms-transform: rotate(-90deg);
2195
- transform: rotate(-90deg);
2196
- opacity: 0;
2197
- }
2198
-
2199
- 100% {
2200
- -webkit-transform-origin: right bottom;
2201
- -ms-transform-origin: right bottom;
2202
- transform-origin: right bottom;
2203
- -webkit-transform: rotate(0);
2204
- -ms-transform: rotate(0);
2205
- transform: rotate(0);
2206
- opacity: 1;
2207
- }
2208
- }
2209
-
2210
- .rotateInUpRight {
2211
- -webkit-animation-name: rotateInUpRight;
2212
- animation-name: rotateInUpRight;
2213
- }
2214
-
2215
- @-webkit-keyframes rotateOut {
2216
- 0% {
2217
- -webkit-transform-origin: center center;
2218
- transform-origin: center center;
2219
- -webkit-transform: rotate(0);
2220
- transform: rotate(0);
2221
- opacity: 1;
2222
- }
2223
-
2224
- 100% {
2225
- -webkit-transform-origin: center center;
2226
- transform-origin: center center;
2227
- -webkit-transform: rotate(200deg);
2228
- transform: rotate(200deg);
2229
- opacity: 0;
2230
- }
2231
- }
2232
-
2233
- @keyframes rotateOut {
2234
- 0% {
2235
- -webkit-transform-origin: center center;
2236
- -ms-transform-origin: center center;
2237
- transform-origin: center center;
2238
- -webkit-transform: rotate(0);
2239
- -ms-transform: rotate(0);
2240
- transform: rotate(0);
2241
- opacity: 1;
2242
- }
2243
-
2244
- 100% {
2245
- -webkit-transform-origin: center center;
2246
- -ms-transform-origin: center center;
2247
- transform-origin: center center;
2248
- -webkit-transform: rotate(200deg);
2249
- -ms-transform: rotate(200deg);
2250
- transform: rotate(200deg);
2251
- opacity: 0;
2252
- }
2253
- }
2254
-
2255
- .rotateOut {
2256
- -webkit-animation-name: rotateOut;
2257
- animation-name: rotateOut;
2258
- }
2259
-
2260
- @-webkit-keyframes rotateOutDownLeft {
2261
- 0% {
2262
- -webkit-transform-origin: left bottom;
2263
- transform-origin: left bottom;
2264
- -webkit-transform: rotate(0);
2265
- transform: rotate(0);
2266
- opacity: 1;
2267
- }
2268
-
2269
- 100% {
2270
- -webkit-transform-origin: left bottom;
2271
- transform-origin: left bottom;
2272
- -webkit-transform: rotate(90deg);
2273
- transform: rotate(90deg);
2274
- opacity: 0;
2275
- }
2276
- }
2277
-
2278
- @keyframes rotateOutDownLeft {
2279
- 0% {
2280
- -webkit-transform-origin: left bottom;
2281
- -ms-transform-origin: left bottom;
2282
- transform-origin: left bottom;
2283
- -webkit-transform: rotate(0);
2284
- -ms-transform: rotate(0);
2285
- transform: rotate(0);
2286
- opacity: 1;
2287
- }
2288
-
2289
- 100% {
2290
- -webkit-transform-origin: left bottom;
2291
- -ms-transform-origin: left bottom;
2292
- transform-origin: left bottom;
2293
- -webkit-transform: rotate(90deg);
2294
- -ms-transform: rotate(90deg);
2295
- transform: rotate(90deg);
2296
- opacity: 0;
2297
- }
2298
- }
2299
-
2300
- .rotateOutDownLeft {
2301
- -webkit-animation-name: rotateOutDownLeft;
2302
- animation-name: rotateOutDownLeft;
2303
- }
2304
-
2305
- @-webkit-keyframes rotateOutDownRight {
2306
- 0% {
2307
- -webkit-transform-origin: right bottom;
2308
- transform-origin: right bottom;
2309
- -webkit-transform: rotate(0);
2310
- transform: rotate(0);
2311
- opacity: 1;
2312
- }
2313
-
2314
- 100% {
2315
- -webkit-transform-origin: right bottom;
2316
- transform-origin: right bottom;
2317
- -webkit-transform: rotate(-90deg);
2318
- transform: rotate(-90deg);
2319
- opacity: 0;
2320
- }
2321
- }
2322
-
2323
- @keyframes rotateOutDownRight {
2324
- 0% {
2325
- -webkit-transform-origin: right bottom;
2326
- -ms-transform-origin: right bottom;
2327
- transform-origin: right bottom;
2328
- -webkit-transform: rotate(0);
2329
- -ms-transform: rotate(0);
2330
- transform: rotate(0);
2331
- opacity: 1;
2332
- }
2333
-
2334
- 100% {
2335
- -webkit-transform-origin: right bottom;
2336
- -ms-transform-origin: right bottom;
2337
- transform-origin: right bottom;
2338
- -webkit-transform: rotate(-90deg);
2339
- -ms-transform: rotate(-90deg);
2340
- transform: rotate(-90deg);
2341
- opacity: 0;
2342
- }
2343
- }
2344
-
2345
- .rotateOutDownRight {
2346
- -webkit-animation-name: rotateOutDownRight;
2347
- animation-name: rotateOutDownRight;
2348
- }
2349
-
2350
- @-webkit-keyframes rotateOutUpLeft {
2351
- 0% {
2352
- -webkit-transform-origin: left bottom;
2353
- transform-origin: left bottom;
2354
- -webkit-transform: rotate(0);
2355
- transform: rotate(0);
2356
- opacity: 1;
2357
- }
2358
-
2359
- 100% {
2360
- -webkit-transform-origin: left bottom;
2361
- transform-origin: left bottom;
2362
- -webkit-transform: rotate(-90deg);
2363
- transform: rotate(-90deg);
2364
- opacity: 0;
2365
- }
2366
- }
2367
-
2368
- @keyframes rotateOutUpLeft {
2369
- 0% {
2370
- -webkit-transform-origin: left bottom;
2371
- -ms-transform-origin: left bottom;
2372
- transform-origin: left bottom;
2373
- -webkit-transform: rotate(0);
2374
- -ms-transform: rotate(0);
2375
- transform: rotate(0);
2376
- opacity: 1;
2377
- }
2378
-
2379
- 100% {
2380
- -webkit-transform-origin: left bottom;
2381
- -ms-transform-origin: left bottom;
2382
- transform-origin: left bottom;
2383
- -webkit-transform: rotate(-90deg);
2384
- -ms-transform: rotate(-90deg);
2385
- transform: rotate(-90deg);
2386
- opacity: 0;
2387
- }
2388
- }
2389
-
2390
- .rotateOutUpLeft {
2391
- -webkit-animation-name: rotateOutUpLeft;
2392
- animation-name: rotateOutUpLeft;
2393
- }
2394
-
2395
- @-webkit-keyframes rotateOutUpRight {
2396
- 0% {
2397
- -webkit-transform-origin: right bottom;
2398
- transform-origin: right bottom;
2399
- -webkit-transform: rotate(0);
2400
- transform: rotate(0);
2401
- opacity: 1;
2402
- }
2403
-
2404
- 100% {
2405
- -webkit-transform-origin: right bottom;
2406
- transform-origin: right bottom;
2407
- -webkit-transform: rotate(90deg);
2408
- transform: rotate(90deg);
2409
- opacity: 0;
2410
- }
2411
- }
2412
-
2413
- @keyframes rotateOutUpRight {
2414
- 0% {
2415
- -webkit-transform-origin: right bottom;
2416
- -ms-transform-origin: right bottom;
2417
- transform-origin: right bottom;
2418
- -webkit-transform: rotate(0);
2419
- -ms-transform: rotate(0);
2420
- transform: rotate(0);
2421
- opacity: 1;
2422
- }
2423
-
2424
- 100% {
2425
- -webkit-transform-origin: right bottom;
2426
- -ms-transform-origin: right bottom;
2427
- transform-origin: right bottom;
2428
- -webkit-transform: rotate(90deg);
2429
- -ms-transform: rotate(90deg);
2430
- transform: rotate(90deg);
2431
- opacity: 0;
2432
- }
2433
- }
2434
-
2435
- .rotateOutUpRight {
2436
- -webkit-animation-name: rotateOutUpRight;
2437
- animation-name: rotateOutUpRight;
2438
- }
2439
-
2440
- @-webkit-keyframes slideInDown {
2441
- 0% {
2442
- opacity: 0;
2443
- -webkit-transform: translateY(-2000px);
2444
- transform: translateY(-2000px);
2445
- }
2446
-
2447
- 100% {
2448
- -webkit-transform: translateY(0);
2449
- transform: translateY(0);
2450
- }
2451
- }
2452
-
2453
- @keyframes slideInDown {
2454
- 0% {
2455
- opacity: 0;
2456
- -webkit-transform: translateY(-2000px);
2457
- -ms-transform: translateY(-2000px);
2458
- transform: translateY(-2000px);
2459
- }
2460
-
2461
- 100% {
2462
- -webkit-transform: translateY(0);
2463
- -ms-transform: translateY(0);
2464
- transform: translateY(0);
2465
- }
2466
- }
2467
-
2468
- .slideInDown {
2469
- -webkit-animation-name: slideInDown;
2470
- animation-name: slideInDown;
2471
- }
2472
-
2473
- @-webkit-keyframes slideInLeft {
2474
- 0% {
2475
- opacity: 0;
2476
- -webkit-transform: translateX(-2000px);
2477
- transform: translateX(-2000px);
2478
- }
2479
-
2480
- 100% {
2481
- -webkit-transform: translateX(0);
2482
- transform: translateX(0);
2483
- }
2484
- }
2485
-
2486
- @keyframes slideInLeft {
2487
- 0% {
2488
- opacity: 0;
2489
- -webkit-transform: translateX(-2000px);
2490
- -ms-transform: translateX(-2000px);
2491
- transform: translateX(-2000px);
2492
- }
2493
-
2494
- 100% {
2495
- -webkit-transform: translateX(0);
2496
- -ms-transform: translateX(0);
2497
- transform: translateX(0);
2498
- }
2499
- }
2500
-
2501
- .slideInLeft {
2502
- -webkit-animation-name: slideInLeft;
2503
- animation-name: slideInLeft;
2504
- }
2505
-
2506
- @-webkit-keyframes slideInRight {
2507
- 0% {
2508
- opacity: 0;
2509
- -webkit-transform: translateX(2000px);
2510
- transform: translateX(2000px);
2511
- }
2512
-
2513
- 100% {
2514
- -webkit-transform: translateX(0);
2515
- transform: translateX(0);
2516
- }
2517
- }
2518
-
2519
- @keyframes slideInRight {
2520
- 0% {
2521
- opacity: 0;
2522
- -webkit-transform: translateX(2000px);
2523
- -ms-transform: translateX(2000px);
2524
- transform: translateX(2000px);
2525
- }
2526
-
2527
- 100% {
2528
- -webkit-transform: translateX(0);
2529
- -ms-transform: translateX(0);
2530
- transform: translateX(0);
2531
- }
2532
- }
2533
-
2534
- .slideInRight {
2535
- -webkit-animation-name: slideInRight;
2536
- animation-name: slideInRight;
2537
- }
2538
-
2539
- @-webkit-keyframes slideOutLeft {
2540
- 0% {
2541
- -webkit-transform: translateX(0);
2542
- transform: translateX(0);
2543
- }
2544
-
2545
- 100% {
2546
- opacity: 0;
2547
- -webkit-transform: translateX(-2000px);
2548
- transform: translateX(-2000px);
2549
- }
2550
- }
2551
-
2552
- @keyframes slideOutLeft {
2553
- 0% {
2554
- -webkit-transform: translateX(0);
2555
- -ms-transform: translateX(0);
2556
- transform: translateX(0);
2557
- }
2558
-
2559
- 100% {
2560
- opacity: 0;
2561
- -webkit-transform: translateX(-2000px);
2562
- -ms-transform: translateX(-2000px);
2563
- transform: translateX(-2000px);
2564
- }
2565
- }
2566
-
2567
- .slideOutLeft {
2568
- -webkit-animation-name: slideOutLeft;
2569
- animation-name: slideOutLeft;
2570
- }
2571
-
2572
- @-webkit-keyframes slideOutRight {
2573
- 0% {
2574
- -webkit-transform: translateX(0);
2575
- transform: translateX(0);
2576
- }
2577
-
2578
- 100% {
2579
- opacity: 0;
2580
- -webkit-transform: translateX(2000px);
2581
- transform: translateX(2000px);
2582
- }
2583
- }
2584
-
2585
- @keyframes slideOutRight {
2586
- 0% {
2587
- -webkit-transform: translateX(0);
2588
- -ms-transform: translateX(0);
2589
- transform: translateX(0);
2590
- }
2591
-
2592
- 100% {
2593
- opacity: 0;
2594
- -webkit-transform: translateX(2000px);
2595
- -ms-transform: translateX(2000px);
2596
- transform: translateX(2000px);
2597
- }
2598
- }
2599
-
2600
- .slideOutRight {
2601
- -webkit-animation-name: slideOutRight;
2602
- animation-name: slideOutRight;
2603
- }
2604
-
2605
- @-webkit-keyframes slideOutUp {
2606
- 0% {
2607
- -webkit-transform: translateY(0);
2608
- transform: translateY(0);
2609
- }
2610
-
2611
- 100% {
2612
- opacity: 0;
2613
- -webkit-transform: translateY(-2000px);
2614
- transform: translateY(-2000px);
2615
- }
2616
- }
2617
-
2618
- @keyframes slideOutUp {
2619
- 0% {
2620
- -webkit-transform: translateY(0);
2621
- -ms-transform: translateY(0);
2622
- transform: translateY(0);
2623
- }
2624
-
2625
- 100% {
2626
- opacity: 0;
2627
- -webkit-transform: translateY(-2000px);
2628
- -ms-transform: translateY(-2000px);
2629
- transform: translateY(-2000px);
2630
- }
2631
- }
2632
-
2633
- .slideOutUp {
2634
- -webkit-animation-name: slideOutUp;
2635
- animation-name: slideOutUp;
2636
- }
2637
-
2638
- @-webkit-keyframes slideInUp {
2639
- 0% {
2640
- opacity: 0;
2641
- -webkit-transform: translateY(2000px);
2642
- transform: translateY(2000px);
2643
- }
2644
-
2645
- 100% {
2646
- opacity: 1;
2647
- -webkit-transform: translateY(0);
2648
- transform: translateY(0);
2649
- }
2650
- }
2651
-
2652
- @keyframes slideInUp {
2653
- 0% {
2654
- opacity: 0;
2655
- -webkit-transform: translateY(2000px);
2656
- -ms-transform: translateY(2000px);
2657
- transform: translateY(2000px);
2658
- }
2659
-
2660
- 100% {
2661
- opacity: 1;
2662
- -webkit-transform: translateY(0);
2663
- -ms-transform: translateY(0);
2664
- transform: translateY(0);
2665
- }
2666
- }
2667
-
2668
- .slideInUp {
2669
- -webkit-animation-name: slideInUp;
2670
- animation-name: slideInUp;
2671
- }
2672
-
2673
- @-webkit-keyframes slideOutDown {
2674
- 0% {
2675
- -webkit-transform: translateY(0);
2676
- transform: translateY(0);
2677
- }
2678
-
2679
- 100% {
2680
- opacity: 0;
2681
- -webkit-transform: translateY(2000px);
2682
- transform: translateY(2000px);
2683
- }
2684
- }
2685
-
2686
- @keyframes slideOutDown {
2687
- 0% {
2688
- -webkit-transform: translateY(0);
2689
- -ms-transform: translateY(0);
2690
- transform: translateY(0);
2691
- }
2692
-
2693
- 100% {
2694
- opacity: 0;
2695
- -webkit-transform: translateY(2000px);
2696
- -ms-transform: translateY(2000px);
2697
- transform: translateY(2000px);
2698
- }
2699
- }
2700
-
2701
- .slideOutDown {
2702
- -webkit-animation-name: slideOutDown;
2703
- animation-name: slideOutDown;
2704
- }
2705
-
2706
- @-webkit-keyframes hinge {
2707
- 0% {
2708
- -webkit-transform: rotate(0);
2709
- transform: rotate(0);
2710
- -webkit-transform-origin: top left;
2711
- transform-origin: top left;
2712
- -webkit-animation-timing-function: ease-in-out;
2713
- animation-timing-function: ease-in-out;
2714
- }
2715
-
2716
- 20%, 60% {
2717
- -webkit-transform: rotate(80deg);
2718
- transform: rotate(80deg);
2719
- -webkit-transform-origin: top left;
2720
- transform-origin: top left;
2721
- -webkit-animation-timing-function: ease-in-out;
2722
- animation-timing-function: ease-in-out;
2723
- }
2724
-
2725
- 40% {
2726
- -webkit-transform: rotate(60deg);
2727
- transform: rotate(60deg);
2728
- -webkit-transform-origin: top left;
2729
- transform-origin: top left;
2730
- -webkit-animation-timing-function: ease-in-out;
2731
- animation-timing-function: ease-in-out;
2732
- }
2733
-
2734
- 80% {
2735
- -webkit-transform: rotate(60deg) translateY(0);
2736
- transform: rotate(60deg) translateY(0);
2737
- -webkit-transform-origin: top left;
2738
- transform-origin: top left;
2739
- -webkit-animation-timing-function: ease-in-out;
2740
- animation-timing-function: ease-in-out;
2741
- opacity: 1;
2742
- }
2743
-
2744
- 100% {
2745
- -webkit-transform: translateY(700px);
2746
- transform: translateY(700px);
2747
- opacity: 0;
2748
- }
2749
- }
2750
-
2751
- @keyframes hinge {
2752
- 0% {
2753
- -webkit-transform: rotate(0);
2754
- -ms-transform: rotate(0);
2755
- transform: rotate(0);
2756
- -webkit-transform-origin: top left;
2757
- -ms-transform-origin: top left;
2758
- transform-origin: top left;
2759
- -webkit-animation-timing-function: ease-in-out;
2760
- animation-timing-function: ease-in-out;
2761
- }
2762
-
2763
- 20%, 60% {
2764
- -webkit-transform: rotate(80deg);
2765
- -ms-transform: rotate(80deg);
2766
- transform: rotate(80deg);
2767
- -webkit-transform-origin: top left;
2768
- -ms-transform-origin: top left;
2769
- transform-origin: top left;
2770
- -webkit-animation-timing-function: ease-in-out;
2771
- animation-timing-function: ease-in-out;
2772
- }
2773
-
2774
- 40% {
2775
- -webkit-transform: rotate(60deg);
2776
- -ms-transform: rotate(60deg);
2777
- transform: rotate(60deg);
2778
- -webkit-transform-origin: top left;
2779
- -ms-transform-origin: top left;
2780
- transform-origin: top left;
2781
- -webkit-animation-timing-function: ease-in-out;
2782
- animation-timing-function: ease-in-out;
2783
- }
2784
-
2785
- 80% {
2786
- -webkit-transform: rotate(60deg) translateY(0);
2787
- -ms-transform: rotate(60deg) translateY(0);
2788
- transform: rotate(60deg) translateY(0);
2789
- -webkit-transform-origin: top left;
2790
- -ms-transform-origin: top left;
2791
- transform-origin: top left;
2792
- -webkit-animation-timing-function: ease-in-out;
2793
- animation-timing-function: ease-in-out;
2794
- opacity: 1;
2795
- }
2796
-
2797
- 100% {
2798
- -webkit-transform: translateY(700px);
2799
- -ms-transform: translateY(700px);
2800
- transform: translateY(700px);
2801
- opacity: 0;
2802
- }
2803
- }
2804
-
2805
- .hinge {
2806
- -webkit-animation-name: hinge;
2807
- animation-name: hinge;
2808
- }
2809
-
2810
- /* originally authored by Nick Pettit - https://github.com/nickpettit/glide */
2811
-
2812
- @-webkit-keyframes rollIn {
2813
- 0% {
2814
- opacity: 0;
2815
- -webkit-transform: translateX(-100%) rotate(-120deg);
2816
- transform: translateX(-100%) rotate(-120deg);
2817
- }
2818
-
2819
- 100% {
2820
- opacity: 1;
2821
- -webkit-transform: translateX(0px) rotate(0deg);
2822
- transform: translateX(0px) rotate(0deg);
2823
- }
2824
- }
2825
-
2826
- @keyframes rollIn {
2827
- 0% {
2828
- opacity: 0;
2829
- -webkit-transform: translateX(-100%) rotate(-120deg);
2830
- -ms-transform: translateX(-100%) rotate(-120deg);
2831
- transform: translateX(-100%) rotate(-120deg);
2832
- }
2833
-
2834
- 100% {
2835
- opacity: 1;
2836
- -webkit-transform: translateX(0px) rotate(0deg);
2837
- -ms-transform: translateX(0px) rotate(0deg);
2838
- transform: translateX(0px) rotate(0deg);
2839
- }
2840
- }
2841
-
2842
- .rollIn {
2843
- -webkit-animation-name: rollIn;
2844
- animation-name: rollIn;
2845
- }
2846
-
2847
- /* originally authored by Nick Pettit - https://github.com/nickpettit/glide */
2848
-
2849
- @-webkit-keyframes rollOut {
2850
- 0% {
2851
- opacity: 1;
2852
- -webkit-transform: translateX(0px) rotate(0deg);
2853
- transform: translateX(0px) rotate(0deg);
2854
- }
2855
-
2856
- 100% {
2857
- opacity: 0;
2858
- -webkit-transform: translateX(100%) rotate(120deg);
2859
- transform: translateX(100%) rotate(120deg);
2860
- }
2861
- }
2862
-
2863
- @keyframes rollOut {
2864
- 0% {
2865
- opacity: 1;
2866
- -webkit-transform: translateX(0px) rotate(0deg);
2867
- -ms-transform: translateX(0px) rotate(0deg);
2868
- transform: translateX(0px) rotate(0deg);
2869
- }
2870
-
2871
- 100% {
2872
- opacity: 0;
2873
- -webkit-transform: translateX(100%) rotate(120deg);
2874
- -ms-transform: translateX(100%) rotate(120deg);
2875
- transform: translateX(100%) rotate(120deg);
2876
- }
2877
- }
2878
-
2879
- .rollOut {
2880
- -webkit-animation-name: rollOut;
2881
- animation-name: rollOut;
2882
- }
2883
-
2884
- @-webkit-keyframes zoomIn {
2885
- 0% {
2886
- opacity: 0;
2887
- -webkit-transform: scale(.3);
2888
- transform: scale(.3);
2889
- }
2890
-
2891
- 50% {
2892
- opacity: 1;
2893
- }
2894
- }
2895
-
2896
- @keyframes zoomIn {
2897
- 0% {
2898
- opacity: 0;
2899
- -webkit-transform: scale(.3);
2900
- -ms-transform: scale(.3);
2901
- transform: scale(.3);
2902
- }
2903
-
2904
- 50% {
2905
- opacity: 1;
2906
- }
2907
- }
2908
-
2909
- .zoomIn {
2910
- -webkit-animation-name: zoomIn;
2911
- animation-name: zoomIn;
2912
- }
2913
-
2914
- @-webkit-keyframes zoomInDown {
2915
- 0% {
2916
- opacity: 0;
2917
- -webkit-transform: scale(.1) translateY(-2000px);
2918
- transform: scale(.1) translateY(-2000px);
2919
- -webkit-animation-timing-function: ease-in-out;
2920
- animation-timing-function: ease-in-out;
2921
- }
2922
-
2923
- 60% {
2924
- opacity: 1;
2925
- -webkit-transform: scale(.475) translateY(60px);
2926
- transform: scale(.475) translateY(60px);
2927
- -webkit-animation-timing-function: ease-out;
2928
- animation-timing-function: ease-out;
2929
- }
2930
- }
2931
-
2932
- @keyframes zoomInDown {
2933
- 0% {
2934
- opacity: 0;
2935
- -webkit-transform: scale(.1) translateY(-2000px);
2936
- -ms-transform: scale(.1) translateY(-2000px);
2937
- transform: scale(.1) translateY(-2000px);
2938
- -webkit-animation-timing-function: ease-in-out;
2939
- animation-timing-function: ease-in-out;
2940
- }
2941
-
2942
- 60% {
2943
- opacity: 1;
2944
- -webkit-transform: scale(.475) translateY(60px);
2945
- -ms-transform: scale(.475) translateY(60px);
2946
- transform: scale(.475) translateY(60px);
2947
- -webkit-animation-timing-function: ease-out;
2948
- animation-timing-function: ease-out;
2949
- }
2950
- }
2951
-
2952
- .zoomInDown {
2953
- -webkit-animation-name: zoomInDown;
2954
- animation-name: zoomInDown;
2955
- }
2956
-
2957
- @-webkit-keyframes zoomInLeft {
2958
- 0% {
2959
- opacity: 0;
2960
- -webkit-transform: scale(.1) translateX(-2000px);
2961
- transform: scale(.1) translateX(-2000px);
2962
- -webkit-animation-timing-function: ease-in-out;
2963
- animation-timing-function: ease-in-out;
2964
- }
2965
-
2966
- 60% {
2967
- opacity: 1;
2968
- -webkit-transform: scale(.475) translateX(48px);
2969
- transform: scale(.475) translateX(48px);
2970
- -webkit-animation-timing-function: ease-out;
2971
- animation-timing-function: ease-out;
2972
- }
2973
- }
2974
-
2975
- @keyframes zoomInLeft {
2976
- 0% {
2977
- opacity: 0;
2978
- -webkit-transform: scale(.1) translateX(-2000px);
2979
- -ms-transform: scale(.1) translateX(-2000px);
2980
- transform: scale(.1) translateX(-2000px);
2981
- -webkit-animation-timing-function: ease-in-out;
2982
- animation-timing-function: ease-in-out;
2983
- }
2984
-
2985
- 60% {
2986
- opacity: 1;
2987
- -webkit-transform: scale(.475) translateX(48px);
2988
- -ms-transform: scale(.475) translateX(48px);
2989
- transform: scale(.475) translateX(48px);
2990
- -webkit-animation-timing-function: ease-out;
2991
- animation-timing-function: ease-out;
2992
- }
2993
- }
2994
-
2995
- .zoomInLeft {
2996
- -webkit-animation-name: zoomInLeft;
2997
- animation-name: zoomInLeft;
2998
- }
2999
-
3000
- @-webkit-keyframes zoomInRight {
3001
- 0% {
3002
- opacity: 0;
3003
- -webkit-transform: scale(.1) translateX(2000px);
3004
- transform: scale(.1) translateX(2000px);
3005
- -webkit-animation-timing-function: ease-in-out;
3006
- animation-timing-function: ease-in-out;
3007
- }
3008
-
3009
- 60% {
3010
- opacity: 1;
3011
- -webkit-transform: scale(.475) translateX(-48px);
3012
- transform: scale(.475) translateX(-48px);
3013
- -webkit-animation-timing-function: ease-out;
3014
- animation-timing-function: ease-out;
3015
- }
3016
- }
3017
-
3018
- @keyframes zoomInRight {
3019
- 0% {
3020
- opacity: 0;
3021
- -webkit-transform: scale(.1) translateX(2000px);
3022
- -ms-transform: scale(.1) translateX(2000px);
3023
- transform: scale(.1) translateX(2000px);
3024
- -webkit-animation-timing-function: ease-in-out;
3025
- animation-timing-function: ease-in-out;
3026
- }
3027
-
3028
- 60% {
3029
- opacity: 1;
3030
- -webkit-transform: scale(.475) translateX(-48px);
3031
- -ms-transform: scale(.475) translateX(-48px);
3032
- transform: scale(.475) translateX(-48px);
3033
- -webkit-animation-timing-function: ease-out;
3034
- animation-timing-function: ease-out;
3035
- }
3036
- }
3037
-
3038
- .zoomInRight {
3039
- -webkit-animation-name: zoomInRight;
3040
- animation-name: zoomInRight;
3041
- }
3042
-
3043
- @-webkit-keyframes zoomInUp {
3044
- 0% {
3045
- opacity: 0;
3046
- -webkit-transform: scale(.1) translateY(2000px);
3047
- transform: scale(.1) translateY(2000px);
3048
- -webkit-animation-timing-function: ease-in-out;
3049
- animation-timing-function: ease-in-out;
3050
- }
3051
-
3052
- 60% {
3053
- opacity: 1;
3054
- -webkit-transform: scale(.475) translateY(-60px);
3055
- transform: scale(.475) translateY(-60px);
3056
- -webkit-animation-timing-function: ease-out;
3057
- animation-timing-function: ease-out;
3058
- }
3059
- }
3060
-
3061
- @keyframes zoomInUp {
3062
- 0% {
3063
- opacity: 0;
3064
- -webkit-transform: scale(.1) translateY(2000px);
3065
- -ms-transform: scale(.1) translateY(2000px);
3066
- transform: scale(.1) translateY(2000px);
3067
- -webkit-animation-timing-function: ease-in-out;
3068
- animation-timing-function: ease-in-out;
3069
- }
3070
-
3071
- 60% {
3072
- opacity: 1;
3073
- -webkit-transform: scale(.475) translateY(-60px);
3074
- -ms-transform: scale(.475) translateY(-60px);
3075
- transform: scale(.475) translateY(-60px);
3076
- -webkit-animation-timing-function: ease-out;
3077
- animation-timing-function: ease-out;
3078
- }
3079
- }
3080
-
3081
- .zoomInUp {
3082
- -webkit-animation-name: zoomInUp;
3083
- animation-name: zoomInUp;
3084
- }
3085
-
3086
- @-webkit-keyframes zoomOut {
3087
- 0% {
3088
- opacity: 1;
3089
- -webkit-transform: scale(1);
3090
- transform: scale(1);
3091
- }
3092
-
3093
- 50% {
3094
- opacity: 0;
3095
- -webkit-transform: scale(.3);
3096
- transform: scale(.3);
3097
- }
3098
-
3099
- 100% {
3100
- opacity: 0;
3101
- }
3102
- }
3103
-
3104
- @keyframes zoomOut {
3105
- 0% {
3106
- opacity: 1;
3107
- -webkit-transform: scale(1);
3108
- -ms-transform: scale(1);
3109
- transform: scale(1);
3110
- }
3111
-
3112
- 50% {
3113
- opacity: 0;
3114
- -webkit-transform: scale(.3);
3115
- -ms-transform: scale(.3);
3116
- transform: scale(.3);
3117
- }
3118
-
3119
- 100% {
3120
- opacity: 0;
3121
- }
3122
- }
3123
-
3124
- .zoomOut {
3125
- -webkit-animation-name: zoomOut;
3126
- animation-name: zoomOut;
3127
- }
3128
-
3129
- @-webkit-keyframes zoomOutDown {
3130
- 40% {
3131
- opacity: 1;
3132
- -webkit-transform: scale(.475) translateY(-60px);
3133
- transform: scale(.475) translateY(-60px);
3134
- -webkit-animation-timing-function: linear;
3135
- animation-timing-function: linear;
3136
- }
3137
-
3138
- 100% {
3139
- opacity: 0;
3140
- -webkit-transform: scale(.1) translateY(2000px);
3141
- transform: scale(.1) translateY(2000px);
3142
- -webkit-transform-origin: center bottom;
3143
- transform-origin: center bottom;
3144
- }
3145
- }
3146
-
3147
- @keyframes zoomOutDown {
3148
- 40% {
3149
- opacity: 1;
3150
- -webkit-transform: scale(.475) translateY(-60px);
3151
- -ms-transform: scale(.475) translateY(-60px);
3152
- transform: scale(.475) translateY(-60px);
3153
- -webkit-animation-timing-function: linear;
3154
- animation-timing-function: linear;
3155
- }
3156
-
3157
- 100% {
3158
- opacity: 0;
3159
- -webkit-transform: scale(.1) translateY(2000px);
3160
- -ms-transform: scale(.1) translateY(2000px);
3161
- transform: scale(.1) translateY(2000px);
3162
- -webkit-transform-origin: center bottom;
3163
- -ms-transform-origin: center bottom;
3164
- transform-origin: center bottom;
3165
- }
3166
- }
3167
-
3168
- .zoomOutDown {
3169
- -webkit-animation-name: zoomOutDown;
3170
- animation-name: zoomOutDown;
3171
- }
3172
-
3173
- @-webkit-keyframes zoomOutLeft {
3174
- 40% {
3175
- opacity: 1;
3176
- -webkit-transform: scale(.475) translateX(42px);
3177
- transform: scale(.475) translateX(42px);
3178
- -webkit-animation-timing-function: linear;
3179
- animation-timing-function: linear;
3180
- }
3181
-
3182
- 100% {
3183
- opacity: 0;
3184
- -webkit-transform: scale(.1) translateX(-2000px);
3185
- transform: scale(.1) translateX(-2000px);
3186
- -webkit-transform-origin: left center;
3187
- transform-origin: left center;
3188
- }
3189
- }
3190
-
3191
- @keyframes zoomOutLeft {
3192
- 40% {
3193
- opacity: 1;
3194
- -webkit-transform: scale(.475) translateX(42px);
3195
- -ms-transform: scale(.475) translateX(42px);
3196
- transform: scale(.475) translateX(42px);
3197
- -webkit-animation-timing-function: linear;
3198
- animation-timing-function: linear;
3199
- }
3200
-
3201
- 100% {
3202
- opacity: 0;
3203
- -webkit-transform: scale(.1) translateX(-2000px);
3204
- -ms-transform: scale(.1) translateX(-2000px);
3205
- transform: scale(.1) translateX(-2000px);
3206
- -webkit-transform-origin: left center;
3207
- -ms-transform-origin: left center;
3208
- transform-origin: left center;
3209
- }
3210
- }
3211
-
3212
- .zoomOutLeft {
3213
- -webkit-animation-name: zoomOutLeft;
3214
- animation-name: zoomOutLeft;
3215
- }
3216
-
3217
- @-webkit-keyframes zoomOutRight {
3218
- 40% {
3219
- opacity: 1;
3220
- -webkit-transform: scale(.475) translateX(-42px);
3221
- transform: scale(.475) translateX(-42px);
3222
- -webkit-animation-timing-function: linear;
3223
- animation-timing-function: linear;
3224
- }
3225
-
3226
- 100% {
3227
- opacity: 0;
3228
- -webkit-transform: scale(.1) translateX(2000px);
3229
- transform: scale(.1) translateX(2000px);
3230
- -webkit-transform-origin: right center;
3231
- transform-origin: right center;
3232
- }
3233
- }
3234
-
3235
- @keyframes zoomOutRight {
3236
- 40% {
3237
- opacity: 1;
3238
- -webkit-transform: scale(.475) translateX(-42px);
3239
- -ms-transform: scale(.475) translateX(-42px);
3240
- transform: scale(.475) translateX(-42px);
3241
- -webkit-animation-timing-function: linear;
3242
- animation-timing-function: linear;
3243
- }
3244
-
3245
- 100% {
3246
- opacity: 0;
3247
- -webkit-transform: scale(.1) translateX(2000px);
3248
- -ms-transform: scale(.1) translateX(2000px);
3249
- transform: scale(.1) translateX(2000px);
3250
- -webkit-transform-origin: right center;
3251
- -ms-transform-origin: right center;
3252
- transform-origin: right center;
3253
- }
3254
- }
3255
-
3256
- .zoomOutRight {
3257
- -webkit-animation-name: zoomOutRight;
3258
- animation-name: zoomOutRight;
3259
- }
3260
-
3261
- @-webkit-keyframes zoomOutUp {
3262
- 40% {
3263
- opacity: 1;
3264
- -webkit-transform: scale(.475) translateY(60px);
3265
- transform: scale(.475) translateY(60px);
3266
- -webkit-animation-timing-function: linear;
3267
- animation-timing-function: linear;
3268
- }
3269
-
3270
- 100% {
3271
- opacity: 0;
3272
- -webkit-transform: scale(.1) translateY(-2000px);
3273
- transform: scale(.1) translateY(-2000px);
3274
- -webkit-transform-origin: center top;
3275
- transform-origin: center top;
3276
- }
3277
- }
3278
-
3279
- @keyframes zoomOutUp {
3280
- 40% {
3281
- opacity: 1;
3282
- -webkit-transform: scale(.475) translateY(60px);
3283
- -ms-transform: scale(.475) translateY(60px);
3284
- transform: scale(.475) translateY(60px);
3285
- -webkit-animation-timing-function: linear;
3286
- animation-timing-function: linear;
3287
- }
3288
-
3289
- 100% {
3290
- opacity: 0;
3291
- -webkit-transform: scale(.1) translateY(-2000px);
3292
- -ms-transform: scale(.1) translateY(-2000px);
3293
- transform: scale(.1) translateY(-2000px);
3294
- -webkit-transform-origin: center top;
3295
- -ms-transform-origin: center top;
3296
- transform-origin: center top;
3297
- }
3298
- }
3299
-
3300
- .zoomOutUp {
3301
- -webkit-animation-name: zoomOutUp;
3302
- animation-name: zoomOutUp;
3303
  }
1
+ @charset "UTF-8";
2
+
3
+ /*!
4
+ Animate.css - http://daneden.me/animate
5
+ Licensed under the MIT license
6
+
7
+ Copyright (c) 2013 Daniel Eden
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14
+ */
15
+
16
+ .animated {
17
+ -webkit-animation-duration: 1s;
18
+ animation-duration: 1s;
19
+ -webkit-animation-fill-mode: both;
20
+ animation-fill-mode: both;
21
+ }
22
+
23
+ .animated.infinite {
24
+ -webkit-animation-iteration-count: infinite;
25
+ animation-iteration-count: infinite;
26
+ }
27
+
28
+ .animated.hinge {
29
+ -webkit-animation-duration: 2s;
30
+ animation-duration: 2s;
31
+ }
32
+
33
+ @-webkit-keyframes bounce {
34
+ 0%, 20%, 50%, 80%, 100% {
35
+ -webkit-transform: translateY(0);
36
+ transform: translateY(0);
37
+ }
38
+
39
+ 40% {
40
+ -webkit-transform: translateY(-30px);
41
+ transform: translateY(-30px);
42
+ }
43
+
44
+ 60% {
45
+ -webkit-transform: translateY(-15px);
46
+ transform: translateY(-15px);
47
+ }
48
+ }
49
+
50
+ @keyframes bounce {
51
+ 0%, 20%, 50%, 80%, 100% {
52
+ -webkit-transform: translateY(0);
53
+ -ms-transform: translateY(0);
54
+ transform: translateY(0);
55
+ }
56
+
57
+ 40% {
58
+ -webkit-transform: translateY(-30px);
59
+ -ms-transform: translateY(-30px);
60
+ transform: translateY(-30px);
61
+ }
62
+
63
+ 60% {
64
+ -webkit-transform: translateY(-15px);
65
+ -ms-transform: translateY(-15px);
66
+ transform: translateY(-15px);
67
+ }
68
+ }
69
+
70
+ .bounce {
71
+ -webkit-animation-name: bounce;
72
+ animation-name: bounce;
73
+ }
74
+
75
+ @-webkit-keyframes flash {
76
+ 0%, 50%, 100% {
77
+ opacity: 1;
78
+ }
79
+
80
+ 25%, 75% {
81
+ opacity: 0;
82
+ }
83
+ }
84
+
85
+ @keyframes flash {
86
+ 0%, 50%, 100% {
87
+ opacity: 1;
88
+ }
89
+
90
+ 25%, 75% {
91
+ opacity: 0;
92
+ }
93
+ }
94
+
95
+ .flash {
96
+ -webkit-animation-name: flash;
97
+ animation-name: flash;
98
+ }
99
+
100
+ /* originally authored by Nick Pettit - https://github.com/nickpettit/glide */
101
+
102
+ @-webkit-keyframes pulse {
103
+ 0% {
104
+ -webkit-transform: scale(1);
105
+ transform: scale(1);
106
+ }
107
+
108
+ 50% {
109
+ -webkit-transform: scale(1.1);
110
+ transform: scale(1.1);
111
+ }
112
+
113
+ 100% {
114
+ -webkit-transform: scale(1);
115
+ transform: scale(1);
116
+ }
117
+ }
118
+
119
+ @keyframes pulse {
120
+ 0% {
121
+ -webkit-transform: scale(1);
122
+ -ms-transform: scale(1);
123
+ transform: scale(1);
124
+ }
125
+
126
+ 50% {
127
+ -webkit-transform: scale(1.1);
128
+ -ms-transform: scale(1.1);
129
+ transform: scale(1.1);
130
+ }
131
+
132
+ 100% {
133
+ -webkit-transform: scale(1);
134
+ -ms-transform: scale(1);
135
+ transform: scale(1);
136
+ }
137
+ }
138
+
139
+ .pulse {
140
+ -webkit-animation-name: pulse;
141
+ animation-name: pulse;
142
+ }
143
+
144
+ @-webkit-keyframes rubberBand {
145
+ 0% {
146
+ -webkit-transform: scale(1);
147
+ transform: scale(1);
148
+ }
149
+
150
+ 30% {
151
+ -webkit-transform: scaleX(1.25) scaleY(0.75);
152
+ transform: scaleX(1.25) scaleY(0.75);
153
+ }
154
+
155
+ 40% {
156
+ -webkit-transform: scaleX(0.75) scaleY(1.25);
157
+ transform: scaleX(0.75) scaleY(1.25);
158
+ }
159
+
160
+ 60% {
161
+ -webkit-transform: scaleX(1.15) scaleY(0.85);
162
+ transform: scaleX(1.15) scaleY(0.85);
163
+ }
164
+
165
+ 100% {
166
+ -webkit-transform: scale(1);
167
+ transform: scale(1);
168
+ }
169
+ }
170
+
171
+ @keyframes rubberBand {
172
+ 0% {
173
+ -webkit-transform: scale(1);
174
+ -ms-transform: scale(1);
175
+ transform: scale(1);
176
+ }
177
+
178
+ 30% {
179
+ -webkit-transform: scaleX(1.25) scaleY(0.75);
180
+ -ms-transform: scaleX(1.25) scaleY(0.75);
181
+ transform: scaleX(1.25) scaleY(0.75);
182
+ }
183
+
184
+ 40% {
185
+ -webkit-transform: scaleX(0.75) scaleY(1.25);
186
+ -ms-transform: scaleX(0.75) scaleY(1.25);
187
+ transform: scaleX(0.75) scaleY(1.25);
188
+ }
189
+
190
+ 60% {
191
+ -webkit-transform: scaleX(1.15) scaleY(0.85);
192
+ -ms-transform: scaleX(1.15) scaleY(0.85);
193
+ transform: scaleX(1.15) scaleY(0.85);
194
+ }
195
+
196
+ 100% {
197
+ -webkit-transform: scale(1);
198
+ -ms-transform: scale(1);
199
+ transform: scale(1);
200
+ }
201
+ }
202
+
203
+ .rubberBand {
204
+ -webkit-animation-name: rubberBand;
205
+ animation-name: rubberBand;
206
+ }
207
+
208
+ @-webkit-keyframes shake {
209
+ 0%, 100% {
210
+ -webkit-transform: translateX(0);
211
+ transform: translateX(0);
212
+ }
213
+
214
+ 10%, 30%, 50%, 70%, 90% {
215
+ -webkit-transform: translateX(-10px);
216
+ transform: translateX(-10px);
217
+ }
218
+
219
+ 20%, 40%, 60%, 80% {
220
+ -webkit-transform: translateX(10px);
221
+ transform: translateX(10px);
222
+ }
223
+ }
224
+
225
+ @keyframes shake {
226
+ 0%, 100% {
227
+ -webkit-transform: translateX(0);
228
+ -ms-transform: translateX(0);
229
+ transform: translateX(0);
230
+ }
231
+
232
+ 10%, 30%, 50%, 70%, 90% {
233
+ -webkit-transform: translateX(-10px);
234
+ -ms-transform: translateX(-10px);
235
+ transform: translateX(-10px);
236
+ }
237
+
238
+ 20%, 40%, 60%, 80% {
239
+ -webkit-transform: translateX(10px);
240
+ -ms-transform: translateX(10px);
241
+ transform: translateX(10px);
242
+ }
243
+ }
244
+
245
+ .shake {
246
+ -webkit-animation-name: shake;
247
+ animation-name: shake;
248
+ }
249
+
250
+ @-webkit-keyframes swing {
251
+ 20% {
252
+ -webkit-transform: rotate(15deg);
253
+ transform: rotate(15deg);
254
+ }
255
+
256
+ 40% {
257
+ -webkit-transform: rotate(-10deg);
258
+ transform: rotate(-10deg);
259
+ }
260
+
261
+ 60% {
262
+ -webkit-transform: rotate(5deg);
263
+ transform: rotate(5deg);
264
+ }
265
+
266
+ 80% {
267
+ -webkit-transform: rotate(-5deg);
268
+ transform: rotate(-5deg);
269
+ }
270
+
271
+ 100% {
272
+ -webkit-transform: rotate(0deg);
273
+ transform: rotate(0deg);
274
+ }
275
+ }
276
+
277
+ @keyframes swing {
278
+ 20% {
279
+ -webkit-transform: rotate(15deg);
280
+ -ms-transform: rotate(15deg);
281
+ transform: rotate(15deg);
282
+ }
283
+
284
+ 40% {
285
+ -webkit-transform: rotate(-10deg);
286
+ -ms-transform: rotate(-10deg);
287
+ transform: rotate(-10deg);
288
+ }
289
+
290
+ 60% {
291
+ -webkit-transform: rotate(5deg);
292
+ -ms-transform: rotate(5deg);
293
+ transform: rotate(5deg);
294
+ }
295
+
296
+ 80% {
297
+ -webkit-transform: rotate(-5deg);
298
+ -ms-transform: rotate(-5deg);
299
+ transform: rotate(-5deg);
300
+ }
301
+
302
+ 100% {
303
+ -webkit-transform: rotate(0deg);
304
+ -ms-transform: rotate(0deg);
305
+ transform: rotate(0deg);
306
+ }
307
+ }
308
+
309
+ .swing {
310
+ -webkit-transform-origin: top center;
311
+ -ms-transform-origin: top center;
312
+ transform-origin: top center;
313
+ -webkit-animation-name: swing;
314
+ animation-name: swing;
315
+ }
316
+
317
+ @-webkit-keyframes tada {
318
+ 0% {
319
+ -webkit-transform: scale(1);
320
+ transform: scale(1);
321
+ }
322
+
323
+ 10%, 20% {
324
+ -webkit-transform: scale(0.9) rotate(-3deg);
325
+ transform: scale(0.9) rotate(-3deg);
326
+ }
327
+
328
+ 30%, 50%, 70%, 90% {
329
+ -webkit-transform: scale(1.1) rotate(3deg);
330
+ transform: scale(1.1) rotate(3deg);
331
+ }
332
+
333
+ 40%, 60%, 80% {
334
+ -webkit-transform: scale(1.1) rotate(-3deg);
335
+ transform: scale(1.1) rotate(-3deg);
336
+ }
337
+
338
+ 100% {
339
+ -webkit-transform: scale(1) rotate(0);
340
+ transform: scale(1) rotate(0);
341
+ }
342
+ }
343
+
344
+ @keyframes tada {
345
+ 0% {
346
+ -webkit-transform: scale(1);
347
+ -ms-transform: scale(1);
348
+ transform: scale(1);
349
+ }
350
+
351
+ 10%, 20% {
352
+ -webkit-transform: scale(0.9) rotate(-3deg);
353
+ -ms-transform: scale(0.9) rotate(-3deg);
354
+ transform: scale(0.9) rotate(-3deg);
355
+ }
356
+
357
+ 30%, 50%, 70%, 90% {
358
+ -webkit-transform: scale(1.1) rotate(3deg);
359
+ -ms-transform: scale(1.1) rotate(3deg);
360
+ transform: scale(1.1) rotate(3deg);
361
+ }
362
+
363
+ 40%, 60%, 80% {
364
+ -webkit-transform: scale(1.1) rotate(-3deg);
365
+ -ms-transform: scale(1.1) rotate(-3deg);
366
+ transform: scale(1.1) rotate(-3deg);
367
+ }
368
+
369
+ 100% {
370
+ -webkit-transform: scale(1) rotate(0);
371
+ -ms-transform: scale(1) rotate(0);
372
+ transform: scale(1) rotate(0);
373
+ }
374
+ }
375
+
376
+ .tada {
377
+ -webkit-animation-name: tada;
378
+ animation-name: tada;
379
+ }
380
+
381
+ /* originally authored by Nick Pettit - https://github.com/nickpettit/glide */
382
+
383
+ @-webkit-keyframes wobble {
384
+ 0% {
385
+ -webkit-transform: translateX(0%);
386
+ transform: translateX(0%);
387
+ }
388
+
389
+ 15% {
390
+ -webkit-transform: translateX(-25%) rotate(-5deg);
391
+ transform: translateX(-25%) rotate(-5deg);
392
+ }
393
+
394
+ 30% {
395
+ -webkit-transform: translateX(20%) rotate(3deg);
396
+ transform: translateX(20%) rotate(3deg);
397
+ }
398
+
399
+ 45% {
400
+ -webkit-transform: translateX(-15%) rotate(-3deg);
401
+ transform: translateX(-15%) rotate(-3deg);
402
+ }
403
+
404
+ 60% {
405
+ -webkit-transform: translateX(10%) rotate(2deg);
406
+ transform: translateX(10%) rotate(2deg);
407
+ }
408
+
409
+ 75% {
410
+ -webkit-transform: translateX(-5%) rotate(-1deg);
411
+ transform: translateX(-5%) rotate(-1deg);
412
+ }
413
+
414
+ 100% {
415
+ -webkit-transform: translateX(0%);
416
+ transform: translateX(0%);
417
+ }
418
+ }
419
+
420
+ @keyframes wobble {
421
+ 0% {
422
+ -webkit-transform: translateX(0%);
423
+ -ms-transform: translateX(0%);
424
+ transform: translateX(0%);
425
+ }
426
+
427
+ 15% {
428
+ -webkit-transform: translateX(-25%) rotate(-5deg);
429
+ -ms-transform: translateX(-25%) rotate(-5deg);
430
+ transform: translateX(-25%) rotate(-5deg);
431
+ }
432
+
433
+ 30% {
434
+ -webkit-transform: translateX(20%) rotate(3deg);
435
+ -ms-transform: translateX(20%) rotate(3deg);
436
+ transform: translateX(20%) rotate(3deg);
437
+ }
438
+
439
+ 45% {
440
+ -webkit-transform: translateX(-15%) rotate(-3deg);
441
+ -ms-transform: translateX(-15%) rotate(-3deg);
442
+ transform: translateX(-15%) rotate(-3deg);
443
+ }
444
+
445
+ 60% {
446
+ -webkit-transform: translateX(10%) rotate(2deg);
447
+ -ms-transform: translateX(10%) rotate(2deg);
448
+ transform: translateX(10%) rotate(2deg);
449
+ }
450
+
451
+ 75% {
452
+ -webkit-transform: translateX(-5%) rotate(-1deg);
453
+ -ms-transform: translateX(-5%) rotate(-1deg);
454
+ transform: translateX(-5%) rotate(-1deg);
455
+ }
456
+
457
+ 100% {
458
+ -webkit-transform: translateX(0%);
459
+ -ms-transform: translateX(0%);
460
+ transform: translateX(0%);
461
+ }
462
+ }
463
+
464
+ .wobble {
465
+ -webkit-animation-name: wobble;
466
+ animation-name: wobble;
467
+ }
468
+
469
+ @-webkit-keyframes bounceIn {
470
+ 0% {
471
+ opacity: 0;
472
+ -webkit-transform: scale(.3);
473
+ transform: scale(.3);
474
+ }
475
+
476
+ 50% {
477
+ opacity: 1;
478
+ -webkit-transform: scale(1.05);
479
+ transform: scale(1.05);
480
+ }
481
+
482
+ 70% {
483
+ -webkit-transform: scale(.9);
484
+ transform: scale(.9);
485
+ }
486
+
487
+ 100% {
488
+ opacity: 1;
489
+ -webkit-transform: scale(1);
490
+ transform: scale(1);
491
+ }
492
+ }
493
+
494
+ @keyframes bounceIn {
495
+ 0% {
496
+ opacity: 0;
497
+ -webkit-transform: scale(.3);
498
+ -ms-transform: scale(.3);
499
+ transform: scale(.3);
500
+ }
501
+
502
+ 50% {
503
+ opacity: 1;
504
+ -webkit-transform: scale(1.05);
505
+ -ms-transform: scale(1.05);
506
+ transform: scale(1.05);
507
+ }
508
+
509
+ 70% {
510
+ -webkit-transform: scale(.9);
511
+ -ms-transform: scale(.9);
512
+ transform: scale(.9);
513
+ }
514
+
515
+ 100% {
516
+ opacity: 1;
517
+ -webkit-transform: scale(1);
518
+ -ms-transform: scale(1);
519
+ transform: scale(1);
520
+ }
521
+ }
522
+
523
+ .bounceIn {
524
+ -webkit-animation-name: bounceIn;
525
+ animation-name: bounceIn;
526
+ }
527
+
528
+ @-webkit-keyframes bounceInDown {
529
+ 0% {
530
+ opacity: 0;
531
+ -webkit-transform: translateY(-2000px);
532
+ transform: translateY(-2000px);
533
+ }
534
+
535
+ 60% {
536
+ opacity: 1;
537
+ -webkit-transform: translateY(30px);
538
+ transform: translateY(30px);
539
+ }
540
+
541
+ 80% {
542
+ -webkit-transform: translateY(-10px);
543
+ transform: translateY(-10px);
544
+ }
545
+
546
+ 100% {
547
+ -webkit-transform: translateY(0);
548
+ transform: translateY(0);
549
+ }
550
+ }
551
+
552
+ @keyframes bounceInDown {
553
+ 0% {
554
+ opacity: 0;
555
+ -webkit-transform: translateY(-2000px);
556
+ -ms-transform: translateY(-2000px);
557
+ transform: translateY(-2000px);
558
+ }
559
+
560
+ 60% {
561
+ opacity: 1;
562
+ -webkit-transform: translateY(30px);
563
+ -ms-transform: translateY(30px);
564
+ transform: translateY(30px);
565
+ }
566
+
567
+ 80% {
568
+ -webkit-transform: translateY(-10px);
569
+ -ms-transform: translateY(-10px);
570
+ transform: translateY(-10px);
571
+ }
572
+
573
+ 100% {
574
+ -webkit-transform: translateY(0);
575
+ -ms-transform: translateY(0);
576
+ transform: translateY(0);
577
+ }
578
+ }
579
+
580
+ .bounceInDown {
581
+ -webkit-animation-name: bounceInDown;
582
+ animation-name: bounceInDown;
583
+ }
584
+
585
+ @-webkit-keyframes bounceInLeft {
586
+ 0% {
587
+ opacity: 0;
588
+ -webkit-transform: translateX(-2000px);
589
+ transform: translateX(-2000px);
590
+ }
591
+
592
+ 60% {
593
+ opacity: 1;
594
+ -webkit-transform: translateX(30px);
595
+ transform: translateX(30px);
596
+ }
597
+
598
+ 80% {
599
+ -webkit-transform: translateX(-10px);
600
+ transform: translateX(-10px);
601
+ }
602
+
603
+ 100% {
604
+ -webkit-transform: translateX(0);
605
+ transform: translateX(0);
606
+ }
607
+ }
608
+
609
+ @keyframes bounceInLeft {
610
+ 0% {
611
+ opacity: 0;
612
+ -webkit-transform: translateX(-2000px);
613
+ -ms-transform: translateX(-2000px);
614
+ transform: translateX(-2000px);
615
+ }
616
+
617
+ 60% {
618
+ opacity: 1;
619
+ -webkit-transform: translateX(30px);
620
+ -ms-transform: translateX(30px);
621
+ transform: translateX(30px);
622
+ }
623
+
624
+ 80% {
625
+ -webkit-transform: translateX(-10px);
626
+ -ms-transform: translateX(-10px);
627
+ transform: translateX(-10px);
628
+ }
629
+
630
+ 100% {
631
+ -webkit-transform: translateX(0);
632
+ -ms-transform: translateX(0);
633
+ transform: translateX(0);
634
+ }
635
+ }
636
+
637
+ .bounceInLeft {
638
+ -webkit-animation-name: bounceInLeft;
639
+ animation-name: bounceInLeft;
640
+ }
641
+
642
+ @-webkit-keyframes bounceInRight {
643
+ 0% {
644
+ opacity: 0;
645
+ -webkit-transform: translateX(2000px);
646
+ transform: translateX(2000px);
647
+ }
648
+
649
+ 60% {
650
+ opacity: 1;
651
+ -webkit-transform: translateX(-30px);
652
+ transform: translateX(-30px);
653
+ }
654
+
655
+ 80% {
656
+ -webkit-transform: translateX(10px);
657
+ transform: translateX(10px);
658
+ }
659
+
660
+ 100% {
661
+ -webkit-transform: translateX(0);
662
+ transform: translateX(0);
663
+ }
664
+ }
665
+
666
+ @keyframes bounceInRight {
667
+ 0% {
668
+ opacity: 0;
669
+ -webkit-transform: translateX(2000px);
670
+ -ms-transform: translateX(2000px);
671
+ transform: translateX(2000px);
672
+ }
673
+
674
+ 60% {
675
+ opacity: 1;
676
+ -webkit-transform: translateX(-30px);
677
+ -ms-transform: translateX(-30px);
678
+ transform: translateX(-30px);
679
+ }
680
+
681
+ 80% {
682
+ -webkit-transform: translateX(10px);
683
+ -ms-transform: translateX(10px);
684
+ transform: translateX(10px);
685
+ }
686
+
687
+ 100% {
688
+ -webkit-transform: translateX(0);
689
+ -ms-transform: translateX(0);
690
+ transform: translateX(0);
691
+ }
692
+ }
693
+
694
+ .bounceInRight {
695
+ -webkit-animation-name: bounceInRight;
696
+ animation-name: bounceInRight;
697
+ }
698
+
699
+ @-webkit-keyframes bounceInUp {
700
+ 0% {
701
+ opacity: 0;
702
+ -webkit-transform: translateY(2000px);
703
+ transform: translateY(2000px);
704
+ }
705
+
706
+ 60% {
707
+ opacity: 1;
708
+ -webkit-transform: translateY(-30px);
709
+ transform: translateY(-30px);
710
+ }
711
+
712
+ 80% {
713
+ -webkit-transform: translateY(10px);
714
+ transform: translateY(10px);
715
+ }
716
+
717
+ 100% {
718
+ -webkit-transform: translateY(0);
719
+ transform: translateY(0);
720
+ }
721
+ }
722
+
723
+ @keyframes bounceInUp {
724
+ 0% {
725
+ opacity: 0;
726
+ -webkit-transform: translateY(2000px);
727
+ -ms-transform: translateY(2000px);
728
+ transform: translateY(2000px);
729
+ }
730
+
731
+ 60% {
732
+ opacity: 1;
733
+ -webkit-transform: translateY(-30px);
734
+ -ms-transform: translateY(-30px);
735
+ transform: translateY(-30px);
736
+ }
737
+
738
+ 80% {
739
+ -webkit-transform: translateY(10px);
740
+ -ms-transform: translateY(10px);
741
+ transform: translateY(10px);
742
+ }
743
+
744
+ 100% {
745
+ -webkit-transform: translateY(0);
746
+ -ms-transform: translateY(0);
747
+ transform: translateY(0);
748
+ }
749
+ }
750
+
751
+ .bounceInUp {
752
+ -webkit-animation-name: bounceInUp;
753
+ animation-name: bounceInUp;
754
+ }
755
+
756
+ @-webkit-keyframes bounceOut {
757
+ 0% {
758
+ -webkit-transform: scale(1);
759
+ transform: scale(1);
760
+ }
761
+
762
+ 25% {
763
+ -webkit-transform: scale(.95);
764
+ transform: scale(.95);
765
+ }
766
+
767
+ 50% {
768
+ opacity: 1;
769
+ -webkit-transform: scale(1.1);
770
+ transform: scale(1.1);
771
+ }
772
+
773
+ 100% {
774
+ opacity: 0;
775
+ -webkit-transform: scale(.3);
776
+ transform: scale(.3);
777
+ }
778
+ }
779
+
780
+ @keyframes bounceOut {
781
+ 0% {
782
+ -webkit-transform: scale(1);
783
+ -ms-transform: scale(1);
784
+ transform: scale(1);
785
+ }
786
+
787
+ 25% {
788
+ -webkit-transform: scale(.95);
789
+ -ms-transform: scale(.95);
790
+ transform: scale(.95);
791
+ }
792
+
793
+ 50% {
794
+ opacity: 1;
795
+ -webkit-transform: scale(1.1);
796
+ -ms-transform: scale(1.1);
797
+ transform: scale(1.1);
798
+ }
799
+
800
+ 100% {
801
+ opacity: 0;
802
+ -webkit-transform: scale(.3);
803
+ -ms-transform: scale(.3);
804
+ transform: scale(.3);
805
+ }
806
+ }
807
+
808
+ .bounceOut {
809
+ -webkit-animation-name: bounceOut;
810
+ animation-name: bounceOut;
811
+ }
812
+
813
+ @-webkit-keyframes bounceOutDown {
814
+ 0% {
815
+ -webkit-transform: translateY(0);
816
+ transform: translateY(0);
817
+ }
818
+
819
+ 20% {
820
+ opacity: 1;
821
+ -webkit-transform: translateY(-20px);
822
+ transform: translateY(-20px);
823
+ }
824
+
825
+ 100% {
826
+ opacity: 0;
827
+ -webkit-transform: translateY(2000px);
828
+ transform: translateY(2000px);
829
+ }
830
+ }
831
+
832
+ @keyframes bounceOutDown {
833
+ 0% {
834
+ -webkit-transform: translateY(0);
835
+ -ms-transform: translateY(0);
836
+ transform: translateY(0);
837
+ }
838
+
839
+ 20% {
840
+ opacity: 1;
841
+ -webkit-transform: translateY(-20px);
842
+ -ms-transform: translateY(-20px);
843
+ transform: translateY(-20px);
844
+ }
845
+
846
+ 100% {
847
+ opacity: 0;
848
+ -webkit-transform: translateY(2000px);
849
+ -ms-transform: translateY(2000px);
850
+ transform: translateY(2000px);
851
+ }
852
+ }
853
+
854
+ .bounceOutDown {
855
+ -webkit-animation-name: bounceOutDown;
856
+ animation-name: bounceOutDown;
857
+ }
858
+
859
+ @-webkit-keyframes bounceOutLeft {
860
+ 0% {
861
+ -webkit-transform: translateX(0);
862
+ transform: translateX(0);
863
+ }
864
+
865
+ 20% {
866
+ opacity: 1;
867
+ -webkit-transform: translateX(20px);
868
+ transform: translateX(20px);
869
+ }
870
+
871
+ 100% {
872
+ opacity: 0;
873
+ -webkit-transform: translateX(-2000px);
874
+ transform: translateX(-2000px);
875
+ }
876
+ }
877
+
878
+ @keyframes bounceOutLeft {
879
+ 0% {
880
+ -webkit-transform: translateX(0);
881
+ -ms-transform: translateX(0);
882
+ transform: translateX(0);
883
+ }
884
+
885
+ 20% {
886
+ opacity: 1;
887
+ -webkit-transform: translateX(20px);
888
+ -ms-transform: translateX(20px);
889
+ transform: translateX(20px);
890
+ }
891
+
892
+ 100% {
893
+ opacity: 0;
894
+ -webkit-transform: translateX(-2000px);
895
+ -ms-transform: translateX(-2000px);
896
+ transform: translateX(-2000px);
897
+ }
898
+ }
899
+
900
+ .bounceOutLeft {
901
+ -webkit-animation-name: bounceOutLeft;
902
+ animation-name: bounceOutLeft;
903
+ }
904
+
905
+ @-webkit-keyframes bounceOutRight {
906
+ 0% {
907
+ -webkit-transform: translateX(0);
908
+ transform: translateX(0);
909
+ }
910
+
911
+ 20% {
912
+ opacity: 1;
913
+ -webkit-transform: translateX(-20px);
914
+ transform: translateX(-20px);
915
+ }
916
+
917
+ 100% {
918
+ opacity: 0;
919
+ -webkit-transform: translateX(2000px);
920
+ transform: translateX(2000px);
921
+ }
922
+ }
923
+
924
+ @keyframes bounceOutRight {
925
+ 0% {
926
+ -webkit-transform: translateX(0);
927
+ -ms-transform: translateX(0);
928
+ transform: translateX(0);
929
+ }
930
+
931
+ 20% {
932
+ opacity: 1;
933
+ -webkit-transform: translateX(-20px);
934
+ -ms-transform: translateX(-20px);
935
+ transform: translateX(-20px);
936
+ }
937
+
938
+ 100% {
939
+ opacity: 0;
940
+ -webkit-transform: translateX(2000px);
941
+ -ms-transform: translateX(2000px);
942
+ transform: translateX(2000px);
943
+ }
944
+ }
945
+
946
+ .bounceOutRight {
947
+ -webkit-animation-name: bounceOutRight;
948
+ animation-name: bounceOutRight;
949
+ }
950
+
951
+ @-webkit-keyframes bounceOutUp {
952
+ 0% {
953
+ -webkit-transform: translateY(0);
954
+ transform: translateY(0);
955
+ }
956
+
957
+ 20% {
958
+ opacity: 1;
959
+ -webkit-transform: translateY(20px);
960
+ transform: translateY(20px);
961
+ }
962
+
963
+ 100% {
964
+ opacity: 0;
965
+ -webkit-transform: translateY(-2000px);
966
+ transform: translateY(-2000px);
967
+ }
968
+ }
969
+
970
+ @keyframes bounceOutUp {
971
+ 0% {
972
+ -webkit-transform: translateY(0);
973
+ -ms-transform: translateY(0);
974
+ transform: translateY(0);
975
+ }
976
+
977
+ 20% {
978
+ opacity: 1;
979
+ -webkit-transform: translateY(20px);
980
+ -ms-transform: translateY(20px);
981
+ transform: translateY(20px);
982
+ }
983
+
984
+ 100% {
985
+ opacity: 0;
986
+ -webkit-transform: translateY(-2000px);
987
+ -ms-transform: translateY(-2000px);
988
+ transform: translateY(-2000px);
989
+ }
990
+ }
991
+
992
+ .bounceOutUp {
993
+ -webkit-animation-name: bounceOutUp;
994
+ animation-name: bounceOutUp;
995
+ }
996
+
997
+ @-webkit-keyframes fadeIn {
998
+ 0% {
999
+ opacity: 0;
1000
+ }
1001
+
1002
+ 100% {
1003
+ opacity: 1;
1004
+ }
1005
+ }
1006
+
1007
+ @keyframes fadeIn {
1008
+ 0% {
1009
+ opacity: 0;
1010
+ }
1011
+
1012
+ 100% {
1013
+ opacity: 1;
1014
+ }
1015
+ }
1016
+
1017
+ .fadeIn {
1018
+ -webkit-animation-name: fadeIn;
1019
+ animation-name: fadeIn;
1020
+ }
1021
+
1022
+ @-webkit-keyframes fadeInDown {
1023
+ 0% {
1024
+ opacity: 0;
1025
+ -webkit-transform: translateY(-20px);
1026
+ transform: translateY(-20px);
1027
+ }
1028
+
1029
+ 100% {
1030
+ opacity: 1;
1031
+ -webkit-transform: translateY(0);
1032
+ transform: translateY(0);
1033
+ }
1034
+ }
1035
+
1036
+ @keyframes fadeInDown {
1037
+ 0% {
1038
+ opacity: 0;
1039
+ -webkit-transform: translateY(-20px);
1040
+ -ms-transform: translateY(-20px);
1041
+ transform: translateY(-20px);
1042
+ }
1043
+
1044
+ 100% {
1045
+ opacity: 1;
1046
+ -webkit-transform: translateY(0);
1047
+ -ms-transform: translateY(0);
1048
+ transform: translateY(0);
1049
+ }
1050
+ }
1051
+
1052
+ .fadeInDown {
1053
+ -webkit-animation-name: fadeInDown;
1054
+ animation-name: fadeInDown;
1055
+ }
1056
+
1057
+ @-webkit-keyframes fadeInDownBig {
1058
+ 0% {
1059
+ opacity: 0;
1060
+ -webkit-transform: translateY(-2000px);
1061
+ transform: translateY(-2000px);
1062
+ }
1063
+
1064
+ 100% {
1065
+ opacity: 1;
1066
+ -webkit-transform: translateY(0);
1067
+ transform: translateY(0);
1068
+ }
1069
+ }
1070
+
1071
+ @keyframes fadeInDownBig {
1072
+ 0% {
1073
+ opacity: 0;
1074
+ -webkit-transform: translateY(-2000px);
1075
+ -ms-transform: translateY(-2000px);
1076
+ transform: translateY(-2000px);
1077
+ }
1078
+
1079
+ 100% {
1080
+ opacity: 1;
1081
+ -webkit-transform: translateY(0);
1082
+ -ms-transform: translateY(0);
1083
+ transform: translateY(0);
1084
+ }
1085
+ }
1086
+
1087
+ .fadeInDownBig {
1088
+ -webkit-animation-name: fadeInDownBig;
1089
+ animation-name: fadeInDownBig;
1090
+ }
1091
+
1092
+ @-webkit-keyframes fadeInLeft {
1093
+ 0% {
1094
+ opacity: 0;
1095
+ -webkit-transform: translateX(-20px);
1096
+ transform: translateX(-20px);
1097
+ }
1098
+
1099
+ 100% {
1100
+ opacity: 1;
1101
+ -webkit-transform: translateX(0);
1102
+ transform: translateX(0);
1103
+ }
1104
+ }
1105
+
1106
+ @keyframes fadeInLeft {
1107
+ 0% {
1108
+ opacity: 0;
1109
+ -webkit-transform: translateX(-20px);
1110
+ -ms-transform: translateX(-20px);
1111
+ transform: translateX(-20px);
1112
+ }
1113
+
1114
+ 100% {
1115
+ opacity: 1;
1116
+ -webkit-transform: translateX(0);
1117
+ -ms-transform: translateX(0);
1118
+ transform: translateX(0);
1119
+ }
1120
+ }
1121
+
1122
+ .fadeInLeft {
1123
+ -webkit-animation-name: fadeInLeft;
1124
+ animation-name: fadeInLeft;
1125
+ }
1126
+
1127
+ @-webkit-keyframes fadeInLeftBig {
1128
+ 0% {
1129
+ opacity: 0;
1130
+ -webkit-transform: translateX(-2000px);
1131
+ transform: translateX(-2000px);
1132
+ }
1133
+
1134
+ 100% {
1135
+ opacity: 1;
1136
+ -webkit-transform: translateX(0);
1137
+ transform: translateX(0);
1138
+ }
1139
+ }
1140
+
1141
+ @keyframes fadeInLeftBig {
1142
+ 0% {
1143
+ opacity: 0;
1144
+ -webkit-transform: translateX(-2000px);
1145
+ -ms-transform: translateX(-2000px);
1146
+ transform: translateX(-2000px);
1147
+ }
1148
+
1149
+ 100% {
1150
+ opacity: 1;
1151
+ -webkit-transform: translateX(0);
1152
+ -ms-transform: translateX(0);
1153
+ transform: translateX(0);
1154
+ }
1155
+ }
1156
+
1157
+ .fadeInLeftBig {
1158
+ -webkit-animation-name: fadeInLeftBig;
1159
+ animation-name: fadeInLeftBig;
1160
+ }
1161
+
1162
+ @-webkit-keyframes fadeInRight {
1163
+ 0% {
1164
+ opacity: 0;
1165
+ -webkit-transform: translateX(20px);
1166
+ transform: translateX(20px);
1167
+ }
1168
+
1169
+ 100% {
1170
+ opacity: 1;
1171
+ -webkit-transform: translateX(0);
1172
+ transform: translateX(0);
1173
+ }
1174
+ }
1175
+
1176
+ @keyframes fadeInRight {
1177
+ 0% {
1178
+ opacity: 0;
1179
+ -webkit-transform: translateX(20px);
1180
+ -ms-transform: translateX(20px);
1181
+ transform: translateX(20px);
1182
+ }
1183
+
1184
+ 100% {
1185
+ opacity: 1;
1186
+ -webkit-transform: translateX(0);
1187
+ -ms-transform: translateX(0);
1188
+ transform: translateX(0);
1189
+ }
1190
+ }
1191
+
1192
+ .fadeInRight {
1193
+ -webkit-animation-name: fadeInRight;
1194
+ animation-name: fadeInRight;
1195
+ }
1196
+
1197
+ @-webkit-keyframes fadeInRightBig {
1198
+ 0% {
1199
+ opacity: 0;
1200
+ -webkit-transform: translateX(2000px);
1201
+ transform: translateX(2000px);
1202
+ }
1203
+
1204
+ 100% {
1205
+ opacity: 1;
1206
+ -webkit-transform: translateX(0);
1207
+ transform: translateX(0);
1208
+ }
1209
+ }
1210
+
1211
+ @keyframes fadeInRightBig {
1212
+ 0% {
1213
+ opacity: 0;
1214
+ -webkit-transform: translateX(2000px);
1215
+ -ms-transform: translateX(2000px);
1216
+ transform: translateX(2000px);
1217
+ }
1218
+
1219
+ 100% {
1220
+ opacity: 1;
1221
+ -webkit-transform: translateX(0);
1222
+ -ms-transform: translateX(0);
1223
+ transform: translateX(0);
1224
+ }
1225
+ }
1226
+
1227
+ .fadeInRightBig {
1228
+ -webkit-animation-name: fadeInRightBig;
1229
+ animation-name: fadeInRightBig;
1230
+ }
1231
+
1232
+ @-webkit-keyframes fadeInUp {
1233
+ 0% {
1234
+ opacity: 0;
1235
+ -webkit-transform: translateY(20px);
1236
+ transform: translateY(20px);
1237
+ }
1238
+
1239
+ 100% {
1240
+ opacity: 1;
1241
+ -webkit-transform: translateY(0);
1242
+ transform: translateY(0);
1243
+ }
1244
+ }
1245
+
1246
+ @keyframes fadeInUp {
1247
+ 0% {
1248
+ opacity: 0;
1249
+ -webkit-transform: translateY(20px);
1250
+ -ms-transform: translateY(20px);
1251
+ transform: translateY(20px);
1252
+ }
1253
+
1254
+ 100% {
1255
+ opacity: 1;
1256
+ -webkit-transform: translateY(0);
1257
+ -ms-transform: translateY(0);
1258
+ transform: translateY(0);
1259
+ }
1260
+ }
1261
+
1262
+ .fadeInUp {
1263
+ -webkit-animation-name: fadeInUp;
1264
+ animation-name: fadeInUp;
1265
+ }
1266
+
1267
+ @-webkit-keyframes fadeInUpBig {
1268
+ 0% {
1269
+ opacity: 0;
1270
+ -webkit-transform: translateY(2000px);
1271
+ transform: translateY(2000px);
1272
+ }
1273
+
1274
+ 100% {
1275
+ opacity: 1;
1276
+ -webkit-transform: translateY(0);
1277
+ transform: translateY(0);
1278
+ }
1279
+ }
1280
+
1281
+ @keyframes fadeInUpBig {
1282
+ 0% {
1283
+ opacity: 0;
1284
+ -webkit-transform: translateY(2000px);
1285
+ -ms-transform: translateY(2000px);
1286
+ transform: translateY(2000px);
1287
+ }
1288
+
1289
+ 100% {
1290
+ opacity: 1;
1291
+ -webkit-transform: translateY(0);
1292
+ -ms-transform: translateY(0);
1293
+ transform: translateY(0);
1294
+ }
1295
+ }
1296
+
1297
+ .fadeInUpBig {
1298
+ -webkit-animation-name: fadeInUpBig;
1299
+ animation-name: fadeInUpBig;
1300
+ }
1301
+
1302
+ @-webkit-keyframes fadeOut {
1303
+ 0% {
1304
+ opacity: 1;
1305
+ }
1306
+
1307
+ 100% {
1308
+ opacity: 0;
1309
+ }
1310
+ }
1311
+
1312
+ @keyframes fadeOut {
1313
+ 0% {
1314
+ opacity: 1;
1315
+ }
1316
+
1317
+ 100% {
1318
+ opacity: 0;
1319
+ }
1320
+ }
1321
+
1322
+ .fadeOut {
1323
+ -webkit-animation-name: fadeOut;
1324
+ animation-name: fadeOut;
1325
+ }
1326
+
1327
+ @-webkit-keyframes fadeOutDown {
1328
+ 0% {
1329
+ opacity: 1;
1330
+ -webkit-transform: translateY(0);
1331
+ transform: translateY(0);
1332
+ }
1333
+
1334
+ 100% {
1335
+ opacity: 0;
1336
+ -webkit-transform: translateY(20px);
1337
+ transform: translateY(20px);
1338
+ }
1339
+ }
1340
+
1341
+ @keyframes fadeOutDown {
1342
+ 0% {
1343
+ opacity: 1;
1344
+ -webkit-transform: translateY(0);
1345
+ -ms-transform: translateY(0);
1346
+ transform: translateY(0);
1347
+ }
1348
+
1349
+ 100% {
1350
+ opacity: 0;
1351
+ -webkit-transform: translateY(20px);
1352
+ -ms-transform: translateY(20px);
1353
+ transform: translateY(20px);
1354
+ }
1355
+ }
1356
+
1357
+ .fadeOutDown {
1358
+ -webkit-animation-name: fadeOutDown;
1359
+ animation-name: fadeOutDown;
1360
+ }
1361
+
1362
+ @-webkit-keyframes fadeOutDownBig {
1363
+ 0% {
1364
+ opacity: 1;
1365
+ -webkit-transform: translateY(0);
1366
+ transform: translateY(0);
1367
+ }
1368
+
1369
+ 100% {
1370
+ opacity: 0;
1371
+ -webkit-transform: translateY(2000px);
1372
+ transform: translateY(2000px);
1373
+ }
1374
+ }
1375
+
1376
+ @keyframes fadeOutDownBig {
1377
+ 0% {
1378
+ opacity: 1;
1379
+ -webkit-transform: translateY(0);
1380
+ -ms-transform: translateY(0);
1381
+ transform: translateY(0);
1382
+ }
1383
+
1384
+ 100% {
1385
+ opacity: 0;
1386
+ -webkit-transform: translateY(2000px);
1387
+ -ms-transform: translateY(2000px);
1388
+ transform: translateY(2000px);
1389
+ }
1390
+ }
1391
+
1392
+ .fadeOutDownBig {
1393
+ -webkit-animation-name: fadeOutDownBig;
1394
+ animation-name: fadeOutDownBig;
1395
+ }
1396
+
1397
+ @-webkit-keyframes fadeOutLeft {
1398
+ 0% {
1399
+ opacity: 1;
1400
+ -webkit-transform: translateX(0);
1401
+ transform: translateX(0);
1402
+ }
1403
+
1404
+ 100% {
1405
+ opacity: 0;
1406
+ -webkit-transform: translateX(-20px);
1407
+ transform: translateX(-20px);
1408
+ }
1409
+ }
1410
+
1411
+ @keyframes fadeOutLeft {
1412
+ 0% {
1413
+ opacity: 1;
1414
+ -webkit-transform: translateX(0);
1415
+ -ms-transform: translateX(0);
1416
+ transform: translateX(0);
1417
+ }
1418
+
1419
+ 100% {
1420
+ opacity: 0;
1421
+ -webkit-transform: translateX(-20px);
1422
+ -ms-transform: translateX(-20px);
1423
+ transform: translateX(-20px);
1424
+ }
1425
+ }
1426
+
1427
+ .fadeOutLeft {
1428
+ -webkit-animation-name: fadeOutLeft;
1429
+ animation-name: fadeOutLeft;
1430
+ }
1431
+
1432
+ @-webkit-keyframes fadeOutLeftBig {
1433
+ 0% {
1434
+ opacity: 1;
1435
+ -webkit-transform: translateX(0);
1436
+ transform: translateX(0);
1437
+ }
1438
+
1439
+ 100% {
1440
+ opacity: 0;
1441
+ -webkit-transform: translateX(-2000px);
1442
+ transform: translateX(-2000px);
1443
+ }
1444
+ }
1445
+
1446
+ @keyframes fadeOutLeftBig {
1447
+ 0% {
1448
+ opacity: 1;
1449
+ -webkit-transform: translateX(0);
1450
+ -ms-transform: translateX(0);
1451
+ transform: translateX(0);
1452
+ }
1453
+
1454
+ 100% {
1455
+ opacity: 0;
1456
+ -webkit-transform: translateX(-2000px);
1457
+ -ms-transform: translateX(-2000px);
1458
+ transform: translateX(-2000px);
1459
+ }
1460
+ }
1461
+
1462
+ .fadeOutLeftBig {
1463
+ -webkit-animation-name: fadeOutLeftBig;
1464
+ animation-name: fadeOutLeftBig;
1465
+ }
1466
+
1467
+ @-webkit-keyframes fadeOutRight {
1468
+ 0% {
1469
+ opacity: 1;
1470
+ -webkit-transform: translateX(0);
1471
+ transform: translateX(0);
1472
+ }
1473
+
1474
+ 100% {
1475
+ opacity: 0;
1476
+ -webkit-transform: translateX(20px);
1477
+ transform: translateX(20px);
1478
+ }
1479
+ }
1480
+
1481
+ @keyframes fadeOutRight {
1482
+ 0% {
1483
+ opacity: 1;
1484
+ -webkit-transform: translateX(0);
1485
+ -ms-transform: translateX(0);
1486
+ transform: translateX(0);
1487
+ }
1488
+
1489
+ 100% {
1490
+ opacity: 0;
1491
+ -webkit-transform: translateX(20px);
1492
+ -ms-transform: translateX(20px);
1493
+ transform: translateX(20px);
1494
+ }
1495
+ }
1496
+
1497
+ .fadeOutRight {
1498
+ -webkit-animation-name: fadeOutRight;
1499
+ animation-name: fadeOutRight;
1500
+ }
1501
+
1502
+ @-webkit-keyframes fadeOutRightBig {
1503
+ 0% {
1504
+ opacity: 1;
1505
+ -webkit-transform: translateX(0);
1506
+ transform: translateX(0);
1507
+ }
1508
+
1509
+ 100% {
1510
+ opacity: 0;
1511
+ -webkit-transform: translateX(2000px);
1512
+ transform: translateX(2000px);
1513
+ }
1514
+ }
1515
+
1516
+ @keyframes fadeOutRightBig {
1517
+ 0% {
1518
+ opacity: 1;
1519
+ -webkit-transform: translateX(0);
1520
+ -ms-transform: translateX(0);
1521
+ transform: translateX(0);
1522
+ }
1523
+
1524
+ 100% {
1525
+ opacity: 0;
1526
+ -webkit-transform: translateX(2000px);
1527
+ -ms-transform: translateX(2000px);
1528
+ transform: translateX(2000px);
1529
+ }
1530
+ }
1531
+
1532
+ .fadeOutRightBig {
1533
+ -webkit-animation-name: fadeOutRightBig;
1534
+ animation-name: fadeOutRightBig;
1535
+ }
1536
+
1537
+ @-webkit-keyframes fadeOutUp {
1538
+ 0% {
1539
+ opacity: 1;
1540
+ -webkit-transform: translateY(0);
1541
+ transform: translateY(0);
1542
+ }
1543
+
1544
+ 100% {
1545
+ opacity: 0;
1546
+ -webkit-transform: translateY(-20px);
1547
+ transform: translateY(-20px);
1548
+ }
1549
+ }
1550
+
1551
+ @keyframes fadeOutUp {
1552
+ 0% {
1553
+ opacity: 1;
1554
+ -webkit-transform: translateY(0);
1555
+ -ms-transform: translateY(0);
1556
+ transform: translateY(0);
1557
+ }
1558
+
1559
+ 100% {
1560
+ opacity: 0;
1561
+ -webkit-transform: translateY(-20px);
1562
+ -ms-transform: translateY(-20px);
1563
+ transform: translateY(-20px);
1564
+ }
1565
+ }
1566
+
1567
+ .fadeOutUp {
1568
+ -webkit-animation-name: fadeOutUp;
1569
+ animation-name: fadeOutUp;
1570
+ }
1571
+
1572
+ @-webkit-keyframes fadeOutUpBig {
1573
+ 0% {
1574
+ opacity: 1;
1575
+ -webkit-transform: translateY(0);
1576
+ transform: translateY(0);
1577
+ }
1578
+
1579
+ 100% {
1580
+ opacity: 0;
1581
+ -webkit-transform: translateY(-2000px);
1582
+ transform: translateY(-2000px);
1583
+ }
1584
+ }
1585
+
1586
+ @keyframes fadeOutUpBig {
1587
+ 0% {
1588
+ opacity: 1;
1589
+ -webkit-transform: translateY(0);
1590
+ -ms-transform: translateY(0);
1591
+ transform: translateY(0);
1592
+ }
1593
+
1594
+ 100% {
1595
+ opacity: 0;
1596
+ -webkit-transform: translateY(-2000px);
1597
+ -ms-transform: translateY(-2000px);
1598
+ transform: translateY(-2000px);
1599
+ }
1600
+ }
1601
+
1602
+ .fadeOutUpBig {
1603
+ -webkit-animation-name: fadeOutUpBig;
1604
+ animation-name: fadeOutUpBig;
1605
+ }
1606
+
1607
+ @-webkit-keyframes flip {
1608
+ 0% {
1609
+ -webkit-transform: perspective(400px) translateZ(0) rotateY(0) scale(1);
1610
+ transform: perspective(400px) translateZ(0) rotateY(0) scale(1);
1611
+ -webkit-animation-timing-function: ease-out;
1612
+ animation-timing-function: ease-out;
1613
+ }
1614
+
1615
+ 40% {
1616
+ -webkit-transform: perspective(400px) translateZ(150px) rotateY(170deg) scale(1);
1617
+ transform: perspective(400px) translateZ(150px) rotateY(170deg) scale(1);
1618
+ -webkit-animation-timing-function: ease-out;
1619
+ animation-timing-function: ease-out;
1620
+ }
1621
+
1622
+ 50% {
1623
+ -webkit-transform: perspective(400px) translateZ(150px) rotateY(190deg) scale(1);
1624
+ transform: perspective(400px) translateZ(150px) rotateY(190deg) scale(1);
1625
+ -webkit-animation-timing-function: ease-in;
1626
+ animation-timing-function: ease-in;
1627
+ }
1628
+
1629
+ 80% {
1630
+ -webkit-transform: perspective(400px) translateZ(0) rotateY(360deg) scale(.95);
1631
+ transform: perspective(400px) translateZ(0) rotateY(360deg) scale(.95);
1632
+ -webkit-animation-timing-function: ease-in;
1633
+ animation-timing-function: ease-in;
1634
+ }
1635
+
1636
+ 100% {
1637
+ -webkit-transform: perspective(400px) translateZ(0) rotateY(360deg) scale(1);
1638
+ transform: perspective(400px) translateZ(0) rotateY(360deg) scale(1);
1639
+ -webkit-animation-timing-function: ease-in;
1640
+ animation-timing-function: ease-in;
1641
+ }
1642
+ }
1643
+
1644
+ @keyframes flip {
1645
+ 0% {
1646
+ -webkit-transform: perspective(400px) translateZ(0) rotateY(0) scale(1);
1647
+ -ms-transform: perspective(400px) translateZ(0) rotateY(0) scale(1);
1648
+ transform: perspective(400px) translateZ(0) rotateY(0) scale(1);
1649
+ -webkit-animation-timing-function: ease-out;
1650
+ animation-timing-function: ease-out;
1651
+ }
1652
+
1653
+ 40% {
1654
+ -webkit-transform: perspective(400px) translateZ(150px) rotateY(170deg) scale(1);
1655
+ -ms-transform: perspective(400px) translateZ(150px) rotateY(170deg) scale(1);
1656
+ transform: perspective(400px) translateZ(150px) rotateY(170deg) scale(1);
1657
+ -webkit-animation-timing-function: ease-out;
1658
+ animation-timing-function: ease-out;
1659
+ }
1660
+
1661
+ 50% {
1662
+ -webkit-transform: perspective(400px) translateZ(150px) rotateY(190deg) scale(1);
1663
+ -ms-transform: perspective(400px) translateZ(150px) rotateY(190deg) scale(1);
1664
+ transform: perspective(400px) translateZ(150px) rotateY(190deg) scale(1);
1665
+ -webkit-animation-timing-function: ease-in;
1666
+ animation-timing-function: ease-in;
1667
+ }
1668
+
1669
+ 80% {
1670
+ -webkit-transform: perspective(400px) translateZ(0) rotateY(360deg) scale(.95);
1671
+ -ms-transform: perspective(400px) translateZ(0) rotateY(360deg) scale(.95);
1672
+ transform: perspective(400px) translateZ(0) rotateY(360deg) scale(.95);
1673
+ -webkit-animation-timing-function: ease-in;
1674
+ animation-timing-function: ease-in;
1675
+ }
1676
+
1677
+ 100% {
1678
+ -webkit-transform: perspective(400px) translateZ(0) rotateY(360deg) scale(1);
1679
+ -ms-transform: perspective(400px) translateZ(0) rotateY(360deg) scale(1);
1680
+ transform: perspective(400px) translateZ(0) rotateY(360deg) scale(1);
1681
+ -webkit-animation-timing-function: ease-in;
1682
+ animation-timing-function: ease-in;
1683
+ }
1684
+ }
1685
+
1686
+ .animated.flip {
1687
+ -webkit-backface-visibility: visible;
1688
+ -ms-backface-visibility: visible;
1689
+ backface-visibility: visible;
1690
+ -webkit-animation-name: flip;
1691
+ animation-name: flip;
1692
+ }
1693
+
1694
+ @-webkit-keyframes flipInX {
1695
+ 0% {
1696
+ -webkit-transform: perspective(400px) rotateX(90deg);
1697
+ transform: perspective(400px) rotateX(90deg);
1698
+ opacity: 0;
1699
+ }
1700
+
1701
+ 40% {
1702
+ -webkit-transform: perspective(400px) rotateX(-10deg);
1703
+ transform: perspective(400px) rotateX(-10deg);
1704
+ }
1705
+
1706
+ 70% {
1707
+ -webkit-transform: perspective(400px) rotateX(10deg);
1708
+ transform: perspective(400px) rotateX(10deg);
1709
+ }
1710
+
1711
+ 100% {
1712
+ -webkit-transform: perspective(400px) rotateX(0deg);
1713
+ transform: perspective(400px) rotateX(0deg);
1714
+ opacity: 1;
1715
+ }
1716
+ }
1717
+
1718
+ @keyframes flipInX {
1719
+ 0% {
1720
+ -webkit-transform: perspective(400px) rotateX(90deg);
1721
+ -ms-transform: perspective(400px) rotateX(90deg);
1722
+ transform: perspective(400px) rotateX(90deg);
1723
+ opacity: 0;
1724
+ }
1725
+
1726
+ 40% {
1727
+ -webkit-transform: perspective(400px) rotateX(-10deg);
1728
+ -ms-transform: perspective(400px) rotateX(-10deg);
1729
+ transform: perspective(400px) rotateX(-10deg);
1730
+ }
1731
+
1732
+ 70% {
1733
+ -webkit-transform: perspective(400px) rotateX(10deg);
1734
+ -ms-transform: perspective(400px) rotateX(10deg);
1735
+ transform: perspective(400px) rotateX(10deg);
1736
+ }
1737
+
1738
+ 100% {
1739
+ -webkit-transform: perspective(400px) rotateX(0deg);
1740
+ -ms-transform: perspective(400px) rotateX(0deg);
1741
+ transform: perspective(400px) rotateX(0deg);
1742
+ opacity: 1;
1743
+ }
1744
+ }
1745
+
1746
+ .flipInX {
1747
+ -webkit-backface-visibility: visible !important;
1748
+ -ms-backface-visibility: visible !important;
1749
+ backface-visibility: visible !important;
1750
+ -webkit-animation-name: flipInX;
1751
+ animation-name: flipInX;
1752
+ }
1753
+
1754
+ @-webkit-keyframes flipInY {
1755
+ 0% {
1756
+ -webkit-transform: perspective(400px) rotateY(90deg);
1757
+ transform: perspective(400px) rotateY(90deg);
1758
+ opacity: 0;
1759
+ }
1760
+
1761
+ 40% {
1762
+ -webkit-transform: perspective(400px) rotateY(-10deg);
1763
+ transform: perspective(400px) rotateY(-10deg);
1764
+ }
1765
+
1766
+ 70% {
1767
+ -webkit-transform: perspective(400px) rotateY(10deg);
1768
+ transform: perspective(400px) rotateY(10deg);
1769
+ }
1770
+
1771
+ 100% {
1772
+ -webkit-transform: perspective(400px) rotateY(0deg);
1773
+ transform: perspective(400px) rotateY(0deg);
1774
+ opacity: 1;
1775
+ }
1776
+ }
1777
+
1778
+ @keyframes flipInY {
1779
+ 0% {
1780
+ -webkit-transform: perspective(400px) rotateY(90deg);
1781
+ -ms-transform: perspective(400px) rotateY(90deg);
1782
+ transform: perspective(400px) rotateY(90deg);
1783
+ opacity: 0;
1784
+ }
1785
+
1786
+ 40% {
1787
+ -webkit-transform: perspective(400px) rotateY(-10deg);
1788
+ -ms-transform: perspective(400px) rotateY(-10deg);
1789
+ transform: perspective(400px) rotateY(-10deg);
1790
+ }
1791
+
1792
+ 70% {
1793
+ -webkit-transform: perspective(400px) rotateY(10deg);
1794
+ -ms-transform: perspective(400px) rotateY(10deg);
1795
+ transform: perspective(400px) rotateY(10deg);
1796
+ }
1797
+
1798
+ 100% {
1799
+ -webkit-transform: perspective(400px) rotateY(0deg);
1800
+ -ms-transform: perspective(400px) rotateY(0deg);
1801
+ transform: perspective(400px) rotateY(0deg);
1802
+ opacity: 1;
1803
+ }
1804
+ }
1805
+
1806
+ .flipInY {
1807
+ -webkit-backface-visibility: visible !important;
1808
+ -ms-backface-visibility: visible !important;
1809
+ backface-visibility: visible !important;
1810
+ -webkit-animation-name: flipInY;
1811
+ animation-name: flipInY;
1812
+ }
1813
+
1814
+ @-webkit-keyframes flipOutX {
1815
+ 0% {
1816
+ -webkit-transform: perspective(400px) rotateX(0deg);
1817
+ transform: perspective(400px) rotateX(0deg);
1818
+ opacity: 1;
1819
+ }
1820
+
1821
+ 100% {
1822
+ -webkit-transform: perspective(400px) rotateX(90deg);
1823
+ transform: perspective(400px) rotateX(90deg);
1824
+ opacity: 0;
1825
+ }
1826
+ }
1827
+
1828
+ @keyframes flipOutX {
1829
+ 0% {
1830
+ -webkit-transform: perspective(400px) rotateX(0deg);
1831
+ -ms-transform: perspective(400px) rotateX(0deg);
1832
+ transform: perspective(400px) rotateX(0deg);
1833
+ opacity: 1;
1834
+ }
1835
+
1836
+ 100% {
1837
+ -webkit-transform: perspective(400px) rotateX(90deg);
1838
+ -ms-transform: perspective(400px) rotateX(90deg);
1839
+ transform: perspective(400px) rotateX(90deg);
1840
+ opacity: 0;
1841
+ }
1842
+ }
1843
+
1844
+ .flipOutX {
1845
+ -webkit-animation-name: flipOutX;
1846
+ animation-name: flipOutX;
1847
+ -webkit-backface-visibility: visible !important;
1848
+ -ms-backface-visibility: visible !important;
1849
+ backface-visibility: visible !important;
1850
+ }
1851
+
1852
+ @-webkit-keyframes flipOutY {
1853
+ 0% {
1854
+ -webkit-transform: perspective(400px) rotateY(0deg);
1855
+ transform: perspective(400px) rotateY(0deg);
1856
+ opacity: 1;
1857
+ }
1858
+
1859
+ 100% {
1860
+ -webkit-transform: perspective(400px) rotateY(90deg);
1861
+ transform: perspective(400px) rotateY(90deg);
1862
+ opacity: 0;
1863
+ }
1864
+ }
1865
+
1866
+ @keyframes flipOutY {
1867
+ 0% {
1868
+ -webkit-transform: perspective(400px) rotateY(0deg);
1869
+ -ms-transform: perspective(400px) rotateY(0deg);
1870
+ transform: perspective(400px) rotateY(0deg);
1871
+ opacity: 1;
1872
+ }
1873
+
1874
+ 100% {
1875
+ -webkit-transform: perspective(400px) rotateY(90deg);
1876
+ -ms-transform: perspective(400px) rotateY(90deg);
1877
+ transform: perspective(400px) rotateY(90deg);
1878
+ opacity: 0;
1879
+ }
1880
+ }
1881
+
1882
+ .flipOutY {
1883
+ -webkit-backface-visibility: visible !important;
1884
+ -ms-backface-visibility: visible !important;
1885
+ backface-visibility: visible !important;
1886
+ -webkit-animation-name: flipOutY;
1887
+ animation-name: flipOutY;
1888
+ }
1889
+
1890
+ @-webkit-keyframes lightSpeedIn {
1891
+ 0% {
1892
+ -webkit-transform: translateX(100%) skewX(-30deg);
1893
+ transform: translateX(100%) skewX(-30deg);
1894
+ opacity: 0;
1895
+ }
1896
+
1897
+ 60% {
1898
+ -webkit-transform: translateX(-20%) skewX(30deg);
1899
+ transform: translateX(-20%) skewX(30deg);
1900
+ opacity: 1;
1901
+ }
1902
+
1903
+ 80% {
1904
+ -webkit-transform: translateX(0%) skewX(-15deg);
1905
+ transform: translateX(0%) skewX(-15deg);
1906
+ opacity: 1;
1907
+ }
1908
+
1909
+ 100% {
1910
+ -webkit-transform: translateX(0%) skewX(0deg);
1911
+ transform: translateX(0%) skewX(0deg);
1912
+ opacity: 1;
1913
+ }
1914
+ }
1915
+
1916
+ @keyframes lightSpeedIn {
1917
+ 0% {
1918
+ -webkit-transform: translateX(100%) skewX(-30deg);
1919
+ -ms-transform: translateX(100%) skewX(-30deg);
1920
+ transform: translateX(100%) skewX(-30deg);
1921
+ opacity: 0;
1922
+ }
1923
+
1924
+ 60% {
1925
+ -webkit-transform: translateX(-20%) skewX(30deg);
1926
+ -ms-transform: translateX(-20%) skewX(30deg);
1927
+ transform: translateX(-20%) skewX(30deg);
1928
+ opacity: 1;
1929
+ }
1930
+
1931
+ 80% {
1932
+ -webkit-transform: translateX(0%) skewX(-15deg);
1933
+ -ms-transform: translateX(0%) skewX(-15deg);
1934
+ transform: translateX(0%) skewX(-15deg);
1935
+ opacity: 1;
1936
+ }
1937
+
1938
+ 100% {
1939
+ -webkit-transform: translateX(0%) skewX(0deg);
1940
+ -ms-transform: translateX(0%) skewX(0deg);
1941
+ transform: translateX(0%) skewX(0deg);
1942
+ opacity: 1;
1943
+ }
1944
+ }
1945
+
1946
+ .lightSpeedIn {
1947
+ -webkit-animation-name: lightSpeedIn;
1948
+ animation-name: lightSpeedIn;
1949
+ -webkit-animation-timing-function: ease-out;
1950
+ animation-timing-function: ease-out;
1951
+ }
1952
+
1953
+ @-webkit-keyframes lightSpeedOut {
1954
+ 0% {
1955
+ -webkit-transform: translateX(0%) skewX(0deg);
1956
+ transform: translateX(0%) skewX(0deg);
1957
+ opacity: 1;
1958
+ }
1959
+
1960
+ 100% {
1961
+ -webkit-transform: translateX(100%) skewX(-30deg);
1962
+ transform: translateX(100%) skewX(-30deg);
1963
+ opacity: 0;
1964
+ }
1965
+ }
1966
+
1967
+ @keyframes lightSpeedOut {
1968
+ 0% {
1969
+ -webkit-transform: translateX(0%) skewX(0deg);
1970
+ -ms-transform: translateX(0%) skewX(0deg);
1971
+ transform: translateX(0%) skewX(0deg);
1972
+ opacity: 1;
1973
+ }
1974
+
1975
+ 100% {
1976
+ -webkit-transform: translateX(100%) skewX(-30deg);
1977
+ -ms-transform: translateX(100%) skewX(-30deg);
1978
+ transform: translateX(100%) skewX(-30deg);
1979
+ opacity: 0;
1980
+ }
1981
+ }
1982
+
1983
+ .lightSpeedOut {
1984
+ -webkit-animation-name: lightSpeedOut;
1985
+ animation-name: lightSpeedOut;
1986
+ -webkit-animation-timing-function: ease-in;
1987
+ animation-timing-function: ease-in;
1988
+ }
1989
+
1990
+ @-webkit-keyframes rotateIn {
1991
+ 0% {
1992
+ -webkit-transform-origin: center center;
1993
+ transform-origin: center center;
1994
+ -webkit-transform: rotate(-200deg);
1995
+ transform: rotate(-200deg);
1996
+ opacity: 0;
1997
+ }
1998
+
1999
+ 100% {
2000
+ -webkit-transform-origin: center center;
2001
+ transform-origin: center center;
2002
+ -webkit-transform: rotate(0);
2003
+ transform: rotate(0);
2004
+ opacity: 1;
2005
+ }
2006
+ }
2007
+
2008
+ @keyframes rotateIn {
2009
+ 0% {
2010
+ -webkit-transform-origin: center center;
2011
+ -ms-transform-origin: center center;
2012
+ transform-origin: center center;
2013
+ -webkit-transform: rotate(-200deg);
2014
+ -ms-transform: rotate(-200deg);
2015
+ transform: rotate(-200deg);
2016
+ opacity: 0;
2017
+ }
2018
+
2019
+ 100% {
2020
+ -webkit-transform-origin: center center;
2021
+ -ms-transform-origin: center center;
2022
+ transform-origin: center center;
2023
+ -webkit-transform: rotate(0);
2024
+ -ms-transform: rotate(0);
2025
+ transform: rotate(0);
2026
+ opacity: 1;
2027
+ }
2028
+ }
2029
+
2030
+ .rotateIn {
2031
+ -webkit-animation-name: rotateIn;
2032
+ animation-name: rotateIn;
2033
+ }
2034
+
2035
+ @-webkit-keyframes rotateInDownLeft {
2036
+ 0% {
2037
+ -webkit-transform-origin: left bottom;
2038
+ transform-origin: left bottom;
2039
+ -webkit-transform: rotate(-90deg);
2040
+ transform: rotate(-90deg);
2041
+ opacity: 0;
2042
+ }
2043
+
2044
+ 100% {
2045
+ -webkit-transform-origin: left bottom;
2046
+ transform-origin: left bottom;
2047
+ -webkit-transform: rotate(0);
2048
+ transform: rotate(0);
2049
+ opacity: 1;
2050
+ }
2051
+ }
2052
+
2053
+ @keyframes rotateInDownLeft {
2054
+ 0% {
2055
+ -webkit-transform-origin: left bottom;
2056
+ -ms-transform-origin: left bottom;
2057
+ transform-origin: left bottom;
2058
+ -webkit-transform: rotate(-90deg);
2059
+ -ms-transform: rotate(-90deg);
2060
+ transform: rotate(-90deg);
2061
+ opacity: 0;
2062
+ }
2063
+
2064
+ 100% {
2065
+ -webkit-transform-origin: left bottom;
2066
+ -ms-transform-origin: left bottom;
2067
+ transform-origin: left bottom;
2068
+ -webkit-transform: rotate(0);
2069
+ -ms-transform: rotate(0);
2070
+ transform: rotate(0);
2071
+ opacity: 1;
2072
+ }
2073
+ }
2074
+
2075
+ .rotateInDownLeft {
2076
+ -webkit-animation-name: rotateInDownLeft;
2077
+ animation-name: rotateInDownLeft;
2078
+ }
2079
+
2080
+ @-webkit-keyframes rotateInDownRight {
2081
+ 0% {
2082
+ -webkit-transform-origin: right bottom;
2083
+ transform-origin: right bottom;
2084
+ -webkit-transform: rotate(90deg);
2085
+ transform: rotate(90deg);
2086
+ opacity: 0;
2087
+ }
2088
+
2089
+ 100% {
2090
+ -webkit-transform-origin: right bottom;
2091
+ transform-origin: right bottom;
2092
+ -webkit-transform: rotate(0);
2093
+ transform: rotate(0);
2094
+ opacity: 1;
2095
+ }
2096
+ }
2097
+
2098
+ @keyframes rotateInDownRight {
2099
+ 0% {
2100
+ -webkit-transform-origin: right bottom;
2101
+ -ms-transform-origin: right bottom;
2102
+ transform-origin: right bottom;
2103
+ -webkit-transform: rotate(90deg);
2104
+ -ms-transform: rotate(90deg);
2105
+ transform: rotate(90deg);
2106
+ opacity: 0;
2107
+ }
2108
+
2109
+ 100% {
2110
+ -webkit-transform-origin: right bottom;
2111
+ -ms-transform-origin: right bottom;
2112
+ transform-origin: right bottom;
2113
+ -webkit-transform: rotate(0);
2114
+ -ms-transform: rotate(0);
2115
+ transform: rotate(0);
2116
+ opacity: 1;
2117
+ }
2118
+ }
2119
+
2120
+ .rotateInDownRight {
2121
+ -webkit-animation-name: rotateInDownRight;
2122
+ animation-name: rotateInDownRight;
2123
+ }
2124
+
2125
+ @-webkit-keyframes rotateInUpLeft {
2126
+ 0% {
2127
+ -webkit-transform-origin: left bottom;
2128
+ transform-origin: left bottom;
2129
+ -webkit-transform: rotate(90deg);
2130
+ transform: rotate(90deg);
2131
+ opacity: 0;
2132
+ }
2133
+
2134
+ 100% {
2135
+ -webkit-transform-origin: left bottom;
2136
+ transform-origin: left bottom;
2137
+ -webkit-transform: rotate(0);
2138
+ transform: rotate(0);
2139
+ opacity: 1;
2140
+ }
2141
+ }
2142
+
2143
+ @keyframes rotateInUpLeft {
2144
+ 0% {
2145
+ -webkit-transform-origin: left bottom;
2146
+ -ms-transform-origin: left bottom;
2147
+ transform-origin: left bottom;
2148
+ -webkit-transform: rotate(90deg);
2149
+ -ms-transform: rotate(90deg);
2150
+ transform: rotate(90deg);
2151
+ opacity: 0;
2152
+ }
2153
+
2154
+ 100% {
2155
+ -webkit-transform-origin: left bottom;
2156
+ -ms-transform-origin: left bottom;
2157
+ transform-origin: left bottom;
2158
+ -webkit-transform: rotate(0);
2159
+ -ms-transform: rotate(0);
2160
+ transform: rotate(0);
2161
+ opacity: 1;
2162
+ }
2163
+ }
2164
+
2165
+ .rotateInUpLeft {
2166
+ -webkit-animation-name: rotateInUpLeft;
2167
+ animation-name: rotateInUpLeft;
2168
+ }
2169
+
2170
+ @-webkit-keyframes rotateInUpRight {
2171
+ 0% {
2172
+ -webkit-transform-origin: right bottom;
2173
+ transform-origin: right bottom;
2174
+ -webkit-transform: rotate(-90deg);
2175
+ transform: rotate(-90deg);
2176
+ opacity: 0;
2177
+ }
2178
+
2179
+ 100% {
2180
+ -webkit-transform-origin: right bottom;
2181
+ transform-origin: right bottom;
2182
+ -webkit-transform: rotate(0);
2183
+ transform: rotate(0);
2184
+ opacity: 1;
2185
+ }
2186
+ }
2187
+
2188
+ @keyframes rotateInUpRight {
2189
+ 0% {
2190
+ -webkit-transform-origin: right bottom;
2191
+ -ms-transform-origin: right bottom;
2192
+ transform-origin: right bottom;
2193
+ -webkit-transform: rotate(-90deg);
2194
+ -ms-transform: rotate(-90deg);
2195
+ transform: rotate(-90deg);
2196
+ opacity: 0;
2197
+ }
2198
+
2199
+ 100% {
2200
+ -webkit-transform-origin: right bottom;
2201
+ -ms-transform-origin: right bottom;
2202
+ transform-origin: right bottom;
2203
+ -webkit-transform: rotate(0);
2204
+ -ms-transform: rotate(0);
2205
+ transform: rotate(0);
2206
+ opacity: 1;
2207
+ }
2208
+ }
2209
+
2210
+ .rotateInUpRight {
2211
+ -webkit-animation-name: rotateInUpRight;
2212
+ animation-name: rotateInUpRight;
2213
+ }
2214
+
2215
+ @-webkit-keyframes rotateOut {
2216
+ 0% {
2217
+ -webkit-transform-origin: center center;
2218
+ transform-origin: center center;
2219
+ -webkit-transform: rotate(0);
2220
+ transform: rotate(0);
2221
+ opacity: 1;
2222
+ }
2223
+
2224
+ 100% {
2225
+ -webkit-transform-origin: center center;
2226
+ transform-origin: center center;
2227
+ -webkit-transform: rotate(200deg);
2228
+ transform: rotate(200deg);
2229
+ opacity: 0;
2230
+ }
2231
+ }
2232
+
2233
+ @keyframes rotateOut {
2234
+ 0% {
2235
+ -webkit-transform-origin: center center;
2236
+ -ms-transform-origin: center center;
2237
+ transform-origin: center center;
2238
+ -webkit-transform: rotate(0);
2239
+ -ms-transform: rotate(0);
2240
+ transform: rotate(0);
2241
+ opacity: 1;
2242
+ }
2243
+
2244
+ 100% {
2245
+ -webkit-transform-origin: center center;
2246
+ -ms-transform-origin: center center;
2247
+ transform-origin: center center;
2248
+ -webkit-transform: rotate(200deg);
2249
+ -ms-transform: rotate(200deg);
2250
+ transform: rotate(200deg);
2251
+ opacity: 0;
2252
+ }
2253
+ }
2254
+
2255
+ .rotateOut {
2256
+ -webkit-animation-name: rotateOut;
2257
+ animation-name: rotateOut;
2258
+ }
2259
+
2260
+ @-webkit-keyframes rotateOutDownLeft {
2261
+ 0% {
2262
+ -webkit-transform-origin: left bottom;
2263
+ transform-origin: left bottom;
2264
+ -webkit-transform: rotate(0);
2265
+ transform: rotate(0);
2266
+ opacity: 1;
2267
+ }
2268
+
2269
+ 100% {
2270
+ -webkit-transform-origin: left bottom;
2271
+ transform-origin: left bottom;
2272
+ -webkit-transform: rotate(90deg);
2273
+ transform: rotate(90deg);
2274
+ opacity: 0;
2275
+ }
2276
+ }
2277
+
2278
+ @keyframes rotateOutDownLeft {
2279
+ 0% {
2280
+ -webkit-transform-origin: left bottom;
2281
+ -ms-transform-origin: left bottom;
2282
+ transform-origin: left bottom;
2283
+ -webkit-transform: rotate(0);
2284
+ -ms-transform: rotate(0);
2285
+ transform: rotate(0);
2286
+ opacity: 1;
2287
+ }
2288
+
2289
+ 100% {
2290
+ -webkit-transform-origin: left bottom;
2291
+ -ms-transform-origin: left bottom;
2292
+ transform-origin: left bottom;
2293
+ -webkit-transform: rotate(90deg);
2294
+ -ms-transform: rotate(90deg);
2295
+ transform: rotate(90deg);
2296
+ opacity: 0;
2297
+ }
2298
+ }
2299
+
2300
+ .rotateOutDownLeft {
2301
+ -webkit-animation-name: rotateOutDownLeft;
2302
+ animation-name: rotateOutDownLeft;
2303
+ }
2304
+
2305
+ @-webkit-keyframes rotateOutDownRight {
2306
+ 0% {
2307
+ -webkit-transform-origin: right bottom;
2308
+ transform-origin: right bottom;
2309
+ -webkit-transform: rotate(0);
2310
+ transform: rotate(0);
2311
+ opacity: 1;
2312
+ }
2313
+
2314
+ 100% {
2315
+ -webkit-transform-origin: right bottom;
2316
+ transform-origin: right bottom;
2317
+ -webkit-transform: rotate(-90deg);
2318
+ transform: rotate(-90deg);
2319
+ opacity: 0;
2320
+ }
2321
+ }
2322
+
2323
+ @keyframes rotateOutDownRight {
2324
+ 0% {
2325
+ -webkit-transform-origin: right bottom;
2326
+ -ms-transform-origin: right bottom;
2327
+ transform-origin: right bottom;
2328
+ -webkit-transform: rotate(0);
2329
+ -ms-transform: rotate(0);
2330
+ transform: rotate(0);
2331
+ opacity: 1;
2332
+ }
2333
+
2334
+ 100% {
2335
+ -webkit-transform-origin: right bottom;
2336
+ -ms-transform-origin: right bottom;
2337
+ transform-origin: right bottom;
2338
+ -webkit-transform: rotate(-90deg);
2339
+ -ms-transform: rotate(-90deg);
2340
+ transform: rotate(-90deg);
2341
+ opacity: 0;
2342
+ }
2343
+ }
2344
+
2345
+ .rotateOutDownRight {
2346
+ -webkit-animation-name: rotateOutDownRight;
2347
+ animation-name: rotateOutDownRight;
2348
+ }
2349
+
2350
+ @-webkit-keyframes rotateOutUpLeft {
2351
+ 0% {
2352
+ -webkit-transform-origin: left bottom;
2353
+ transform-origin: left bottom;
2354
+ -webkit-transform: rotate(0);
2355
+ transform: rotate(0);
2356
+ opacity: 1;
2357
+ }
2358
+
2359
+ 100% {
2360
+ -webkit-transform-origin: left bottom;
2361
+ transform-origin: left bottom;
2362
+ -webkit-transform: rotate(-90deg);
2363
+ transform: rotate(-90deg);
2364
+ opacity: 0;
2365
+ }
2366
+ }
2367
+
2368
+ @keyframes rotateOutUpLeft {
2369
+ 0% {
2370
+ -webkit-transform-origin: left bottom;
2371
+ -ms-transform-origin: left bottom;
2372
+ transform-origin: left bottom;
2373
+ -webkit-transform: rotate(0);
2374
+ -ms-transform: rotate(0);
2375
+ transform: rotate(0);
2376
+ opacity: 1;
2377
+ }
2378
+
2379
+ 100% {
2380
+ -webkit-transform-origin: left bottom;
2381
+ -ms-transform-origin: left bottom;
2382
+ transform-origin: left bottom;
2383
+ -webkit-transform: rotate(-90deg);
2384
+ -ms-transform: rotate(-90deg);
2385
+ transform: rotate(-90deg);
2386
+ opacity: 0;
2387
+ }
2388
+ }
2389
+
2390
+ .rotateOutUpLeft {
2391
+ -webkit-animation-name: rotateOutUpLeft;
2392
+ animation-name: rotateOutUpLeft;
2393
+ }
2394
+
2395
+ @-webkit-keyframes rotateOutUpRight {
2396
+ 0% {
2397
+ -webkit-transform-origin: right bottom;
2398
+ transform-origin: right bottom;
2399
+ -webkit-transform: rotate(0);
2400
+ transform: rotate(0);
2401
+ opacity: 1;
2402
+ }
2403
+
2404
+ 100% {
2405
+ -webkit-transform-origin: right bottom;
2406
+ transform-origin: right bottom;
2407
+ -webkit-transform: rotate(90deg);
2408
+ transform: rotate(90deg);
2409
+ opacity: 0;
2410
+ }
2411
+ }
2412
+
2413
+ @keyframes rotateOutUpRight {
2414
+ 0% {
2415
+ -webkit-transform-origin: right bottom;
2416
+ -ms-transform-origin: right bottom;
2417
+ transform-origin: right bottom;
2418
+ -webkit-transform: rotate(0);
2419
+ -ms-transform: rotate(0);
2420
+ transform: rotate(0);
2421
+ opacity: 1;
2422
+ }
2423
+
2424
+ 100% {
2425
+ -webkit-transform-origin: right bottom;
2426
+ -ms-transform-origin: right bottom;
2427
+ transform-origin: right bottom;
2428
+ -webkit-transform: rotate(90deg);
2429
+ -ms-transform: rotate(90deg);
2430
+ transform: rotate(90deg);
2431
+ opacity: 0;
2432
+ }
2433
+ }
2434
+
2435
+ .rotateOutUpRight {
2436
+ -webkit-animation-name: rotateOutUpRight;
2437
+ animation-name: rotateOutUpRight;
2438
+ }
2439
+
2440
+ @-webkit-keyframes slideInDown {
2441
+ 0% {
2442
+ opacity: 0;
2443
+ -webkit-transform: translateY(-2000px);
2444
+ transform: translateY(-2000px);
2445
+ }
2446
+
2447
+ 100% {
2448
+ -webkit-transform: translateY(0);
2449
+ transform: translateY(0);
2450
+ }
2451
+ }
2452
+
2453
+ @keyframes slideInDown {
2454
+ 0% {
2455
+ opacity: 0;
2456
+ -webkit-transform: translateY(-2000px);
2457
+ -ms-transform: translateY(-2000px);
2458
+ transform: translateY(-2000px);
2459
+ }
2460
+
2461
+ 100% {
2462
+ -webkit-transform: translateY(0);
2463
+ -ms-transform: translateY(0);
2464
+ transform: translateY(0);
2465
+ }
2466
+ }
2467
+
2468
+ .slideInDown {
2469
+ -webkit-animation-name: slideInDown;
2470
+ animation-name: slideInDown;
2471
+ }
2472
+
2473
+ @-webkit-keyframes slideInLeft {
2474
+ 0% {
2475
+ opacity: 0;
2476
+ -webkit-transform: translateX(-2000px);
2477
+ transform: translateX(-2000px);
2478
+ }
2479
+
2480
+ 100% {
2481
+ -webkit-transform: translateX(0);
2482
+ transform: translateX(0);
2483
+ }
2484
+ }
2485
+
2486
+ @keyframes slideInLeft {
2487
+ 0% {
2488
+ opacity: 0;
2489
+ -webkit-transform: translateX(-2000px);
2490
+ -ms-transform: translateX(-2000px);
2491
+ transform: translateX(-2000px);
2492
+ }
2493
+
2494
+ 100% {
2495
+ -webkit-transform: translateX(0);
2496
+ -ms-transform: translateX(0);
2497
+ transform: translateX(0);
2498
+ }
2499
+ }
2500
+
2501
+ .slideInLeft {
2502
+ -webkit-animation-name: slideInLeft;
2503
+ animation-name: slideInLeft;
2504
+ }
2505
+
2506
+ @-webkit-keyframes slideInRight {
2507
+ 0% {
2508
+ opacity: 0;
2509
+ -webkit-transform: translateX(2000px);
2510
+ transform: translateX(2000px);
2511
+ }
2512
+
2513
+ 100% {
2514
+ -webkit-transform: translateX(0);
2515
+ transform: translateX(0);
2516
+ }
2517
+ }
2518
+
2519
+ @keyframes slideInRight {
2520
+ 0% {
2521
+ opacity: 0;
2522
+ -webkit-transform: translateX(2000px);
2523
+ -ms-transform: translateX(2000px);
2524
+ transform: translateX(2000px);
2525
+ }
2526
+
2527
+ 100% {
2528
+ -webkit-transform: translateX(0);
2529
+ -ms-transform: translateX(0);
2530
+ transform: translateX(0);
2531
+ }
2532
+ }
2533
+
2534
+ .slideInRight {
2535
+ -webkit-animation-name: slideInRight;
2536
+ animation-name: slideInRight;
2537
+ }
2538
+
2539
+ @-webkit-keyframes slideOutLeft {
2540
+ 0% {
2541
+ -webkit-transform: translateX(0);
2542
+ transform: translateX(0);
2543
+ }
2544
+
2545
+ 100% {
2546
+ opacity: 0;
2547
+ -webkit-transform: translateX(-2000px);
2548
+ transform: translateX(-2000px);
2549
+ }
2550
+ }
2551
+
2552
+ @keyframes slideOutLeft {
2553
+ 0% {
2554
+ -webkit-transform: translateX(0);
2555
+ -ms-transform: translateX(0);
2556
+ transform: translateX(0);
2557
+ }
2558
+
2559
+ 100% {
2560
+ opacity: 0;
2561
+ -webkit-transform: translateX(-2000px);
2562
+ -ms-transform: translateX(-2000px);
2563
+ transform: translateX(-2000px);
2564
+ }
2565
+ }
2566
+
2567
+ .slideOutLeft {
2568
+ -webkit-animation-name: slideOutLeft;
2569
+ animation-name: slideOutLeft;
2570
+ }
2571
+
2572
+ @-webkit-keyframes slideOutRight {
2573
+ 0% {
2574
+ -webkit-transform: translateX(0);
2575
+ transform: translateX(0);
2576
+ }
2577
+
2578
+ 100% {
2579
+ opacity: 0;
2580
+ -webkit-transform: translateX(2000px);
2581
+ transform: translateX(2000px);
2582
+ }
2583
+ }
2584
+
2585
+ @keyframes slideOutRight {
2586
+ 0% {
2587
+ -webkit-transform: translateX(0);
2588
+ -ms-transform: translateX(0);
2589
+ transform: translateX(0);
2590
+ }
2591
+
2592
+ 100% {
2593
+ opacity: 0;
2594
+ -webkit-transform: translateX(2000px);
2595
+ -ms-transform: translateX(2000px);
2596
+ transform: translateX(2000px);
2597
+ }
2598
+ }
2599
+
2600
+ .slideOutRight {
2601
+ -webkit-animation-name: slideOutRight;
2602
+ animation-name: slideOutRight;
2603
+ }
2604
+
2605
+ @-webkit-keyframes slideOutUp {
2606
+ 0% {
2607
+ -webkit-transform: translateY(0);
2608
+ transform: translateY(0);
2609
+ }
2610
+
2611
+ 100% {
2612
+ opacity: 0;
2613
+ -webkit-transform: translateY(-2000px);
2614
+ transform: translateY(-2000px);
2615
+ }
2616
+ }
2617
+
2618
+ @keyframes slideOutUp {
2619
+ 0% {
2620
+ -webkit-transform: translateY(0);
2621
+ -ms-transform: translateY(0);
2622
+ transform: translateY(0);
2623
+ }
2624
+
2625
+ 100% {
2626
+ opacity: 0;
2627
+ -webkit-transform: translateY(-2000px);
2628
+ -ms-transform: translateY(-2000px);
2629
+ transform: translateY(-2000px);
2630
+ }
2631
+ }
2632
+
2633
+ .slideOutUp {
2634
+ -webkit-animation-name: slideOutUp;
2635
+ animation-name: slideOutUp;
2636
+ }
2637
+
2638
+ @-webkit-keyframes slideInUp {
2639
+ 0% {
2640
+ opacity: 0;
2641
+ -webkit-transform: translateY(2000px);
2642
+ transform: translateY(2000px);
2643
+ }
2644
+
2645
+ 100% {
2646
+ opacity: 1;
2647
+ -webkit-transform: translateY(0);
2648
+ transform: translateY(0);
2649
+ }
2650
+ }
2651
+
2652
+ @keyframes slideInUp {
2653
+ 0% {
2654
+ opacity: 0;
2655
+ -webkit-transform: translateY(2000px);
2656
+ -ms-transform: translateY(2000px);
2657
+ transform: translateY(2000px);
2658
+ }
2659
+
2660
+ 100% {
2661
+ opacity: 1;
2662
+ -webkit-transform: translateY(0);
2663
+ -ms-transform: translateY(0);
2664
+ transform: translateY(0);
2665
+ }
2666
+ }
2667
+
2668
+ .slideInUp {
2669
+ -webkit-animation-name: slideInUp;
2670
+ animation-name: slideInUp;
2671
+ }
2672
+
2673
+ @-webkit-keyframes slideOutDown {
2674
+ 0% {
2675
+ -webkit-transform: translateY(0);
2676
+ transform: translateY(0);
2677
+ }
2678
+
2679
+ 100% {
2680
+ opacity: 0;
2681
+ -webkit-transform: translateY(2000px);
2682
+ transform: translateY(2000px);
2683
+ }
2684
+ }
2685
+
2686
+ @keyframes slideOutDown {
2687
+ 0% {
2688
+ -webkit-transform: translateY(0);
2689
+ -ms-transform: translateY(0);
2690
+ transform: translateY(0);
2691
+ }
2692
+
2693
+ 100% {
2694
+ opacity: 0;
2695
+ -webkit-transform: translateY(2000px);
2696
+ -ms-transform: translateY(2000px);
2697
+ transform: translateY(2000px);
2698
+ }
2699
+ }
2700
+
2701
+ .slideOutDown {
2702
+ -webkit-animation-name: slideOutDown;
2703
+ animation-name: slideOutDown;
2704
+ }
2705
+
2706
+ @-webkit-keyframes hinge {
2707
+ 0% {
2708
+ -webkit-transform: rotate(0);
2709
+ transform: rotate(0);
2710
+ -webkit-transform-origin: top left;
2711
+ transform-origin: top left;
2712
+ -webkit-animation-timing-function: ease-in-out;
2713
+ animation-timing-function: ease-in-out;
2714
+ }
2715
+
2716
+ 20%, 60% {
2717
+ -webkit-transform: rotate(80deg);
2718
+ transform: rotate(80deg);
2719
+ -webkit-transform-origin: top left;
2720
+ transform-origin: top left;
2721
+ -webkit-animation-timing-function: ease-in-out;
2722
+ animation-timing-function: ease-in-out;
2723
+ }
2724
+
2725
+ 40% {
2726
+ -webkit-transform: rotate(60deg);
2727
+ transform: rotate(60deg);
2728
+ -webkit-transform-origin: top left;
2729
+ transform-origin: top left;
2730
+ -webkit-animation-timing-function: ease-in-out;
2731
+ animation-timing-function: ease-in-out;
2732
+ }
2733
+
2734
+ 80% {
2735
+ -webkit-transform: rotate(60deg) translateY(0);
2736
+ transform: rotate(60deg) translateY(0);
2737
+ -webkit-transform-origin: top left;
2738
+ transform-origin: top left;
2739
+ -webkit-animation-timing-function: ease-in-out;
2740
+ animation-timing-function: ease-in-out;
2741
+ opacity: 1;
2742
+ }
2743
+
2744
+ 100% {
2745
+ -webkit-transform: translateY(700px);
2746
+ transform: translateY(700px);
2747
+ opacity: 0;
2748
+ }
2749
+ }
2750
+
2751
+ @keyframes hinge {
2752
+ 0% {
2753
+ -webkit-transform: rotate(0);
2754
+ -ms-transform: rotate(0);
2755
+ transform: rotate(0);
2756
+ -webkit-transform-origin: top left;
2757
+ -ms-transform-origin: top left;
2758
+ transform-origin: top left;
2759
+ -webkit-animation-timing-function: ease-in-out;
2760
+ animation-timing-function: ease-in-out;
2761
+ }
2762
+
2763
+ 20%, 60% {
2764
+ -webkit-transform: rotate(80deg);
2765
+ -ms-transform: rotate(80deg);
2766
+ transform: rotate(80deg);
2767
+ -webkit-transform-origin: top left;
2768
+ -ms-transform-origin: top left;
2769
+ transform-origin: top left;
2770
+ -webkit-animation-timing-function: ease-in-out;
2771
+ animation-timing-function: ease-in-out;
2772
+ }
2773
+
2774
+ 40% {
2775
+ -webkit-transform: rotate(60deg);
2776
+ -ms-transform: rotate(60deg);
2777
+ transform: rotate(60deg);
2778
+ -webkit-transform-origin: top left;
2779
+ -ms-transform-origin: top left;
2780
+ transform-origin: top left;
2781
+ -webkit-animation-timing-function: ease-in-out;
2782
+ animation-timing-function: ease-in-out;
2783
+ }
2784
+
2785
+ 80% {
2786
+ -webkit-transform: rotate(60deg) translateY(0);
2787
+ -ms-transform: rotate(60deg) translateY(0);
2788
+ transform: rotate(60deg) translateY(0);
2789
+ -webkit-transform-origin: top left;
2790
+ -ms-transform-origin: top left;
2791
+ transform-origin: top left;
2792
+ -webkit-animation-timing-function: ease-in-out;
2793
+ animation-timing-function: ease-in-out;
2794
+ opacity: 1;
2795
+ }
2796
+
2797
+ 100% {
2798
+ -webkit-transform: translateY(700px);
2799
+ -ms-transform: translateY(700px);
2800
+ transform: translateY(700px);
2801
+ opacity: 0;
2802
+ }
2803
+ }
2804
+
2805
+ .hinge {
2806
+ -webkit-animation-name: hinge;
2807
+ animation-name: hinge;
2808
+ }
2809
+
2810
+ /* originally authored by Nick Pettit - https://github.com/nickpettit/glide */
2811
+
2812
+ @-webkit-keyframes rollIn {
2813
+ 0% {
2814
+ opacity: 0;
2815
+ -webkit-transform: translateX(-100%) rotate(-120deg);
2816
+ transform: translateX(-100%) rotate(-120deg);
2817
+ }
2818
+
2819
+ 100% {
2820
+ opacity: 1;
2821
+ -webkit-transform: translateX(0px) rotate(0deg);
2822
+ transform: translateX(0px) rotate(0deg);
2823
+ }
2824
+ }
2825
+
2826
+ @keyframes rollIn {
2827
+ 0% {
2828
+ opacity: 0;
2829
+ -webkit-transform: translateX(-100%) rotate(-120deg);
2830
+ -ms-transform: translateX(-100%) rotate(-120deg);
2831
+ transform: translateX(-100%) rotate(-120deg);
2832
+ }
2833
+
2834
+ 100% {
2835
+ opacity: 1;
2836
+ -webkit-transform: translateX(0px) rotate(0deg);
2837
+ -ms-transform: translateX(0px) rotate(0deg);
2838
+ transform: translateX(0px) rotate(0deg);
2839
+ }
2840
+ }
2841
+
2842
+ .rollIn {
2843
+ -webkit-animation-name: rollIn;
2844
+ animation-name: rollIn;
2845
+ }
2846
+
2847
+ /* originally authored by Nick Pettit - https://github.com/nickpettit/glide */
2848
+
2849
+ @-webkit-keyframes rollOut {
2850
+ 0% {
2851
+ opacity: 1;
2852
+ -webkit-transform: translateX(0px) rotate(0deg);
2853
+ transform: translateX(0px) rotate(0deg);
2854
+ }
2855
+
2856
+ 100% {
2857
+ opacity: 0;
2858
+ -webkit-transform: translateX(100%) rotate(120deg);
2859
+ transform: translateX(100%) rotate(120deg);
2860
+ }
2861
+ }
2862
+
2863
+ @keyframes rollOut {
2864
+ 0% {
2865
+ opacity: 1;
2866
+ -webkit-transform: translateX(0px) rotate(0deg);
2867
+ -ms-transform: translateX(0px) rotate(0deg);
2868
+ transform: translateX(0px) rotate(0deg);
2869
+ }
2870
+
2871
+ 100% {
2872
+ opacity: 0;
2873
+ -webkit-transform: translateX(100%) rotate(120deg);
2874
+ -ms-transform: translateX(100%) rotate(120deg);
2875
+ transform: translateX(100%) rotate(120deg);
2876
+ }
2877
+ }
2878
+
2879
+ .rollOut {
2880
+ -webkit-animation-name: rollOut;
2881
+ animation-name: rollOut;
2882
+ }
2883
+
2884
+ @-webkit-keyframes zoomIn {
2885
+ 0% {
2886
+ opacity: 0;
2887
+ -webkit-transform: scale(.3);
2888
+ transform: scale(.3);
2889
+ }
2890
+
2891
+ 50% {
2892
+ opacity: 1;
2893
+ }
2894
+ }
2895
+
2896
+ @keyframes zoomIn {
2897
+ 0% {
2898
+ opacity: 0;
2899
+ -webkit-transform: scale(.3);
2900
+ -ms-transform: scale(.3);
2901
+ transform: scale(.3);
2902
+ }
2903
+
2904
+ 50% {
2905
+ opacity: 1;
2906
+ }
2907
+ }
2908
+
2909
+ .zoomIn {
2910
+ -webkit-animation-name: zoomIn;
2911
+ animation-name: zoomIn;
2912
+ }
2913
+
2914
+ @-webkit-keyframes zoomInDown {
2915
+ 0% {
2916
+ opacity: 0;
2917
+ -webkit-transform: scale(.1) translateY(-2000px);
2918
+ transform: scale(.1) translateY(-2000px);
2919
+ -webkit-animation-timing-function: ease-in-out;
2920
+ animation-timing-function: ease-in-out;
2921
+ }
2922
+
2923
+ 60% {
2924
+ opacity: 1;
2925
+ -webkit-transform: scale(.475) translateY(60px);
2926
+ transform: scale(.475) translateY(60px);
2927
+ -webkit-animation-timing-function: ease-out;
2928
+ animation-timing-function: ease-out;
2929
+ }
2930
+ }
2931
+
2932
+ @keyframes zoomInDown {
2933
+ 0% {
2934
+ opacity: 0;
2935
+ -webkit-transform: scale(.1) translateY(-2000px);
2936
+ -ms-transform: scale(.1) translateY(-2000px);
2937
+ transform: scale(.1) translateY(-2000px);
2938
+ -webkit-animation-timing-function: ease-in-out;
2939
+ animation-timing-function: ease-in-out;
2940
+ }
2941
+
2942
+ 60% {
2943
+ opacity: 1;
2944
+ -webkit-transform: scale(.475) translateY(60px);
2945
+ -ms-transform: scale(.475) translateY(60px);
2946
+ transform: scale(.475) translateY(60px);
2947
+ -webkit-animation-timing-function: ease-out;
2948
+ animation-timing-function: ease-out;
2949
+ }
2950
+ }
2951
+
2952
+ .zoomInDown {
2953
+ -webkit-animation-name: zoomInDown;
2954
+ animation-name: zoomInDown;
2955
+ }
2956
+
2957
+ @-webkit-keyframes zoomInLeft {
2958
+ 0% {
2959
+ opacity: 0;
2960
+ -webkit-transform: scale(.1) translateX(-2000px);
2961
+ transform: scale(.1) translateX(-2000px);
2962
+ -webkit-animation-timing-function: ease-in-out;
2963
+ animation-timing-function: ease-in-out;
2964
+ }
2965
+
2966
+ 60% {
2967
+ opacity: 1;
2968
+ -webkit-transform: scale(.475) translateX(48px);
2969
+ transform: scale(.475) translateX(48px);
2970
+ -webkit-animation-timing-function: ease-out;
2971
+ animation-timing-function: ease-out;
2972
+ }
2973
+ }
2974
+
2975
+ @keyframes zoomInLeft {
2976
+ 0% {
2977
+ opacity: 0;
2978
+ -webkit-transform: scale(.1) translateX(-2000px);
2979
+ -ms-transform: scale(.1) translateX(-2000px);
2980
+ transform: scale(.1) translateX(-2000px);
2981
+ -webkit-animation-timing-function: ease-in-out;
2982
+ animation-timing-function: ease-in-out;
2983
+ }
2984
+
2985
+ 60% {
2986
+ opacity: 1;
2987
+ -webkit-transform: scale(.475) translateX(48px);
2988
+ -ms-transform: scale(.475) translateX(48px);
2989
+ transform: scale(.475) translateX(48px);
2990
+ -webkit-animation-timing-function: ease-out;
2991
+ animation-timing-function: ease-out;
2992
+ }
2993
+ }
2994
+
2995
+ .zoomInLeft {
2996
+ -webkit-animation-name: zoomInLeft;
2997
+ animation-name: zoomInLeft;
2998
+ }
2999
+
3000
+ @-webkit-keyframes zoomInRight {
3001
+ 0% {
3002
+ opacity: 0;
3003
+ -webkit-transform: scale(.1) translateX(2000px);
3004
+ transform: scale(.1) translateX(2000px);
3005
+ -webkit-animation-timing-function: ease-in-out;
3006
+ animation-timing-function: ease-in-out;
3007
+ }
3008
+
3009
+ 60% {
3010
+ opacity: 1;
3011
+ -webkit-transform: scale(.475) translateX(-48px);
3012
+ transform: scale(.475) translateX(-48px);
3013
+ -webkit-animation-timing-function: ease-out;
3014
+ animation-timing-function: ease-out;
3015
+ }
3016
+ }
3017
+
3018
+ @keyframes zoomInRight {
3019
+ 0% {
3020
+ opacity: 0;
3021
+ -webkit-transform: scale(.1) translateX(2000px);
3022
+ -ms-transform: scale(.1) translateX(2000px);
3023
+ transform: scale(.1) translateX(2000px);
3024
+ -webkit-animation-timing-function: ease-in-out;
3025
+ animation-timing-function: ease-in-out;
3026
+ }
3027
+
3028
+ 60% {
3029
+ opacity: 1;
3030
+ -webkit-transform: scale(.475) translateX(-48px);
3031
+ -ms-transform: scale(.475) translateX(-48px);
3032
+ transform: scale(.475) translateX(-48px);
3033
+ -webkit-animation-timing-function: ease-out;
3034
+ animation-timing-function: ease-out;
3035
+ }
3036
+ }
3037
+
3038
+ .zoomInRight {
3039
+ -webkit-animation-name: zoomInRight;
3040
+ animation-name: zoomInRight;
3041
+ }
3042
+
3043
+ @-webkit-keyframes zoomInUp {
3044
+ 0% {
3045
+ opacity: 0;
3046
+ -webkit-transform: scale(.1) translateY(2000px);
3047
+ transform: scale(.1) translateY(2000px);
3048
+ -webkit-animation-timing-function: ease-in-out;
3049
+ animation-timing-function: ease-in-out;
3050
+ }
3051
+
3052
+ 60% {
3053
+ opacity: 1;
3054
+ -webkit-transform: scale(.475) translateY(-60px);
3055
+ transform: scale(.475) translateY(-60px);
3056
+ -webkit-animation-timing-function: ease-out;
3057
+ animation-timing-function: ease-out;
3058
+ }
3059
+ }
3060
+
3061
+ @keyframes zoomInUp {
3062
+ 0% {
3063
+ opacity: 0;
3064
+ -webkit-transform: scale(.1) translateY(2000px);
3065
+ -ms-transform: scale(.1) translateY(2000px);
3066
+ transform: scale(.1) translateY(2000px);
3067
+ -webkit-animation-timing-function: ease-in-out;
3068
+ animation-timing-function: ease-in-out;
3069
+ }
3070
+
3071
+ 60% {
3072
+ opacity: 1;
3073
+ -webkit-transform: scale(.475) translateY(-60px);
3074
+ -ms-transform: scale(.475) translateY(-60px);
3075
+ transform: scale(.475) translateY(-60px);
3076
+ -webkit-animation-timing-function: ease-out;
3077
+ animation-timing-function: ease-out;
3078
+ }
3079
+ }
3080
+
3081
+ .zoomInUp {
3082
+ -webkit-animation-name: zoomInUp;
3083
+ animation-name: zoomInUp;
3084
+ }
3085
+
3086
+ @-webkit-keyframes zoomOut {
3087
+ 0% {
3088
+ opacity: 1;
3089
+ -webkit-transform: scale(1);
3090
+ transform: scale(1);
3091
+ }
3092
+
3093
+ 50% {
3094
+ opacity: 0;
3095
+ -webkit-transform: scale(.3);
3096
+ transform: scale(.3);
3097
+ }
3098
+
3099
+ 100% {
3100
+ opacity: 0;
3101
+ }
3102
+ }
3103
+
3104
+ @keyframes zoomOut {
3105
+ 0% {
3106
+ opacity: 1;
3107
+ -webkit-transform: scale(1);
3108
+ -ms-transform: scale(1);
3109
+ transform: scale(1);
3110
+ }
3111
+
3112
+ 50% {
3113
+ opacity: 0;
3114
+ -webkit-transform: scale(.3);
3115
+ -ms-transform: scale(.3);
3116
+ transform: scale(.3);
3117
+ }
3118
+
3119
+ 100% {
3120
+ opacity: 0;
3121
+ }
3122
+ }
3123
+
3124
+ .zoomOut {
3125
+ -webkit-animation-name: zoomOut;
3126
+ animation-name: zoomOut;
3127
+ }
3128
+
3129
+ @-webkit-keyframes zoomOutDown {
3130
+ 40% {
3131
+ opacity: 1;
3132
+ -webkit-transform: scale(.475) translateY(-60px);
3133
+ transform: scale(.475) translateY(-60px);
3134
+ -webkit-animation-timing-function: linear;
3135
+ animation-timing-function: linear;
3136
+ }
3137
+
3138
+ 100% {
3139
+ opacity: 0;
3140
+ -webkit-transform: scale(.1) translateY(2000px);
3141
+ transform: scale(.1) translateY(2000px);
3142
+ -webkit-transform-origin: center bottom;
3143
+ transform-origin: center bottom;
3144
+ }
3145
+ }
3146
+
3147
+ @keyframes zoomOutDown {
3148
+ 40% {
3149
+ opacity: 1;
3150
+ -webkit-transform: scale(.475) translateY(-60px);
3151
+ -ms-transform: scale(.475) translateY(-60px);
3152
+ transform: scale(.475) translateY(-60px);
3153
+ -webkit-animation-timing-function: linear;
3154
+ animation-timing-function: linear;
3155
+ }
3156
+
3157
+ 100% {
3158
+ opacity: 0;
3159
+ -webkit-transform: scale(.1) translateY(2000px);
3160
+ -ms-transform: scale(.1) translateY(2000px);
3161
+ transform: scale(.1) translateY(2000px);
3162
+ -webkit-transform-origin: center bottom;
3163
+ -ms-transform-origin: center bottom;
3164
+ transform-origin: center bottom;
3165
+ }
3166
+ }
3167
+
3168
+ .zoomOutDown {
3169
+ -webkit-animation-name: zoomOutDown;
3170
+ animation-name: zoomOutDown;
3171
+ }
3172
+
3173
+ @-webkit-keyframes zoomOutLeft {
3174
+ 40% {
3175
+ opacity: 1;
3176
+ -webkit-transform: scale(.475) translateX(42px);
3177
+ transform: scale(.475) translateX(42px);
3178
+ -webkit-animation-timing-function: linear;
3179
+ animation-timing-function: linear;
3180
+ }
3181
+
3182
+ 100% {
3183
+ opacity: 0;
3184
+ -webkit-transform: scale(.1) translateX(-2000px);
3185
+ transform: scale(.1) translateX(-2000px);
3186
+ -webkit-transform-origin: left center;
3187
+ transform-origin: left center;
3188
+ }
3189
+ }
3190
+
3191
+ @keyframes zoomOutLeft {
3192
+ 40% {
3193
+ opacity: 1;
3194
+ -webkit-transform: scale(.475) translateX(42px);
3195
+ -ms-transform: scale(.475) translateX(42px);
3196
+ transform: scale(.475) translateX(42px);
3197
+ -webkit-animation-timing-function: linear;
3198
+ animation-timing-function: linear;
3199
+ }
3200
+
3201
+ 100% {
3202
+ opacity: 0;
3203
+ -webkit-transform: scale(.1) translateX(-2000px);
3204
+ -ms-transform: scale(.1) translateX(-2000px);
3205
+ transform: scale(.1) translateX(-2000px);
3206
+ -webkit-transform-origin: left center;
3207
+ -ms-transform-origin: left center;
3208
+ transform-origin: left center;
3209
+ }
3210
+ }
3211
+
3212
+ .zoomOutLeft {
3213
+ -webkit-animation-name: zoomOutLeft;
3214
+ animation-name: zoomOutLeft;
3215
+ }
3216
+
3217
+ @-webkit-keyframes zoomOutRight {
3218
+ 40% {
3219
+ opacity: 1;
3220
+ -webkit-transform: scale(.475) translateX(-42px);
3221
+ transform: scale(.475) translateX(-42px);
3222
+ -webkit-animation-timing-function: linear;
3223
+ animation-timing-function: linear;
3224
+ }
3225
+
3226
+ 100% {
3227
+ opacity: 0;
3228
+ -webkit-transform: scale(.1) translateX(2000px);
3229
+ transform: scale(.1) translateX(2000px);
3230
+ -webkit-transform-origin: right center;
3231
+ transform-origin: right center;
3232
+ }
3233
+ }
3234
+
3235
+ @keyframes zoomOutRight {
3236
+ 40% {
3237
+ opacity: 1;
3238
+ -webkit-transform: scale(.475) translateX(-42px);
3239
+ -ms-transform: scale(.475) translateX(-42px);
3240
+ transform: scale(.475) translateX(-42px);
3241
+ -webkit-animation-timing-function: linear;
3242
+ animation-timing-function: linear;
3243
+ }
3244
+
3245
+ 100% {
3246
+ opacity: 0;
3247
+ -webkit-transform: scale(.1) translateX(2000px);
3248
+ -ms-transform: scale(.1) translateX(2000px);
3249
+ transform: scale(.1) translateX(2000px);
3250
+ -webkit-transform-origin: right center;
3251
+ -ms-transform-origin: right center;
3252
+ transform-origin: right center;
3253
+ }
3254
+ }
3255
+
3256
+ .zoomOutRight {
3257
+ -webkit-animation-name: zoomOutRight;
3258
+ animation-name: zoomOutRight;
3259
+ }
3260
+
3261
+ @-webkit-keyframes zoomOutUp {
3262
+ 40% {
3263
+ opacity: 1;
3264
+ -webkit-transform: scale(.475) translateY(60px);
3265
+ transform: scale(.475) translateY(60px);
3266
+ -webkit-animation-timing-function: linear;
3267
+ animation-timing-function: linear;
3268
+ }
3269
+
3270
+ 100% {
3271
+ opacity: 0;
3272
+ -webkit-transform: scale(.1) translateY(-2000px);
3273
+ transform: scale(.1) translateY(-2000px);
3274
+ -webkit-transform-origin: center top;
3275
+ transform-origin: center top;
3276
+ }
3277
+ }
3278
+
3279
+ @keyframes zoomOutUp {
3280
+ 40% {
3281
+ opacity: 1;
3282
+ -webkit-transform: scale(.475) translateY(60px);
3283
+ -ms-transform: scale(.475) translateY(60px);
3284
+ transform: scale(.475) translateY(60px);
3285
+ -webkit-animation-timing-function: linear;
3286
+ animation-timing-function: linear;
3287
+ }
3288
+
3289
+ 100% {
3290
+ opacity: 0;
3291
+ -webkit-transform: scale(.1) translateY(-2000px);
3292
+ -ms-transform: scale(.1) translateY(-2000px);
3293
+ transform: scale(.1) translateY(-2000px);
3294
+ -webkit-transform-origin: center top;
3295
+ -ms-transform-origin: center top;
3296
+ transform-origin: center top;
3297
+ }
3298
+ }
3299
+
3300
+ .zoomOutUp {
3301
+ -webkit-animation-name: zoomOutUp;
3302
+ animation-name: zoomOutUp;
3303
  }
css/fonts/yks-mc-font.svg CHANGED
@@ -1,13 +1,13 @@
1
- <?xml version="1.0" standalone="no"?>
2
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
- <svg xmlns="http://www.w3.org/2000/svg">
4
- <metadata>Generated by IcoMoon</metadata>
5
- <defs>
6
- <font id="yks-mc-font" horiz-adv-x="512">
7
- <font-face units-per-em="512" ascent="480" descent="-32" />
8
- <missing-glyph horiz-adv-x="512" />
9
- <glyph unicode="&#x20;" d="" horiz-adv-x="256" />
10
- <glyph unicode="&#xe600;" d="M0 265.739v-214.261h136.348l0.279-32.556c0.279-18.087 0.279-35.618 0.279-38.957-0.279-3.618 0.279-6.4 0.835-6.4 0.556 0 19.756 17.531 42.296 38.957l40.905 38.957h207.582v428.522h-428.522v-214.261zM258.226 359.791c1.948-1.948 3.339-5.008 3.339-6.957 0-3.618-66.782-165.287-74.017-179.478-6.4-12.243-23.374-9.183-23.374 4.174 0 4.731 36.174 94.052 64.556 160 10.018 23.096 11.965 25.6 18.643 25.6 4.174 0 8.905-1.392 10.852-3.339zM144.696 331.409c0-18.365-0.556-20.87-5.565-22.539-3.061-0.835-16.974-7.792-30.887-15.026l-25.322-13.635 30.887-16.139 30.887-16.417v-20.313c0-11.408-1.113-20.035-2.226-19.479-1.113 0.557-25.6 13.356-54.261 28.382l-52.035 27.826v32.279l13.356 7.235c57.044 31.165 88.765 47.861 91.826 48.139 2.226 0.279 3.339-5.565 3.339-20.313zM336.418 324.174l50.365-26.435v-34.505l-35.339-18.644c-19.757-10.296-43.409-22.817-52.87-28.105l-17.531-9.461v41.739l22.261 11.687c12.8 6.678 21.426 12.8 20.313 14.469-0.835 1.67-0.279 1.948 1.392 0.835 1.67-1.113 6.4-0.279 10.017 1.67 6.678 3.618 5.844 4.174-23.652 18.921l-30.331 15.305v20.313c0 11.409 1.113 20.035 2.505 19.478 1.392-0.279 25.043-12.8 52.87-27.269z" horiz-adv-x="429" />
11
- <glyph unicode="&#xe601;" d="M248 432c-119.296 0-216-96.704-216-216s96.704-216 216-216 216 96.704 216 216-96.704 216-216 216zM248 48c-92.784 0-168 75.216-168 168s75.216 168 168 168 168-75.216 168-168-75.216-168-168-168zM248 320c-13.248 0-24-10.736-24-24v-80.992c0-13.248 10.752-24 24-24s24 10.752 24 24v80.992c0 13.264-10.752 24-24 24zM248 160c-13.248 0-24-10.752-24-24s10.752-24 24-24 24 10.752 24 24-10.752 24-24 24z" />
12
- <glyph unicode="&#xe602;" d="M478.464 167.142l-44.211 39.424c-12.8 11.418-12.8 30.054 0 41.472l44.211 39.398c12.8 11.417 9.37 22.041-7.603 23.654l-58.599 5.555c-16.973 1.613-26.112 16.205-20.275 32.435l31.104 86.579c5.837 16.231-1.305 22.144-15.846 13.133l-69.145-42.752c-14.541-9.011-33.331-4.096-41.754 10.931l-25.063 44.697c-8.397 15.027-22.323 15.104-30.899 0.179l-23.27-40.499c-8.576-14.925-28.288-21.299-43.802-14.157l-40.96 18.816c-15.539 7.117-27.469-1.127-26.547-18.381l2.227-41.344c0.921-17.229-11.802-34.995-28.263-39.424l-39.552-10.624c-16.461-4.454-19.482-17.408-6.681-28.825l44.211-39.399c12.8-11.392 12.8-30.055 0-41.447l-44.211-39.373c-12.8-11.443-9.421-22.451 7.501-24.499l53.632-6.502c16.922-2.099 26.368-17.203 20.966-33.562l-27.52-83.405c-5.401-16.409 2.304-22.81 17.101-14.208l63.053 36.454c14.822 8.601 34.714 3.84 44.237-10.445l26.189-39.347c9.498-14.361 23.808-13.543 31.719 1.741l23.014 44.339c7.962 15.309 26.957 21.555 42.214 13.901l44.391-22.195c15.309-7.654 27.059 0.205 26.137 17.459l-2.227 41.344c-0.921 17.255 11.801 34.995 28.262 39.45l39.526 10.599c16.512 4.48 19.533 17.433 6.733 28.825zM281.6 119.808h-51.2v53.76h51.2v-53.76zM281.6 201.702h-51.2v133.12h51.2v-133.12z" />
13
  </font></defs></svg>
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
+ <svg xmlns="http://www.w3.org/2000/svg">
4
+ <metadata>Generated by IcoMoon</metadata>
5
+ <defs>
6
+ <font id="yks-mc-font" horiz-adv-x="512">
7
+ <font-face units-per-em="512" ascent="480" descent="-32" />
8
+ <missing-glyph horiz-adv-x="512" />
9
+ <glyph unicode="&#x20;" d="" horiz-adv-x="256" />
10
+ <glyph unicode="&#xe600;" d="M0 265.739v-214.261h136.348l0.279-32.556c0.279-18.087 0.279-35.618 0.279-38.957-0.279-3.618 0.279-6.4 0.835-6.4 0.556 0 19.756 17.531 42.296 38.957l40.905 38.957h207.582v428.522h-428.522v-214.261zM258.226 359.791c1.948-1.948 3.339-5.008 3.339-6.957 0-3.618-66.782-165.287-74.017-179.478-6.4-12.243-23.374-9.183-23.374 4.174 0 4.731 36.174 94.052 64.556 160 10.018 23.096 11.965 25.6 18.643 25.6 4.174 0 8.905-1.392 10.852-3.339zM144.696 331.409c0-18.365-0.556-20.87-5.565-22.539-3.061-0.835-16.974-7.792-30.887-15.026l-25.322-13.635 30.887-16.139 30.887-16.417v-20.313c0-11.408-1.113-20.035-2.226-19.479-1.113 0.557-25.6 13.356-54.261 28.382l-52.035 27.826v32.279l13.356 7.235c57.044 31.165 88.765 47.861 91.826 48.139 2.226 0.279 3.339-5.565 3.339-20.313zM336.418 324.174l50.365-26.435v-34.505l-35.339-18.644c-19.757-10.296-43.409-22.817-52.87-28.105l-17.531-9.461v41.739l22.261 11.687c12.8 6.678 21.426 12.8 20.313 14.469-0.835 1.67-0.279 1.948 1.392 0.835 1.67-1.113 6.4-0.279 10.017 1.67 6.678 3.618 5.844 4.174-23.652 18.921l-30.331 15.305v20.313c0 11.409 1.113 20.035 2.505 19.478 1.392-0.279 25.043-12.8 52.87-27.269z" horiz-adv-x="429" />
11
+ <glyph unicode="&#xe601;" d="M248 432c-119.296 0-216-96.704-216-216s96.704-216 216-216 216 96.704 216 216-96.704 216-216 216zM248 48c-92.784 0-168 75.216-168 168s75.216 168 168 168 168-75.216 168-168-75.216-168-168-168zM248 320c-13.248 0-24-10.736-24-24v-80.992c0-13.248 10.752-24 24-24s24 10.752 24 24v80.992c0 13.264-10.752 24-24 24zM248 160c-13.248 0-24-10.752-24-24s10.752-24 24-24 24 10.752 24 24-10.752 24-24 24z" />
12
+ <glyph unicode="&#xe602;" d="M478.464 167.142l-44.211 39.424c-12.8 11.418-12.8 30.054 0 41.472l44.211 39.398c12.8 11.417 9.37 22.041-7.603 23.654l-58.599 5.555c-16.973 1.613-26.112 16.205-20.275 32.435l31.104 86.579c5.837 16.231-1.305 22.144-15.846 13.133l-69.145-42.752c-14.541-9.011-33.331-4.096-41.754 10.931l-25.063 44.697c-8.397 15.027-22.323 15.104-30.899 0.179l-23.27-40.499c-8.576-14.925-28.288-21.299-43.802-14.157l-40.96 18.816c-15.539 7.117-27.469-1.127-26.547-18.381l2.227-41.344c0.921-17.229-11.802-34.995-28.263-39.424l-39.552-10.624c-16.461-4.454-19.482-17.408-6.681-28.825l44.211-39.399c12.8-11.392 12.8-30.055 0-41.447l-44.211-39.373c-12.8-11.443-9.421-22.451 7.501-24.499l53.632-6.502c16.922-2.099 26.368-17.203 20.966-33.562l-27.52-83.405c-5.401-16.409 2.304-22.81 17.101-14.208l63.053 36.454c14.822 8.601 34.714 3.84 44.237-10.445l26.189-39.347c9.498-14.361 23.808-13.543 31.719 1.741l23.014 44.339c7.962 15.309 26.957 21.555 42.214 13.901l44.391-22.195c15.309-7.654 27.059 0.205 26.137 17.459l-2.227 41.344c-0.921 17.255 11.801 34.995 28.262 39.45l39.526 10.599c16.512 4.48 19.533 17.433 6.733 28.825zM281.6 119.808h-51.2v53.76h51.2v-53.76zM281.6 201.702h-51.2v133.12h51.2v-133.12z" />
13
  </font></defs></svg>
css/jquery-ui-1.10.4.smoothness.css CHANGED
@@ -1,1178 +1,1178 @@
1
- /*! jQuery UI - v1.10.4 - 2014-01-17
2
- * http://jqueryui.com
3
- * Includes: jquery.ui.core.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css, jquery.ui.theme.css
4
- * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
5
- * Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
6
-
7
- /* Layout helpers
8
- ----------------------------------*/
9
- .ui-helper-hidden {
10
- display: none;
11
- }
12
- .ui-helper-hidden-accessible {
13
- border: 0;
14
- clip: rect(0 0 0 0);
15
- height: 1px;
16
- margin: -1px;
17
- overflow: hidden;
18
- padding: 0;
19
- position: absolute;
20
- width: 1px;
21
- }
22
- .ui-helper-reset {
23
- margin: 0;
24
- padding: 0;
25
- border: 0;
26
- outline: 0;
27
- line-height: 1.3;
28
- text-decoration: none;
29
- font-size: 100%;
30
- list-style: none;
31
- }
32
- .ui-helper-clearfix:before,
33
- .ui-helper-clearfix:after {
34
- content: "";
35
- display: table;
36
- border-collapse: collapse;
37
- }
38
- .ui-helper-clearfix:after {
39
- clear: both;
40
- }
41
- .ui-helper-clearfix {
42
- min-height: 0; /* support: IE7 */
43
- }
44
- .ui-helper-zfix {
45
- width: 100%;
46
- height: 100%;
47
- top: 0;
48
- left: 0;
49
- position: absolute;
50
- opacity: 0;
51
- filter:Alpha(Opacity=0);
52
- }
53
-
54
- .ui-front {
55
- z-index: 100;
56
- }
57
-
58
-
59
- /* Interaction Cues
60
- ----------------------------------*/
61
- .ui-state-disabled {
62
- cursor: default !important;
63
- }
64
-
65
-
66
- /* Icons
67
- ----------------------------------*/
68
-
69
- /* states and images */
70
- .ui-icon {
71
- display: block;
72
- text-indent: -99999px;
73
- overflow: hidden;
74
- background-repeat: no-repeat;
75
- }
76
-
77
-
78
- /* Misc visuals
79
- ----------------------------------*/
80
-
81
- /* Overlays */
82
- .ui-widget-overlay {
83
- position: fixed;
84
- top: 0;
85
- left: 0;
86
- width: 100%;
87
- height: 100%;
88
- }
89
- .ui-accordion .ui-accordion-header {
90
- display: block;
91
- cursor: pointer;
92
- position: relative;
93
- margin-top: 2px;
94
- padding: .5em .5em .5em .7em;
95
- min-height: 0; /* support: IE7 */
96
- }
97
- .ui-accordion .ui-accordion-icons {
98
- padding-left: 2.2em;
99
- }
100
- .ui-accordion .ui-accordion-noicons {
101
- padding-left: .7em;
102
- }
103
- .ui-accordion .ui-accordion-icons .ui-accordion-icons {
104
- padding-left: 2.2em;
105
- }
106
- .ui-accordion .ui-accordion-header .ui-accordion-header-icon {
107
- position: absolute;
108
- left: .5em;
109
- top: 50%;
110
- margin-top: -8px;
111
- }
112
- .ui-accordion .ui-accordion-content {
113
- padding: 1em 2.2em;
114
- border-top: 0;
115
- overflow: auto;
116
- }
117
- .ui-autocomplete {
118
- position: absolute;
119
- top: 0;
120
- left: 0;
121
- cursor: default;
122
- }
123
- .ui-button {
124
- display: inline-block;
125
- position: relative;
126
- padding: 0;
127
- line-height: normal;
128
- margin-right: .1em;
129
- cursor: pointer;
130
- vertical-align: middle;
131
- text-align: center;
132
- overflow: visible; /* removes extra width in IE */
133
- }
134
- .ui-button,
135
- .ui-button:link,
136
- .ui-button:visited,
137
- .ui-button:hover,
138
- .ui-button:active {
139
- text-decoration: none;
140
- }
141
- /* to make room for the icon, a width needs to be set here */
142
- .ui-button-icon-only {
143
- width: 2.2em;
144
- }
145
- /* button elements seem to need a little more width */
146
- button.ui-button-icon-only {
147
- width: 2.4em;
148
- }
149
- .ui-button-icons-only {
150
- width: 3.4em;
151
- }
152
- button.ui-button-icons-only {
153
- width: 3.7em;
154
- }
155
-
156
- /* button text element */
157
- .ui-button .ui-button-text {
158
- display: block;
159
- line-height: normal;
160
- }
161
- .ui-button-text-only .ui-button-text {
162
- padding: .4em 1em;
163
- }
164
- .ui-button-icon-only .ui-button-text,
165
- .ui-button-icons-only .ui-button-text {
166
- padding: .4em;
167
- text-indent: -9999999px;
168
- }
169
- .ui-button-text-icon-primary .ui-button-text,
170
- .ui-button-text-icons .ui-button-text {
171
- padding: .4em 1em .4em 2.1em;
172
- }
173
- .ui-button-text-icon-secondary .ui-button-text,
174
- .ui-button-text-icons .ui-button-text {
175
- padding: .4em 2.1em .4em 1em;
176
- }
177
- .ui-button-text-icons .ui-button-text {
178
- padding-left: 2.1em;
179
- padding-right: 2.1em;
180
- }
181
- /* no icon support for input elements, provide padding by default */
182
- input.ui-button {
183
- padding: .4em 1em;
184
- }
185
-
186
- /* button icon element(s) */
187
- .ui-button-icon-only .ui-icon,
188
- .ui-button-text-icon-primary .ui-icon,
189
- .ui-button-text-icon-secondary .ui-icon,
190
- .ui-button-text-icons .ui-icon,
191
- .ui-button-icons-only .ui-icon {
192
- position: absolute;
193
- top: 50%;
194
- margin-top: -8px;
195
- }
196
- .ui-button-icon-only .ui-icon {
197
- left: 50%;
198
- margin-left: -8px;
199
- }
200
- .ui-button-text-icon-primary .ui-button-icon-primary,
201
- .ui-button-text-icons .ui-button-icon-primary,
202
- .ui-button-icons-only .ui-button-icon-primary {
203
- left: .5em;
204
- }
205
- .ui-button-text-icon-secondary .ui-button-icon-secondary,
206
- .ui-button-text-icons .ui-button-icon-secondary,
207
- .ui-button-icons-only .ui-button-icon-secondary {
208
- right: .5em;
209
- }
210
-
211
- /* button sets */
212
- .ui-buttonset {
213
- margin-right: 7px;
214
- }
215
- .ui-buttonset .ui-button {
216
- margin-left: 0;
217
- margin-right: -.3em;
218
- }
219
-
220
- /* workarounds */
221
- /* reset extra padding in Firefox, see h5bp.com/l */
222
- input.ui-button::-moz-focus-inner,
223
- button.ui-button::-moz-focus-inner {
224
- border: 0;
225
- padding: 0;
226
- }
227
- .ui-datepicker {
228
- width: 17em;
229
- padding: .2em .2em 0;
230
- display: none;
231
- }
232
- .ui-datepicker .ui-datepicker-header {
233
- position: relative;
234
- padding: .2em 0;
235
- }
236
- .ui-datepicker .ui-datepicker-prev,
237
- .ui-datepicker .ui-datepicker-next {
238
- position: absolute;
239
- top: 2px;
240
- width: 1.8em;
241
- height: 1.8em;
242
- }
243
- .ui-datepicker .ui-datepicker-prev-hover,
244
- .ui-datepicker .ui-datepicker-next-hover {
245
- top: 1px;
246
- }
247
- .ui-datepicker .ui-datepicker-prev {
248
- left: 2px;
249
- }
250
- .ui-datepicker .ui-datepicker-next {
251
- right: 2px;
252
- }
253
- .ui-datepicker .ui-datepicker-prev-hover {
254
- left: 1px;
255
- }
256
- .ui-datepicker .ui-datepicker-next-hover {
257
- right: 1px;
258
- }
259
- .ui-datepicker .ui-datepicker-prev span,
260
- .ui-datepicker .ui-datepicker-next span {
261
- display: block;
262
- position: absolute;
263
- left: 50%;
264
- margin-left: -8px;
265
- top: 50%;
266
- margin-top: -8px;
267
- }
268
- .ui-datepicker .ui-datepicker-title {
269
- margin: 0 2.3em;
270
- line-height: 1.8em;
271
- text-align: center;
272
- }
273
- .ui-datepicker .ui-datepicker-title select {
274
- font-size: 1em;
275
- margin: 1px 0;
276
- }
277
- .ui-datepicker select.ui-datepicker-month,
278
- .ui-datepicker select.ui-datepicker-year {
279
- width: 49%;
280
- }
281
- .ui-datepicker table {
282
- width: 100%;
283
- font-size: .9em;
284
- border-collapse: collapse;
285
- margin: 0 0 .4em;
286
- }
287
- .ui-datepicker th {
288
- padding: .7em .3em;
289
- text-align: center;
290
- font-weight: bold;
291
- border: 0;
292
- }
293
- .ui-datepicker td {
294
- border: 0;
295
- padding: 1px;
296
- }
297
- .ui-datepicker td span,
298
- .ui-datepicker td a {
299
- display: block;
300
- padding: .2em;
301
- text-align: right;
302
- text-decoration: none;
303
- }
304
- .ui-datepicker .ui-datepicker-buttonpane {
305
- background-image: none;
306
- margin: .7em 0 0 0;
307
- padding: 0 .2em;
308
- border-left: 0;
309
- border-right: 0;
310
- border-bottom: 0;
311
- }
312
- .ui-datepicker .ui-datepicker-buttonpane button {
313
- float: right;
314
- margin: .5em .2em .4em;
315
- cursor: pointer;
316
- padding: .2em .6em .3em .6em;
317
- width: auto;
318
- overflow: visible;
319
- }
320
- .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
321
- float: left;
322
- }
323
-
324
- /* with multiple calendars */
325
- .ui-datepicker.ui-datepicker-multi {
326
- width: auto;
327
- }
328
- .ui-datepicker-multi .ui-datepicker-group {
329
- float: left;
330
- }
331
- .ui-datepicker-multi .ui-datepicker-group table {
332
- width: 95%;
333
- margin: 0 auto .4em;
334
- }
335
- .ui-datepicker-multi-2 .ui-datepicker-group {
336
- width: 50%;
337
- }
338
- .ui-datepicker-multi-3 .ui-datepicker-group {
339
- width: 33.3%;
340
- }
341
- .ui-datepicker-multi-4 .ui-datepicker-group {
342
- width: 25%;
343
- }
344
- .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
345
- .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
346
- border-left-width: 0;
347
- }
348
- .ui-datepicker-multi .ui-datepicker-buttonpane {
349
- clear: left;
350
- }
351
- .ui-datepicker-row-break {
352
- clear: both;
353
- width: 100%;
354
- font-size: 0;
355
- }
356
-
357
- /* RTL support */
358
- .ui-datepicker-rtl {
359
- direction: rtl;
360
- }
361
- .ui-datepicker-rtl .ui-datepicker-prev {
362
- right: 2px;
363
- left: auto;
364
- }
365
- .ui-datepicker-rtl .ui-datepicker-next {
366
- left: 2px;
367
- right: auto;
368
- }
369
- .ui-datepicker-rtl .ui-datepicker-prev:hover {
370
- right: 1px;
371
- left: auto;
372
- }
373
- .ui-datepicker-rtl .ui-datepicker-next:hover {
374
- left: 1px;
375
- right: auto;
376
- }
377
- .ui-datepicker-rtl .ui-datepicker-buttonpane {
378
- clear: right;
379
- }
380
- .ui-datepicker-rtl .ui-datepicker-buttonpane button {
381
- float: left;
382
- }
383
- .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
384
- .ui-datepicker-rtl .ui-datepicker-group {
385
- float: right;
386
- }
387
- .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
388
- .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
389
- border-right-width: 0;
390
- border-left-width: 1px;
391
- }
392
- .ui-dialog {
393
- overflow: hidden;
394
- position: absolute;
395
- top: 0;
396
- left: 0;
397
- padding: .2em;
398
- outline: 0;
399
- }
400
- .ui-dialog .ui-dialog-titlebar {
401
- padding: .4em 1em;
402
- position: relative;
403
- }
404
- .ui-dialog .ui-dialog-title {
405
- float: left;
406
- margin: .1em 0;
407
- white-space: nowrap;
408
- width: 90%;
409
- overflow: hidden;
410
- text-overflow: ellipsis;
411
- }
412
- .ui-dialog .ui-dialog-titlebar-close {
413
- position: absolute;
414
- right: .3em;
415
- top: 50%;
416
- width: 20px;
417
- margin: -10px 0 0 0;
418
- padding: 1px;
419
- height: 20px;
420
- }
421
- .ui-dialog .ui-dialog-content {
422
- position: relative;
423
- border: 0;
424
- padding: .5em 1em;
425
- background: none;
426
- overflow: auto;
427
- }
428
- .ui-dialog .ui-dialog-buttonpane {
429
- text-align: left;
430
- border-width: 1px 0 0 0;
431
- background-image: none;
432
- margin-top: .5em;
433
- padding: .3em 1em .5em .4em;
434
- }
435
- .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
436
- float: right;
437
- }
438
- .ui-dialog .ui-dialog-buttonpane button {
439
- margin: .5em .4em .5em 0;
440
- cursor: pointer;
441
- }
442
- .ui-dialog .ui-resizable-se {
443
- width: 12px;
444
- height: 12px;
445
- right: -5px;
446
- bottom: -5px;
447
- background-position: 16px 16px;
448
- }
449
- .ui-draggable .ui-dialog-titlebar {
450
- cursor: move;
451
- }
452
- .ui-menu {
453
- list-style: none;
454
- padding: 2px;
455
- margin: 0;
456
- display: block;
457
- outline: none;
458
- }
459
- .ui-menu .ui-menu {
460
- margin-top: -3px;
461
- position: absolute;
462
- }
463
- .ui-menu .ui-menu-item {
464
- margin: 0;
465
- padding: 0;
466
- width: 100%;
467
- /* support: IE10, see #8844 */
468
- list-style-image: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);
469
- }
470
- .ui-menu .ui-menu-divider {
471
- margin: 5px -2px 5px -2px;
472
- height: 0;
473
- font-size: 0;
474
- line-height: 0;
475
- border-width: 1px 0 0 0;
476
- }
477
- .ui-menu .ui-menu-item a {
478
- text-decoration: none;
479
- display: block;
480
- padding: 2px .4em;
481
- line-height: 1.5;
482
- min-height: 0; /* support: IE7 */
483
- font-weight: normal;
484
- }
485
- .ui-menu .ui-menu-item a.ui-state-focus,
486
- .ui-menu .ui-menu-item a.ui-state-active {
487
- font-weight: normal;
488
- margin: -1px;
489
- }
490
-
491
- .ui-menu .ui-state-disabled {
492
- font-weight: normal;
493
- margin: .4em 0 .2em;
494
- line-height: 1.5;
495
- }
496
- .ui-menu .ui-state-disabled a {
497
- cursor: default;
498
- }
499
-
500
- /* icon support */
501
- .ui-menu-icons {
502
- position: relative;
503
- }
504
- .ui-menu-icons .ui-menu-item a {
505
- position: relative;
506
- padding-left: 2em;
507
- }
508
-
509
- /* left-aligned */
510
- .ui-menu .ui-icon {
511
- position: absolute;
512
- top: .2em;
513
- left: .2em;
514
- }
515
-
516
- /* right-aligned */
517
- .ui-menu .ui-menu-icon {
518
- position: static;
519
- float: right;
520
- }
521
- .ui-progressbar {
522
- height: 2em;
523
- text-align: left;
524
- overflow: hidden;
525
- }
526
- .ui-progressbar .ui-progressbar-value {
527
- margin: -1px;
528
- height: 100%;
529
- }
530
- .ui-progressbar .ui-progressbar-overlay {
531
- background: url("images/animated-overlay.gif");
532
- height: 100%;
533
- filter: alpha(opacity=25);
534
- opacity: 0.25;
535
- }
536
- .ui-progressbar-indeterminate .ui-progressbar-value {
537
- background-image: none;
538
- }
539
- .ui-resizable {
540
- position: relative;
541
- }
542
- .ui-resizable-handle {
543
- position: absolute;
544
- font-size: 0.1px;
545
- display: block;
546
- }
547
- .ui-resizable-disabled .ui-resizable-handle,
548
- .ui-resizable-autohide .ui-resizable-handle {
549
- display: none;
550
- }
551
- .ui-resizable-n {
552
- cursor: n-resize;
553
- height: 7px;
554
- width: 100%;
555
- top: -5px;
556
- left: 0;
557
- }
558
- .ui-resizable-s {
559
- cursor: s-resize;
560
- height: 7px;
561
- width: 100%;
562
- bottom: -5px;
563
- left: 0;
564
- }
565
- .ui-resizable-e {
566
- cursor: e-resize;
567
- width: 7px;
568
- right: -5px;
569
- top: 0;
570
- height: 100%;
571
- }
572
- .ui-resizable-w {
573
- cursor: w-resize;
574
- width: 7px;
575
- left: -5px;
576
- top: 0;
577
- height: 100%;
578
- }
579
- .ui-resizable-se {
580
- cursor: se-resize;
581
- width: 12px;
582
- height: 12px;
583
- right: 1px;
584
- bottom: 1px;
585
- }
586
- .ui-resizable-sw {
587
- cursor: sw-resize;
588
- width: 9px;
589
- height: 9px;
590
- left: -5px;
591
- bottom: -5px;
592
- }
593
- .ui-resizable-nw {
594
- cursor: nw-resize;
595
- width: 9px;
596
- height: 9px;
597
- left: -5px;
598
- top: -5px;
599
- }
600
- .ui-resizable-ne {
601
- cursor: ne-resize;
602
- width: 9px;
603
- height: 9px;
604
- right: -5px;
605
- top: -5px;
606
- }
607
- .ui-selectable-helper {
608
- position: absolute;
609
- z-index: 100;
610
- border: 1px dotted black;
611
- }
612
- .ui-slider {
613
- position: relative;
614
- text-align: left;
615
- }
616
- .ui-slider .ui-slider-handle {
617
- position: absolute;
618
- z-index: 2;
619
- width: 1.2em;
620
- height: 1.2em;
621
- cursor: default;
622
- }
623
- .ui-slider .ui-slider-range {
624
- position: absolute;
625
- z-index: 1;
626
- font-size: .7em;
627
- display: block;
628
- border: 0;
629
- background-position: 0 0;
630
- }
631
-
632
- /* For IE8 - See #6727 */
633
- .ui-slider.ui-state-disabled .ui-slider-handle,
634
- .ui-slider.ui-state-disabled .ui-slider-range {
635
- filter: inherit;
636
- }
637
-
638
- .ui-slider-horizontal {
639
- height: .8em;
640
- }
641
- .ui-slider-horizontal .ui-slider-handle {
642
- top: -.3em;
643
- margin-left: -.6em;
644
- }
645
- .ui-slider-horizontal .ui-slider-range {
646
- top: 0;
647
- height: 100%;
648
- }
649
- .ui-slider-horizontal .ui-slider-range-min {
650
- left: 0;
651
- }
652
- .ui-slider-horizontal .ui-slider-range-max {
653
- right: 0;
654
- }
655
-
656
- .ui-slider-vertical {
657
- width: .8em;
658
- height: 100px;
659
- }
660
- .ui-slider-vertical .ui-slider-handle {
661
- left: -.3em;
662
- margin-left: 0;
663
- margin-bottom: -.6em;
664
- }
665
- .ui-slider-vertical .ui-slider-range {
666
- left: 0;
667
- width: 100%;
668
- }
669
- .ui-slider-vertical .ui-slider-range-min {
670
- bottom: 0;
671
- }
672
- .ui-slider-vertical .ui-slider-range-max {
673
- top: 0;
674
- }
675
- .ui-spinner {
676
- position: relative;
677
- display: inline-block;
678
- overflow: hidden;
679
- padding: 0;
680
- vertical-align: middle;
681
- }
682
- .ui-spinner-input {
683
- border: none;
684
- background: none;
685
- color: inherit;
686
- padding: 0;
687
- margin: .2em 0;
688
- vertical-align: middle;
689
- margin-left: .4em;
690
- margin-right: 22px;
691
- }
692
- .ui-spinner-button {
693
- width: 16px;
694
- height: 50%;
695
- font-size: .5em;
696
- padding: 0;
697
- margin: 0;
698
- text-align: center;
699
- position: absolute;
700
- cursor: default;
701
- display: block;
702
- overflow: hidden;
703
- right: 0;
704
- }
705
- /* more specificity required here to override default borders */
706
- .ui-spinner a.ui-spinner-button {
707
- border-top: none;
708
- border-bottom: none;
709
- border-right: none;
710
- }
711
- /* vertically center icon */
712
- .ui-spinner .ui-icon {
713
- position: absolute;
714
- margin-top: -8px;
715
- top: 50%;
716
- left: 0;
717
- }
718
- .ui-spinner-up {
719
- top: 0;
720
- }
721
- .ui-spinner-down {
722
- bottom: 0;
723
- }
724
-
725
- /* TR overrides */
726
- .ui-spinner .ui-icon-triangle-1-s {
727
- /* need to fix icons sprite */
728
- background-position: -65px -16px;
729
- }
730
- .ui-tabs {
731
- position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
732
- padding: .2em;
733
- }
734
- .ui-tabs .ui-tabs-nav {
735
- margin: 0;
736
- padding: .2em .2em 0;
737
- }
738
- .ui-tabs .ui-tabs-nav li {
739
- list-style: none;
740
- float: left;
741
- position: relative;
742
- top: 0;
743
- margin: 1px .2em 0 0;
744
- border-bottom-width: 0;
745
- padding: 0;
746
- white-space: nowrap;
747
- }
748
- .ui-tabs .ui-tabs-nav .ui-tabs-anchor {
749
- float: left;
750
- padding: .5em 1em;
751
- text-decoration: none;
752
- }
753
- .ui-tabs .ui-tabs-nav li.ui-tabs-active {
754
- margin-bottom: -1px;
755
- padding-bottom: 1px;
756
- }
757
- .ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,
758
- .ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,
759
- .ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor {
760
- cursor: text;
761
- }
762
- .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor {
763
- cursor: pointer;
764
- }
765
- .ui-tabs .ui-tabs-panel {
766
- display: block;
767
- border-width: 0;
768
- padding: 1em 1.4em;
769
- background: none;
770
- }
771
- .ui-tooltip {
772
- padding: 8px;
773
- position: absolute;
774
- z-index: 9999;
775
- max-width: 300px;
776
- -webkit-box-shadow: 0 0 5px #aaa;
777
- box-shadow: 0 0 5px #aaa;
778
- }
779
- body .ui-tooltip {
780
- border-width: 2px;
781
- }
782
-
783
- /* Component containers
784
- ----------------------------------*/
785
- .ui-widget {
786
- font-family: Verdana,Arial,sans-serif;
787
- font-size: 1.1em;
788
- }
789
- .ui-widget .ui-widget {
790
- font-size: 1em;
791
- }
792
- .ui-widget input,
793
- .ui-widget select,
794
- .ui-widget textarea,
795
- .ui-widget button {
796
- font-family: Verdana,Arial,sans-serif;
797
- font-size: 1em;
798
- }
799
- .ui-widget-content {
800
- border: 1px solid #aaaaaa;
801
- background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;
802
- color: #222222;
803
- }
804
- .ui-widget-content a {
805
- color: #222222;
806
- }
807
- .ui-widget-header {
808
- border: 1px solid #aaaaaa;
809
- background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;
810
- color: #222222;
811
- font-weight: bold;
812
- }
813
- .ui-widget-header a {
814
- color: #222222;
815
- }
816
-
817
- /* Interaction states
818
- ----------------------------------*/
819
- .ui-state-default,
820
- .ui-widget-content .ui-state-default,
821
- .ui-widget-header .ui-state-default {
822
- border: 1px solid #d3d3d3;
823
- background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;
824
- font-weight: normal;
825
- color: #555555;
826
- }
827
- .ui-state-default a,
828
- .ui-state-default a:link,
829
- .ui-state-default a:visited {
830
- color: #555555;
831
- text-decoration: none;
832
- }
833
- .ui-state-hover,
834
- .ui-widget-content .ui-state-hover,
835
- .ui-widget-header .ui-state-hover,
836
- .ui-state-focus,
837
- .ui-widget-content .ui-state-focus,
838
- .ui-widget-header .ui-state-focus {
839
- border: 1px solid #999999;
840
- background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;
841
- font-weight: normal;
842
- color: #212121;
843
- }
844
- .ui-state-hover a,
845
- .ui-state-hover a:hover,
846
- .ui-state-hover a:link,
847
- .ui-state-hover a:visited,
848
- .ui-state-focus a,
849
- .ui-state-focus a:hover,
850
- .ui-state-focus a:link,
851
- .ui-state-focus a:visited {
852
- color: #212121;
853
- text-decoration: none;
854
- }
855
- .ui-state-active,
856
- .ui-widget-content .ui-state-active,
857
- .ui-widget-header .ui-state-active {
858
- border: 1px solid #aaaaaa;
859
- background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;
860
- font-weight: normal;
861
- color: #212121;
862
- }
863
- .ui-state-active a,
864
- .ui-state-active a:link,
865
- .ui-state-active a:visited {
866
- color: #212121;
867
- text-decoration: none;
868
- }
869
-
870
- /* Interaction Cues
871
- ----------------------------------*/
872
- .ui-state-highlight,
873
- .ui-widget-content .ui-state-highlight,
874
- .ui-widget-header .ui-state-highlight {
875
- border: 1px solid #fcefa1;
876
- background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;
877
- color: #363636;
878
- }
879
- .ui-state-highlight a,
880
- .ui-widget-content .ui-state-highlight a,
881
- .ui-widget-header .ui-state-highlight a {
882
- color: #363636;
883
- }
884
- .ui-state-error,
885
- .ui-widget-content .ui-state-error,
886
- .ui-widget-header .ui-state-error {
887
- border: 1px solid #cd0a0a;
888
- background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;
889
- color: #cd0a0a;
890
- }
891
- .ui-state-error a,
892
- .ui-widget-content .ui-state-error a,
893
- .ui-widget-header .ui-state-error a {
894
- color: #cd0a0a;
895
- }
896
- .ui-state-error-text,
897
- .ui-widget-content .ui-state-error-text,
898
- .ui-widget-header .ui-state-error-text {
899
- color: #cd0a0a;
900
- }
901
- .ui-priority-primary,
902
- .ui-widget-content .ui-priority-primary,
903
- .ui-widget-header .ui-priority-primary {
904
- font-weight: bold;
905
- }
906
- .ui-priority-secondary,
907
- .ui-widget-content .ui-priority-secondary,
908
- .ui-widget-header .ui-priority-secondary {
909
- opacity: .7;
910
- filter:Alpha(Opacity=70);
911
- font-weight: normal;
912
- }
913
- .ui-state-disabled,
914
- .ui-widget-content .ui-state-disabled,
915
- .ui-widget-header .ui-state-disabled {
916
- opacity: .35;
917
- filter:Alpha(Opacity=35);
918
- background-image: none;
919
- }
920
- .ui-state-disabled .ui-icon {
921
- filter:Alpha(Opacity=35); /* For IE8 - See #6059 */
922
- }
923
-
924
- /* Icons
925
- ----------------------------------*/
926
-
927
- /* states and images */
928
- .ui-icon {
929
- width: 16px;
930
- height: 16px;
931
- }
932
- .ui-icon,
933
- .ui-widget-content .ui-icon {
934
- background-image: url(images/ui-icons_222222_256x240.png);
935
- }
936
- .ui-widget-header .ui-icon {
937
- background-image: url(images/ui-icons_222222_256x240.png);
938
- }
939
- .ui-state-default .ui-icon {
940
- background-image: url(images/ui-icons_888888_256x240.png);
941
- }
942
- .ui-state-hover .ui-icon,
943
- .ui-state-focus .ui-icon {
944
- background-image: url(images/ui-icons_454545_256x240.png);
945
- }
946
- .ui-state-active .ui-icon {
947
- background-image: url(images/ui-icons_454545_256x240.png);
948
- }
949
- .ui-state-highlight .ui-icon {
950
- background-image: url(images/ui-icons_2e83ff_256x240.png);
951
- }
952
- .ui-state-error .ui-icon,
953
- .ui-state-error-text .ui-icon {
954
- background-image: url(images/ui-icons_cd0a0a_256x240.png);
955
- }
956
-
957
- /* positioning */
958
- .ui-icon-blank { background-position: 16px 16px; }
959
- .ui-icon-carat-1-n { background-position: 0 0; }
960
- .ui-icon-carat-1-ne { background-position: -16px 0; }
961
- .ui-icon-carat-1-e { background-position: -32px 0; }
962
- .ui-icon-carat-1-se { background-position: -48px 0; }
963
- .ui-icon-carat-1-s { background-position: -64px 0; }
964
- .ui-icon-carat-1-sw { background-position: -80px 0; }
965
- .ui-icon-carat-1-w { background-position: -96px 0; }
966
- .ui-icon-carat-1-nw { background-position: -112px 0; }
967
- .ui-icon-carat-2-n-s { background-position: -128px 0; }
968
- .ui-icon-carat-2-e-w { background-position: -144px 0; }
969
- .ui-icon-triangle-1-n { background-position: 0 -16px; }
970
- .ui-icon-triangle-1-ne { background-position: -16px -16px; }
971
- .ui-icon-triangle-1-e { background-position: -32px -16px; }
972
- .ui-icon-triangle-1-se { background-position: -48px -16px; }
973
- .ui-icon-triangle-1-s { background-position: -64px -16px; }
974
- .ui-icon-triangle-1-sw { background-position: -80px -16px; }
975
- .ui-icon-triangle-1-w { background-position: -96px -16px; }
976
- .ui-icon-triangle-1-nw { background-position: -112px -16px; }
977
- .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
978
- .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
979
- .ui-icon-arrow-1-n { background-position: 0 -32px; }
980
- .ui-icon-arrow-1-ne { background-position: -16px -32px; }
981
- .ui-icon-arrow-1-e { background-position: -32px -32px; }
982
- .ui-icon-arrow-1-se { background-position: -48px -32px; }
983
- .ui-icon-arrow-1-s { background-position: -64px -32px; }
984
- .ui-icon-arrow-1-sw { background-position: -80px -32px; }
985
- .ui-icon-arrow-1-w { background-position: -96px -32px; }
986
- .ui-icon-arrow-1-nw { background-position: -112px -32px; }
987
- .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
988
- .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
989
- .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
990
- .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
991
- .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
992
- .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
993
- .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
994
- .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
995
- .ui-icon-arrowthick-1-n { background-position: 0 -48px; }
996
- .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
997
- .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
998
- .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
999
- .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
1000
- .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
1001
- .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
1002
- .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
1003
- .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
1004
- .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
1005
- .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
1006
- .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
1007
- .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
1008
- .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
1009
- .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
1010
- .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
1011
- .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
1012
- .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
1013
- .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
1014
- .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
1015
- .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
1016
- .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
1017
- .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
1018
- .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
1019
- .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
1020
- .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
1021
- .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
1022
- .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
1023
- .ui-icon-arrow-4 { background-position: 0 -80px; }
1024
- .ui-icon-arrow-4-diag { background-position: -16px -80px; }
1025
- .ui-icon-extlink { background-position: -32px -80px; }
1026
- .ui-icon-newwin { background-position: -48px -80px; }
1027
- .ui-icon-refresh { background-position: -64px -80px; }
1028
- .ui-icon-shuffle { background-position: -80px -80px; }
1029
- .ui-icon-transfer-e-w { background-position: -96px -80px; }
1030
- .ui-icon-transferthick-e-w { background-position: -112px -80px; }
1031
- .ui-icon-folder-collapsed { background-position: 0 -96px; }
1032
- .ui-icon-folder-open { background-position: -16px -96px; }
1033
- .ui-icon-document { background-position: -32px -96px; }
1034
- .ui-icon-document-b { background-position: -48px -96px; }
1035
- .ui-icon-note { background-position: -64px -96px; }
1036
- .ui-icon-mail-closed { background-position: -80px -96px; }
1037
- .ui-icon-mail-open { background-position: -96px -96px; }
1038
- .ui-icon-suitcase { background-position: -112px -96px; }
1039
- .ui-icon-comment { background-position: -128px -96px; }
1040
- .ui-icon-person { background-position: -144px -96px; }
1041
- .ui-icon-print { background-position: -160px -96px; }
1042
- .ui-icon-trash { background-position: -176px -96px; }
1043
- .ui-icon-locked { background-position: -192px -96px; }
1044
- .ui-icon-unlocked { background-position: -208px -96px; }
1045
- .ui-icon-bookmark { background-position: -224px -96px; }
1046
- .ui-icon-tag { background-position: -240px -96px; }
1047
- .ui-icon-home { background-position: 0 -112px; }
1048
- .ui-icon-flag { background-position: -16px -112px; }
1049
- .ui-icon-calendar { background-position: -32px -112px; }
1050
- .ui-icon-cart { background-position: -48px -112px; }
1051
- .ui-icon-pencil { background-position: -64px -112px; }
1052
- .ui-icon-clock { background-position: -80px -112px; }
1053
- .ui-icon-disk { background-position: -96px -112px; }
1054
- .ui-icon-calculator { background-position: -112px -112px; }
1055
- .ui-icon-zoomin { background-position: -128px -112px; }
1056
- .ui-icon-zoomout { background-position: -144px -112px; }
1057
- .ui-icon-search { background-position: -160px -112px; }
1058
- .ui-icon-wrench { background-position: -176px -112px; }
1059
- .ui-icon-gear { background-position: -192px -112px; }
1060
- .ui-icon-heart { background-position: -208px -112px; }
1061
- .ui-icon-star { background-position: -224px -112px; }
1062
- .ui-icon-link { background-position: -240px -112px; }
1063
- .ui-icon-cancel { background-position: 0 -128px; }
1064
- .ui-icon-plus { background-position: -16px -128px; }
1065
- .ui-icon-plusthick { background-position: -32px -128px; }
1066
- .ui-icon-minus { background-position: -48px -128px; }
1067
- .ui-icon-minusthick { background-position: -64px -128px; }
1068
- .ui-icon-close { background-position: -80px -128px; }
1069
- .ui-icon-closethick { background-position: -96px -128px; }
1070
- .ui-icon-key { background-position: -112px -128px; }
1071
- .ui-icon-lightbulb { background-position: -128px -128px; }
1072
- .ui-icon-scissors { background-position: -144px -128px; }
1073
- .ui-icon-clipboard { background-position: -160px -128px; }
1074
- .ui-icon-copy { background-position: -176px -128px; }
1075
- .ui-icon-contact { background-position: -192px -128px; }
1076
- .ui-icon-image { background-position: -208px -128px; }
1077
- .ui-icon-video { background-position: -224px -128px; }
1078
- .ui-icon-script { background-position: -240px -128px; }
1079
- .ui-icon-alert { background-position: 0 -144px; }
1080
- .ui-icon-info { background-position: -16px -144px; }
1081
- .ui-icon-notice { background-position: -32px -144px; }
1082
- .ui-icon-help { background-position: -48px -144px; }
1083
- .ui-icon-check { background-position: -64px -144px; }
1084
- .ui-icon-bullet { background-position: -80px -144px; }
1085
- .ui-icon-radio-on { background-position: -96px -144px; }
1086
- .ui-icon-radio-off { background-position: -112px -144px; }
1087
- .ui-icon-pin-w { background-position: -128px -144px; }
1088
- .ui-icon-pin-s { background-position: -144px -144px; }
1089
- .ui-icon-play { background-position: 0 -160px; }
1090
- .ui-icon-pause { background-position: -16px -160px; }
1091
- .ui-icon-seek-next { background-position: -32px -160px; }
1092
- .ui-icon-seek-prev { background-position: -48px -160px; }
1093
- .ui-icon-seek-end { background-position: -64px -160px; }
1094
- .ui-icon-seek-start { background-position: -80px -160px; }
1095
- /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
1096
- .ui-icon-seek-first { background-position: -80px -160px; }
1097
- .ui-icon-stop { background-position: -96px -160px; }
1098
- .ui-icon-eject { background-position: -112px -160px; }
1099
- .ui-icon-volume-off { background-position: -128px -160px; }
1100
- .ui-icon-volume-on { background-position: -144px -160px; }
1101
- .ui-icon-power { background-position: 0 -176px; }
1102
- .ui-icon-signal-diag { background-position: -16px -176px; }
1103
- .ui-icon-signal { background-position: -32px -176px; }
1104
- .ui-icon-battery-0 { background-position: -48px -176px; }
1105
- .ui-icon-battery-1 { background-position: -64px -176px; }
1106
- .ui-icon-battery-2 { background-position: -80px -176px; }
1107
- .ui-icon-battery-3 { background-position: -96px -176px; }
1108
- .ui-icon-circle-plus { background-position: 0 -192px; }
1109
- .ui-icon-circle-minus { background-position: -16px -192px; }
1110
- .ui-icon-circle-close { background-position: -32px -192px; }
1111
- .ui-icon-circle-triangle-e { background-position: -48px -192px; }
1112
- .ui-icon-circle-triangle-s { background-position: -64px -192px; }
1113
- .ui-icon-circle-triangle-w { background-position: -80px -192px; }
1114
- .ui-icon-circle-triangle-n { background-position: -96px -192px; }
1115
- .ui-icon-circle-arrow-e { background-position: -112px -192px; }
1116
- .ui-icon-circle-arrow-s { background-position: -128px -192px; }
1117
- .ui-icon-circle-arrow-w { background-position: -144px -192px; }
1118
- .ui-icon-circle-arrow-n { background-position: -160px -192px; }
1119
- .ui-icon-circle-zoomin { background-position: -176px -192px; }
1120
- .ui-icon-circle-zoomout { background-position: -192px -192px; }
1121
- .ui-icon-circle-check { background-position: -208px -192px; }
1122
- .ui-icon-circlesmall-plus { background-position: 0 -208px; }
1123
- .ui-icon-circlesmall-minus { background-position: -16px -208px; }
1124
- .ui-icon-circlesmall-close { background-position: -32px -208px; }
1125
- .ui-icon-squaresmall-plus { background-position: -48px -208px; }
1126
- .ui-icon-squaresmall-minus { background-position: -64px -208px; }
1127
- .ui-icon-squaresmall-close { background-position: -80px -208px; }
1128
- .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
1129
- .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
1130
- .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
1131
- .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
1132
- .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
1133
- .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
1134
-
1135
-
1136
- /* Misc visuals
1137
- ----------------------------------*/
1138
-
1139
- /* Corner radius */
1140
- .ui-corner-all,
1141
- .ui-corner-top,
1142
- .ui-corner-left,
1143
- .ui-corner-tl {
1144
- border-top-left-radius: 4px;
1145
- }
1146
- .ui-corner-all,
1147
- .ui-corner-top,
1148
- .ui-corner-right,
1149
- .ui-corner-tr {
1150
- border-top-right-radius: 4px;
1151
- }
1152
- .ui-corner-all,
1153
- .ui-corner-bottom,
1154
- .ui-corner-left,
1155
- .ui-corner-bl {
1156
- border-bottom-left-radius: 4px;
1157
- }
1158
- .ui-corner-all,
1159
- .ui-corner-bottom,
1160
- .ui-corner-right,
1161
- .ui-corner-br {
1162
- border-bottom-right-radius: 4px;
1163
- }
1164
-
1165
- /* Overlays */
1166
- .ui-widget-overlay {
1167
- background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;
1168
- opacity: .3;
1169
- filter: Alpha(Opacity=30);
1170
- }
1171
- .ui-widget-shadow {
1172
- margin: -8px 0 0 -8px;
1173
- padding: 8px;
1174
- background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;
1175
- opacity: .3;
1176
- filter: Alpha(Opacity=30);
1177
- border-radius: 8px;
1178
  }
1
+ /*! jQuery UI - v1.10.4 - 2014-01-17
2
+ * http://jqueryui.com
3
+ * Includes: jquery.ui.core.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css, jquery.ui.theme.css
4
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
5
+ * Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
6
+
7
+ /* Layout helpers
8
+ ----------------------------------*/
9
+ .ui-helper-hidden {
10
+ display: none;
11
+ }
12
+ .ui-helper-hidden-accessible {
13
+ border: 0;
14
+ clip: rect(0 0 0 0);
15
+ height: 1px;
16
+ margin: -1px;
17
+ overflow: hidden;
18
+ padding: 0;
19
+ position: absolute;
20
+ width: 1px;
21
+ }
22
+ .ui-helper-reset {
23
+ margin: 0;
24
+ padding: 0;
25
+ border: 0;
26
+ outline: 0;
27
+ line-height: 1.3;
28
+ text-decoration: none;
29
+ font-size: 100%;
30
+ list-style: none;
31
+ }
32
+ .ui-helper-clearfix:before,
33
+ .ui-helper-clearfix:after {
34
+ content: "";
35
+ display: table;
36
+ border-collapse: collapse;
37
+ }
38
+ .ui-helper-clearfix:after {
39
+ clear: both;
40
+ }
41
+ .ui-helper-clearfix {
42
+ min-height: 0; /* support: IE7 */
43
+ }
44
+ .ui-helper-zfix {
45
+ width: 100%;
46
+ height: 100%;
47
+ top: 0;
48
+ left: 0;
49
+ position: absolute;
50
+ opacity: 0;
51
+ filter:Alpha(Opacity=0);
52
+ }
53
+
54
+ .ui-front {
55
+ z-index: 100;
56
+ }
57
+
58
+
59
+ /* Interaction Cues
60
+ ----------------------------------*/
61
+ .ui-state-disabled {
62
+ cursor: default !important;
63
+ }
64
+
65
+
66
+ /* Icons
67
+ ----------------------------------*/
68
+
69
+ /* states and images */
70
+ .ui-icon {
71
+ display: block;
72
+ text-indent: -99999px;
73
+ overflow: hidden;
74
+ background-repeat: no-repeat;
75
+ }
76
+
77
+
78
+ /* Misc visuals
79
+ ----------------------------------*/
80
+
81
+ /* Overlays */
82
+ .ui-widget-overlay {
83
+ position: fixed;
84
+ top: 0;
85
+ left: 0;
86
+ width: 100%;
87
+ height: 100%;
88
+ }
89
+ .ui-accordion .ui-accordion-header {
90
+ display: block;
91
+ cursor: pointer;
92
+ position: relative;
93
+ margin-top: 2px;
94
+ padding: .5em .5em .5em .7em;
95
+ min-height: 0; /* support: IE7 */
96
+ }
97
+ .ui-accordion .ui-accordion-icons {
98
+ padding-left: 2.2em;
99
+ }
100
+ .ui-accordion .ui-accordion-noicons {
101
+ padding-left: .7em;
102
+ }
103
+ .ui-accordion .ui-accordion-icons .ui-accordion-icons {
104
+ padding-left: 2.2em;
105
+ }
106
+ .ui-accordion .ui-accordion-header .ui-accordion-header-icon {
107
+ position: absolute;
108
+ left: .5em;
109
+ top: 50%;
110
+ margin-top: -8px;
111
+ }
112
+ .ui-accordion .ui-accordion-content {
113
+ padding: 1em 2.2em;
114
+ border-top: 0;
115
+ overflow: auto;
116
+ }
117
+ .ui-autocomplete {
118
+ position: absolute;
119
+ top: 0;
120
+ left: 0;
121
+ cursor: default;
122
+ }
123
+ .ui-button {
124
+ display: inline-block;
125
+ position: relative;
126
+ padding: 0;
127
+ line-height: normal;
128
+ margin-right: .1em;
129
+ cursor: pointer;
130
+ vertical-align: middle;
131
+ text-align: center;
132
+ overflow: visible; /* removes extra width in IE */
133
+ }
134
+ .ui-button,
135
+ .ui-button:link,
136
+ .ui-button:visited,
137
+ .ui-button:hover,
138
+ .ui-button:active {
139
+ text-decoration: none;
140
+ }
141
+ /* to make room for the icon, a width needs to be set here */
142
+ .ui-button-icon-only {
143
+ width: 2.2em;
144
+ }
145
+ /* button elements seem to need a little more width */
146
+ button.ui-button-icon-only {
147
+ width: 2.4em;
148
+ }
149
+ .ui-button-icons-only {
150
+ width: 3.4em;
151
+ }
152
+ button.ui-button-icons-only {
153
+ width: 3.7em;
154
+ }
155
+
156
+ /* button text element */
157
+ .ui-button .ui-button-text {
158
+ display: block;
159
+ line-height: normal;
160
+ }
161
+ .ui-button-text-only .ui-button-text {
162
+ padding: .4em 1em;
163
+ }
164
+ .ui-button-icon-only .ui-button-text,
165
+ .ui-button-icons-only .ui-button-text {
166
+ padding: .4em;
167
+ text-indent: -9999999px;
168
+ }
169
+ .ui-button-text-icon-primary .ui-button-text,
170
+ .ui-button-text-icons .ui-button-text {
171
+ padding: .4em 1em .4em 2.1em;
172
+ }
173
+ .ui-button-text-icon-secondary .ui-button-text,
174
+ .ui-button-text-icons .ui-button-text {
175
+ padding: .4em 2.1em .4em 1em;
176
+ }
177
+ .ui-button-text-icons .ui-button-text {
178
+ padding-left: 2.1em;
179
+ padding-right: 2.1em;
180
+ }
181
+ /* no icon support for input elements, provide padding by default */
182
+ input.ui-button {
183
+ padding: .4em 1em;
184
+ }
185
+
186
+ /* button icon element(s) */
187
+ .ui-button-icon-only .ui-icon,
188
+ .ui-button-text-icon-primary .ui-icon,
189
+ .ui-button-text-icon-secondary .ui-icon,
190
+ .ui-button-text-icons .ui-icon,
191
+ .ui-button-icons-only .ui-icon {
192
+ position: absolute;
193
+ top: 50%;
194
+ margin-top: -8px;
195
+ }
196
+ .ui-button-icon-only .ui-icon {
197
+ left: 50%;
198
+ margin-left: -8px;
199
+ }
200
+ .ui-button-text-icon-primary .ui-button-icon-primary,
201
+ .ui-button-text-icons .ui-button-icon-primary,
202
+ .ui-button-icons-only .ui-button-icon-primary {
203
+ left: .5em;
204
+ }
205
+ .ui-button-text-icon-secondary .ui-button-icon-secondary,
206
+ .ui-button-text-icons .ui-button-icon-secondary,
207
+ .ui-button-icons-only .ui-button-icon-secondary {
208
+ right: .5em;
209
+ }
210
+
211
+ /* button sets */
212
+ .ui-buttonset {
213
+ margin-right: 7px;
214
+ }
215
+ .ui-buttonset .ui-button {
216
+ margin-left: 0;
217
+ margin-right: -.3em;
218
+ }
219
+
220
+ /* workarounds */
221
+ /* reset extra padding in Firefox, see h5bp.com/l */
222
+ input.ui-button::-moz-focus-inner,
223
+ button.ui-button::-moz-focus-inner {
224
+ border: 0;
225
+ padding: 0;
226
+ }
227
+ .ui-datepicker {
228
+ width: 17em;
229
+ padding: .2em .2em 0;
230
+ display: none;
231
+ }
232
+ .ui-datepicker .ui-datepicker-header {
233
+ position: relative;
234
+ padding: .2em 0;
235
+ }
236
+ .ui-datepicker .ui-datepicker-prev,
237
+ .ui-datepicker .ui-datepicker-next {
238
+ position: absolute;
239
+ top: 2px;
240
+ width: 1.8em;
241
+ height: 1.8em;
242
+ }
243
+ .ui-datepicker .ui-datepicker-prev-hover,
244
+ .ui-datepicker .ui-datepicker-next-hover {
245
+ top: 1px;
246
+ }
247
+ .ui-datepicker .ui-datepicker-prev {
248
+ left: 2px;
249
+ }
250
+ .ui-datepicker .ui-datepicker-next {
251
+ right: 2px;
252
+ }
253
+ .ui-datepicker .ui-datepicker-prev-hover {
254
+ left: 1px;
255
+ }
256
+ .ui-datepicker .ui-datepicker-next-hover {
257
+ right: 1px;
258
+ }
259
+ .ui-datepicker .ui-datepicker-prev span,
260
+ .ui-datepicker .ui-datepicker-next span {
261
+ display: block;
262
+ position: absolute;
263
+ left: 50%;
264
+ margin-left: -8px;
265
+ top: 50%;
266
+ margin-top: -8px;
267
+ }
268
+ .ui-datepicker .ui-datepicker-title {
269
+ margin: 0 2.3em;
270
+ line-height: 1.8em;
271
+ text-align: center;
272
+ }
273
+ .ui-datepicker .ui-datepicker-title select {
274
+ font-size: 1em;
275
+ margin: 1px 0;
276
+ }
277
+ .ui-datepicker select.ui-datepicker-month,
278
+ .ui-datepicker select.ui-datepicker-year {
279
+ width: 49%;
280
+ }
281
+ .ui-datepicker table {
282
+ width: 100%;
283
+ font-size: .9em;
284
+ border-collapse: collapse;
285
+ margin: 0 0 .4em;
286
+ }
287
+ .ui-datepicker th {
288
+ padding: .7em .3em;
289
+ text-align: center;
290
+ font-weight: bold;
291
+ border: 0;
292
+ }
293
+ .ui-datepicker td {
294
+ border: 0;
295
+ padding: 1px;
296
+ }
297
+ .ui-datepicker td span,
298
+ .ui-datepicker td a {
299
+ display: block;
300
+ padding: .2em;
301
+ text-align: right;
302
+ text-decoration: none;
303
+ }
304
+ .ui-datepicker .ui-datepicker-buttonpane {
305
+ background-image: none;
306
+ margin: .7em 0 0 0;
307
+ padding: 0 .2em;
308
+ border-left: 0;
309
+ border-right: 0;
310
+ border-bottom: 0;
311
+ }
312
+ .ui-datepicker .ui-datepicker-buttonpane button {
313
+ float: right;
314
+ margin: .5em .2em .4em;
315
+ cursor: pointer;
316
+ padding: .2em .6em .3em .6em;
317
+ width: auto;
318
+ overflow: visible;
319
+ }
320
+ .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
321
+ float: left;
322
+ }
323
+
324
+ /* with multiple calendars */
325
+ .ui-datepicker.ui-datepicker-multi {
326
+ width: auto;
327
+ }
328
+ .ui-datepicker-multi .ui-datepicker-group {
329
+ float: left;
330
+ }
331
+ .ui-datepicker-multi .ui-datepicker-group table {
332
+ width: 95%;
333
+ margin: 0 auto .4em;
334
+ }
335
+ .ui-datepicker-multi-2 .ui-datepicker-group {
336
+ width: 50%;
337
+ }
338
+ .ui-datepicker-multi-3 .ui-datepicker-group {
339
+ width: 33.3%;
340
+ }
341
+ .ui-datepicker-multi-4 .ui-datepicker-group {
342
+ width: 25%;
343
+ }
344
+ .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
345
+ .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
346
+ border-left-width: 0;
347
+ }
348
+ .ui-datepicker-multi .ui-datepicker-buttonpane {
349
+ clear: left;
350
+ }
351
+ .ui-datepicker-row-break {
352
+ clear: both;
353
+ width: 100%;
354
+ font-size: 0;
355
+ }
356
+
357
+ /* RTL support */
358
+ .ui-datepicker-rtl {
359
+ direction: rtl;
360
+ }
361
+ .ui-datepicker-rtl .ui-datepicker-prev {
362
+ right: 2px;
363
+ left: auto;
364
+ }
365
+ .ui-datepicker-rtl .ui-datepicker-next {
366
+ left: 2px;
367
+ right: auto;
368
+ }
369
+ .ui-datepicker-rtl .ui-datepicker-prev:hover {
370
+ right: 1px;
371
+ left: auto;
372
+ }
373
+ .ui-datepicker-rtl .ui-datepicker-next:hover {
374
+ left: 1px;
375
+ right: auto;
376
+ }
377
+ .ui-datepicker-rtl .ui-datepicker-buttonpane {
378
+ clear: right;
379
+ }
380
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button {
381
+ float: left;
382
+ }
383
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
384
+ .ui-datepicker-rtl .ui-datepicker-group {
385
+ float: right;
386
+ }
387
+ .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
388
+ .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
389
+ border-right-width: 0;
390
+ border-left-width: 1px;
391
+ }
392
+ .ui-dialog {
393
+ overflow: hidden;
394
+ position: absolute;
395
+ top: 0;
396
+ left: 0;
397
+ padding: .2em;
398
+ outline: 0;
399
+ }
400
+ .ui-dialog .ui-dialog-titlebar {
401
+ padding: .4em 1em;
402
+ position: relative;
403
+ }
404
+ .ui-dialog .ui-dialog-title {
405
+ float: left;
406
+ margin: .1em 0;
407
+ white-space: nowrap;
408
+ width: 90%;
409
+ overflow: hidden;
410
+ text-overflow: ellipsis;
411
+ }
412
+ .ui-dialog .ui-dialog-titlebar-close {
413
+ position: absolute;
414
+ right: .3em;
415
+ top: 50%;
416
+ width: 20px;
417
+ margin: -10px 0 0 0;
418
+ padding: 1px;
419
+ height: 20px;
420
+ }
421
+ .ui-dialog .ui-dialog-content {
422
+ position: relative;
423
+ border: 0;
424
+ padding: .5em 1em;
425
+ background: none;
426
+ overflow: auto;
427
+ }
428
+ .ui-dialog .ui-dialog-buttonpane {
429
+ text-align: left;
430
+ border-width: 1px 0 0 0;
431
+ background-image: none;
432
+ margin-top: .5em;
433
+ padding: .3em 1em .5em .4em;
434
+ }
435
+ .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
436
+ float: right;
437
+ }
438
+ .ui-dialog .ui-dialog-buttonpane button {
439
+ margin: .5em .4em .5em 0;
440
+ cursor: pointer;
441
+ }
442
+ .ui-dialog .ui-resizable-se {
443
+ width: 12px;
444
+ height: 12px;
445
+ right: -5px;
446
+ bottom: -5px;
447
+ background-position: 16px 16px;
448
+ }
449
+ .ui-draggable .ui-dialog-titlebar {
450
+ cursor: move;
451
+ }
452
+ .ui-menu {
453
+ list-style: none;
454
+ padding: 2px;
455
+ margin: 0;
456
+ display: block;
457
+ outline: none;
458
+ }
459
+ .ui-menu .ui-menu {
460
+ margin-top: -3px;
461
+ position: absolute;
462
+ }
463
+ .ui-menu .ui-menu-item {
464
+ margin: 0;
465
+ padding: 0;
466
+ width: 100%;
467
+ /* support: IE10, see #8844 */
468
+ list-style-image: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);
469
+ }
470
+ .ui-menu .ui-menu-divider {
471
+ margin: 5px -2px 5px -2px;
472
+ height: 0;
473
+ font-size: 0;
474
+ line-height: 0;
475
+ border-width: 1px 0 0 0;
476
+ }
477
+ .ui-menu .ui-menu-item a {
478
+ text-decoration: none;
479
+ display: block;
480
+ padding: 2px .4em;
481
+ line-height: 1.5;
482
+ min-height: 0; /* support: IE7 */
483
+ font-weight: normal;
484
+ }
485
+ .ui-menu .ui-menu-item a.ui-state-focus,
486
+ .ui-menu .ui-menu-item a.ui-state-active {
487
+ font-weight: normal;
488
+ margin: -1px;
489
+ }
490
+
491
+ .ui-menu .ui-state-disabled {
492
+ font-weight: normal;
493
+ margin: .4em 0 .2em;
494
+ line-height: 1.5;
495
+ }
496
+ .ui-menu .ui-state-disabled a {
497
+ cursor: default;
498
+ }
499
+
500
+ /* icon support */
501
+ .ui-menu-icons {
502
+ position: relative;
503
+ }
504
+ .ui-menu-icons .ui-menu-item a {
505
+ position: relative;
506
+ padding-left: 2em;
507
+ }
508
+
509
+ /* left-aligned */
510
+ .ui-menu .ui-icon {
511
+ position: absolute;
512
+ top: .2em;
513
+ left: .2em;
514
+ }
515
+
516
+ /* right-aligned */
517
+ .ui-menu .ui-menu-icon {
518
+ position: static;
519
+ float: right;
520
+ }
521
+ .ui-progressbar {
522
+ height: 2em;
523
+ text-align: left;
524
+ overflow: hidden;
525
+ }
526
+ .ui-progressbar .ui-progressbar-value {
527
+ margin: -1px;
528
+ height: 100%;
529
+ }
530
+ .ui-progressbar .ui-progressbar-overlay {
531
+ background: url("images/animated-overlay.gif");
532
+ height: 100%;
533
+ filter: alpha(opacity=25);
534
+ opacity: 0.25;
535
+ }
536
+ .ui-progressbar-indeterminate .ui-progressbar-value {
537
+ background-image: none;
538
+ }
539
+ .ui-resizable {
540
+ position: relative;
541
+ }
542
+ .ui-resizable-handle {
543
+ position: absolute;
544
+ font-size: 0.1px;
545
+ display: block;
546
+ }
547
+ .ui-resizable-disabled .ui-resizable-handle,
548
+ .ui-resizable-autohide .ui-resizable-handle {
549
+ display: none;
550
+ }
551
+ .ui-resizable-n {
552
+ cursor: n-resize;
553
+ height: 7px;
554
+ width: 100%;
555
+ top: -5px;
556
+ left: 0;
557
+ }
558
+ .ui-resizable-s {
559
+ cursor: s-resize;
560
+ height: 7px;
561
+ width: 100%;
562
+ bottom: -5px;
563
+ left: 0;
564
+ }
565
+ .ui-resizable-e {
566
+ cursor: e-resize;
567
+ width: 7px;
568
+ right: -5px;
569
+ top: 0;
570
+ height: 100%;
571
+ }
572
+ .ui-resizable-w {
573
+ cursor: w-resize;
574
+ width: 7px;
575
+ left: -5px;
576
+ top: 0;
577
+ height: 100%;
578
+ }
579
+ .ui-resizable-se {
580
+ cursor: se-resize;
581
+ width: 12px;
582
+ height: 12px;
583
+ right: 1px;
584
+ bottom: 1px;
585
+ }
586
+ .ui-resizable-sw {
587
+ cursor: sw-resize;
588
+ width: 9px;
589
+ height: 9px;
590
+ left: -5px;
591
+ bottom: -5px;
592
+ }
593
+ .ui-resizable-nw {
594
+ cursor: nw-resize;
595
+ width: 9px;
596
+ height: 9px;
597
+ left: -5px;
598
+ top: -5px;
599
+ }
600
+ .ui-resizable-ne {
601
+ cursor: ne-resize;
602
+ width: 9px;
603
+ height: 9px;
604
+ right: -5px;
605
+ top: -5px;
606
+ }
607
+ .ui-selectable-helper {
608
+ position: absolute;
609
+ z-index: 100;
610
+ border: 1px dotted black;
611
+ }
612
+ .ui-slider {
613
+ position: relative;
614
+ text-align: left;
615
+ }
616
+ .ui-slider .ui-slider-handle {
617
+ position: absolute;
618
+ z-index: 2;
619
+ width: 1.2em;
620
+ height: 1.2em;
621
+ cursor: default;
622
+ }
623
+ .ui-slider .ui-slider-range {
624
+ position: absolute;
625
+ z-index: 1;
626
+ font-size: .7em;
627
+ display: block;
628
+ border: 0;
629
+ background-position: 0 0;
630
+ }
631
+
632
+ /* For IE8 - See #6727 */
633
+ .ui-slider.ui-state-disabled .ui-slider-handle,
634
+ .ui-slider.ui-state-disabled .ui-slider-range {
635
+ filter: inherit;
636
+ }
637
+
638
+ .ui-slider-horizontal {
639
+ height: .8em;
640
+ }
641
+ .ui-slider-horizontal .ui-slider-handle {
642
+ top: -.3em;
643
+ margin-left: -.6em;
644
+ }
645
+ .ui-slider-horizontal .ui-slider-range {
646
+ top: 0;
647
+ height: 100%;
648
+ }
649
+ .ui-slider-horizontal .ui-slider-range-min {
650
+ left: 0;
651
+ }
652
+ .ui-slider-horizontal .ui-slider-range-max {
653
+ right: 0;
654
+ }
655
+
656
+ .ui-slider-vertical {
657
+ width: .8em;
658
+ height: 100px;
659
+ }
660
+ .ui-slider-vertical .ui-slider-handle {
661
+ left: -.3em;
662
+ margin-left: 0;
663
+ margin-bottom: -.6em;
664
+ }
665
+ .ui-slider-vertical .ui-slider-range {
666
+ left: 0;
667
+ width: 100%;
668
+ }
669
+ .ui-slider-vertical .ui-slider-range-min {
670
+ bottom: 0;
671
+ }
672
+ .ui-slider-vertical .ui-slider-range-max {
673
+ top: 0;
674
+ }
675
+ .ui-spinner {
676
+ position: relative;
677
+ display: inline-block;
678
+ overflow: hidden;
679
+ padding: 0;
680
+ vertical-align: middle;
681
+ }
682
+ .ui-spinner-input {
683
+ border: none;
684
+ background: none;
685
+ color: inherit;
686
+ padding: 0;
687
+ margin: .2em 0;
688
+ vertical-align: middle;
689
+ margin-left: .4em;
690
+ margin-right: 22px;
691
+ }
692
+ .ui-spinner-button {
693
+ width: 16px;
694
+ height: 50%;
695
+ font-size: .5em;
696
+ padding: 0;
697
+ margin: 0;
698
+ text-align: center;
699
+ position: absolute;
700
+ cursor: default;
701
+ display: block;
702
+ overflow: hidden;
703
+ right: 0;
704
+ }
705
+ /* more specificity required here to override default borders */
706
+ .ui-spinner a.ui-spinner-button {
707
+ border-top: none;
708
+ border-bottom: none;
709
+ border-right: none;
710
+ }
711
+ /* vertically center icon */
712
+ .ui-spinner .ui-icon {
713
+ position: absolute;
714
+ margin-top: -8px;
715
+ top: 50%;
716
+ left: 0;
717
+ }
718
+ .ui-spinner-up {
719
+ top: 0;
720
+ }
721
+ .ui-spinner-down {
722
+ bottom: 0;
723
+ }
724
+
725
+ /* TR overrides */
726
+ .ui-spinner .ui-icon-triangle-1-s {
727
+ /* need to fix icons sprite */
728
+ background-position: -65px -16px;
729
+ }
730
+ .ui-tabs {
731
+ position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
732
+ padding: .2em;
733
+ }
734
+ .ui-tabs .ui-tabs-nav {
735
+ margin: 0;
736
+ padding: .2em .2em 0;
737
+ }
738
+ .ui-tabs .ui-tabs-nav li {
739
+ list-style: none;
740
+ float: left;
741
+ position: relative;
742
+ top: 0;
743
+ margin: 1px .2em 0 0;
744
+ border-bottom-width: 0;
745
+ padding: 0;
746
+ white-space: nowrap;
747
+ }
748
+ .ui-tabs .ui-tabs-nav .ui-tabs-anchor {
749
+ float: left;
750
+ padding: .5em 1em;
751
+ text-decoration: none;
752
+ }
753
+ .ui-tabs .ui-tabs-nav li.ui-tabs-active {
754
+ margin-bottom: -1px;
755
+ padding-bottom: 1px;
756
+ }
757
+ .ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,
758
+ .ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,
759
+ .ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor {
760
+ cursor: text;
761
+ }
762
+ .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor {
763
+ cursor: pointer;
764
+ }
765
+ .ui-tabs .ui-tabs-panel {
766
+ display: block;
767
+ border-width: 0;
768
+ padding: 1em 1.4em;
769
+ background: none;
770
+ }
771
+ .ui-tooltip {
772
+ padding: 8px;
773
+ position: absolute;
774
+ z-index: 9999;
775
+ max-width: 300px;
776
+ -webkit-box-shadow: 0 0 5px #aaa;
777
+ box-shadow: 0 0 5px #aaa;
778
+ }
779
+ body .ui-tooltip {
780
+ border-width: 2px;
781
+ }
782
+
783
+ /* Component containers
784
+ ----------------------------------*/
785
+ .ui-widget {
786
+ font-family: Verdana,Arial,sans-serif;
787
+ font-size: 1.1em;
788
+ }
789
+ .ui-widget .ui-widget {
790
+ font-size: 1em;
791
+ }
792
+ .ui-widget input,
793
+ .ui-widget select,
794
+ .ui-widget textarea,
795
+ .ui-widget button {
796
+ font-family: Verdana,Arial,sans-serif;
797
+ font-size: 1em;
798
+ }
799
+ .ui-widget-content {
800
+ border: 1px solid #aaaaaa;
801
+ background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;
802
+ color: #222222;
803
+ }
804
+ .ui-widget-content a {
805
+ color: #222222;
806
+ }
807
+ .ui-widget-header {
808
+ border: 1px solid #aaaaaa;
809
+ background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;
810
+ color: #222222;
811
+ font-weight: bold;
812
+ }
813
+ .ui-widget-header a {
814
+ color: #222222;
815
+ }
816
+
817
+ /* Interaction states
818
+ ----------------------------------*/
819
+ .ui-state-default,
820
+ .ui-widget-content .ui-state-default,
821
+ .ui-widget-header .ui-state-default {
822
+ border: 1px solid #d3d3d3;
823
+ background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;
824
+ font-weight: normal;
825
+ color: #555555;
826
+ }
827
+ .ui-state-default a,
828
+ .ui-state-default a:link,
829
+ .ui-state-default a:visited {
830
+ color: #555555;
831
+ text-decoration: none;
832
+ }
833
+ .ui-state-hover,
834
+ .ui-widget-content .ui-state-hover,
835
+ .ui-widget-header .ui-state-hover,
836
+ .ui-state-focus,
837
+ .ui-widget-content .ui-state-focus,
838
+ .ui-widget-header .ui-state-focus {
839
+ border: 1px solid #999999;
840
+ background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;
841
+ font-weight: normal;
842
+ color: #212121;
843
+ }
844
+ .ui-state-hover a,
845
+ .ui-state-hover a:hover,
846
+ .ui-state-hover a:link,
847
+ .ui-state-hover a:visited,
848
+ .ui-state-focus a,
849
+ .ui-state-focus a:hover,
850
+ .ui-state-focus a:link,
851
+ .ui-state-focus a:visited {
852
+ color: #212121;
853
+ text-decoration: none;
854
+ }
855
+ .ui-state-active,
856
+ .ui-widget-content .ui-state-active,
857
+ .ui-widget-header .ui-state-active {
858
+ border: 1px solid #aaaaaa;
859
+ background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;
860
+ font-weight: normal;
861
+ color: #212121;
862
+ }
863
+ .ui-state-active a,
864
+ .ui-state-active a:link,
865
+ .ui-state-active a:visited {
866
+ color: #212121;
867
+ text-decoration: none;
868
+ }
869
+
870
+ /* Interaction Cues
871
+ ----------------------------------*/
872
+ .ui-state-highlight,
873
+ .ui-widget-content .ui-state-highlight,
874
+ .ui-widget-header .ui-state-highlight {
875
+ border: 1px solid #fcefa1;
876
+ background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;
877
+ color: #363636;
878
+ }
879
+ .ui-state-highlight a,
880
+ .ui-widget-content .ui-state-highlight a,
881
+ .ui-widget-header .ui-state-highlight a {
882
+ color: #363636;
883
+ }
884
+ .ui-state-error,
885
+ .ui-widget-content .ui-state-error,
886
+ .ui-widget-header .ui-state-error {
887
+ border: 1px solid #cd0a0a;
888
+ background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;
889
+ color: #cd0a0a;
890
+ }
891
+ .ui-state-error a,
892
+ .ui-widget-content .ui-state-error a,
893
+ .ui-widget-header .ui-state-error a {
894
+ color: #cd0a0a;
895
+ }
896
+ .ui-state-error-text,
897
+ .ui-widget-content .ui-state-error-text,
898
+ .ui-widget-header .ui-state-error-text {
899
+ color: #cd0a0a;
900
+ }
901
+ .ui-priority-primary,
902
+ .ui-widget-content .ui-priority-primary,
903
+ .ui-widget-header .ui-priority-primary {
904
+ font-weight: bold;
905
+ }
906
+ .ui-priority-secondary,
907
+ .ui-widget-content .ui-priority-secondary,
908
+ .ui-widget-header .ui-priority-secondary {
909
+ opacity: .7;
910
+ filter:Alpha(Opacity=70);
911
+ font-weight: normal;
912
+ }
913
+ .ui-state-disabled,
914
+ .ui-widget-content .ui-state-disabled,
915
+ .ui-widget-header .ui-state-disabled {
916
+ opacity: .35;
917
+ filter:Alpha(Opacity=35);
918
+ background-image: none;
919
+ }
920
+ .ui-state-disabled .ui-icon {
921
+ filter:Alpha(Opacity=35); /* For IE8 - See #6059 */
922
+ }
923
+
924
+ /* Icons
925
+ ----------------------------------*/
926
+
927
+ /* states and images */
928
+ .ui-icon {
929
+ width: 16px;
930
+ height: 16px;
931
+ }
932
+ .ui-icon,
933
+ .ui-widget-content .ui-icon {
934
+ background-image: url(images/ui-icons_222222_256x240.png);
935
+ }
936
+ .ui-widget-header .ui-icon {
937
+ background-image: url(images/ui-icons_222222_256x240.png);
938
+ }
939
+ .ui-state-default .ui-icon {
940
+ background-image: url(images/ui-icons_888888_256x240.png);
941
+ }
942
+ .ui-state-hover .ui-icon,
943
+ .ui-state-focus .ui-icon {
944
+ background-image: url(images/ui-icons_454545_256x240.png);
945
+ }
946
+ .ui-state-active .ui-icon {
947
+ background-image: url(images/ui-icons_454545_256x240.png);
948
+ }
949
+ .ui-state-highlight .ui-icon {
950
+ background-image: url(images/ui-icons_2e83ff_256x240.png);
951
+ }
952
+ .ui-state-error .ui-icon,
953
+ .ui-state-error-text .ui-icon {
954
+ background-image: url(images/ui-icons_cd0a0a_256x240.png);
955
+ }
956
+
957
+ /* positioning */
958
+ .ui-icon-blank { background-position: 16px 16px; }
959
+ .ui-icon-carat-1-n { background-position: 0 0; }
960
+ .ui-icon-carat-1-ne { background-position: -16px 0; }
961
+ .ui-icon-carat-1-e { background-position: -32px 0; }
962
+ .ui-icon-carat-1-se { background-position: -48px 0; }
963
+ .ui-icon-carat-1-s { background-position: -64px 0; }
964
+ .ui-icon-carat-1-sw { background-position: -80px 0; }
965
+ .ui-icon-carat-1-w { background-position: -96px 0; }
966
+ .ui-icon-carat-1-nw { background-position: -112px 0; }
967
+ .ui-icon-carat-2-n-s { background-position: -128px 0; }
968
+ .ui-icon-carat-2-e-w { background-position: -144px 0; }
969
+ .ui-icon-triangle-1-n { background-position: 0 -16px; }
970
+ .ui-icon-triangle-1-ne { background-position: -16px -16px; }
971
+ .ui-icon-triangle-1-e { background-position: -32px -16px; }
972
+ .ui-icon-triangle-1-se { background-position: -48px -16px; }
973
+ .ui-icon-triangle-1-s { background-position: -64px -16px; }
974
+ .ui-icon-triangle-1-sw { background-position: -80px -16px; }
975
+ .ui-icon-triangle-1-w { background-position: -96px -16px; }
976
+ .ui-icon-triangle-1-nw { background-position: -112px -16px; }
977
+ .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
978
+ .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
979
+ .ui-icon-arrow-1-n { background-position: 0 -32px; }
980
+ .ui-icon-arrow-1-ne { background-position: -16px -32px; }
981
+ .ui-icon-arrow-1-e { background-position: -32px -32px; }
982
+ .ui-icon-arrow-1-se { background-position: -48px -32px; }
983
+ .ui-icon-arrow-1-s { background-position: -64px -32px; }
984
+ .ui-icon-arrow-1-sw { background-position: -80px -32px; }
985
+ .ui-icon-arrow-1-w { background-position: -96px -32px; }
986
+ .ui-icon-arrow-1-nw { background-position: -112px -32px; }
987
+ .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
988
+ .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
989
+ .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
990
+ .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
991
+ .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
992
+ .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
993
+ .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
994
+ .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
995
+ .ui-icon-arrowthick-1-n { background-position: 0 -48px; }
996
+ .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
997
+ .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
998
+ .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
999
+ .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
1000
+ .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
1001
+ .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
1002
+ .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
1003
+ .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
1004
+ .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
1005
+ .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
1006
+ .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
1007
+ .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
1008
+ .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
1009
+ .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
1010
+ .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
1011
+ .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
1012
+ .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
1013
+ .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
1014
+ .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
1015
+ .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
1016
+ .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
1017
+ .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
1018
+ .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
1019
+ .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
1020
+ .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
1021
+ .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
1022
+ .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
1023
+ .ui-icon-arrow-4 { background-position: 0 -80px; }
1024
+ .ui-icon-arrow-4-diag { background-position: -16px -80px; }
1025
+ .ui-icon-extlink { background-position: -32px -80px; }
1026
+ .ui-icon-newwin { background-position: -48px -80px; }
1027
+ .ui-icon-refresh { background-position: -64px -80px; }
1028
+ .ui-icon-shuffle { background-position: -80px -80px; }
1029
+ .ui-icon-transfer-e-w { background-position: -96px -80px; }
1030
+ .ui-icon-transferthick-e-w { background-position: -112px -80px; }
1031
+ .ui-icon-folder-collapsed { background-position: 0 -96px; }
1032
+ .ui-icon-folder-open { background-position: -16px -96px; }
1033
+ .ui-icon-document { background-position: -32px -96px; }
1034
+ .ui-icon-document-b { background-position: -48px -96px; }
1035
+ .ui-icon-note { background-position: -64px -96px; }
1036
+ .ui-icon-mail-closed { background-position: -80px -96px; }
1037
+ .ui-icon-mail-open { background-position: -96px -96px; }
1038
+ .ui-icon-suitcase { background-position: -112px -96px; }
1039
+ .ui-icon-comment { background-position: -128px -96px; }
1040
+ .ui-icon-person { background-position: -144px -96px; }
1041
+ .ui-icon-print { background-position: -160px -96px; }
1042
+ .ui-icon-trash { background-position: -176px -96px; }
1043
+ .ui-icon-locked { background-position: -192px -96px; }
1044
+ .ui-icon-unlocked { background-position: -208px -96px; }
1045
+ .ui-icon-bookmark { background-position: -224px -96px; }
1046
+ .ui-icon-tag { background-position: -240px -96px; }
1047
+ .ui-icon-home { background-position: 0 -112px; }
1048
+ .ui-icon-flag { background-position: -16px -112px; }
1049
+ .ui-icon-calendar { background-position: -32px -112px; }
1050
+ .ui-icon-cart { background-position: -48px -112px; }
1051
+ .ui-icon-pencil { background-position: -64px -112px; }
1052
+ .ui-icon-clock { background-position: -80px -112px; }
1053
+ .ui-icon-disk { background-position: -96px -112px; }
1054
+ .ui-icon-calculator { background-position: -112px -112px; }
1055
+ .ui-icon-zoomin { background-position: -128px -112px; }
1056
+ .ui-icon-zoomout { background-position: -144px -112px; }
1057
+ .ui-icon-search { background-position: -160px -112px; }
1058
+ .ui-icon-wrench { background-position: -176px -112px; }
1059
+ .ui-icon-gear { background-position: -192px -112px; }
1060
+ .ui-icon-heart { background-position: -208px -112px; }
1061
+ .ui-icon-star { background-position: -224px -112px; }
1062
+ .ui-icon-link { background-position: -240px -112px; }
1063
+ .ui-icon-cancel { background-position: 0 -128px; }
1064
+ .ui-icon-plus { background-position: -16px -128px; }
1065
+ .ui-icon-plusthick { background-position: -32px -128px; }
1066
+ .ui-icon-minus { background-position: -48px -128px; }
1067
+ .ui-icon-minusthick { background-position: -64px -128px; }
1068
+ .ui-icon-close { background-position: -80px -128px; }
1069
+ .ui-icon-closethick { background-position: -96px -128px; }
1070
+ .ui-icon-key { background-position: -112px -128px; }
1071
+ .ui-icon-lightbulb { background-position: -128px -128px; }
1072
+ .ui-icon-scissors { background-position: -144px -128px; }
1073
+ .ui-icon-clipboard { background-position: -160px -128px; }
1074
+ .ui-icon-copy { background-position: -176px -128px; }
1075
+ .ui-icon-contact { background-position: -192px -128px; }
1076
+ .ui-icon-image { background-position: -208px -128px; }
1077
+ .ui-icon-video { background-position: -224px -128px; }
1078
+ .ui-icon-script { background-position: -240px -128px; }
1079
+ .ui-icon-alert { background-position: 0 -144px; }
1080
+ .ui-icon-info { background-position: -16px -144px; }
1081
+ .ui-icon-notice { background-position: -32px -144px; }
1082
+ .ui-icon-help { background-position: -48px -144px; }
1083
+ .ui-icon-check { background-position: -64px -144px; }
1084
+ .ui-icon-bullet { background-position: -80px -144px; }
1085
+ .ui-icon-radio-on { background-position: -96px -144px; }
1086
+ .ui-icon-radio-off { background-position: -112px -144px; }
1087
+ .ui-icon-pin-w { background-position: -128px -144px; }
1088
+ .ui-icon-pin-s { background-position: -144px -144px; }
1089
+ .ui-icon-play { background-position: 0 -160px; }
1090
+ .ui-icon-pause { background-position: -16px -160px; }
1091
+ .ui-icon-seek-next { background-position: -32px -160px; }
1092
+ .ui-icon-seek-prev { background-position: -48px -160px; }
1093
+ .ui-icon-seek-end { background-position: -64px -160px; }
1094
+ .ui-icon-seek-start { background-position: -80px -160px; }
1095
+ /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
1096
+ .ui-icon-seek-first { background-position: -80px -160px; }
1097
+ .ui-icon-stop { background-position: -96px -160px; }
1098
+ .ui-icon-eject { background-position: -112px -160px; }
1099
+ .ui-icon-volume-off { background-position: -128px -160px; }
1100
+ .ui-icon-volume-on { background-position: -144px -160px; }
1101
+ .ui-icon-power { background-position: 0 -176px; }
1102
+ .ui-icon-signal-diag { background-position: -16px -176px; }
1103
+ .ui-icon-signal { background-position: -32px -176px; }
1104
+ .ui-icon-battery-0 { background-position: -48px -176px; }
1105
+ .ui-icon-battery-1 { background-position: -64px -176px; }
1106
+ .ui-icon-battery-2 { background-position: -80px -176px; }
1107
+ .ui-icon-battery-3 { background-position: -96px -176px; }
1108
+ .ui-icon-circle-plus { background-position: 0 -192px; }
1109
+ .ui-icon-circle-minus { background-position: -16px -192px; }
1110
+ .ui-icon-circle-close { background-position: -32px -192px; }
1111
+ .ui-icon-circle-triangle-e { background-position: -48px -192px; }
1112
+ .ui-icon-circle-triangle-s { background-position: -64px -192px; }
1113
+ .ui-icon-circle-triangle-w { background-position: -80px -192px; }
1114
+ .ui-icon-circle-triangle-n { background-position: -96px -192px; }
1115
+ .ui-icon-circle-arrow-e { background-position: -112px -192px; }
1116
+ .ui-icon-circle-arrow-s { background-position: -128px -192px; }
1117
+ .ui-icon-circle-arrow-w { background-position: -144px -192px; }
1118
+ .ui-icon-circle-arrow-n { background-position: -160px -192px; }
1119
+ .ui-icon-circle-zoomin { background-position: -176px -192px; }
1120
+ .ui-icon-circle-zoomout { background-position: -192px -192px; }
1121
+ .ui-icon-circle-check { background-position: -208px -192px; }
1122
+ .ui-icon-circlesmall-plus { background-position: 0 -208px; }
1123
+ .ui-icon-circlesmall-minus { background-position: -16px -208px; }
1124
+ .ui-icon-circlesmall-close { background-position: -32px -208px; }
1125
+ .ui-icon-squaresmall-plus { background-position: -48px -208px; }
1126
+ .ui-icon-squaresmall-minus { background-position: -64px -208px; }
1127
+ .ui-icon-squaresmall-close { background-position: -80px -208px; }
1128
+ .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
1129
+ .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
1130
+ .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
1131
+ .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
1132
+ .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
1133
+ .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
1134
+
1135
+
1136
+ /* Misc visuals
1137
+ ----------------------------------*/
1138
+
1139
+ /* Corner radius */
1140
+ .ui-corner-all,
1141
+ .ui-corner-top,
1142
+ .ui-corner-left,
1143
+ .ui-corner-tl {
1144
+ border-top-left-radius: 4px;
1145
+ }
1146
+ .ui-corner-all,
1147
+ .ui-corner-top,
1148
+ .ui-corner-right,
1149
+ .ui-corner-tr {
1150
+ border-top-right-radius: 4px;
1151
+ }
1152
+ .ui-corner-all,
1153
+ .ui-corner-bottom,
1154
+ .ui-corner-left,
1155
+ .ui-corner-bl {
1156
+ border-bottom-left-radius: 4px;
1157
+ }
1158
+ .ui-corner-all,
1159
+ .ui-corner-bottom,
1160
+ .ui-corner-right,
1161
+ .ui-corner-br {
1162
+ border-bottom-right-radius: 4px;
1163
+ }
1164
+
1165
+ /* Overlays */
1166
+ .ui-widget-overlay {
1167
+ background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;
1168
+ opacity: .3;
1169
+ filter: Alpha(Opacity=30);
1170
+ }
1171
+ .ui-widget-shadow {
1172
+ margin: -8px 0 0 -8px;
1173
+ padding: 8px;
1174
+ background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;
1175
+ opacity: .3;
1176
+ filter: Alpha(Opacity=30);
1177
+ border-radius: 8px;
1178
  }
css/jquery.dataTables.css CHANGED
@@ -1,212 +1,212 @@
1
- /*
2
- * Table
3
- */
4
- table.dataTable {
5
- margin: 0 auto;
6
- clear: both;
7
- width: 100%;
8
- margin-bottom: .5em;
9
- }
10
-
11
- table.dataTable thead th {
12
- padding: 3px 18px 3px 10px;
13
- border-bottom: 1px solid lightgrey;
14
- font-weight: bold;
15
- cursor: pointer;
16
- *cursor: hand;
17
- }
18
-
19
- table.dataTable tfoot th {
20
- padding: 3px 18px 3px 10px;
21
- border-top: 1px solid black;
22
- font-weight: bold;
23
- }
24
-
25
- table.dataTable td {
26
- padding: 3px 10px;
27
- }
28
-
29
- table.dataTable td.center,
30
- table.dataTable td.dataTables_empty {
31
- text-align: center;
32
- }
33
-
34
-
35
- /*
36
- * Table wrapper
37
- */
38
- .dataTables_wrapper {
39
- position: relative;
40
- clear: both;
41
- *zoom: 1;
42
- }
43
-
44
-
45
- /*
46
- * Page length menu
47
- */
48
- .dataTables_length {
49
- float: left;
50
- margin-bottom: .75em;
51
- }
52
-
53
-
54
- /*
55
- * Filter
56
- */
57
- .dataTables_filter {
58
- float: right;
59
- text-align: right;
60
- }
61
-
62
-
63
- /*
64
- * Table information
65
- */
66
- .dataTables_info {
67
- clear: both;
68
- float: left;
69
- }
70
-
71
-
72
- /*
73
- * Pagination
74
- */
75
- .dataTables_paginate {
76
- float: right;
77
- text-align: right;
78
- }
79
-
80
- /* Two button pagination - previous / next */
81
- .paginate_disabled_previous,
82
- .paginate_enabled_previous,
83
- .paginate_disabled_next,
84
- .paginate_enabled_next {
85
- height: 19px;
86
- float: left;
87
- cursor: pointer;
88
- *cursor: hand;
89
- color: #111 !important;
90
- }
91
- .paginate_disabled_previous:hover,
92
- .paginate_enabled_previous:hover,
93
- .paginate_disabled_next:hover,
94
- .paginate_enabled_next:hover {
95
- text-decoration: none !important;
96
- }
97
- .paginate_disabled_previous:active,
98
- .paginate_enabled_previous:active,
99
- .paginate_disabled_next:active,
100
- .paginate_enabled_next:active {
101
- outline: none;
102
- }
103
-
104
- .paginate_disabled_previous,
105
- .paginate_disabled_next {
106
- color: #666 !important;
107
- }
108
- .paginate_disabled_previous,
109
- .paginate_enabled_previous {
110
- padding-left: 23px;
111
- }
112
- .paginate_disabled_next,
113
- .paginate_enabled_next {
114
- padding-right: 23px;
115
- margin-left: 10px;
116
- }
117
-
118
- .paginate_enabled_previous { background: url('../images/pagination/back_enabled.png') no-repeat top left; }
119
- .paginate_enabled_previous:hover { background: url('../images/pagination/back_enabled_hover.png') no-repeat top left; }
120
- .paginate_disabled_previous { background: url('../images/pagination/back_disabled.png') no-repeat top left; }
121
-
122
- .paginate_enabled_next { background: url('../images/pagination/forward_enabled.png') no-repeat top right; }
123
- .paginate_enabled_next:hover { background: url('../images/pagination/forward_enabled_hover.png') no-repeat top right; }
124
- .paginate_disabled_next { background: url('../images/pagination/forward_disabled.png') no-repeat top right; }
125
-
126
- /* Full number pagination */
127
- .paging_full_numbers {
128
- height: 22px;
129
- line-height: 22px;
130
- }
131
- .paging_full_numbers a:active {
132
- outline: none
133
- }
134
- .paging_full_numbers a:hover {
135
- text-decoration: none;
136
- }
137
-
138
- .paging_full_numbers a.paginate_button,
139
- .paging_full_numbers a.paginate_active {
140
- border: 1px solid #aaa;
141
- -webkit-border-radius: 5px;
142
- -moz-border-radius: 5px;
143
- border-radius: 5px;
144
- padding: 2px 5px;
145
- margin: 0 3px;
146
- cursor: pointer;
147
- *cursor: hand;
148
- color: #333 !important;
149
- }
150
-
151
- .paging_full_numbers a.paginate_button {
152
- background-color: #ddd;
153
- }
154
-
155
- .paging_full_numbers a.paginate_button:hover {
156
- background-color: #ccc;
157
- text-decoration: none !important;
158
- }
159
-
160
- .paging_full_numbers a.paginate_active {
161
- background-color: #99B3FF;
162
- }
163
-
164
-
165
- /*
166
- * Processing indicator
167
- */
168
- .dataTables_processing {
169
- position: absolute;
170
- top: 50%;
171
- left: 50%;
172
- width: 250px;
173
- height: 30px;
174
- margin-left: -125px;
175
- margin-top: -15px;
176
- padding: 14px 0 2px 0;
177
- border: 1px solid #ddd;
178
- text-align: center;
179
- color: #999;
180
- font-size: 14px;
181
- background-color: white;
182
- }
183
-
184
-
185
- /*
186
- * Sorting
187
- */
188
- .sorting { background: url('../images/pagination/sort_both.png') no-repeat center right; }
189
- .sorting_asc { background: url('../images/pagination/sort_asc.png') no-repeat center right; }
190
- .sorting_desc { background: url('../images/pagination/sort_desc.png') no-repeat center right; }
191
-
192
- .sorting_asc_disabled { background: url('../images/pagination/sort_asc_disabled.png') no-repeat center right; }
193
- .sorting_desc_disabled { background: url('../images/pagination/sort_desc_disabled.png') no-repeat center right; }
194
-
195
- table.dataTable thead th:active,
196
- table.dataTable thead td:active {
197
- outline: none;
198
- }
199
-
200
-
201
- /*
202
- * Scrolling
203
- */
204
- .dataTables_scroll {
205
- clear: both;
206
- }
207
-
208
- .dataTables_scrollBody {
209
- *margin-top: -1px;
210
- -webkit-overflow-scrolling: touch;
211
- }
212
-
1
+ /*
2
+ * Table
3
+ */
4
+ table.dataTable {
5
+ margin: 0 auto;
6
+ clear: both;
7
+ width: 100%;
8
+ margin-bottom: .5em;
9
+ }
10
+
11
+ table.dataTable thead th {
12
+ padding: 3px 18px 3px 10px;
13
+ border-bottom: 1px solid lightgrey;
14
+ font-weight: bold;
15
+ cursor: pointer;
16
+ *cursor: hand;
17
+ }
18
+
19
+ table.dataTable tfoot th {
20
+ padding: 3px 18px 3px 10px;
21
+ border-top: 1px solid black;
22
+ font-weight: bold;
23
+ }
24
+
25
+ table.dataTable td {
26
+ padding: 3px 10px;
27
+ }
28
+
29
+ table.dataTable td.center,
30
+ table.dataTable td.dataTables_empty {
31
+ text-align: center;
32
+ }
33
+
34
+
35
+ /*
36
+ * Table wrapper
37
+ */
38
+ .dataTables_wrapper {
39
+ position: relative;
40
+ clear: both;
41
+ *zoom: 1;
42
+ }
43
+
44
+
45
+ /*
46
+ * Page length menu
47
+ */
48
+ .dataTables_length {
49
+ float: left;
50
+ margin-bottom: .75em;
51
+ }
52
+
53
+
54
+ /*
55
+ * Filter
56
+ */
57
+ .dataTables_filter {
58
+ float: right;
59
+ text-align: right;
60
+ }
61
+
62
+
63
+ /*
64
+ * Table information
65
+ */
66
+ .dataTables_info {
67
+ clear: both;
68
+ float: left;
69
+ }
70
+
71
+
72
+ /*
73
+ * Pagination
74
+ */
75
+ .dataTables_paginate {
76
+ float: right;
77
+ text-align: right;
78
+ }
79
+
80
+ /* Two button pagination - previous / next */
81
+ .paginate_disabled_previous,
82
+ .paginate_enabled_previous,
83
+ .paginate_disabled_next,
84
+ .paginate_enabled_next {
85
+ height: 19px;
86
+ float: left;
87
+ cursor: pointer;
88
+ *cursor: hand;
89
+ color: #111 !important;
90
+ }
91
+ .paginate_disabled_previous:hover,
92
+ .paginate_enabled_previous:hover,
93
+ .paginate_disabled_next:hover,
94
+ .paginate_enabled_next:hover {
95
+ text-decoration: none !important;
96
+ }
97
+ .paginate_disabled_previous:active,
98
+ .paginate_enabled_previous:active,
99
+ .paginate_disabled_next:active,
100
+ .paginate_enabled_next:active {
101
+ outline: none;
102
+ }
103
+
104
+ .paginate_disabled_previous,
105
+ .paginate_disabled_next {
106
+ color: #666 !important;
107
+ }
108
+ .paginate_disabled_previous,
109
+ .paginate_enabled_previous {
110
+ padding-left: 23px;
111
+ }
112
+ .paginate_disabled_next,
113
+ .paginate_enabled_next {
114
+ padding-right: 23px;
115
+ margin-left: 10px;
116
+ }
117
+
118
+ .paginate_enabled_previous { background: url('../images/pagination/back_enabled.png') no-repeat top left; }
119
+ .paginate_enabled_previous:hover { background: url('../images/pagination/back_enabled_hover.png') no-repeat top left; }
120
+ .paginate_disabled_previous { background: url('../images/pagination/back_disabled.png') no-repeat top left; }
121
+
122
+ .paginate_enabled_next { background: url('../images/pagination/forward_enabled.png') no-repeat top right; }
123
+ .paginate_enabled_next:hover { background: url('../images/pagination/forward_enabled_hover.png') no-repeat top right; }
124
+ .paginate_disabled_next { background: url('../images/pagination/forward_disabled.png') no-repeat top right; }
125
+
126
+ /* Full number pagination */
127
+ .paging_full_numbers {
128
+ height: 22px;
129
+ line-height: 22px;
130
+ }
131
+ .paging_full_numbers a:active {
132
+ outline: none
133
+ }
134
+ .paging_full_numbers a:hover {
135
+ text-decoration: none;
136
+ }
137
+
138
+ .paging_full_numbers a.paginate_button,
139
+ .paging_full_numbers a.paginate_active {
140
+ border: 1px solid #aaa;
141
+ -webkit-border-radius: 5px;
142
+ -moz-border-radius: 5px;
143
+ border-radius: 5px;
144
+ padding: 2px 5px;
145
+ margin: 0 3px;
146
+ cursor: pointer;
147
+ *cursor: hand;
148
+ color: #333 !important;
149
+ }
150
+
151
+ .paging_full_numbers a.paginate_button {
152
+ background-color: #ddd;
153
+ }
154
+
155
+ .paging_full_numbers a.paginate_button:hover {
156
+ background-color: #ccc;
157
+ text-decoration: none !important;
158
+ }
159
+
160
+ .paging_full_numbers a.paginate_active {
161
+ background-color: #99B3FF;
162
+ }
163
+
164
+
165
+ /*
166
+ * Processing indicator
167
+ */
168
+ .dataTables_processing {
169
+ position: absolute;
170
+ top: 50%;
171
+ left: 50%;
172
+ width: 250px;
173
+ height: 30px;
174
+ margin-left: -125px;
175
+ margin-top: -15px;
176
+ padding: 14px 0 2px 0;
177
+ border: 1px solid #ddd;
178
+ text-align: center;
179
+ color: #999;
180
+ font-size: 14px;
181
+ background-color: white;
182
+ }
183
+
184
+
185
+ /*
186
+ * Sorting
187
+ */
188
+ .sorting { background: url('../images/pagination/sort_both.png') no-repeat center right; }
189
+ .sorting_asc { background: url('../images/pagination/sort_asc.png') no-repeat center right; }
190
+ .sorting_desc { background: url('../images/pagination/sort_desc.png') no-repeat center right; }
191
+
192
+ .sorting_asc_disabled { background: url('../images/pagination/sort_asc_disabled.png') no-repeat center right; }
193
+ .sorting_desc_disabled { background: url('../images/pagination/sort_desc_disabled.png') no-repeat center right; }
194
+
195
+ table.dataTable thead th:active,
196
+ table.dataTable thead td:active {
197
+ outline: none;
198
+ }
199
+
200
+
201
+ /*
202
+ * Scrolling
203
+ */
204
+ .dataTables_scroll {
205
+ clear: both;
206
+ }
207
+
208
+ .dataTables_scrollBody {
209
+ *margin-top: -1px;
210
+ -webkit-overflow-scrolling: touch;
211
+ }
212
+
css/style.ykseme.css CHANGED
@@ -1,1735 +1,2061 @@
1
- /* =========== Helper Classes =========== */
2
-
3
- .yks-hidden {display: none;}
4
-
5
- .yks-text-right {text-align: right;}
6
- .yks-text-left {text-align: left;}
7
- .yks-text-center {text-align: center;}
8
-
9
- .yks-right {float: right;}
10
- .yks-left {float: left;}
11
-
12
- .yks-margin-left {margin-left: 2em;}
13
-
14
-
15
- /*******************************************/
16
- /**** Include Our Custom Web Font ****/
17
- @font-face {
18
- font-family: 'yks-mc-font';
19
- src:url('fonts/yks-mc-font.eot?-e5ggdf');
20
- src:url('fonts/yks-mc-font.eot?#iefix-e5ggdf') format('embedded-opentype'),
21
- url('fonts/yks-mc-font.woff?-e5ggdf') format('woff'),
22
- url('fonts/yks-mc-font.ttf?-e5ggdf') format('truetype'),
23
- url('fonts/yks-mc-font.svg?-e5ggdf#yks-mc-font') format('svg');
24
- font-weight: normal;
25
- font-style: normal;
26
- }
27
-
28
- .yks_mc_error_x {
29
- color:#DD3D36;
30
- }
31
-
32
- /* TinyMCE Button Class */
33
- /* Icon Fonts */
34
- .mce-i-yks-mc-icon-yikes-button-image:before {
35
- content: "\e600" !important;
36
- font-family: 'yks-mc-font' !important;
37
- }
38
-
39
- .toplevel_page_yks-mailchimp-form .update-nag {
40
- padding-top:0;
41
- margin-top:0;
42
- width:95%;
43
- margin-right:0;
44
- }
45
-
46
- .yks-mc-icon-notice {
47
- display:block;
48
- }
49
-
50
- .update-nag .yks-mc-icon-notice:before {
51
- content: "\e601" !important;
52
- font-family: 'yks-mc-font' !important;
53
- float:left;
54
- font-size:1.5em;
55
- color: #FFBA00;
56
- display:block;
57
- margin-right: .25em;
58
- }
59
-
60
- /* Reset Plugin Modal and Icons */
61
- .yks-mc-icon-yks-mc-warning:before {
62
- content: "\e602";
63
- font-family: 'yks-mc-font' !important;
64
- }
65
-
66
- .yks-mc-reset-warning-icon {
67
- font-size: 3.25em;
68
- color: rgb(255, 76, 76);
69
- text-align:center;
70
- float:left;
71
- margin-right:.25em;
72
- margin-top:.75em;
73
- }
74
-
75
- .yks_mc_about_icon {
76
- display:block;
77
- float:left;
78
- margin-top:2em;
79
- }
80
-
81
- .yks-mc-delete-form-warning-icon {
82
- font-size: 3.25em;
83
- color: rgb(255, 76, 76);
84
- text-align:center;
85
- float:left;
86
- margin-right:.25em;
87
- }
88
-
89
- .yks-mc-success-icon {
90
- font-size: 3.25em;
91
- color: rgb(126, 207, 110);
92
- text-align:center;
93
- margin-top: .25em;
94
- margin-right: .75em;
95
- float:left;
96
- }
97
-
98
- .yks-mc-reset-plugin-settings-preloader {
99
- width: 15p