My Calendar - Version 2.3.0

Version Description

This is a major revision.

  • Bug fix: Manage events screen showed no data for users without manage_events permissions.
  • Bug fix: if single event set, could not filter to time period views.
  • Bug fix: 'single' template ID not passed into template filter.
  • Bug fix: events in private categories appeared in time-based upcoming events lists.
  • Bug fix: RSS feed encoding.
  • Bug fix: Turn-of-year issues with week view.
  • Bug fix: Added new locations multiple times if added with multiple occurrences of an event.
  • Bug fix: In some browsers, time selector added invalid data.
  • Bug fix: List of search results not wrapped in a list element.
  • Bug fix: Trim spaces on above/below navigation strings.
  • Bug fix: If an event ends at midnight, automatically end tomorrow unless set for a later date.
  • Bug fix: Don't show events on both days if they end at midnight.
  • Bug fix: Don't attempt to enqueue jquery.charcount.js if WP to Twitter not installed.
  • Bug fix: Dates didn't strip links in list view when JS disabled for that view.

  • New template tag: {runtime} to show human language version of length of event.

  • New template tag: {excerpt} to create autoexcerpt from description field, using shortdesc if it exists.

  • New feature: Accessibility features for locations.

  • New feature: Specify accessibility services for events.

  • New feature: ticketing link field

  • New feature: event registration information fields

  • New feature: my_calendar_event shortcode can query templates by keyword (list,mini,single,grid).

  • New feature: filter events by available accessibility services

  • New feature: Combined filter shortcode to group all filters into a single form. [mc_filters show='locations,categories,access']

  • New feature: new API for adding custom fields to events.

  • New feature: data API to fetch event data in JSON, CSV, or RSS formats.

  • New feature: Archive events to hide from admin events list.

  • New feature: Control input options for multiple types of location input data.

  • New feature: Shortcode generator for primary, upcoming, and today's events shortcodes.

  • New feature: admin-side event search

  • New feature: category key now acts as quick links to filter by category

  • New feature: Option to add title to Event Search widget.

  • New filter: mc_date_format for customizing date formats.

  • New filter: customize search results page: mc_search_page

  • New filter: mc_use_permalinks to enable use of custom post type permalinks for single event pages.

  • New filter: mc_post_template to customize template used in single event shortcode automatically inserted into custom post type pages.

  • New design: new stylesheet available: twentyfourteen.css

  • Updated: added more fields to search on events.

  • Updated: updated image uploader to use add media panel and store attachment ID

  • Updated:

    template supports all template tags (but strips HTML.).
  • Updated: Various aspects of UI

  • Updated: Date/time selectors. See http://amsul.ca/pickadate.js/, MIT license.

  • Reorganized default output template code.

  • Import all used locations into location manager.

  • Removed User settings fields.

  • Moved Holiday category assignment to Category Manager.

  • Improved get current URL function.

  • iCal output in multiple-month view outputs all displayed months.

  • {map} template tag to display a Google Map using the Google Maps API. (Not available in pop-up displays.)

  • Scheduled removal of showkey, shownav, toggle, and showjump shortcode attributes.

  • Removed upgrade support for 1.6.x & 1.7.x series of My Calendar.

Download this release

Release Info

Developer joedolson
Plugin Icon 128x128 My Calendar
Version 2.3.0
Comparing to
See all releases

Code changes from version 2.2.13 to 2.3.0

Files changed (149) hide show
  1. button/generator.css +0 -37
  2. button/generator.php +0 -136
  3. button/mcb.js +0 -125
  4. button/tinymce3/calendarButton.gif +0 -0
  5. button/tinymce3/editor_plugin.js +0 -61
  6. button/tinymce3/langs/en.js +0 -4
  7. button/tinymce3/langs/es.js +0 -4
  8. button/tinymce3/langs/fr.js +0 -4
  9. button/tinymce3/langs/ru.js +0 -4
  10. button/tinymce3/mcb.png +0 -0
  11. mc-admin.css → css/mc-admin.css +0 -0
  12. mc-print.css → css/mc-print.css +3 -3
  13. css/mc-styles.css +110 -0
  14. css/reset.css +2 -0
  15. images/event-details.jpg +0 -0
  16. images/event-details.png +0 -0
  17. images/guide.png +0 -0
  18. images/ical.png +0 -0
  19. {icons → images/icons}/32x32/applications-toys.png +0 -0
  20. {icons → images/icons}/32x32/appointment.png +0 -0
  21. {icons → images/icons}/32x32/art.png +0 -0
  22. {icons → images/icons}/32x32/ball.png +0 -0
  23. {icons → images/icons}/32x32/call.png +0 -0
  24. {icons → images/icons}/32x32/concert.png +0 -0
  25. {icons → images/icons}/32x32/crafts.png +0 -0
  26. {icons → images/icons}/32x32/event-2.png +0 -0
  27. {icons → images/icons}/32x32/event.png +0 -0
  28. {icons → images/icons}/32x32/games.png +0 -0
  29. {icons → images/icons}/32x32/globe.png +0 -0
  30. {icons → images/icons}/32x32/meeting.png +0 -0
  31. {icons → images/icons}/32x32/movies.png +0 -0
  32. {icons → images/icons}/32x32/party.png +0 -0
  33. {icons → images/icons}/32x32/pi.png +0 -0
  34. {icons → images/icons}/32x32/rehearsal.png +0 -0
  35. {icons → images/icons}/32x32/school.png +0 -0
  36. {icons → images/icons}/32x32/shop.png +0 -0
  37. {icons → images/icons}/32x32/star.png +0 -0
  38. {icons → images/icons}/32x32/tickets.png +0 -0
  39. {icons → images/icons}/appointment.png +0 -0
  40. {icons → images/icons}/art.png +0 -0
  41. {icons → images/icons}/ball.png +0 -0
  42. {icons → images/icons}/call.png +0 -0
  43. {icons → images/icons}/concert.png +0 -0
  44. {icons → images/icons}/crafts.png +0 -0
  45. {icons → images/icons}/event-2.png +0 -0
  46. {icons → images/icons}/event.png +0 -0
  47. {icons → images/icons}/games.png +0 -0
  48. {icons → images/icons}/globe.png +0 -0
  49. {icons → images/icons}/meeting.png +0 -0
  50. {icons → images/icons}/movies.png +0 -0
  51. {icons → images/icons}/party.png +0 -0
  52. {icons → images/icons}/pi.png +0 -0
  53. {icons → images/icons}/rehearsal.png +0 -0
  54. {icons → images/icons}/school.png +0 -0
  55. {icons → images/icons}/shop.png +0 -0
  56. {icons → images/icons}/star.png +0 -0
  57. {icons → images/icons}/tickets.png +0 -0
  58. images/submissions.png +0 -0
  59. date-utilities.php → includes/date-utilities.php +0 -0
  60. js/calendrical.css +0 -28
  61. js/gmap3.min.js +10 -0
  62. js/jquery.addfields.js +3 -4
  63. js/jquery.calendrical.js +0 -484
  64. js/pickadate/legacy.js +10 -0
  65. js/pickadate/picker.date.js +5 -0
  66. js/pickadate/picker.js +7 -0
  67. js/pickadate/picker.time.js +5 -0
  68. js/pickadate/themes/classic.css +4 -0
  69. js/pickadate/themes/classic.date.css +1 -0
  70. js/pickadate/themes/classic.time.css +1 -0
  71. js/pickadate/themes/default.css +4 -0
  72. js/pickadate/themes/default.date.css +1 -0
  73. js/pickadate/themes/default.time.css +1 -0
  74. js/pickadate/themes/rtl.css +3 -0
  75. js/pickadate/translations/ar.js +1 -0
  76. js/pickadate/translations/bg_BG.js +1 -0
  77. js/pickadate/translations/bs_BA.js +1 -0
  78. js/pickadate/translations/ca_ES.js +1 -0
  79. js/pickadate/translations/cs_CZ.js +1 -0
  80. js/pickadate/translations/da_DK.js +1 -0
  81. js/pickadate/translations/de_DE.js +1 -0
  82. js/pickadate/translations/el_GR.js +1 -0
  83. js/pickadate/translations/es_ES.js +1 -0
  84. js/pickadate/translations/et_EE.js +1 -0
  85. js/pickadate/translations/eu_ES.js +1 -0
  86. js/pickadate/translations/fi_FI.js +1 -0
  87. js/pickadate/translations/fr_FR.js +1 -0
  88. js/pickadate/translations/gl_ES.js +1 -0
  89. js/pickadate/translations/he_IL.js +1 -0
  90. js/pickadate/translations/hr_HR.js +1 -0
  91. js/pickadate/translations/hu_HU.js +1 -0
  92. js/pickadate/translations/id_ID.js +1 -0
  93. js/pickadate/translations/is_IS.js +1 -0
  94. js/pickadate/translations/it_IT.js +1 -0
  95. js/pickadate/translations/ja_JP.js +1 -0
  96. js/pickadate/translations/ko_KR.js +1 -0
  97. js/pickadate/translations/nl_NL.js +1 -0
  98. js/pickadate/translations/no_NO.js +1 -0
  99. js/pickadate/translations/pl_PL.js +1 -0
  100. js/pickadate/translations/pt_BR.js +1 -0
  101. js/pickadate/translations/pt_PT.js +1 -0
  102. js/pickadate/translations/ro_RO.js +1 -0
  103. js/pickadate/translations/ru_RU.js +1 -0
  104. js/pickadate/translations/sk_SK.js +1 -0
  105. js/pickadate/translations/sl_SI.js +1 -0
  106. js/pickadate/translations/sv_SE.js +1 -0
  107. js/pickadate/translations/th_TH.js +1 -0
  108. js/pickadate/translations/tr_TR.js +1 -0
  109. js/pickadate/translations/uk_UA.js +1 -0
  110. js/pickadate/translations/zh_CN.js +1 -0
  111. js/pickadate/translations/zh_TW.js +1 -0
  112. js/sortable.js +18 -0
  113. js/tabs.js +15 -0
  114. js/upload.js +53 -12
  115. lang/my-calendar.pot +1686 -1490
  116. mc-styles.css +0 -63
  117. my-calendar-api.php +76 -0
  118. my-calendar-behaviors.php +44 -69
  119. my-calendar-categories.php +67 -57
  120. my-calendar-core.php +361 -483
  121. my-calendar-event-manager.php +1001 -766
  122. my-calendar-events.php +182 -96
  123. my-calendar-export.php +89 -3
  124. my-calendar-generator.php +163 -0
  125. my-calendar-group-manager.php +348 -335
  126. my-calendar-help.php +119 -41
  127. my-calendar-ical.php +21 -20
  128. my-calendar-importer.php +0 -117
  129. my-calendar-install.php +239 -223
  130. my-calendar-limits.php +38 -42
  131. my-calendar-locations.php +279 -125
  132. my-calendar-output.php +545 -436
  133. my-calendar-rss.php +0 -94
  134. my-calendar-settings.php +362 -501
  135. my-calendar-shortcodes.php +21 -8
  136. my-calendar-styles.php +102 -118
  137. my-calendar-templates.php +382 -212
  138. my-calendar-templating.php +32 -55
  139. my-calendar-upgrade-db.php +1 -1
  140. my-calendar-user.php +0 -57
  141. my-calendar-widgets.php +117 -135
  142. my-calendar.php +83 -95
  143. readme.txt +81 -28
  144. styles/dark.css +2 -2
  145. styles/inherit.css +3 -3
  146. styles/light.css +3 -3
  147. styles/my-calendar.css +5 -5
  148. styles/refresh.css +2 -2
  149. styles/twentyfourteen.css +60 -0
button/generator.css DELETED
@@ -1,37 +0,0 @@
1
- .wrap {
2
- margin: 0 5px;
3
- }
4
- fieldset {
5
- border: 1px solid #ccc;
6
- margin: 10px 0;
7
- padding: 10px;
8
- }
9
- label {
10
- display: block;
11
- float: left;
12
- width: 30%;
13
- margin-right: 10px;
14
- }
15
- .help, .clear {
16
- clear: left;
17
- }
18
- fieldset {
19
- margin: 6px 0;
20
- }
21
- input {
22
- line-height: normal;
23
- }
24
-
25
- input[type=text],
26
- select {
27
- width: 60%;
28
- }
29
- .req {
30
- color: red;
31
- }
32
- .resources {
33
- margin: 5px;
34
- padding: 10px;
35
- background: #fff;
36
- border: 1px solid #ccc;
37
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
button/generator.php DELETED
@@ -1,136 +0,0 @@
1
- <?php
2
- // Load WordPress core files
3
- $iswin = preg_match('/:\\\/', dirname(__file__));
4
- $slash = ($iswin) ? "\\" : "/";
5
- $wp_path = preg_split('/(?=((\\\|\/)wp-content)).*/', dirname(__file__));
6
- $wp_path = ( isset($wp_path[0]) && $wp_path[0] != "" && $wp_path[0] != dirname(__FILE__) ) ? $wp_path[0] : $_SERVER["DOCUMENT_ROOT"];
7
- require_once($wp_path . $slash . 'wp-load.php');
8
- require_once($wp_path . $slash . 'wp-admin' . $slash . 'admin.php');
9
-
10
- // check for rights
11
- if ( !is_user_logged_in() || !current_user_can('edit_posts') )
12
- wp_die(__( "You don't have access to this function.", 'my-calendar' ));
13
- ?>
14
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
15
- <html xmlns="http://www.w3.org/1999/xhtml" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>>
16
- <head>
17
- <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
18
- <title><?php bloginfo('name') ?> &rsaquo; <?php _e("My Calendar Shortcode Generator",'my-calendar'); ?> &#8212; WordPress</title>
19
- <?php
20
- // WordPress styles
21
- wp_admin_css( 'css/global' );
22
- wp_admin_css();
23
- wp_admin_css( 'css/colors' );
24
- wp_admin_css( 'css/ie' );
25
- $hook_suffix = '';
26
- if ( isset($page_hook) )
27
- $hook_suffix = "$page_hook";
28
- else if ( isset($plugin_page) )
29
- $hook_suffix = "$plugin_page";
30
- else if ( isset($pagenow) )
31
- $hook_suffix = "$pagenow";
32
- do_action("admin_print_styles-$hook_suffix");
33
- do_action('admin_print_styles');
34
- do_action("admin_print_scripts-$hook_suffix");
35
- do_action('admin_print_scripts');
36
- do_action("admin_head-$hook_suffix");
37
- do_action('admin_head');
38
- ?>
39
- <link rel="stylesheet" href="<?php echo plugins_url('button/generator.css',dirname(__FILE__)); ?>?ver=<?php echo mc_tiny_mce_version(); ?>" type="text/css" media="screen" charset="utf-8" />
40
- <script src="<?php echo plugins_url('button/mcb.js',dirname(__FILE__)); ?>" type="text/javascript" charset="utf-8"></script>
41
- </head>
42
- <body class="<?php echo apply_filters( 'admin_body_class', '' ); ?>">
43
- <div class="wrap">
44
- <h2><?php _e("My Calendar Shortcode Generator",'my-calendar'); ?></h2>
45
- <p>
46
- <?php _e("Navigational fields above and below the calendar: Feed links and print view will only display if they are enabled on your settings page. All other fields will appear if specified; the defaults specified in your settings will be used if the attribute is left blank. Use <code>none</code> to hide all navigation elements.",'my-calendar'); ?>
47
- </p>
48
- <form action="#" mode="POST">
49
- <fieldset>
50
- <legend><?php _e('Shortcode Attributes', 'my-calendar'); ?></legend>
51
- <p>
52
- <?php echo my_calendar_categories_list('select','admin'); ?>
53
- </p>
54
- <p>
55
- <label for="ltype"><?php _e('Location filter type:','my-calendar'); ?></label>
56
- <select name="ltype" id="ltype">
57
- <option value="" selected="selected"><?php _e('All locations','my-calendar'); ?></option>
58
- <option value='event_label'><?php _e('Location Name','my-calendar'); ?></option>
59
- <option value='event_city'><?php _e('City','my-calendar'); ?></option>
60
- <option value='event_state'><?php _e('State','my-calendar'); ?></option>
61
- <option value='event_postcode'><?php _e('Postal Code','my-calendar'); ?></option>
62
- <option value='event_country'><?php _e('Country','my-calendar'); ?></option>
63
- <option value='event_region'><?php _e('Region','my-calendar'); ?></option>
64
- </select>
65
- </p>
66
- <p>
67
- <label for="lvalue"><?php _e('Location filter value:','my-calendar'); ?></label>
68
- <input type="text" name="lvalue" id="lvalue" />
69
- </p>
70
- <p>
71
- <label for="format"><?php _e('Format', 'my-calendar'); ?></label>
72
- <select name="format" id="format">
73
- <option value="calendar" selected="selected"><?php _e('Grid','my-calendar'); ?></option>
74
- <option value="list"><?php _e('List','my-calendar'); ?></option>
75
- </select>
76
- </p>
77
- <p>
78
- <label for="above" id='labove'><?php _e('Navigation above calendar','my-calendar'); ?></label>
79
- <input type="text" name="above" id="above" value="nav,toggle,jump,print,timeframe" aria-labelledby='labove aboveLabel' /><br />
80
- <em id="aboveLabel"><?php _e('Use "none" for no navigation.','my-calendar'); ?></em>
81
- </p>
82
- <p>
83
- <label for="below" id='lbelow'><?php _e('Navigation below calendar','my-calendar'); ?></label>
84
- <input type="text" name="below" id="below" value="key,feeds" aria-labelledby='lbelow belowLabel' /><br />
85
- <em id="belowLabel"><?php _e('Use "none" for no navigation.','my-calendar'); ?></em>
86
- </p>
87
- <p>
88
- <label for="time"><?php _e('Time Segment', 'my-calendar'); ?></label>
89
- <select name="time" id="time">
90
- <option value="month" selected="selected"><?php _e('Month', 'my-calendar'); ?></option>
91
- <option value="week"><?php _e('Week', 'my-calendar'); ?></option>
92
- <option value="day"><?php _e('Day', 'my-calendar'); ?></option>
93
- </select>
94
- </p>
95
- <?php
96
- // Grab all the categories and list them
97
- $users = my_calendar_getUsers();
98
- $options = '';
99
- foreach($users as $u) {
100
- $options = '<option value="'.$u->ID.'">'.$u->display_name."</option>\n";
101
- }
102
- ?> <p>
103
- <label for="author"><?php _e('Limit by Author','my-calendar'); ?></label>
104
- <select name="author" id="author" multiple="multiple">
105
- <option value="all"><?php _e('All authors','my-calendar'); ?></option>
106
- <?php echo $options; ?>
107
- </select>
108
- </p>
109
- <p>
110
- <label for="host"><?php _e('Limit by Host','my-calendar'); ?></label>
111
- <select name="host" id="host" multiple="multiple">
112
- <option value="all"><?php _e('All hosts','my-calendar'); ?></option>
113
- <?php echo $options; ?>
114
- </select>
115
- </p>
116
- </fieldset>
117
- <p>
118
- <input type="button" class="button" id="mycalendar" name="generate" value="<?php _e('Generate Shortcode', 'my-calendar'); ?>" />
119
- </p>
120
- <p><?php _e('<strong>Note:</strong> If you provide a location filter value, it must be an exact match for that information as saved with your events. (e.g. "Saint Paul" is not equivalent to "saint paul" or "St. Paul")','my-calendar'); ?></p>
121
- </form>
122
- </div>
123
- <?php jd_show_support_box(); ?>
124
- <script type="text/javascript" charset="utf-8">
125
- // <![CDATA[
126
- jQuery(document).ready(function(){
127
- try {
128
- myCalQT.Tag.Generator.initialize();
129
- } catch (e) {
130
- throw "<?php _e("My Calendar: this generator isn't going to put the shortcode in your page. Sorry!", 'my-calendar'); ?>";
131
- }
132
- });
133
- // ]]>
134
- </script>
135
- </body>
136
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
button/mcb.js DELETED
@@ -1,125 +0,0 @@
1
- // pass the window to the object
2
- var myCalQT = window.myCalQT || {};
3
- // set the function
4
- (myCalQT.Tag = function() {
5
- return {
6
- // set the function
7
- embed : function() {
8
- // check if the URL is a string and if the function tb_show works, if not, return
9
- if (typeof this.configUrl !== 'string' || typeof tb_show !== 'function') {
10
- return;
11
- }
12
- // pepare the url
13
- var url = this.configUrl + ((this.configUrl.match(/\?/)) ? "&" : "?") + "TB_iframe=true";
14
- // call lightbox to show the embed
15
- tb_show('My Calendar Shortcode Generator', url , false);
16
- }
17
- };
18
- }());
19
- /* Generator specific script */
20
- (myCalQT.Tag.Generator = function(){
21
- // tags to find
22
- var tags = 'category,ltype,lvalue,format,above,below,author,host,time'.split(',');
23
- // to validate and generate the tag
24
- var vt = function(id){
25
- var form = jQuery('#'+id).val();
26
- if(form==''){
27
- return '';
28
- }else{
29
- return ' '+id+'="'+form+'"';
30
- }
31
- };
32
- // to build tag
33
- var buildTag = function() {
34
- var r = '[my_calendar';
35
- for (i=0;i<tags.length;i++){
36
- r += vt(tags[i]);
37
- }
38
- return r + ']';
39
- };
40
-
41
- // get the selected text in the box
42
- var getSel = function(){
43
- var win = window.parent || window;
44
- var ret = '';
45
- if ( typeof win.tinyMCE !== 'undefined' && ( win.ed = win.tinyMCE.activeEditor ) && !win.ed.isHidden() ) {
46
- win.ed.focus();
47
- if (win.tinymce.isIE){
48
- win.ed.selection.moveToBookmark(win.tinymce.EditorManager.activeEditor.windowManager.bookmark);
49
- }
50
- ret = win.tinymce.EditorManager.activeEditor.selection.getContent({format : 'text'});
51
- } else {
52
- var myField = win.edCanvas;
53
- // IE
54
- if (document.selection) {
55
- myField.focus();
56
- ret = (win.document.all) ? win.document.selection.createRange().text : win.document.getSelection();
57
- }
58
- // Mozilla, Netscape
59
- else if (myField.selectionStart || myField.selectionStart == '0') {
60
- ret = myField.value.substring(myField.selectionStart, myField.selectionEnd);
61
- }
62
- }
63
- return (ret=='')?false:ret;
64
- };
65
-
66
- // Tag parser
67
- var parseTagEdit = function(){
68
- // get selection
69
- var selec = getSel();
70
- if(selec != false){
71
- // trim
72
- selec = selec.replace(/^\s+|\s+$/g,'');
73
- // look for the endpoint
74
- var endp = selec.lastIndexOf(']');
75
- // if no endpoint is found
76
- if(endp == -1){
77
- return;
78
- }
79
- // look for the starting point
80
- if(selec.substring(0,13) != '[my_calendar '){
81
- return;
82
- }
83
- // only params
84
- selec = selec.substring(13, endp);
85
- // remove more than two white spaces
86
- selec = selec.replace(/\s+/g, ' ')
87
- // get params separated by space
88
- var params = selec.split(' ');
89
- // modify values
90
- for (i=0;i<params.length;i++){
91
- var parval = params[i].split('=');
92
- jQuery('#'+parval[0]).val(parval[1]);
93
- }
94
- }
95
- };
96
- // to insert tag
97
- var insertTag = function() {
98
- var tag = buildTag() || "";
99
- var win = window.parent || window;
100
-
101
- if ( typeof win.tinyMCE !== 'undefined' && ( win.ed = win.tinyMCE.activeEditor ) && !win.ed.isHidden() ) {
102
- win.ed.focus();
103
- if (win.tinymce.isIE){
104
- win.ed.selection.moveToBookmark(win.tinymce.EditorManager.activeEditor.windowManager.bookmark);
105
- }
106
- win.ed.execCommand('mceInsertContent', false, tag);
107
- } else {
108
- win.edInsertContent(win.edCanvas, tag);
109
- }
110
- // Close Lightbox
111
- win.tb_remove();
112
- };
113
- return {
114
- initialize : function() {
115
- if (typeof jQuery === 'undefined') {
116
- return;
117
- }
118
- jQuery("#mycalendar").click(function(e) {
119
- e.preventDefault();
120
- insertTag();
121
- });
122
- parseTagEdit();
123
- }
124
- };
125
- }());
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
button/tinymce3/calendarButton.gif DELETED
Binary file
button/tinymce3/editor_plugin.js DELETED
@@ -1,61 +0,0 @@
1
- (function() {
2
- // Load plugin specific language pack
3
- tinymce.PluginManager.requireLangPack('mcqt');
4
- tinymce.create('tinymce.plugins.myCalendar', {
5
- /**
6
- * Initializes the plugin, this will be executed after the plugin has been created.
7
- * This call is done before the editor instance has finished it's initialization so use the onInit event
8
- * of the editor instance to intercept that event.
9
- *
10
- * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
11
- * @param {string} url Absolute URL to where the plugin is located.
12
- */
13
- init : function(ed, url) {
14
-
15
- if (typeof myCalQT === 'undefined' ||
16
- typeof myCalQT.Tag === 'undefined' ||
17
- typeof myCalQT.Tag.embed !== 'function'
18
- ) {
19
- return;
20
- }
21
- ed.addCommand('createMCTag', function() {
22
- myCalQT.Tag.embed.apply(myCalQT.Tag);
23
- });
24
- ed.addButton('myCalendar', {
25
- title : 'mcqt.description',
26
- image : url + '/mcb.png',
27
- cmd : 'createMCTag'
28
- });
29
- },
30
- /**
31
- * Creates control instances based in the incomming name. This method is normally not
32
- * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons
33
- * but you sometimes need to create more complex controls like listboxes, split buttons etc then this
34
- * method can be used to create those.
35
- *
36
- * @param {String} n Name of the control to create.
37
- * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control.
38
- * @return {tinymce.ui.Control} New control instance or null if no control was created.
39
- */
40
- createControl : function(n, cm) {
41
- return null;
42
- },
43
- /**
44
- * Returns information about the plugin as a name/value array.
45
- * The current keys are longname, author, authorurl, infourl and version.
46
- *
47
- * @return {Object} Name/value array containing information about the plugin.
48
- */
49
- getInfo : function() {
50
- return {
51
- longname : 'My Calendar TinyMCE Plugin',
52
- author : 'Joseph C Dolson',
53
- authorurl : 'http://www.joedolson.com',
54
- infourl : 'http://http://www.joedolson.com/articles/my-calendar/',
55
- version : "1.7.9"
56
- };
57
- }
58
- });
59
- // Register plugin
60
- tinymce.PluginManager.add('mcqt', tinymce.plugins.myCalendar);
61
- })();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
button/tinymce3/langs/en.js DELETED
@@ -1,4 +0,0 @@
1
- // English lang variables
2
- tinyMCE.addI18n("en.mcqt", {
3
- description : "Insert My Calendar"
4
- });
 
 
 
 
button/tinymce3/langs/es.js DELETED
@@ -1,4 +0,0 @@
1
- // Spanish lang variables
2
- tinyMCE.addI18n("es.mcqt", {
3
- description : "Insertar etiqueta My Calendar"
4
- });
 
 
 
 
button/tinymce3/langs/fr.js DELETED
@@ -1,4 +0,0 @@
1
- // Spanish lang variables
2
- tinyMCE.addI18n("es.mcqt", {
3
- description : "Insertar etiqueta My Calendar"
4
- });
 
 
 
 
button/tinymce3/langs/ru.js DELETED
@@ -1,4 +0,0 @@
1
- // Russian lang variables
2
- tinyMCE.addI18n("ru.mcqt", {
3
- description : "вставка тегов My Calendar"
4
- });
 
 
 
 
button/tinymce3/mcb.png DELETED
Binary file
mc-admin.css → css/mc-admin.css RENAMED
File without changes
mc-print.css → css/mc-print.css RENAMED
@@ -1,9 +1,9 @@
1
  .my-calendar-header, h3 img, .mc-toggle, .mc_edit_links, #mc-export,.longdesc, .shortdesc , .mc-print, form { display: none; }
2
- table { border: 1px solid #ddd; border-collapse: collapse; margin: 0 auto;}
3
  th { text-align:center; background: #f6f6f6; border: 1px solid #ddd; width: 130px; text-transform:uppercase; }
4
- td { border: 1px solid #ddd; font-size: 12px; vertical-align: top;}
5
  .details {border-bottom: 1px solid #ddd; color: #444; margin-bottom: 2px;}
6
- .details a { display: none; }
7
  h3 { font-size: 1.1em; margin: 2px 0 5px;}
8
  p {margin: 2px 0; padding: 1px 0; line-height: 1.2; }
9
  caption { font-size: 1.4em; padding: 3px 0; }
1
  .my-calendar-header, h3 img, .mc-toggle, .mc_edit_links, #mc-export,.longdesc, .shortdesc , .mc-print, form { display: none; }
2
+ table { border: 1px solid #ddd; border-collapse: collapse; margin: 0 auto; width: 100%; }
3
  th { text-align:center; background: #f6f6f6; border: 1px solid #ddd; width: 130px; text-transform:uppercase; }
4
+ td { border: 1px solid #ddd; font-size: 12px; vertical-align: top; width: 14.285%; }
5
  .details {border-bottom: 1px solid #ddd; color: #444; margin-bottom: 2px;}
6
+ .details a, .details img { display: none; }
7
  h3 { font-size: 1.1em; margin: 2px 0 5px;}
8
  p {margin: 2px 0; padding: 1px 0; line-height: 1.2; }
9
  caption { font-size: 1.4em; padding: 3px 0; }
css/mc-styles.css ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #my-calendar legend {font-weight: 700;font-size: 1em}
2
+ .mcbuy, .mcsbuy {font-size: 1.1em; line-height: 1.5}
3
+ .mc-button { text-align: center; font-size: 1.4em; padding: 10px 0 0}
4
+ .mc-button a { padding: 3px 8px; border: 1px solid; border-radius: 5px; background: #fff}
5
+ .mcd { text-align: center; margin: 0; }
6
+ #cat_icon option {padding: 5px 0 5px 24px}
7
+ #my-calendar-admin-table .delete {color: #c00}
8
+ .import {background: #ffa;padding: 5px 10px;border: 1px solid #aaa;border-radius: 5px;margin: 15px 0}
9
+ .n4 {width: 42px}
10
+ .category-color {width: 1.2em;height: 1.2em;display: inline-block;border-radius: 3px;border: 1px solid #000}
11
+ .jd-my-calendar .postbox h3 {cursor: text}
12
+ .active-link {font-weight:700;text-decoration: underline}
13
+ ul.links li {float: left;margin: 0 5px 10px;font-size: .9em}
14
+ #toggle {height: 2em}
15
+ #toggle li {float: left;margin-right: 5px}
16
+ .jd-my-calendar .spam {background: #ffa}
17
+ .jd-my-calendar .pending { background: #eee}
18
+ .jd-my-calendar .pending td {color: #666}
19
+ .jd-my-calendar fieldset fieldset {margin: 0 0 20px 0;padding-top: 2px}
20
+ #mceditor {border: 1px solid #ddd;margin: 0 0 5px}
21
+ .mc_template_tags dt {font-weight: 700}
22
+ .mc_template_tags dd {margin-left: 0; padding: 2px 1px}
23
+ .mc_template_tags {clear: right}
24
+ .clonedInput {margin-bottom: 10px;border-bottom: 1px solid #ddd}
25
+ #my-calendar .apply {padding: 1px 5px 0;margin: 0 -5px;border-radius: 3px;box-shadow: 2px 2px 3px #aaa;background: #ffd}
26
+ #my-calendar .apply legend {background: #ffd;padding: 2px 0}
27
+ #my-calendar .apply .warning { background: #ffe; color: #a00; padding: 3px; border: 1px solid #333 }
28
+ #my-calendar .break ul {padding: 10px 10px 0;margin-right: 180px}
29
+ #my-calendar .two-columns {-moz-column-count: 2;-moz-column-gap: 30px;-webkit-column-count: 2;-webkit-column-gap: 30px;column-count: 2;column-gap: 30px}
30
+ .jd-my-calendar .event_image { float: right; margin-left: 10px; }
31
+ .jd-my-calendar .event_image img { width: 150px; height: auto; margin: 2px 0; border-radius: 3px; }
32
+ .mc_support {font-family:'Courier New';background:#fff;padding:5px}
33
+ .template-editor, .style-editor { width: 98%}
34
+ .jd-my-calendar .postbox { margin: 10px 10px 0 0}
35
+ .jd-my-calendar .postbox .inside { overflow: visible!important} /* some plugins change this, but I need it at WP default. */
36
+ .jd-my-calendar .meta-box-sortables { min-height: 0}
37
+ .jd-my-calendar textarea { width: 100%}
38
+ .mc-clear { clear: both }
39
+ .jd-my-calendar pre { background: #fff; padding: 5px; border: 1px solid #ddd; box-shadow: 1px 1px 2px #ddd}
40
+ .jd-my-calendar label span.required { font-size: .9em; color: #c33 }
41
+ .jd-my-calendar .default { background: #fff }
42
+ .jd-my-calendar .button-adjust { top: 10px; right: 0}
43
+ .jd-my-calendar hr { width: 20%; margin: 0 auto; border: none; border-top: 1px solid #ccc}
44
+ #mc-shortcodes li code, #mc-shortcodes .example code { font-size: 1.4em; line-height: 1.5; display: inline-block}
45
+ .jd-my-calendar .tablenav { float: right }
46
+ input[id=e_label], input[id=e_title], input[id=location_label], input[id=mc_twitter] { font-size: 1.4em; padding: 5px; width: 100%}
47
+ label[for=mc_twitter] { background: url(../images/twitter.png) no-repeat; padding-left: 20px; }
48
+ strong.label { font-weight: 400; }
49
+ #my-calendar-text label { display: inline-block; width: 12em; }
50
+ .wp-picker-container { position: relative; top: .7em; }
51
+ .jd-my-calendar .counter { padding-right: 6px; border-right: 16px solid green; border-radius: 20px; }
52
+ .jd-my-calendar .counter.warning { border-color: orange; }
53
+ .jd-my-calendar .counter.exceeded { border-color: red; }
54
+ .mc-categories th:nth-of-type(5), .mc-categories th:nth-of-type(6), .mc-categories th:nth-of-type(7) { width: 50px; }
55
+
56
+ .jcd-wide { width: 75%; }
57
+ .jcd-narrow { width: 20%; }
58
+
59
+ .mc-tabs .tabs { margin: 0!important; padding: 0 4px; position: relative; top: 1px; }
60
+ .mc-tabs .tabs li { display: inline; margin: 0 auto; line-height: 1; }
61
+ .mc-tabs .tabs a { display: inline-block; padding: 4px 8px; border-radius: 4px 4px 0 0; border: 1px solid #ccc; background: #f3f3f3; }
62
+ .mc-tabs .tabs a.active { border-bottom: 1px solid #fefefe; background: #fefefe; }
63
+ .mc-tabs .wptab { background: #fff; padding: 12px; margin-bottom: 10px; border: 1px solid #ccc; }
64
+
65
+ .jd-my-calendar .ui-accordion-header, .mc-settings-page #mc-sortable li { border: 1px solid #ccc; border-radius: 2px; background: rgba( 0,0,0,.05 ); padding: 1px 1em; margin: 1px 0; }
66
+ .jd-my-calendar .ui-accordion-header.ui-state-hover, .ui-accordion-header.ui-state-focus, .mc-settings-page #mc-sortable li:hover { background: #f6f6f6; box-shadow: 0 0 2px #ddd; }
67
+ #mc-sortable li { cursor: move; }
68
+ .jd-my-calendar .ui-accordion-header-active { background: #fff; }
69
+ #mc-sortable .mc-calendar { background: #ffc; border: 1px solid #cc8; }
70
+ #mc-sortable li.mc-stop { margin: 1px -1em; border-radius: none; border-left: none; border-right: none; padding: 2px 2em; }
71
+ #mc-sortable div.dashicons { vertical-align: middle; height: 1em; }
72
+ #mc-sortable code { display: inline-block; width: 5em; text-align: center; }
73
+
74
+ .jd-my-calendar .checkboxes { margin: 0; }
75
+ .jd-my-calendar .checkboxes li { display: inline-block; padding: 5px; background: rgba( 0, 0, 0, .05 ); margin: 2px; }
76
+ .jd-my-calendar .checkboxes li:hover { background: #fff; }
77
+
78
+ .mc-actions { float: left; vertical-align: middle; height: 30px; margin: 6px 0 4px; clear: left; }
79
+
80
+ .jd-my-calendar fieldset legend { font-weight: 700; padding: 0; font-size: 1.1em; }
81
+ .generator fieldset { border: 1px solid #ccc; margin: 10px 0; padding: 10px; }
82
+ .generator label { display: block; float: left; width: 30%; margin-right: 10px; }
83
+ .generator td input[type=text] { width: 100%; }
84
+ .generator td label { float: none; width: auto; display: inline; }
85
+ .generator .help, .generator .clear { clear: left; }
86
+ .generator input { line-height: normal; }
87
+ .generator input[type=text], .generator select { width: 60%; }
88
+ .req { color: red; }
89
+
90
+ .jd-my-calendar textarea:disabled { color: #333; border: none; box-shadow: none; }
91
+ .mc-locations label { display: block; }
92
+ .mc-locations .checkboxes label, .checkbox label { display: inline; }
93
+
94
+ .locations-container { position: relative; }
95
+ .mc-locations .location-primary { width: 47%; margin-right: 20px; }
96
+ .mc-locations:after { content: ' '; display: table; clear: both; }
97
+ .mc-locations .location-secondary { position: absolute; left: 50%; top: 0; width: 47%; }
98
+ .mc-locations .locations-container input { max-width: 90%; }
99
+
100
+ .mc-search { position: absolute; right: 12px; }
101
+
102
+ @media (max-width: 1140px) {
103
+ .mc-locations .locations-container input { max-width: 70%; }
104
+ }
105
+
106
+ @media (max-width: 782px) {
107
+ .jd-my-calendar .tablenav { float: none; }
108
+ .jcd-narrow { width: 100%; }
109
+ .jcd-wide { width: 100%; }
110
+ }
css/reset.css ADDED
@@ -0,0 +1,2 @@
 
 
1
+ .mc-main div,.mc-main span,.mc-main h1,.mc-main h2,.mc-main h3,.mc-main h4,.mc-main h5,.mc-main h6,.mc-main p,.mc-main blockquote,.mc-main pre,.mc-main a,.mc-main abbr,.mc-main acronym,.mc-main address,.mc-main big,.mc-main cite,.mc-main code,.mc-main del,.mc-main dfn,.mc-main font,.mc-main img,.mc-main ins,.mc-main kbd,.mc-main q,.mc-main s,.mc-main samp,.mc-main small,.mc-main strike,.mc-main sub,.mc-main sup,.mc-main tt,.mc-main var,.mc-main center,.mc-main dl,.mc-main dt,.mc-main dd,.mc-main ol,.mc-main ul,.mc-main li,.mc-main fieldset,.mc-main form,.mc-main label,.mc-main legend,.mc-main table,.mc-main caption,.mc-main tbody,.mc-main tfoot,.mc-main thead,.mc-main tr,.mc-main th,.mc-main td,.mc-main article,.mc-main aside,.mc-main audio,.mc-main canvas,.mc-main details,.mc-main figcaption,.mc-main figure,.mc-main footer,.mc-main header,.mc-main hgroup,.mc-main mark,.mc-main menu,.mc-main meter,.mc-main nav,.mc-main output,.mc-main progress,.mc-main section,.mc-main summary,.mc-main time,.mc-main video{border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent;margin:0;padding:0;}body{line-height:1;}article,.mc-main aside,.mc-main dialog,.mc-main figure,.mc-main footer,.mc-main header,.mc-main hgroup,.mc-main nav,.mc-main section,.mc-main blockquote{display:block;}nav ul{list-style:none;}ol{list-style:decimal;}ul{list-style:disc;}ul ul{list-style:circle;}blockquote,.mc-main q{quotes:none;}blockquote:before,.mc-main blockquote:after,.mc-main q:before,.mc-main q:after{content:none;}ins{text-decoration:underline;}del{text-decoration:line-through;}mark{background:none;}abbr[title],.mc-main dfn[title]{border-bottom:1px dotted #000;cursor:help;}table{border-collapse:collapse;border-spacing:0;}hr{display:block;height:1px;border:0;border-top:1px solid #ccc;margin:1em 0;padding:0;}input[type=submit],.mc-main input[type=button],.mc-main button{margin:0!important;padding:0!important;}input,.mc-main select,.mc-main a img{vertical-align:middle;}.mc-main *, .mc-main *:before, .mc-main *:after {-moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;}.mc-main .screen-reader-text { clip: rect(1px 1px 1px 1px); clip: rect(1px, 1px, 1px, 1px); overflow: hidden;
2
+ position: absolute; max-height:1px; }
images/event-details.jpg DELETED
Binary file
images/event-details.png DELETED
Binary file
images/guide.png DELETED
Binary file
images/ical.png DELETED
Binary file
{icons → images/icons}/32x32/applications-toys.png RENAMED
File without changes
{icons → images/icons}/32x32/appointment.png RENAMED
File without changes
{icons → images/icons}/32x32/art.png RENAMED
File without changes
{icons → images/icons}/32x32/ball.png RENAMED
File without changes
{icons → images/icons}/32x32/call.png RENAMED
File without changes
{icons → images/icons}/32x32/concert.png RENAMED
File without changes
{icons → images/icons}/32x32/crafts.png RENAMED
File without changes
{icons → images/icons}/32x32/event-2.png RENAMED
File without changes
{icons → images/icons}/32x32/event.png RENAMED
File without changes
{icons → images/icons}/32x32/games.png RENAMED
File without changes
{icons → images/icons}/32x32/globe.png RENAMED
File without changes
{icons → images/icons}/32x32/meeting.png RENAMED
File without changes
{icons → images/icons}/32x32/movies.png RENAMED
File without changes
{icons → images/icons}/32x32/party.png RENAMED
File without changes
{icons → images/icons}/32x32/pi.png RENAMED
File without changes
{icons → images/icons}/32x32/rehearsal.png RENAMED
File without changes
{icons → images/icons}/32x32/school.png RENAMED
File without changes
{icons → images/icons}/32x32/shop.png RENAMED
File without changes
{icons → images/icons}/32x32/star.png RENAMED
File without changes
{icons → images/icons}/32x32/tickets.png RENAMED
File without changes
{icons → images/icons}/appointment.png RENAMED
File without changes
{icons → images/icons}/art.png RENAMED
File without changes
{icons → images/icons}/ball.png RENAMED
File without changes
{icons → images/icons}/call.png RENAMED
File without changes
{icons → images/icons}/concert.png RENAMED
File without changes
{icons → images/icons}/crafts.png RENAMED
File without changes
{icons → images/icons}/event-2.png RENAMED
File without changes
{icons → images/icons}/event.png RENAMED
File without changes
{icons → images/icons}/games.png RENAMED
File without changes
{icons → images/icons}/globe.png RENAMED
File without changes
{icons → images/icons}/meeting.png RENAMED
File without changes
{icons → images/icons}/movies.png RENAMED
File without changes
{icons → images/icons}/party.png RENAMED
File without changes
{icons → images/icons}/pi.png RENAMED
File without changes
{icons → images/icons}/rehearsal.png RENAMED
File without changes
{icons → images/icons}/school.png RENAMED
File without changes
{icons → images/icons}/shop.png RENAMED
File without changes
{icons → images/icons}/star.png RENAMED
File without changes
{icons → images/icons}/tickets.png RENAMED
File without changes
images/submissions.png DELETED
Binary file
date-utilities.php → includes/date-utilities.php RENAMED
File without changes
js/calendrical.css DELETED
@@ -1,28 +0,0 @@
1
- #event_begin, #event_time, #event_end, #event_endtime {position: relative}
2
- .calendricalDatePopup {background: #fff;border: 1px solid #bbb;padding: 3px;text-align: center; border-radius: 0 0 5px 5px; z-index: 5;box-shadow: 1px 1px 2px #aaa}
3
- .calendricalDatePopup table {border-collapse: collapse; margin: 0 auto}
4
- .calendricalDatePopup td { border: 1px solid #eee}
5
- .calendricalDatePopup table .monthCell {padding: 0 0 6px; font-size: 1.2em; font-weight: 400; line-height: 1; }
6
- .calendricalDatePopup table .monthCell:nth-of-type(1) { text-align: right; }
7
- .calendricalDatePopup table .monthCell:nth-of-type(2) { text-align: center; }
8
- .calendricalDatePopup table .monthCell:nth-of-type(3) { text-align: left; }
9
- .calendricalDatePopup table .monthCell a {display: block;}
10
- .calendricalDatePopup table .monthCell .monthName { background: #eee; width: 100%; padding: 2px; }
11
- .calendricalDatePopup table .monthCell .prevMonth, .calendricalDatePopup table .monthCell .nextMonth { color: #fff; background: #777; display: block; line-height: 1; padding: 2px 8px; }
12
- .calendricalDatePopup table .monthCell .prevMonth:hover, .calendricalDatePopup table .monthCell .nextMonth:hover, .calendricalDatePopup table .monthCell .prevMonth:focus, .calendricalDatePopup table .monthCell .nextMonth:focus { background: #000; }
13
- .calendricalDatePopup table .monthCell .prevMonth { border-radius: 16px 0 0 16px; }
14
- .calendricalDatePopup table .monthCell .nextMonth { border-radius: 0 16px 16px 0; }
15
- .calendricalDatePopup table a {text-decoration: none}
16
- .calendricalDatePopup table td {text-align: center;padding: 0; }
17
- .calendricalDatePopup table a {display: block; padding: 6px 8px; line-height: 1; }
18
- .calendricalDatePopup table a:hover, .calendricalDatePopup table a:focus {background: #eee;border: none; text-decoration: underline}
19
- .calendricalDatePopup table td.today a {background: #ffc}
20
- .calendricalDatePopup table td.selected a {background: #eef}
21
- .calendricalDatePopup table td.today_selected a {background: #ffc;}
22
- .calendricalDatePopup table td.nonMonth a {color: #555; background: #f9f9f9; }
23
- .calendricalTimePopup {background: #fff;border: 1px solid #bbb;width: 110px;height: 170px;overflow: auto;z-index: 5;box-shadow: 1px 1px 2px #aaa}
24
- .calendricalTimePopup ul {margin: 0;padding: 0}
25
- .calendricalTimePopup ul li {list-style: none;margin: 0}
26
- .calendricalTimePopup ul li a, .calendricalTimePopup ul li a:visited {text-indent: 10px;padding: 4px;display: block;color: black;text-decoration: none}
27
- .calendricalTimePopup ul li a:hover, .calendricalTimePopup ul li a:focus, .calendricalTimePopup ul li.selected a {background: #ccf}
28
- .calendricalEndTimePopup {width: 160px}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/gmap3.min.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * GMAP3 Plugin for JQuery
3
+ * Version : 5.1.1
4
+ * Date : 2013-05-25
5
+ * Licence : GPL v3 : http://www.gnu.org/licenses/gpl.html
6
+ * Author : DEMONTE Jean-Baptiste
7
+ * Contact : jbdemonte@gmail.com
8
+ * Web site : http://gmap3.net
9
+ */
10
+ (function(y,t){var z,i=0;function J(){if(!z){z={verbose:false,queryLimit:{attempt:5,delay:250,random:250},classes:{Map:google.maps.Map,Marker:google.maps.Marker,InfoWindow:google.maps.InfoWindow,Circle:google.maps.Circle,Rectangle:google.maps.Rectangle,OverlayView:google.maps.OverlayView,StreetViewPanorama:google.maps.StreetViewPanorama,KmlLayer:google.maps.KmlLayer,TrafficLayer:google.maps.TrafficLayer,BicyclingLayer:google.maps.BicyclingLayer,GroundOverlay:google.maps.GroundOverlay,StyledMapType:google.maps.StyledMapType,ImageMapType:google.maps.ImageMapType},map:{mapTypeId:google.maps.MapTypeId.ROADMAP,center:[46.578498,2.457275],zoom:2},overlay:{pane:"floatPane",content:"",offset:{x:0,y:0}},geoloc:{getCurrentPosition:{maximumAge:60000,timeout:5000}}}}}function k(M,L){return M!==t?M:"gmap3_"+(L?i+1:++i)}function d(L){var O=function(P){return parseInt(P,10)},N=google.maps.version.split(".").map(O),M;L=L.split(".").map(O);for(M=0;M<L.length;M++){if(N.hasOwnProperty(M)){if(N[M]<L[M]){return false}}else{return false}}return true}function n(P,L,N,Q,O){if(L.todo.events||L.todo.onces){var M={id:Q,data:L.todo.data,tag:L.todo.tag};if(L.todo.events){y.each(L.todo.events,function(R,U){var T=P,S=U;if(y.isArray(U)){T=U[0];S=U[1]}google.maps.event.addListener(N,R,function(V){S.apply(T,[O?O:N,V,M])})})}if(L.todo.onces){y.each(L.todo.onces,function(R,U){var T=P,S=U;if(y.isArray(U)){T=U[0];S=U[1]}google.maps.event.addListenerOnce(N,R,function(V){S.apply(T,[O?O:N,V,M])})})}}}function l(){var L=[];this.empty=function(){return !L.length};this.add=function(M){L.push(M)};this.get=function(){return L.length?L[0]:false};this.ack=function(){L.shift()}}function w(T,L,N){var R={},P=this,Q,S={latLng:{map:false,marker:false,infowindow:false,circle:false,overlay:false,getlatlng:false,getmaxzoom:false,getelevation:false,streetviewpanorama:false,getaddress:true},geoloc:{getgeoloc:true}};if(typeof N==="string"){N=M(N)}function M(V){var U={};U[V]={};return U}function O(){var U;for(U in N){if(U in R){continue}return U}}this.run=function(){var U,V;while(U=O()){if(typeof T[U]==="function"){Q=U;V=y.extend(true,{},z[U]||{},N[U].options||{});if(U in S.latLng){if(N[U].values){x(N[U].values,T,T[U],{todo:N[U],opts:V,session:R})}else{v(T,T[U],S.latLng[U],{todo:N[U],opts:V,session:R})}}else{if(U in S.geoloc){o(T,T[U],{todo:N[U],opts:V,session:R})}else{T[U].apply(T,[{todo:N[U],opts:V,session:R}])}}return}else{R[U]=null}}L.apply(T,[N,R])};this.ack=function(U){R[Q]=U;P.run.apply(P,[])}}function c(N){var L,M=[];for(L in N){M.push(L)}return M}function b(N,Q){var L={};if(N.todo){for(var M in N.todo){if((M!=="options")&&(M!=="values")){L[M]=N.todo[M]}}}var O,P=["data","tag","id","events","onces"];for(O=0;O<P.length;O++){A(L,P[O],Q,N.todo)}L.options=y.extend({},N.opts||{},Q.options||{});return L}function A(N,M){for(var L=2;L<arguments.length;L++){if(M in arguments[L]){N[M]=arguments[L][M];return}}}function r(){var L=[];this.get=function(S){if(L.length){var P,O,N,R,M,Q=c(S);for(P=0;P<L.length;P++){R=L[P];M=Q.length==R.keys.length;for(O=0;(O<Q.length)&&M;O++){N=Q[O];M=N in R.request;if(M){if((typeof S[N]==="object")&&("equals" in S[N])&&(typeof S[N]==="function")){M=S[N].equals(R.request[N])}else{M=S[N]===R.request[N]}}}if(M){return R.results}}}};this.store=function(N,M){L.push({request:N,keys:c(N),results:M})}}function e(Q,P,O,L){var N=this,M=[];z.classes.OverlayView.call(this);this.setMap(Q);this.onAdd=function(){var R=this.getPanes();if(P.pane in R){y(R[P.pane]).append(L)}y.each("dblclick click mouseover mousemove mouseout mouseup mousedown".split(" "),function(T,S){M.push(google.maps.event.addDomListener(L[0],S,function(U){y.Event(U).stopPropagation();google.maps.event.trigger(N,S,[U]);N.draw()}))});M.push(google.maps.event.addDomListener(L[0],"contextmenu",function(S){y.Event(S).stopPropagation();google.maps.event.trigger(N,"rightclick",[S]);N.draw()}))};this.getPosition=function(){return O};this.draw=function(){var R=this.getProjection().fromLatLngToDivPixel(O);L.css("left",(R.x+P.offset.x)+"px").css("top",(R.y+P.offset.y)+"px")};this.onRemove=function(){for(var R=0;R<M.length;R++){google.maps.event.removeListener(M[R])}L.remove()};this.hide=function(){L.hide()};this.show=function(){L.show()};this.toggle=function(){if(L){if(L.is(":visible")){this.show()}else{this.hide()}}};this.toggleDOM=function(){if(this.getMap()){this.setMap(null)}else{this.setMap(Q)}};this.getDOMElement=function(){return L[0]}}function f(O,L){function M(){this.onAdd=function(){};this.onRemove=function(){};this.draw=function(){};return z.classes.OverlayView.apply(this,[])}M.prototype=z.classes.OverlayView.prototype;var N=new M();N.setMap(O);return N}function F(ae,ao,aa){var an=false,ai=false,af=false,Z=false,W=true,V=this,N=[],T={},ad={},U={},aj=[],ah=[],O=[],ak=f(ao,aa.radius),Y,ap,am,P,Q;S();function L(aq){if(!aj[aq]){delete ah[aq].options.map;aj[aq]=new z.classes.Marker(ah[aq].options);n(ae,{todo:ah[aq]},aj[aq],ah[aq].id)}}this.getById=function(aq){if(aq in ad){L(ad[aq]);return aj[ad[aq]]}return false};this.rm=function(ar){var aq=ad[ar];if(aj[aq]){aj[aq].setMap(null)}delete aj[aq];aj[aq]=false;delete ah[aq];ah[aq]=false;delete O[aq];O[aq]=false;delete ad[ar];delete U[aq];ai=true};this.clearById=function(aq){if(aq in ad){this.rm(aq);return true}};this.clear=function(az,av,aA){var ar,ay,at,aw,au,ax=[],aq=C(aA);if(az){ar=ah.length-1;ay=-1;at=-1}else{ar=0;ay=ah.length;at=1}for(aw=ar;aw!=ay;aw+=at){if(ah[aw]){if(!aq||aq(ah[aw].tag)){ax.push(U[aw]);if(av||az){break}}}}for(au=0;au<ax.length;au++){this.rm(ax[au])}};this.add=function(aq,ar){aq.id=k(aq.id);this.clearById(aq.id);ad[aq.id]=aj.length;U[aj.length]=aq.id;aj.push(null);ah.push(aq);O.push(ar);ai=true};this.addMarker=function(ar,aq){aq=aq||{};aq.id=k(aq.id);this.clearById(aq.id);if(!aq.options){aq.options={}}aq.options.position=ar.getPosition();n(ae,{todo:aq},ar,aq.id);ad[aq.id]=aj.length;U[aj.length]=aq.id;aj.push(ar);ah.push(aq);O.push(aq.data||{});ai=true};this.todo=function(aq){return ah[aq]};this.value=function(aq){return O[aq]};this.marker=function(aq){if(aq in aj){L(aq);return aj[aq]}return false};this.markerIsSet=function(aq){return Boolean(aj[aq])};this.setMarker=function(ar,aq){aj[ar]=aq};this.store=function(aq,ar,at){T[aq.ref]={obj:ar,shadow:at}};this.free=function(){for(var aq=0;aq<N.length;aq++){google.maps.event.removeListener(N[aq])}N=[];y.each(T,function(ar){ac(ar)});T={};y.each(ah,function(ar){ah[ar]=null});ah=[];y.each(aj,function(ar){if(aj[ar]){aj[ar].setMap(null);delete aj[ar]}});aj=[];y.each(O,function(ar){delete O[ar]});O=[];ad={};U={}};this.filter=function(aq){am=aq;ag()};this.enable=function(aq){if(W!=aq){W=aq;ag()}};this.display=function(aq){P=aq};this.error=function(aq){Q=aq};this.beginUpdate=function(){an=true};this.endUpdate=function(){an=false;if(ai){ag()}};this.autofit=function(ar){for(var aq=0;aq<ah.length;aq++){if(ah[aq]){ar.extend(ah[aq].options.position)}}};function S(){ap=ak.getProjection();if(!ap){setTimeout(function(){S.apply(V,[])},25);return}Z=true;N.push(google.maps.event.addListener(ao,"zoom_changed",function(){al()}));N.push(google.maps.event.addListener(ao,"bounds_changed",function(){al()}));ag()}function ac(aq){if(typeof T[aq]==="object"){if(typeof(T[aq].obj.setMap)==="function"){T[aq].obj.setMap(null)}if(typeof(T[aq].obj.remove)==="function"){T[aq].obj.remove()}if(typeof(T[aq].shadow.remove)==="function"){T[aq].obj.remove()}if(typeof(T[aq].shadow.setMap)==="function"){T[aq].shadow.setMap(null)}delete T[aq].obj;delete T[aq].shadow}else{if(aj[aq]){aj[aq].setMap(null)}}delete T[aq]}function M(){var ay,ax,aw,au,av,at,ar,aq;if(arguments[0] instanceof google.maps.LatLng){ay=arguments[0].lat();aw=arguments[0].lng();if(arguments[1] instanceof google.maps.LatLng){ax=arguments[1].lat();au=arguments[1].lng()}else{ax=arguments[1];au=arguments[2]}}else{ay=arguments[0];aw=arguments[1];if(arguments[2] instanceof google.maps.LatLng){ax=arguments[2].lat();au=arguments[2].lng()}else{ax=arguments[2];au=arguments[3]}}av=Math.PI*ay/180;at=Math.PI*aw/180;ar=Math.PI*ax/180;aq=Math.PI*au/180;return 1000*6371*Math.acos(Math.min(Math.cos(av)*Math.cos(ar)*Math.cos(at)*Math.cos(aq)+Math.cos(av)*Math.sin(at)*Math.cos(ar)*Math.sin(aq)+Math.sin(av)*Math.sin(ar),1))}function R(){var aq=M(ao.getCenter(),ao.getBounds().getNorthEast()),ar=new google.maps.Circle({center:ao.getCenter(),radius:1.25*aq});return ar.getBounds()}function X(){var ar={},aq;for(aq in T){ar[aq]=true}return ar}function al(){clearTimeout(Y);Y=setTimeout(function(){ag()},25)}function ab(ar){var au=ap.fromLatLngToDivPixel(ar),at=ap.fromDivPixelToLatLng(new google.maps.Point(au.x+aa.radius,au.y-aa.radius)),aq=ap.fromDivPixelToLatLng(new google.maps.Point(au.x-aa.radius,au.y+aa.radius));return new google.maps.LatLngBounds(aq,at)}function ag(){if(an||af||!Z){return}var aE=[],aG={},aF=ao.getZoom(),aH=("maxZoom" in aa)&&(aF>aa.maxZoom),aw=X(),av,au,at,aA,ar=false,aq,aD,ay,az,aB,aC,ax;ai=false;if(aF>3){aq=R();ar=aq.getSouthWest().lng()<aq.getNorthEast().lng()}for(av=0;av<ah.length;av++){if(ah[av]&&(!ar||aq.contains(ah[av].options.position))&&(!am||am(O[av]))){aE.push(av)}}while(1){av=0;while(aG[av]&&(av<aE.length)){av++}if(av==aE.length){break}aA=[];if(W&&!aH){ax=10;do{az=aA;aA=[];ax--;if(az.length){ay=aq.getCenter()}else{ay=ah[aE[av]].options.position}aq=ab(ay);for(au=av;au<aE.length;au++){if(aG[au]){continue}if(aq.contains(ah[aE[au]].options.position)){aA.push(au)}}}while((az.length<aA.length)&&(aA.length>1)&&ax)}else{for(au=av;au<aE.length;au++){if(aG[au]){continue}aA.push(au);break}}aD={indexes:[],ref:[]};aB=aC=0;for(at=0;at<aA.length;at++){aG[aA[at]]=true;aD.indexes.push(aE[aA[at]]);aD.ref.push(aE[aA[at]]);aB+=ah[aE[aA[at]]].options.position.lat();aC+=ah[aE[aA[at]]].options.position.lng()}aB/=aA.length;aC/=aA.length;aD.latLng=new google.maps.LatLng(aB,aC);aD.ref=aD.ref.join("-");if(aD.ref in aw){delete aw[aD.ref]}else{if(aA.length===1){T[aD.ref]=true}P(aD)}}y.each(aw,function(aI){ac(aI)});af=false}}function a(M,L){this.id=function(){return M};this.filter=function(N){L.filter(N)};this.enable=function(){L.enable(true)};this.disable=function(){L.enable(false)};this.add=function(O,N,P){if(!P){L.beginUpdate()}L.addMarker(O,N);if(!P){L.endUpdate()}};this.getById=function(N){return L.getById(N)};this.clearById=function(P,O){var N;if(!O){L.beginUpdate()}N=L.clearById(P);if(!O){L.endUpdate()}return N};this.clear=function(P,Q,N,O){if(!O){L.beginUpdate()}L.clear(P,Q,N);if(!O){L.endUpdate()}}}function D(){var M={},N={};function L(P){return{id:P.id,name:P.name,object:P.obj,tag:P.tag,data:P.data}}this.add=function(R,Q,T,S){var P=R.todo||{},U=k(P.id);if(!M[Q]){M[Q]=[]}if(U in N){this.clearById(U)}N[U]={obj:T,sub:S,name:Q,id:U,tag:P.tag,data:P.data};M[Q].push(U);return U};this.getById=function(R,Q,P){if(R in N){if(Q){return N[R].sub}else{if(P){return L(N[R])}}return N[R].obj}return false};this.get=function(R,T,P,S){var V,U,Q=C(P);if(!M[R]||!M[R].length){return null}V=M[R].length;while(V){V--;U=M[R][T?V:M[R].length-V-1];if(U&&N[U]){if(Q&&!Q(N[U].tag)){continue}return S?L(N[U]):N[U].obj}}return null};this.all=function(S,Q,T){var P=[],R=C(Q),U=function(X){var V,W;for(V=0;V<M[X].length;V++){W=M[X][V];if(W&&N[W]){if(R&&!R(N[W].tag)){continue}P.push(T?L(N[W]):N[W].obj)}}};if(S in M){U(S)}else{if(S===t){for(S in M){U(S)}}}return P};function O(P){if(typeof(P.setMap)==="function"){P.setMap(null)}if(typeof(P.remove)==="function"){P.remove()}if(typeof(P.free)==="function"){P.free()}P=null}this.rm=function(S,Q,R){var P,T;if(!M[S]){return false}if(Q){if(R){for(P=M[S].length-1;P>=0;P--){T=M[S][P];if(Q(N[T].tag)){break}}}else{for(P=0;P<M[S].length;P++){T=M[S][P];if(Q(N[T].tag)){break}}}}else{P=R?M[S].length-1:0}if(!(P in M[S])){return false}return this.clearById(M[S][P],P)};this.clearById=function(S,P){if(S in N){var R,Q=N[S].name;for(R=0;P===t&&R<M[Q].length;R++){if(S===M[Q][R]){P=R}}O(N[S].obj);if(N[S].sub){O(N[S].sub)}delete N[S];M[Q].splice(P,1);return true}return false};this.objGetById=function(R){var Q;if(M.clusterer){for(var P in M.clusterer){if((Q=N[M.clusterer[P]].obj.getById(R))!==false){return Q}}}return false};this.objClearById=function(Q){if(M.clusterer){for(var P in M.clusterer){if(N[M.clusterer[P]].obj.clearById(Q)){return true}}}return null};this.clear=function(V,U,W,P){var R,T,S,Q=C(P);if(!V||!V.length){V=[];for(R in M){V.push(R)}}else{V=g(V)}for(T=0;T<V.length;T++){S=V[T];if(U){this.rm(S,Q,true)}else{if(W){this.rm(S,Q,false)}else{while(this.rm(S,Q,false)){}}}}};this.objClear=function(S,R,T,Q){if(M.clusterer&&(y.inArray("marker",S)>=0||!S.length)){for(var P in M.clusterer){N[M.clusterer[P]].obj.clear(R,T,Q)}}}}var m={},H=new r();function p(){if(!m.geocoder){m.geocoder=new google.maps.Geocoder()}return m.geocoder}function G(){if(!m.directionsService){m.directionsService=new google.maps.DirectionsService()}return m.directionsService}function h(){if(!m.elevationService){m.elevationService=new google.maps.ElevationService()}return m.elevationService}function q(){if(!m.maxZoomService){m.maxZoomService=new google.maps.MaxZoomService()}return m.maxZoomService}function B(){if(!m.distanceMatrixService){m.distanceMatrixService=new google.maps.DistanceMatrixService()}return m.distanceMatrixService}function u(){if(z.verbose){var L,M=[];if(window.console&&(typeof console.error==="function")){for(L=0;L<arguments.length;L++){M.push(arguments[L])}console.error.apply(console,M)}else{M="";for(L=0;L<arguments.length;L++){M+=arguments[L].toString()+" "}alert(M)}}}function E(L){return(typeof(L)==="number"||typeof(L)==="string")&&L!==""&&!isNaN(L)}function g(N){var M,L=[];if(N!==t){if(typeof(N)==="object"){if(typeof(N.length)==="number"){L=N}else{for(M in N){L.push(N[M])}}}else{L.push(N)}}return L}function C(L){if(L){if(typeof L==="function"){return L}L=g(L);return function(N){if(N===t){return false}if(typeof N==="object"){for(var M=0;M<N.length;M++){if(y.inArray(N[M],L)>=0){return true}}return false}return y.inArray(N,L)>=0}}}function I(M,O,L){var N=O?M:null;if(!M||(typeof M==="string")){return N}if(M.latLng){return I(M.latLng)}if(M instanceof google.maps.LatLng){return M}else{if(E(M.lat)){return new google.maps.LatLng(M.lat,M.lng)}else{if(!L&&y.isArray(M)){if(!E(M[0])||!E(M[1])){return N}return new google.maps.LatLng(M[0],M[1])}}}return N}function j(M){var N,L;if(!M||M instanceof google.maps.LatLngBounds){return M||null}if(y.isArray(M)){if(M.length==2){N=I(M[0]);L=I(M[1])}else{if(M.length==4){N=I([M[0],M[1]]);L=I([M[2],M[3]])}}}else{if(("ne" in M)&&("sw" in M)){N=I(M.ne);L=I(M.sw)}else{if(("n" in M)&&("e" in M)&&("s" in M)&&("w" in M)){N=I([M.n,M.e]);L=I([M.s,M.w])}}}if(N&&L){return new google.maps.LatLngBounds(L,N)}return null}function v(T,L,O,S,P){var N=O?I(S.todo,false,true):false,R=N?{latLng:N}:(S.todo.address?(typeof(S.todo.address)==="string"?{address:S.todo.address}:S.todo.address):false),M=R?H.get(R):false,Q=this;if(R){P=P||0;if(M){S.latLng=M.results[0].geometry.location;S.results=M.results;S.status=M.status;L.apply(T,[S])}else{if(R.location){R.location=I(R.location)}if(R.bounds){R.bounds=j(R.bounds)}p().geocode(R,function(V,U){if(U===google.maps.GeocoderStatus.OK){H.store(R,{results:V,status:U});S.latLng=V[0].geometry.location;S.results=V;S.status=U;L.apply(T,[S])}else{if((U===google.maps.GeocoderStatus.OVER_QUERY_LIMIT)&&(P<z.queryLimit.attempt)){setTimeout(function(){v.apply(Q,[T,L,O,S,P+1])},z.queryLimit.delay+Math.floor(Math.random()*z.queryLimit.random))}else{u("geocode failed",U,R);S.latLng=S.results=false;S.status=U;L.apply(T,[S])}}})}}else{S.latLng=I(S.todo,false,true);L.apply(T,[S])}}function x(Q,L,R,M){var O=this,N=-1;function P(){do{N++}while((N<Q.length)&&!("address" in Q[N]));if(N>=Q.length){R.apply(L,[M]);return}v(O,function(S){delete S.todo;y.extend(Q[N],S);P.apply(O,[])},true,{todo:Q[N]})}P()}function o(L,O,M){var N=false;if(navigator&&navigator.geolocation){navigator.geolocation.getCurrentPosition(function(P){if(N){return}N=true;M.latLng=new google.maps.LatLng(P.coords.latitude,P.coords.longitude);O.apply(L,[M])},function(){if(N){return}N=true;M.latLng=false;O.apply(L,[M])},M.opts.getCurrentPosition)}else{M.latLng=false;O.apply(L,[M])}}function K(T){var S=this,U=new l(),V=new D(),N=null,P;this._plan=function(Z){for(var Y=0;Y<Z.length;Y++){U.add(new w(S,R,Z[Y]))}Q()};function Q(){if(!P&&(P=U.get())){P.run()}}function R(){P=null;U.ack();Q.call(S)}function X(Y){if(Y.todo.callback){var Z=Array.prototype.slice.call(arguments,1);if(typeof Y.todo.callback==="function"){Y.todo.callback.apply(T,Z)}else{if(y.isArray(Y.todo.callback)){if(typeof Y.todo.callback[1]==="function"){Y.todo.callback[1].apply(Y.todo.callback[0],Z)}}}}}function O(Y,Z,aa){if(aa){n(T,Y,Z,aa)}X(Y,Z);P.ack(Z)}function L(aa,Y){Y=Y||{};if(N){if(Y.todo&&Y.todo.options){if(Y.todo.options.center){Y.todo.options.center=I(Y.todo.options.center)}N.setOptions(Y.todo.options)}}else{var Z=Y.opts||y.extend(true,{},z.map,Y.todo&&Y.todo.options?Y.todo.options:{});Z.center=aa||I(Z.center);N=new z.classes.Map(T.get(0),Z)}}this.map=function(Y){L(Y.latLng,Y);n(T,Y,N);O(Y,N)};this.destroy=function(Y){V.clear();T.empty();if(N){N=null}O(Y,true)};this.infowindow=function(Z){var aa=[],Y="values" in Z.todo;if(!Y){if(Z.latLng){Z.opts.position=Z.latLng}Z.todo.values=[{options:Z.opts}]}y.each(Z.todo.values,function(ac,ad){var af,ae,ab=b(Z,ad);ab.options.position=ab.options.position?I(ab.options.position):I(ad.latLng);if(!N){L(ab.options.position)}ae=new z.classes.InfoWindow(ab.options);if(ae&&((ab.open===t)||ab.open)){if(Y){ae.open(N,ab.anchor?ab.anchor:t)}else{ae.open(N,ab.anchor?ab.anchor:(Z.latLng?t:(Z.session.marker?Z.session.marker:t)))}}aa.push(ae);af=V.add({todo:ab},"infowindow",ae);n(T,{todo:ab},ae,af)});O(Z,Y?aa:aa[0])};this.circle=function(Z){var aa=[],Y="values" in Z.todo;if(!Y){Z.opts.center=Z.latLng||I(Z.opts.center);Z.todo.values=[{options:Z.opts}]}if(!Z.todo.values.length){O(Z,false);return}y.each(Z.todo.values,function(ac,ad){var af,ae,ab=b(Z,ad);ab.options.center=ab.options.center?I(ab.options.center):I(ad);if(!N){L(ab.options.center)}ab.options.map=N;ae=new z.classes.Circle(ab.options);aa.push(ae);af=V.add({todo:ab},"circle",ae);n(T,{todo:ab},ae,af)});O(Z,Y?aa:aa[0])};this.overlay=function(aa,Z){var ab=[],Y="values" in aa.todo;if(!Y){aa.todo.values=[{latLng:aa.latLng,options:aa.opts}]}if(!aa.todo.values.length){O(aa,false);return}if(!e.__initialised){e.prototype=new z.classes.OverlayView();e.__initialised=true}y.each(aa.todo.values,function(ae,af){var ah,ag,ac=b(aa,af),ad=y(document.createElement("div")).css({border:"none",borderWidth:"0px",position:"absolute"});ad.append(ac.options.content);ag=new e(N,ac.options,I(ac)||I(af),ad);ab.push(ag);ad=null;if(!Z){ah=V.add(aa,"overlay",ag);n(T,{todo:ac},ag,ah)}});if(Z){return ab[0]}O(aa,Y?ab:ab[0])};this.getaddress=function(Y){X(Y,Y.results,Y.status);P.ack()};this.getlatlng=function(Y){X(Y,Y.results,Y.status);P.ack()};this.getmaxzoom=function(Y){q().getMaxZoomAtLatLng(Y.latLng,function(Z){X(Y,Z.status===google.maps.MaxZoomStatus.OK?Z.zoom:false,status);P.ack()})};this.getelevation=function(Z){var aa,Y=[],ab=function(ad,ac){X(Z,ac===google.maps.ElevationStatus.OK?ad:false,ac);P.ack()};if(Z.latLng){Y.push(Z.latLng)}else{Y=g(Z.todo.locations||[]);for(aa=0;aa<Y.length;aa++){Y[aa]=I(Y[aa])}}if(Y.length){h().getElevationForLocations({locations:Y},ab)}else{if(Z.todo.path&&Z.todo.path.length){for(aa=0;aa<Z.todo.path.length;aa++){Y.push(I(Z.todo.path[aa]))}}if(Y.length){h().getElevationAlongPath({path:Y,samples:Z.todo.samples},ab)}else{P.ack()}}};this.defaults=function(Y){y.each(Y.todo,function(Z,aa){if(typeof z[Z]==="object"){z[Z]=y.extend({},z[Z],aa)}else{z[Z]=aa}});P.ack(true)};this.rectangle=function(Z){var aa=[],Y="values" in Z.todo;if(!Y){Z.todo.values=[{options:Z.opts}]}if(!Z.todo.values.length){O(Z,false);return}y.each(Z.todo.values,function(ac,ad){var af,ae,ab=b(Z,ad);ab.options.bounds=ab.options.bounds?j(ab.options.bounds):j(ad);if(!N){L(ab.options.bounds.getCenter())}ab.options.map=N;ae=new z.classes.Rectangle(ab.options);aa.push(ae);af=V.add({todo:ab},"rectangle",ae);n(T,{todo:ab},ae,af)});O(Z,Y?aa:aa[0])};function M(Z,aa,ab){var ac=[],Y="values" in Z.todo;if(!Y){Z.todo.values=[{options:Z.opts}]}if(!Z.todo.values.length){O(Z,false);return}L();y.each(Z.todo.values,function(af,ah){var aj,ag,ae,ai,ad=b(Z,ah);if(ad.options[ab]){if(ad.options[ab][0][0]&&y.isArray(ad.options[ab][0][0])){for(ag=0;ag<ad.options[ab].length;ag++){for(ae=0;ae<ad.options[ab][ag].length;ae++){ad.options[ab][ag][ae]=I(ad.options[ab][ag][ae])}}}else{for(ag=0;ag<ad.options[ab].length;ag++){ad.options[ab][ag]=I(ad.options[ab][ag])}}}ad.options.map=N;ai=new google.maps[aa](ad.options);ac.push(ai);aj=V.add({todo:ad},aa.toLowerCase(),ai);n(T,{todo:ad},ai,aj)});O(Z,Y?ac:ac[0])}this.polyline=function(Y){M(Y,"Polyline","path")};this.polygon=function(Y){M(Y,"Polygon","paths")};this.trafficlayer=function(Y){L();var Z=V.get("trafficlayer");if(!Z){Z=new z.classes.TrafficLayer();Z.setMap(N);V.add(Y,"trafficlayer",Z)}O(Y,Z)};this.bicyclinglayer=function(Y){L();var Z=V.get("bicyclinglayer");if(!Z){Z=new z.classes.BicyclingLayer();Z.setMap(N);V.add(Y,"bicyclinglayer",Z)}O(Y,Z)};this.groundoverlay=function(Y){Y.opts.bounds=j(Y.opts.bounds);if(Y.opts.bounds){L(Y.opts.bounds.getCenter())}var aa,Z=new z.classes.GroundOverlay(Y.opts.url,Y.opts.bounds,Y.opts.opts);Z.setMap(N);aa=V.add(Y,"groundoverlay",Z);O(Y,Z,aa)};this.streetviewpanorama=function(Y){if(!Y.opts.opts){Y.opts.opts={}}if(Y.latLng){Y.opts.opts.position=Y.latLng}else{if(Y.opts.opts.position){Y.opts.opts.position=I(Y.opts.opts.position)}}if(Y.todo.divId){Y.opts.container=document.getElementById(Y.todo.divId)}else{if(Y.opts.container){Y.opts.container=y(Y.opts.container).get(0)}}var aa,Z=new z.classes.StreetViewPanorama(Y.opts.container,Y.opts.opts);if(Z){N.setStreetView(Z)}aa=V.add(Y,"streetviewpanorama",Z);O(Y,Z,aa)};this.kmllayer=function(Z){var aa=[],Y="values" in Z.todo;if(!Y){Z.todo.values=[{options:Z.opts}]}if(!Z.todo.values.length){O(Z,false);return}y.each(Z.todo.values,function(ad,ae){var ag,af,ac,ab=b(Z,ae);if(!N){L()}ac=ab.options;if(ab.options.opts){ac=ab.options.opts;if(ab.options.url){ac.url=ab.options.url}}ac.map=N;if(d("3.10")){af=new z.classes.KmlLayer(ac)}else{af=new z.classes.KmlLayer(ac.url,ac)}aa.push(af);ag=V.add({todo:ab},"kmllayer",af);n(T,{todo:ab},af,ag)});O(Z,Y?aa:aa[0])};this.panel=function(ab){L();var ad,Y=0,ac=0,aa,Z=y(document.createElement("div"));Z.css({position:"absolute",zIndex:1000,visibility:"hidden"});if(ab.opts.content){aa=y(ab.opts.content);Z.append(aa);T.first().prepend(Z);if(ab.opts.left!==t){Y=ab.opts.left}else{if(ab.opts.right!==t){Y=T.width()-aa.width()-ab.opts.right}else{if(ab.opts.center){Y=(T.width()-aa.width())/2}}}if(ab.opts.top!==t){ac=ab.opts.top}else{if(ab.opts.bottom!==t){ac=T.height()-aa.height()-ab.opts.bottom}else{if(ab.opts.middle){ac=(T.height()-aa.height())/2}}}Z.css({top:ac,left:Y,visibility:"visible"})}ad=V.add(ab,"panel",Z);O(ab,Z,ad);Z=null};function W(aa){var af=new F(T,N,aa),Y={},ab={},ae=[],ad=/^[0-9]+$/,ac,Z;for(Z in aa){if(ad.test(Z)){ae.push(1*Z);ab[Z]=aa[Z];ab[Z].width=ab[Z].width||0;ab[Z].height=ab[Z].height||0}else{Y[Z]=aa[Z]}}ae.sort(function(ah,ag){return ah>ag});if(Y.calculator){ac=function(ag){var ah=[];y.each(ag,function(aj,ai){ah.push(af.value(ai))});return Y.calculator.apply(T,[ah])}}else{ac=function(ag){return ag.length}}af.error(function(){u.apply(S,arguments)});af.display(function(ag){var ai,aj,am,ak,al,ah=ac(ag.indexes);if(aa.force||ah>1){for(ai=0;ai<ae.length;ai++){if(ae[ai]<=ah){aj=ab[ae[ai]]}}}if(aj){al=aj.offset||[-aj.width/2,-aj.height/2];am=y.extend({},Y);am.options=y.extend({pane:"overlayLayer",content:aj.content?aj.content.replace("CLUSTER_COUNT",ah):"",offset:{x:("x" in al?al.x:al[0])||0,y:("y" in al?al.y:al[1])||0}},Y.options||{});ak=S.overlay({todo:am,opts:am.options,latLng:I(ag)},true);am.options.pane="floatShadow";am.options.content=y(document.createElement("div")).width(aj.width+"px").height(aj.height+"px").css({cursor:"pointer"});shadow=S.overlay({todo:am,opts:am.options,latLng:I(ag)},true);Y.data={latLng:I(ag),markers:[]};y.each(ag.indexes,function(ao,an){Y.data.markers.push(af.value(an));if(af.markerIsSet(an)){af.marker(an).setMap(null)}});n(T,{todo:Y},shadow,t,{main:ak,shadow:shadow});af.store(ag,ak,shadow)}else{y.each(ag.indexes,function(ao,an){af.marker(an).setMap(N)})}});return af}this.marker=function(aa){var Y="values" in aa.todo,ad=!N;if(!Y){aa.opts.position=aa.latLng||I(aa.opts.position);aa.todo.values=[{options:aa.opts}]}if(!aa.todo.values.length){O(aa,false);return}if(ad){L()}if(aa.todo.cluster&&!N.getBounds()){google.maps.event.addListenerOnce(N,"bounds_changed",function(){S.marker.apply(S,[aa])});return}if(aa.todo.cluster){var Z,ab;if(aa.todo.cluster instanceof a){Z=aa.todo.cluster;ab=V.getById(Z.id(),true)}else{ab=W(aa.todo.cluster);Z=new a(k(aa.todo.id,true),ab);V.add(aa,"clusterer",Z,ab)}ab.beginUpdate();y.each(aa.todo.values,function(af,ag){var ae=b(aa,ag);ae.options.position=ae.options.position?I(ae.options.position):I(ag);ae.options.map=N;if(ad){N.setCenter(ae.options.position);ad=false}ab.add(ae,ag)});ab.endUpdate();O(aa,Z)}else{var ac=[];y.each(aa.todo.values,function(af,ag){var ai,ah,ae=b(aa,ag);ae.options.position=ae.options.position?I(ae.options.position):I(ag);ae.options.map=N;if(ad){N.setCenter(ae.options.position);ad=false}ah=new z.classes.Marker(ae.options);ac.push(ah);ai=V.add({todo:ae},"marker",ah);n(T,{todo:ae},ah,ai)});O(aa,Y?ac:ac[0])}};this.getroute=function(Y){Y.opts.origin=I(Y.opts.origin,true);Y.opts.destination=I(Y.opts.destination,true);G().route(Y.opts,function(aa,Z){X(Y,Z==google.maps.DirectionsStatus.OK?aa:false,Z);P.ack()})};this.directionsrenderer=function(Y){Y.opts.map=N;var aa,Z=new google.maps.DirectionsRenderer(Y.opts);if(Y.todo.divId){Z.setPanel(document.getElementById(Y.todo.divId))}else{if(Y.todo.container){Z.setPanel(y(Y.todo.container).get(0))}}aa=V.add(Y,"directionsrenderer",Z);O(Y,Z,aa)};this.getgeoloc=function(Y){O(Y,Y.latLng)};this.styledmaptype=function(Y){L();var Z=new z.classes.StyledMapType(Y.todo.styles,Y.opts);N.mapTypes.set(Y.todo.id,Z);O(Y,Z)};this.imagemaptype=function(Y){L();var Z=new z.classes.ImageMapType(Y.opts);N.mapTypes.set(Y.todo.id,Z);O(Y,Z)};this.autofit=function(Y){var Z=new google.maps.LatLngBounds();y.each(V.all(),function(aa,ab){if(ab.getPosition){Z.extend(ab.getPosition())}else{if(ab.getBounds){Z.extend(ab.getBounds().getNorthEast());Z.extend(ab.getBounds().getSouthWest())}else{if(ab.getPaths){ab.getPaths().forEach(function(ac){ac.forEach(function(ad){Z.extend(ad)})})}else{if(ab.getPath){ab.getPath().forEach(function(ac){Z.extend(ac);""})}else{if(ab.getCenter){Z.extend(ab.getCenter())}else{if(ab instanceof a){ab=V.getById(ab.id(),true);if(ab){ab.autofit(Z)}}}}}}}});if(!Z.isEmpty()&&(!N.getBounds()||!N.getBounds().equals(Z))){if("maxZoom" in Y.todo){google.maps.event.addListenerOnce(N,"bounds_changed",function(){if(this.getZoom()>Y.todo.maxZoom){this.setZoom(Y.todo.maxZoom)}})}N.fitBounds(Z)}O(Y,true)};this.clear=function(Y){if(typeof Y.todo==="string"){if(V.clearById(Y.todo)||V.objClearById(Y.todo)){O(Y,true);return}Y.todo={name:Y.todo}}if(Y.todo.id){y.each(g(Y.todo.id),function(Z,aa){V.clearById(aa)||V.objClearById(aa)})}else{V.clear(g(Y.todo.name),Y.todo.last,Y.todo.first,Y.todo.tag);V.objClear(g(Y.todo.name),Y.todo.last,Y.todo.first,Y.todo.tag)}O(Y,true)};this.exec=function(Y){var Z=this;y.each(g(Y.todo.func),function(aa,ab){y.each(Z.get(Y.todo,true,Y.todo.hasOwnProperty("full")?Y.todo.full:true),function(ac,ad){ab.call(T,ad)})});O(Y,true)};this.get=function(aa,ad,ac){var Z,ab,Y=ad?aa:aa.todo;if(!ad){ac=Y.full}if(typeof Y==="string"){ab=V.getById(Y,false,ac)||V.objGetById(Y);if(ab===false){Z=Y;Y={}}}else{Z=Y.name}if(Z==="map"){ab=N}if(!ab){ab=[];if(Y.id){y.each(g(Y.id),function(ae,af){ab.push(V.getById(af,false,ac)||V.objGetById(af))});if(!y.isArray(Y.id)){ab=ab[0]}}else{y.each(Z?g(Z):[t],function(af,ag){var ae;if(Y.first){ae=V.get(ag,false,Y.tag,ac);if(ae){ab.push(ae)}}else{if(Y.all){y.each(V.all(ag,Y.tag,ac),function(ai,ah){ab.push(ah)})}else{ae=V.get(ag,true,Y.tag,ac);if(ae){ab.push(ae)}}}});if(!Y.all&&!y.isArray(Z)){ab=ab[0]}}}ab=y.isArray(ab)||!Y.all?ab:[ab];if(ad){return ab}else{O(aa,ab)}};this.getdistance=function(Y){var Z;Y.opts.origins=g(Y.opts.origins);for(Z=0;Z<Y.opts.origins.length;Z++){Y.opts.origins[Z]=I(Y.opts.origins[Z],true)}Y.opts.destinations=g(Y.opts.destinations);for(Z=0;Z<Y.opts.destinations.length;Z++){Y.opts.destinations[Z]=I(Y.opts.destinations[Z],true)}B().getDistanceMatrix(Y.opts,function(ab,aa){X(Y,aa===google.maps.DistanceMatrixStatus.OK?ab:false,aa);P.ack()})};this.trigger=function(Z){if(typeof Z.todo==="string"){google.maps.event.trigger(N,Z.todo)}else{var Y=[N,Z.todo.eventName];if(Z.todo.var_args){y.each(Z.todo.var_args,function(ab,aa){Y.push(aa)})}google.maps.event.trigger.apply(google.maps.event,Y)}X(Z);P.ack()}}function s(M){var L;if(!typeof M==="object"||!M.hasOwnProperty("get")){return false}for(L in M){if(L!=="get"){return false}}return !M.get.hasOwnProperty("callback")}y.fn.gmap3=function(){var M,O=[],N=true,L=[];J();for(M=0;M<arguments.length;M++){if(arguments[M]){O.push(arguments[M])}}if(!O.length){O.push("map")}y.each(this,function(){var P=y(this),Q=P.data("gmap3");N=false;if(!Q){Q=new K(P);P.data("gmap3",Q)}if(O.length===1&&(O[0]==="get"||s(O[0]))){if(O[0]==="get"){L.push(Q.get("map",true))}else{L.push(Q.get(O[0].get,true,O[0].get.full))}}else{Q._plan(O)}});if(L.length){if(L.length===1){return L[0]}else{return L}}return this}})(jQuery);
js/jquery.addfields.js CHANGED
@@ -1,6 +1,6 @@
1
  jQuery(document).ready(function($) {
2
  $('#add_field').on('click',function() {
3
- $('#event_span').removeAttr('disabled');
4
  var num = $('.clonedInput').length; // how many "duplicatable" input fields we currently have
5
  var newNum = new Number(num + 1); // the numeric ID of the new input field being added
6
  // create the new element via clone(), and manipulate it's ID using newNum value
@@ -23,10 +23,10 @@ jQuery(document).ready(function($) {
23
  // if only one element remains, disable the "remove" button
24
  if (num-1 == 1)
25
  $('#del_field').attr('disabled','disabled');
26
- $('#event_span').attr('disabled','disabled');
27
  });
28
  $('#del_field').attr('disabled','disabled');
29
- $('#event_span').attr('disabled','disabled');
30
  });
31
 
32
  jQuery(document).ready(function($) {
@@ -53,7 +53,6 @@ jQuery(document).ready(function($) {
53
  // if only one element remains, disable the "remove" button
54
  if (num-1 == 1)
55
  $('#del_price').attr('disabled','disabled');
56
- $('#event_span').attr('disabled','disabled');
57
  });
58
  $('#del_price').attr('disabled','disabled');
59
  });
1
  jQuery(document).ready(function($) {
2
  $('#add_field').on('click',function() {
3
+ $('#event_span').show();
4
  var num = $('.clonedInput').length; // how many "duplicatable" input fields we currently have
5
  var newNum = new Number(num + 1); // the numeric ID of the new input field being added
6
  // create the new element via clone(), and manipulate it's ID using newNum value
23
  // if only one element remains, disable the "remove" button
24
  if (num-1 == 1)
25
  $('#del_field').attr('disabled','disabled');
26
+ $('#event_span').hide();
27
  });
28
  $('#del_field').attr('disabled','disabled');
29
+ $('#event_span').hide();
30
  });
31
 
32
  jQuery(document).ready(function($) {
53
  // if only one element remains, disable the "remove" button
54
  if (num-1 == 1)
55
  $('#del_price').attr('disabled','disabled');
 
56
  });
57
  $('#del_price').attr('disabled','disabled');
58
  });
js/jquery.calendrical.js DELETED
@@ -1,484 +0,0 @@
1
- (function($) {
2
- var monthNames = mc_months;
3
-
4
- function getToday() {
5
- var date = new Date();
6
- return new Date(date.getFullYear(), date.getMonth(), date.getDate());
7
- }
8
-
9
- function areDatesEqual(date1, date2) {
10
- return String(date1) == String(date2);
11
- }
12
-
13
- function daysInMonth(year, month) {
14
- if (year instanceof Date) return daysInMonth(year.getFullYear(), year.getMonth());
15
- if ( month == 1 ) {
16
- var leapYear = (year % 4 == 0) &&
17
- (!(year % 100 == 0) || (year % 400 == 0));
18
- return leapYear ? 29 : 28;
19
- } else if (month == 3 || month == 5 || month == 8 || month == 10) {
20
- return 30;
21
- } else {
22
- return 31;
23
- }
24
- }
25
-
26
- function dayAfter(date) {
27
- var year = date.getFullYear();
28
- var month = date.getMonth();
29
- var day = date.getDate();
30
- var lastDay = daysInMonth(date);
31
- return (day == lastDay) ?
32
- ((month == 11) ?
33
- new Date(year + 1, 0, 1) :
34
- new Date(year, month + 1, 1)
35
- ) :
36
- new Date(year, month, day + 1);
37
- }
38
-
39
- function dayBefore(date) {
40
- var year = date.getFullYear();
41
- var month = date.getMonth();
42
- var day = date.getDate();
43
- return (day == 1) ?
44
- ((month == 0) ?
45
- new Date(year - 1, 11, daysInMonth(year - 1, 11)) :
46
- new Date(year, month - 1, daysInMonth(year, month - 1))
47
- ) :
48
- new Date(year, month, day - 1);
49
- }
50
-
51
- function monthAfter(year, month) {
52
- return (month == 11) ?
53
- new Date(year + 1, 0, 1) :
54
- new Date(year, month + 1, 1);
55
- }
56
-
57
- function formatDate(date) {
58
- var d = date.getDate();
59
- var m = date.getMonth() + 1;
60
- var dlen = d.toString();
61
- var mlen = m.toString();
62
- var day = ( dlen.length == 2 ) ? d : '0' + d;
63
- var month = ( mlen.length == 2 ) ? ( m ) : '0' + m;
64
- return (date.getFullYear() + '-' + month + '-' + day );
65
- }
66
-
67
- function parseDate(date) {
68
- a = date.split(/[\.\-\/]/);
69
- var year = a.shift();
70
- var month = a.shift()-1;
71
- var day = a.shift();
72
- return new Date( year, month, day );
73
- }
74
-
75
- function formatTime( hour, minute ) {
76
- var d = new Date( 2013, 9, 1, hour, minute );
77
- var t=d.toLocaleTimeString();
78
- return t;
79
- }
80
-
81
- function parseTime(text) {
82
- var match = match = /(\d+)\s*[:\-\.,]\s*(\d+)\s*[:\-\.,]\s*(\d+)\s*(am|pm)?/i.exec(text);
83
- if (match && match.length >= 3) {
84
- var hour = Number(match[1]);
85
- var minute = Number(match[2]);
86
- if (hour == 12 && match[4]) { hour -= 12; }
87
- if (match[4] && match[4].toLowerCase() == 'pm') { hour += 12; }
88
- return {
89
- hour: hour,
90
- minute: minute
91
- };
92
- } else {
93
- return null;
94
- }
95
- }
96
-
97
- /**
98
- * Generates calendar header, with month name, << and >> controls, and
99
- * initials for days of the week.
100
- */
101
- function renderCalendarHeader(element, year, month, options) {
102
- //Prepare thead element
103
- var thead = $('<thead />');
104
- var titleRow = $('<tr />').appendTo(thead);
105
-
106
- //Generate << (back a month) link
107
- $('<th />').addClass('monthCell').append(
108
- $('<a href="javascript:;">&laquo;</a>')
109
- .addClass('prevMonth')
110
- .on('click',function(e) {
111
- renderCalendarPage(element,
112
- month == 0 ? (year - 1) : year,
113
- month == 0 ? 11 : (month - 1), options
114
- );
115
- e.preventDefault();
116
- })
117
- ).appendTo(titleRow);
118
-
119
- //Generate month title
120
- $('<th />').addClass('monthCell').attr('colSpan', 5).append(
121
- $('<a href="javascript:;">' + monthNames[month] + ' ' +
122
- year + '</a>').addClass('monthName')
123
- ).appendTo(titleRow);
124
-
125
- //Generate >> (forward a month) link
126
- $('<th />').addClass('monthCell').append(
127
- $('<a href="javascript:;">&raquo;</a>')
128
- .addClass('nextMonth')
129
- .on('click',function() {
130
- renderCalendarPage(element,
131
- month == 11 ? (year + 1) : year,
132
- month == 11 ? 0 : (month + 1), options
133
- );
134
- })
135
- ).appendTo(titleRow);
136
-
137
- //Generate weekday initials row
138
- var dayNames = $('<tr />').appendTo(thead);
139
- $.each(String('SMTWTFS').split(''), function(k, v) {
140
- $('<th />').addClass('dayName').append(v).appendTo(dayNames);
141
- });
142
-
143
- return thead;
144
- }
145
-
146
- function renderCalendarPage(element, year, month, options) {
147
- options = options || {};
148
-
149
- var today = getToday();
150
-
151
- var date = new Date(year, month, 1);
152
-
153
- //Wind end date forward to saturday week after month
154
- var endDate = monthAfter(year, month);
155
- var ff = 6 - endDate.getDay();
156
- if (ff < 6) ff += 7;
157
- for (var i = 0; i < ff; i++) endDate = dayAfter(endDate);
158
-
159
- var table = $('<table />');
160
- renderCalendarHeader(element, year, month, options).appendTo(table);
161
-
162
- var tbody = $('<tbody />').appendTo(table);
163
- var row = $('<tr />');
164
-
165
- //Rewind date to monday week before month
166
- var rewind = date.getDay() + 7;
167
- for (var i = 0; i < rewind; i++) date = dayBefore(date);
168
-
169
- while (date <= endDate) {
170
- var td = $('<td />')
171
- .addClass('day')
172
- .append(
173
- $('<a href="javascript:;">' +
174
- date.getDate() + '</a>'
175
- ).click((function() {
176
- var thisDate = date;
177
-
178
- return function() {
179
- if (options && options.selectDate) {
180
- options.selectDate(thisDate);
181
- }
182
- }
183
- }()))
184
- )
185
- .appendTo(row);
186
-
187
- var isToday = areDatesEqual(date, today);
188
- var isSelected = options.selected &&
189
- areDatesEqual(options.selected, date);
190
-
191
- if (isToday) td.addClass('today');
192
- if (isSelected) td.addClass('selected');
193
- if (isToday && isSelected) td.addClass('today_selected');
194
- if (date.getMonth() != month) td.addClass('nonMonth');
195
-
196
- dow = date.getDay();
197
- if (dow == 6) {
198
- tbody.append(row);
199
- row = $('<tr />');
200
- }
201
- date = dayAfter(date);
202
- }
203
- if (row.children().length) {
204
- tbody.append(row);
205
- } else {
206
- row.remove();
207
- }
208
-
209
- element.empty().append(table);
210
- }
211
-
212
- function roundNumber( num, dec ) {
213
- var result = Math.round(num*Math.pow(10,dec))/Math.pow(10,dec);
214
- return result;
215
- }
216
-
217
- function renderTimeSelect(element, options) {
218
- var selection = options.selection && parseTime(options.selection);
219
- if (selection) {
220
- selection.minute = Math.floor(selection.minute / 15.0) * 15;
221
- }
222
- var startTime = options.startTime &&
223
- (options.startTime.hour * 60 + options.startTime.minute);
224
-
225
- var scrollTo; //Element to scroll the dropdown box to when shown
226
- var ul = $('<ul />');
227
- var first = $('<li />').append(
228
- $('<a href="javascript:;">All day</a>')
229
- .click(function() {
230
- if (options && options.selectTime) {
231
- options.selectTime('');
232
- }
233
- }).mousemove(function() {
234
- $('li.selected', ul).removeClass('selected');
235
- })
236
- ).appendTo(ul);
237
- for (var hour = 0; hour < 24; hour++) {
238
- for (var minute = 0; minute < 60; minute += 15) {
239
-
240
- (function() {
241
- var timeText = formatTime(hour, minute);
242
- var fullText = timeText;
243
- if ( startTime != null ) {
244
- var duration = roundNumber( ( (hour * 60 + minute) - startTime ), 2 );
245
- if ( duration < 0 ) {
246
- fullText = '<s>' + fullText + '</s>';
247
- } else if (duration < 60 && duration >= 0) {
248
- fullText += ' (' + duration + ' mins)';
249
- } else if (duration == 60) {
250
- fullText += ' (1 hr)';
251
- } else {
252
- var long_duration = roundNumber( ( duration / 60.0 ), 2 );
253
- fullText += ' (' + long_duration + ' hrs)';
254
- }
255
- }
256
- var li = $('<li />').append(
257
- $('<a href="javascript:;">' + fullText + '</a>')
258
- .click(function() {
259
- if (options && options.selectTime) {
260
- options.selectTime(timeText);
261
- }
262
- }).mousemove(function() {
263
- $('li.selected', ul).removeClass('selected');
264
- })
265
- ).appendTo(ul);
266
-
267
- //Set to scroll to the default hour, unless already set
268
- if (!scrollTo && hour == options.defaultHour) {
269
- scrollTo = li;
270
- }
271
-
272
- if (selection &&
273
- selection.hour == hour &&
274
- selection.minute == minute)
275
- {
276
- //Highlight selected item
277
- li.addClass('selected');
278
- //Set to scroll to the selected hour
279
- //
280
- //This is set even if scrollTo is already set, since scrolling to selected hour is more important than
281
- //scrolling to default hour
282
- scrollTo = li;
283
- }
284
- })();
285
- }
286
- }
287
- var last = $('<li />').append(
288
- $('<a href="javascript:;">12:00am</a>')
289
- .click(function() {
290
- if (options && options.selectTime) {
291
- options.selectTime('12:00am');
292
- }
293
- }).mousemove(function() {
294
- $('li.selected', ul).removeClass('selected');
295
- })
296
- ).appendTo(ul);
297
- if (scrollTo) {
298
- //Set timeout of zero so code runs immediately after any calling
299
- //functions are finished (this is needed, since box hasn't been
300
- //added to the DOM yet)
301
- setTimeout(function() {
302
- //Scroll the dropdown box so that scrollTo item is in the middle
303
- element[0].scrollTop =
304
- scrollTo[0].offsetTop - scrollTo.height() * 2;
305
- }, 0);
306
- }
307
- element.empty().append(ul);
308
- }
309
-
310
- $.fn.calendricalDate = function( options ) {
311
- options = options || {};
312
- options.padding = options.padding || 4;
313
-
314
- return this.each(function() {
315
- var element = $(this);
316
- var div;
317
- var within = false;
318
-
319
- element.bind('click', function() {
320
- //element.bind('focus click', function() {
321
- if (div) return;
322
- var offset = element.position();
323
- var padding = element.css('padding-left');
324
- div = $('<div />')
325
- .addClass('calendricalDatePopup')
326
- .mouseenter(function() { within = true; })
327
- .mouseleave(function() { within = false; })
328
- .mousedown(function(e) {
329
- e.preventDefault();
330
- })
331
- .css({
332
- position: 'absolute',
333
- left: offset.left,
334
- top: offset.top + element.height
335
- });
336
- element.after(div);
337
- var selected = parseDate(element.val());
338
- if (!selected.getFullYear()) selected = getToday();
339
-
340
- renderCalendarPage(
341
- div,
342
- selected.getFullYear(),
343
- selected.getMonth(), {
344
- selected: selected,
345
- selectDate: function(date) {
346
- within = false;
347
- element.val(formatDate(date));
348
- div.remove();
349
- div = null;
350
- if (options.endDate) {
351
- var endDate = parseDate(
352
- options.endDate.val()
353
- );
354
- if (endDate >= selected) {
355
- options.endDate.val(formatDate(
356
- new Date(
357
- date.getTime() +
358
- endDate.getTime() -
359
- selected.getTime()
360
- )
361
- ));
362
- }
363
- }
364
- }
365
- }
366
- );
367
- }).blur(function() {
368
- if (within){
369
- if (div) element.focus();
370
- return;
371
- }
372
- if (!div) return;
373
- div.remove();
374
- div = null;
375
- });
376
- });
377
- };
378
-
379
- $.fn.calendricalDateRange = function(options) {
380
- if (this.length >= 2) {
381
- $(this[0]).calendricalDate($.extend({
382
- endDate: $(this[1])
383
- }, options));
384
- $(this[1]).calendricalDate(options);
385
- }
386
- return this;
387
- };
388
-
389
- $.fn.calendricalTime = function(options) {
390
- options = options || {};
391
- options.padding = options.padding || 4;
392
-
393
- return this.each(function() {
394
- var element = $(this);
395
- var div;
396
- var within = false;
397
-
398
- element.attr( "autocomplete", "off" );
399
- element.bind('click', function() {
400
- //element.bind('focus click', function() { // only allow keyboard focus once it works properly.
401
- if (div) return;
402
-
403
- var useStartTime = options.startTime;
404
- if (useStartTime) {
405
- if (options.startDate && options.endDate &&
406
- !areDatesEqual(parseDate(options.startDate.val()),
407
- parseDate(options.endDate.val())))
408
- useStartTime = true;
409
- }
410
-
411
- var offset = element.position();
412
- div = $('<div />')
413
- .addClass('calendricalTimePopup')
414
- .mouseenter(function() { within = true; })
415
- .mouseleave(function() { within = false; })
416
- .mousedown(function(e) {
417
- e.preventDefault();
418
- })
419
- .css({
420
- position: 'absolute',
421
- left: offset.left,
422
- top: offset.top + element.height
423
- });
424
- if (useStartTime) {
425
- div.addClass('calendricalEndTimePopup');
426
- }
427
-
428
- element.after(div);
429
-
430
- var opts = {
431
- selection: element.val(),
432
- selectTime: function(time) {
433
- within = false;
434
- element.val(time);
435
- div.remove();
436
- div = null;
437
- },
438
- defaultHour: (options.defaultHour != null) ?
439
- options.defaultHour : 8
440
- };
441
-
442
- if (useStartTime) {
443
- opts.startTime = parseTime(options.startTime.val());
444
- }
445
-
446
- renderTimeSelect(div, opts);
447
- }).blur(function() {
448
- if (within){
449
- if (div) element.focus();
450
- return;
451
- }
452
- if (!div) return;
453
- div.remove();
454
- div = null;
455
- });
456
- });
457
- },
458
-
459
- $.fn.calendricalTimeRange = function(options) {
460
- if (this.length >= 2) {
461
- $(this[0]).calendricalTime(options);
462
- $(this[1]).calendricalTime($.extend({
463
- startTime: $(this[0])
464
- }, options));
465
- }
466
- return this;
467
- };
468
-
469
- $.fn.calendricalDateTimeRange = function(options) {
470
- if (this.length >= 4) {
471
- $(this[0]).calendricalDate($.extend({
472
- endDate: $(this[2])
473
- }, options));
474
- $(this[1]).calendricalTime(options);
475
- $(this[2]).calendricalDate(options);
476
- $(this[3]).calendricalTime($.extend({
477
- startTime: $(this[1]),
478
- startDate: $(this[0]),
479
- endDate: $(this[2])
480
- }, options));
481
- }
482
- return this;
483
- };
484
- })( jQuery );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/pickadate/legacy.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Legacy browser support
3
+ */
4
+ [].map||(Array.prototype.map=function(a,b){for(var c=this,d=c.length,e=new Array(d),f=0;d>f;f++)f in c&&(e[f]=a.call(b,c[f],f,c));return e}),[].filter||(Array.prototype.filter=function(a){if(null==this)throw new TypeError;var b=Object(this),c=b.length>>>0;if("function"!=typeof a)throw new TypeError;for(var d=[],e=arguments[1],f=0;c>f;f++)if(f in b){var g=b[f];a.call(e,g,f,b)&&d.push(g)}return d}),[].indexOf||(Array.prototype.indexOf=function(a){if(null==this)throw new TypeError;var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>1&&(d=Number(arguments[1]),d!=d?d=0:0!==d&&1/0!=d&&d!=-1/0&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(var e=d>=0?d:Math.max(c-Math.abs(d),0);c>e;e++)if(e in b&&b[e]===a)return e;return-1});/*!
5
+ * Cross-Browser Split 1.1.1
6
+ * Copyright 2007-2012 Steven Levithan <stevenlevithan.com>
7
+ * Available under the MIT License
8
+ * http://blog.stevenlevithan.com/archives/cross-browser-split
9
+ */
10
+ var nativeSplit=String.prototype.split,compliantExecNpcg=void 0===/()??/.exec("")[1];String.prototype.split=function(a,b){var c=this;if("[object RegExp]"!==Object.prototype.toString.call(a))return nativeSplit.call(c,a,b);var d,e,f,g,h=[],i=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.extended?"x":"")+(a.sticky?"y":""),j=0;for(a=new RegExp(a.source,i+"g"),c+="",compliantExecNpcg||(d=new RegExp("^"+a.source+"$(?!\\s)",i)),b=void 0===b?-1>>>0:b>>>0;(e=a.exec(c))&&(f=e.index+e[0].length,!(f>j&&(h.push(c.slice(j,e.index)),!compliantExecNpcg&&e.length>1&&e[0].replace(d,function(){for(var a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(e[a]=void 0)}),e.length>1&&e.index<c.length&&Array.prototype.push.apply(h,e.slice(1)),g=e[0].length,j=f,h.length>=b)));)a.lastIndex===e.index&&a.lastIndex++;return j===c.length?(g||!a.test(""))&&h.push(""):h.push(c.slice(j)),h.length>b?h.slice(0,b):h};
js/pickadate/picker.date.js ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ /*!
2
+ * Date picker for pickadate.js v3.4.0
3
+ * http://amsul.github.io/pickadate.js/date.htm
4
+ */
5
+ !function(a){"function"==typeof define&&define.amd?define(["picker","jquery"],a):a(Picker,jQuery)}(function(a,b){function c(a,b){var c=this,d=a.$node[0].value,e=a.$node.data("value"),f=e||d,g=e?b.formatSubmit:b.format,h=function(){return"rtl"===getComputedStyle(a.$root[0]).direction};c.settings=b,c.$node=a.$node,c.queue={min:"measure create",max:"measure create",now:"now create",select:"parse create validate",highlight:"parse navigate create validate",view:"parse create validate viewset",disable:"deactivate",enable:"activate"},c.item={},c.item.disable=(b.disable||[]).slice(0),c.item.enable=-function(a){return a[0]===!0?a.shift():-1}(c.item.disable),c.set("min",b.min).set("max",b.max).set("now"),f?c.set("select",f,{format:g,fromValue:!!d}):c.set("select",null).set("highlight",c.item.now),c.key={40:7,38:-7,39:function(){return h()?-1:1},37:function(){return h()?1:-1},go:function(a){var b=c.item.highlight,d=new Date(b.year,b.month,b.date+a);c.set("highlight",[d.getFullYear(),d.getMonth(),d.getDate()],{interval:a}),this.render()}},a.on("render",function(){a.$root.find("."+b.klass.selectMonth).on("change",function(){var c=this.value;c&&(a.set("highlight",[a.get("view").year,c,a.get("highlight").date]),a.$root.find("."+b.klass.selectMonth).trigger("focus"))}),a.$root.find("."+b.klass.selectYear).on("change",function(){var c=this.value;c&&(a.set("highlight",[c,a.get("view").month,a.get("highlight").date]),a.$root.find("."+b.klass.selectYear).trigger("focus"))})}).on("open",function(){a.$root.find("button, select").attr("disabled",!1)}).on("close",function(){a.$root.find("button, select").attr("disabled",!0)})}var d=7,e=6,f=a._;c.prototype.set=function(a,b,c){var d=this,e=d.item;return null===b?(e[a]=b,d):(e["enable"==a?"disable":"flip"==a?"enable":a]=d.queue[a].split(" ").map(function(e){return b=d[e](a,b,c)}).pop(),"select"==a?d.set("highlight",e.select,c):"highlight"==a?d.set("view",e.highlight,c):a.match(/^(flip|min|max|disable|enable)$/)&&(e.select&&d.disabled(e.select)&&d.set("select",e.select,c),e.highlight&&d.disabled(e.highlight)&&d.set("highlight",e.highlight,c)),d)},c.prototype.get=function(a){return this.item[a]},c.prototype.create=function(a,c,d){var e,g=this;return c=void 0===c?a:c,c==-1/0||1/0==c?e=c:b.isPlainObject(c)&&f.isInteger(c.pick)?c=c.obj:b.isArray(c)?(c=new Date(c[0],c[1],c[2]),c=f.isDate(c)?c:g.create().obj):c=f.isInteger(c)||f.isDate(c)?g.normalize(new Date(c),d):g.now(a,c,d),{year:e||c.getFullYear(),month:e||c.getMonth(),date:e||c.getDate(),day:e||c.getDay(),obj:e||c,pick:e||c.getTime()}},c.prototype.createRange=function(a,c){var d=this,e=function(a){return a===!0||b.isArray(a)||f.isDate(a)?d.create(a):a};return f.isInteger(a)||(a=e(a)),f.isInteger(c)||(c=e(c)),f.isInteger(a)&&b.isPlainObject(c)?a=[c.year,c.month,c.date+a]:f.isInteger(c)&&b.isPlainObject(a)&&(c=[a.year,a.month,a.date+c]),{from:e(a),to:e(c)}},c.prototype.withinRange=function(a,b){return a=this.createRange(a.from,a.to),b.pick>=a.from.pick&&b.pick<=a.to.pick},c.prototype.overlapRanges=function(a,b){var c=this;return a=c.createRange(a.from,a.to),b=c.createRange(b.from,b.to),c.withinRange(a,b.from)||c.withinRange(a,b.to)||c.withinRange(b,a.from)||c.withinRange(b,a.to)},c.prototype.now=function(a,b,c){return b=new Date,c&&c.rel&&b.setDate(b.getDate()+c.rel),this.normalize(b,c)},c.prototype.navigate=function(a,c,d){var e,f,g,h,i=b.isArray(c),j=b.isPlainObject(c),k=this.item.view;if(i||j){for(j?(f=c.year,g=c.month,h=c.date):(f=+c[0],g=+c[1],h=+c[2]),d&&d.nav&&k&&k.month!==g&&(f=k.year,g=k.month),e=new Date(f,g+(d&&d.nav?d.nav:0),1),f=e.getFullYear(),g=e.getMonth();new Date(f,g,h).getMonth()!==g;)h-=1;c=[f,g,h]}return c},c.prototype.normalize=function(a){return a.setHours(0,0,0,0),a},c.prototype.measure=function(a,b){var c=this;return b?f.isInteger(b)&&(b=c.now(a,b,{rel:b})):b="min"==a?-1/0:1/0,b},c.prototype.viewset=function(a,b){return this.create([b.year,b.month,1])},c.prototype.validate=function(a,c,d){var e,g,h,i,j=this,k=c,l=d&&d.interval?d.interval:1,m=-1===j.item.enable,n=j.item.min,o=j.item.max,p=m&&j.item.disable.filter(function(a){if(b.isArray(a)){var d=j.create(a).pick;d<c.pick?e=!0:d>c.pick&&(g=!0)}return f.isInteger(a)}).length;if((!d||!d.nav)&&(!m&&j.disabled(c)||m&&j.disabled(c)&&(p||e||g)||!m&&(c.pick<=n.pick||c.pick>=o.pick)))for(m&&!p&&(!g&&l>0||!e&&0>l)&&(l*=-1);j.disabled(c)&&(Math.abs(l)>1&&(c.month<k.month||c.month>k.month)&&(c=k,l=l>0?1:-1),c.pick<=n.pick?(h=!0,l=1,c=j.create([n.year,n.month,n.date-1])):c.pick>=o.pick&&(i=!0,l=-1,c=j.create([o.year,o.month,o.date+1])),!h||!i);)c=j.create([c.year,c.month,c.date+l]);return c},c.prototype.disabled=function(a){var c=this,d=c.item.disable.filter(function(d){return f.isInteger(d)?a.day===(c.settings.firstDay?d:d-1)%7:b.isArray(d)||f.isDate(d)?a.pick===c.create(d).pick:b.isPlainObject(d)?c.withinRange(d,a):void 0});return d=d.length&&!d.filter(function(a){return b.isArray(a)&&"inverted"==a[3]||b.isPlainObject(a)&&a.inverted}).length,-1===c.item.enable?!d:d||a.pick<c.item.min.pick||a.pick>c.item.max.pick},c.prototype.parse=function(a,c,d){var e,g=this,h={};return!c||f.isInteger(c)||b.isArray(c)||f.isDate(c)||b.isPlainObject(c)&&f.isInteger(c.pick)?c:(d&&d.format||(d=d||{},d.format=g.settings.format),e="string"!=typeof c||d.fromValue?0:1,g.formats.toArray(d.format).map(function(a){var b=g.formats[a],d=b?f.trigger(b,g,[c,h]):a.replace(/^!/,"").length;b&&(h[a]=c.substr(0,d)),c=c.substr(d)}),[h.yyyy||h.yy,+(h.mm||h.m)-e,h.dd||h.d])},c.prototype.formats=function(){function a(a,b,c){var d=a.match(/\w+/)[0];return c.mm||c.m||(c.m=b.indexOf(d)),d.length}function b(a){return a.match(/\w+/)[0].length}return{d:function(a,b){return a?f.digits(a):b.date},dd:function(a,b){return a?2:f.lead(b.date)},ddd:function(a,c){return a?b(a):this.settings.weekdaysShort[c.day]},dddd:function(a,c){return a?b(a):this.settings.weekdaysFull[c.day]},m:function(a,b){return a?f.digits(a):b.month+1},mm:function(a,b){return a?2:f.lead(b.month+1)},mmm:function(b,c){var d=this.settings.monthsShort;return b?a(b,d,c):d[c.month]},mmmm:function(b,c){var d=this.settings.monthsFull;return b?a(b,d,c):d[c.month]},yy:function(a,b){return a?2:(""+b.year).slice(2)},yyyy:function(a,b){return a?4:b.year},toArray:function(a){return a.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g)},toString:function(a,b){var c=this;return c.formats.toArray(a).map(function(a){return f.trigger(c.formats[a],c,[0,b])||a.replace(/^!/,"")}).join("")}}}(),c.prototype.isDateExact=function(a,c){var d=this;return f.isInteger(a)&&f.isInteger(c)||"boolean"==typeof a&&"boolean"==typeof c?a===c:(f.isDate(a)||b.isArray(a))&&(f.isDate(c)||b.isArray(c))?d.create(a).pick===d.create(c).pick:b.isPlainObject(a)&&b.isPlainObject(c)?d.isDateExact(a.from,c.from)&&d.isDateExact(a.to,c.to):!1},c.prototype.isDateOverlap=function(a,c){var d=this;return f.isInteger(a)&&(f.isDate(c)||b.isArray(c))?a===d.create(c).day+1:f.isInteger(c)&&(f.isDate(a)||b.isArray(a))?c===d.create(a).day+1:b.isPlainObject(a)&&b.isPlainObject(c)?d.overlapRanges(a,c):!1},c.prototype.flipEnable=function(a){var b=this.item;b.enable=a||(-1==b.enable?1:-1)},c.prototype.deactivate=function(a,c){var d=this,e=d.item.disable.slice(0);return"flip"==c?d.flipEnable():c===!1?(d.flipEnable(1),e=[]):c===!0?(d.flipEnable(-1),e=[]):c.map(function(a){for(var c,g=0;g<e.length;g+=1)if(d.isDateExact(a,e[g])){c=!0;break}c||(f.isInteger(a)||f.isDate(a)||b.isArray(a)||b.isPlainObject(a)&&a.from&&a.to)&&e.push(a)}),e},c.prototype.activate=function(a,c){var d=this,e=d.item.disable,g=e.length;return"flip"==c?d.flipEnable():c===!0?(d.flipEnable(1),e=[]):c===!1?(d.flipEnable(-1),e=[]):c.map(function(a){var c,h,i,j;for(i=0;g>i;i+=1){if(h=e[i],d.isDateExact(h,a)){c=e[i]=null,j=!0;break}if(d.isDateOverlap(h,a)){b.isPlainObject(a)?(a.inverted=!0,c=a):b.isArray(a)?(c=a,c[3]||c.push("inverted")):f.isDate(a)&&(c=[a.getFullYear(),a.getMonth(),a.getDate(),"inverted"]);break}}if(c)for(i=0;g>i;i+=1)if(d.isDateExact(e[i],a)){e[i]=null;break}if(j)for(i=0;g>i;i+=1)if(d.isDateOverlap(e[i],a)){e[i]=null;break}c&&e.push(c)}),e.filter(function(a){return null!=a})},c.prototype.nodes=function(a){var b=this,c=b.settings,g=b.item,h=g.now,i=g.select,j=g.highlight,k=g.view,l=g.disable,m=g.min,n=g.max,o=function(a){return c.firstDay&&a.push(a.shift()),f.node("thead",f.node("tr",f.group({min:0,max:d-1,i:1,node:"th",item:function(b){return[a[b],c.klass.weekdays]}})))}((c.showWeekdaysFull?c.weekdaysFull:c.weekdaysShort).slice(0)),p=function(a){return f.node("div"," ",c.klass["nav"+(a?"Next":"Prev")]+(a&&k.year>=n.year&&k.month>=n.month||!a&&k.year<=m.year&&k.month<=m.month?" "+c.klass.navDisabled:""),"data-nav="+(a||-1))},q=function(b){return c.selectMonths?f.node("select",f.group({min:0,max:11,i:1,node:"option",item:function(a){return[b[a],0,"value="+a+(k.month==a?" selected":"")+(k.year==m.year&&a<m.month||k.year==n.year&&a>n.month?" disabled":"")]}}),c.klass.selectMonth,a?"":"disabled"):f.node("div",b[k.month],c.klass.month)},r=function(){var b=k.year,d=c.selectYears===!0?5:~~(c.selectYears/2);if(d){var e=m.year,g=n.year,h=b-d,i=b+d;if(e>h&&(i+=e-h,h=e),i>g){var j=h-e,l=i-g;h-=j>l?l:j,i=g}return f.node("select",f.group({min:h,max:i,i:1,node:"option",item:function(a){return[a,0,"value="+a+(b==a?" selected":"")]}}),c.klass.selectYear,a?"":"disabled")}return f.node("div",b,c.klass.year)};return f.node("div",p()+p(1)+q(c.showMonthsShort?c.monthsShort:c.monthsFull)+r(),c.klass.header)+f.node("table",o+f.node("tbody",f.group({min:0,max:e-1,i:1,node:"tr",item:function(a){var e=c.firstDay&&0===b.create([k.year,k.month,1]).day?-7:0;return[f.group({min:d*a-k.day+e+1,max:function(){return this.min+d-1},i:1,node:"td",item:function(a){a=b.create([k.year,k.month,a+(c.firstDay?1:0)]);var d=i&&i.pick==a.pick,e=j&&j.pick==a.pick,g=l&&b.disabled(a)||a.pick<m.pick||a.pick>n.pick;return[f.node("div",a.date,function(b){return b.push(k.month==a.month?c.klass.infocus:c.klass.outfocus),h.pick==a.pick&&b.push(c.klass.now),d&&b.push(c.klass.selected),e&&b.push(c.klass.highlighted),g&&b.push(c.klass.disabled),b.join(" ")}([c.klass.day]),"data-pick="+a.pick+" "+f.ariaAttr({role:"button",controls:b.$node[0].id,checked:d&&b.$node.val()===f.trigger(b.formats.toString,b,[c.format,a])?!0:null,activedescendant:e?!0:null,disabled:g?!0:null}))]}})]}})),c.klass.table)+f.node("div",f.node("button",c.today,c.klass.buttonToday,"type=button data-pick="+h.pick+(a?"":" disabled"))+f.node("button",c.clear,c.klass.buttonClear,"type=button data-clear=1"+(a?"":" disabled")),c.klass.footer)},c.defaults=function(a){return{monthsFull:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdaysFull:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],today:"Today",clear:"Clear",format:"d mmmm, yyyy",klass:{table:a+"table",header:a+"header",navPrev:a+"nav--prev",navNext:a+"nav--next",navDisabled:a+"nav--disabled",month:a+"month",year:a+"year",selectMonth:a+"select--month",selectYear:a+"select--year",weekdays:a+"weekday",day:a+"day",disabled:a+"day--disabled",selected:a+"day--selected",highlighted:a+"day--highlighted",now:a+"day--today",infocus:a+"day--infocus",outfocus:a+"day--outfocus",footer:a+"footer",buttonClear:a+"button--clear",buttonToday:a+"button--today"}}}(a.klasses().picker+"__"),a.extend("pickadate",c)});
js/pickadate/picker.js ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ /*!
2
+ * pickadate.js v3.4.0, 2014/02/15
3
+ * By Amsul, http://amsul.ca
4
+ * Hosted on http://amsul.github.io/pickadate.js
5
+ * Licensed under MIT
6
+ */
7
+ !function(a){"function"==typeof define&&define.amd?define("picker",["jquery"],a):this.Picker=a(jQuery)}(function(a){function b(d,e,g,h){function i(){return b._.node("div",b._.node("div",b._.node("div",b._.node("div",s.component.nodes(n.open),p.box),p.wrap),p.frame),p.holder)}function j(){q.data(e,s).addClass(p.input).val(q.data("value")?s.get("select",o.format):d.value).on("focus."+n.id+" click."+n.id,m),o.editable||q.on("keydown."+n.id,function(a){var b=a.keyCode,c=/^(8|46)$/.test(b);return 27==b?(s.close(),!1):void((32==b||c||!n.open&&s.component.key[b])&&(a.preventDefault(),a.stopPropagation(),c?s.clear().close():s.open()))}),c(d,{haspopup:!0,expanded:!1,readonly:!1,owns:d.id+"_root"+(s._hidden?" "+s._hidden.id:"")})}function k(){s.$root.on({focusin:function(a){s.$root.removeClass(p.focused),c(s.$root[0],"selected",!1),a.stopPropagation()},"mousedown click":function(b){var c=b.target;c!=s.$root.children()[0]&&(b.stopPropagation(),"mousedown"!=b.type||a(c).is(":input")||"OPTION"==c.nodeName||(b.preventDefault(),d.focus()))}}).on("click","[data-pick], [data-nav], [data-clear]",function(){var c=a(this),e=c.data(),f=c.hasClass(p.navDisabled)||c.hasClass(p.disabled),g=document.activeElement;g=g&&(g.type||g.href)&&g,(f||g&&!a.contains(s.$root[0],g))&&d.focus(),e.nav&&!f?s.set("highlight",s.component.item.highlight,{nav:e.nav}):b._.isInteger(e.pick)&&!f?s.set("select",e.pick).close(!0):e.clear&&s.clear().close(!0)}),c(s.$root[0],"hidden",!0)}function l(){var b=["string"==typeof o.hiddenPrefix?o.hiddenPrefix:"","string"==typeof o.hiddenSuffix?o.hiddenSuffix:"_submit"];s._hidden=a('<input type=hidden name="'+b[0]+d.name+b[1]+'"id="'+b[0]+d.id+b[1]+'"'+(q.data("value")||d.value?' value="'+s.get("select",o.formatSubmit)+'"':"")+">")[0],q.on("change."+n.id,function(){s._hidden.value=d.value?s.get("select",o.formatSubmit):""}).after(s._hidden)}function m(a){a.stopPropagation(),"focus"==a.type&&(s.$root.addClass(p.focused),c(s.$root[0],"selected",!0)),s.open()}if(!d)return b;var n={id:d.id||"P"+Math.abs(~~(Math.random()*new Date))},o=g?a.extend(!0,{},g.defaults,h):h||{},p=a.extend({},b.klasses(),o.klass),q=a(d),r=function(){return this.start()},s=r.prototype={constructor:r,$node:q,start:function(){return n&&n.start?s:(n.methods={},n.start=!0,n.open=!1,n.type=d.type,d.autofocus=d==document.activeElement,d.type="text",d.readOnly=!o.editable,d.id=d.id||n.id,s.component=new g(s,o),s.$root=a(b._.node("div",i(),p.picker,'id="'+d.id+'_root"')),k(),o.formatSubmit&&l(),j(),o.container?a(o.container).append(s.$root):q.after(s.$root),s.on({start:s.component.onStart,render:s.component.onRender,stop:s.component.onStop,open:s.component.onOpen,close:s.component.onClose,set:s.component.onSet}).on({start:o.onStart,render:o.onRender,stop:o.onStop,open:o.onOpen,close:o.onClose,set:o.onSet}),d.autofocus&&s.open(),s.trigger("start").trigger("render"))},render:function(a){return a?s.$root.html(i()):s.$root.find("."+p.box).html(s.component.nodes(n.open)),s.trigger("render")},stop:function(){return n.start?(s.close(),s._hidden&&s._hidden.parentNode.removeChild(s._hidden),s.$root.remove(),q.removeClass(p.input).removeData(e),setTimeout(function(){q.off("."+n.id)},0),d.type=n.type,d.readOnly=!1,s.trigger("stop"),n.methods={},n.start=!1,s):s},open:function(e){return n.open?s:(q.addClass(p.active),c(d,"expanded",!0),s.$root.addClass(p.opened),c(s.$root[0],"hidden",!1),e!==!1&&(n.open=!0,q.trigger("focus"),f.on("click."+n.id+" focusin."+n.id,function(a){var b=a.target;b!=d&&b!=document&&3!=a.which&&s.close(b===s.$root.children()[0])}).on("keydown."+n.id,function(c){var e=c.keyCode,f=s.component.key[e],g=c.target;27==e?s.close(!0):g!=d||!f&&13!=e?a.contains(s.$root[0],g)&&13==e&&(c.preventDefault(),g.click()):(c.preventDefault(),f?b._.trigger(s.component.key.go,s,[b._.trigger(f)]):s.$root.find("."+p.highlighted).hasClass(p.disabled)||s.set("select",s.component.item.highlight).close())})),s.trigger("open"))},close:function(a){return a&&(q.off("focus."+n.id).trigger("focus"),setTimeout(function(){q.on("focus."+n.id,m)},0)),q.removeClass(p.active),c(d,"expanded",!1),s.$root.removeClass(p.opened+" "+p.focused),c(s.$root[0],"hidden",!0),c(s.$root[0],"selected",!1),n.open?(n.open=!1,f.off("."+n.id),s.trigger("close")):s},clear:function(){return s.set("clear")},set:function(b,c,d){var e,f,g=a.isPlainObject(b),h=g?b:{};if(d=g&&a.isPlainObject(c)?c:d||{},b){g||(h[b]=c);for(e in h)f=h[e],e in s.component.item&&s.component.set(e,f,d),("select"==e||"clear"==e)&&q.val("clear"==e?"":s.get(e,o.format)).trigger("change");s.render()}return d.muted?s:s.trigger("set",h)},get:function(a,c){return a=a||"value",null!=n[a]?n[a]:"value"==a?d.value:a in s.component.item?"string"==typeof c?b._.trigger(s.component.formats.toString,s.component,[c,s.component.get(a)]):s.component.get(a):void 0},on:function(b,c){var d,e,f=a.isPlainObject(b),g=f?b:{};if(b){f||(g[b]=c);for(d in g)e=g[d],n.methods[d]=n.methods[d]||[],n.methods[d].push(e)}return s},off:function(){var a,b,c=arguments;for(a=0,namesCount=c.length;namesCount>a;a+=1)b=c[a],b in n.methods&&delete n.methods[b];return s},trigger:function(a,c){var d=n.methods[a];return d&&d.map(function(a){b._.trigger(a,s,[c])}),s}};return new r}function c(b,c,e){if(a.isPlainObject(c))for(var f in c)d(b,f,c[f]);else d(b,c,e)}function d(a,b,c){a.setAttribute(("role"==b?"":"aria-")+b,c)}function e(b,c){a.isPlainObject(b)||(b={attribute:c}),c="";for(var d in b){var e=("role"==d?"":"aria-")+d,f=b[d];c+=null==f?"":e+'="'+b[d]+'"'}return c}var f=a(document);return b.klasses=function(a){return a=a||"picker",{picker:a,opened:a+"--opened",focused:a+"--focused",input:a+"__input",active:a+"__input--active",holder:a+"__holder",frame:a+"__frame",wrap:a+"__wrap",box:a+"__box"}},b._={group:function(a){for(var c,d="",e=b._.trigger(a.min,a);e<=b._.trigger(a.max,a,[e]);e+=a.i)c=b._.trigger(a.item,a,[e]),d+=b._.node(a.node,c[0],c[1],c[2]);return d},node:function(b,c,d,e){return c?(c=a.isArray(c)?c.join(""):c,d=d?' class="'+d+'"':"",e=e?" "+e:"","<"+b+d+e+">"+c+"</"+b+">"):""},lead:function(a){return(10>a?"0":"")+a},trigger:function(a,b,c){return"function"==typeof a?a.apply(b,c||[]):a},digits:function(a){return/\d/.test(a[1])?2:1},isDate:function(a){return{}.toString.call(a).indexOf("Date")>-1&&this.isInteger(a.getDate())},isInteger:function(a){return{}.toString.call(a).indexOf("Number")>-1&&a%1===0},ariaAttr:e},b.extend=function(c,d){a.fn[c]=function(e,f){var g=this.data(c);return"picker"==e?g:g&&"string"==typeof e?(b._.trigger(g[e],g,[f]),this):this.each(function(){var f=a(this);f.data(c)||new b(this,c,d,e)})},a.fn[c].defaults=d.defaults},b});
js/pickadate/picker.time.js ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ /*!
2
+ * Time picker for pickadate.js v3.4.0
3
+ * http://amsul.github.io/pickadate.js/time.htm
4
+ */
5
+ !function(a){"function"==typeof define&&define.amd?define(["picker","jquery"],a):a(Picker,jQuery)}(function(a,b){function c(a,b){var c=this,d=a.$node[0].value,e=a.$node.data("value"),f=e||d,g=e?b.formatSubmit:b.format;c.settings=b,c.$node=a.$node,c.queue={interval:"i",min:"measure create",max:"measure create",now:"now create",select:"parse create validate",highlight:"parse create validate",view:"parse create validate",disable:"deactivate",enable:"activate"},c.item={},c.item.interval=b.interval||30,c.item.disable=(b.disable||[]).slice(0),c.item.enable=-function(a){return a[0]===!0?a.shift():-1}(c.item.disable),c.set("min",b.min).set("max",b.max).set("now"),f?c.set("select",f,{format:g,fromValue:!!d}):c.set("select",null).set("highlight",c.item.now),c.key={40:1,38:-1,39:1,37:-1,go:function(a){c.set("highlight",c.item.highlight.pick+a*c.item.interval,{interval:a*c.item.interval}),this.render()}},a.on("render",function(){var c=a.$root.children(),d=c.find("."+b.klass.viewset);d.length&&(c[0].scrollTop=~~d.position().top-2*d[0].clientHeight)}).on("open",function(){a.$root.find("button").attr("disable",!1)}).on("close",function(){a.$root.find("button").attr("disable",!0)})}var d=24,e=60,f=12,g=d*e,h=a._;c.prototype.set=function(a,b,c){var d=this,e=d.item;return null===b?(e[a]=b,d):(e["enable"==a?"disable":"flip"==a?"enable":a]=d.queue[a].split(" ").map(function(e){return b=d[e](a,b,c)}).pop(),"select"==a?d.set("highlight",e.select,c):"highlight"==a?d.set("view",e.highlight,c):"interval"==a?d.set("min",e.min,c).set("max",e.max,c):a.match(/^(flip|min|max|disable|enable)$/)&&("min"==a&&d.set("max",e.max,c),e.select&&d.disabled(e.select)&&d.set("select",e.select,c),e.highlight&&d.disabled(e.highlight)&&d.set("highlight",e.highlight,c)),d)},c.prototype.get=function(a){return this.item[a]},c.prototype.create=function(a,c,f){var i=this;return c=void 0===c?a:c,h.isDate(c)&&(c=[c.getHours(),c.getMinutes()]),b.isPlainObject(c)&&h.isInteger(c.pick)?c=c.pick:b.isArray(c)?c=+c[0]*e+ +c[1]:h.isInteger(c)||(c=i.now(a,c,f)),"max"==a&&c<i.item.min.pick&&(c+=g),"min"!=a&&"max"!=a&&(c-i.item.min.pick)%i.item.interval!==0&&(c+=i.item.interval),c=i.normalize(a,c,f),{hour:~~(d+c/e)%d,mins:(e+c%e)%e,time:(g+c)%g,pick:c}},c.prototype.createRange=function(a,c){var d=this,e=function(a){return a===!0||b.isArray(a)||h.isDate(a)?d.create(a):a};return h.isInteger(a)||(a=e(a)),h.isInteger(c)||(c=e(c)),h.isInteger(a)&&b.isPlainObject(c)?a=[c.hour,c.mins+a*d.settings.interval]:h.isInteger(c)&&b.isPlainObject(a)&&(c=[a.hour,a.mins+c*d.settings.interval]),{from:e(a),to:e(c)}},c.prototype.withinRange=function(a,b){return a=this.createRange(a.from,a.to),b.pick>=a.from.pick&&b.pick<=a.to.pick},c.prototype.overlapRanges=function(a,b){var c=this;return a=c.createRange(a.from,a.to),b=c.createRange(b.from,b.to),c.withinRange(a,b.from)||c.withinRange(a,b.to)||c.withinRange(b,a.from)||c.withinRange(b,a.to)},c.prototype.now=function(a,b){var c,d=this.item.interval,f=new Date,g=f.getHours()*e+f.getMinutes(),i=h.isInteger(b);return g-=g%d,c=0>b&&-d>=d*b+g,g+="min"==a&&c?0:d,i&&(g+=d*(c&&"max"!=a?b+1:b)),g},c.prototype.normalize=function(a,b){var c=this.item.interval,d=this.item.min&&this.item.min.pick||0;return b-="min"==a?0:(b-d)%c},c.prototype.measure=function(a,c,f){var g=this;return c?c===!0||h.isInteger(c)?c=g.now(a,c,f):b.isPlainObject(c)&&h.isInteger(c.pick)&&(c=g.normalize(a,c.pick,f)):c="min"==a?[0,0]:[d-1,e-1],c},c.prototype.validate=function(a,b,c){var d=this,e=c&&c.interval?c.interval:d.item.interval;return d.disabled(b)&&(b=d.shift(b,e)),b=d.scope(b),d.disabled(b)&&(b=d.shift(b,-1*e)),b},c.prototype.disabled=function(a){var c=this,d=c.item.disable.filter(function(d){return h.isInteger(d)?a.hour==d:b.isArray(d)||h.isDate(d)?a.pick==c.create(d).pick:b.isPlainObject(d)?c.withinRange(d,a):void 0});return d=d.length&&!d.filter(function(a){return b.isArray(a)&&"inverted"==a[2]||b.isPlainObject(a)&&a.inverted}).length,-1===c.item.enable?!d:d||a.pick<c.item.min.pick||a.pick>c.item.max.pick},c.prototype.shift=function(a,b){var c=this,d=c.item.min.pick,e=c.item.max.pick;for(b=b||c.item.interval;c.disabled(a)&&(a=c.create(a.pick+=b),!(a.pick<=d||a.pick>=e)););return a},c.prototype.scope=function(a){var b=this.item.min.pick,c=this.item.max.pick;return this.create(a.pick>c?c:a.pick<b?b:a)},c.prototype.parse=function(a,c,d){var f,g,i,j,k,l=this,m={};if(!c||h.isInteger(c)||b.isArray(c)||h.isDate(c)||b.isPlainObject(c)&&h.isInteger(c.pick))return c;d&&d.format||(d=d||{},d.format=l.settings.format),l.formats.toArray(d.format).map(function(a){var b,d=l.formats[a],e=d?h.trigger(d,l,[c,m]):a.replace(/^!/,"").length;d&&(b=c.substr(0,e),m[a]=b.match(/^\d+$/)?+b:b),c=c.substr(e)});for(j in m)k=m[j],h.isInteger(k)?j.match(/^(h|hh)$/i)?(f=k,("h"==j||"hh"==j)&&(f%=12)):"i"==j&&(g=k):j.match(/^a$/i)&&k.match(/^p/i)&&("h"in m||"hh"in m)&&(i=!0);return(i?f+12:f)*e+g},c.prototype.formats={h:function(a,b){return a?h.digits(a):b.hour%f||f},hh:function(a,b){return a?2:h.lead(b.hour%f||f)},H:function(a,b){return a?h.digits(a):""+b.hour%24},HH:function(a,b){return a?h.digits(a):h.lead(b.hour%24)},i:function(a,b){return a?2:h.lead(b.mins)},a:function(a,b){return a?4:g/2>b.time%g?"a.m.":"p.m."},A:function(a,b){return a?2:g/2>b.time%g?"AM":"PM"},toArray:function(a){return a.split(/(h{1,2}|H{1,2}|i|a|A|!.)/g)},toString:function(a,b){var c=this;return c.formats.toArray(a).map(function(a){return h.trigger(c.formats[a],c,[0,b])||a.replace(/^!/,"")}).join("")}},c.prototype.isTimeExact=function(a,c){var d=this;return h.isInteger(a)&&h.isInteger(c)||"boolean"==typeof a&&"boolean"==typeof c?a===c:(h.isDate(a)||b.isArray(a))&&(h.isDate(c)||b.isArray(c))?d.create(a).pick===d.create(c).pick:b.isPlainObject(a)&&b.isPlainObject(c)?d.isTimeExact(a.from,c.from)&&d.isTimeExact(a.to,c.to):!1},c.prototype.isTimeOverlap=function(a,c){var d=this;return h.isInteger(a)&&(h.isDate(c)||b.isArray(c))?a===d.create(c).hour:h.isInteger(c)&&(h.isDate(a)||b.isArray(a))?c===d.create(a).hour:b.isPlainObject(a)&&b.isPlainObject(c)?d.overlapRanges(a,c):!1},c.prototype.flipEnable=function(a){var b=this.item;b.enable=a||(-1==b.enable?1:-1)},c.prototype.deactivate=function(a,c){var d=this,e=d.item.disable.slice(0);return"flip"==c?d.flipEnable():c===!1?(d.flipEnable(1),e=[]):c===!0?(d.flipEnable(-1),e=[]):c.map(function(a){for(var c,f=0;f<e.length;f+=1)if(d.isTimeExact(a,e[f])){c=!0;break}c||(h.isInteger(a)||h.isDate(a)||b.isArray(a)||b.isPlainObject(a)&&a.from&&a.to)&&e.push(a)}),e},c.prototype.activate=function(a,c){var d=this,e=d.item.disable,f=e.length;return"flip"==c?d.flipEnable():c===!0?(d.flipEnable(1),e=[]):c===!1?(d.flipEnable(-1),e=[]):c.map(function(a){var c,g,i,j;for(i=0;f>i;i+=1){if(g=e[i],d.isTimeExact(g,a)){c=e[i]=null,j=!0;break}if(d.isTimeOverlap(g,a)){b.isPlainObject(a)?(a.inverted=!0,c=a):b.isArray(a)?(c=a,c[2]||c.push("inverted")):h.isDate(a)&&(c=[a.getFullYear(),a.getMonth(),a.getDate(),"inverted"]);break}}if(c)for(i=0;f>i;i+=1)if(d.isTimeExact(e[i],a)){e[i]=null;break}if(j)for(i=0;f>i;i+=1)if(d.isTimeOverlap(e[i],a)){e[i]=null;break}c&&e.push(c)}),e.filter(function(a){return null!=a})},c.prototype.i=function(a,b){return h.isInteger(b)&&b>0?b:this.item.interval},c.prototype.nodes=function(a){var b=this,c=b.settings,d=b.item.select,e=b.item.highlight,f=b.item.view,g=b.item.disable;return h.node("ul",h.group({min:b.item.min.pick,max:b.item.max.pick,i:b.item.interval,node:"li",item:function(a){a=b.create(a);var i=a.pick,j=d&&d.pick==i,k=e&&e.pick==i,l=g&&b.disabled(a);return[h.trigger(b.formats.toString,b,[h.trigger(c.formatLabel,b,[a])||c.format,a]),function(a){return j&&a.push(c.klass.selected),k&&a.push(c.klass.highlighted),f&&f.pick==i&&a.push(c.klass.viewset),l&&a.push(c.klass.disabled),a.join(" ")}([c.klass.listItem]),"data-pick="+a.pick+" "+h.ariaAttr({role:"button",controls:b.$node[0].id,checked:j&&b.$node.val()===h.trigger(b.formats.toString,b,[c.format,a])?!0:null,activedescendant:k?!0:null,disabled:l?!0:null})]}})+h.node("li",h.node("button",c.clear,c.klass.buttonClear,"type=button data-clear=1"+(a?"":" disable"))),c.klass.list)},c.defaults=function(a){return{clear:"Clear",format:"h:i A",interval:30,klass:{picker:a+" "+a+"--time",holder:a+"__holder",list:a+"__list",listItem:a+"__list-item",disabled:a+"__list-item--disabled",selected:a+"__list-item--selected",highlighted:a+"__list-item--highlighted",viewset:a+"__list-item--viewset",now:a+"__list-item--now",buttonClear:a+"__button--clear"}}}(a.klasses().picker),a.extend("pickatime",c)});
js/pickadate/themes/classic.css ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ .picker{font-size:16px;text-align:left;line-height:1.2;color:#000;position:absolute;z-index:10000;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.picker__input{cursor:default}.picker__input.picker__input--active{border-color:#0089ec}.picker__holder{width:100%;overflow-y:auto;-webkit-overflow-scrolling:touch}/*!
2
+ * Classic picker styling for pickadate.js
3
+ * Demo: http://amsul.github.io/pickadate.js
4
+ */.picker{width:100%}.picker__holder{position:absolute;background:#fff;border:1px solid #aaa;border-top-width:0;border-bottom-width:0;-webkit-border-radius:0 0 5px 5px;-moz-border-radius:0 0 5px 5px;border-radius:0 0 5px 5px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;min-width:176px;max-width:466px;max-height:0;-ms-filter:"alpha(Opacity=0)";filter:alpha(opacity=0);-moz-opacity:0;opacity:0;-webkit-transform:translateY(-1em) perspective(600px) rotateX(10deg);-moz-transform:translateY(-1em) perspective(600px) rotateX(10deg);transform:translateY(-1em) perspective(600px) rotateX(10deg);-webkit-transition:all .15s ease-out,max-height 0 .15s,border-width 0 .15s;-moz-transition:all .15s ease-out,max-height 0 .15s,border-width 0 .15s;transition:all .15s ease-out,max-height 0 .15s,border-width 0 .15s}.picker__frame{padding:1px}.picker__wrap{margin:-1px}.picker--opened .picker__holder{max-height:25em;-ms-filter:"alpha(Opacity=100)";filter:alpha(opacity=100);-moz-opacity:1;opacity:1;border-top-width:1px;border-bottom-width:1px;-webkit-transform:translateY(0) perspective(600px) rotateX(0);-moz-transform:translateY(0) perspective(600px) rotateX(0);transform:translateY(0) perspective(600px) rotateX(0);-webkit-transition:all .15s ease-out,max-height 0,border-width 0;-moz-transition:all .15s ease-out,max-height 0,border-width 0;transition:all .15s ease-out,max-height 0,border-width 0;-webkit-box-shadow:0 6px 18px 1px rgba(0,0,0,.12);-moz-box-shadow:0 6px 18px 1px rgba(0,0,0,.12);box-shadow:0 6px 18px 1px rgba(0,0,0,.12)}
js/pickadate/themes/classic.date.css ADDED
@@ -0,0 +1 @@
 
1
+ .picker__box{padding:0 1em}.picker__header{text-align:center;position:relative;margin-top:.75em}.picker__month,.picker__year{font-weight:500;display:inline-block;margin-left:.25em;margin-right:.25em}.picker__year{color:#999;font-size:.8em;font-style:italic}.picker__select--month,.picker__select--year{border:1px solid #b7b7b7;height:2.5em;padding:.5em .25em;margin-left:.25em;margin-right:.25em;font-size:.6em}@media (min-width:24.5em){.picker__select--month,.picker__select--year{font-size:.8em;margin-top:-.5em}}.picker__select--month{width:35%}.picker__select--year{width:22.5%}.picker__select--month:focus,.picker__select--year:focus{border-color:#0089ec}.picker__nav--next,.picker__nav--prev{position:absolute;padding:.5em 1.25em;width:1em;height:1em;top:-.25em}@media (min-width:24.5em){.picker__nav--next,.picker__nav--prev{top:-.33em}}.picker__nav--prev{left:-1em;padding-right:1.25em}@media (min-width:24.5em){.picker__nav--prev{padding-right:1.5em}}.picker__nav--next{right:-1em;padding-left:1.25em}@media (min-width:24.5em){.picker__nav--next{padding-left:1.5em}}.picker__nav--next:before,.picker__nav--prev:before{content:" ";border-top:.5em solid transparent;border-bottom:.5em solid transparent;border-right:.75em solid #000;width:0;height:0;display:block;margin:0 auto}.picker__nav--next:before{border-right:0;border-left:.75em solid #000}.picker__nav--next:hover,.picker__nav--prev:hover{cursor:pointer;color:#000;background:#b1dcfb}.picker__nav--disabled,.picker__nav--disabled:before,.picker__nav--disabled:before:hover,.picker__nav--disabled:hover{cursor:default;background:0 0;border-right-color:#f5f5f5;border-left-color:#f5f5f5}.picker__table{text-align:center;border-collapse:collapse;border-spacing:0;table-layout:fixed;font-size:inherit;width:100%;margin-top:.75em;margin-bottom:.5em}@media (min-height:33.875em){.picker__table{margin-bottom:.75em}}.picker__table td{margin:0;padding:0}.picker__weekday{width:14.285714286%;font-size:.75em;padding-bottom:.25em;color:#999;font-weight:500}@media (min-height:33.875em){.picker__weekday{padding-bottom:.5em}}.picker__day{padding:.3125em 0;font-weight:200;border:1px solid transparent}.picker__day--today{color:#0089ec;position:relative}.picker__day--today:before{content:" ";position:absolute;top:2px;right:2px;width:0;height:0;border-top:.5em solid #0059bc;border-left:.5em solid transparent}.picker__day--selected,.picker__day--selected:hover{border-color:#0089ec}.picker__day--highlighted{background:#b1dcfb}.picker__day--disabled:before{border-top-color:#aaa}.picker__day--outfocus{color:#ddd}.picker__day--infocus:hover,.picker__day--outfocus:hover{cursor:pointer;color:#000;background:#b1dcfb}.picker--focused .picker__day--highlighted,.picker__day--highlighted:hover{background:#0089ec;color:#fff}.picker__day--disabled,.picker__day--disabled:hover{background:#f5f5f5;border-color:#f5f5f5;color:#ddd;cursor:default}.picker__day--highlighted.picker__day--disabled,.picker__day--highlighted.picker__day--disabled:hover{background:#bbb}.picker__footer{text-align:center}.picker__button--clear,.picker__button--today{border:1px solid #fff;background:#fff;font-size:.8em;padding:.66em 0;font-weight:700;width:50%;display:inline-block;vertical-align:bottom}.picker__button--clear:hover,.picker__button--today:hover{cursor:pointer;color:#000;background:#b1dcfb;border-bottom-color:#b1dcfb}.picker__button--clear:focus,.picker__button--today:focus{background:#b1dcfb;border-color:#0089ec;outline:0}.picker__button--clear:before,.picker__button--today:before{position:relative;display:inline-block;height:0}.picker__button--today:before{content:" ";margin-right:.45em;top:-.05em;width:0;border-top:.66em solid #0059bc;border-left:.66em solid transparent}.picker__button--clear:before{content:"\D7";margin-right:.35em;top:-.1em;color:#e20;vertical-align:top;font-size:1.1em}
js/pickadate/themes/classic.time.css ADDED
@@ -0,0 +1 @@
 
1
+ .picker__list{list-style:none;padding:.75em 0 4.2em;margin:0}.picker__list-item{border-bottom:1px solid #ddd;border-top:1px solid #ddd;margin-bottom:-1px;position:relative;background:#fff;padding:.75em 1.25em}@media (min-height:46.75em){.picker__list-item{padding:.5em 1em}}.picker__list-item:hover{cursor:pointer;color:#000;background:#b1dcfb;border-color:#0089ec;z-index:10}.picker__list-item--selected,.picker__list-item--selected:hover{border-color:#0089ec;z-index:10}.picker__list-item--highlighted{background:#b1dcfb}.picker--focused .picker__list-item--highlighted,.picker__list-item--highlighted:hover{background:#0089ec;color:#fff}.picker--focused .picker__list-item--disabled,.picker__list-item--disabled,.picker__list-item--disabled:hover{background:#f5f5f5;color:#ddd;cursor:default;border-color:#ddd;z-index:auto}.picker--time .picker__button--clear{display:block;width:80%;margin:1em auto 0;padding:1em 1.25em;background:0 0;border:0;font-weight:500;font-size:.67em;text-align:center;text-transform:uppercase;color:#666}.picker--time .picker__button--clear:focus,.picker--time .picker__button--clear:hover{background:#b1dcfb;background:#e20;border-color:#e20;cursor:pointer;color:#fff;outline:0}.picker--time .picker__button--clear:before{top:-.25em;color:#666;font-size:1.25em;font-weight:700}.picker--time .picker__button--clear:focus:before,.picker--time .picker__button--clear:hover:before{color:#fff}.picker--time{min-width:256px;max-width:320px}.picker--time .picker__holder{background:#f2f2f2}@media (min-height:40.125em){.picker--time .picker__holder{font-size:.875em}}.picker--time .picker__box{padding:0;position:relative}
js/pickadate/themes/default.css ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ .picker{font-size:16px;text-align:left;line-height:1.2;color:#000;position:absolute;z-index:10000;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.picker__input{cursor:default}.picker__input.picker__input--active{border-color:#0089ec}.picker__holder{width:100%;overflow-y:auto;-webkit-overflow-scrolling:touch}/*!
2
+ * Default mobile-first, responsive styling for pickadate.js
3
+ * Demo: http://amsul.github.io/pickadate.js
4
+ */.picker__frame,.picker__holder{bottom:0;left:0;right:0;top:100%}.picker__holder{position:fixed;-webkit-transition:background .15s ease-out,top 0s .15s;-moz-transition:background .15s ease-out,top 0s .15s;transition:background .15s ease-out,top 0s .15s}.picker__frame{position:absolute;margin:0 auto;min-width:256px;max-width:666px;width:100%;-ms-filter:"alpha(Opacity=0)";filter:alpha(opacity=0);-moz-opacity:0;opacity:0;-webkit-transition:all .15s ease-out;-moz-transition:all .15s ease-out;transition:all .15s ease-out}@media (min-height:33.875em){.picker__frame{overflow:visible;top:auto;bottom:-100%;max-height:80%}}@media (min-height:40.125em){.picker__frame{margin-bottom:7.5%}}.picker__wrap{display:table;width:100%;height:100%}@media (min-height:33.875em){.picker__wrap{display:block}}.picker__box{background:#fff;display:table-cell;vertical-align:middle}@media (min-height:26.5em){.picker__box{font-size:1.25em}}@media (min-height:33.875em){.picker__box{display:block;font-size:1.33em;border:1px solid #777;border-top-color:#898989;border-bottom-width:0;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0;-webkit-box-shadow:0 12px 36px 16px rgba(0,0,0,.24);-moz-box-shadow:0 12px 36px 16px rgba(0,0,0,.24);box-shadow:0 12px 36px 16px rgba(0,0,0,.24)}}@media (min-height:40.125em){.picker__box{font-size:1.5em;border-bottom-width:1px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}}.picker--opened .picker__holder{top:0;zoom:1;background:rgba(0,0,0,.32);-webkit-transition:background .15s ease-out;-moz-transition:background .15s ease-out;transition:background .15s ease-out}.picker--opened .picker__frame{top:0;-ms-filter:"alpha(Opacity=100)";filter:alpha(opacity=100);-moz-opacity:1;opacity:1}@media (min-height:33.875em){.picker--opened .picker__frame{top:auto;bottom:0}}
js/pickadate/themes/default.date.css ADDED
@@ -0,0 +1 @@
 
1
+ .picker__box{padding:0 1em}.picker__header{text-align:center;position:relative;margin-top:.75em}.picker__month,.picker__year{font-weight:500;display:inline-block;margin-left:.25em;margin-right:.25em}.picker__year{color:#999;font-size:.8em;font-style:italic}.picker__select--month,.picker__select--year{border:1px solid #b7b7b7;height:2.5em;padding:.5em .25em;margin-left:.25em;margin-right:.25em;font-size:.6em}@media (min-width:24.5em){.picker__select--month,.picker__select--year{font-size:.8em;margin-top:-.5em}}.picker__select--month{width:35%}.picker__select--year{width:22.5%}.picker__select--month:focus,.picker__select--year:focus{border-color:#0089ec}.picker__nav--next,.picker__nav--prev{position:absolute;padding:.5em 1.25em;width:1em;height:1em;top:-.25em}@media (min-width:24.5em){.picker__nav--next,.picker__nav--prev{top:-.33em}}.picker__nav--prev{left:-1em;padding-right:1.25em}@media (min-width:24.5em){.picker__nav--prev{padding-right:1.5em}}.picker__nav--next{right:-1em;padding-left:1.25em}@media (min-width:24.5em){.picker__nav--next{padding-left:1.5em}}.picker__nav--next:before,.picker__nav--prev:before{content:" ";border-top:.5em solid transparent;border-bottom:.5em solid transparent;border-right:.75em solid #000;width:0;height:0;display:block;margin:0 auto}.picker__nav--next:before{border-right:0;border-left:.75em solid #000}.picker__nav--next:hover,.picker__nav--prev:hover{cursor:pointer;color:#000;background:#b1dcfb}.picker__nav--disabled,.picker__nav--disabled:before,.picker__nav--disabled:before:hover,.picker__nav--disabled:hover{cursor:default;background:0 0;border-right-color:#f5f5f5;border-left-color:#f5f5f5}.picker__table{text-align:center;border-collapse:collapse;border-spacing:0;table-layout:fixed;font-size:inherit;width:100%;margin-top:.75em;margin-bottom:.5em}@media (min-height:33.875em){.picker__table{margin-bottom:.75em}}.picker__table td{margin:0;padding:0}.picker__weekday{width:14.285714286%;font-size:.75em;padding-bottom:.25em;color:#999;font-weight:500}@media (min-height:33.875em){.picker__weekday{padding-bottom:.5em}}.picker__day{padding:.3125em 0;font-weight:200;border:1px solid transparent}.picker__day--today{color:#0089ec;position:relative}.picker__day--today:before{content:" ";position:absolute;top:2px;right:2px;width:0;height:0;border-top:.5em solid #0059bc;border-left:.5em solid transparent}.picker__day--selected,.picker__day--selected:hover{border-color:#0089ec}.picker__day--highlighted{background:#b1dcfb}.picker__day--disabled:before{border-top-color:#aaa}.picker__day--outfocus{color:#ddd}.picker__day--infocus:hover,.picker__day--outfocus:hover{cursor:pointer;color:#000;background:#b1dcfb}.picker--focused .picker__day--highlighted,.picker__day--highlighted:hover{background:#0089ec;color:#fff}.picker__day--disabled,.picker__day--disabled:hover{background:#f5f5f5;border-color:#f5f5f5;color:#ddd;cursor:default}.picker__day--highlighted.picker__day--disabled,.picker__day--highlighted.picker__day--disabled:hover{background:#bbb}.picker__footer{text-align:center}.picker__button--clear,.picker__button--today{border:1px solid #fff;background:#fff;font-size:.8em;padding:.66em 0;font-weight:700;width:50%;display:inline-block;vertical-align:bottom}.picker__button--clear:hover,.picker__button--today:hover{cursor:pointer;color:#000;background:#b1dcfb;border-bottom-color:#b1dcfb}.picker__button--clear:focus,.picker__button--today:focus{background:#b1dcfb;border-color:#0089ec;outline:0}.picker__button--clear:before,.picker__button--today:before{position:relative;display:inline-block;height:0}.picker__button--today:before{content:" ";margin-right:.45em;top:-.05em;width:0;border-top:.66em solid #0059bc;border-left:.66em solid transparent}.picker__button--clear:before{content:"\D7";margin-right:.35em;top:-.1em;color:#e20;vertical-align:top;font-size:1.1em}
js/pickadate/themes/default.time.css ADDED
@@ -0,0 +1 @@
 
1
+ .picker__list{list-style:none;padding:.75em 0 4.2em;margin:0}.picker__list-item{border-bottom:1px solid #ddd;border-top:1px solid #ddd;margin-bottom:-1px;position:relative;background:#fff;padding:.75em 1.25em}@media (min-height:46.75em){.picker__list-item{padding:.5em 1em}}.picker__list-item:hover{cursor:pointer;color:#000;background:#b1dcfb;border-color:#0089ec;z-index:10}.picker__list-item--selected,.picker__list-item--selected:hover{border-color:#0089ec;z-index:10}.picker__list-item--highlighted{background:#b1dcfb}.picker--focused .picker__list-item--highlighted,.picker__list-item--highlighted:hover{background:#0089ec;color:#fff}.picker--focused .picker__list-item--disabled,.picker__list-item--disabled,.picker__list-item--disabled:hover{background:#f5f5f5;color:#ddd;cursor:default;border-color:#ddd;z-index:auto}.picker--time .picker__button--clear{display:block;width:80%;margin:1em auto 0;padding:1em 1.25em;background:0 0;border:0;font-weight:500;font-size:.67em;text-align:center;text-transform:uppercase;color:#666}.picker--time .picker__button--clear:focus,.picker--time .picker__button--clear:hover{background:#b1dcfb;background:#e20;border-color:#e20;cursor:pointer;color:#fff;outline:0}.picker--time .picker__button--clear:before{top:-.25em;color:#666;font-size:1.25em;font-weight:700}.picker--time .picker__button--clear:focus:before,.picker--time .picker__button--clear:hover:before{color:#fff}.picker--time .picker__frame{min-width:256px;max-width:320px}.picker--time .picker__box{font-size:1em;background:#f2f2f2;padding:0}@media (min-height:40.125em){.picker--time .picker__box{margin-bottom:5em}}
js/pickadate/themes/rtl.css ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*!
2
+ * Styling for RTL (right-to-left) languages using pickadate.js
3
+ */.picker{direction:rtl}.picker__nav--next{right:auto;left:-1em}.picker__nav--prev{left:auto;right:-1em}.picker__nav--next:before{border-left:0;border-right:.75em solid #000}.picker__nav--prev:before{border-right:0;border-left:.75em solid #000}
js/pickadate/translations/ar.js ADDED
@@ -0,0 +1 @@
 
1
+ $.extend($.fn.pickadate.defaults,{monthsFull:["يناير","فبراير","مارس","ابريل","مايو","يونيو","يوليو","اغسطس","سبتمبر","اكتوبر","نوفمبر","ديسمبر"],monthsShort:["يناير","فبراير","مارس","ابريل","مايو","يونيو","يوليو","اغسطس","سبتمبر","اكتوبر","نوفمبر","ديسمبر"],weekdaysFull:["الاحد","الاثنين","الثلاثاء","الاربعاء","الخميس","الجمعة","السبت"],weekdaysShort:["الاحد","الاثنين","الثلاثاء","الاربعاء","الخميس","الجمعة","السبت"],today:"اليوم",clear:"مسح",format:"yyyy mmmm dd",formatSubmit:"yyyy/mm/dd"});
js/pickadate/translations/bg_BG.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["януари","февруари","март","април","май","юни","юли","август","септември","октомври","ноември","декември"],monthsShort:["янр","фев","мар","апр","май","юни","юли","авг","сеп","окт","ное","дек"],weekdaysFull:["неделя","понеделник","вторник","сряда","четвъртък","петък","събота"],weekdaysShort:["нд","пн","вт","ср","чт","пт","сб"],today:"днес",clear:"изтривам",firstDay:1,format:"d mmmm yyyy г.",formatSubmit:"yyyy/mm/dd"});
js/pickadate/translations/bs_BA.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["januar","februar","mart","april","maj","juni","juli","august","septembar","oktobar","novembar","decembar"],monthsShort:["jan","feb","mar","apr","maj","jun","jul","aug","sep","okt","nov","dec"],weekdaysFull:["nedjelja","ponedjeljak","utorak","srijeda","cetvrtak","petak","subota"],weekdaysShort:["ne","po","ut","sr","če","pe","su"],today:"danas",clear:"izbrisati",firstDay:1,format:"dd. mmmm yyyy.",formatSubmit:"yyyy/mm/dd"});
js/pickadate/translations/ca_ES.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["Gener","Febrer","Març","Abril","Maig","juny","Juliol","Agost","Setembre","Octubre","Novembre","Desembre"],monthsShort:["Gen","Feb","Mar","Abr","Mai","Jun","Jul","Ago","Set","Oct","Nov","Des"],weekdaysFull:["diumenge","dilluns","dimarts","dimecres","dijous","divendres","dissabte"],weekdaysShort:["diu","dil","dim","dmc","dij","div","dis"],today:"avui",clear:"esborrar",firstDay:1,format:"dddd d !de mmmm !de yyyy",formatSubmit:"yyyy/mm/dd"});
js/pickadate/translations/cs_CZ.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["leden","únor","březen","duben","květen","červen","červenec","srpen","září","říjen","listopad","prosinec"],monthsShort:["led","úno","bře","dub","kvě","čer","čvc","srp","zář","říj","lis","pro"],weekdaysFull:["neděle","pondělí","úterý","středa","čtvrtek","pátek","sobota"],weekdaysShort:["ne","po","út","st","čt","pá","so"],today:"dnes",clear:"vymazat",firstDay:1,format:"d. mmmm yyyy",formatSubmit:"yyyy/mm/dd"});
js/pickadate/translations/da_DK.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["januar","februar","marts","april","maj","juni","juli","august","september","oktober","november","december"],monthsShort:["jan","feb","mar","apr","maj","jun","jul","aug","sep","okt","nov","dec"],weekdaysFull:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],weekdaysShort:["søn","man","tir","ons","tor","fre","lør"],today:"i dag",clear:"slet",firstDay:1,format:"d. mmmm yyyy",formatSubmit:"yyyy/mm/dd"});
js/pickadate/translations/de_DE.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthsShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],weekdaysFull:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],weekdaysShort:["So","Mo","Di","Mi","Do","Fr","Sa"],today:"Heute",clear:"Löschen",firstDay:1,format:"dddd, dd. mmmm yyyy",formatSubmit:"yyyy/mm/dd"});
js/pickadate/translations/el_GR.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["Ιανουάριος","Φεβρουάριος","Μάρτιος","Απρίλιος","Μάιος","Ιούνιος","Ιούλιος","Αύγουστος","Σεπτέμβριος","Οκτώβριος","Νοέμβριος","Δεκέμβριος"],monthsShort:["Ιαν","Φεβ","Μαρ","Απρ","Μαι","Ιουν","Ιουλ","Αυγ","Σεπ","Οκτ","Νοε","Δεκ"],weekdaysFull:["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Σάββατο"],weekdaysShort:["Κυρ","Δευ","Τρι","Τετ","Πεμ","Παρ","Σαβ"],today:"σήμερα",clear:"Διαγραφή",firstDay:1,format:"d mmmm yyyy",formatSubmit:"yyyy/mm/dd"});
js/pickadate/translations/es_ES.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],monthsShort:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],weekdaysFull:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],weekdaysShort:["dom","lun","mar","mié","jue","vie","sáb"],today:"hoy",clear:"borrar",firstDay:1,format:"dddd d !de mmmm !de yyyy",formatSubmit:"yyyy/mm/dd"});
js/pickadate/translations/et_EE.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["jaanuar","veebruar","märts","aprill","mai","juuni","juuli","august","september","oktoober","november","detsember"],monthsShort:["jaan","veebr","märts","apr","mai","juuni","juuli","aug","sept","okt","nov","dets"],weekdaysFull:["pühapäev","esmaspäev","teisipäev","kolmapäev","neljapäev","reede","laupäev"],weekdaysShort:["püh","esm","tei","kol","nel","ree","lau"],today:"täna",clear:"kustutama",firstDay:1,format:"d. mmmm yyyy. a",formatSubmit:"yyyy/mm/dd"});
js/pickadate/translations/eu_ES.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["urtarrila","otsaila","martxoa","apirila","maiatza","ekaina","uztaila","abuztua","iraila","urria","azaroa","abendua"],monthsShort:["urt","ots","mar","api","mai","eka","uzt","abu","ira","urr","aza","abe"],weekdaysFull:["igandea","astelehena","asteartea","asteazkena","osteguna","ostirala","larunbata"],weekdaysShort:["ig.","al.","ar.","az.","og.","or.","lr."],today:"gaur",clear:"garbitu",firstDay:1,format:"dddd, yyyy(e)ko mmmmren da",formatSubmit:"yyyy/mm/dd"});
js/pickadate/translations/fi_FI.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["tammikuu","helmikuu","maaliskuu","huhtikuu","toukokuu","kesäkuu","heinäkuu","elokuu","syyskuu","lokakuu","marraskuu","joulukuu"],monthsShort:["tammi","helmi","maalis","huhti","touko","kesä","heinä","elo","syys","loka","marras","joulu"],weekdaysFull:["sunnuntai","maanantai","tiistai","keskiviikko","torstai","perjantai","lauantai"],weekdaysShort:["su","ma","ti","ke","to","pe","la"],today:"tänään",clear:"tyhjennä",firstDay:1,format:"d.m.yyyy",formatSubmit:"yyyy/mm/dd"});
js/pickadate/translations/fr_FR.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],monthsShort:["Jan","Fev","Mar","Avr","Mai","Juin","Juil","Aou","Sep","Oct","Nov","Dec"],weekdaysFull:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],weekdaysShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],today:"Aujourd'hui",clear:"Effacer",firstDay:1,format:"dd mmmm yyyy",formatSubmit:"yyyy/mm/dd"});
js/pickadate/translations/gl_ES.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["Xaneiro","Febreiro","Marzo","Abril","Maio","Xuño","Xullo","Agosto","Setembro","Outubro","Novembro","Decembro"],monthsShort:["xan","feb","mar","abr","mai","xun","xul","ago","sep","out","nov","dec"],weekdaysFull:["domingo","luns","martes","mércores","xoves","venres","sábado"],weekdaysShort:["dom","lun","mar","mér","xov","ven","sab"],today:"hoxe",clear:"borrar",firstDay:1,format:"dddd d !de mmmm !de yyyy",formatSubmit:"yyyy/mm/dd"});
js/pickadate/translations/he_IL.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["ינואר","פברואר","מרץ","אפריל","מאי","יוני","יולי","אוגוסט","ספטמבר","אוקטובר","נובמבר","דצמבר"],monthsShort:["ינו","פבר","מרץ","אפר","מאי","יונ","יול","אוג","ספט","אוק","נוב","דצמ"],weekdaysFull:["יום ראשון","יום שני","יום שלישי","יום רביעי","יום חמישי","יום ששי","יום שבת"],weekdaysShort:["א","ב","ג","ד","ה","ו","ש"],today:"היום",clear:"למחוק",format:"yyyy mmmmב d dddd",formatSubmit:"yyyy/mm/dd"});
js/pickadate/translations/hr_HR.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["sijećanj","veljača","ožujak","travanj","svibanj","lipanj","srpanj","kolovoz","rujan","listopad","studeni","prosinac"],monthsShort:["sij","velj","ožu","tra","svi","lip","srp","kol","ruj","lis","stu","pro"],weekdaysFull:["nedjelja","ponedjeljak","utorak","srijeda","četvrtak","petak","subota"],weekdaysShort:["ned","pon","uto","sri","čet","pet","sub"],today:"danas",clear:"izbrisati",firstDay:1,format:"d. mmmm yyyy.",formatSubmit:"yyyy/mm/dd"});
js/pickadate/translations/hu_HU.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["január","február","március","aprilis","május","június","július","augusztus","szeptember","október","november","december"],monthsShort:["jan","febr","márc","apr","máj","jún","júl","aug","szept","okt","nov","dec"],weekdaysFull:["vasámap","hétfö","kedd","szerda","csütörtök","péntek","szombat"],weekdaysShort:["V","H","K","SZ","CS","P","SZ"],today:"ma",clear:"töröl",firstDay:1,format:"yyyy. mmmm dd.",formatSubmit:"yyyy/mm/dd"});
js/pickadate/translations/id_ID.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agu","Sep","Okt","Nov","Des"],weekdaysFull:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"],weekdaysShort:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],today:"hari ini",clear:"menghapus",firstDay:1,format:"d mmmm yyyy",formatSubmit:"yyyy/mm/dd"});
js/pickadate/translations/is_IS.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["janúar","febrúar","mars","apríl","maí","júní","júlí","ágúst","september","október","nóvember","desember"],monthsShort:["jan","feb","mar","apr","maí","jún","júl","ágú","sep","okt","nóv","des"],weekdaysFull:["sunnudagur","mánudagur","þriðjudagur","miðvikudagur","fimmtudagur","föstudagur","laugardagur"],weekdaysShort:["sun","mán","þri","mið","fim","fös","lau"],today:"Í dag",clear:"Hreinsa",firstDay:1,format:"dd. mmmm yyyy",formatSubmit:"yyyy/mm/dd"});
js/pickadate/translations/it_IT.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],monthsShort:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],weekdaysFull:["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"],weekdaysShort:["dom","lun","mar","mer","gio","ven","sab"],today:"oggi",clear:"cancellare",firstDay:1,format:"dddd d mmmm yyyy",formatSubmit:"yyyy/mm/dd"});
js/pickadate/translations/ja_JP.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],monthsShort:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],weekdaysFull:["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"],weekdaysShort:["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"],today:"今日",clear:"消去",firstDay:1,format:"yyyy mm dd",formatSubmit:"yyyy/mm/dd"});
js/pickadate/translations/ko_KR.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],monthsShort:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],weekdaysFull:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],weekdaysShort:["일","월","화","수","목","금","토"],today:"오늘",clear:"취소",firstDay:1,format:"yyyy 년 mm 월 dd 일",formatSubmit:"yyyy/mm/dd"});
js/pickadate/translations/nl_NL.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],monthsShort:["jan","feb","maa","apr","mei","jun","jul","aug","sep","okt","nov","dec"],weekdaysFull:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],weekdaysShort:["zo","ma","di","wo","do","vr","za"],today:"vandaag",clear:"verwijderen",firstDay:1,format:"dddd d mmmm yyyy",formatSubmit:"yyyy/mm/dd"});
js/pickadate/translations/no_NO.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember"],monthsShort:["jan","feb","mar","apr","mai","jun","jul","aug","sep","okt","nov","des"],weekdaysFull:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],weekdaysShort:["søn","man","tir","ons","tor","fre","lør"],today:"i dag",clear:"nullstill",firstDay:1,format:"dd. mmm. yyyy",formatSubmit:"yyyy/mm/dd"});
js/pickadate/translations/pl_PL.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["styczeń","luty","marzec","kwiecień","maj","czerwiec","lipiec","sierpień","wrzesień","październik","listopad","grudzień"],monthsShort:["sty","lut","mar","kwi","maj","cze","lip","sie","wrz","paź","lis","gru"],weekdaysFull:["niedziela","poniedziałek","wtorek","środa","czwartek","piątek","sobota"],weekdaysShort:["N","Pn","Wt","Śr","Cz","Pt","So"],today:"dzisiaj",clear:"usunąć",firstDay:1,format:"d mmmm yyyy",formatSubmit:"yyyy/mm/dd"});
js/pickadate/translations/pt_BR.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],monthsShort:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],weekdaysFull:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"],weekdaysShort:["dom","seg","ter","qua","qui","sex","sab"],today:"hoje",clear:"excluir",format:"dddd, d !de mmmm !de yyyy",formatSubmit:"yyyy/mm/dd"});
js/pickadate/translations/pt_PT.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],monthsShort:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],weekdaysFull:["domingo","segunda","terça","quarta","quinta","sexta","sábado"],weekdaysShort:["dom","seg","ter","qua","qui","sex","sab"],today:"hoje",clear:"excluir",format:"d !de mmmm !de yyyy",formatSubmit:"yyyy/mm/dd"});
js/pickadate/translations/ro_RO.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["ianuarie","februarie","martie","aprilie","mai","iunie","iulie","august","septembrie","octombrie","noiembrie","decembrie"],monthsShort:["ian","feb","mar","apr","mai","iun","iul","aug","sep","oct","noi","dec"],weekdaysFull:["duminică","luni","marţi","miercuri","joi","vineri","sâmbătă"],weekdaysShort:["D","L","Ma","Mi","J","V","S"],today:"azi",clear:"șterge",firstDay:1,format:"dd mmmm yyyy",formatSubmit:"yyyy/mm/dd"});
js/pickadate/translations/ru_RU.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["Января","Февраля","Марта","Апреля","Мая","Июня","Июля","Августа","Сентября","Октября","Ноября","Декабря"],monthsShort:["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],weekdaysFull:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"],weekdaysShort:["вс","пн","вт","ср","чт","пт","сб"],today:"сегодня",clear:"удалить",firstDay:1,format:"d mmmm yyyy г.",formatSubmit:"yyyy/mm/dd"});
js/pickadate/translations/sk_SK.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["január","február","marec","apríl","máj","jún","júl","august","september","október","november","december"],monthsShort:["I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII"],weekdaysFull:["nedeļľa","pondelok","utorok","streda","š̌švrtok","piatok","sobota"],weekdaysShort:["Ne","Po","Ut","St","Št","Pi","So"],today:"dnes",clear:"vymazať",firstDay:1,format:"d. mmmm yyyy",formatSubmit:"yyyy/mm/dd"});
js/pickadate/translations/sl_SI.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["januar","februar","marec","april","maj","junij","julij","avgust","september","oktober","november","december"],monthsShort:["jan","feb","mar","apr","maj","jun","jul","avg","sep","okt","nov","dec"],weekdaysFull:["nedelja","ponedeljek","torek","sreda","četrtek","petek","sobota"],weekdaysShort:["ned","pon","tor","sre","čet","pet","sob"],today:"danes",clear:"izbriši",firstDay:1,format:"d. mmmm yyyy",formatSubmit:"yyyy/mm/dd"});
js/pickadate/translations/sv_SE.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december"],monthsShort:["jan","feb","mar","apr","maj","jun","jul","aug","sep","okt","nov","dec"],weekdaysFull:["söndag","måndag","tisdag","onsdag","torsdag","fredag","lördag"],weekdaysShort:["sön","mån","tis","ons","tor","fre","lör"],today:"i dag",clear:"bort",firstDay:1,format:"d/m yyyy",formatSubmit:"yyyy/mm/dd"});
js/pickadate/translations/th_TH.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"],monthsShort:["ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค."],weekdaysFull:["อาทติย","จันทร","องัคาร","พุธ","พฤหสั บดี","ศกุร","เสาร"],weekdaysShort:["อ.","จ.","อ.","พ.","พฤ.","ศ.","ส."],today:"วันนี้",clear:"ลบ",format:"d mmmm yyyy",formatSubmit:"yyyy/mm/dd"});
js/pickadate/translations/tr_TR.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],monthsShort:["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"],weekdaysFull:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"],weekdaysShort:["Pzr","Pzt","Sal","Çrş","Prş","Cum","Cmt"],today:"bugün",clear:"sil",firstDay:1,format:"dd mmmm yyyy dddd",formatSubmit:"yyyy/mm/dd"});
js/pickadate/translations/uk_UA.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["січень","лютий","березень","квітень","травень","червень","липень","серпень","вересень","жовтень","листопад","грудень"],monthsShort:["січ","лют","бер","кві","тра","чер","лип","сер","вер","жов","лис","гру"],weekdaysFull:["неділя","понеділок","вівторок","середа","четвер","п‘ятниця","субота"],weekdaysShort:["нд","пн","вт","ср","чт","пт","сб"],today:"сьогодні",clear:"викреслити",firstDay:1,format:"dd mmmm yyyy p.",formatSubmit:"yyyy/mm/dd"});
js/pickadate/translations/zh_CN.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["一","二","三","四","五","六","七","八","九","十","十一","十二"],weekdaysFull:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],weekdaysShort:["日","一","二","三","四","五","六"],today:"今日",clear:"删",firstDay:1,format:"yyyy 年 mm 月 dd 日",formatSubmit:"yyyy/mm/dd"});
js/pickadate/translations/zh_TW.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["一","二","三","四","五","六","七","八","九","十","十一","十二"],weekdaysFull:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],weekdaysShort:["日","一","二","三","四","五","六"],today:"今天",clear:"清除",firstDay:1,format:"yyyy 年 mm 月 dd 日",formatSubmit:"yyyy/mm/dd"});
js/sortable.js ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function($){
2
+ $('#mc-sortable').sortable({
3
+ update: function( event, ui ) {
4
+ $('#mc-sortable-update').html('Submit form to save changes');
5
+ $('#mc-sortable-update').css( { 'padding':'6px', 'background-color':'#ffc', 'font-weight':'bold' } );
6
+ }
7
+ });
8
+ $('#mc-sortable .up').on( 'click', function(e) {
9
+ e.preventDefault();
10
+ $(this).parents('li').insertBefore( $(this).parents('li').prev() );
11
+ $(this).parents('li').css( { 'background':'#ffc' } );
12
+ });
13
+ $('#mc-sortable .down').on( 'click', function(e) {
14
+ e.preventDefault();
15
+ $(this).parents('li').insertAfter( $(this).parents('li').next() );
16
+ $(this).parents('li').css( { 'background':'#ffc' } );
17
+ });
18
+ });
js/tabs.js ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function($){
2
+ var tabs = $('.mc-tabs .wptab').length;
3
+ $('.mc-tabs .tabs a[href="#'+firstItem+'"]').addClass('active');
4
+ if ( tabs > 1 ) {
5
+ $('.mc-tabs .wptab').not('#'+firstItem).hide();
6
+ $('.mc-tabs .tabs a').on('click',function(e) {
7
+ e.preventDefault();
8
+ $('.mc-tabs .tabs a').removeClass('active');
9
+ $(this).addClass('active');
10
+ var target = $(this).attr('href');
11
+ $('.mc-tabs .wptab').not(target).hide();
12
+ $(target).show();
13
+ });
14
+ }
15
+ });
js/upload.js CHANGED
@@ -1,12 +1,53 @@
1
- jQuery(document).ready(function() {
2
- jQuery('#upload_image_button').click(function() {
3
- formfield = jQuery('#event_image').attr('name');
4
- tb_show('', 'media-upload.php?type=image&amp;TB_iframe=true');
5
- return false;
6
- });
7
- window.send_to_editor = function(html) {
8
- imgurl = jQuery('img',html).attr('src');
9
- jQuery('#event_image').val(imgurl);
10
- tb_remove();
11
- }
12
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var mediaPopup = '';
2
+ (function ($) {
3
+ "use strict";
4
+ $(function () {
5
+ /**
6
+ * Clears any existing Media Manager instances
7
+ *
8
+ * @author Gabe Shackle <gabe@hereswhatidid.com>
9
+ * @modified Joe Dolson <plugins@joedolson.com>
10
+ * @return void
11
+ */
12
+ function clear_existing() {
13
+ if ( typeof mediaPopup !== 'string' ) {
14
+ mediaPopup.detach();
15
+ mediaPopup = '';
16
+ }
17
+ }
18
+ $('.mc-image-upload')
19
+ .on( 'click', '.textfield-field', function(e) {
20
+ e.preventDefault();
21
+ var $self = $(this),
22
+ $inpField = $self.parent('.field-holder').find('#e_image'),
23
+ $idField = $self.parent('.field-holder').find('#e_image_id'),
24
+ $displayField = $self.parent('.field-holder').find('.event_image');
25
+ clear_existing();
26
+ mediaPopup = wp.media( {
27
+ multiple: false, // add, reset, false
28
+ title: 'Choose an Uploaded Document',
29
+ button: {
30
+ text: 'Select'
31
+ }
32
+ } );
33
+
34
+ mediaPopup.on( 'select', function() {
35
+ var selection = mediaPopup.state().get('selection'),
36
+ id = '',
37
+ img = '',
38
+ height = '',
39
+ width = '';
40
+ if( selection ) {
41
+ id = selection.first().attributes.id;
42
+ height = thumbHeight;
43
+ width = ( ( selection.first().attributes.width )/( selection.first().attributes.height ) )*thumbHeight;
44
+ img = "<img src='"+selection.first().attributes.url+"' width='"+width+"' height='"+height+"' />";
45
+ $inpField.val( selection.first().attributes.url );
46
+ $idField.val( id );
47
+ $displayField.html( img );
48
+ }
49
+ });
50
+ mediaPopup.open();
51
+ })
52
+ });
53
+ })(jQuery);
lang/my-calendar.pot CHANGED
@@ -1,322 +1,183 @@
1
- # Copyright (C) 2013 My Calendar
2
  # This file is distributed under the same license as the My Calendar package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: My Calendar 2.2.10\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/my-calendar\n"
7
- "POT-Creation-Date: 2013-09-30 21:00:54+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2013-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
- #: button/generator.php:12
16
- msgid "You don't have access to this function."
17
  msgstr ""
18
 
19
- #: button/generator.php:18 button/generator.php:44
20
- msgid "My Calendar Shortcode Generator"
21
- msgstr ""
22
-
23
- #: button/generator.php:46
24
- msgid ""
25
- "Navigational fields above and below the calendar: Feed links and print view "
26
- "will only display if they are enabled on your settings page. All other "
27
- "fields will appear if specified; the defaults specified in your settings "
28
- "will be used if the attribute is left blank. Use <code>none</code> to hide "
29
- "all navigation elements."
30
- msgstr ""
31
-
32
- #: button/generator.php:50
33
- msgid "Shortcode Attributes"
34
- msgstr ""
35
-
36
- #: button/generator.php:55
37
- msgid "Location filter type:"
38
- msgstr ""
39
-
40
- #: button/generator.php:57
41
- msgid "All locations"
42
- msgstr ""
43
-
44
- #: button/generator.php:58 my-calendar-settings.php:391
45
- #: my-calendar-settings.php:908
46
- msgid "Location Name"
47
- msgstr ""
48
-
49
- #: button/generator.php:59 my-calendar-event-manager.php:875
50
- #: my-calendar-group-manager.php:477 my-calendar-locations.php:152
51
- #: my-calendar-settings.php:909 my-calendar.php:271
52
- msgid "City"
53
- msgstr ""
54
-
55
- #: button/generator.php:60 my-calendar-event-manager.php:922
56
- #: my-calendar-group-manager.php:493 my-calendar-locations.php:197
57
- #: my-calendar.php:274
58
- msgid "State"
59
- msgstr ""
60
-
61
- #: button/generator.php:61 my-calendar-event-manager.php:891
62
- #: my-calendar-group-manager.php:480 my-calendar-locations.php:168
63
- #: my-calendar-settings.php:912 my-calendar.php:277
64
- msgid "Postal Code"
65
- msgstr ""
66
-
67
- #: button/generator.php:62 my-calendar-event-manager.php:907
68
- #: my-calendar-group-manager.php:484 my-calendar-locations.php:184
69
- #: my-calendar-settings.php:911
70
- msgid "Country"
71
- msgstr ""
72
-
73
- #: button/generator.php:63 my-calendar-event-manager.php:898
74
- #: my-calendar-event-manager.php:923 my-calendar-group-manager.php:481
75
- #: my-calendar-group-manager.php:494 my-calendar-locations.php:175
76
- #: my-calendar-locations.php:198 my-calendar-settings.php:913
77
- msgid "Region"
78
- msgstr ""
79
-
80
- #: button/generator.php:67
81
- msgid "Location filter value:"
82
- msgstr ""
83
-
84
- #: button/generator.php:71
85
- msgid "Format"
86
- msgstr ""
87
-
88
- #: button/generator.php:73
89
- msgid "Grid"
90
- msgstr ""
91
-
92
- #: button/generator.php:74
93
- msgid "List"
94
- msgstr ""
95
-
96
- #: button/generator.php:78 my-calendar-widgets.php:687
97
- msgid "Navigation above calendar"
98
- msgstr ""
99
-
100
- #: button/generator.php:80 button/generator.php:85
101
- msgid "Use \"none\" for no navigation."
102
- msgstr ""
103
-
104
- #: button/generator.php:83 my-calendar-widgets.php:691
105
- msgid "Navigation below calendar"
106
- msgstr ""
107
-
108
- #: button/generator.php:88
109
- msgid "Time Segment"
110
- msgstr ""
111
-
112
- #: button/generator.php:90 my-calendar-output.php:364
113
- #: my-calendar-output.php:479 my-calendar-output.php:486
114
- #: my-calendar-output.php:492 my-calendar-widgets.php:711
115
- msgid "Month"
116
- msgstr ""
117
-
118
- #: button/generator.php:91 my-calendar-output.php:480
119
- #: my-calendar-output.php:488 my-calendar-output.php:494
120
- #: my-calendar-widgets.php:712
121
- msgid "Week"
122
- msgstr ""
123
-
124
- #: button/generator.php:92 my-calendar-output.php:482
125
- #: my-calendar-output.php:489 my-calendar-output.php:496
126
- msgid "Day"
127
- msgstr ""
128
-
129
- #: button/generator.php:103 my-calendar-widgets.php:695
130
- msgid "Limit by Author"
131
- msgstr ""
132
-
133
- #: button/generator.php:105 my-calendar-widgets.php:697
134
- msgid "All authors"
135
- msgstr ""
136
-
137
- #: button/generator.php:110 my-calendar-widgets.php:702
138
- msgid "Limit by Host"
139
- msgstr ""
140
-
141
- #: button/generator.php:112 my-calendar-widgets.php:704
142
- msgid "All hosts"
143
- msgstr ""
144
-
145
- #: button/generator.php:118
146
- msgid "Generate Shortcode"
147
- msgstr ""
148
-
149
- #: button/generator.php:120
150
- msgid ""
151
- "<strong>Note:</strong> If you provide a location filter value, it must be an "
152
- "exact match for that information as saved with your events. (e.g. \"Saint "
153
- "Paul\" is not equivalent to \"saint paul\" or \"St. Paul\")"
154
- msgstr ""
155
-
156
- #: button/generator.php:130
157
- msgid ""
158
- "My Calendar: this generator isn't going to put the shortcode in your page. "
159
- "Sorry!"
160
- msgstr ""
161
-
162
- #: my-calendar-behaviors.php:45
163
  msgid "Behavior Settings saved"
164
  msgstr ""
165
 
166
- #: my-calendar-behaviors.php:68
167
  msgid "My Calendar Behaviors"
168
  msgstr ""
169
 
170
- #: my-calendar-behaviors.php:75
171
  msgid "Calendar Behavior Settings"
172
  msgstr ""
173
 
174
- #: my-calendar-behaviors.php:80
175
  msgid "Insert scripts on these pages (comma separated post IDs)"
176
  msgstr ""
177
 
178
- #: my-calendar-behaviors.php:83
179
- msgid "Calendar Behaviors: Calendar View"
180
  msgstr ""
181
 
182
- #: my-calendar-behaviors.php:85
183
- msgid "Update/Reset the My Calendar Calendar Javascript"
184
  msgstr ""
185
 
186
- #: my-calendar-behaviors.php:85
187
- msgid "Disable Calendar Javascript Effects"
188
  msgstr ""
189
 
190
- #: my-calendar-behaviors.php:88
191
- msgid "Edit the jQuery scripts for My Calendar in Calendar format"
192
  msgstr ""
193
 
194
- #: my-calendar-behaviors.php:95 my-calendar-behaviors.php:127
195
- #: my-calendar-behaviors.php:158 my-calendar-behaviors.php:190
196
  msgid "Comparing scripts with latest installed version of My Calendar"
197
  msgstr ""
198
 
199
- #: my-calendar-behaviors.php:95 my-calendar-behaviors.php:127
200
- #: my-calendar-behaviors.php:158 my-calendar-behaviors.php:190
201
- #: my-calendar-styles.php:223
202
  msgid "Latest (from plugin)"
203
  msgstr ""
204
 
205
- #: my-calendar-behaviors.php:95 my-calendar-behaviors.php:127
206
- #: my-calendar-behaviors.php:158 my-calendar-behaviors.php:190
207
- #: my-calendar-styles.php:223
208
  msgid "Current (in use)"
209
  msgstr ""
210
 
211
- #: my-calendar-behaviors.php:99
212
  msgid "There have been updates to the calendar view scripts."
213
  msgstr ""
214
 
215
- #: my-calendar-behaviors.php:99 my-calendar-behaviors.php:131
216
- #: my-calendar-behaviors.php:162 my-calendar-behaviors.php:194
217
  msgid "Compare your scripts with latest installed version of My Calendar."
218
  msgstr ""
219
 
220
- #: my-calendar-behaviors.php:103 my-calendar-behaviors.php:135
221
- #: my-calendar-behaviors.php:166 my-calendar-behaviors.php:198
222
  msgid "Your script matches that included with My Calendar."
223
  msgstr ""
224
 
225
- #: my-calendar-behaviors.php:108 my-calendar-behaviors.php:140
226
- #: my-calendar-behaviors.php:171 my-calendar-behaviors.php:205
227
  msgid "Save"
228
  msgstr ""
229
 
230
- #: my-calendar-behaviors.php:115
231
  msgid "Calendar Behaviors: List View"
232
  msgstr ""
233
 
234
- #: my-calendar-behaviors.php:117
235
- msgid "Update/Reset the My Calendar List Javascript"
236
  msgstr ""
237
 
238
- #: my-calendar-behaviors.php:117
239
- msgid "Disable List Javascript Effects"
240
  msgstr ""
241
 
242
- #: my-calendar-behaviors.php:120
243
  msgid "Edit the jQuery scripts for My Calendar in List format"
244
  msgstr ""
245
 
246
- #: my-calendar-behaviors.php:131
247
  msgid "There have been updates to the list view scripts."
248
  msgstr ""
249
 
250
- #: my-calendar-behaviors.php:146
251
  msgid "Calendar Behaviors: Mini Calendar View"
252
  msgstr ""
253
 
254
- #: my-calendar-behaviors.php:148
255
- msgid "Update/Reset the My Calendar Mini Format Javascript"
256
  msgstr ""
257
 
258
- #: my-calendar-behaviors.php:148
259
- msgid "Disable Mini Javascript Effects"
260
  msgstr ""
261
 
262
- #: my-calendar-behaviors.php:151
263
- msgid "Edit the jQuery scripts for My Calendar in Mini Calendar format"
264
  msgstr ""
265
 
266
- #: my-calendar-behaviors.php:162
267
  msgid "There have been updates to the mini view scripts."
268
  msgstr ""
269
 
270
- #: my-calendar-behaviors.php:178
271
- msgid "Calendar Behaviors: AJAX Navigation"
272
  msgstr ""
273
 
274
- #: my-calendar-behaviors.php:180
275
- msgid "Update/Reset the My Calendar AJAX Javascript"
276
  msgstr ""
277
 
278
- #: my-calendar-behaviors.php:180
279
- msgid "Disable AJAX Effects"
280
  msgstr ""
281
 
282
- #: my-calendar-behaviors.php:183
283
- msgid "Edit the jQuery scripts for My Calendar AJAX navigation"
284
  msgstr ""
285
 
286
- #: my-calendar-behaviors.php:194
287
  msgid "There have been updates to the AJAX scripts."
288
  msgstr ""
289
 
290
- #: my-calendar-behaviors.php:211
291
  msgid ""
292
  "Resetting JavaScript will set that script to the version currently "
293
  "distributed with the plug-in."
294
  msgstr ""
295
 
296
- #: my-calendar-categories.php:107 my-calendar-categories.php:147
297
  msgid "Default category changed."
298
  msgstr ""
299
 
300
- #: my-calendar-categories.php:110
301
  msgid "Category added successfully"
302
  msgstr ""
303
 
304
- #: my-calendar-categories.php:112
305
  msgid "Category addition failed."
306
  msgstr ""
307
 
308
- #: my-calendar-categories.php:127
309
  msgid "Category deleted successfully. Categories in calendar updated."
310
  msgstr ""
311
 
312
- #: my-calendar-categories.php:129
313
  msgid "Category deleted successfully. Categories in calendar not updated."
314
  msgstr ""
315
 
316
- #: my-calendar-categories.php:131
317
  msgid "Category not deleted. Categories in calendar updated."
318
  msgstr ""
319
 
 
 
 
 
320
  #: my-calendar-categories.php:152
321
  msgid "Category edited successfully."
322
  msgstr ""
@@ -326,7 +187,7 @@ msgid "Category was not edited."
326
  msgstr ""
327
 
328
  #: my-calendar-categories.php:188 my-calendar-categories.php:214
329
- #: my-calendar-categories.php:235
330
  msgid "Add Category"
331
  msgstr ""
332
 
@@ -338,273 +199,500 @@ msgstr ""
338
  msgid "Category Editor"
339
  msgstr ""
340
 
341
- #: my-calendar-categories.php:215 my-calendar-categories.php:277
342
  msgid "Category Name"
343
  msgstr ""
344
 
345
- #: my-calendar-categories.php:216
346
- msgid "Category Color (Hex format)"
347
  msgstr ""
348
 
349
- #: my-calendar-categories.php:217 my-calendar-categories.php:279
350
  msgid "Category Icon"
351
  msgstr ""
352
 
353
- #: my-calendar-categories.php:230
 
 
 
 
354
  msgid "Default category"
355
  msgstr ""
356
 
357
- #: my-calendar-categories.php:232
358
- msgid "Private category (logged-in users only)"
359
  msgstr ""
360
 
361
- #: my-calendar-categories.php:235 my-calendar-locations.php:215
362
- #: my-calendar-styles.php:212
363
  msgid "Save Changes"
364
  msgstr ""
365
 
366
- #: my-calendar-categories.php:243
367
  msgid "Add a New Category"
368
  msgstr ""
369
 
370
- #: my-calendar-categories.php:247
371
  msgid "Category List"
372
  msgstr ""
373
 
374
- #: my-calendar-categories.php:262 my-calendar.php:349
375
  msgid "Manage Categories"
376
  msgstr ""
377
 
378
- #: my-calendar-categories.php:276 my-calendar-event-manager.php:1112
379
- #: my-calendar-group-manager.php:749 my-calendar-locations.php:288
380
  msgid "ID"
381
  msgstr ""
382
 
383
- #: my-calendar-categories.php:278
384
  msgid "Category Color"
385
  msgstr ""
386
 
387
- #: my-calendar-categories.php:280
388
  msgid "Private"
389
  msgstr ""
390
 
391
- #: my-calendar-categories.php:281 my-calendar-categories.php:297
392
- #: my-calendar-event-manager.php:1152 my-calendar-locations.php:290
393
- #: my-calendar-locations.php:302 my-calendar-output.php:309
394
  msgid "Edit"
395
  msgstr ""
396
 
397
- #: my-calendar-categories.php:282 my-calendar-categories.php:302
398
- #: my-calendar-event-manager.php:35 my-calendar-event-manager.php:1155
399
- #: my-calendar-locations.php:291 my-calendar-locations.php:303
400
- #: my-calendar-output.php:310
401
  msgid "Delete"
402
  msgstr ""
403
 
404
- #: my-calendar-categories.php:296
 
 
 
 
 
 
 
 
405
  msgid "Yes"
406
  msgstr ""
407
 
408
- #: my-calendar-categories.php:296
409
  msgid "No"
410
  msgstr ""
411
 
412
- #: my-calendar-categories.php:300 my-calendar-group-manager.php:814
413
- #: my-calendar-output.php:189 my-calendar-settings.php:430
414
  msgid "N/A"
415
  msgstr ""
416
 
417
- #: my-calendar-categories.php:302 my-calendar-locations.php:303
418
  msgid "Are you sure you want to delete this category?"
419
  msgstr ""
420
 
421
- #: my-calendar-categories.php:312
422
  msgid "There are no categories in the database - or something has gone wrong!"
423
  msgstr ""
424
 
425
- #: my-calendar-core.php:57 my-calendar.php:356
426
  msgid "Settings"
427
  msgstr ""
428
 
429
- #: my-calendar-core.php:58 my-calendar.php:357
430
  msgid "Help"
431
  msgstr ""
432
 
433
- #: my-calendar-core.php:285
 
 
 
 
434
  msgid ""
435
  "<br /><strong>Note:</strong> Please review the <a class=\"thickbox\" href="
436
  "\"%1$s\">changelog</a> before upgrading."
437
  msgstr ""
438
 
439
- #: my-calendar-core.php:1120 my-calendar-event-manager.php:262
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
440
  msgid "Add Event"
441
  msgstr ""
442
 
443
- #: my-calendar-core.php:1176
 
 
 
 
 
 
 
 
 
 
 
 
 
 
444
  msgid "Event Notifications"
445
  msgstr ""
446
 
447
- #: my-calendar-core.php:1402
448
  msgid "Is this your calendar page?"
449
  msgstr ""
450
 
451
- #: my-calendar-core.php:1500
452
  msgid ""
453
  "Please read the FAQ and other Help documents before making a support request."
454
  msgstr ""
455
 
456
- #: my-calendar-core.php:1502
457
  msgid "Please describe your problem in detail. I'm not psychic."
458
  msgstr ""
459
 
460
- #: my-calendar-core.php:1507
461
  msgid ""
462
  "Thank you for supporting the continuing development of this plug-in! I'll "
463
  "get back to you as soon as I can."
464
  msgstr ""
465
 
466
- #: my-calendar-core.php:1509
467
  msgid ""
468
  "I'll get back to you as soon as I can, after dealing with any support "
469
  "requests from plug-in supporters."
470
  msgstr ""
471
 
472
- #: my-calendar-core.php:1519
 
 
 
 
473
  msgid ""
474
  "Please note: I do keep records of those who have donated, <strong>but if "
475
  "your donation came from somebody other than your account at this web site, "
476
  "please note this in your message.</strong>"
477
  msgstr ""
478
 
479
- #: my-calendar-core.php:1521
480
  msgid "From:"
481
  msgstr ""
482
 
483
- #: my-calendar-core.php:1524
484
  msgid ""
485
  "I have read <a href=\"http://www.joedolson.com/articles/my-calendar/faq/"
486
  "\">the FAQ for this plug-in</a>."
487
  msgstr ""
488
 
489
- #: my-calendar-core.php:1527
490
  msgid ""
491
  "I have <a href=\"http://www.joedolson.com/donate.php\">made a donation to "
492
  "help support this plug-in</a>."
493
  msgstr ""
494
 
495
- #: my-calendar-core.php:1530
496
  msgid ""
497
  "I have <a href=\"http://www.joedolson.com/articles/my-calendar/users-guide/"
498
  "\">purchased the User's Guide</a>, but could not find an answer to this "
499
  "question."
500
  msgstr ""
501
 
502
- #: my-calendar-core.php:1536
503
  msgid "Send Support Request"
504
  msgstr ""
505
 
506
- #: my-calendar-core.php:1539
507
  msgid ""
508
  "The following additional information will be sent with your support request:"
509
  msgstr ""
510
 
511
- #: my-calendar-core.php:1559 my-calendar-templates.php:174
512
  msgid "Does not recur"
513
  msgstr ""
514
 
515
- #: my-calendar-core.php:1560
516
  msgid "Days"
517
  msgstr ""
518
 
519
- #: my-calendar-core.php:1561
520
  msgid "Days, weekdays only"
521
  msgstr ""
522
 
523
- #: my-calendar-core.php:1562
524
  msgid "Weeks"
525
  msgstr ""
526
 
527
- #: my-calendar-core.php:1563
528
  msgid "Months by date (e.g., the 24th of each month)"
529
  msgstr ""
530
 
531
- #: my-calendar-core.php:1564
532
  msgid "Month by day (e.g., the 3rd Monday of each month)"
533
  msgstr ""
534
 
535
- #: my-calendar-core.php:1565 my-calendar-output.php:369
536
  msgid "Year"
537
  msgstr ""
538
 
539
- #: my-calendar-event-manager.php:24
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
540
  msgid "Delete Event"
541
  msgstr ""
542
 
543
- #: my-calendar-event-manager.php:24
544
  msgid "Are you sure you want to delete this event?"
545
  msgstr ""
546
 
547
- #: my-calendar-event-manager.php:40
548
  msgid "You do not have permission to delete that event."
549
  msgstr ""
550
 
551
- #: my-calendar-event-manager.php:54
552
  msgid "You do not have permission to approve that event."
553
  msgstr ""
554
 
555
- #: my-calendar-event-manager.php:69
556
  msgid "You do not have permission to reject that event."
557
  msgstr ""
558
 
559
- #: my-calendar-event-manager.php:102
560
  msgid "%1$d events deleted successfully out of %2$d selected"
561
  msgstr ""
562
 
563
- #: my-calendar-event-manager.php:104 my-calendar-event-manager.php:129
564
- #: my-calendar-event-manager.php:300 my-calendar-event-manager.php:378
565
- #: my-calendar-event-manager.php:395 my-calendar-event-manager.php:414
566
- #: my-calendar-event-manager.php:1375 my-calendar-event-manager.php:1378
567
- #: my-calendar-event-manager.php:1388 my-calendar-event-manager.php:1395
568
- #: my-calendar-event-manager.php:1411 my-calendar-event-manager.php:1418
569
- #: my-calendar-event-manager.php:1423 my-calendar-group-manager.php:56
570
- #: my-calendar-group-manager.php:82 my-calendar-group-manager.php:162
571
- #: my-calendar-group-manager.php:603
572
  msgid "Error"
573
  msgstr ""
574
 
575
- #: my-calendar-event-manager.php:104
576
  msgid "Your events have not been deleted. Please investigate."
577
  msgstr ""
578
 
579
- #: my-calendar-event-manager.php:129
580
  msgid "Your events have not been approved. Please investigate."
581
  msgstr ""
582
 
583
- #: my-calendar-event-manager.php:134
584
  msgid "%1$d events approved successfully out of %2$d selected"
585
  msgstr ""
586
 
587
- #: my-calendar-event-manager.php:141 my-calendar-settings.php:119
588
- #: my-calendar-settings.php:768 my-calendar.php:347
 
 
 
 
 
 
 
 
589
  msgid "Manage Events"
590
  msgstr ""
591
 
592
- #: my-calendar-event-manager.php:146
593
  msgid "My Events"
594
  msgstr ""
595
 
596
- #: my-calendar-event-manager.php:166 my-calendar-settings.php:320
597
  msgid ""
598
  "My Calendar has identified that you have the Calendar plugin by Kieran "
599
  "O'Shea installed. You can import those events and categories into the My "
600
  "Calendar database. Would you like to import these events?"
601
  msgstr ""
602
 
603
- #: my-calendar-event-manager.php:173 my-calendar-settings.php:326
604
  msgid "Import from Calendar"
605
  msgstr ""
606
 
607
- #: my-calendar-event-manager.php:178
608
  msgid ""
609
  "Although it is possible that this import could fail to import your events "
610
  "correctly, it should not have any impact on your existing Calendar database. "
@@ -612,724 +700,792 @@ msgid ""
612
  "\">please contact me</a>!"
613
  msgstr ""
614
 
615
- #: my-calendar-event-manager.php:223
616
  msgid "Return to Calendar"
617
  msgstr ""
618
 
619
- #: my-calendar-event-manager.php:235
620
  msgid "Currently editing your local calendar"
621
  msgstr ""
622
 
623
- #: my-calendar-event-manager.php:237
624
  msgid "Currently editing your central calendar"
625
  msgstr ""
626
 
627
- #: my-calendar-event-manager.php:243 my-calendar-group-manager.php:786
 
628
  msgid "Edit Event"
629
  msgstr ""
630
 
631
- #: my-calendar-event-manager.php:246 my-calendar-event-manager.php:255
632
  msgid "You must provide an event id in order to edit it"
633
  msgstr ""
634
 
635
- #: my-calendar-event-manager.php:252
636
  msgid "Copy Event"
637
  msgstr ""
638
 
639
- #: my-calendar-event-manager.php:300
640
  msgid "I'm sorry! I couldn't add that event to the database."
641
  msgstr ""
642
 
643
- #: my-calendar-event-manager.php:311
644
  msgid "Event saved. An administrator will review and approve your event."
645
  msgstr ""
646
 
647
- #: my-calendar-event-manager.php:316
648
  msgid "Event added. It will now show on the calendar."
649
  msgstr ""
650
 
651
- #: my-calendar-event-manager.php:322 my-calendar-group-manager.php:54
652
- #: my-calendar-group-manager.php:159
653
- msgid "View <a href=\"%s\">your calendar</a>."
654
  msgstr ""
655
 
656
- #: my-calendar-event-manager.php:351 my-calendar-group-manager.php:58
657
- #: my-calendar-group-manager.php:84 my-calendar-group-manager.php:164
658
- msgid "Nothing was changed in that update."
659
  msgstr ""
660
 
661
- #: my-calendar-event-manager.php:355
662
  msgid "Date/time information for this event has been updated."
663
  msgstr ""
664
 
665
- #: my-calendar-event-manager.php:378 my-calendar-group-manager.php:162
666
  msgid "Your event was not updated."
667
  msgstr ""
668
 
669
- #: my-calendar-event-manager.php:380
670
- msgid "No event data was changed in that update."
671
- msgstr ""
672
-
673
- #: my-calendar-event-manager.php:384 my-calendar-group-manager.php:60
674
- #: my-calendar-group-manager.php:166
675
  msgid "Event updated successfully"
676
  msgstr ""
677
 
678
- #: my-calendar-event-manager.php:388 my-calendar-group-manager.php:170
679
  msgid "You do not have sufficient permissions to edit that event."
680
  msgstr ""
681
 
682
- #: my-calendar-event-manager.php:395
683
  msgid "You can't delete an event if you haven't submitted an event id"
684
  msgstr ""
685
 
686
- #: my-calendar-event-manager.php:412
687
  msgid "Event deleted successfully"
688
  msgstr ""
689
 
690
- #: my-calendar-event-manager.php:414
691
  msgid ""
692
  "Despite issuing a request to delete, the event still remains in the "
693
  "database. Please investigate."
694
  msgstr ""
695
 
696
- #: my-calendar-event-manager.php:427 my-calendar-group-manager.php:182
697
  msgid "Sorry! That's an invalid event key."
698
  msgstr ""
699
 
700
- #: my-calendar-event-manager.php:431 my-calendar-group-manager.php:186
701
  msgid "Sorry! We couldn't find an event with that ID."
702
  msgstr ""
703
 
704
- #: my-calendar-event-manager.php:456
705
  msgid "This event must be approved in order for it to appear on the calendar."
706
  msgstr ""
707
 
708
- #: my-calendar-event-manager.php:499
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
709
  msgid ""
710
  "This event ends after the next occurrence begins. Events must end "
711
  "<strong>before</strong> the next occurrence begins."
712
  msgstr ""
713
 
714
- #: my-calendar-event-manager.php:499
715
  msgid ""
716
  "Event end date: <strong>%s %s</strong>. Next occurrence starts: <strong>%s</"
717
  "strong>"
718
  msgstr ""
719
 
720
- #: my-calendar-event-manager.php:537
721
- msgid "Add/Edit Event"
722
  msgstr ""
723
 
724
- #: my-calendar-event-manager.php:537
725
- msgid "Edit events"
726
  msgstr ""
727
 
728
- #: my-calendar-event-manager.php:547
729
  msgid ""
730
  "There was an error acquiring information about this event instance. The ID "
731
  "for this event instance was not provided. <strong>You are editing this "
732
  "entire recurrence set.</strong>"
733
  msgstr ""
734
 
735
- #: my-calendar-event-manager.php:551 my-calendar-group-manager.php:309
736
- msgid "Enter your Event Information"
737
  msgstr ""
738
 
739
- #: my-calendar-event-manager.php:553 my-calendar-group-manager.php:311
740
  msgid "Event Title"
741
  msgstr ""
742
 
743
- #: my-calendar-event-manager.php:553 my-calendar-event-manager.php:700
744
- #: my-calendar-group-manager.php:311
745
  msgid "(required)"
746
  msgstr ""
747
 
748
- #: my-calendar-event-manager.php:558
749
- msgid "Publish"
750
- msgstr ""
751
-
752
- #: my-calendar-event-manager.php:558
753
- msgid "You must approve this event to promote it to the calendar."
754
  msgstr ""
755
 
756
- #: my-calendar-event-manager.php:560
757
  msgid "An administrator must approve your new event."
758
  msgstr ""
759
 
760
- #: my-calendar-event-manager.php:575
761
  msgid "This event is not spam"
762
  msgstr ""
763
 
764
- #: my-calendar-event-manager.php:582
765
  msgid "Post to Twitter (via WP to Twitter)"
766
  msgstr ""
767
 
768
- #: my-calendar-event-manager.php:590 my-calendar-group-manager.php:327
769
- msgid ""
770
- "Event Description (<abbr title=\"hypertext markup language\">HTML</abbr> "
771
- "allowed)"
772
  msgstr ""
773
 
774
- #: my-calendar-event-manager.php:611 my-calendar-event-manager.php:624
775
- #: my-calendar-group-manager.php:338 my-calendar-group-manager.php:346
776
- msgid "This event's image:"
777
  msgstr ""
778
 
779
- #: my-calendar-event-manager.php:613 my-calendar-group-manager.php:340
780
- msgid "Add an image:"
781
  msgstr ""
782
 
783
- #: my-calendar-event-manager.php:615
784
- msgid "(URL to Event image)"
785
  msgstr ""
786
 
787
- #: my-calendar-event-manager.php:617 my-calendar-group-manager.php:340
788
- msgid "Upload Image"
789
  msgstr ""
790
 
791
- #: my-calendar-event-manager.php:617 my-calendar-group-manager.php:340
792
- msgid "Include your image URL or upload an image."
793
  msgstr ""
794
 
795
- #: my-calendar-event-manager.php:630 my-calendar-group-manager.php:352
 
 
 
 
 
 
 
 
796
  msgid ""
797
- "Event Short Description (<abbr title=\"hypertext markup language\">HTML</"
798
- "abbr> allowed)"
799
  msgstr ""
800
 
801
- #: my-calendar-event-manager.php:634 my-calendar-group-manager.php:356
802
- msgid "Event Host"
803
  msgstr ""
804
 
805
- #: my-calendar-event-manager.php:654 my-calendar-group-manager.php:376
806
- msgid "Event Category"
807
  msgstr ""
808
 
809
- #: my-calendar-event-manager.php:664 my-calendar-group-manager.php:388
810
- msgid "Event Link (Optional)"
 
811
  msgstr ""
812
 
813
- #: my-calendar-event-manager.php:664 my-calendar-group-manager.php:388
814
- msgid "This link will expire when the event passes."
815
  msgstr ""
816
 
817
- #: my-calendar-event-manager.php:674 my-calendar-event-manager.php:682
818
- msgid "Event Date and Time"
819
  msgstr ""
820
 
821
- #: my-calendar-event-manager.php:700
822
- msgid "Start Date (YYYY-MM-DD)"
823
  msgstr ""
824
 
825
- #: my-calendar-event-manager.php:700
826
- msgid "Time (hh:mm am/pm)"
827
  msgstr ""
828
 
829
- #: my-calendar-event-manager.php:706
830
- msgid "All day event"
 
 
831
  msgstr ""
832
 
833
- #: my-calendar-event-manager.php:709
834
- msgid "End Date (YYYY-MM-DD)"
 
 
835
  msgstr ""
836
 
837
- #: my-calendar-event-manager.php:709
838
- msgid "(optional)"
839
  msgstr ""
840
 
841
- #: my-calendar-event-manager.php:709
842
- msgid "End Time (hh:mm am/pm)"
843
  msgstr ""
844
 
845
- #: my-calendar-event-manager.php:714
846
- msgid "Hide end time"
847
  msgstr ""
848
 
849
- #: my-calendar-event-manager.php:720
850
- msgid "This is a multi-day event."
851
  msgstr ""
852
 
853
- #: my-calendar-event-manager.php:722
854
- msgid ""
855
- "Enter the beginning and ending dates/times for each occurrence of the event."
856
  msgstr ""
857
 
858
- #: my-calendar-event-manager.php:722
859
- msgid ""
860
- "If this is a multi-day event, it creates a single event with multiple dates/"
861
- "times; otherwise it creates separate events for each occurrence."
862
  msgstr ""
863
 
864
- #: my-calendar-event-manager.php:724
865
- msgid "Add another occurrence"
866
  msgstr ""
867
 
868
- #: my-calendar-event-manager.php:725
869
- msgid "Remove last occurrence"
870
  msgstr ""
871
 
872
- #: my-calendar-event-manager.php:729
873
- msgid "Dates for this event:"
874
  msgstr ""
875
 
876
- #: my-calendar-event-manager.php:730
877
- msgid ""
878
- "Editing a single date of an event changes only that event. Editing the root "
879
- "event changes all events in the series."
880
  msgstr ""
881
 
882
- #: my-calendar-event-manager.php:740
883
- msgid "Related Events:"
884
  msgstr ""
885
 
886
- #: my-calendar-event-manager.php:740
887
- msgid "Edit group"
888
  msgstr ""
889
 
890
- #: my-calendar-event-manager.php:747
891
- msgid "Current time difference from GMT is "
892
  msgstr ""
893
 
894
- #: my-calendar-event-manager.php:747
895
- msgid " hour(s)"
896
  msgstr ""
897
 
898
- #: my-calendar-event-manager.php:752 my-calendar-event-manager.php:985
899
- msgid "Save Event"
900
  msgstr ""
901
 
902
- #: my-calendar-event-manager.php:760 my-calendar-event-manager.php:776
903
- msgid "Recurring Events"
904
  msgstr ""
905
 
906
- #: my-calendar-event-manager.php:779
907
- msgid "Repeats"
 
 
 
908
  msgstr ""
909
 
910
- #: my-calendar-event-manager.php:779
911
- msgid "times"
 
912
  msgstr ""
913
 
914
- #: my-calendar-event-manager.php:780
915
- msgid "every"
916
  msgstr ""
917
 
918
- #: my-calendar-event-manager.php:781
919
- msgid "Units"
 
920
  msgstr ""
921
 
922
- #: my-calendar-event-manager.php:784
923
- msgid ""
924
- "Your entry is the number of events after the first occurrence of the event: "
925
- "a recurrence of <em>2</em> means the event will happen three times."
926
  msgstr ""
927
 
928
- #: my-calendar-event-manager.php:805
929
- msgid "Event Registration Settings"
930
  msgstr ""
931
 
932
- #: my-calendar-event-manager.php:808
933
- msgid "Event Registration"
 
934
  msgstr ""
935
 
936
- #: my-calendar-event-manager.php:826 my-calendar-event-manager.php:829
937
- #: my-calendar-group-manager.php:430 my-calendar-group-manager.php:433
938
- #: my-calendar-locations.php:129
939
- msgid "Event Location"
940
  msgstr ""
941
 
942
- #: my-calendar-event-manager.php:836 my-calendar-group-manager.php:440
943
- msgid "Choose a preset location:"
944
  msgstr ""
945
 
946
- #: my-calendar-event-manager.php:846 my-calendar-group-manager.php:453
947
- msgid "Add recurring locations for later use."
948
  msgstr ""
949
 
950
- #: my-calendar-event-manager.php:853 my-calendar-group-manager.php:462
951
- #: my-calendar-locations.php:131
952
- msgid ""
953
- "All location fields are optional: <em>insufficient information may result in "
954
- "an inaccurate map</em>."
955
  msgstr ""
956
 
957
- #: my-calendar-event-manager.php:855
958
- msgid "Copy this location into the locations table"
959
  msgstr ""
960
 
961
- #: my-calendar-event-manager.php:857 my-calendar-group-manager.php:465
962
- #: my-calendar-locations.php:134
963
- msgid "Name of Location (e.g. <em>Joe's Bar and Grill</em>)"
964
  msgstr ""
965
 
966
- #: my-calendar-event-manager.php:866 my-calendar-group-manager.php:468
967
- #: my-calendar-locations.php:143
968
- msgid "Street Address"
969
  msgstr ""
970
 
971
- #: my-calendar-event-manager.php:869 my-calendar-group-manager.php:471
972
- #: my-calendar-locations.php:146
973
- msgid "Street Address (2)"
974
  msgstr ""
975
 
976
- #: my-calendar-event-manager.php:872 my-calendar-group-manager.php:474
977
- #: my-calendar-locations.php:149
978
- msgid "Phone"
979
  msgstr ""
980
 
981
- #: my-calendar-event-manager.php:882 my-calendar-group-manager.php:477
982
- #: my-calendar-locations.php:159 my-calendar-settings.php:910
983
- msgid "State/Province"
984
  msgstr ""
985
 
986
- #: my-calendar-event-manager.php:916 my-calendar-group-manager.php:487
987
- #: my-calendar-locations.php:191
988
- msgid "Initial Zoom"
989
  msgstr ""
990
 
991
- #: my-calendar-event-manager.php:918 my-calendar-group-manager.php:489
992
- #: my-calendar-locations.php:193
993
- msgid "Neighborhood"
994
  msgstr ""
995
 
996
- #: my-calendar-event-manager.php:919 my-calendar-group-manager.php:490
997
- #: my-calendar-locations.php:194
998
- msgid "Small City"
999
  msgstr ""
1000
 
1001
- #: my-calendar-event-manager.php:920 my-calendar-group-manager.php:491
1002
- #: my-calendar-locations.php:195
1003
- msgid "Large City"
1004
  msgstr ""
1005
 
1006
- #: my-calendar-event-manager.php:921 my-calendar-group-manager.php:492
1007
- #: my-calendar-locations.php:196
1008
- msgid "Greater Metro Area"
1009
  msgstr ""
1010
 
1011
- #: my-calendar-event-manager.php:927 my-calendar-group-manager.php:498
1012
- msgid "Location URL"
1013
  msgstr ""
1014
 
1015
- #: my-calendar-event-manager.php:930 my-calendar-group-manager.php:501
1016
- #: my-calendar-locations.php:205
1017
- msgid "GPS Coordinates (optional)"
1018
  msgstr ""
1019
 
1020
- #: my-calendar-event-manager.php:932 my-calendar-group-manager.php:503
1021
- msgid ""
1022
- "If you supply GPS coordinates for your location, they will be used in place "
1023
- "of any other address information to provide your map link."
1024
  msgstr ""
1025
 
1026
- #: my-calendar-event-manager.php:935 my-calendar-group-manager.php:506
1027
- #: my-calendar-locations.php:210
1028
- msgid "Latitude"
1029
  msgstr ""
1030
 
1031
- #: my-calendar-event-manager.php:935 my-calendar-group-manager.php:506
1032
- #: my-calendar-locations.php:211
1033
- msgid "Longitude"
1034
  msgstr ""
1035
 
1036
- #: my-calendar-event-manager.php:964
1037
- msgid "Special scheduling options"
1038
  msgstr ""
1039
 
1040
- #: my-calendar-event-manager.php:967
1041
- msgid "Special Options"
1042
  msgstr ""
1043
 
1044
- #: my-calendar-event-manager.php:969
1045
- msgid ""
1046
- "Cancel this event if it occurs on a date with an event in the Holidays "
1047
- "category"
1048
  msgstr ""
1049
 
1050
- #: my-calendar-event-manager.php:972
1051
- msgid ""
1052
- "If this event recurs, and falls on the 5th week of the month in a month with "
1053
- "only four weeks, move it back one week."
1054
  msgstr ""
1055
 
1056
- #: my-calendar-event-manager.php:1046
1057
- msgid "Clear filters"
1058
  msgstr ""
1059
 
1060
- #: my-calendar-event-manager.php:1067
1061
- msgid "Spam"
1062
  msgstr ""
1063
 
1064
- #: my-calendar-event-manager.php:1072 my-calendar-templates.php:277
1065
- msgid "Published"
1066
  msgstr ""
1067
 
1068
- #: my-calendar-event-manager.php:1073 my-calendar-templates.php:277
1069
- msgid "Reserved"
 
1070
  msgstr ""
1071
 
1072
- #: my-calendar-event-manager.php:1074 my-calendar-group-manager.php:730
1073
- msgid "All"
 
 
1074
  msgstr ""
1075
 
1076
- #: my-calendar-event-manager.php:1085
1077
- msgid "&laquo; Previous Page"
 
1078
  msgstr ""
1079
 
1080
- #: my-calendar-event-manager.php:1086
1081
- msgid "Next Page &raquo;"
 
 
1082
  msgstr ""
1083
 
1084
- #: my-calendar-event-manager.php:1103 my-calendar-event-manager.php:1218
1085
- msgid "Delete checked events"
1086
  msgstr ""
1087
 
1088
- #: my-calendar-event-manager.php:1105 my-calendar-event-manager.php:1220
1089
- msgid "Approve checked events"
1090
  msgstr ""
1091
 
1092
- #: my-calendar-event-manager.php:1112 my-calendar-group-manager.php:252
1093
- msgid "Check/Uncheck all"
1094
  msgstr ""
1095
 
1096
- #: my-calendar-event-manager.php:1113 my-calendar-group-manager.php:751
1097
- #: my-calendar-settings.php:386 my-calendar-widgets.php:62
1098
- #: my-calendar-widgets.php:161 my-calendar-widgets.php:667
1099
- msgid "Title"
1100
  msgstr ""
1101
 
1102
- #: my-calendar-event-manager.php:1114 my-calendar-locations.php:289
1103
- msgid "Location"
1104
  msgstr ""
1105
 
1106
- #: my-calendar-event-manager.php:1115 my-calendar-settings.php:343
1107
- msgid "Date/Time"
1108
  msgstr ""
1109
 
1110
- #: my-calendar-event-manager.php:1116 my-calendar-group-manager.php:755
1111
- #: my-calendar-settings.php:389
1112
- msgid "Author"
1113
  msgstr ""
1114
 
1115
- #: my-calendar-event-manager.php:1117 my-calendar-group-manager.php:756
1116
- #: my-calendar-output.php:132 my-calendar-settings.php:390
1117
- #: my-calendar-templates.php:275
1118
- msgid "Category"
1119
  msgstr ""
1120
 
1121
- #: my-calendar-event-manager.php:1135
1122
- msgid "Possible spam"
1123
  msgstr ""
1124
 
1125
- #: my-calendar-event-manager.php:1150
1126
- msgid "Copy"
1127
  msgstr ""
1128
 
1129
- #: my-calendar-event-manager.php:1153 my-calendar-group-manager.php:788
1130
- #: my-calendar-output.php:300
1131
- msgid "Edit Group"
1132
  msgstr ""
1133
 
1134
- #: my-calendar-event-manager.php:1156 my-calendar-group-manager.php:792
1135
- msgid "Not editable."
1136
  msgstr ""
1137
 
1138
- #: my-calendar-event-manager.php:1160
1139
- msgid "Reject"
1140
  msgstr ""
1141
 
1142
- #: my-calendar-event-manager.php:1160
1143
- msgid "Approve"
 
1144
  msgstr ""
1145
 
1146
- #: my-calendar-event-manager.php:1165
1147
- msgid "Approved"
1148
  msgstr ""
1149
 
1150
- #: my-calendar-event-manager.php:1166
1151
- msgid "Rejected"
1152
  msgstr ""
1153
 
1154
- #: my-calendar-event-manager.php:1167
1155
- msgid "Awaiting Approval"
1156
  msgstr ""
1157
 
1158
- #: my-calendar-event-manager.php:1173
1159
- msgid "Filter by location"
1160
  msgstr ""
1161
 
1162
- #: my-calendar-event-manager.php:1173 my-calendar-event-manager.php:1201
1163
- #: my-calendar-event-manager.php:1210
1164
- msgid "Show only: "
1165
  msgstr ""
1166
 
1167
- #: my-calendar-event-manager.php:1177 my-calendar-group-manager.php:754
1168
- msgid "Recurs"
 
 
 
 
1169
  msgstr ""
1170
 
1171
- #: my-calendar-event-manager.php:1185 my-calendar-group-manager.php:805
1172
- msgid "Never"
 
1173
  msgstr ""
1174
 
1175
- #: my-calendar-event-manager.php:1186 my-calendar-group-manager.php:806
1176
- #: my-calendar-templates.php:175
1177
- msgid "Daily"
1178
  msgstr ""
1179
 
1180
- #: my-calendar-event-manager.php:1186
1181
- msgid "Every %d days"
 
1182
  msgstr ""
1183
 
1184
- #: my-calendar-event-manager.php:1187 my-calendar-group-manager.php:807
1185
- msgid "Weekdays"
 
1186
  msgstr ""
1187
 
1188
- #: my-calendar-event-manager.php:1187
1189
- msgid "Every %d weekdays"
 
 
1190
  msgstr ""
1191
 
1192
- #: my-calendar-event-manager.php:1188 my-calendar-group-manager.php:808
1193
- #: my-calendar-templates.php:177
1194
- msgid "Weekly"
1195
  msgstr ""
1196
 
1197
- #: my-calendar-event-manager.php:1188
1198
- msgid "Every %d weeks"
 
 
 
1199
  msgstr ""
1200
 
1201
- #: my-calendar-event-manager.php:1189 my-calendar-group-manager.php:809
1202
- msgid "Bi-Weekly"
1203
  msgstr ""
1204
 
1205
- #: my-calendar-event-manager.php:1190 my-calendar-group-manager.php:810
1206
- msgid "Monthly (by date)"
1207
  msgstr ""
1208
 
1209
- #: my-calendar-event-manager.php:1190
1210
- msgid "Every %d months (by date)"
1211
  msgstr ""
1212
 
1213
- #: my-calendar-event-manager.php:1191 my-calendar-group-manager.php:811
1214
- msgid "Monthly (by day)"
1215
  msgstr ""
1216
 
1217
- #: my-calendar-event-manager.php:1192 my-calendar-group-manager.php:812
1218
- msgid "Yearly"
1219
  msgstr ""
1220
 
1221
- #: my-calendar-event-manager.php:1192
1222
- msgid "Every %d years"
1223
  msgstr ""
1224
 
1225
- #: my-calendar-event-manager.php:1196 my-calendar-event-manager.php:1197
1226
- msgid "&ndash; %d Times"
1227
  msgstr ""
1228
 
1229
- #: my-calendar-event-manager.php:1201
1230
- msgid "Filter by author"
1231
  msgstr ""
1232
 
1233
- #: my-calendar-event-manager.php:1210
1234
- msgid "Filter by category"
 
 
1235
  msgstr ""
1236
 
1237
- #: my-calendar-event-manager.php:1231
1238
- msgid "There are no events in the database meeting your current criteria."
 
 
1239
  msgstr ""
1240
 
1241
- #: my-calendar-event-manager.php:1375
1242
- msgid ""
1243
- "Your event end date must be either after or the same as your event begin date"
1244
  msgstr ""
1245
 
1246
- #: my-calendar-event-manager.php:1378
1247
  msgid ""
1248
- "Your date formatting is correct but one or more of your dates is invalid. "
1249
- "Check for number of days in month and leap year related errors."
 
1250
  msgstr ""
1251
 
1252
- #: my-calendar-event-manager.php:1388
1253
- msgid ""
1254
- "The time field must either be blank or be entered in the format hh:mm am/pm"
1255
  msgstr ""
1256
 
1257
- #: my-calendar-event-manager.php:1395
1258
- msgid ""
1259
- "The end time field must either be blank or be entered in the format hh:mm am/"
1260
- "pm"
1261
  msgstr ""
1262
 
1263
- #: my-calendar-event-manager.php:1411 my-calendar-group-manager.php:603
1264
- msgid "The event title must be between 1 and 255 characters in length."
1265
  msgstr ""
1266
 
1267
- #: my-calendar-event-manager.php:1418
1268
- msgid "The repetition value must be 0 unless a type of recurrence is selected."
 
1269
  msgstr ""
1270
 
1271
- #: my-calendar-event-manager.php:1423
1272
- msgid "That event conflicts with a previously scheduled event."
1273
  msgstr ""
1274
 
1275
- #: my-calendar-event-manager.php:1612
1276
- msgid "Editing: "
1277
  msgstr ""
1278
 
1279
- #: my-calendar-event-manager.php:1648 my-calendar-event-manager.php:1661
1280
- msgid "No related events"
1281
  msgstr ""
1282
 
1283
- #: my-calendar-event-manager.php:1683 my-calendar-group-manager.php:406
1284
- msgid ""
1285
- "My Calendar does not manage event registrations. Use this for information "
1286
- "only."
1287
  msgstr ""
1288
 
1289
- #: my-calendar-event-manager.php:1687 my-calendar-group-manager.php:408
1290
- msgid "Open"
1291
  msgstr ""
1292
 
1293
- #: my-calendar-event-manager.php:1690 my-calendar-group-manager.php:409
1294
- msgid "Closed"
1295
  msgstr ""
1296
 
1297
- #: my-calendar-event-manager.php:1697 my-calendar-group-manager.php:410
1298
- msgid "Does not apply"
1299
  msgstr ""
1300
 
1301
- #: my-calendar-event-manager.php:1702 my-calendar-group-manager.php:413
1302
- msgid ""
1303
- "If this event recurs, it can only be registered for as a complete series."
1304
  msgstr ""
1305
 
1306
- #: my-calendar-group-manager.php:56
1307
  msgid "Event not updated."
1308
  msgstr ""
1309
 
1310
- #: my-calendar-group-manager.php:82
 
 
 
 
 
1311
  msgid "Event not grouped."
1312
  msgstr ""
1313
 
1314
- #: my-calendar-group-manager.php:86
1315
  msgid "Event grouped successfully"
1316
  msgstr ""
1317
 
1318
- #: my-calendar-group-manager.php:101 my-calendar-group-manager.php:393
1319
- #: my-calendar-group-manager.php:517
1320
  msgid "Edit Event Group"
1321
  msgstr ""
1322
 
1323
- #: my-calendar-group-manager.php:104
1324
  msgid "You must provide an event group id in order to edit it"
1325
  msgstr ""
1326
 
1327
- #: my-calendar-group-manager.php:111 my-calendar-group-manager.php:119
1328
- #: my-calendar-group-manager.php:306 my-calendar.php:351
1329
  msgid "Manage Event Groups"
1330
  msgstr ""
1331
 
1332
- #: my-calendar-group-manager.php:112
1333
  msgid ""
1334
  "Grouped events can be edited simultaneously. When you choose a group of "
1335
  "events to edit, the form will be pre-filled with the content applicable to "
@@ -1340,109 +1496,198 @@ msgid ""
1340
  "changes applied. (All grouped events can also be edited individually.)"
1341
  msgstr ""
1342
 
1343
- #: my-calendar-group-manager.php:113
1344
- msgid ""
1345
- "The following fields will never be changed when editing groups: registration "
1346
- "availability, event publication status, spam flagging, event recurrence, "
1347
- "event repetitions, and the start and end dates and times for that event."
1348
  msgstr ""
1349
 
1350
- #: my-calendar-group-manager.php:121
1351
- msgid "Select an event group to edit."
1352
  msgstr ""
1353
 
1354
- #: my-calendar-group-manager.php:234
1355
  msgid ""
1356
  "<strong>NOTE:</strong> The group editable fields for the events in this "
1357
  "group do not match"
1358
  msgstr ""
1359
 
1360
- #: my-calendar-group-manager.php:234
1361
  msgid "The group editable fields for the events in this group match."
1362
  msgstr ""
1363
 
1364
- #: my-calendar-group-manager.php:241
1365
  msgid "Apply these changes to:"
1366
  msgstr ""
1367
 
1368
- #: my-calendar-group-manager.php:254
1369
  msgid "Remove checked events from this group"
1370
  msgstr ""
1371
 
1372
- #: my-calendar-group-manager.php:272
1373
  msgid "You must provide a group ID to edit groups"
1374
  msgstr ""
1375
 
1376
- #: my-calendar-group-manager.php:311 my-calendar-group-manager.php:319
1377
- #: my-calendar-group-manager.php:327 my-calendar-group-manager.php:340
1378
- #: my-calendar-group-manager.php:352 my-calendar-group-manager.php:356
1379
- #: my-calendar-group-manager.php:376 my-calendar-group-manager.php:388
1380
- #: my-calendar-group-manager.php:405 my-calendar-group-manager.php:465
1381
- #: my-calendar-group-manager.php:468 my-calendar-group-manager.php:471
1382
- #: my-calendar-group-manager.php:474 my-calendar-group-manager.php:477
1383
- #: my-calendar-group-manager.php:480 my-calendar-group-manager.php:481
1384
- #: my-calendar-group-manager.php:484 my-calendar-group-manager.php:487
1385
- #: my-calendar-group-manager.php:498 my-calendar-group-manager.php:506
 
 
 
 
1386
  msgid "Fields do not match"
1387
  msgstr ""
1388
 
1389
- #: my-calendar-group-manager.php:319
1390
  msgid "Selected dates are a single multi-day event."
1391
  msgstr ""
1392
 
1393
- #: my-calendar-group-manager.php:402
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1394
  msgid "Event Registration Options"
1395
  msgstr ""
1396
 
1397
- #: my-calendar-group-manager.php:405
1398
  msgid "Event Registration Status"
1399
  msgstr ""
1400
 
1401
- #: my-calendar-group-manager.php:725
1402
- msgid "Create/Modify Groups"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1403
  msgstr ""
1404
 
1405
- #: my-calendar-group-manager.php:728
1406
  msgid "Grouped Events"
1407
  msgstr ""
1408
 
1409
- #: my-calendar-group-manager.php:729
1410
  msgid "Ungrouped Events"
1411
  msgstr ""
1412
 
1413
- #: my-calendar-group-manager.php:734
1414
  msgid "Check a set of events to group them for mass editing."
1415
  msgstr ""
1416
 
1417
- #: my-calendar-group-manager.php:744 my-calendar-group-manager.php:836
1418
  msgid "Group checked events for mass editing"
1419
  msgstr ""
1420
 
1421
- #: my-calendar-group-manager.php:750
1422
  msgid "Group"
1423
  msgstr ""
1424
 
1425
- #: my-calendar-group-manager.php:752
1426
  msgid "Where"
1427
  msgstr ""
1428
 
1429
- #: my-calendar-group-manager.php:753
1430
  msgid "Starts"
1431
  msgstr ""
1432
 
1433
- #: my-calendar-group-manager.php:790
1434
  msgid "Ungrouped"
1435
  msgstr ""
1436
 
1437
- #: my-calendar-group-manager.php:815
1438
  msgid "Forever"
1439
  msgstr ""
1440
 
1441
- #: my-calendar-group-manager.php:816
1442
  msgid "%d Times"
1443
  msgstr ""
1444
 
1445
- #: my-calendar-group-manager.php:842
1446
  msgid "There are no events in the database!"
1447
  msgstr ""
1448
 
@@ -1450,231 +1695,247 @@ msgstr ""
1450
  msgid "How to use My Calendar"
1451
  msgstr ""
1452
 
1453
- #: my-calendar-help.php:13 my-calendar.php:174 my-calendar.php:357
1454
  msgid "My Calendar Help"
1455
  msgstr ""
1456
 
1457
- #: my-calendar-help.php:17
1458
- msgid "Shortcodes"
1459
  msgstr ""
1460
 
1461
  #: my-calendar-help.php:18
1462
- msgid "Icons"
1463
  msgstr ""
1464
 
1465
  #: my-calendar-help.php:19
1466
- msgid "Styles"
1467
  msgstr ""
1468
 
1469
  #: my-calendar-help.php:20
1470
- msgid "Templating"
1471
  msgstr ""
1472
 
1473
  #: my-calendar-help.php:21
 
 
 
 
1474
  msgid "Support Form"
1475
  msgstr ""
1476
 
1477
- #: my-calendar-help.php:22 my-calendar-help.php:360
1478
  msgid "Helpful Information"
1479
  msgstr ""
1480
 
1481
- #: my-calendar-help.php:30 my-calendar.php:172
1482
  msgid "Getting Started"
1483
  msgstr ""
1484
 
1485
- #: my-calendar-help.php:33
1486
- msgid ""
1487
- "Although the My Calendar plug-in is very complicated in terms of what can be "
1488
- "customized, the basic usage is quite simple."
1489
- msgstr ""
1490
-
1491
- #: my-calendar-help.php:36
1492
  msgid "Add the My Calendar shortcode (<code>[my_calendar]</code>) to a page."
1493
  msgstr ""
1494
 
1495
- #: my-calendar-help.php:37
1496
  msgid ""
1497
- "Add events by clicking on the Add/Edit Events link in the admin sidebar or "
1498
- "on \"Add Events\" in the admin toolbar."
1499
  msgstr ""
1500
 
1501
- #: my-calendar-help.php:38
1502
  msgid "Select your preferred stylesheet in the Styles Editor"
1503
  msgstr ""
1504
 
1505
- #: my-calendar-help.php:41
1506
  msgid ""
1507
- "Read more of the basic help documentation on this page or purchase the My "
1508
- "Calendar User's Guide to customize further -- but the above is all that you "
1509
  "need to do to begin using the calendar."
1510
  msgstr ""
1511
 
1512
- #: my-calendar-help.php:49
1513
- msgid "Shortcode Syntax"
 
 
 
 
1514
  msgstr ""
1515
 
1516
  #: my-calendar-help.php:52
1517
- msgid "These shortcodes can be used in Posts, Pages, or in text widgets."
 
 
 
 
 
 
 
 
1518
  msgstr ""
1519
 
1520
- #: my-calendar-help.php:54
1521
  msgid "Main Calendar Shortcode (List or Grid, Weekly or Monthly view)"
1522
  msgstr ""
1523
 
1524
- #: my-calendar-help.php:57
 
 
 
 
1525
  msgid ""
1526
- "This basic shortcode will show the one-week view of the calendar on a post "
1527
- "or page including all categories and the category key, in a list format. The "
1528
  "standard previous/next navigation will be included above the calendar, the "
1529
  "link to the print format (if enabled) will be shown below."
1530
  msgstr ""
1531
 
1532
- #: my-calendar-help.php:61
1533
- msgid "The shortcode supports these attributes:"
1534
  msgstr ""
1535
 
1536
- #: my-calendar-help.php:64
1537
- msgid ""
1538
- "Names or IDs of categories included in this calendar, comma or pipe "
1539
- "separated."
1540
  msgstr ""
1541
 
1542
- #: my-calendar-help.php:65
1543
  msgid ""
1544
- "Either \"list\" or \"mini\" to show the list view or the mini calendar; "
1545
- "exclude or any other value to show the main grid calendar."
1546
  msgstr ""
1547
 
1548
- #: my-calendar-help.php:66
1549
  msgid ""
1550
- "Comma-separated list of navigational features to display above or below the "
1551
- "calendar. Available: <strong>nav, toggle, jump, print, key, feeds, "
1552
- "timeframe</strong>. Order listed determines the order displayed. Feed links "
1553
- "and print view will only display if they are enabled on the settings page. "
1554
- "All other fields will appear if specified; the defaults specified in "
1555
- "settings will be used if the attribute is left blank. Use <em>none</em> to "
1556
- "hide all navigation elements."
1557
  msgstr ""
1558
 
1559
- #: my-calendar-help.php:67
1560
  msgid ""
1561
  "Set to \"week\" to show a one week view or to \"day\" to show a single day "
1562
- "view. Any other value will show a month view. (Day view shows as a list "
1563
- "regardless of format setting.)"
1564
  msgstr ""
1565
 
1566
- #: my-calendar-help.php:68
1567
- msgid "The type of location data to restrict by."
1568
  msgstr ""
1569
 
1570
- #: my-calendar-help.php:69
1571
- msgid "The specific location information to filter to."
1572
  msgstr ""
1573
 
1574
- #: my-calendar-help.php:70
1575
- msgid ""
1576
- "Author or comma-separated list of authors (usernames or IDs) to show events "
1577
- "from."
1578
  msgstr ""
1579
 
1580
- #: my-calendar-help.php:71
1581
- msgid ""
1582
- "Host or comma-separated list of hosts (WordPress usernames or IDs) to show "
1583
- "events from."
1584
  msgstr ""
1585
 
1586
- #: my-calendar-help.php:72
1587
- msgid ""
1588
- "String to give this specific calendar shortcode a unique ID. Use when "
1589
- "showing multiple calendars in a Page or post."
1590
  msgstr ""
1591
 
1592
- #: my-calendar-help.php:75
1593
  msgid ""
1594
  "The main My Calendar shortcode can be generated from a button in your post "
1595
  "and page editor. The mini calendar can also be accessed and configured as a "
1596
  "widget."
1597
  msgstr ""
1598
 
1599
- #: my-calendar-help.php:77
1600
- msgid "Additional Calendar Views (Upcoming events, today's events)"
1601
  msgstr ""
1602
 
1603
- #: my-calendar-help.php:80
1604
  msgid ""
1605
- "Displays the output of the Upcoming Events widget. The <code>before</code> "
1606
- "and <code>after</code> attributes should be numbers; the <code>type</code> "
1607
- "attribute can be either \"event\" or \"days\", and the <code>category</code> "
1608
- "and <code>author</code> attributes work the same way as on the main calendar "
1609
- "shortcode. Templates work using the template codes listed below. "
1610
- "<code>fallback</code> provides text in case there are no events meeting your "
1611
- "criteria. Order provides a sort order for the events list &ndash; either "
1612
- "ascending (<code>asc</code>) or descending (<code>desc</code>). "
1613
- "<code>show_today</code> is an indicator whether or not to include today's "
1614
- "events in the list. <code>Skip</code> is the number of events to skip in the "
1615
- "upcoming events."
1616
  msgstr ""
1617
 
1618
- #: my-calendar-help.php:84
1619
  msgid ""
1620
  "Displays the output of the Today's Events widget, with four configurable "
1621
  "attributes: category, author, template and fallback text."
1622
  msgstr ""
1623
 
1624
- #: my-calendar-help.php:87
1625
- msgid ""
1626
- "Both Upcoming Events and Today's Events can also be configured using widgets."
1627
  msgstr ""
1628
 
1629
- #: my-calendar-help.php:91
1630
  msgid ""
1631
  "Displays a single event and/or all dates for that event. If template is set "
1632
  "to a blank value, will only display the list of occurrences. If the list "
1633
  "attribute is set blank, will only show the event template"
1634
  msgstr ""
1635
 
1636
- #: my-calendar-help.php:94
1637
- msgid "Supplement Features (Locations filter, Categories filter)"
1638
- msgstr ""
1639
-
1640
- #: my-calendar-help.php:98
1641
- msgid ""
1642
- "List of event locations, either as a list of links or as a select form. The "
1643
- "<code>show</code> attribute can either be <code>list</code> or <code>form</"
1644
- "code>, <code>type</code> is either <code>saved</code> (to show items from "
1645
- "your stored locations), or <code>custom</code> (to show the options "
1646
- "configured in your user settings). <code>datatype</code> must be the type of "
1647
- "data your limits are choosing from: <code>name</code> (business name), "
1648
- "<code>city</code>, <code>state</code>, <code>country</code>, <code>zip</"
1649
- "code> (postal code), or <code>region</code>."
1650
  msgstr ""
1651
 
1652
- #: my-calendar-help.php:102
1653
  msgid ""
1654
- "Display a list of locations. The <code>datatype</code> is the type of data "
1655
- "displayed; all lists will include a link to the map of that location. In "
1656
- "addition to basic location information as in the above shortcode, you can "
1657
- "also use \"hcard\" to display all available location information."
1658
  msgstr ""
1659
 
1660
- #: my-calendar-help.php:103
1661
  msgid ""
1662
- "Use the <code>template</code> attribute to show your customized set of data. "
1663
- "Sorted by the <code>datatype</code> value."
 
 
 
 
 
1664
  msgstr ""
1665
 
1666
- #: my-calendar-help.php:107
1667
  msgid ""
1668
  "List of event categories, either as a list of links or as a select dropdown "
1669
  "form. The <code>show</code> attribute can either be <code>list</code> or "
1670
  "<code>form</code>."
1671
  msgstr ""
1672
 
1673
- #: my-calendar-help.php:114
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1674
  msgid "Category Icons"
1675
  msgstr ""
1676
 
1677
- #: my-calendar-help.php:117
1678
  msgid ""
1679
  "My Calendar is designed to manage multiple calendars. The basis for these "
1680
  "calendars are categories; you can setup a calendar page which includes all "
@@ -1684,22 +1945,22 @@ msgid ""
1684
  "etc."
1685
  msgstr ""
1686
 
1687
- #: my-calendar-help.php:120
1688
  msgid ""
1689
  "The pre-installed category icons may not be what you need. I assume that "
1690
  "you'll upload your own icons -- place your custom icons in a folder at \"my-"
1691
  "calendar-custom\" to avoid having them overwritten by upgrades."
1692
  msgstr ""
1693
 
1694
- #: my-calendar-help.php:120
1695
  msgid "You can alternately place icons in:"
1696
  msgstr ""
1697
 
1698
- #: my-calendar-help.php:128
1699
  msgid "Custom Styles"
1700
  msgstr ""
1701
 
1702
- #: my-calendar-help.php:131
1703
  msgid ""
1704
  "My Calendar comes with five default stylesheets. My Calendar will retain "
1705
  "your changes to stylesheets, but if you want to add an entirely new "
@@ -1707,22 +1968,22 @@ msgid ""
1707
  "directory."
1708
  msgstr ""
1709
 
1710
- #: my-calendar-help.php:134
1711
  msgid "Your custom style directory is"
1712
  msgstr ""
1713
 
1714
- #: my-calendar-help.php:137
1715
  msgid ""
1716
  "You can also add custom styles to your custom directory or your theme "
1717
  "directory for print styles, mobile styles, and tablet styles. <code>mc-print."
1718
  "css</code>, <code>mc-mobile.css</code>, and <code>mc-tablet.css</code>."
1719
  msgstr ""
1720
 
1721
- #: my-calendar-help.php:145
1722
- msgid "Widget Templating"
1723
  msgstr ""
1724
 
1725
- #: my-calendar-help.php:148
1726
  msgid ""
1727
  "All template tags support two attributes: before=\"value\" and after=\"value"
1728
  "\". The values of the attributes will be placed before and after the output "
@@ -1730,309 +1991,359 @@ msgid ""
1730
  "quotes."
1731
  msgstr ""
1732
 
1733
- #: my-calendar-help.php:151
1734
  msgid ""
1735
  "Date/Time template tags support the \"format\" attribute: format=\"M, Y\", "
1736
  "where the value is a PHP formatted date string. Only <code>dtstart</code> "
1737
  "and <code>dtend</code> include the full date/time information for formatting."
1738
  msgstr ""
1739
 
1740
- #: my-calendar-help.php:154
1741
  msgid "Example:"
1742
  msgstr ""
1743
 
1744
- #: my-calendar-help.php:156 my-calendar.php:198
1745
  msgid "Event Template Tags"
1746
  msgstr ""
1747
 
1748
- #: my-calendar-help.php:159
1749
  msgid "Displays the title of the event."
1750
  msgstr ""
1751
 
1752
- #: my-calendar-help.php:162
1753
  msgid ""
1754
  "Displays title of the event as a link if a URL is present, or the title "
1755
  "alone if no URL is available."
1756
  msgstr ""
1757
 
1758
- #: my-calendar-help.php:165
1759
  msgid "Displays the start time for the event."
1760
  msgstr ""
1761
 
1762
- #: my-calendar-help.php:168
 
 
 
 
1763
  msgid ""
1764
  "Displays the start time for the event adjusted to the current user's time "
1765
  "zone settings. Returns <code>{time}</code> if user settings are disabled or "
1766
  "if the user has not selected a preferred time zone."
1767
  msgstr ""
1768
 
1769
- #: my-calendar-help.php:171
1770
  msgid ""
1771
  "Displays the end time for the event adjusted to the current user's time zone "
1772
  "settings. Returns <code>{endtime}</code> if user settings are disabled or if "
1773
  "the user has not selected a preferred time zone."
1774
  msgstr ""
1775
 
1776
- #: my-calendar-help.php:174
1777
  msgid "Displays the date on which the event begins."
1778
  msgstr ""
1779
 
1780
- #: my-calendar-help.php:177
1781
  msgid ""
1782
  "Displays the date on which the series of events began (for recurring events)."
1783
  msgstr ""
1784
 
1785
- #: my-calendar-help.php:180
1786
  msgid "Displays the date on which the event ends."
1787
  msgstr ""
1788
 
1789
- #: my-calendar-help.php:183
1790
  msgid "Displays the time at which the event ends."
1791
  msgstr ""
1792
 
1793
- #: my-calendar-help.php:186
1794
  msgid ""
1795
  "Displays the beginning date to the end date for events. Does not show end "
1796
  "date if same as start date."
1797
  msgstr ""
1798
 
1799
- #: my-calendar-help.php:189
1800
  msgid ""
1801
  "Displays the beginning and end times for events. Does not show end time if "
1802
  "same as start or if marked as hidden."
1803
  msgstr ""
1804
 
1805
- #: my-calendar-help.php:192
1806
  msgid "Timestamp for beginning of event."
1807
  msgstr ""
1808
 
1809
- #: my-calendar-help.php:195
1810
  msgid "Timestamp for end of event."
1811
  msgstr ""
1812
 
1813
- #: my-calendar-help.php:198
1814
  msgid ""
1815
  "For multi-day events displays an unordered list of dates and times for "
1816
  "events in this group. Otherwise, beginning date/time."
1817
  msgstr ""
1818
 
1819
- #: my-calendar-help.php:201
1820
  msgid "Displays the WordPress author who posted the event."
1821
  msgstr ""
1822
 
1823
- #: my-calendar-help.php:204
1824
  msgid "Displays the gravatar image for the event author."
1825
  msgstr ""
1826
 
1827
- #: my-calendar-help.php:207
1828
  msgid "Displays the name of the person assigned as host for the event."
1829
  msgstr ""
1830
 
1831
- #: my-calendar-help.php:210
1832
  msgid ""
1833
  "Displays the email address of the person assigned as host for the event."
1834
  msgstr ""
1835
 
1836
- #: my-calendar-help.php:213
1837
  msgid "Displays the gravatar image for the event host."
1838
  msgstr ""
1839
 
1840
- #: my-calendar-help.php:216
1841
  msgid "Displays the short version of the event description."
1842
  msgstr ""
1843
 
1844
- #: my-calendar-help.php:219
1845
  msgid "Displays short description without converting paragraphs."
1846
  msgstr ""
1847
 
1848
- #: my-calendar-help.php:222
1849
  msgid "Displays short description with any HTML stripped out."
1850
  msgstr ""
1851
 
1852
- #: my-calendar-help.php:225
 
 
 
 
 
 
1853
  msgid "Displays the description of the event."
1854
  msgstr ""
1855
 
1856
- #: my-calendar-help.php:228
1857
  msgid "Displays description without converting paragraphs."
1858
  msgstr ""
1859
 
1860
- #: my-calendar-help.php:231
1861
  msgid "Displays description with any HTML stripped out."
1862
  msgstr ""
1863
 
1864
- #: my-calendar-help.php:234
 
 
 
 
1865
  msgid "Image associated with the event. (HTMl)"
1866
  msgstr ""
1867
 
1868
- #: my-calendar-help.php:237
1869
  msgid "Image associated with the event. (image URL only)"
1870
  msgstr ""
1871
 
1872
- #: my-calendar-help.php:240
 
 
 
 
 
 
 
 
1873
  msgid "Displays the URL provided for the event."
1874
  msgstr ""
1875
 
1876
- #: my-calendar-help.php:243
1877
  msgid "Produces the URL to download an iCal formatted record for the event."
1878
  msgstr ""
1879
 
1880
- #: my-calendar-help.php:246
1881
  msgid ""
1882
  "Produces a hyperlink to download an iCal formatted record for the event."
1883
  msgstr ""
1884
 
1885
- #: my-calendar-help.php:249
 
 
 
 
 
 
 
 
1886
  msgid "Shows the recurrence status of the event. (Daily, Weekly, etc.)"
1887
  msgstr ""
1888
 
1889
- #: my-calendar-help.php:252
1890
  msgid "Shows the number of repetitions of the event."
1891
  msgstr ""
1892
 
1893
- #: my-calendar-help.php:255
1894
  msgid ""
1895
  "Provides a link to an auto-generated page containing all information on the "
1896
  "given event."
1897
  msgstr ""
1898
 
1899
- #: my-calendar-help.php:255 my-calendar-help.php:258
1900
  msgid "Requires that the site URL has been provided on the Settings page"
1901
  msgstr ""
1902
 
1903
- #: my-calendar-help.php:258
 
 
 
 
1904
  msgid ""
1905
  "Provides a link to the defined event URL when present, otherwise the "
1906
  "{details} link."
1907
  msgstr ""
1908
 
1909
- #: my-calendar-help.php:261
1910
  msgid ""
1911
  "Displays text indicating whether registration for the event is currently "
1912
  "open or closed; displays nothing if that choice is selected in the event."
1913
  msgstr ""
1914
 
1915
- #: my-calendar-help.php:264
 
 
 
 
 
 
 
 
1916
  msgid ""
1917
  "Displays the current status of the event: either \"Published\" or \"Reserved"
1918
  "\" - primary used in email templates."
1919
  msgstr ""
1920
 
1921
- #: my-calendar-help.php:266 my-calendar.php:258
1922
  msgid "Location Template Tags"
1923
  msgstr ""
1924
 
1925
- #: my-calendar-help.php:270
1926
  msgid "Displays the name of the location of the event."
1927
  msgstr ""
1928
 
1929
- #: my-calendar-help.php:273
1930
  msgid "Displays the first line of the site address."
1931
  msgstr ""
1932
 
1933
- #: my-calendar-help.php:276
1934
  msgid "Displays the second line of the site address."
1935
  msgstr ""
1936
 
1937
- #: my-calendar-help.php:279
1938
  msgid "Displays the city for the location."
1939
  msgstr ""
1940
 
1941
- #: my-calendar-help.php:282
1942
  msgid "Displays the state for the location."
1943
  msgstr ""
1944
 
1945
- #: my-calendar-help.php:285
1946
  msgid "Displays the postcode for the location."
1947
  msgstr ""
1948
 
1949
- #: my-calendar-help.php:288
1950
  msgid "Shows the custom region entered for the location."
1951
  msgstr ""
1952
 
1953
- #: my-calendar-help.php:291
1954
  msgid "Displays the country for the event location."
1955
  msgstr ""
1956
 
1957
- #: my-calendar-help.php:294
1958
  msgid "Output the URL for the location link."
1959
  msgstr ""
1960
 
1961
- #: my-calendar-help.php:297
1962
  msgid "Output the stored phone number for the location."
1963
  msgstr ""
1964
 
1965
- #: my-calendar-help.php:300
1966
  msgid ""
1967
  "Output a hyperlink to the location's listed link with default link text."
1968
  msgstr ""
1969
 
1970
- #: my-calendar-help.php:303
1971
  msgid ""
1972
  "Displays the event address in <a href=\"http://microformats.org/wiki/hcard"
1973
  "\">hcard</a> format."
1974
  msgstr ""
1975
 
1976
- #: my-calendar-help.php:306
1977
  msgid ""
1978
  "Displays a link to a Google Map of the event, if sufficient address "
1979
  "information is available. If not, will be empty."
1980
  msgstr ""
1981
 
1982
- #: my-calendar-help.php:309
1983
  msgid ""
1984
  "Produces the URL for the Google Map for the event location if sufficient "
1985
  "address information is available. If not, will be empty."
1986
  msgstr ""
1987
 
1988
- #: my-calendar-help.php:311 my-calendar.php:294
 
 
 
 
 
 
 
 
 
 
1989
  msgid "Category Template Tags"
1990
  msgstr ""
1991
 
1992
- #: my-calendar-help.php:315
1993
  msgid "Displays the name of the category the event is in."
1994
  msgstr ""
1995
 
1996
- #: my-calendar-help.php:318
1997
  msgid "Produces the address of the current event's category icon."
1998
  msgstr ""
1999
 
2000
- #: my-calendar-help.php:321
2001
  msgid "Produces the HTML for the current event's category icon."
2002
  msgstr ""
2003
 
2004
- #: my-calendar-help.php:324
2005
  msgid "Produces the hex code for the current event's category color."
2006
  msgstr ""
2007
 
2008
- #: my-calendar-help.php:327
2009
- msgid ""
2010
- "Displays the ID for\r\n"
2011
- "\t\t the category the event is in."
2012
  msgstr ""
2013
 
2014
- #: my-calendar-help.php:331
2015
  msgid "Special use Template Tags"
2016
  msgstr ""
2017
 
2018
- #: my-calendar-help.php:335
2019
  msgid "A unique ID for the current instance of an event."
2020
  msgstr ""
2021
 
2022
- #: my-calendar-help.php:338
2023
  msgid ""
2024
  "The ID for the event record associated with the current instance of an event."
2025
  msgstr ""
2026
 
2027
- #: my-calendar-help.php:348
2028
  msgid "Get Plug-in Support"
2029
  msgstr ""
2030
 
2031
- #: my-calendar-help.php:353
2032
  msgid "My Calendar support requests can only be sent by administrators."
2033
  msgstr ""
2034
 
2035
- #: my-calendar-help.php:363
2036
  msgid ""
2037
  "<strong>Uninstalling the plugin</strong>: Although the WordPress standard "
2038
  "and expectation is for plug-ins to delete any custom database tables when "
@@ -2046,7 +2357,7 @@ msgid ""
2046
  "however."
2047
  msgstr ""
2048
 
2049
- #: my-calendar-help.php:366
2050
  msgid ""
2051
  "<strong>Donations</strong>: I appreciate anything you can give. $2 may not "
2052
  "seem like much, but it can really add up when thousands of people are using "
@@ -2054,81 +2365,83 @@ msgid ""
2054
  "gifts are not tax deductible. Thank you!"
2055
  msgstr ""
2056
 
2057
- #: my-calendar-install.php:251
2058
  msgid "My Calendar Default Timezone"
2059
  msgstr ""
2060
 
2061
- #: my-calendar-install.php:296
2062
  msgid "My Calendar Default Location"
2063
  msgstr ""
2064
 
2065
- #: my-calendar-locations.php:42
 
 
 
 
2066
  msgid "Location added successfully"
2067
  msgstr ""
2068
 
2069
- #: my-calendar-locations.php:44
2070
  msgid "Location could not be added to database"
2071
  msgstr ""
2072
 
2073
- #: my-calendar-locations.php:51
2074
  msgid "Location deleted successfully"
2075
  msgstr ""
2076
 
2077
- #: my-calendar-locations.php:53
2078
  msgid "Location could not be deleted"
2079
  msgstr ""
2080
 
2081
- #: my-calendar-locations.php:79
2082
  msgid "Location could not be edited."
2083
  msgstr ""
2084
 
2085
- #: my-calendar-locations.php:81
2086
  msgid "Location was not changed."
2087
  msgstr ""
2088
 
2089
- #: my-calendar-locations.php:83
2090
  msgid "Location edited successfully"
2091
  msgstr ""
2092
 
2093
- #: my-calendar-locations.php:104
2094
  msgid "Add New Location"
2095
  msgstr ""
2096
 
2097
- #: my-calendar-locations.php:106
2098
  msgid "Edit Location"
2099
  msgstr ""
2100
 
2101
- #: my-calendar-locations.php:113
2102
  msgid "Location Editor"
2103
  msgstr ""
2104
 
2105
- #: my-calendar-locations.php:202
2106
- msgid "Website"
2107
  msgstr ""
2108
 
2109
- #: my-calendar-locations.php:207
2110
- msgid ""
2111
- "If you supply GPS coordinates for your location, they will be used in place "
2112
- "of any other address information to pinpoint your location."
2113
  msgstr ""
2114
 
2115
- #: my-calendar-locations.php:215
2116
- msgid "Add Location"
2117
  msgstr ""
2118
 
2119
- #: my-calendar-locations.php:223
2120
- msgid "Add a New Location"
2121
  msgstr ""
2122
 
2123
- #: my-calendar-locations.php:228 my-calendar.php:350
2124
- msgid "Manage Locations"
2125
  msgstr ""
2126
 
2127
- #: my-calendar-locations.php:311
2128
  msgid "There are no locations in the database yet!"
2129
  msgstr ""
2130
 
2131
- #: my-calendar-locations.php:315
2132
  msgid ""
2133
  "Please note: editing or deleting locations stored for re-use will have no "
2134
  "effect on any event previously scheduled at that location. The location "
@@ -2136,397 +2449,412 @@ msgid ""
2136
  "locations into event records."
2137
  msgstr ""
2138
 
2139
- #: my-calendar-output.php:170 my-calendar-output.php:295
2140
- msgid "Close"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2141
  msgstr ""
2142
 
2143
- #: my-calendar-output.php:183
2144
  msgid "(%s in your time zone)"
2145
  msgstr ""
2146
 
2147
- #: my-calendar-output.php:189
2148
  msgid "Not Applicable"
2149
  msgstr ""
2150
 
2151
- #: my-calendar-output.php:204
2152
- msgid "Posted by"
2153
  msgstr ""
2154
 
2155
- #: my-calendar-output.php:212 my-calendar-templates.php:279
2156
- msgid "Details about"
2157
  msgstr ""
2158
 
2159
- #: my-calendar-output.php:239 my-calendar-templates.php:225
2160
  msgid "iCal"
2161
  msgstr ""
2162
 
2163
- #: my-calendar-output.php:274
2164
  msgid ""
2165
- "This class is part of a series. You must register for the first event in "
2166
- "this series to attend."
2167
  msgstr ""
2168
 
2169
- #: my-calendar-output.php:280
2170
  msgid "View full calendar"
2171
  msgstr ""
2172
 
2173
- #: my-calendar-output.php:317
2174
  msgid "Edit This Date"
2175
  msgstr ""
2176
 
2177
- #: my-calendar-output.php:318
2178
  msgid "Edit All"
2179
  msgstr ""
2180
 
2181
- #: my-calendar-output.php:319
2182
  msgid "Delete This Date"
2183
  msgstr ""
2184
 
2185
- #: my-calendar-output.php:320
2186
  msgid "Delete All"
2187
  msgstr ""
2188
 
2189
- #: my-calendar-output.php:397
2190
  msgid "Go"
2191
  msgstr ""
2192
 
2193
- #: my-calendar-output.php:426
2194
  msgid "Calendar: Print View"
2195
  msgstr ""
2196
 
2197
- #: my-calendar-output.php:445
2198
  msgid "Return to site"
2199
  msgstr ""
2200
 
2201
- #: my-calendar-output.php:458
2202
  msgid "View as Grid"
2203
  msgstr ""
2204
 
2205
- #: my-calendar-output.php:462
2206
  msgid "View as List"
2207
  msgstr ""
2208
 
2209
- #: my-calendar-output.php:555
2210
  msgid " and %d other event"
2211
  msgstr ""
2212
 
2213
- #: my-calendar-output.php:557
2214
  msgid " and %d other events"
2215
  msgstr ""
2216
 
2217
- #: my-calendar-output.php:565
2218
- msgid "Event search results for &ldquo;%1$s&rdquo;"
2219
- msgstr ""
2220
-
2221
- #: my-calendar-output.php:637
2222
  msgid "Sorry, your search produced no results."
2223
  msgstr ""
2224
 
2225
- #: my-calendar-output.php:676
2226
- msgid ""
2227
- "<strong>Admin Notice:</strong> The <code>showkey</code>, <code>shownav</"
2228
- "code>, <code>showjump</code>, and <code>toggle</code> shortcode attributes "
2229
- "have been deprecated. Use <code>above</code> and <code>below</code> instead."
2230
  msgstr ""
2231
 
2232
- #: my-calendar-output.php:715
2233
  msgid "<abbr title=\"Sunday\">Sun</abbr>"
2234
  msgstr ""
2235
 
2236
- #: my-calendar-output.php:716
2237
  msgid "<abbr title=\"Monday\">Mon</abbr>"
2238
  msgstr ""
2239
 
2240
- #: my-calendar-output.php:717
2241
  msgid "<abbr title=\"Tuesday\">Tues</abbr>"
2242
  msgstr ""
2243
 
2244
- #: my-calendar-output.php:718
2245
  msgid "<abbr title=\"Wednesday\">Wed</abbr>"
2246
  msgstr ""
2247
 
2248
- #: my-calendar-output.php:719
2249
  msgid "<abbr title=\"Thursday\">Thur</abbr>"
2250
  msgstr ""
2251
 
2252
- #: my-calendar-output.php:720
2253
  msgid "<abbr title=\"Friday\">Fri</abbr>"
2254
  msgstr ""
2255
 
2256
- #: my-calendar-output.php:721
2257
  msgid "<abbr title=\"Saturday\">Sat</abbr>"
2258
  msgstr ""
2259
 
2260
- #: my-calendar-output.php:726
2261
  msgid "<abbr title=\"Sunday\">S</abbr>"
2262
  msgstr ""
2263
 
2264
- #: my-calendar-output.php:727
2265
  msgid "<abbr title=\"Monday\">M</abbr>"
2266
  msgstr ""
2267
 
2268
- #: my-calendar-output.php:728
2269
  msgid "<abbr title=\"Tuesday\">T</abbr>"
2270
  msgstr ""
2271
 
2272
- #: my-calendar-output.php:729
2273
  msgid "<abbr title=\"Wednesday\">W</abbr>"
2274
  msgstr ""
2275
 
2276
- #: my-calendar-output.php:730
2277
  msgid "<abbr title=\"Thursday\">T</abbr>"
2278
  msgstr ""
2279
 
2280
- #: my-calendar-output.php:731
2281
  msgid "<abbr title=\"Friday\">F</abbr>"
2282
  msgstr ""
2283
 
2284
- #: my-calendar-output.php:732
2285
  msgid "<abbr title=\"Saturday\">S</abbr>"
2286
  msgstr ""
2287
 
2288
- #: my-calendar-output.php:847
2289
  msgid "Print View"
2290
  msgstr ""
2291
 
2292
- #: my-calendar-output.php:954
2293
  msgid "No events scheduled for today!"
2294
  msgstr ""
2295
 
2296
- #: my-calendar-output.php:970
2297
  msgid "and"
2298
  msgstr ""
2299
 
2300
- #: my-calendar-output.php:984
2301
  msgid "Events in"
2302
  msgstr ""
2303
 
2304
- #: my-calendar-output.php:1016
2305
  msgid "There are no events scheduled during this period."
2306
  msgstr ""
2307
 
2308
- #: my-calendar-output.php:1124
2309
  msgid ""
2310
  "Unrecognized calendar format. Please use one of 'list','calendar', or 'mini'."
2311
  msgstr ""
2312
 
2313
- #: my-calendar-output.php:1147
2314
- msgid "Category Key"
2315
- msgstr ""
2316
-
2317
- #: my-calendar-output.php:1170
2318
  msgid "Subscribe by <abbr title=\"Really Simple Syndication\">RSS</abbr>"
2319
  msgstr ""
2320
 
2321
- #: my-calendar-output.php:1171
2322
  msgid "Download as <abbr title=\"iCal Events Export\">iCal</abbr>"
2323
  msgstr ""
2324
 
2325
- #: my-calendar-output.php:1194
2326
  msgid "Next events &raquo;"
2327
  msgstr ""
2328
 
2329
- #: my-calendar-output.php:1220 my-calendar-output.php:1264
2330
  msgid "Week of "
2331
  msgstr ""
2332
 
2333
- #: my-calendar-output.php:1238
2334
  msgid "&laquo; Previous events"
2335
  msgstr ""
2336
 
2337
- #: my-calendar-output.php:1290
 
 
 
 
2338
  msgid "(select to include)"
2339
  msgstr ""
2340
 
2341
- #: my-calendar-output.php:1314 my-calendar-output.php:1317
2342
  msgid "All Categories"
2343
  msgstr ""
2344
 
2345
- #: my-calendar-output.php:1315
2346
- msgid "Categories"
2347
  msgstr ""
2348
 
2349
- #: my-calendar-output.php:1336 my-calendar-output.php:1546
2350
- msgid "Submit"
2351
  msgstr ""
2352
 
2353
- #: my-calendar-output.php:1437 my-calendar-output.php:1439
2354
- msgid "Search Events"
2355
  msgstr ""
2356
 
2357
- #: my-calendar-output.php:1487 my-calendar-output.php:1508
2358
- msgid "Show all"
2359
  msgstr ""
2360
 
2361
- #: my-calendar-output.php:1506
2362
- msgid "Show events in:"
2363
  msgstr ""
2364
 
2365
- #: my-calendar-settings.php:62
2366
  msgid "Categories imported successfully."
2367
  msgstr ""
2368
 
2369
- #: my-calendar-settings.php:62
2370
  msgid "Categories not imported."
2371
  msgstr ""
2372
 
2373
- #: my-calendar-settings.php:63
2374
  msgid "Events imported successfully."
2375
  msgstr ""
2376
 
2377
- #: my-calendar-settings.php:63
2378
  msgid "Events not imported."
2379
  msgstr ""
2380
 
2381
- #: my-calendar-settings.php:88
2382
  msgid "Dropping occurrences database table"
2383
  msgstr ""
2384
 
2385
- #: my-calendar-settings.php:90
2386
  msgid "Reinstalling occurrences database table."
2387
  msgstr ""
2388
 
2389
- #: my-calendar-settings.php:92
2390
  msgid "Generating event occurrences."
2391
  msgstr ""
2392
 
2393
- #: my-calendar-settings.php:94
2394
  msgid "Event generation completed."
2395
  msgstr ""
2396
 
2397
- #: my-calendar-settings.php:103
2398
  msgid "My Calendar Cache cleared"
2399
  msgstr ""
2400
 
2401
- #: my-calendar-settings.php:112
2402
  msgid "My Calendar Management Settings saved"
2403
  msgstr ""
2404
 
2405
- #: my-calendar-settings.php:117 my-calendar-settings.php:766
2406
  msgid "Add Events"
2407
  msgstr ""
2408
 
2409
- #: my-calendar-settings.php:118 my-calendar-settings.php:767
2410
  msgid "Approve Events"
2411
  msgstr ""
2412
 
2413
- #: my-calendar-settings.php:120 my-calendar-settings.php:769
2414
  msgid "Edit Categories"
2415
  msgstr ""
2416
 
2417
- #: my-calendar-settings.php:121 my-calendar-settings.php:770
2418
  msgid "Edit Locations"
2419
  msgstr ""
2420
 
2421
- #: my-calendar-settings.php:122 my-calendar-settings.php:771
2422
  msgid "Edit Styles"
2423
  msgstr ""
2424
 
2425
- #: my-calendar-settings.php:123 my-calendar-settings.php:772
2426
  msgid "Edit Behaviors"
2427
  msgstr ""
2428
 
2429
- #: my-calendar-settings.php:124 my-calendar-settings.php:773
2430
  msgid "Edit Templates"
2431
  msgstr ""
2432
 
2433
- #: my-calendar-settings.php:125 my-calendar-settings.php:774
2434
  msgid "Edit Settings"
2435
  msgstr ""
2436
 
2437
- #: my-calendar-settings.php:126 my-calendar-settings.php:775
2438
  msgid "View Help"
2439
  msgstr ""
2440
 
2441
- #: my-calendar-settings.php:140
2442
  msgid "My Calendar Permissions Updated"
2443
  msgstr ""
2444
 
2445
- #: my-calendar-settings.php:177
2446
  msgid "Output Settings saved"
2447
  msgstr ""
2448
 
2449
- #: my-calendar-settings.php:185
2450
  msgid "Date/Time Format Settings saved"
2451
  msgstr ""
2452
 
2453
- #: my-calendar-settings.php:204
2454
  msgid "Input Settings saved"
2455
  msgstr ""
2456
 
2457
- #: my-calendar-settings.php:212
2458
  msgid "Multisite settings saved"
2459
  msgstr ""
2460
 
2461
- #: my-calendar-settings.php:241
2462
  msgid "Custom text settings saved"
2463
  msgstr ""
2464
 
2465
- #: my-calendar-settings.php:257
2466
  msgid "Email notice settings saved"
2467
  msgstr ""
2468
 
2469
- #: my-calendar-settings.php:271
2470
- msgid "User custom settings saved"
2471
- msgstr ""
2472
-
2473
- #: my-calendar-settings.php:305
2474
  msgid "My Calendar Options"
2475
  msgstr ""
2476
 
2477
- #: my-calendar-settings.php:337
2478
  msgid "My Calendar Settings"
2479
  msgstr ""
2480
 
2481
- #: my-calendar-settings.php:340
2482
  msgid "Management"
2483
  msgstr ""
2484
 
2485
- #: my-calendar-settings.php:341
2486
  msgid "Customizable Text"
2487
  msgstr ""
2488
 
2489
- #: my-calendar-settings.php:342
2490
  msgid "Output"
2491
  msgstr ""
2492
 
2493
- #: my-calendar-settings.php:344
2494
  msgid "Input"
2495
  msgstr ""
2496
 
2497
- #: my-calendar-settings.php:346
2498
  msgid "Multi-site"
2499
  msgstr ""
2500
 
2501
- #: my-calendar-settings.php:348
2502
  msgid "Permissions"
2503
  msgstr ""
2504
 
2505
- #: my-calendar-settings.php:349
2506
  msgid "Email Notifications"
2507
  msgstr ""
2508
 
2509
- #: my-calendar-settings.php:350
2510
- msgid "Individual Users"
2511
- msgstr ""
2512
-
2513
- #: my-calendar-settings.php:358
2514
  msgid "My Calendar Management"
2515
  msgstr ""
2516
 
2517
- #: my-calendar-settings.php:364
2518
- msgid "Calendar Options: Management"
2519
- msgstr ""
2520
-
2521
- #: my-calendar-settings.php:366
2522
  msgid "Get data (events, categories and locations) from a remote database."
2523
  msgstr ""
2524
 
2525
- #: my-calendar-settings.php:368
2526
  msgid "Add this code to your theme's <code>functions.php</code> file:"
2527
  msgstr ""
2528
 
2529
- #: my-calendar-settings.php:373
2530
  msgid ""
2531
  "You will need to allow remote connections from this site to the site hosting "
2532
  "your My Calendar events. Replace the above placeholders with the host-site "
@@ -2535,696 +2863,568 @@ msgid ""
2535
  "installation."
2536
  msgstr ""
2537
 
2538
- #: my-calendar-settings.php:376
2539
  msgid "Enable approval options."
2540
  msgstr ""
2541
 
2542
- #: my-calendar-settings.php:379
 
 
 
 
2543
  msgid ""
2544
  "Clear current cache. (Necessary if you edit shortcodes to change displayed "
2545
  "categories, for example.)"
2546
  msgstr ""
2547
 
2548
- #: my-calendar-settings.php:383
2549
  msgid "Default Sort order for Admin Events List"
2550
  msgstr ""
2551
 
2552
- #: my-calendar-settings.php:385
2553
  msgid "Event ID"
2554
  msgstr ""
2555
 
2556
- #: my-calendar-settings.php:387
2557
  msgid "Description"
2558
  msgstr ""
2559
 
2560
- #: my-calendar-settings.php:388
2561
  msgid "Start Date"
2562
  msgstr ""
2563
 
2564
- #: my-calendar-settings.php:396
2565
  msgid "Currently editing my local calendar"
2566
  msgstr ""
2567
 
2568
- #: my-calendar-settings.php:399
2569
  msgid "Currently editing the network calendar"
2570
  msgstr ""
2571
 
2572
- #: my-calendar-settings.php:403
2573
  msgid ""
2574
  "You are currently working in the primary site for this network; your local "
2575
  "calendar is also the global table."
2576
  msgstr ""
2577
 
2578
- #: my-calendar-settings.php:406
2579
  msgid "Re-generate event occurrences table."
2580
  msgstr ""
2581
 
2582
- #: my-calendar-settings.php:411
2583
  msgid "Save Management Settings"
2584
  msgstr ""
2585
 
2586
- #: my-calendar-settings.php:415
2587
  msgid "My Calendar management settings are only available to administrators."
2588
  msgstr ""
2589
 
2590
- #: my-calendar-settings.php:423
2591
- msgid "Calendar Text Settings"
2592
  msgstr ""
2593
 
2594
- #: my-calendar-settings.php:428
2595
- msgid "Calendar Options: Customizable Text Fields"
2596
  msgstr ""
2597
 
2598
- #: my-calendar-settings.php:430
2599
  msgid "Label for all-day events"
2600
  msgstr ""
2601
 
2602
- #: my-calendar-settings.php:431
2603
  msgid "Previous events link"
2604
  msgstr ""
2605
 
2606
- #: my-calendar-settings.php:431
2607
- msgid "Previous Events"
2608
  msgstr ""
2609
 
2610
- #: my-calendar-settings.php:431 my-calendar-settings.php:432
2611
- msgid "Use <code>{date}</code> to display the appropriate date in navigation."
2612
  msgstr ""
2613
 
2614
- #: my-calendar-settings.php:432
2615
  msgid "Next events link"
2616
  msgstr ""
2617
 
2618
- #: my-calendar-settings.php:432
2619
- msgid "Next Events"
2620
  msgstr ""
2621
 
2622
- #: my-calendar-settings.php:433
2623
  msgid "If events are open"
2624
  msgstr ""
2625
 
2626
- #: my-calendar-settings.php:433
2627
  msgid "Registration is open"
2628
  msgstr ""
2629
 
2630
- #: my-calendar-settings.php:434
2631
  msgid "If events are closed"
2632
  msgstr ""
2633
 
2634
- #: my-calendar-settings.php:434
2635
  msgid "Registration is closed"
2636
  msgstr ""
2637
 
2638
- #: my-calendar-settings.php:435
2639
  msgid "Week view caption:"
2640
  msgstr ""
2641
 
2642
- #: my-calendar-settings.php:435
2643
  msgid "Available tag: <code>{date format=\"\"}</code>"
2644
  msgstr ""
2645
 
2646
- #: my-calendar-settings.php:436
2647
  msgid "Extended caption:"
2648
  msgstr ""
2649
 
2650
- #: my-calendar-settings.php:436
2651
- msgid ""
2652
- "Caption shows month/year in list/grid formats. Follows after month/year."
2653
  msgstr ""
2654
 
2655
- #: my-calendar-settings.php:438
2656
  msgid "Event title template"
2657
  msgstr ""
2658
 
2659
- #: my-calendar-settings.php:439 my-calendar-settings.php:448
2660
- #: my-calendar-settings.php:454
2661
- msgid "All template tags are available."
2662
  msgstr ""
2663
 
2664
- #: my-calendar-settings.php:442
2665
  msgid "Event details link text"
2666
  msgstr ""
2667
 
2668
- #: my-calendar-settings.php:443
2669
  msgid ""
2670
  "Tags: <code>{title}</code>, <code>{location}</code>, <code>{color}</code>, "
2671
  "<code>{icon}</code>, <code>{date}</code>, <code>{time}</code>."
2672
  msgstr ""
2673
 
2674
- #: my-calendar-settings.php:446
2675
  msgid "Event URL link text"
2676
  msgstr ""
2677
 
2678
- #: my-calendar-settings.php:448 my-calendar-settings.php:454
2679
- msgid "Templating Help"
2680
- msgstr ""
2681
-
2682
- #: my-calendar-settings.php:452
2683
  msgid "Title element template"
2684
  msgstr ""
2685
 
2686
- #: my-calendar-settings.php:454
2687
  msgid "Current: %s"
2688
  msgstr ""
2689
 
2690
- #: my-calendar-settings.php:459
2691
  msgid "Save Custom Text Settings"
2692
  msgstr ""
2693
 
2694
- #: my-calendar-settings.php:468
2695
- msgid "Calendar Output Settings"
2696
- msgstr ""
2697
-
2698
- #: my-calendar-settings.php:473
2699
- msgid "Calendar Options: Customize the Output of your Calendar"
2700
  msgstr ""
2701
 
2702
- #: my-calendar-settings.php:475
2703
  msgid "Calendar Link Targets"
2704
  msgstr ""
2705
 
2706
- #: my-calendar-settings.php:479
2707
  msgid "Where is your main calendar page?"
2708
  msgstr ""
2709
 
2710
- #: my-calendar-settings.php:480 my-calendar-settings.php:484
2711
  msgid ""
2712
  "Can be any Page or Post which includes the <code>[my_calendar]</code> "
2713
  "shortcode."
2714
  msgstr ""
2715
 
2716
- #: my-calendar-settings.php:483
2717
  msgid ""
2718
  "Target <abbr title=\"Uniform resource locator\">URL</abbr> for mini calendar "
2719
  "date links:"
2720
  msgstr ""
2721
 
2722
- #: my-calendar-settings.php:486
2723
- msgid "Modify date and event link behaviors:"
2724
- msgstr ""
2725
-
2726
- #: my-calendar-settings.php:488
2727
  msgid "Open calendar links to event details URL"
2728
  msgstr ""
2729
 
2730
- #: my-calendar-settings.php:488
2731
- msgid "Replaces pop-up in grid view."
2732
- msgstr ""
2733
-
2734
- #: my-calendar-settings.php:491
2735
  msgid "Mini calendar widget date links to:"
2736
  msgstr ""
2737
 
2738
- #: my-calendar-settings.php:492
2739
  msgid "jQuery pop-up view"
2740
  msgstr ""
2741
 
2742
- #: my-calendar-settings.php:493
2743
  msgid "daily view page (above)"
2744
  msgstr ""
2745
 
2746
- #: my-calendar-settings.php:494
2747
  msgid "in-page anchor on main calendar page (list)"
2748
  msgstr ""
2749
 
2750
- #: my-calendar-settings.php:495
2751
  msgid "in-page anchor on main calendar page (grid)"
2752
  msgstr ""
2753
 
2754
- #: my-calendar-settings.php:497
2755
- msgid "Replaces pop-up in mini calendar"
2756
  msgstr ""
2757
 
2758
- #: my-calendar-settings.php:499
2759
- msgid "iCal times are UTC"
2760
  msgstr ""
2761
 
2762
- #: my-calendar-settings.php:505
2763
- msgid "General Layout Options"
2764
  msgstr ""
2765
 
2766
- #: my-calendar-settings.php:506
2767
- msgid ""
2768
- "Comma-separated list to indicate what order the navigational elements of My "
2769
- "Calendar should appear in."
2770
  msgstr ""
2771
 
2772
- #: my-calendar-settings.php:509
2773
- msgid "Show above the calendar:"
2774
  msgstr ""
2775
 
2776
- #: my-calendar-settings.php:510
2777
- msgid "Default: <code>nav,toggle,jump,print,timeframe</code>"
2778
  msgstr ""
2779
 
2780
- #: my-calendar-settings.php:513
2781
- msgid "Show below the calendar:"
2782
  msgstr ""
2783
 
2784
- #: my-calendar-settings.php:514
2785
- msgid "Default: <code>key,feeds</code>"
2786
  msgstr ""
2787
 
2788
  #: my-calendar-settings.php:521
 
 
 
 
2789
  msgid "Grid Layout Options"
2790
  msgstr ""
2791
 
2792
- #: my-calendar-settings.php:524
2793
  msgid "Show Weekends on Calendar"
2794
  msgstr ""
2795
 
2796
- #: my-calendar-settings.php:527
2797
  msgid "Switch to list view on mobile devices"
2798
  msgstr ""
2799
 
2800
- #: my-calendar-settings.php:534
2801
  msgid "List Layout Options"
2802
  msgstr ""
2803
 
2804
- #: my-calendar-settings.php:537
2805
  msgid "How many months of events to show at a time:"
2806
  msgstr ""
2807
 
2808
- #: my-calendar-settings.php:540
2809
  msgid ""
2810
  "Show the first event's title and the number of events that day next to the "
2811
  "date."
2812
  msgstr ""
2813
 
2814
- #: my-calendar-settings.php:547
2815
  msgid "Event Details Pop-up"
2816
  msgstr ""
2817
 
2818
- #: my-calendar-settings.php:548
2819
  msgid ""
2820
  "The checked items will be shown in your event details view. Does not apply "
2821
  "if you are using a custom template"
2822
  msgstr ""
2823
 
2824
- #: my-calendar-settings.php:551
2825
  msgid "Author's name"
2826
  msgstr ""
2827
 
2828
- #: my-calendar-settings.php:554
2829
  msgid "Link to single event iCal download"
2830
  msgstr ""
2831
 
2832
- #: my-calendar-settings.php:557
2833
  msgid "Link to submit event to Google Calendar"
2834
  msgstr ""
2835
 
2836
- #: my-calendar-settings.php:560
2837
- msgid "Category icons"
2838
  msgstr ""
2839
 
2840
- #: my-calendar-settings.php:563
2841
  msgid "Link to Google Map"
2842
  msgstr ""
2843
 
2844
- #: my-calendar-settings.php:566
2845
  msgid "Event Address"
2846
  msgstr ""
2847
 
2848
- #: my-calendar-settings.php:569
2849
  msgid "Short description"
2850
  msgstr ""
2851
 
2852
- #: my-calendar-settings.php:572
2853
  msgid "Full description"
2854
  msgstr ""
2855
 
2856
- #: my-calendar-settings.php:575
2857
  msgid "Process WordPress shortcodes in descriptions"
2858
  msgstr ""
2859
 
2860
- #: my-calendar-settings.php:578
2861
  msgid "Link to event details (requires <a href='#mc_uri'>URL</a>)"
2862
  msgstr ""
2863
 
2864
- #: my-calendar-settings.php:581
2865
  msgid "External link"
2866
  msgstr ""
2867
 
2868
- #: my-calendar-settings.php:584
2869
- msgid "Availability status"
2870
- msgstr ""
2871
-
2872
- #: my-calendar-settings.php:587
2873
- msgid "Event links expire after event passes."
2874
  msgstr ""
2875
 
2876
- #: my-calendar-settings.php:592
2877
  msgid "Event Category Display"
2878
  msgstr ""
2879
 
2880
- #: my-calendar-settings.php:595
2881
  msgid "No category colors with titles."
2882
  msgstr ""
2883
 
2884
- #: my-calendar-settings.php:596
2885
  msgid "Titles are in category colors."
2886
  msgstr ""
2887
 
2888
- #: my-calendar-settings.php:597
2889
  msgid "Titles have category color as background."
2890
  msgstr ""
2891
 
2892
- #: my-calendar-settings.php:600
2893
  msgid "Optimize contrast for category colors."
2894
  msgstr ""
2895
 
2896
- #: my-calendar-settings.php:606
2897
  msgid "Event Scheduling Defaults"
2898
  msgstr ""
2899
 
2900
- #: my-calendar-settings.php:609
2901
- msgid ""
2902
- "Default setting for event input: If a recurring event is scheduled for a "
2903
- "date which doesn't exist (such as the 5th Wednesday in February), move it "
2904
- "back one week."
2905
- msgstr ""
2906
-
2907
- #: my-calendar-settings.php:612
2908
- msgid "Holiday Category"
2909
  msgstr ""
2910
 
2911
- #: my-calendar-settings.php:614
2912
- msgid "None"
 
 
2913
  msgstr ""
2914
 
2915
- #: my-calendar-settings.php:630
2916
  msgid ""
2917
- "Default setting for event input: If an event coincides with an event in the "
2918
- "designated \"Holiday\" category, do not show the event."
2919
  msgstr ""
2920
 
2921
- #: my-calendar-settings.php:636
2922
  msgid "Save Output Settings"
2923
  msgstr ""
2924
 
2925
- #: my-calendar-settings.php:644
2926
  msgid "Calendar Time Formats"
2927
  msgstr ""
2928
 
2929
- #: my-calendar-settings.php:649
2930
  msgid "Set default date/time formats"
2931
  msgstr ""
2932
 
2933
- #: my-calendar-settings.php:653
2934
  msgid "Month format (calendar headings)"
2935
  msgstr ""
2936
 
2937
- #: my-calendar-settings.php:653 my-calendar-settings.php:655
2938
- #: my-calendar-settings.php:658 my-calendar-settings.php:661
2939
- msgid "Now:"
2940
- msgstr ""
2941
-
2942
- #: my-calendar-settings.php:655
2943
  msgid "Time format"
2944
  msgstr ""
2945
 
2946
- #: my-calendar-settings.php:658
2947
  msgid "Date in grid mode, week view"
2948
  msgstr ""
2949
 
2950
- #: my-calendar-settings.php:661
2951
  msgid "Date Format in other views"
2952
  msgstr ""
2953
 
2954
- #: my-calendar-settings.php:664
2955
  msgid ""
2956
- "Date formats use the same syntax as the <a href=\"http://php.net/date\">PHP "
2957
- "<code>date()</code> function</a>. Save options to update sample output."
 
 
 
 
2958
  msgstr ""
2959
 
2960
- #: my-calendar-settings.php:669
2961
  msgid "Save Date/Time Settings"
2962
  msgstr ""
2963
 
2964
- #: my-calendar-settings.php:679
2965
  msgid "Calendar Input Settings"
2966
  msgstr ""
2967
 
2968
- #: my-calendar-settings.php:684
2969
  msgid ""
2970
  "Select which input fields will be available when adding or editing events."
2971
  msgstr ""
2972
 
2973
- #: my-calendar-settings.php:689 my-calendar.php:393
2974
  msgid "Event Location Dropdown Menu"
2975
  msgstr ""
2976
 
2977
- #: my-calendar-settings.php:689 my-calendar.php:393
2978
  msgid "Event Short Description field"
2979
  msgstr ""
2980
 
2981
- #: my-calendar-settings.php:689 my-calendar.php:393
2982
  msgid "Event Description Field"
2983
  msgstr ""
2984
 
2985
- #: my-calendar-settings.php:689 my-calendar.php:393
2986
  msgid "Event Category field"
2987
  msgstr ""
2988
 
2989
- #: my-calendar-settings.php:689 my-calendar.php:393
2990
  msgid "Event Image field"
2991
  msgstr ""
2992
 
2993
- #: my-calendar-settings.php:689 my-calendar.php:393
2994
  msgid "Event Link field"
2995
  msgstr ""
2996
 
2997
- #: my-calendar-settings.php:689 my-calendar.php:393
2998
  msgid "Event Recurrence Options"
2999
  msgstr ""
3000
 
3001
- #: my-calendar-settings.php:689 my-calendar.php:393
3002
  msgid "Event Registration options"
3003
  msgstr ""
3004
 
3005
- #: my-calendar-settings.php:689 my-calendar.php:393
3006
  msgid "Event Location fields"
3007
  msgstr ""
3008
 
3009
- #: my-calendar-settings.php:689 my-calendar.php:393
3010
- msgid "Use HTML Editor in Event Description Field"
3011
  msgstr ""
3012
 
3013
- #: my-calendar-settings.php:689 my-calendar.php:393
3014
- msgid "Set Special Scheduling options"
3015
  msgstr ""
3016
 
3017
- #: my-calendar-settings.php:702
3018
  msgid "Administrators see all input options"
3019
  msgstr ""
3020
 
3021
- #: my-calendar-settings.php:707
3022
  msgid "Save Input Settings"
3023
  msgstr ""
3024
 
3025
- #: my-calendar-settings.php:717
3026
  msgid "Multisite Settings (Network Administrators only)"
3027
  msgstr ""
3028
 
3029
- #: my-calendar-settings.php:723
3030
- msgid "Settings for WP MultiSite configurations"
3031
  msgstr ""
3032
 
3033
- #: my-calendar-settings.php:724
3034
  msgid ""
3035
  "The central calendar is the calendar associated with the primary site in "
3036
  "your WordPress Multisite network."
3037
  msgstr ""
3038
 
3039
- #: my-calendar-settings.php:726
3040
  msgid "Site owners may only post to their local calendar"
3041
  msgstr ""
3042
 
3043
- #: my-calendar-settings.php:727
3044
  msgid "Site owners may only post to the central calendar"
3045
  msgstr ""
3046
 
3047
- #: my-calendar-settings.php:728
3048
  msgid "Site owners may manage either calendar"
3049
  msgstr ""
3050
 
3051
- #: my-calendar-settings.php:730
3052
  msgid ""
3053
  "Changes only effect input permissions. Public-facing calendars will be "
3054
  "unchanged."
3055
  msgstr ""
3056
 
3057
- #: my-calendar-settings.php:732
3058
  msgid "Sub-site calendars show events from their local calendar."
3059
  msgstr ""
3060
 
3061
- #: my-calendar-settings.php:733
3062
  msgid "Sub-site calendars show events from the central calendar."
3063
  msgstr ""
3064
 
3065
- #: my-calendar-settings.php:737
3066
  msgid "Save Multisite Settings"
3067
  msgstr ""
3068
 
3069
- #: my-calendar-settings.php:747
3070
  msgid "My Calendar Permissions"
3071
  msgstr ""
3072
 
3073
- #: my-calendar-settings.php:754
3074
- msgid "Calendar Options: Permissions"
3075
- msgstr ""
3076
-
3077
- #: my-calendar-settings.php:790
3078
  msgid "Save Permissions"
3079
  msgstr ""
3080
 
3081
- #: my-calendar-settings.php:794
3082
  msgid "My Calendar permission settings are only available to administrators."
3083
  msgstr ""
3084
 
3085
- #: my-calendar-settings.php:802
3086
  msgid "Calendar Email Settings"
3087
  msgstr ""
3088
 
3089
- #: my-calendar-settings.php:807
3090
- msgid "Calendar Options: Email Notifications"
3091
- msgstr ""
3092
-
3093
- #: my-calendar-settings.php:811
3094
  msgid "Send Email Notifications when new events are scheduled or reserved."
3095
  msgstr ""
3096
 
3097
- #: my-calendar-settings.php:814
3098
- msgid "Notification messages are sent to: "
3099
  msgstr ""
3100
 
3101
- #: my-calendar-settings.php:817
3102
- msgid "Notification messages are sent from: "
3103
  msgstr ""
3104
 
3105
- #: my-calendar-settings.php:820
3106
  msgid "Email subject"
3107
  msgstr ""
3108
 
3109
- #: my-calendar-settings.php:820
3110
- msgid "New event Added"
3111
  msgstr ""
3112
 
3113
- #: my-calendar-settings.php:823
3114
  msgid "Message Body"
3115
  msgstr ""
3116
 
3117
- #: my-calendar-settings.php:823
3118
  msgid "New Event:"
3119
  msgstr ""
3120
 
3121
- #: my-calendar-settings.php:824
3122
- msgid "Shortcode Help"
3123
- msgstr ""
3124
-
3125
- #: my-calendar-settings.php:824
3126
- msgid "All template shortcodes are available."
3127
- msgstr ""
3128
-
3129
- #: my-calendar-settings.php:827
3130
  msgid "Send HTML email"
3131
  msgstr ""
3132
 
3133
- #: my-calendar-settings.php:832
3134
  msgid "Save Email Settings"
3135
  msgstr ""
3136
 
3137
- #: my-calendar-settings.php:841
3138
- msgid "Calendar User Settings"
3139
- msgstr ""
3140
-
3141
- #: my-calendar-settings.php:849
3142
- msgid "Settings which can be configured in registered user's accounts"
3143
- msgstr ""
3144
-
3145
- #: my-calendar-settings.php:851
3146
- msgid ""
3147
- "Allow registered users to provide timezone or location presets in their user "
3148
- "profiles."
3149
- msgstr ""
3150
-
3151
- #: my-calendar-settings.php:863
3152
- msgid "Timezone Settings"
3153
- msgstr ""
3154
-
3155
- #: my-calendar-settings.php:864
3156
- msgid ""
3157
- "These settings provide registered users with the ability to select a time "
3158
- "zone in their user profile. When they view your calendar, the times for "
3159
- "events will display the time the event happens in their time zone as well as "
3160
- "the entered value."
3161
- msgstr ""
3162
-
3163
- #: my-calendar-settings.php:866
3164
- msgid "Enable Timezone"
3165
- msgstr ""
3166
-
3167
- #: my-calendar-settings.php:869
3168
- msgid "Select Timezone Label"
3169
- msgstr ""
3170
-
3171
- #: my-calendar-settings.php:872
3172
- msgid "Timezone Options"
3173
- msgstr ""
3174
-
3175
- #: my-calendar-settings.php:872 my-calendar-settings.php:896
3176
- msgid "Value, Label; one per line"
3177
- msgstr ""
3178
-
3179
- #: my-calendar-settings.php:884
3180
- msgid "Location Settings"
3181
- msgstr ""
3182
-
3183
- #: my-calendar-settings.php:885
3184
- msgid ""
3185
- "These settings provide registered users with the ability to select a "
3186
- "location in their user profile. When they view your calendar, their initial "
3187
- "view will be limited to locations which include that location parameter. "
3188
- "These values can also be used to generate custom location filtering options "
3189
- "using the <code>my_calendar_locations</code> shortcode. It is not necessary "
3190
- "to enable these settings for users to use the custom filtering options."
3191
- msgstr ""
3192
-
3193
- #: my-calendar-settings.php:887
3194
- msgid "Enable Location"
3195
- msgstr ""
3196
-
3197
- #: my-calendar-settings.php:890
3198
- msgid "Use this location list as input control"
3199
- msgstr ""
3200
-
3201
- #: my-calendar-settings.php:890
3202
- msgid ""
3203
- "The normal text entry for this location type will be replaced by a drop down "
3204
- "containing these choices."
3205
- msgstr ""
3206
-
3207
- #: my-calendar-settings.php:893
3208
- msgid "Select Location Label"
3209
- msgstr ""
3210
-
3211
- #: my-calendar-settings.php:896
3212
- msgid "Location Options"
3213
- msgstr ""
3214
-
3215
- #: my-calendar-settings.php:906
3216
- msgid "Location Type"
3217
- msgstr ""
3218
-
3219
- #: my-calendar-settings.php:919
3220
- msgid "Save User Settings"
3221
- msgstr ""
3222
-
3223
- #: my-calendar-settings.php:923
3224
- msgid ""
3225
- "Only users with the ability to edit user accounts may modify user settings."
3226
- msgstr ""
3227
-
3228
  #: my-calendar-styles.php:90
3229
  msgid "Styles are disabled, and were not edited."
3230
  msgstr ""
@@ -3255,31 +3455,31 @@ msgid ""
3255
  "your file name and location!"
3256
  msgstr ""
3257
 
3258
- #: my-calendar-styles.php:141
3259
  msgid "My Calendar Styles"
3260
  msgstr ""
3261
 
3262
- #: my-calendar-styles.php:147
3263
  msgid "Calendar Style Settings"
3264
  msgstr ""
3265
 
3266
- #: my-calendar-styles.php:155
3267
  msgid "Select My Calendar Theme"
3268
  msgstr ""
3269
 
3270
- #: my-calendar-styles.php:163
3271
  msgid "Your Custom Stylesheets"
3272
  msgstr ""
3273
 
3274
- #: my-calendar-styles.php:172
3275
  msgid "Installed Stylesheets"
3276
  msgstr ""
3277
 
3278
- #: my-calendar-styles.php:180
3279
  msgid "Choose Style"
3280
  msgstr ""
3281
 
3282
- #: my-calendar-styles.php:193
3283
  msgid ""
3284
  "My Calendar was unable to update your CSS files during the upgrade. Please "
3285
  "check your file permissions if you wish to edit your My Calendar styles. "
@@ -3287,105 +3487,117 @@ msgid ""
3287
  "be deleted from the database when you successfully update your stylesheet."
3288
  msgstr ""
3289
 
3290
- #: my-calendar-styles.php:201
3291
  msgid "CSS Style Options"
3292
  msgstr ""
3293
 
3294
- #: my-calendar-styles.php:203
3295
  msgid "Apply CSS on these pages (comma separated IDs)"
3296
  msgstr ""
3297
 
3298
- #: my-calendar-styles.php:206
3299
  msgid "Restore My Calendar stylesheet"
3300
  msgstr ""
3301
 
3302
- #: my-calendar-styles.php:206
3303
  msgid "Disable My Calendar Stylesheet"
3304
  msgstr ""
3305
 
3306
- #: my-calendar-styles.php:209
3307
  msgid "Edit the stylesheet for My Calendar"
3308
  msgstr ""
3309
 
3310
- #: my-calendar-styles.php:223
3311
  msgid "Comparing Your Style with latest installed version of My Calendar"
3312
  msgstr ""
3313
 
3314
- #: my-calendar-styles.php:227
3315
  msgid "There have been updates to the stylesheet."
3316
  msgstr ""
3317
 
3318
- #: my-calendar-styles.php:227
3319
  msgid "Compare Your Stylesheet with latest installed version of My Calendar."
3320
  msgstr ""
3321
 
3322
- #: my-calendar-styles.php:231
3323
  msgid "Your stylesheet matches that included with My Calendar."
3324
  msgstr ""
3325
 
3326
- #: my-calendar-styles.php:240
3327
  msgid ""
3328
  "Resetting your stylesheet will set your stylesheet to the version of that "
3329
  "style currently distributed with the plug-in."
3330
  msgstr ""
3331
 
3332
- #: my-calendar-templates.php:76
3333
  msgid "Map<span> to %s</span>"
3334
  msgstr ""
3335
 
3336
- #: my-calendar-templates.php:109 my-calendar-templates.php:167
3337
- msgid "Visit web site<span>: %s</span>"
 
 
 
 
 
 
 
 
 
 
 
 
3338
  msgstr ""
3339
 
3340
- #: my-calendar-templates.php:176
 
 
 
 
3341
  msgid "Daily, weekdays only"
3342
  msgstr ""
3343
 
3344
- #: my-calendar-templates.php:178
3345
  msgid "Bi-weekly"
3346
  msgstr ""
3347
 
3348
- #: my-calendar-templates.php:179
3349
- msgid "Date of Month (the %s of each month)"
3350
  msgstr ""
3351
 
3352
- #: my-calendar-templates.php:180
3353
- msgid "Day of Month (the %s %s of each month)"
3354
  msgstr ""
3355
 
3356
- #: my-calendar-templates.php:181
3357
  msgid "Annually"
3358
  msgstr ""
3359
 
3360
- #: my-calendar-templates.php:311
3361
- msgid "<span class=\"screenreader\">Send %1$s to </span>Google Calendar"
3362
- msgstr ""
3363
-
3364
- #: my-calendar-templating.php:21
3365
  msgid "Grid Output Template saved"
3366
  msgstr ""
3367
 
3368
- #: my-calendar-templating.php:33
3369
  msgid "RSS Feed Output Template saved"
3370
  msgstr ""
3371
 
3372
- #: my-calendar-templating.php:45
3373
  msgid "List Output Template saved"
3374
  msgstr ""
3375
 
3376
- #: my-calendar-templating.php:56
3377
  msgid "Mini Output Template saved"
3378
  msgstr ""
3379
 
3380
- #: my-calendar-templating.php:67
3381
  msgid "Event Details Template saved"
3382
  msgstr ""
3383
 
3384
- #: my-calendar-templating.php:85
3385
  msgid "My Calendar Information Templates"
3386
  msgstr ""
3387
 
3388
- #: my-calendar-templating.php:90
3389
  msgid ""
3390
  "Advanced users may customize the HTML template for each event. This page "
3391
  "lets you create a customized view of your events in each context. All "
@@ -3395,93 +3607,93 @@ msgid ""
3395
  "settings.</strong>"
3396
  msgstr ""
3397
 
3398
- #: my-calendar-templating.php:90
3399
  msgid "Templates Help"
3400
  msgstr ""
3401
 
3402
- #: my-calendar-templating.php:95
3403
  msgid "My Calendar: Grid Event Template"
3404
  msgstr ""
3405
 
3406
- #: my-calendar-templating.php:100
3407
  msgid "Use this grid event template"
3408
  msgstr ""
3409
 
3410
- #: my-calendar-templating.php:103
3411
  msgid "Your custom template for events in the calendar grid output."
3412
  msgstr ""
3413
 
3414
- #: my-calendar-templating.php:106
3415
  msgid "Save Grid Template"
3416
  msgstr ""
3417
 
3418
- #: my-calendar-templating.php:115
3419
  msgid "My Calendar: List Event Template"
3420
  msgstr ""
3421
 
3422
- #: my-calendar-templating.php:120
3423
  msgid "Use this list event template"
3424
  msgstr ""
3425
 
3426
- #: my-calendar-templating.php:123
3427
  msgid "Your custom template for events in calendar list output."
3428
  msgstr ""
3429
 
3430
- #: my-calendar-templating.php:126
3431
  msgid "Save List Template"
3432
  msgstr ""
3433
 
3434
- #: my-calendar-templating.php:135
3435
  msgid "My Calendar: Mini Calendar Template"
3436
  msgstr ""
3437
 
3438
- #: my-calendar-templating.php:140
3439
  msgid "Use this mini event template"
3440
  msgstr ""
3441
 
3442
- #: my-calendar-templating.php:143
3443
  msgid "Your custom template for events in sidebar/mini calendar output."
3444
  msgstr ""
3445
 
3446
- #: my-calendar-templating.php:146
3447
  msgid "Save Mini Template"
3448
  msgstr ""
3449
 
3450
- #: my-calendar-templating.php:155
3451
  msgid "My Calendar: Event Details Page Template"
3452
  msgstr ""
3453
 
3454
- #: my-calendar-templating.php:160
3455
  msgid "Use this details template"
3456
  msgstr ""
3457
 
3458
- #: my-calendar-templating.php:163
3459
  msgid "Your custom template for events on the event details page."
3460
  msgstr ""
3461
 
3462
- #: my-calendar-templating.php:166
3463
  msgid "Save Details Template"
3464
  msgstr ""
3465
 
3466
- #: my-calendar-templating.php:175
3467
  msgid "My Calendar: RSS Event Template"
3468
  msgstr ""
3469
 
3470
- #: my-calendar-templating.php:177
3471
  msgid ""
3472
  "Notice: HTML templates are very forgiving of errors. RSS templates are not. "
3473
  "Be sure to test your changes."
3474
  msgstr ""
3475
 
3476
- #: my-calendar-templating.php:181
3477
  msgid "Use this custom RSS event template"
3478
  msgstr ""
3479
 
3480
- #: my-calendar-templating.php:184
3481
  msgid "Your custom template for events in the RSS feed."
3482
  msgstr ""
3483
 
3484
- #: my-calendar-templating.php:187
3485
  msgid "Save RSS Template"
3486
  msgstr ""
3487
 
@@ -3504,302 +3716,282 @@ msgid ""
3504
  "database is up to date. If you can't add events, upgrade your database!"
3505
  msgstr ""
3506
 
3507
- #: my-calendar-user.php:38
3508
- msgid "My Calendar User Settings"
3509
- msgstr ""
3510
-
3511
  #: my-calendar-widgets.php:6
3512
  msgid "My Calendar: Simple Event Search"
3513
  msgstr ""
3514
 
3515
- #: my-calendar-widgets.php:20
3516
  msgid "My Calendar: Today's Events"
3517
  msgstr ""
3518
 
3519
- #: my-calendar-widgets.php:66 my-calendar-widgets.php:165
3520
- msgid "Template"
3521
- msgstr ""
3522
-
3523
- #: my-calendar-widgets.php:69
3524
  msgid "Add calendar URL to use this option."
3525
  msgstr ""
3526
 
3527
- #: my-calendar-widgets.php:71 my-calendar-widgets.php:173
3528
  msgid "Widget title links to:"
3529
  msgstr ""
3530
 
3531
- #: my-calendar-widgets.php:75
3532
  msgid "Show this text if there are no events today:"
3533
  msgstr ""
3534
 
3535
- #: my-calendar-widgets.php:79 my-calendar-widgets.php:207
3536
- #: my-calendar-widgets.php:675
3537
  msgid "Category or categories to display:"
3538
  msgstr ""
3539
 
3540
- #: my-calendar-widgets.php:83 my-calendar-widgets.php:211
3541
  msgid "Author or authors to show:"
3542
  msgstr ""
3543
 
3544
- #: my-calendar-widgets.php:87 my-calendar-widgets.php:215
3545
  msgid "Host or hosts to show:"
3546
  msgstr ""
3547
 
3548
- #: my-calendar-widgets.php:110
3549
  msgid "My Calendar: Upcoming Events"
3550
  msgstr ""
3551
 
3552
- #: my-calendar-widgets.php:169
3553
  msgid "Widget Options"
3554
  msgstr ""
3555
 
3556
- #: my-calendar-widgets.php:177
3557
  msgid "Display upcoming events by:"
3558
  msgstr ""
3559
 
3560
- #: my-calendar-widgets.php:178
3561
  msgid "Events (e.g. 2 past, 3 future)"
3562
  msgstr ""
3563
 
3564
- #: my-calendar-widgets.php:179
3565
  msgid "Dates (e.g. 4 days past, 5 forward)"
3566
  msgstr ""
3567
 
3568
- #: my-calendar-widgets.php:180
3569
  msgid "Show current month"
3570
  msgstr ""
3571
 
3572
- #: my-calendar-widgets.php:181
3573
  msgid "Show current year"
3574
  msgstr ""
3575
 
3576
- #: my-calendar-widgets.php:185
3577
  msgid "Skip the first <em>n</em> events"
3578
  msgstr ""
3579
 
3580
- #: my-calendar-widgets.php:188
3581
  msgid "Events sort order:"
3582
  msgstr ""
3583
 
3584
- #: my-calendar-widgets.php:189
3585
  msgid "Ascending (near to far)"
3586
  msgstr ""
3587
 
3588
- #: my-calendar-widgets.php:190
3589
  msgid "Descending (far to near)"
3590
  msgstr ""
3591
 
3592
- #: my-calendar-widgets.php:200
3593
  msgid "Include today's events"
3594
  msgstr ""
3595
 
3596
- #: my-calendar-widgets.php:203
3597
  msgid "Show this text if there are no events meeting your criteria:"
3598
  msgstr ""
3599
 
3600
- #: my-calendar-widgets.php:610
3601
  msgid "My Calendar: Mini Calendar"
3602
  msgstr ""
3603
 
3604
- #: my-calendar-widgets.php:639
3605
  msgid "Calendar"
3606
  msgstr ""
3607
 
3608
- #: my-calendar-widgets.php:671
3609
  msgid "Widget Title Link"
3610
  msgstr ""
3611
 
3612
- #: my-calendar-widgets.php:710
3613
  msgid "Mini-Calendar Timespan:"
3614
  msgstr ""
3615
 
3616
- #: my-calendar.php:136
3617
  msgid "My Calendar: Submissions"
3618
  msgstr ""
3619
 
3620
- #: my-calendar.php:138
3621
  msgid ""
3622
  "Buy the <a href='http://www.joedolson.com/articles/my-calendar/submissions/' "
3623
- "rel='external'>My Calendar: Submissions add-on</a> &mdash; let your site's "
3624
- "visitors help build your calendar."
3625
  msgstr ""
3626
 
3627
- #: my-calendar.php:139
3628
  msgid "Learn more!"
3629
  msgstr ""
3630
 
3631
- #: my-calendar.php:146
3632
  msgid "Support This Plug-in"
3633
  msgstr ""
3634
 
3635
- #: my-calendar.php:152
3636
  msgid "Help me help you:"
3637
  msgstr ""
3638
 
3639
- #: my-calendar.php:152
3640
  msgid "Buy the My Calendar User's Guide"
3641
  msgstr ""
3642
 
3643
- #: my-calendar.php:153
3644
  msgid ""
3645
  "<strong>Or make a donation today!</strong> Every donation counts - donate "
3646
- "$2, $10, or $100 and help me keep this plug-in running!"
3647
  msgstr ""
3648
 
3649
- #: my-calendar.php:158 my-calendar.php:161
3650
  msgid "Make a Donation"
3651
  msgstr ""
3652
 
3653
- #: my-calendar.php:169
3654
  msgid "Get Help"
3655
  msgstr ""
3656
 
3657
- #: my-calendar.php:173
3658
  msgid "Get Support"
3659
  msgstr ""
3660
 
3661
- #: my-calendar.php:175
3662
  msgid "Check out my other plug-ins"
3663
  msgstr ""
3664
 
3665
- #: my-calendar.php:176
3666
  msgid "Rate this plug-in 5 stars!"
3667
  msgstr ""
3668
 
3669
- #: my-calendar.php:177
3670
  msgid "Help translate this plug-in!"
3671
  msgstr ""
3672
 
3673
- #: my-calendar.php:202
3674
  msgid "Title of the event."
3675
  msgstr ""
3676
 
3677
- #: my-calendar.php:205
3678
  msgid ""
3679
  "Title of the event as a link if a URL is present, or the title alone if not."
3680
  msgstr ""
3681
 
3682
- #: my-calendar.php:208
3683
  msgid "Start time for the event."
3684
  msgstr ""
3685
 
3686
- #: my-calendar.php:211
3687
- msgid "Event times adjusted to the current user's time zone if set."
3688
- msgstr ""
3689
-
3690
- #: my-calendar.php:214
3691
  msgid "Date on which the event begins."
3692
  msgstr ""
3693
 
3694
- #: my-calendar.php:217
3695
- msgid "Date on which the event ends."
3696
- msgstr ""
3697
-
3698
- #: my-calendar.php:220
3699
- msgid "Time at which the event ends."
3700
- msgstr ""
3701
-
3702
- #: my-calendar.php:223
3703
  msgid "Beginning date to end date; excludes end date if same as beginning."
3704
  msgstr ""
3705
 
3706
- #: my-calendar.php:226
3707
  msgid ""
3708
  "Multi-day events: an unordered list of dates/times. Otherwise, beginning "
3709
  "date/time."
3710
  msgstr ""
3711
 
3712
- #: my-calendar.php:229
3713
  msgid "Author who posted the event."
3714
  msgstr ""
3715
 
3716
- #: my-calendar.php:232
3717
  msgid "Name of the assigned host for the event."
3718
  msgstr ""
3719
 
3720
- #: my-calendar.php:235
3721
- msgid "Email for the person assigned as host."
3722
- msgstr ""
3723
-
3724
- #: my-calendar.php:238
3725
  msgid "Short event description."
3726
  msgstr ""
3727
 
3728
- #: my-calendar.php:241
3729
  msgid "Description of the event."
3730
  msgstr ""
3731
 
3732
- #: my-calendar.php:244
3733
  msgid "Image associated with the event."
3734
  msgstr ""
3735
 
3736
- #: my-calendar.php:247
3737
  msgid "URL provided for the event."
3738
  msgstr ""
3739
 
3740
- #: my-calendar.php:250
3741
  msgid "Link to an auto-generated page containing information about the event."
3742
  msgstr ""
3743
 
3744
- #: my-calendar.php:253
3745
  msgid "Whether event is currently open for registration."
3746
  msgstr ""
3747
 
3748
- #: my-calendar.php:256
3749
  msgid "Current status of event: either \"Published\" or \"Reserved.\""
3750
  msgstr ""
3751
 
3752
- #: my-calendar.php:262
3753
  msgid "Name of the location of the event."
3754
  msgstr ""
3755
 
3756
- #: my-calendar.php:265
3757
  msgid "First line of the site address."
3758
  msgstr ""
3759
 
3760
- #: my-calendar.php:268
3761
  msgid "Second line of the site address."
3762
  msgstr ""
3763
 
3764
- #: my-calendar.php:280
3765
  msgid "Custom region."
3766
  msgstr ""
3767
 
3768
- #: my-calendar.php:283
3769
  msgid "Country for the event location."
3770
  msgstr ""
3771
 
3772
- #: my-calendar.php:286
3773
  msgid "Output the URL for the location."
3774
  msgstr ""
3775
 
3776
- #: my-calendar.php:289
3777
  msgid ""
3778
  "Event address in <a href=\"http://microformats.org/wiki/hcard\">hcard</a> "
3779
  "format."
3780
  msgstr ""
3781
 
3782
- #: my-calendar.php:292
3783
  msgid "Link to Google Map to the event, if address information is available."
3784
  msgstr ""
3785
 
3786
- #: my-calendar.php:298
3787
  msgid "Name of the category of the event."
3788
  msgstr ""
3789
 
3790
- #: my-calendar.php:301
3791
  msgid "URL for the event's category icon."
3792
  msgstr ""
3793
 
3794
- #: my-calendar.php:304
3795
  msgid "Hex code for the event's category color."
3796
  msgstr ""
3797
 
3798
- #: my-calendar.php:307
3799
  msgid "ID of the category of the event."
3800
  msgstr ""
3801
 
3802
- #. #-#-#-#-# plugin.pot (My Calendar 2.2.10) #-#-#-#-#
 
 
 
 
3803
  #. Plugin Name of the plugin/theme
3804
  #: my-calendar.php:327 my-calendar.php:329 my-calendar.php:334
3805
  #: my-calendar.php:336
@@ -3810,39 +4002,43 @@ msgstr ""
3810
  msgid "Add New Event"
3811
  msgstr ""
3812
 
3813
- #: my-calendar.php:353
3814
- msgid "Style Editor"
 
 
 
 
 
 
 
 
3815
  msgstr ""
3816
 
3817
  #: my-calendar.php:354
3818
- msgid "Script Editor"
3819
  msgstr ""
3820
 
3821
  #: my-calendar.php:355
3822
- msgid "Template Editor"
3823
  msgstr ""
3824
 
3825
- #: my-calendar.php:363
3826
- msgid "Event Submissions"
3827
  msgstr ""
3828
 
3829
  #: my-calendar.php:364
3830
- msgid "Payments"
3831
- msgstr ""
3832
-
3833
- #: my-calendar.php:370
3834
- msgid "Event Registrations"
3835
  msgstr ""
3836
 
3837
- #: my-calendar.php:371
3838
- msgid "Registration Payments"
3839
  msgstr ""
3840
 
3841
- #: my-calendar.php:405
3842
  msgid "Apply"
3843
  msgstr ""
3844
 
3845
- #: my-calendar.php:408
3846
  msgid "Event editing fields to show"
3847
  msgstr ""
3848
 
1
+ # Copyright (C) 2014 My Calendar
2
  # This file is distributed under the same license as the My Calendar package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: My Calendar 2.2.14\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/my-calendar\n"
7
+ "POT-Creation-Date: 2014-04-08 00:54:28+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2014-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
+ #: my-calendar-api.php:25
16
+ msgid "The My Calendar API is not enabled."
17
  msgstr ""
18
 
19
+ #: my-calendar-behaviors.php:33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  msgid "Behavior Settings saved"
21
  msgstr ""
22
 
23
+ #: my-calendar-behaviors.php:48
24
  msgid "My Calendar Behaviors"
25
  msgstr ""
26
 
27
+ #: my-calendar-behaviors.php:55
28
  msgid "Calendar Behavior Settings"
29
  msgstr ""
30
 
31
+ #: my-calendar-behaviors.php:60
32
  msgid "Insert scripts on these pages (comma separated post IDs)"
33
  msgstr ""
34
 
35
+ #: my-calendar-behaviors.php:63
36
+ msgid "Calendar Behaviors: Grid View"
37
  msgstr ""
38
 
39
+ #: my-calendar-behaviors.php:65
40
+ msgid "Update Grid View JavaScript"
41
  msgstr ""
42
 
43
+ #: my-calendar-behaviors.php:65
44
+ msgid "Disable Grid Javascript"
45
  msgstr ""
46
 
47
+ #: my-calendar-behaviors.php:68
48
+ msgid "Edit jQuery scripts for My Calendar in Grid View"
49
  msgstr ""
50
 
51
+ #: my-calendar-behaviors.php:75 my-calendar-behaviors.php:105
52
+ #: my-calendar-behaviors.php:135 my-calendar-behaviors.php:165
53
  msgid "Comparing scripts with latest installed version of My Calendar"
54
  msgstr ""
55
 
56
+ #: my-calendar-behaviors.php:75 my-calendar-behaviors.php:105
57
+ #: my-calendar-behaviors.php:135 my-calendar-behaviors.php:165
58
+ #: my-calendar-styles.php:217
59
  msgid "Latest (from plugin)"
60
  msgstr ""
61
 
62
+ #: my-calendar-behaviors.php:75 my-calendar-behaviors.php:105
63
+ #: my-calendar-behaviors.php:135 my-calendar-behaviors.php:165
64
+ #: my-calendar-styles.php:217
65
  msgid "Current (in use)"
66
  msgstr ""
67
 
68
+ #: my-calendar-behaviors.php:79
69
  msgid "There have been updates to the calendar view scripts."
70
  msgstr ""
71
 
72
+ #: my-calendar-behaviors.php:79 my-calendar-behaviors.php:109
73
+ #: my-calendar-behaviors.php:139 my-calendar-behaviors.php:169
74
  msgid "Compare your scripts with latest installed version of My Calendar."
75
  msgstr ""
76
 
77
+ #: my-calendar-behaviors.php:83 my-calendar-behaviors.php:113
78
+ #: my-calendar-behaviors.php:143 my-calendar-behaviors.php:173
79
  msgid "Your script matches that included with My Calendar."
80
  msgstr ""
81
 
82
+ #: my-calendar-behaviors.php:88 my-calendar-behaviors.php:118
83
+ #: my-calendar-behaviors.php:148 my-calendar-behaviors.php:179
84
  msgid "Save"
85
  msgstr ""
86
 
87
+ #: my-calendar-behaviors.php:93
88
  msgid "Calendar Behaviors: List View"
89
  msgstr ""
90
 
91
+ #: my-calendar-behaviors.php:95
92
+ msgid "Update List JavaScript"
93
  msgstr ""
94
 
95
+ #: my-calendar-behaviors.php:95
96
+ msgid "Disable List JavaScript"
97
  msgstr ""
98
 
99
+ #: my-calendar-behaviors.php:98
100
  msgid "Edit the jQuery scripts for My Calendar in List format"
101
  msgstr ""
102
 
103
+ #: my-calendar-behaviors.php:109
104
  msgid "There have been updates to the list view scripts."
105
  msgstr ""
106
 
107
+ #: my-calendar-behaviors.php:123
108
  msgid "Calendar Behaviors: Mini Calendar View"
109
  msgstr ""
110
 
111
+ #: my-calendar-behaviors.php:125
112
+ msgid "Update Mini View JavaScript"
113
  msgstr ""
114
 
115
+ #: my-calendar-behaviors.php:125
116
+ msgid "Disable Mini JavaScript"
117
  msgstr ""
118
 
119
+ #: my-calendar-behaviors.php:128
120
+ msgid "Edit jQuery scripts in Mini view"
121
  msgstr ""
122
 
123
+ #: my-calendar-behaviors.php:139
124
  msgid "There have been updates to the mini view scripts."
125
  msgstr ""
126
 
127
+ #: my-calendar-behaviors.php:153
128
+ msgid "Calendar Behaviors: AJAX"
129
  msgstr ""
130
 
131
+ #: my-calendar-behaviors.php:155
132
+ msgid "Update AJAX JavaScript"
133
  msgstr ""
134
 
135
+ #: my-calendar-behaviors.php:155
136
+ msgid "Disable AJAX Navigation"
137
  msgstr ""
138
 
139
+ #: my-calendar-behaviors.php:158
140
+ msgid "Edit jQuery scripts for AJAX navigation"
141
  msgstr ""
142
 
143
+ #: my-calendar-behaviors.php:169
144
  msgid "There have been updates to the AJAX scripts."
145
  msgstr ""
146
 
147
+ #: my-calendar-behaviors.php:185
148
  msgid ""
149
  "Resetting JavaScript will set that script to the version currently "
150
  "distributed with the plug-in."
151
  msgstr ""
152
 
153
+ #: my-calendar-categories.php:99 my-calendar-categories.php:139
154
  msgid "Default category changed."
155
  msgstr ""
156
 
157
+ #: my-calendar-categories.php:102
158
  msgid "Category added successfully"
159
  msgstr ""
160
 
161
+ #: my-calendar-categories.php:104
162
  msgid "Category addition failed."
163
  msgstr ""
164
 
165
+ #: my-calendar-categories.php:119
166
  msgid "Category deleted successfully. Categories in calendar updated."
167
  msgstr ""
168
 
169
+ #: my-calendar-categories.php:121
170
  msgid "Category deleted successfully. Categories in calendar not updated."
171
  msgstr ""
172
 
173
+ #: my-calendar-categories.php:123
174
  msgid "Category not deleted. Categories in calendar updated."
175
  msgstr ""
176
 
177
+ #: my-calendar-categories.php:145
178
+ msgid "Holiday category changed."
179
+ msgstr ""
180
+
181
  #: my-calendar-categories.php:152
182
  msgid "Category edited successfully."
183
  msgstr ""
187
  msgstr ""
188
 
189
  #: my-calendar-categories.php:188 my-calendar-categories.php:214
190
+ #: my-calendar-categories.php:239
191
  msgid "Add Category"
192
  msgstr ""
193
 
199
  msgid "Category Editor"
200
  msgstr ""
201
 
202
+ #: my-calendar-categories.php:221 my-calendar-categories.php:287
203
  msgid "Category Name"
204
  msgstr ""
205
 
206
+ #: my-calendar-categories.php:221
207
+ msgid "Color"
208
  msgstr ""
209
 
210
+ #: my-calendar-categories.php:222 my-calendar-categories.php:289
211
  msgid "Category Icon"
212
  msgstr ""
213
 
214
+ #: my-calendar-categories.php:234
215
+ msgid "Private category (logged-in users only)"
216
+ msgstr ""
217
+
218
+ #: my-calendar-categories.php:235
219
  msgid "Default category"
220
  msgstr ""
221
 
222
+ #: my-calendar-categories.php:236
223
+ msgid "Holiday Category"
224
  msgstr ""
225
 
226
+ #: my-calendar-categories.php:239 my-calendar-locations.php:162
227
+ #: my-calendar-styles.php:207
228
  msgid "Save Changes"
229
  msgstr ""
230
 
231
+ #: my-calendar-categories.php:247
232
  msgid "Add a New Category"
233
  msgstr ""
234
 
235
+ #: my-calendar-categories.php:251
236
  msgid "Category List"
237
  msgstr ""
238
 
239
+ #: my-calendar-categories.php:273 my-calendar.php:349
240
  msgid "Manage Categories"
241
  msgstr ""
242
 
243
+ #: my-calendar-categories.php:286 my-calendar-event-manager.php:1294
244
+ #: my-calendar-group-manager.php:763 my-calendar-locations.php:243
245
  msgid "ID"
246
  msgstr ""
247
 
248
+ #: my-calendar-categories.php:288
249
  msgid "Category Color"
250
  msgstr ""
251
 
252
+ #: my-calendar-categories.php:290
253
  msgid "Private"
254
  msgstr ""
255
 
256
+ #: my-calendar-categories.php:291 my-calendar-categories.php:309
257
+ #: my-calendar-event-manager.php:1335 my-calendar-locations.php:245
258
+ #: my-calendar-locations.php:257 my-calendar-output.php:369
259
  msgid "Edit"
260
  msgstr ""
261
 
262
+ #: my-calendar-categories.php:292 my-calendar-categories.php:313
263
+ #: my-calendar-event-manager.php:173 my-calendar-event-manager.php:896
264
+ #: my-calendar-event-manager.php:1338 my-calendar-locations.php:246
265
+ #: my-calendar-locations.php:258 my-calendar-output.php:369
266
  msgid "Delete"
267
  msgstr ""
268
 
269
+ #: my-calendar-categories.php:305
270
+ msgid "(Default)"
271
+ msgstr ""
272
+
273
+ #: my-calendar-categories.php:305
274
+ msgid "(Holiday)"
275
+ msgstr ""
276
+
277
+ #: my-calendar-categories.php:308
278
  msgid "Yes"
279
  msgstr ""
280
 
281
+ #: my-calendar-categories.php:308
282
  msgid "No"
283
  msgstr ""
284
 
285
+ #: my-calendar-categories.php:311 my-calendar-group-manager.php:827
286
+ #: my-calendar-output.php:99
287
  msgid "N/A"
288
  msgstr ""
289
 
290
+ #: my-calendar-categories.php:313 my-calendar-locations.php:258
291
  msgid "Are you sure you want to delete this category?"
292
  msgstr ""
293
 
294
+ #: my-calendar-categories.php:319
295
  msgid "There are no categories in the database - or something has gone wrong!"
296
  msgstr ""
297
 
298
+ #: my-calendar-core.php:55 my-calendar.php:357
299
  msgid "Settings"
300
  msgstr ""
301
 
302
+ #: my-calendar-core.php:56 my-calendar.php:358
303
  msgid "Help"
304
  msgstr ""
305
 
306
+ #: my-calendar-core.php:309
307
+ msgid "Characters left: "
308
+ msgstr ""
309
+
310
+ #: my-calendar-core.php:327
311
  msgid ""
312
  "<br /><strong>Note:</strong> Please review the <a class=\"thickbox\" href="
313
  "\"%1$s\">changelog</a> before upgrading."
314
  msgstr ""
315
 
316
+ #: my-calendar-core.php:597 my-calendar-install.php:367
317
+ msgid "Accessible Entrance"
318
+ msgstr ""
319
+
320
+ #: my-calendar-core.php:598 my-calendar-install.php:368
321
+ msgid "Accessible Parking Designated"
322
+ msgstr ""
323
+
324
+ #: my-calendar-core.php:599 my-calendar-install.php:369
325
+ msgid "Accessible Restrooms"
326
+ msgstr ""
327
+
328
+ #: my-calendar-core.php:600 my-calendar-install.php:370
329
+ msgid "Accessible Seating"
330
+ msgstr ""
331
+
332
+ #: my-calendar-core.php:601 my-calendar-install.php:371
333
+ msgid "Accessible Transportation Available"
334
+ msgstr ""
335
+
336
+ #: my-calendar-core.php:602 my-calendar-install.php:372
337
+ msgid "Wheelchair Accessible"
338
+ msgstr ""
339
+
340
+ #: my-calendar-core.php:603 my-calendar-install.php:373
341
+ msgid "Courtesy Wheelchairs"
342
+ msgstr ""
343
+
344
+ #: my-calendar-core.php:604 my-calendar-install.php:374
345
+ msgid "Bariatric Seating Available"
346
+ msgstr ""
347
+
348
+ #: my-calendar-core.php:605 my-calendar-install.php:375
349
+ msgid "Elevator to all public areas"
350
+ msgstr ""
351
+
352
+ #: my-calendar-core.php:606 my-calendar-install.php:376
353
+ msgid "Braille Signage"
354
+ msgstr ""
355
+
356
+ #: my-calendar-core.php:607 my-calendar-install.php:377
357
+ msgid "Fragrance-Free Policy"
358
+ msgstr ""
359
+
360
+ #: my-calendar-core.php:608 my-calendar-core.php:622
361
+ #: my-calendar-install.php:378 my-calendar-install.php:392
362
+ msgid "Other"
363
+ msgstr ""
364
+
365
+ #: my-calendar-core.php:611 my-calendar-install.php:381
366
+ msgid "Audio Description"
367
+ msgstr ""
368
+
369
+ #: my-calendar-core.php:612 my-calendar-install.php:382
370
+ msgid "ASL Interpretation"
371
+ msgstr ""
372
+
373
+ #: my-calendar-core.php:613 my-calendar-install.php:383
374
+ msgid "ASL Interpretation with voicing"
375
+ msgstr ""
376
+
377
+ #: my-calendar-core.php:614 my-calendar-install.php:384
378
+ msgid "Deaf-Blind ASL"
379
+ msgstr ""
380
+
381
+ #: my-calendar-core.php:615 my-calendar-install.php:385
382
+ msgid "Real-time Captioning"
383
+ msgstr ""
384
+
385
+ #: my-calendar-core.php:616 my-calendar-install.php:386
386
+ msgid "Scripted Captioning"
387
+ msgstr ""
388
+
389
+ #: my-calendar-core.php:617 my-calendar-install.php:387
390
+ msgid "Assisted Listening Devices"
391
+ msgstr ""
392
+
393
+ #: my-calendar-core.php:618 my-calendar-install.php:388
394
+ msgid "Tactile/Touch Tour"
395
+ msgstr ""
396
+
397
+ #: my-calendar-core.php:619 my-calendar-install.php:389
398
+ msgid "Braille Playbill"
399
+ msgstr ""
400
+
401
+ #: my-calendar-core.php:620 my-calendar-install.php:390
402
+ msgid "Large Print Playbill"
403
+ msgstr ""
404
+
405
+ #: my-calendar-core.php:621 my-calendar-install.php:391
406
+ msgid "Sensory Friendly"
407
+ msgstr ""
408
+
409
+ #: my-calendar-core.php:1054 my-calendar-event-manager.php:427
410
+ #: my-calendar-event-manager.php:898
411
  msgid "Add Event"
412
  msgstr ""
413
 
414
+ #: my-calendar-core.php:1059 my-calendar-core.php:1707
415
+ #: my-calendar-generator.php:145
416
+ msgid "Events"
417
+ msgstr ""
418
+
419
+ #: my-calendar-core.php:1064 my-calendar-output.php:1168
420
+ #: my-calendar-output.php:1371 my-calendar-settings.php:519
421
+ msgid "Categories"
422
+ msgstr ""
423
+
424
+ #: my-calendar-core.php:1069
425
+ msgid "Locations"
426
+ msgstr ""
427
+
428
+ #: my-calendar-core.php:1129
429
  msgid "Event Notifications"
430
  msgstr ""
431
 
432
+ #: my-calendar-core.php:1282
433
  msgid "Is this your calendar page?"
434
  msgstr ""
435
 
436
+ #: my-calendar-core.php:1380
437
  msgid ""
438
  "Please read the FAQ and other Help documents before making a support request."
439
  msgstr ""
440
 
441
+ #: my-calendar-core.php:1382
442
  msgid "Please describe your problem in detail. I'm not psychic."
443
  msgstr ""
444
 
445
+ #: my-calendar-core.php:1387
446
  msgid ""
447
  "Thank you for supporting the continuing development of this plug-in! I'll "
448
  "get back to you as soon as I can."
449
  msgstr ""
450
 
451
+ #: my-calendar-core.php:1389
452
  msgid ""
453
  "I'll get back to you as soon as I can, after dealing with any support "
454
  "requests from plug-in supporters."
455
  msgstr ""
456
 
457
+ #: my-calendar-core.php:1392
458
+ msgid "Sorry! I couldn't send that message. Here's the text of your request:"
459
+ msgstr ""
460
+
461
+ #: my-calendar-core.php:1402
462
  msgid ""
463
  "Please note: I do keep records of those who have donated, <strong>but if "
464
  "your donation came from somebody other than your account at this web site, "
465
  "please note this in your message.</strong>"
466
  msgstr ""
467
 
468
+ #: my-calendar-core.php:1404
469
  msgid "From:"
470
  msgstr ""
471
 
472
+ #: my-calendar-core.php:1407
473
  msgid ""
474
  "I have read <a href=\"http://www.joedolson.com/articles/my-calendar/faq/"
475
  "\">the FAQ for this plug-in</a>."
476
  msgstr ""
477
 
478
+ #: my-calendar-core.php:1410
479
  msgid ""
480
  "I have <a href=\"http://www.joedolson.com/donate.php\">made a donation to "
481
  "help support this plug-in</a>."
482
  msgstr ""
483
 
484
+ #: my-calendar-core.php:1413
485
  msgid ""
486
  "I have <a href=\"http://www.joedolson.com/articles/my-calendar/users-guide/"
487
  "\">purchased the User's Guide</a>, but could not find an answer to this "
488
  "question."
489
  msgstr ""
490
 
491
+ #: my-calendar-core.php:1419
492
  msgid "Send Support Request"
493
  msgstr ""
494
 
495
+ #: my-calendar-core.php:1422
496
  msgid ""
497
  "The following additional information will be sent with your support request:"
498
  msgstr ""
499
 
500
+ #: my-calendar-core.php:1442 my-calendar-templates.php:515
501
  msgid "Does not recur"
502
  msgstr ""
503
 
504
+ #: my-calendar-core.php:1443 my-calendar-generator.php:146
505
  msgid "Days"
506
  msgstr ""
507
 
508
+ #: my-calendar-core.php:1444
509
  msgid "Days, weekdays only"
510
  msgstr ""
511
 
512
+ #: my-calendar-core.php:1445
513
  msgid "Weeks"
514
  msgstr ""
515
 
516
+ #: my-calendar-core.php:1446
517
  msgid "Months by date (e.g., the 24th of each month)"
518
  msgstr ""
519
 
520
+ #: my-calendar-core.php:1447
521
  msgid "Month by day (e.g., the 3rd Monday of each month)"
522
  msgstr ""
523
 
524
+ #: my-calendar-core.php:1448 my-calendar-output.php:405
525
  msgid "Year"
526
  msgstr ""
527
 
528
+ #: my-calendar-core.php:1704
529
+ msgid "event"
530
+ msgstr ""
531
+
532
+ #: my-calendar-core.php:1705
533
+ msgid "events"
534
+ msgstr ""
535
+
536
+ #: my-calendar-core.php:1706
537
+ msgid "Event"
538
+ msgstr ""
539
+
540
+ #: my-calendar-core.php:1718
541
+ msgid "Create New %s"
542
+ msgstr ""
543
+
544
+ #: my-calendar-core.php:1719
545
+ msgid "Modify %s"
546
+ msgstr ""
547
+
548
+ #: my-calendar-core.php:1720
549
+ msgid "New %s"
550
+ msgstr ""
551
+
552
+ #: my-calendar-core.php:1721
553
+ msgid "View %s"
554
+ msgstr ""
555
+
556
+ #: my-calendar-core.php:1722
557
+ msgid "Search %s"
558
+ msgstr ""
559
+
560
+ #: my-calendar-core.php:1723
561
+ msgid "No %s found"
562
+ msgstr ""
563
+
564
+ #: my-calendar-core.php:1724
565
+ msgid "No %s found in Trash"
566
+ msgstr ""
567
+
568
+ #: my-calendar-core.php:1760
569
+ msgid "%s Categories"
570
+ msgstr ""
571
+
572
+ #: my-calendar-core.php:1778
573
+ msgid "%1$s updated. <a href=\"%2$s\">View %1$s</a>"
574
+ msgstr ""
575
+
576
+ #: my-calendar-core.php:1779
577
+ msgid "Custom field updated."
578
+ msgstr ""
579
+
580
+ #: my-calendar-core.php:1780
581
+ msgid "Custom field deleted."
582
+ msgstr ""
583
+
584
+ #: my-calendar-core.php:1781
585
+ msgid "%s updated."
586
+ msgstr ""
587
+
588
+ #. translators: %s: date and time of the revision
589
+ #: my-calendar-core.php:1783
590
+ msgid "%1$s restored to revision from %2$ss"
591
+ msgstr ""
592
+
593
+ #: my-calendar-core.php:1784
594
+ msgid "%1$s published. <a href=\"%2$s\">View %3$s</a>"
595
+ msgstr ""
596
+
597
+ #: my-calendar-core.php:1785
598
+ msgid "%s saved."
599
+ msgstr ""
600
+
601
+ #: my-calendar-core.php:1786
602
+ msgid "%1$s submitted. <a target=\"_blank\" href=\"%2$s\">Preview %3$s</a>"
603
+ msgstr ""
604
+
605
+ #: my-calendar-core.php:1787
606
+ msgid ""
607
+ "%1$s scheduled for: <strong>%2$s</strong>. <a target=\"_blank\" href=\"%3$s"
608
+ "\">Preview %4$s</a>"
609
+ msgstr ""
610
+
611
+ #: my-calendar-core.php:1788
612
+ msgid "M j, Y @ G:i"
613
+ msgstr ""
614
+
615
+ #: my-calendar-core.php:1789
616
+ msgid "%1$s draft updated. <a target=\"_blank\" href=\"%2$s\">Preview %3$s</a>"
617
+ msgstr ""
618
+
619
+ #: my-calendar-event-manager.php:162
620
  msgid "Delete Event"
621
  msgstr ""
622
 
623
+ #: my-calendar-event-manager.php:162
624
  msgid "Are you sure you want to delete this event?"
625
  msgstr ""
626
 
627
+ #: my-calendar-event-manager.php:178
628
  msgid "You do not have permission to delete that event."
629
  msgstr ""
630
 
631
+ #: my-calendar-event-manager.php:192
632
  msgid "You do not have permission to approve that event."
633
  msgstr ""
634
 
635
+ #: my-calendar-event-manager.php:207
636
  msgid "You do not have permission to reject that event."
637
  msgstr ""
638
 
639
+ #: my-calendar-event-manager.php:239
640
  msgid "%1$d events deleted successfully out of %2$d selected"
641
  msgstr ""
642
 
643
+ #: my-calendar-event-manager.php:241 my-calendar-event-manager.php:266
644
+ #: my-calendar-event-manager.php:293 my-calendar-event-manager.php:459
645
+ #: my-calendar-event-manager.php:546 my-calendar-event-manager.php:561
646
+ #: my-calendar-event-manager.php:581 my-calendar-event-manager.php:1563
647
+ #: my-calendar-event-manager.php:1566 my-calendar-event-manager.php:1575
648
+ #: my-calendar-event-manager.php:1580 my-calendar-event-manager.php:1593
649
+ #: my-calendar-event-manager.php:1599 my-calendar-event-manager.php:1604
650
+ #: my-calendar-group-manager.php:50 my-calendar-group-manager.php:76
651
+ #: my-calendar-group-manager.php:155 my-calendar-group-manager.php:609
652
  msgid "Error"
653
  msgstr ""
654
 
655
+ #: my-calendar-event-manager.php:241
656
  msgid "Your events have not been deleted. Please investigate."
657
  msgstr ""
658
 
659
+ #: my-calendar-event-manager.php:266
660
  msgid "Your events have not been approved. Please investigate."
661
  msgstr ""
662
 
663
+ #: my-calendar-event-manager.php:271
664
  msgid "%1$d events approved successfully out of %2$d selected"
665
  msgstr ""
666
 
667
+ #: my-calendar-event-manager.php:293
668
+ msgid "Could not archive those events."
669
+ msgstr ""
670
+
671
+ #: my-calendar-event-manager.php:298
672
+ msgid "%1$d events archived successfully out of %2$d selected."
673
+ msgstr ""
674
+
675
+ #: my-calendar-event-manager.php:305 my-calendar-settings.php:184
676
+ #: my-calendar-settings.php:725 my-calendar.php:347
677
  msgid "Manage Events"
678
  msgstr ""
679
 
680
+ #: my-calendar-event-manager.php:310
681
  msgid "My Events"
682
  msgstr ""
683
 
684
+ #: my-calendar-event-manager.php:337 my-calendar-settings.php:368
685
  msgid ""
686
  "My Calendar has identified that you have the Calendar plugin by Kieran "
687
  "O'Shea installed. You can import those events and categories into the My "
688
  "Calendar database. Would you like to import these events?"
689
  msgstr ""
690
 
691
+ #: my-calendar-event-manager.php:344 my-calendar-settings.php:374
692
  msgid "Import from Calendar"
693
  msgstr ""
694
 
695
+ #: my-calendar-event-manager.php:349
696
  msgid ""
697
  "Although it is possible that this import could fail to import your events "
698
  "correctly, it should not have any impact on your existing Calendar database. "
700
  "\">please contact me</a>!"
701
  msgstr ""
702
 
703
+ #: my-calendar-event-manager.php:391
704
  msgid "Return to Calendar"
705
  msgstr ""
706
 
707
+ #: my-calendar-event-manager.php:401
708
  msgid "Currently editing your local calendar"
709
  msgstr ""
710
 
711
+ #: my-calendar-event-manager.php:403
712
  msgid "Currently editing your central calendar"
713
  msgstr ""
714
 
715
+ #: my-calendar-event-manager.php:409 my-calendar-event-manager.php:895
716
+ #: my-calendar-group-manager.php:799
717
  msgid "Edit Event"
718
  msgstr ""
719
 
720
+ #: my-calendar-event-manager.php:412 my-calendar-event-manager.php:421
721
  msgid "You must provide an event id in order to edit it"
722
  msgstr ""
723
 
724
+ #: my-calendar-event-manager.php:418
725
  msgid "Copy Event"
726
  msgstr ""
727
 
728
+ #: my-calendar-event-manager.php:459
729
  msgid "I'm sorry! I couldn't add that event to the database."
730
  msgstr ""
731
 
732
+ #: my-calendar-event-manager.php:470
733
  msgid "Event saved. An administrator will review and approve your event."
734
  msgstr ""
735
 
736
+ #: my-calendar-event-manager.php:481
737
  msgid "Event added. It will now show on the calendar."
738
  msgstr ""
739
 
740
+ #: my-calendar-event-manager.php:483
741
+ msgid " <a href=\"%s\">View Event</a>"
 
742
  msgstr ""
743
 
744
+ #: my-calendar-event-manager.php:491 my-calendar-group-manager.php:48
745
+ #: my-calendar-group-manager.php:151
746
+ msgid "View <a href=\"%s\">your calendar</a>."
747
  msgstr ""
748
 
749
+ #: my-calendar-event-manager.php:523
750
  msgid "Date/time information for this event has been updated."
751
  msgstr ""
752
 
753
+ #: my-calendar-event-manager.php:546 my-calendar-group-manager.php:155
754
  msgid "Your event was not updated."
755
  msgstr ""
756
 
757
+ #: my-calendar-event-manager.php:550 my-calendar-group-manager.php:54
758
+ #: my-calendar-group-manager.php:159
 
 
 
 
759
  msgid "Event updated successfully"
760
  msgstr ""
761
 
762
+ #: my-calendar-event-manager.php:554 my-calendar-group-manager.php:163
763
  msgid "You do not have sufficient permissions to edit that event."
764
  msgstr ""
765
 
766
+ #: my-calendar-event-manager.php:561
767
  msgid "You can't delete an event if you haven't submitted an event id"
768
  msgstr ""
769
 
770
+ #: my-calendar-event-manager.php:579
771
  msgid "Event deleted successfully"
772
  msgstr ""
773
 
774
+ #: my-calendar-event-manager.php:581
775
  msgid ""
776
  "Despite issuing a request to delete, the event still remains in the "
777
  "database. Please investigate."
778
  msgstr ""
779
 
780
+ #: my-calendar-event-manager.php:594 my-calendar-group-manager.php:175
781
  msgid "Sorry! That's an invalid event key."
782
  msgstr ""
783
 
784
+ #: my-calendar-event-manager.php:598 my-calendar-group-manager.php:179
785
  msgid "Sorry! We couldn't find an event with that ID."
786
  msgstr ""
787
 
788
+ #: my-calendar-event-manager.php:623
789
  msgid "This event must be approved in order for it to appear on the calendar."
790
  msgstr ""
791
 
792
+ #: my-calendar-event-manager.php:672
793
+ msgid "Event Description"
794
+ msgstr ""
795
+
796
+ #: my-calendar-event-manager.php:690
797
+ msgid "Short Description"
798
+ msgstr ""
799
+
800
+ #: my-calendar-event-manager.php:700 my-calendar-group-manager.php:339
801
+ msgid "Add an image:"
802
+ msgstr ""
803
+
804
+ #: my-calendar-event-manager.php:700 my-calendar-group-manager.php:339
805
+ msgid "Upload"
806
+ msgstr ""
807
+
808
+ #: my-calendar-event-manager.php:714 my-calendar-event-manager.php:1299
809
+ #: my-calendar-group-manager.php:770 my-calendar-output.php:119
810
+ #: my-calendar-settings.php:430 my-calendar-templates.php:196
811
+ msgid "Category"
812
+ msgstr ""
813
+
814
+ #: my-calendar-event-manager.php:735
815
+ msgid "URL"
816
+ msgstr ""
817
+
818
+ #: my-calendar-event-manager.php:735
819
+ msgid "Link will expire after event"
820
+ msgstr ""
821
+
822
+ #: my-calendar-event-manager.php:758
823
+ msgid "Recurring"
824
+ msgstr ""
825
+
826
+ #: my-calendar-event-manager.php:761
827
+ msgid "Recurring Events"
828
+ msgstr ""
829
+
830
+ #: my-calendar-event-manager.php:763
831
+ msgid "Repeats"
832
+ msgstr ""
833
+
834
+ #: my-calendar-event-manager.php:763
835
+ msgid "times"
836
+ msgstr ""
837
+
838
+ #: my-calendar-event-manager.php:764
839
+ msgid "every"
840
+ msgstr ""
841
+
842
+ #: my-calendar-event-manager.php:765
843
+ msgid "Units"
844
+ msgstr ""
845
+
846
+ #: my-calendar-event-manager.php:769
847
+ msgid ""
848
+ "Your entry is the number of events after the first occurrence of the event: "
849
+ "a recurrence of <em>2</em> means the event will happen three times."
850
+ msgstr ""
851
+
852
+ #: my-calendar-event-manager.php:785
853
+ msgid "Event Access"
854
+ msgstr ""
855
+
856
+ #: my-calendar-event-manager.php:797
857
+ msgid "Event Registration Settings"
858
+ msgstr ""
859
+
860
+ #: my-calendar-event-manager.php:800
861
+ msgid "Event Registration"
862
+ msgstr ""
863
+
864
+ #: my-calendar-event-manager.php:856
865
  msgid ""
866
  "This event ends after the next occurrence begins. Events must end "
867
  "<strong>before</strong> the next occurrence begins."
868
  msgstr ""
869
 
870
+ #: my-calendar-event-manager.php:856
871
  msgid ""
872
  "Event end date: <strong>%s %s</strong>. Next occurrence starts: <strong>%s</"
873
  "strong>"
874
  msgstr ""
875
 
876
+ #: my-calendar-event-manager.php:908
877
+ msgid "Edit Event Post"
878
  msgstr ""
879
 
880
+ #: my-calendar-event-manager.php:913
881
+ msgid "Manage events"
882
  msgstr ""
883
 
884
+ #: my-calendar-event-manager.php:924
885
  msgid ""
886
  "There was an error acquiring information about this event instance. The ID "
887
  "for this event instance was not provided. <strong>You are editing this "
888
  "entire recurrence set.</strong>"
889
  msgstr ""
890
 
891
+ #: my-calendar-event-manager.php:928
892
+ msgid "Event Details"
893
  msgstr ""
894
 
895
+ #: my-calendar-event-manager.php:930 my-calendar-group-manager.php:300
896
  msgid "Event Title"
897
  msgstr ""
898
 
899
+ #: my-calendar-event-manager.php:930 my-calendar-group-manager.php:300
 
900
  msgid "(required)"
901
  msgstr ""
902
 
903
+ #: my-calendar-event-manager.php:942 my-calendar-event-manager.php:1343
904
+ msgid "Approve"
 
 
 
 
905
  msgstr ""
906
 
907
+ #: my-calendar-event-manager.php:944
908
  msgid "An administrator must approve your new event."
909
  msgstr ""
910
 
911
+ #: my-calendar-event-manager.php:959
912
  msgid "This event is not spam"
913
  msgstr ""
914
 
915
+ #: my-calendar-event-manager.php:966
916
  msgid "Post to Twitter (via WP to Twitter)"
917
  msgstr ""
918
 
919
+ #: my-calendar-event-manager.php:976
920
+ msgid "Host"
 
 
921
  msgstr ""
922
 
923
+ #: my-calendar-event-manager.php:1007
924
+ msgid "Date and Time"
 
925
  msgstr ""
926
 
927
+ #: my-calendar-event-manager.php:1015
928
+ msgid "Event Date and Time"
929
  msgstr ""
930
 
931
+ #: my-calendar-event-manager.php:1022
932
+ msgid "This is a multi-day event."
933
  msgstr ""
934
 
935
+ #: my-calendar-event-manager.php:1024
936
+ msgid "Enter start and end dates/times for each occurrence of the event."
937
  msgstr ""
938
 
939
+ #: my-calendar-event-manager.php:1026
940
+ msgid "Add another occurrence"
941
  msgstr ""
942
 
943
+ #: my-calendar-event-manager.php:1027
944
+ msgid "Remove last occurrence"
945
+ msgstr ""
946
+
947
+ #: my-calendar-event-manager.php:1032
948
+ msgid "Scheduled dates for this event"
949
+ msgstr ""
950
+
951
+ #: my-calendar-event-manager.php:1034
952
  msgid ""
953
+ "Editing a single date of an event changes only that date. Editing the root "
954
+ "event changes all events in the series."
955
  msgstr ""
956
 
957
+ #: my-calendar-event-manager.php:1045
958
+ msgid "Related Events:"
959
  msgstr ""
960
 
961
+ #: my-calendar-event-manager.php:1045
962
+ msgid "Edit group"
963
  msgstr ""
964
 
965
+ #: my-calendar-event-manager.php:1068 my-calendar-event-manager.php:1071
966
+ #: my-calendar-group-manager.php:418 my-calendar-group-manager.php:421
967
+ msgid "Event Location"
968
  msgstr ""
969
 
970
+ #: my-calendar-event-manager.php:1077 my-calendar-group-manager.php:428
971
+ msgid "Choose a preset location:"
972
  msgstr ""
973
 
974
+ #: my-calendar-event-manager.php:1086 my-calendar-group-manager.php:441
975
+ msgid "Add recurring locations for later use."
976
  msgstr ""
977
 
978
+ #: my-calendar-event-manager.php:1101
979
+ msgid "Special scheduling options"
980
  msgstr ""
981
 
982
+ #: my-calendar-event-manager.php:1104
983
+ msgid "Special Options"
984
  msgstr ""
985
 
986
+ #: my-calendar-event-manager.php:1106
987
+ msgid ""
988
+ "Cancel this event if it occurs on a date with an event in the Holidays "
989
+ "category"
990
  msgstr ""
991
 
992
+ #: my-calendar-event-manager.php:1109
993
+ msgid ""
994
+ "If this event recurs, and falls on the 5th week of the month in a month with "
995
+ "only four weeks, move it back one week."
996
  msgstr ""
997
 
998
+ #: my-calendar-event-manager.php:1122
999
+ msgid "Save Event"
1000
  msgstr ""
1001
 
1002
+ #: my-calendar-event-manager.php:1151
1003
+ msgid "Notes"
1004
  msgstr ""
1005
 
1006
+ #: my-calendar-event-manager.php:1216
1007
+ msgid "Clear filters"
1008
  msgstr ""
1009
 
1010
+ #: my-calendar-event-manager.php:1242
1011
+ msgid "Spam"
1012
  msgstr ""
1013
 
1014
+ #: my-calendar-event-manager.php:1250
1015
+ msgid "Search"
 
1016
  msgstr ""
1017
 
1018
+ #: my-calendar-event-manager.php:1250 my-calendar-output.php:1543
1019
+ #: my-calendar-output.php:1545
1020
+ msgid "Search Events"
 
1021
  msgstr ""
1022
 
1023
+ #: my-calendar-event-manager.php:1257 my-calendar-templates.php:201
1024
+ msgid "Published"
1025
  msgstr ""
1026
 
1027
+ #: my-calendar-event-manager.php:1258 my-calendar-templates.php:201
1028
+ msgid "Reserved"
1029
  msgstr ""
1030
 
1031
+ #: my-calendar-event-manager.php:1259
1032
+ msgid "Archived"
1033
  msgstr ""
1034
 
1035
+ #: my-calendar-event-manager.php:1260 my-calendar-group-manager.php:733
1036
+ msgid "All"
 
 
1037
  msgstr ""
1038
 
1039
+ #: my-calendar-event-manager.php:1269 my-calendar-group-manager.php:742
1040
+ msgid "&laquo; Previous<span class=\"screen-reader-text\"> Events</span>"
1041
  msgstr ""
1042
 
1043
+ #: my-calendar-event-manager.php:1270 my-calendar-group-manager.php:743
1044
+ msgid "Next<span class=\"screen-reader-text\"> Events</span> &raquo;"
1045
  msgstr ""
1046
 
1047
+ #: my-calendar-event-manager.php:1282 my-calendar-event-manager.php:1402
1048
+ msgid "Delete events"
1049
  msgstr ""
1050
 
1051
+ #: my-calendar-event-manager.php:1284 my-calendar-event-manager.php:1404
1052
+ msgid "Approve events"
1053
  msgstr ""
1054
 
1055
+ #: my-calendar-event-manager.php:1287 my-calendar-event-manager.php:1407
1056
+ msgid "Archive events"
1057
  msgstr ""
1058
 
1059
+ #: my-calendar-event-manager.php:1294 my-calendar-group-manager.php:245
1060
+ msgid "Check/Uncheck all"
1061
  msgstr ""
1062
 
1063
+ #: my-calendar-event-manager.php:1295 my-calendar-group-manager.php:765
1064
+ #: my-calendar-settings.php:430 my-calendar-widgets.php:20
1065
+ #: my-calendar-widgets.php:78 my-calendar-widgets.php:177
1066
+ #: my-calendar-widgets.php:664
1067
+ msgid "Title"
1068
  msgstr ""
1069
 
1070
+ #: my-calendar-event-manager.php:1296 my-calendar-locations.php:244
1071
+ #: my-calendar-output.php:1605
1072
+ msgid "Location"
1073
  msgstr ""
1074
 
1075
+ #: my-calendar-event-manager.php:1297 my-calendar-settings.php:391
1076
+ msgid "Date/Time"
1077
  msgstr ""
1078
 
1079
+ #: my-calendar-event-manager.php:1298 my-calendar-group-manager.php:769
1080
+ #: my-calendar-settings.php:430
1081
+ msgid "Author"
1082
  msgstr ""
1083
 
1084
+ #: my-calendar-event-manager.php:1317
1085
+ msgid "Possible spam"
 
 
1086
  msgstr ""
1087
 
1088
+ #: my-calendar-event-manager.php:1333
1089
+ msgid "Copy"
1090
  msgstr ""
1091
 
1092
+ #: my-calendar-event-manager.php:1336 my-calendar-group-manager.php:801
1093
+ #: my-calendar-output.php:363
1094
+ msgid "Edit Group"
1095
  msgstr ""
1096
 
1097
+ #: my-calendar-event-manager.php:1339 my-calendar-group-manager.php:805
1098
+ msgid "Not editable."
 
 
1099
  msgstr ""
1100
 
1101
+ #: my-calendar-event-manager.php:1343
1102
+ msgid "Reject"
1103
  msgstr ""
1104
 
1105
+ #: my-calendar-event-manager.php:1348
1106
+ msgid "Approved"
1107
  msgstr ""
1108
 
1109
+ #: my-calendar-event-manager.php:1349
1110
+ msgid "Rejected"
 
 
 
1111
  msgstr ""
1112
 
1113
+ #: my-calendar-event-manager.php:1350
1114
+ msgid "Awaiting Approval"
1115
  msgstr ""
1116
 
1117
+ #: my-calendar-event-manager.php:1356
1118
+ msgid "Filter by location"
 
1119
  msgstr ""
1120
 
1121
+ #: my-calendar-event-manager.php:1356 my-calendar-event-manager.php:1384
1122
+ #: my-calendar-event-manager.php:1393
1123
+ msgid "Show only: "
1124
  msgstr ""
1125
 
1126
+ #: my-calendar-event-manager.php:1360 my-calendar-group-manager.php:768
1127
+ msgid "Recurs"
 
1128
  msgstr ""
1129
 
1130
+ #: my-calendar-event-manager.php:1368 my-calendar-group-manager.php:817
1131
+ msgid "Never"
 
1132
  msgstr ""
1133
 
1134
+ #: my-calendar-event-manager.php:1369 my-calendar-group-manager.php:818
1135
+ #: my-calendar-templates.php:516
1136
+ msgid "Daily"
1137
  msgstr ""
1138
 
1139
+ #: my-calendar-event-manager.php:1369
1140
+ msgid "Every %d days"
 
1141
  msgstr ""
1142
 
1143
+ #: my-calendar-event-manager.php:1370 my-calendar-group-manager.php:819
1144
+ msgid "Weekdays"
 
1145
  msgstr ""
1146
 
1147
+ #: my-calendar-event-manager.php:1370
1148
+ msgid "Every %d weekdays"
 
1149
  msgstr ""
1150
 
1151
+ #: my-calendar-event-manager.php:1371 my-calendar-group-manager.php:820
1152
+ #: my-calendar-templates.php:518
1153
+ msgid "Weekly"
1154
  msgstr ""
1155
 
1156
+ #: my-calendar-event-manager.php:1371
1157
+ msgid "Every %d weeks"
 
1158
  msgstr ""
1159
 
1160
+ #: my-calendar-event-manager.php:1372 my-calendar-group-manager.php:821
1161
+ msgid "Bi-Weekly"
1162
  msgstr ""
1163
 
1164
+ #: my-calendar-event-manager.php:1373 my-calendar-group-manager.php:822
1165
+ msgid "Monthly (by date)"
 
1166
  msgstr ""
1167
 
1168
+ #: my-calendar-event-manager.php:1373
1169
+ msgid "Every %d months (by date)"
 
 
1170
  msgstr ""
1171
 
1172
+ #: my-calendar-event-manager.php:1374 my-calendar-group-manager.php:823
1173
+ msgid "Monthly (by day)"
 
1174
  msgstr ""
1175
 
1176
+ #: my-calendar-event-manager.php:1375 my-calendar-group-manager.php:824
1177
+ msgid "Yearly"
 
1178
  msgstr ""
1179
 
1180
+ #: my-calendar-event-manager.php:1375
1181
+ msgid "Every %d years"
1182
  msgstr ""
1183
 
1184
+ #: my-calendar-event-manager.php:1379 my-calendar-event-manager.php:1380
1185
+ msgid "&ndash; %d Times"
1186
  msgstr ""
1187
 
1188
+ #: my-calendar-event-manager.php:1384
1189
+ msgid "Filter by author"
 
 
1190
  msgstr ""
1191
 
1192
+ #: my-calendar-event-manager.php:1393
1193
+ msgid "Filter by category"
 
 
1194
  msgstr ""
1195
 
1196
+ #: my-calendar-event-manager.php:1412
1197
+ msgid "View Archived Events"
1198
  msgstr ""
1199
 
1200
+ #: my-calendar-event-manager.php:1414
1201
+ msgid "Return to Manage Events"
1202
  msgstr ""
1203
 
1204
+ #: my-calendar-event-manager.php:1420
1205
+ msgid "There are no events in the database meeting your current criteria."
1206
  msgstr ""
1207
 
1208
+ #: my-calendar-event-manager.php:1563
1209
+ msgid ""
1210
+ "Your event end date must be either after or the same as your event begin date"
1211
  msgstr ""
1212
 
1213
+ #: my-calendar-event-manager.php:1566
1214
+ msgid ""
1215
+ "Your date formatting is correct but one or more of your dates is invalid. "
1216
+ "Check for number of days in month and leap year related errors."
1217
  msgstr ""
1218
 
1219
+ #: my-calendar-event-manager.php:1575
1220
+ msgid ""
1221
+ "The time field must either be blank or be entered in the format hh:mm am/pm"
1222
  msgstr ""
1223
 
1224
+ #: my-calendar-event-manager.php:1580
1225
+ msgid ""
1226
+ "The end time field must either be blank or be entered in the format hh:mm am/"
1227
+ "pm"
1228
  msgstr ""
1229
 
1230
+ #: my-calendar-event-manager.php:1593
1231
+ msgid "An event title is required."
1232
  msgstr ""
1233
 
1234
+ #: my-calendar-event-manager.php:1599
1235
+ msgid "The repetition value must be 0 unless a type of recurrence is selected."
1236
  msgstr ""
1237
 
1238
+ #: my-calendar-event-manager.php:1604
1239
+ msgid "That event conflicts with a previously scheduled event."
1240
  msgstr ""
1241
 
1242
+ #: my-calendar-event-manager.php:1800
1243
+ msgid "Editing: "
 
 
1244
  msgstr ""
1245
 
1246
+ #: my-calendar-event-manager.php:1886
1247
+ msgid "Date (YYYY-MM-DD)"
1248
  msgstr ""
1249
 
1250
+ #: my-calendar-event-manager.php:1887
1251
+ msgid "From"
1252
  msgstr ""
1253
 
1254
+ #: my-calendar-event-manager.php:1889
1255
+ msgid "To"
 
1256
  msgstr ""
1257
 
1258
+ #: my-calendar-event-manager.php:1893
1259
+ msgid "All day event"
 
 
1260
  msgstr ""
1261
 
1262
+ #: my-calendar-event-manager.php:1894
1263
+ msgid "Hide end time"
1264
  msgstr ""
1265
 
1266
+ #: my-calendar-event-manager.php:1897
1267
+ msgid "End Date (YYYY-MM-DD, optional)"
1268
  msgstr ""
1269
 
1270
+ #: my-calendar-event-manager.php:1917
1271
+ msgid "Open"
 
1272
  msgstr ""
1273
 
1274
+ #: my-calendar-event-manager.php:1918
1275
+ msgid "Closed"
1276
  msgstr ""
1277
 
1278
+ #: my-calendar-event-manager.php:1919
1279
+ msgid "Does not apply"
1280
  msgstr ""
1281
 
1282
+ #: my-calendar-event-manager.php:1922
1283
+ msgid ""
1284
+ "If this event recurs, it can only be registered for as a complete series."
1285
  msgstr ""
1286
 
1287
+ #: my-calendar-event-manager.php:1928
1288
+ msgid "Tickets URL"
1289
  msgstr ""
1290
 
1291
+ #: my-calendar-event-manager.php:1931
1292
+ msgid "Registration Information"
1293
  msgstr ""
1294
 
1295
+ #: my-calendar-events.php:202 my-calendar-events.php:216
1296
+ msgid "No related events"
1297
  msgstr ""
1298
 
1299
+ #: my-calendar-generator.php:36
1300
+ msgid "Shortcode Attributes"
1301
  msgstr ""
1302
 
1303
+ #: my-calendar-generator.php:42
1304
+ msgid "Location filter type:"
 
1305
  msgstr ""
1306
 
1307
+ #: my-calendar-generator.php:44
1308
+ msgid "All locations"
1309
+ msgstr ""
1310
+
1311
+ #: my-calendar-generator.php:45 my-calendar-settings.php:430
1312
+ msgid "Location Name"
1313
  msgstr ""
1314
 
1315
+ #: my-calendar-generator.php:46 my-calendar-group-manager.php:459
1316
+ #: my-calendar-locations.php:330 my-calendar.php:269
1317
+ msgid "City"
1318
  msgstr ""
1319
 
1320
+ #: my-calendar-generator.php:47 my-calendar-group-manager.php:475
1321
+ #: my-calendar-locations.php:387 my-calendar.php:272
1322
+ msgid "State"
1323
  msgstr ""
1324
 
1325
+ #: my-calendar-generator.php:48 my-calendar-group-manager.php:462
1326
+ #: my-calendar-locations.php:348 my-calendar.php:275
1327
+ msgid "Postal Code"
1328
  msgstr ""
1329
 
1330
+ #: my-calendar-generator.php:49 my-calendar-group-manager.php:466
1331
+ #: my-calendar-locations.php:366
1332
+ msgid "Country"
1333
  msgstr ""
1334
 
1335
+ #: my-calendar-generator.php:50 my-calendar-group-manager.php:463
1336
+ #: my-calendar-group-manager.php:476 my-calendar-locations.php:357
1337
+ #: my-calendar-locations.php:388
1338
+ msgid "Region"
1339
  msgstr ""
1340
 
1341
+ #: my-calendar-generator.php:54
1342
+ msgid "Location filter value:"
 
1343
  msgstr ""
1344
 
1345
+ #: my-calendar-generator.php:58
1346
+ msgid ""
1347
+ "<strong>Note:</strong> If you provide a location filter value, it must be an "
1348
+ "exact match for that information as saved with your events. (e.g. \"Saint "
1349
+ "Paul\" is not equivalent to \"saint paul\" or \"St. Paul\")"
1350
  msgstr ""
1351
 
1352
+ #: my-calendar-generator.php:68 my-calendar-widgets.php:684
1353
+ msgid "Limit by Author"
1354
  msgstr ""
1355
 
1356
+ #: my-calendar-generator.php:70 my-calendar-widgets.php:686
1357
+ msgid "All authors"
1358
  msgstr ""
1359
 
1360
+ #: my-calendar-generator.php:75 my-calendar-widgets.php:691
1361
+ msgid "Limit by Host"
1362
  msgstr ""
1363
 
1364
+ #: my-calendar-generator.php:77 my-calendar-widgets.php:693
1365
+ msgid "All hosts"
1366
  msgstr ""
1367
 
1368
+ #: my-calendar-generator.php:85
1369
+ msgid "Format"
1370
  msgstr ""
1371
 
1372
+ #: my-calendar-generator.php:87
1373
+ msgid "Grid"
1374
  msgstr ""
1375
 
1376
+ #: my-calendar-generator.php:88
1377
+ msgid "List"
1378
  msgstr ""
1379
 
1380
+ #: my-calendar-generator.php:92 my-calendar-generator.php:150
1381
+ msgid "Time Segment"
1382
  msgstr ""
1383
 
1384
+ #: my-calendar-generator.php:94 my-calendar-output.php:400
1385
+ #: my-calendar-output.php:512 my-calendar-output.php:519
1386
+ #: my-calendar-output.php:525 my-calendar-widgets.php:699
1387
+ msgid "Month"
1388
  msgstr ""
1389
 
1390
+ #: my-calendar-generator.php:95 my-calendar-output.php:513
1391
+ #: my-calendar-output.php:521 my-calendar-output.php:527
1392
+ #: my-calendar-widgets.php:700
1393
+ msgid "Week"
1394
  msgstr ""
1395
 
1396
+ #: my-calendar-generator.php:96 my-calendar-output.php:515
1397
+ #: my-calendar-output.php:522 my-calendar-output.php:529
1398
+ msgid "Day"
1399
  msgstr ""
1400
 
1401
+ #: my-calendar-generator.php:100
1402
  msgid ""
1403
+ "For navigational fields above and below the calendar: the defaults specified "
1404
+ "in your settings will be used if the attribute is left blank. Use "
1405
+ "<code>none</code> to hide all navigation elements."
1406
  msgstr ""
1407
 
1408
+ #: my-calendar-generator.php:103 my-calendar-widgets.php:676
1409
+ msgid "Navigation above calendar"
 
1410
  msgstr ""
1411
 
1412
+ #: my-calendar-generator.php:107 my-calendar-widgets.php:680
1413
+ msgid "Navigation below calendar"
 
 
1414
  msgstr ""
1415
 
1416
+ #: my-calendar-generator.php:115
1417
+ msgid "Fallback Text"
1418
  msgstr ""
1419
 
1420
+ #: my-calendar-generator.php:119 my-calendar-widgets.php:82
1421
+ #: my-calendar-widgets.php:181
1422
+ msgid "Template"
1423
  msgstr ""
1424
 
1425
+ #: my-calendar-generator.php:127
1426
+ msgid "Events/Days Before Current Day"
1427
  msgstr ""
1428
 
1429
+ #: my-calendar-generator.php:131
1430
+ msgid "Events/Days After Current Day"
1431
  msgstr ""
1432
 
1433
+ #: my-calendar-generator.php:135
1434
+ msgid "Events/Days to Skip"
1435
  msgstr ""
1436
 
1437
+ #: my-calendar-generator.php:139
1438
+ msgid "Fallback"
 
 
1439
  msgstr ""
1440
 
1441
+ #: my-calendar-generator.php:143
1442
+ msgid "Type of Upcoming Events List"
1443
  msgstr ""
1444
 
1445
+ #: my-calendar-generator.php:152
1446
+ msgid "Ascending"
1447
  msgstr ""
1448
 
1449
+ #: my-calendar-generator.php:153
1450
+ msgid "Descending"
1451
  msgstr ""
1452
 
1453
+ #: my-calendar-generator.php:160
1454
+ msgid "Generate Shortcode"
 
1455
  msgstr ""
1456
 
1457
+ #: my-calendar-group-manager.php:50
1458
  msgid "Event not updated."
1459
  msgstr ""
1460
 
1461
+ #: my-calendar-group-manager.php:52 my-calendar-group-manager.php:78
1462
+ #: my-calendar-group-manager.php:157
1463
+ msgid "Nothing was changed in that update."
1464
+ msgstr ""
1465
+
1466
+ #: my-calendar-group-manager.php:76
1467
  msgid "Event not grouped."
1468
  msgstr ""
1469
 
1470
+ #: my-calendar-group-manager.php:80
1471
  msgid "Event grouped successfully"
1472
  msgstr ""
1473
 
1474
+ #: my-calendar-group-manager.php:91 my-calendar-group-manager.php:387
1475
+ #: my-calendar-group-manager.php:524
1476
  msgid "Edit Event Group"
1477
  msgstr ""
1478
 
1479
+ #: my-calendar-group-manager.php:94
1480
  msgid "You must provide an event group id in order to edit it"
1481
  msgstr ""
1482
 
1483
+ #: my-calendar-group-manager.php:100 my-calendar-group-manager.php:109
1484
+ #: my-calendar-group-manager.php:295 my-calendar.php:351
1485
  msgid "Manage Event Groups"
1486
  msgstr ""
1487
 
1488
+ #: my-calendar-group-manager.php:102
1489
  msgid ""
1490
  "Grouped events can be edited simultaneously. When you choose a group of "
1491
  "events to edit, the form will be pre-filled with the content applicable to "
1496
  "changes applied. (All grouped events can also be edited individually.)"
1497
  msgstr ""
1498
 
1499
+ #: my-calendar-group-manager.php:111
1500
+ msgid "Select an event group to edit."
 
 
 
1501
  msgstr ""
1502
 
1503
+ #: my-calendar-group-manager.php:117
1504
+ msgid "Create/Modify Groups"
1505
  msgstr ""
1506
 
1507
+ #: my-calendar-group-manager.php:227
1508
  msgid ""
1509
  "<strong>NOTE:</strong> The group editable fields for the events in this "
1510
  "group do not match"
1511
  msgstr ""
1512
 
1513
+ #: my-calendar-group-manager.php:227
1514
  msgid "The group editable fields for the events in this group match."
1515
  msgstr ""
1516
 
1517
+ #: my-calendar-group-manager.php:234
1518
  msgid "Apply these changes to:"
1519
  msgstr ""
1520
 
1521
+ #: my-calendar-group-manager.php:247
1522
  msgid "Remove checked events from this group"
1523
  msgstr ""
1524
 
1525
+ #: my-calendar-group-manager.php:265
1526
  msgid "You must provide a group ID to edit groups"
1527
  msgstr ""
1528
 
1529
+ #: my-calendar-group-manager.php:298
1530
+ msgid "Enter your Event Information"
1531
+ msgstr ""
1532
+
1533
+ #: my-calendar-group-manager.php:300 my-calendar-group-manager.php:307
1534
+ #: my-calendar-group-manager.php:317 my-calendar-group-manager.php:328
1535
+ #: my-calendar-group-manager.php:339 my-calendar-group-manager.php:350
1536
+ #: my-calendar-group-manager.php:370 my-calendar-group-manager.php:382
1537
+ #: my-calendar-group-manager.php:399 my-calendar-group-manager.php:450
1538
+ #: my-calendar-group-manager.php:453 my-calendar-group-manager.php:456
1539
+ #: my-calendar-group-manager.php:459 my-calendar-group-manager.php:462
1540
+ #: my-calendar-group-manager.php:463 my-calendar-group-manager.php:466
1541
+ #: my-calendar-group-manager.php:469 my-calendar-group-manager.php:480
1542
+ #: my-calendar-group-manager.php:483 my-calendar-group-manager.php:488
1543
  msgid "Fields do not match"
1544
  msgstr ""
1545
 
1546
+ #: my-calendar-group-manager.php:307
1547
  msgid "Selected dates are a single multi-day event."
1548
  msgstr ""
1549
 
1550
+ #: my-calendar-group-manager.php:315
1551
+ msgid ""
1552
+ "Event Description (<abbr title=\"hypertext markup language\">HTML</abbr> "
1553
+ "allowed)"
1554
+ msgstr ""
1555
+
1556
+ #: my-calendar-group-manager.php:328
1557
+ msgid ""
1558
+ "Event Short Description (<abbr title=\"hypertext markup language\">HTML</"
1559
+ "abbr> allowed)"
1560
+ msgstr ""
1561
+
1562
+ #: my-calendar-group-manager.php:350
1563
+ msgid "Event Host"
1564
+ msgstr ""
1565
+
1566
+ #: my-calendar-group-manager.php:370
1567
+ msgid "Event Category"
1568
+ msgstr ""
1569
+
1570
+ #: my-calendar-group-manager.php:382
1571
+ msgid "Event Link (Optional)"
1572
+ msgstr ""
1573
+
1574
+ #: my-calendar-group-manager.php:382
1575
+ msgid "Link will expire after event."
1576
+ msgstr ""
1577
+
1578
+ #: my-calendar-group-manager.php:396
1579
  msgid "Event Registration Options"
1580
  msgstr ""
1581
 
1582
+ #: my-calendar-group-manager.php:399
1583
  msgid "Event Registration Status"
1584
  msgstr ""
1585
 
1586
+ #: my-calendar-group-manager.php:450 my-calendar-locations.php:308
1587
+ msgid "Name of Location (e.g. <em>Joe's Bar and Grill</em>)"
1588
+ msgstr ""
1589
+
1590
+ #: my-calendar-group-manager.php:453 my-calendar-locations.php:324
1591
+ msgid "Street Address"
1592
+ msgstr ""
1593
+
1594
+ #: my-calendar-group-manager.php:456 my-calendar-locations.php:327
1595
+ msgid "Street Address (2)"
1596
+ msgstr ""
1597
+
1598
+ #: my-calendar-group-manager.php:459 my-calendar-locations.php:339
1599
+ msgid "State/Province"
1600
+ msgstr ""
1601
+
1602
+ #: my-calendar-group-manager.php:469 my-calendar-locations.php:381
1603
+ msgid "Initial Zoom"
1604
+ msgstr ""
1605
+
1606
+ #: my-calendar-group-manager.php:471 my-calendar-locations.php:383
1607
+ msgid "Neighborhood"
1608
+ msgstr ""
1609
+
1610
+ #: my-calendar-group-manager.php:472 my-calendar-locations.php:384
1611
+ msgid "Small City"
1612
+ msgstr ""
1613
+
1614
+ #: my-calendar-group-manager.php:473 my-calendar-locations.php:385
1615
+ msgid "Large City"
1616
+ msgstr ""
1617
+
1618
+ #: my-calendar-group-manager.php:474 my-calendar-locations.php:386
1619
+ msgid "Greater Metro Area"
1620
+ msgstr ""
1621
+
1622
+ #: my-calendar-group-manager.php:480 my-calendar-locations.php:406
1623
+ msgid "Phone"
1624
+ msgstr ""
1625
+
1626
+ #: my-calendar-group-manager.php:483 my-calendar-locations.php:412
1627
+ msgid "Location URL"
1628
+ msgstr ""
1629
+
1630
+ #: my-calendar-group-manager.php:486 my-calendar-locations.php:393
1631
+ msgid "GPS Coordinates (optional)"
1632
+ msgstr ""
1633
+
1634
+ #: my-calendar-group-manager.php:488 my-calendar-locations.php:398
1635
+ msgid "Latitude"
1636
+ msgstr ""
1637
+
1638
+ #: my-calendar-group-manager.php:488 my-calendar-locations.php:398
1639
+ msgid "Longitude"
1640
+ msgstr ""
1641
+
1642
+ #: my-calendar-group-manager.php:492 my-calendar-locations.php:416
1643
+ msgid "Location Accessibility"
1644
+ msgstr ""
1645
+
1646
+ #: my-calendar-group-manager.php:609
1647
+ msgid "The event title must be between 1 and 255 characters in length."
1648
  msgstr ""
1649
 
1650
+ #: my-calendar-group-manager.php:731
1651
  msgid "Grouped Events"
1652
  msgstr ""
1653
 
1654
+ #: my-calendar-group-manager.php:732
1655
  msgid "Ungrouped Events"
1656
  msgstr ""
1657
 
1658
+ #: my-calendar-group-manager.php:736
1659
  msgid "Check a set of events to group them for mass editing."
1660
  msgstr ""
1661
 
1662
+ #: my-calendar-group-manager.php:757 my-calendar-group-manager.php:851
1663
  msgid "Group checked events for mass editing"
1664
  msgstr ""
1665
 
1666
+ #: my-calendar-group-manager.php:764
1667
  msgid "Group"
1668
  msgstr ""
1669
 
1670
+ #: my-calendar-group-manager.php:766
1671
  msgid "Where"
1672
  msgstr ""
1673
 
1674
+ #: my-calendar-group-manager.php:767
1675
  msgid "Starts"
1676
  msgstr ""
1677
 
1678
+ #: my-calendar-group-manager.php:803
1679
  msgid "Ungrouped"
1680
  msgstr ""
1681
 
1682
+ #: my-calendar-group-manager.php:829
1683
  msgid "Forever"
1684
  msgstr ""
1685
 
1686
+ #: my-calendar-group-manager.php:831
1687
  msgid "%d Times"
1688
  msgstr ""
1689
 
1690
+ #: my-calendar-group-manager.php:856
1691
  msgid "There are no events in the database!"
1692
  msgstr ""
1693
 
1695
  msgid "How to use My Calendar"
1696
  msgstr ""
1697
 
1698
+ #: my-calendar-help.php:13 my-calendar.php:184 my-calendar.php:358
1699
  msgid "My Calendar Help"
1700
  msgstr ""
1701
 
1702
+ #: my-calendar-help.php:17 my-calendar.php:182
1703
+ msgid "Shortcode Generator"
1704
  msgstr ""
1705
 
1706
  #: my-calendar-help.php:18
1707
+ msgid "Shortcodes"
1708
  msgstr ""
1709
 
1710
  #: my-calendar-help.php:19
1711
+ msgid "Icons"
1712
  msgstr ""
1713
 
1714
  #: my-calendar-help.php:20
1715
+ msgid "Styles"
1716
  msgstr ""
1717
 
1718
  #: my-calendar-help.php:21
1719
+ msgid "Templating"
1720
+ msgstr ""
1721
+
1722
+ #: my-calendar-help.php:22
1723
  msgid "Support Form"
1724
  msgstr ""
1725
 
1726
+ #: my-calendar-help.php:23 my-calendar-help.php:438
1727
  msgid "Helpful Information"
1728
  msgstr ""
1729
 
1730
+ #: my-calendar-help.php:31 my-calendar.php:181
1731
  msgid "Getting Started"
1732
  msgstr ""
1733
 
1734
+ #: my-calendar-help.php:34
 
 
 
 
 
 
1735
  msgid "Add the My Calendar shortcode (<code>[my_calendar]</code>) to a page."
1736
  msgstr ""
1737
 
1738
+ #: my-calendar-help.php:35
1739
  msgid ""
1740
+ "Add events by clicking on the Add/Edit Events link in the admin or on \"Add "
1741
+ "Events\" in the toolbar."
1742
  msgstr ""
1743
 
1744
+ #: my-calendar-help.php:36
1745
  msgid "Select your preferred stylesheet in the Styles Editor"
1746
  msgstr ""
1747
 
1748
+ #: my-calendar-help.php:39
1749
  msgid ""
1750
+ "Read more help documentation below or <a href=\"%s\">purchase the My "
1751
+ "Calendar User's Guide</a> to learn more -- but the above is all that you "
1752
  "need to do to begin using the calendar."
1753
  msgstr ""
1754
 
1755
+ #: my-calendar-help.php:47
1756
+ msgid "My Calendar Shortcode Generator"
1757
+ msgstr ""
1758
+
1759
+ #: my-calendar-help.php:51
1760
+ msgid "Main"
1761
  msgstr ""
1762
 
1763
  #: my-calendar-help.php:52
1764
+ msgid "Upcoming"
1765
+ msgstr ""
1766
+
1767
+ #: my-calendar-help.php:53
1768
+ msgid "Today"
1769
+ msgstr ""
1770
+
1771
+ #: my-calendar-help.php:73
1772
+ msgid "Shortcode Syntax"
1773
  msgstr ""
1774
 
1775
+ #: my-calendar-help.php:76
1776
  msgid "Main Calendar Shortcode (List or Grid, Weekly or Monthly view)"
1777
  msgstr ""
1778
 
1779
+ #: my-calendar-help.php:78
1780
+ msgid "Example Customized Shortcode"
1781
+ msgstr ""
1782
+
1783
+ #: my-calendar-help.php:81
1784
  msgid ""
1785
+ "This shortcode shows the one-week view of the calendar on a post or page "
1786
+ "including all categories and the category key, in a list format. The "
1787
  "standard previous/next navigation will be included above the calendar, the "
1788
  "link to the print format (if enabled) will be shown below."
1789
  msgstr ""
1790
 
1791
+ #: my-calendar-help.php:84
1792
+ msgid "Shortcode attributes:"
1793
  msgstr ""
1794
 
1795
+ #: my-calendar-help.php:87
1796
+ msgid "Names or IDs of categories in the calendar, comma or pipe separated."
 
 
1797
  msgstr ""
1798
 
1799
+ #: my-calendar-help.php:88
1800
  msgid ""
1801
+ "\"list\" or \"mini\"; exclude or any other value to show a calendar grid."
 
1802
  msgstr ""
1803
 
1804
+ #: my-calendar-help.php:89
1805
  msgid ""
1806
+ "Comma-separated list of navigation to display above or below the calendar. "
1807
+ "Available: <strong>nav, toggle, jump, print, key, feeds, timeframe</strong>. "
1808
+ "Order listed determines the order displayed. Defaults in settings will be "
1809
+ "used if the attribute is blank. Use <em>none</em> to hide all navigation."
 
 
 
1810
  msgstr ""
1811
 
1812
+ #: my-calendar-help.php:90
1813
  msgid ""
1814
  "Set to \"week\" to show a one week view or to \"day\" to show a single day "
1815
+ "view. Any other value will show a month view. (Day view always shows as a "
1816
+ "list.)"
1817
  msgstr ""
1818
 
1819
+ #: my-calendar-help.php:91
1820
+ msgid "Type of location data to restrict by."
1821
  msgstr ""
1822
 
1823
+ #: my-calendar-help.php:92
1824
+ msgid "Specific location information to filter to."
1825
  msgstr ""
1826
 
1827
+ #: my-calendar-help.php:93
1828
+ msgid "Author or comma-separated list (usernames or IDs) to show events from."
 
 
1829
  msgstr ""
1830
 
1831
+ #: my-calendar-help.php:94
1832
+ msgid "Host or comma-separated list (usernames or IDs) to show events from."
 
 
1833
  msgstr ""
1834
 
1835
+ #: my-calendar-help.php:95
1836
+ msgid "String to give shortcode a unique ID."
 
 
1837
  msgstr ""
1838
 
1839
+ #: my-calendar-help.php:98
1840
  msgid ""
1841
  "The main My Calendar shortcode can be generated from a button in your post "
1842
  "and page editor. The mini calendar can also be accessed and configured as a "
1843
  "widget."
1844
  msgstr ""
1845
 
1846
+ #: my-calendar-help.php:100
1847
+ msgid "Additional Views (Upcoming events, today's events)"
1848
  msgstr ""
1849
 
1850
+ #: my-calendar-help.php:103
1851
  msgid ""
1852
+ "Displays the output of the Upcoming Events widget. <code>before</code> and "
1853
+ "<code>after</code> are numbers; <code>type</code> is either \"event\" or "
1854
+ "\"days\", and <code>category</code> and <code>author</code> work the same as "
1855
+ "in the main calendar shortcode. Templates use the template codes listed "
1856
+ "below. <code>fallback</code> provides text if no events meet your criteria. "
1857
+ "Order sets sort order for the list &ndash; ascending (<code>asc</code>) or "
1858
+ "descending (<code>desc</code>). <code>show_today</code> indicates whether to "
1859
+ "include today's events in the list. <code>Skip</code> is how many events to "
1860
+ "skip in the list."
 
 
1861
  msgstr ""
1862
 
1863
+ #: my-calendar-help.php:107
1864
  msgid ""
1865
  "Displays the output of the Today's Events widget, with four configurable "
1866
  "attributes: category, author, template and fallback text."
1867
  msgstr ""
1868
 
1869
+ #: my-calendar-help.php:110
1870
+ msgid "Upcoming Events and Today's Events can also be configured as widgets."
 
1871
  msgstr ""
1872
 
1873
+ #: my-calendar-help.php:114
1874
  msgid ""
1875
  "Displays a single event and/or all dates for that event. If template is set "
1876
  "to a blank value, will only display the list of occurrences. If the list "
1877
  "attribute is set blank, will only show the event template"
1878
  msgstr ""
1879
 
1880
+ #: my-calendar-help.php:118
1881
+ msgid "Calendar Filter Shortcodes"
 
 
 
 
 
 
 
 
 
 
 
 
1882
  msgstr ""
1883
 
1884
+ #: my-calendar-help.php:122
1885
  msgid ""
1886
+ "Displays all available filters as a single form. The <code>show</code> "
1887
+ "attribute takes three keywords: categories, locations, and access, to "
1888
+ "indicate which filters to show and in what order."
 
1889
  msgstr ""
1890
 
1891
+ #: my-calendar-help.php:126
1892
  msgid ""
1893
+ "List of event locations, as a list of links or as a select form. <code>show</"
1894
+ "code> is either <code>list</code> or <code>form</code>, <code>type</code> is "
1895
+ "<code>saved</code> (to show items from stored locations), or <code>custom</"
1896
+ "code> (to show options configured in location settings). <code>datatype</"
1897
+ "code> must be the type of data your limits are using: <code>name</code> "
1898
+ "(business name), <code>city</code>, <code>state</code>, <code>country</"
1899
+ "code>, <code>zip</code> (postal code), or <code>region</code>."
1900
  msgstr ""
1901
 
1902
+ #: my-calendar-help.php:130
1903
  msgid ""
1904
  "List of event categories, either as a list of links or as a select dropdown "
1905
  "form. The <code>show</code> attribute can either be <code>list</code> or "
1906
  "<code>form</code>."
1907
  msgstr ""
1908
 
1909
+ #: my-calendar-help.php:134
1910
+ msgid ""
1911
+ "List of filterable accessibility services, either as a list of links or as a "
1912
+ "select dropdown form. The <code>show</code> attribute can either be "
1913
+ "<code>list</code> or <code>form</code>."
1914
+ msgstr ""
1915
+
1916
+ #: my-calendar-help.php:136
1917
+ msgid "Information Listing Shortcodes"
1918
+ msgstr ""
1919
+
1920
+ #: my-calendar-help.php:140
1921
+ msgid ""
1922
+ "List of locations. <code>datatype</code> is the type of data displayed; all "
1923
+ "lists include a link to the map to that location. In addition to basic "
1924
+ "location information as in the above shortcode, you can also use \"hcard\" "
1925
+ "to display all available location information."
1926
+ msgstr ""
1927
+
1928
+ #: my-calendar-help.php:141
1929
+ msgid ""
1930
+ "Use <code>template</code> to show customized data, sorted by the "
1931
+ "<code>datatype</code> value."
1932
+ msgstr ""
1933
+
1934
+ #: my-calendar-help.php:149
1935
  msgid "Category Icons"
1936
  msgstr ""
1937
 
1938
+ #: my-calendar-help.php:152
1939
  msgid ""
1940
  "My Calendar is designed to manage multiple calendars. The basis for these "
1941
  "calendars are categories; you can setup a calendar page which includes all "
1945
  "etc."
1946
  msgstr ""
1947
 
1948
+ #: my-calendar-help.php:155
1949
  msgid ""
1950
  "The pre-installed category icons may not be what you need. I assume that "
1951
  "you'll upload your own icons -- place your custom icons in a folder at \"my-"
1952
  "calendar-custom\" to avoid having them overwritten by upgrades."
1953
  msgstr ""
1954
 
1955
+ #: my-calendar-help.php:155
1956
  msgid "You can alternately place icons in:"
1957
  msgstr ""
1958
 
1959
+ #: my-calendar-help.php:163
1960
  msgid "Custom Styles"
1961
  msgstr ""
1962
 
1963
+ #: my-calendar-help.php:166
1964
  msgid ""
1965
  "My Calendar comes with five default stylesheets. My Calendar will retain "
1966
  "your changes to stylesheets, but if you want to add an entirely new "
1968
  "directory."
1969
  msgstr ""
1970
 
1971
+ #: my-calendar-help.php:169
1972
  msgid "Your custom style directory is"
1973
  msgstr ""
1974
 
1975
+ #: my-calendar-help.php:172
1976
  msgid ""
1977
  "You can also add custom styles to your custom directory or your theme "
1978
  "directory for print styles, mobile styles, and tablet styles. <code>mc-print."
1979
  "css</code>, <code>mc-mobile.css</code>, and <code>mc-tablet.css</code>."
1980
  msgstr ""
1981
 
1982
+ #: my-calendar-help.php:180
1983
+ msgid "Template Tags"
1984
  msgstr ""
1985
 
1986
+ #: my-calendar-help.php:183
1987
  msgid ""
1988
  "All template tags support two attributes: before=\"value\" and after=\"value"
1989
  "\". The values of the attributes will be placed before and after the output "
1991
  "quotes."
1992
  msgstr ""
1993
 
1994
+ #: my-calendar-help.php:186
1995
  msgid ""
1996
  "Date/Time template tags support the \"format\" attribute: format=\"M, Y\", "
1997
  "where the value is a PHP formatted date string. Only <code>dtstart</code> "
1998
  "and <code>dtend</code> include the full date/time information for formatting."
1999
  msgstr ""
2000
 
2001
+ #: my-calendar-help.php:189
2002
  msgid "Example:"
2003
  msgstr ""
2004
 
2005
+ #: my-calendar-help.php:191 my-calendar.php:208
2006
  msgid "Event Template Tags"
2007
  msgstr ""
2008
 
2009
+ #: my-calendar-help.php:194
2010
  msgid "Displays the title of the event."
2011
  msgstr ""
2012
 
2013
+ #: my-calendar-help.php:197
2014
  msgid ""
2015
  "Displays title of the event as a link if a URL is present, or the title "
2016
  "alone if no URL is available."
2017
  msgstr ""
2018
 
2019
+ #: my-calendar-help.php:200
2020
  msgid "Displays the start time for the event."
2021
  msgstr ""
2022
 
2023
+ #: my-calendar-help.php:203
2024
+ msgid "Human language estimate of how long an event will run."
2025
+ msgstr ""
2026
+
2027
+ #: my-calendar-help.php:206
2028
  msgid ""
2029
  "Displays the start time for the event adjusted to the current user's time "
2030
  "zone settings. Returns <code>{time}</code> if user settings are disabled or "
2031
  "if the user has not selected a preferred time zone."
2032
  msgstr ""
2033
 
2034
+ #: my-calendar-help.php:209
2035
  msgid ""
2036
  "Displays the end time for the event adjusted to the current user's time zone "
2037
  "settings. Returns <code>{endtime}</code> if user settings are disabled or if "
2038
  "the user has not selected a preferred time zone."
2039
  msgstr ""
2040
 
2041
+ #: my-calendar-help.php:212
2042
  msgid "Displays the date on which the event begins."
2043
  msgstr ""
2044
 
2045
+ #: my-calendar-help.php:215
2046
  msgid ""
2047
  "Displays the date on which the series of events began (for recurring events)."
2048
  msgstr ""
2049
 
2050
+ #: my-calendar-help.php:218
2051
  msgid "Displays the date on which the event ends."
2052
  msgstr ""
2053
 
2054
+ #: my-calendar-help.php:221
2055
  msgid "Displays the time at which the event ends."
2056
  msgstr ""
2057
 
2058
+ #: my-calendar-help.php:224
2059
  msgid ""
2060
  "Displays the beginning date to the end date for events. Does not show end "
2061
  "date if same as start date."
2062
  msgstr ""
2063
 
2064
+ #: my-calendar-help.php:227
2065
  msgid ""
2066
  "Displays the beginning and end times for events. Does not show end time if "
2067
  "same as start or if marked as hidden."
2068
  msgstr ""
2069
 
2070
+ #: my-calendar-help.php:230
2071
  msgid "Timestamp for beginning of event."
2072
  msgstr ""
2073
 
2074
+ #: my-calendar-help.php:233
2075
  msgid "Timestamp for end of event."
2076
  msgstr ""
2077
 
2078
+ #: my-calendar-help.php:236
2079
  msgid ""
2080
  "For multi-day events displays an unordered list of dates and times for "
2081
  "events in this group. Otherwise, beginning date/time."
2082
  msgstr ""
2083
 
2084
+ #: my-calendar-help.php:239
2085
  msgid "Displays the WordPress author who posted the event."
2086
  msgstr ""
2087
 
2088
+ #: my-calendar-help.php:242
2089
  msgid "Displays the gravatar image for the event author."
2090
  msgstr ""
2091
 
2092
+ #: my-calendar-help.php:245
2093
  msgid "Displays the name of the person assigned as host for the event."
2094
  msgstr ""
2095
 
2096
+ #: my-calendar-help.php:248
2097
  msgid ""
2098
  "Displays the email address of the person assigned as host for the event."
2099
  msgstr ""
2100
 
2101
+ #: my-calendar-help.php:251
2102
  msgid "Displays the gravatar image for the event host."
2103
  msgstr ""
2104
 
2105
+ #: my-calendar-help.php:254
2106
  msgid "Displays the short version of the event description."
2107
  msgstr ""
2108
 
2109
+ #: my-calendar-help.php:257
2110
  msgid "Displays short description without converting paragraphs."
2111
  msgstr ""
2112
 
2113
+ #: my-calendar-help.php:260
2114
  msgid "Displays short description with any HTML stripped out."
2115
  msgstr ""
2116
 
2117
+ #: my-calendar-help.php:263
2118
+ msgid ""
2119
+ "Like <code>the_excerpt();</code> displays shortdesc if provided, otherwise "
2120
+ "excerpts description."
2121
+ msgstr ""
2122
+
2123
+ #: my-calendar-help.php:266
2124
  msgid "Displays the description of the event."
2125
  msgstr ""
2126
 
2127
+ #: my-calendar-help.php:269
2128
  msgid "Displays description without converting paragraphs."
2129
  msgstr ""
2130
 
2131
+ #: my-calendar-help.php:272
2132
  msgid "Displays description with any HTML stripped out."
2133
  msgstr ""
2134
 
2135
+ #: my-calendar-help.php:275
2136
+ msgid "Unordered list of accessibility options for this event."
2137
+ msgstr ""
2138
+
2139
+ #: my-calendar-help.php:278
2140
  msgid "Image associated with the event. (HTMl)"
2141
  msgstr ""
2142
 
2143
+ #: my-calendar-help.php:281
2144
  msgid "Image associated with the event. (image URL only)"
2145
  msgstr ""
2146
 
2147
+ #: my-calendar-help.php:284
2148
+ msgid "Event post thumbnail, full size, full HTML"
2149
+ msgstr ""
2150
+
2151
+ #: my-calendar-help.php:290
2152
+ msgid "Event post thumbnail, %s size, full HTML"
2153
+ msgstr ""
2154
+
2155
+ #: my-calendar-help.php:296
2156
  msgid "Displays the URL provided for the event."
2157
  msgstr ""
2158
 
2159
+ #: my-calendar-help.php:299
2160
  msgid "Produces the URL to download an iCal formatted record for the event."
2161
  msgstr ""
2162
 
2163
+ #: my-calendar-help.php:302
2164
  msgid ""
2165
  "Produces a hyperlink to download an iCal formatted record for the event."
2166
  msgstr ""
2167
 
2168
+ #: my-calendar-help.php:305
2169
+ msgid "URL to submit event to Google Calendar"
2170
+ msgstr ""
2171
+
2172
+ #: my-calendar-help.php:308
2173
+ msgid "Link to submit event to Google Calendar, with class \"gcal\""
2174
+ msgstr ""
2175
+
2176
+ #: my-calendar-help.php:311
2177
  msgid "Shows the recurrence status of the event. (Daily, Weekly, etc.)"
2178
  msgstr ""
2179
 
2180
+ #: my-calendar-help.php:314
2181
  msgid "Shows the number of repetitions of the event."
2182
  msgstr ""
2183
 
2184
+ #: my-calendar-help.php:317
2185
  msgid ""
2186
  "Provides a link to an auto-generated page containing all information on the "
2187
  "given event."
2188
  msgstr ""
2189
 
2190
+ #: my-calendar-help.php:317 my-calendar-help.php:323
2191
  msgid "Requires that the site URL has been provided on the Settings page"
2192
  msgstr ""
2193
 
2194
+ #: my-calendar-help.php:320
2195
+ msgid "Raw URL for the details link; empty if target URL not defined."
2196
+ msgstr ""
2197
+
2198
+ #: my-calendar-help.php:323
2199
  msgid ""
2200
  "Provides a link to the defined event URL when present, otherwise the "
2201
  "{details} link."
2202
  msgstr ""
2203
 
2204
+ #: my-calendar-help.php:326
2205
  msgid ""
2206
  "Displays text indicating whether registration for the event is currently "
2207
  "open or closed; displays nothing if that choice is selected in the event."
2208
  msgstr ""
2209
 
2210
+ #: my-calendar-help.php:329
2211
+ msgid "URL to ticketing for event."
2212
+ msgstr ""
2213
+
2214
+ #: my-calendar-help.php:332
2215
+ msgid "Registration information about this event."
2216
+ msgstr ""
2217
+
2218
+ #: my-calendar-help.php:335
2219
  msgid ""
2220
  "Displays the current status of the event: either \"Published\" or \"Reserved"
2221
  "\" - primary used in email templates."
2222
  msgstr ""
2223
 
2224
+ #: my-calendar-help.php:338 my-calendar.php:257
2225
  msgid "Location Template Tags"
2226
  msgstr ""
2227
 
2228
+ #: my-calendar-help.php:342
2229
  msgid "Displays the name of the location of the event."
2230
  msgstr ""
2231
 
2232
+ #: my-calendar-help.php:345
2233
  msgid "Displays the first line of the site address."
2234
  msgstr ""
2235
 
2236
+ #: my-calendar-help.php:348
2237
  msgid "Displays the second line of the site address."
2238
  msgstr ""
2239
 
2240
+ #: my-calendar-help.php:351
2241
  msgid "Displays the city for the location."
2242
  msgstr ""
2243
 
2244
+ #: my-calendar-help.php:354
2245
  msgid "Displays the state for the location."
2246
  msgstr ""
2247
 
2248
+ #: my-calendar-help.php:357
2249
  msgid "Displays the postcode for the location."
2250
  msgstr ""
2251
 
2252
+ #: my-calendar-help.php:360
2253
  msgid "Shows the custom region entered for the location."
2254
  msgstr ""
2255
 
2256
+ #: my-calendar-help.php:363
2257
  msgid "Displays the country for the event location."
2258
  msgstr ""
2259
 
2260
+ #: my-calendar-help.php:366
2261
  msgid "Output the URL for the location link."
2262
  msgstr ""
2263
 
2264
+ #: my-calendar-help.php:369
2265
  msgid "Output the stored phone number for the location."
2266
  msgstr ""
2267
 
2268
+ #: my-calendar-help.php:372
2269
  msgid ""
2270
  "Output a hyperlink to the location's listed link with default link text."
2271
  msgstr ""
2272
 
2273
+ #: my-calendar-help.php:375
2274
  msgid ""
2275
  "Displays the event address in <a href=\"http://microformats.org/wiki/hcard"
2276
  "\">hcard</a> format."
2277
  msgstr ""
2278
 
2279
+ #: my-calendar-help.php:378
2280
  msgid ""
2281
  "Displays a link to a Google Map of the event, if sufficient address "
2282
  "information is available. If not, will be empty."
2283
  msgstr ""
2284
 
2285
+ #: my-calendar-help.php:381
2286
  msgid ""
2287
  "Produces the URL for the Google Map for the event location if sufficient "
2288
  "address information is available. If not, will be empty."
2289
  msgstr ""
2290
 
2291
+ #: my-calendar-help.php:384
2292
+ msgid ""
2293
+ "Output Google Map if sufficient address information is available. If not, "
2294
+ "will be empty."
2295
+ msgstr ""
2296
+
2297
+ #: my-calendar-help.php:387
2298
+ msgid "Unordered list of accessibility options for this location."
2299
+ msgstr ""
2300
+
2301
+ #: my-calendar-help.php:390 my-calendar.php:292
2302
  msgid "Category Template Tags"
2303
  msgstr ""
2304
 
2305
+ #: my-calendar-help.php:394
2306
  msgid "Displays the name of the category the event is in."
2307
  msgstr ""
2308
 
2309
+ #: my-calendar-help.php:397
2310
  msgid "Produces the address of the current event's category icon."
2311
  msgstr ""
2312
 
2313
+ #: my-calendar-help.php:400
2314
  msgid "Produces the HTML for the current event's category icon."
2315
  msgstr ""
2316
 
2317
+ #: my-calendar-help.php:403
2318
  msgid "Produces the hex code for the current event's category color."
2319
  msgstr ""
2320
 
2321
+ #: my-calendar-help.php:406
2322
+ msgid "Displays the ID for the category the event is in."
 
 
2323
  msgstr ""
2324
 
2325
+ #: my-calendar-help.php:409
2326
  msgid "Special use Template Tags"
2327
  msgstr ""
2328
 
2329
+ #: my-calendar-help.php:413
2330
  msgid "A unique ID for the current instance of an event."
2331
  msgstr ""
2332
 
2333
+ #: my-calendar-help.php:416
2334
  msgid ""
2335
  "The ID for the event record associated with the current instance of an event."
2336
  msgstr ""
2337
 
2338
+ #: my-calendar-help.php:426
2339
  msgid "Get Plug-in Support"
2340
  msgstr ""
2341
 
2342
+ #: my-calendar-help.php:431
2343
  msgid "My Calendar support requests can only be sent by administrators."
2344
  msgstr ""
2345
 
2346
+ #: my-calendar-help.php:441
2347
  msgid ""
2348
  "<strong>Uninstalling the plugin</strong>: Although the WordPress standard "
2349
  "and expectation is for plug-ins to delete any custom database tables when "
2357
  "however."
2358
  msgstr ""
2359
 
2360
+ #: my-calendar-help.php:444
2361
  msgid ""
2362
  "<strong>Donations</strong>: I appreciate anything you can give. $2 may not "
2363
  "seem like much, but it can really add up when thousands of people are using "
2365
  "gifts are not tax deductible. Thank you!"
2366
  msgstr ""
2367
 
2368
+ #: my-calendar-install.php:262
2369
  msgid "My Calendar Default Timezone"
2370
  msgstr ""
2371
 
2372
+ #: my-calendar-install.php:307
2373
  msgid "My Calendar Default Location"
2374
  msgstr ""
2375
 
2376
+ #: my-calendar-locations.php:17
2377
+ msgid "Location Controls Updated"
2378
+ msgstr ""
2379
+
2380
+ #: my-calendar-locations.php:70
2381
  msgid "Location added successfully"
2382
  msgstr ""
2383
 
2384
+ #: my-calendar-locations.php:72
2385
  msgid "Location could not be added to database"
2386
  msgstr ""
2387
 
2388
+ #: my-calendar-locations.php:79
2389
  msgid "Location deleted successfully"
2390
  msgstr ""
2391
 
2392
+ #: my-calendar-locations.php:81
2393
  msgid "Location could not be deleted"
2394
  msgstr ""
2395
 
2396
+ #: my-calendar-locations.php:109
2397
  msgid "Location could not be edited."
2398
  msgstr ""
2399
 
2400
+ #: my-calendar-locations.php:111
2401
  msgid "Location was not changed."
2402
  msgstr ""
2403
 
2404
+ #: my-calendar-locations.php:113
2405
  msgid "Location edited successfully"
2406
  msgstr ""
2407
 
2408
+ #: my-calendar-locations.php:135
2409
  msgid "Add New Location"
2410
  msgstr ""
2411
 
2412
+ #: my-calendar-locations.php:137
2413
  msgid "Edit Location"
2414
  msgstr ""
2415
 
2416
+ #: my-calendar-locations.php:144
2417
  msgid "Location Editor"
2418
  msgstr ""
2419
 
2420
+ #: my-calendar-locations.php:162
2421
+ msgid "Add Location"
2422
  msgstr ""
2423
 
2424
+ #: my-calendar-locations.php:170
2425
+ msgid "Add a New Location"
 
 
2426
  msgstr ""
2427
 
2428
+ #: my-calendar-locations.php:174 my-calendar.php:350
2429
+ msgid "Manage Locations"
2430
  msgstr ""
2431
 
2432
+ #: my-calendar-locations.php:230
2433
+ msgid "&laquo; Previous<span class=\"screen-reader-text\"> Locations</span>"
2434
  msgstr ""
2435
 
2436
+ #: my-calendar-locations.php:231
2437
+ msgid "Next<span class=\"screen-reader-text\"> Locations</span> &raquo;"
2438
  msgstr ""
2439
 
2440
+ #: my-calendar-locations.php:263
2441
  msgid "There are no locations in the database yet!"
2442
  msgstr ""
2443
 
2444
+ #: my-calendar-locations.php:266
2445
  msgid ""
2446
  "Please note: editing or deleting locations stored for re-use will have no "
2447
  "effect on any event previously scheduled at that location. The location "
2449
  "locations into event records."
2450
  msgstr ""
2451
 
2452
+ #: my-calendar-locations.php:273
2453
+ msgid "Control Input Options for Location Fields"
2454
+ msgstr ""
2455
+
2456
+ #: my-calendar-locations.php:282
2457
+ msgid "Location Controls for %s"
2458
+ msgstr ""
2459
+
2460
+ #: my-calendar-locations.php:282
2461
+ msgid "Value, Label; one per line"
2462
+ msgstr ""
2463
+
2464
+ #: my-calendar-locations.php:295
2465
+ msgid "Save Location Controls"
2466
+ msgstr ""
2467
+
2468
+ #: my-calendar-locations.php:304
2469
+ msgid "Copy this location into the locations table"
2470
+ msgstr ""
2471
+
2472
+ #: my-calendar-locations.php:322
2473
+ msgid "Location Address"
2474
+ msgstr ""
2475
+
2476
+ #: my-calendar-locations.php:395
2477
+ msgid ""
2478
+ "If you supply GPS coordinates for your location, they will be used in place "
2479
+ "of any other address information to provide your map link."
2480
+ msgstr ""
2481
+
2482
+ #: my-calendar-locations.php:404
2483
+ msgid "Location Contact Information"
2484
+ msgstr ""
2485
+
2486
+ #: my-calendar-locations.php:409
2487
+ msgid "Secondary Phone"
2488
  msgstr ""
2489
 
2490
+ #: my-calendar-output.php:93
2491
  msgid "(%s in your time zone)"
2492
  msgstr ""
2493
 
2494
+ #: my-calendar-output.php:99
2495
  msgid "Not Applicable"
2496
  msgstr ""
2497
 
2498
+ #: my-calendar-output.php:235 my-calendar-output.php:345
2499
+ msgid "Close"
2500
  msgstr ""
2501
 
2502
+ #: my-calendar-output.php:244
2503
+ msgid "Posted by"
2504
  msgstr ""
2505
 
2506
+ #: my-calendar-output.php:262 my-calendar-templates.php:270
2507
  msgid "iCal"
2508
  msgstr ""
2509
 
2510
+ #: my-calendar-output.php:302
2511
  msgid ""
2512
+ "This event is in a series. Register for the first event in this series to "
2513
+ "attend."
2514
  msgstr ""
2515
 
2516
+ #: my-calendar-output.php:309
2517
  msgid "View full calendar"
2518
  msgstr ""
2519
 
2520
+ #: my-calendar-output.php:371
2521
  msgid "Edit This Date"
2522
  msgstr ""
2523
 
2524
+ #: my-calendar-output.php:371
2525
  msgid "Edit All"
2526
  msgstr ""
2527
 
2528
+ #: my-calendar-output.php:371
2529
  msgid "Delete This Date"
2530
  msgstr ""
2531
 
2532
+ #: my-calendar-output.php:371
2533
  msgid "Delete All"
2534
  msgstr ""
2535
 
2536
+ #: my-calendar-output.php:433
2537
  msgid "Go"
2538
  msgstr ""
2539
 
2540
+ #: my-calendar-output.php:459
2541
  msgid "Calendar: Print View"
2542
  msgstr ""
2543
 
2544
+ #: my-calendar-output.php:478
2545
  msgid "Return to site"
2546
  msgstr ""
2547
 
2548
+ #: my-calendar-output.php:491
2549
  msgid "View as Grid"
2550
  msgstr ""
2551
 
2552
+ #: my-calendar-output.php:495
2553
  msgid "View as List"
2554
  msgstr ""
2555
 
2556
+ #: my-calendar-output.php:588
2557
  msgid " and %d other event"
2558
  msgstr ""
2559
 
2560
+ #: my-calendar-output.php:590
2561
  msgid " and %d other events"
2562
  msgstr ""
2563
 
2564
+ #: my-calendar-output.php:668
 
 
 
 
2565
  msgid "Sorry, your search produced no results."
2566
  msgstr ""
2567
 
2568
+ #: my-calendar-output.php:677
2569
+ msgid "Events Search for &ldquo;%s&rdquo;"
 
 
 
2570
  msgstr ""
2571
 
2572
+ #: my-calendar-output.php:759
2573
  msgid "<abbr title=\"Sunday\">Sun</abbr>"
2574
  msgstr ""
2575
 
2576
+ #: my-calendar-output.php:760
2577
  msgid "<abbr title=\"Monday\">Mon</abbr>"
2578
  msgstr ""
2579
 
2580
+ #: my-calendar-output.php:761
2581
  msgid "<abbr title=\"Tuesday\">Tues</abbr>"
2582
  msgstr ""
2583
 
2584
+ #: my-calendar-output.php:762
2585
  msgid "<abbr title=\"Wednesday\">Wed</abbr>"
2586
  msgstr ""
2587
 
2588
+ #: my-calendar-output.php:763
2589
  msgid "<abbr title=\"Thursday\">Thur</abbr>"
2590
  msgstr ""
2591
 
2592
+ #: my-calendar-output.php:764
2593
  msgid "<abbr title=\"Friday\">Fri</abbr>"
2594
  msgstr ""
2595
 
2596
+ #: my-calendar-output.php:765
2597
  msgid "<abbr title=\"Saturday\">Sat</abbr>"
2598
  msgstr ""
2599
 
2600
+ #: my-calendar-output.php:770
2601
  msgid "<abbr title=\"Sunday\">S</abbr>"
2602
  msgstr ""
2603
 
2604
+ #: my-calendar-output.php:771
2605
  msgid "<abbr title=\"Monday\">M</abbr>"
2606
  msgstr ""
2607
 
2608
+ #: my-calendar-output.php:772
2609
  msgid "<abbr title=\"Tuesday\">T</abbr>"
2610
  msgstr ""
2611
 
2612
+ #: my-calendar-output.php:773
2613
  msgid "<abbr title=\"Wednesday\">W</abbr>"
2614
  msgstr ""
2615
 
2616
+ #: my-calendar-output.php:774
2617
  msgid "<abbr title=\"Thursday\">T</abbr>"
2618
  msgstr ""
2619
 
2620
+ #: my-calendar-output.php:775
2621
  msgid "<abbr title=\"Friday\">F</abbr>"
2622
  msgstr ""
2623
 
2624
+ #: my-calendar-output.php:776
2625
  msgid "<abbr title=\"Saturday\">S</abbr>"
2626
  msgstr ""
2627
 
2628
+ #: my-calendar-output.php:877
2629
  msgid "Print View"
2630
  msgstr ""
2631
 
2632
+ #: my-calendar-output.php:970
2633
  msgid "No events scheduled for today!"
2634
  msgstr ""
2635
 
2636
+ #: my-calendar-output.php:989
2637
  msgid "and"
2638
  msgstr ""
2639
 
2640
+ #: my-calendar-output.php:1004
2641
  msgid "Events in"
2642
  msgstr ""
2643
 
2644
+ #: my-calendar-output.php:1036
2645
  msgid "There are no events scheduled during this period."
2646
  msgstr ""
2647
 
2648
+ #: my-calendar-output.php:1144
2649
  msgid ""
2650
  "Unrecognized calendar format. Please use one of 'list','calendar', or 'mini'."
2651
  msgstr ""
2652
 
2653
+ #: my-calendar-output.php:1193
 
 
 
 
2654
  msgid "Subscribe by <abbr title=\"Really Simple Syndication\">RSS</abbr>"
2655
  msgstr ""
2656
 
2657
+ #: my-calendar-output.php:1194
2658
  msgid "Download as <abbr title=\"iCal Events Export\">iCal</abbr>"
2659
  msgstr ""
2660
 
2661
+ #: my-calendar-output.php:1217
2662
  msgid "Next events &raquo;"
2663
  msgstr ""
2664
 
2665
+ #: my-calendar-output.php:1243 my-calendar-output.php:1287
2666
  msgid "Week of "
2667
  msgstr ""
2668
 
2669
+ #: my-calendar-output.php:1261
2670
  msgid "&laquo; Previous events"
2671
  msgstr ""
2672
 
2673
+ #: my-calendar-output.php:1328
2674
+ msgid "Filter Events"
2675
+ msgstr ""
2676
+
2677
+ #: my-calendar-output.php:1345
2678
  msgid "(select to include)"
2679
  msgstr ""
2680
 
2681
+ #: my-calendar-output.php:1370 my-calendar-output.php:1373
2682
  msgid "All Categories"
2683
  msgstr ""
2684
 
2685
+ #: my-calendar-output.php:1390 my-calendar-output.php:1649
2686
+ msgid "Submit"
2687
  msgstr ""
2688
 
2689
+ #: my-calendar-output.php:1429 my-calendar-output.php:1430
2690
+ msgid "Accessibility Services"
2691
  msgstr ""
2692
 
2693
+ #: my-calendar-output.php:1432
2694
+ msgid "No Limit"
2695
  msgstr ""
2696
 
2697
+ #: my-calendar-output.php:1447
2698
+ msgid "Limit by Access"
2699
  msgstr ""
2700
 
2701
+ #: my-calendar-output.php:1584 my-calendar-output.php:1607
2702
+ msgid "Show all"
2703
  msgstr ""
2704
 
2705
+ #: my-calendar-settings.php:127
2706
  msgid "Categories imported successfully."
2707
  msgstr ""
2708
 
2709
+ #: my-calendar-settings.php:127
2710
  msgid "Categories not imported."
2711
  msgstr ""
2712
 
2713
+ #: my-calendar-settings.php:128
2714
  msgid "Events imported successfully."
2715
  msgstr ""
2716
 
2717
+ #: my-calendar-settings.php:128
2718
  msgid "Events not imported."
2719
  msgstr ""
2720
 
2721
+ #: my-calendar-settings.php:152
2722
  msgid "Dropping occurrences database table"
2723
  msgstr ""
2724
 
2725
+ #: my-calendar-settings.php:154
2726
  msgid "Reinstalling occurrences database table."
2727
  msgstr ""
2728
 
2729
+ #: my-calendar-settings.php:156
2730
  msgid "Generating event occurrences."
2731
  msgstr ""
2732
 
2733
+ #: my-calendar-settings.php:158
2734
  msgid "Event generation completed."
2735
  msgstr ""
2736
 
2737
+ #: my-calendar-settings.php:168
2738
  msgid "My Calendar Cache cleared"
2739
  msgstr ""
2740
 
2741
+ #: my-calendar-settings.php:177
2742
  msgid "My Calendar Management Settings saved"
2743
  msgstr ""
2744
 
2745
+ #: my-calendar-settings.php:182 my-calendar-settings.php:723
2746
  msgid "Add Events"
2747
  msgstr ""
2748
 
2749
+ #: my-calendar-settings.php:183 my-calendar-settings.php:724
2750
  msgid "Approve Events"
2751
  msgstr ""
2752
 
2753
+ #: my-calendar-settings.php:185 my-calendar-settings.php:726
2754
  msgid "Edit Categories"
2755
  msgstr ""
2756
 
2757
+ #: my-calendar-settings.php:186 my-calendar-settings.php:727
2758
  msgid "Edit Locations"
2759
  msgstr ""
2760
 
2761
+ #: my-calendar-settings.php:187 my-calendar-settings.php:728
2762
  msgid "Edit Styles"
2763
  msgstr ""
2764
 
2765
+ #: my-calendar-settings.php:188 my-calendar-settings.php:729
2766
  msgid "Edit Behaviors"
2767
  msgstr ""
2768
 
2769
+ #: my-calendar-settings.php:189 my-calendar-settings.php:730
2770
  msgid "Edit Templates"
2771
  msgstr ""
2772
 
2773
+ #: my-calendar-settings.php:190 my-calendar-settings.php:731
2774
  msgid "Edit Settings"
2775
  msgstr ""
2776
 
2777
+ #: my-calendar-settings.php:191 my-calendar-settings.php:732
2778
  msgid "View Help"
2779
  msgstr ""
2780
 
2781
+ #: my-calendar-settings.php:205
2782
  msgid "My Calendar Permissions Updated"
2783
  msgstr ""
2784
 
2785
+ #: my-calendar-settings.php:255
2786
  msgid "Output Settings saved"
2787
  msgstr ""
2788
 
2789
+ #: my-calendar-settings.php:265
2790
  msgid "Date/Time Format Settings saved"
2791
  msgstr ""
2792
 
2793
+ #: my-calendar-settings.php:284
2794
  msgid "Input Settings saved"
2795
  msgstr ""
2796
 
2797
+ #: my-calendar-settings.php:292
2798
  msgid "Multisite settings saved"
2799
  msgstr ""
2800
 
2801
+ #: my-calendar-settings.php:321
2802
  msgid "Custom text settings saved"
2803
  msgstr ""
2804
 
2805
+ #: my-calendar-settings.php:337
2806
  msgid "Email notice settings saved"
2807
  msgstr ""
2808
 
2809
+ #: my-calendar-settings.php:353
 
 
 
 
2810
  msgid "My Calendar Options"
2811
  msgstr ""
2812
 
2813
+ #: my-calendar-settings.php:385
2814
  msgid "My Calendar Settings"
2815
  msgstr ""
2816
 
2817
+ #: my-calendar-settings.php:388 my-calendar-settings.php:412
2818
  msgid "Management"
2819
  msgstr ""
2820
 
2821
+ #: my-calendar-settings.php:389
2822
  msgid "Customizable Text"
2823
  msgstr ""
2824
 
2825
+ #: my-calendar-settings.php:390
2826
  msgid "Output"
2827
  msgstr ""
2828
 
2829
+ #: my-calendar-settings.php:392
2830
  msgid "Input"
2831
  msgstr ""
2832
 
2833
+ #: my-calendar-settings.php:394
2834
  msgid "Multi-site"
2835
  msgstr ""
2836
 
2837
+ #: my-calendar-settings.php:396
2838
  msgid "Permissions"
2839
  msgstr ""
2840
 
2841
+ #: my-calendar-settings.php:397 my-calendar-settings.php:772
2842
  msgid "Email Notifications"
2843
  msgstr ""
2844
 
2845
+ #: my-calendar-settings.php:406
 
 
 
 
2846
  msgid "My Calendar Management"
2847
  msgstr ""
2848
 
2849
+ #: my-calendar-settings.php:414
 
 
 
 
2850
  msgid "Get data (events, categories and locations) from a remote database."
2851
  msgstr ""
2852
 
2853
+ #: my-calendar-settings.php:416
2854
  msgid "Add this code to your theme's <code>functions.php</code> file:"
2855
  msgstr ""
2856
 
2857
+ #: my-calendar-settings.php:421
2858
  msgid ""
2859
  "You will need to allow remote connections from this site to the site hosting "
2860
  "your My Calendar events. Replace the above placeholders with the host-site "
2863
  "installation."
2864
  msgstr ""
2865
 
2866
+ #: my-calendar-settings.php:424
2867
  msgid "Enable approval options."
2868
  msgstr ""
2869
 
2870
+ #: my-calendar-settings.php:425
2871
+ msgid "Enable external API."
2872
+ msgstr ""
2873
+
2874
+ #: my-calendar-settings.php:428
2875
  msgid ""
2876
  "Clear current cache. (Necessary if you edit shortcodes to change displayed "
2877
  "categories, for example.)"
2878
  msgstr ""
2879
 
2880
+ #: my-calendar-settings.php:430
2881
  msgid "Default Sort order for Admin Events List"
2882
  msgstr ""
2883
 
2884
+ #: my-calendar-settings.php:430
2885
  msgid "Event ID"
2886
  msgstr ""
2887
 
2888
+ #: my-calendar-settings.php:430
2889
  msgid "Description"
2890
  msgstr ""
2891
 
2892
+ #: my-calendar-settings.php:430
2893
  msgid "Start Date"
2894
  msgstr ""
2895
 
2896
+ #: my-calendar-settings.php:433
2897
  msgid "Currently editing my local calendar"
2898
  msgstr ""
2899
 
2900
+ #: my-calendar-settings.php:433
2901
  msgid "Currently editing the network calendar"
2902
  msgstr ""
2903
 
2904
+ #: my-calendar-settings.php:436
2905
  msgid ""
2906
  "You are currently working in the primary site for this network; your local "
2907
  "calendar is also the global table."
2908
  msgstr ""
2909
 
2910
+ #: my-calendar-settings.php:439
2911
  msgid "Re-generate event occurrences table."
2912
  msgstr ""
2913
 
2914
+ #: my-calendar-settings.php:443
2915
  msgid "Save Management Settings"
2916
  msgstr ""
2917
 
2918
+ #: my-calendar-settings.php:447
2919
  msgid "My Calendar management settings are only available to administrators."
2920
  msgstr ""
2921
 
2922
+ #: my-calendar-settings.php:455
2923
+ msgid "Text Settings"
2924
  msgstr ""
2925
 
2926
+ #: my-calendar-settings.php:460
2927
+ msgid "Customize Text Fields"
2928
  msgstr ""
2929
 
2930
+ #: my-calendar-settings.php:462
2931
  msgid "Label for all-day events"
2932
  msgstr ""
2933
 
2934
+ #: my-calendar-settings.php:463
2935
  msgid "Previous events link"
2936
  msgstr ""
2937
 
2938
+ #: my-calendar-settings.php:463
2939
+ msgid "Previous"
2940
  msgstr ""
2941
 
2942
+ #: my-calendar-settings.php:463 my-calendar-settings.php:464
2943
+ msgid "Use <code>{date}</code> to display date in navigation."
2944
  msgstr ""
2945
 
2946
+ #: my-calendar-settings.php:464
2947
  msgid "Next events link"
2948
  msgstr ""
2949
 
2950
+ #: my-calendar-settings.php:464
2951
+ msgid "Next"
2952
  msgstr ""
2953
 
2954
+ #: my-calendar-settings.php:465
2955
  msgid "If events are open"
2956
  msgstr ""
2957
 
2958
+ #: my-calendar-settings.php:465
2959
  msgid "Registration is open"
2960
  msgstr ""
2961
 
2962
+ #: my-calendar-settings.php:466
2963
  msgid "If events are closed"
2964
  msgstr ""
2965
 
2966
+ #: my-calendar-settings.php:466
2967
  msgid "Registration is closed"
2968
  msgstr ""
2969
 
2970
+ #: my-calendar-settings.php:467
2971
  msgid "Week view caption:"
2972
  msgstr ""
2973
 
2974
+ #: my-calendar-settings.php:467
2975
  msgid "Available tag: <code>{date format=\"\"}</code>"
2976
  msgstr ""
2977
 
2978
+ #: my-calendar-settings.php:468
2979
  msgid "Extended caption:"
2980
  msgstr ""
2981
 
2982
+ #: my-calendar-settings.php:468
2983
+ msgid "Follows month/year in list views."
 
2984
  msgstr ""
2985
 
2986
+ #: my-calendar-settings.php:469
2987
  msgid "Event title template"
2988
  msgstr ""
2989
 
2990
+ #: my-calendar-settings.php:469 my-calendar-settings.php:471
2991
+ #: my-calendar-settings.php:779
2992
+ msgid "Templating Help"
2993
  msgstr ""
2994
 
2995
+ #: my-calendar-settings.php:470
2996
  msgid "Event details link text"
2997
  msgstr ""
2998
 
2999
+ #: my-calendar-settings.php:470
3000
  msgid ""
3001
  "Tags: <code>{title}</code>, <code>{location}</code>, <code>{color}</code>, "
3002
  "<code>{icon}</code>, <code>{date}</code>, <code>{time}</code>."
3003
  msgstr ""
3004
 
3005
+ #: my-calendar-settings.php:471
3006
  msgid "Event URL link text"
3007
  msgstr ""
3008
 
3009
+ #: my-calendar-settings.php:472
 
 
 
 
3010
  msgid "Title element template"
3011
  msgstr ""
3012
 
3013
+ #: my-calendar-settings.php:472
3014
  msgid "Current: %s"
3015
  msgstr ""
3016
 
3017
+ #: my-calendar-settings.php:476
3018
  msgid "Save Custom Text Settings"
3019
  msgstr ""
3020
 
3021
+ #: my-calendar-settings.php:485
3022
+ msgid "Output Settings"
 
 
 
 
3023
  msgstr ""
3024
 
3025
+ #: my-calendar-settings.php:490
3026
  msgid "Calendar Link Targets"
3027
  msgstr ""
3028
 
3029
+ #: my-calendar-settings.php:494
3030
  msgid "Where is your main calendar page?"
3031
  msgstr ""
3032
 
3033
+ #: my-calendar-settings.php:494 my-calendar-settings.php:495
3034
  msgid ""
3035
  "Can be any Page or Post which includes the <code>[my_calendar]</code> "
3036
  "shortcode."
3037
  msgstr ""
3038
 
3039
+ #: my-calendar-settings.php:495
3040
  msgid ""
3041
  "Target <abbr title=\"Uniform resource locator\">URL</abbr> for mini calendar "
3042
  "date links:"
3043
  msgstr ""
3044
 
3045
+ #: my-calendar-settings.php:496
 
 
 
 
3046
  msgid "Open calendar links to event details URL"
3047
  msgstr ""
3048
 
3049
+ #: my-calendar-settings.php:500
 
 
 
 
3050
  msgid "Mini calendar widget date links to:"
3051
  msgstr ""
3052
 
3053
+ #: my-calendar-settings.php:500
3054
  msgid "jQuery pop-up view"
3055
  msgstr ""
3056
 
3057
+ #: my-calendar-settings.php:500
3058
  msgid "daily view page (above)"
3059
  msgstr ""
3060
 
3061
+ #: my-calendar-settings.php:500
3062
  msgid "in-page anchor on main calendar page (list)"
3063
  msgstr ""
3064
 
3065
+ #: my-calendar-settings.php:500
3066
  msgid "in-page anchor on main calendar page (grid)"
3067
  msgstr ""
3068
 
3069
+ #: my-calendar-settings.php:506
3070
+ msgid "Set Default Navigation Element Order (can be overridden in shortcodes)"
3071
  msgstr ""
3072
 
3073
+ #: my-calendar-settings.php:513
3074
+ msgid "Primary Previous/Next Buttons"
3075
  msgstr ""
3076
 
3077
+ #: my-calendar-settings.php:514
3078
+ msgid "Switch between list and grid views"
3079
  msgstr ""
3080
 
3081
+ #: my-calendar-settings.php:515
3082
+ msgid "Jump to any other month/year"
 
 
3083
  msgstr ""
3084
 
3085
+ #: my-calendar-settings.php:516
3086
+ msgid "Link to printable view"
3087
  msgstr ""
3088
 
3089
+ #: my-calendar-settings.php:517
3090
+ msgid "Toggle between day, week, and month view"
3091
  msgstr ""
3092
 
3093
+ #: my-calendar-settings.php:518
3094
+ msgid "The calendar"
3095
  msgstr ""
3096
 
3097
+ #: my-calendar-settings.php:520
3098
+ msgid "Links to RSS and iCal output"
3099
  msgstr ""
3100
 
3101
  #: my-calendar-settings.php:521
3102
+ msgid "Elements below here will be hidden."
3103
+ msgstr ""
3104
+
3105
+ #: my-calendar-settings.php:543
3106
  msgid "Grid Layout Options"
3107
  msgstr ""
3108
 
3109
+ #: my-calendar-settings.php:545
3110
  msgid "Show Weekends on Calendar"
3111
  msgstr ""
3112
 
3113
+ #: my-calendar-settings.php:546
3114
  msgid "Switch to list view on mobile devices"
3115
  msgstr ""
3116
 
3117
+ #: my-calendar-settings.php:552
3118
  msgid "List Layout Options"
3119
  msgstr ""
3120
 
3121
+ #: my-calendar-settings.php:554
3122
  msgid "How many months of events to show at a time:"
3123
  msgstr ""
3124
 
3125
+ #: my-calendar-settings.php:555
3126
  msgid ""
3127
  "Show the first event's title and the number of events that day next to the "
3128
  "date."
3129
  msgstr ""
3130
 
3131
+ #: my-calendar-settings.php:561
3132
  msgid "Event Details Pop-up"
3133
  msgstr ""
3134
 
3135
+ #: my-calendar-settings.php:562
3136
  msgid ""
3137
  "The checked items will be shown in your event details view. Does not apply "
3138
  "if you are using a custom template"
3139
  msgstr ""
3140
 
3141
+ #: my-calendar-settings.php:564
3142
  msgid "Author's name"
3143
  msgstr ""
3144
 
3145
+ #: my-calendar-settings.php:565
3146
  msgid "Link to single event iCal download"
3147
  msgstr ""
3148
 
3149
+ #: my-calendar-settings.php:566
3150
  msgid "Link to submit event to Google Calendar"
3151
  msgstr ""
3152
 
3153
+ #: my-calendar-settings.php:567
3154
+ msgid "Hide Category icons"
3155
  msgstr ""
3156
 
3157
+ #: my-calendar-settings.php:568
3158
  msgid "Link to Google Map"
3159
  msgstr ""
3160
 
3161
+ #: my-calendar-settings.php:569
3162
  msgid "Event Address"
3163
  msgstr ""
3164
 
3165
+ #: my-calendar-settings.php:570
3166
  msgid "Short description"
3167
  msgstr ""
3168
 
3169
+ #: my-calendar-settings.php:571
3170
  msgid "Full description"
3171
  msgstr ""
3172
 
3173
+ #: my-calendar-settings.php:572
3174
  msgid "Process WordPress shortcodes in descriptions"
3175
  msgstr ""
3176
 
3177
+ #: my-calendar-settings.php:573
3178
  msgid "Link to event details (requires <a href='#mc_uri'>URL</a>)"
3179
  msgstr ""
3180
 
3181
+ #: my-calendar-settings.php:574
3182
  msgid "External link"
3183
  msgstr ""
3184
 
3185
+ #: my-calendar-settings.php:575
3186
+ msgid "Registration info"
 
 
 
 
3187
  msgstr ""
3188
 
3189
+ #: my-calendar-settings.php:579
3190
  msgid "Event Category Display"
3191
  msgstr ""
3192
 
3193
+ #: my-calendar-settings.php:581
3194
  msgid "No category colors with titles."
3195
  msgstr ""
3196
 
3197
+ #: my-calendar-settings.php:581
3198
  msgid "Titles are in category colors."
3199
  msgstr ""
3200
 
3201
+ #: my-calendar-settings.php:581
3202
  msgid "Titles have category color as background."
3203
  msgstr ""
3204
 
3205
+ #: my-calendar-settings.php:582
3206
  msgid "Optimize contrast for category colors."
3207
  msgstr ""
3208
 
3209
+ #: my-calendar-settings.php:587
3210
  msgid "Event Scheduling Defaults"
3211
  msgstr ""
3212
 
3213
+ #: my-calendar-settings.php:589
3214
+ msgid "Event links expire after event passes."
 
 
 
 
 
 
 
3215
  msgstr ""
3216
 
3217
+ #: my-calendar-settings.php:590
3218
+ msgid ""
3219
+ "If a recurring event falls on a date that doesn't exist (like the 5th "
3220
+ "Wednesday in February), move it back one week."
3221
  msgstr ""
3222
 
3223
+ #: my-calendar-settings.php:591
3224
  msgid ""
3225
+ "If an event coincides with an event in the designated \"Holiday\" category, "
3226
+ "do not show the event."
3227
  msgstr ""
3228
 
3229
+ #: my-calendar-settings.php:595
3230
  msgid "Save Output Settings"
3231
  msgstr ""
3232
 
3233
+ #: my-calendar-settings.php:603
3234
  msgid "Calendar Time Formats"
3235
  msgstr ""
3236
 
3237
+ #: my-calendar-settings.php:608
3238
  msgid "Set default date/time formats"
3239
  msgstr ""
3240
 
3241
+ #: my-calendar-settings.php:617
3242
  msgid "Month format (calendar headings)"
3243
  msgstr ""
3244
 
3245
+ #: my-calendar-settings.php:618
 
 
 
 
 
3246
  msgid "Time format"
3247
  msgstr ""
3248
 
3249
+ #: my-calendar-settings.php:619
3250
  msgid "Date in grid mode, week view"
3251
  msgstr ""
3252
 
3253
+ #: my-calendar-settings.php:620
3254
  msgid "Date Format in other views"
3255
  msgstr ""
3256
 
3257
+ #: my-calendar-settings.php:622
3258
  msgid ""
3259
+ "Date formats use syntax from the <a href=\"http://php.net/date\">PHP "
3260
+ "<code>date()</code> function</a>. Save to update sample output."
3261
+ msgstr ""
3262
+
3263
+ #: my-calendar-settings.php:624
3264
+ msgid "iCal times are UTC"
3265
  msgstr ""
3266
 
3267
+ #: my-calendar-settings.php:628
3268
  msgid "Save Date/Time Settings"
3269
  msgstr ""
3270
 
3271
+ #: my-calendar-settings.php:638
3272
  msgid "Calendar Input Settings"
3273
  msgstr ""
3274
 
3275
+ #: my-calendar-settings.php:643
3276
  msgid ""
3277
  "Select which input fields will be available when adding or editing events."
3278
  msgstr ""
3279
 
3280
+ #: my-calendar-settings.php:648 my-calendar.php:387
3281
  msgid "Event Location Dropdown Menu"
3282
  msgstr ""
3283
 
3284
+ #: my-calendar-settings.php:648 my-calendar.php:387
3285
  msgid "Event Short Description field"
3286
  msgstr ""
3287
 
3288
+ #: my-calendar-settings.php:648 my-calendar.php:387
3289
  msgid "Event Description Field"
3290
  msgstr ""
3291
 
3292
+ #: my-calendar-settings.php:648 my-calendar.php:387
3293
  msgid "Event Category field"
3294
  msgstr ""
3295
 
3296
+ #: my-calendar-settings.php:648 my-calendar.php:387
3297
  msgid "Event Image field"
3298
  msgstr ""
3299
 
3300
+ #: my-calendar-settings.php:648 my-calendar.php:387
3301
  msgid "Event Link field"
3302
  msgstr ""
3303
 
3304
+ #: my-calendar-settings.php:648 my-calendar.php:387
3305
  msgid "Event Recurrence Options"
3306
  msgstr ""
3307
 
3308
+ #: my-calendar-settings.php:648 my-calendar.php:387
3309
  msgid "Event Registration options"
3310
  msgstr ""
3311
 
3312
+ #: my-calendar-settings.php:648 my-calendar.php:387
3313
  msgid "Event Location fields"
3314
  msgstr ""
3315
 
3316
+ #: my-calendar-settings.php:648 my-calendar.php:387
3317
+ msgid "Set Special Scheduling options"
3318
  msgstr ""
3319
 
3320
+ #: my-calendar-settings.php:648 my-calendar.php:387
3321
+ msgid "Event Accessibility"
3322
  msgstr ""
3323
 
3324
+ #: my-calendar-settings.php:662
3325
  msgid "Administrators see all input options"
3326
  msgstr ""
3327
 
3328
+ #: my-calendar-settings.php:666
3329
  msgid "Save Input Settings"
3330
  msgstr ""
3331
 
3332
+ #: my-calendar-settings.php:676
3333
  msgid "Multisite Settings (Network Administrators only)"
3334
  msgstr ""
3335
 
3336
+ #: my-calendar-settings.php:682
3337
+ msgid "WP MultiSite configurations"
3338
  msgstr ""
3339
 
3340
+ #: my-calendar-settings.php:683
3341
  msgid ""
3342
  "The central calendar is the calendar associated with the primary site in "
3343
  "your WordPress Multisite network."
3344
  msgstr ""
3345
 
3346
+ #: my-calendar-settings.php:685
3347
  msgid "Site owners may only post to their local calendar"
3348
  msgstr ""
3349
 
3350
+ #: my-calendar-settings.php:686
3351
  msgid "Site owners may only post to the central calendar"
3352
  msgstr ""
3353
 
3354
+ #: my-calendar-settings.php:687
3355
  msgid "Site owners may manage either calendar"
3356
  msgstr ""
3357
 
3358
+ #: my-calendar-settings.php:689
3359
  msgid ""
3360
  "Changes only effect input permissions. Public-facing calendars will be "
3361
  "unchanged."
3362
  msgstr ""
3363
 
3364
+ #: my-calendar-settings.php:691
3365
  msgid "Sub-site calendars show events from their local calendar."
3366
  msgstr ""
3367
 
3368
+ #: my-calendar-settings.php:692
3369
  msgid "Sub-site calendars show events from the central calendar."
3370
  msgstr ""
3371
 
3372
+ #: my-calendar-settings.php:696
3373
  msgid "Save Multisite Settings"
3374
  msgstr ""
3375
 
3376
+ #: my-calendar-settings.php:706
3377
  msgid "My Calendar Permissions"
3378
  msgstr ""
3379
 
3380
+ #: my-calendar-settings.php:755
 
 
 
 
3381
  msgid "Save Permissions"
3382
  msgstr ""
3383
 
3384
+ #: my-calendar-settings.php:759
3385
  msgid "My Calendar permission settings are only available to administrators."
3386
  msgstr ""
3387
 
3388
+ #: my-calendar-settings.php:767
3389
  msgid "Calendar Email Settings"
3390
  msgstr ""
3391
 
3392
+ #: my-calendar-settings.php:775
 
 
 
 
3393
  msgid "Send Email Notifications when new events are scheduled or reserved."
3394
  msgstr ""
3395
 
3396
+ #: my-calendar-settings.php:776
3397
+ msgid "Notification messages are sent to:"
3398
  msgstr ""
3399
 
3400
+ #: my-calendar-settings.php:777
3401
+ msgid "Notification messages are sent from:"
3402
  msgstr ""
3403
 
3404
+ #: my-calendar-settings.php:778
3405
  msgid "Email subject"
3406
  msgstr ""
3407
 
3408
+ #: my-calendar-settings.php:778
3409
+ msgid "New event added"
3410
  msgstr ""
3411
 
3412
+ #: my-calendar-settings.php:779
3413
  msgid "Message Body"
3414
  msgstr ""
3415
 
3416
+ #: my-calendar-settings.php:779
3417
  msgid "New Event:"
3418
  msgstr ""
3419
 
3420
+ #: my-calendar-settings.php:780
 
 
 
 
 
 
 
 
3421
  msgid "Send HTML email"
3422
  msgstr ""
3423
 
3424
+ #: my-calendar-settings.php:784
3425
  msgid "Save Email Settings"
3426
  msgstr ""
3427
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3428
  #: my-calendar-styles.php:90
3429
  msgid "Styles are disabled, and were not edited."
3430
  msgstr ""
3455
  "your file name and location!"
3456
  msgstr ""
3457
 
3458
+ #: my-calendar-styles.php:138
3459
  msgid "My Calendar Styles"
3460
  msgstr ""
3461
 
3462
+ #: my-calendar-styles.php:143
3463
  msgid "Calendar Style Settings"
3464
  msgstr ""
3465
 
3466
+ #: my-calendar-styles.php:151
3467
  msgid "Select My Calendar Theme"
3468
  msgstr ""
3469
 
3470
+ #: my-calendar-styles.php:158
3471
  msgid "Your Custom Stylesheets"
3472
  msgstr ""
3473
 
3474
+ #: my-calendar-styles.php:167
3475
  msgid "Installed Stylesheets"
3476
  msgstr ""
3477
 
3478
+ #: my-calendar-styles.php:174
3479
  msgid "Choose Style"
3480
  msgstr ""
3481
 
3482
+ #: my-calendar-styles.php:188
3483
  msgid ""
3484
  "My Calendar was unable to update your CSS files during the upgrade. Please "
3485
  "check your file permissions if you wish to edit your My Calendar styles. "
3487
  "be deleted from the database when you successfully update your stylesheet."
3488
  msgstr ""
3489
 
3490
+ #: my-calendar-styles.php:196
3491
  msgid "CSS Style Options"
3492
  msgstr ""
3493
 
3494
+ #: my-calendar-styles.php:198
3495
  msgid "Apply CSS on these pages (comma separated IDs)"
3496
  msgstr ""
3497
 
3498
+ #: my-calendar-styles.php:201
3499
  msgid "Restore My Calendar stylesheet"
3500
  msgstr ""
3501
 
3502
+ #: my-calendar-styles.php:201
3503
  msgid "Disable My Calendar Stylesheet"
3504
  msgstr ""
3505
 
3506
+ #: my-calendar-styles.php:204
3507
  msgid "Edit the stylesheet for My Calendar"
3508
  msgstr ""
3509
 
3510
+ #: my-calendar-styles.php:217
3511
  msgid "Comparing Your Style with latest installed version of My Calendar"
3512
  msgstr ""
3513
 
3514
+ #: my-calendar-styles.php:221
3515
  msgid "There have been updates to the stylesheet."
3516
  msgstr ""
3517
 
3518
+ #: my-calendar-styles.php:221
3519
  msgid "Compare Your Stylesheet with latest installed version of My Calendar."
3520
  msgstr ""
3521
 
3522
+ #: my-calendar-styles.php:226
3523
  msgid "Your stylesheet matches that included with My Calendar."
3524
  msgstr ""
3525
 
3526
+ #: my-calendar-styles.php:232
3527
  msgid ""
3528
  "Resetting your stylesheet will set your stylesheet to the version of that "
3529
  "style currently distributed with the plug-in."
3530
  msgstr ""
3531
 
3532
+ #: my-calendar-templates.php:79
3533
  msgid "Map<span> to %s</span>"
3534
  msgstr ""
3535
 
3536
+ #: my-calendar-templates.php:129
3537
+ msgid "Map"
3538
+ msgstr ""
3539
+
3540
+ #: my-calendar-templates.php:145
3541
+ msgid "Visit web site<span class=\"screen-reader-text\">: %s</span>"
3542
+ msgstr ""
3543
+
3544
+ #: my-calendar-templates.php:220
3545
+ msgid "Details about"
3546
+ msgstr ""
3547
+
3548
+ #: my-calendar-templates.php:248
3549
+ msgid "<span class=\"screen-reader-text\">Send %1$s to </span>Google Calendar"
3550
  msgstr ""
3551
 
3552
+ #: my-calendar-templates.php:279
3553
+ msgid "Event Details %s"
3554
+ msgstr ""
3555
+
3556
+ #: my-calendar-templates.php:517
3557
  msgid "Daily, weekdays only"
3558
  msgstr ""
3559
 
3560
+ #: my-calendar-templates.php:519
3561
  msgid "Bi-weekly"
3562
  msgstr ""
3563
 
3564
+ #: my-calendar-templates.php:520
3565
+ msgid "the %s of each month"
3566
  msgstr ""
3567
 
3568
+ #: my-calendar-templates.php:521
3569
+ msgid "the %s %s of each month"
3570
  msgstr ""
3571
 
3572
+ #: my-calendar-templates.php:522
3573
  msgid "Annually"
3574
  msgstr ""
3575
 
3576
+ #: my-calendar-templating.php:20
 
 
 
 
3577
  msgid "Grid Output Template saved"
3578
  msgstr ""
3579
 
3580
+ #: my-calendar-templating.php:28
3581
  msgid "RSS Feed Output Template saved"
3582
  msgstr ""
3583
 
3584
+ #: my-calendar-templating.php:36
3585
  msgid "List Output Template saved"
3586
  msgstr ""
3587
 
3588
+ #: my-calendar-templating.php:44
3589
  msgid "Mini Output Template saved"
3590
  msgstr ""
3591
 
3592
+ #: my-calendar-templating.php:52
3593
  msgid "Event Details Template saved"
3594
  msgstr ""
3595
 
3596
+ #: my-calendar-templating.php:68
3597
  msgid "My Calendar Information Templates"
3598
  msgstr ""
3599
 
3600
+ #: my-calendar-templating.php:73
3601
  msgid ""
3602
  "Advanced users may customize the HTML template for each event. This page "
3603
  "lets you create a customized view of your events in each context. All "
3607
  "settings.</strong>"
3608
  msgstr ""
3609
 
3610
+ #: my-calendar-templating.php:73
3611
  msgid "Templates Help"
3612
  msgstr ""
3613
 
3614
+ #: my-calendar-templating.php:77
3615
  msgid "My Calendar: Grid Event Template"
3616
  msgstr ""
3617
 
3618
+ #: my-calendar-templating.php:82
3619
  msgid "Use this grid event template"
3620
  msgstr ""
3621
 
3622
+ #: my-calendar-templating.php:85
3623
  msgid "Your custom template for events in the calendar grid output."
3624
  msgstr ""
3625
 
3626
+ #: my-calendar-templating.php:88
3627
  msgid "Save Grid Template"
3628
  msgstr ""
3629
 
3630
+ #: my-calendar-templating.php:97
3631
  msgid "My Calendar: List Event Template"
3632
  msgstr ""
3633
 
3634
+ #: my-calendar-templating.php:102
3635
  msgid "Use this list event template"
3636
  msgstr ""
3637
 
3638
+ #: my-calendar-templating.php:105
3639
  msgid "Your custom template for events in calendar list output."
3640
  msgstr ""
3641
 
3642
+ #: my-calendar-templating.php:108
3643
  msgid "Save List Template"
3644
  msgstr ""
3645
 
3646
+ #: my-calendar-templating.php:117
3647
  msgid "My Calendar: Mini Calendar Template"
3648
  msgstr ""
3649
 
3650
+ #: my-calendar-templating.php:122
3651
  msgid "Use this mini event template"
3652
  msgstr ""
3653
 
3654
+ #: my-calendar-templating.php:125
3655
  msgid "Your custom template for events in sidebar/mini calendar output."
3656
  msgstr ""
3657
 
3658
+ #: my-calendar-templating.php:128
3659
  msgid "Save Mini Template"
3660
  msgstr ""
3661
 
3662
+ #: my-calendar-templating.php:137
3663
  msgid "My Calendar: Event Details Page Template"
3664
  msgstr ""
3665
 
3666
+ #: my-calendar-templating.php:142
3667
  msgid "Use this details template"
3668
  msgstr ""
3669
 
3670
+ #: my-calendar-templating.php:145
3671
  msgid "Your custom template for events on the event details page."
3672
  msgstr ""
3673
 
3674
+ #: my-calendar-templating.php:148
3675
  msgid "Save Details Template"
3676
  msgstr ""
3677
 
3678
+ #: my-calendar-templating.php:157
3679
  msgid "My Calendar: RSS Event Template"
3680
  msgstr ""
3681
 
3682
+ #: my-calendar-templating.php:159
3683
  msgid ""
3684
  "Notice: HTML templates are very forgiving of errors. RSS templates are not. "
3685
  "Be sure to test your changes."
3686
  msgstr ""
3687
 
3688
+ #: my-calendar-templating.php:163
3689
  msgid "Use this custom RSS event template"
3690
  msgstr ""
3691
 
3692
+ #: my-calendar-templating.php:166
3693
  msgid "Your custom template for events in the RSS feed."
3694
  msgstr ""
3695
 
3696
+ #: my-calendar-templating.php:169
3697
  msgid "Save RSS Template"
3698
  msgstr ""
3699
 
3716
  "database is up to date. If you can't add events, upgrade your database!"
3717
  msgstr ""
3718
 
 
 
 
 
3719
  #: my-calendar-widgets.php:6
3720
  msgid "My Calendar: Simple Event Search"
3721
  msgstr ""
3722
 
3723
+ #: my-calendar-widgets.php:35
3724
  msgid "My Calendar: Today's Events"
3725
  msgstr ""
3726
 
3727
+ #: my-calendar-widgets.php:85
 
 
 
 
3728
  msgid "Add calendar URL to use this option."
3729
  msgstr ""
3730
 
3731
+ #: my-calendar-widgets.php:87 my-calendar-widgets.php:189
3732
  msgid "Widget title links to:"
3733
  msgstr ""
3734
 
3735
+ #: my-calendar-widgets.php:91
3736
  msgid "Show this text if there are no events today:"
3737
  msgstr ""
3738
 
3739
+ #: my-calendar-widgets.php:95 my-calendar-widgets.php:223
3740
+ #: my-calendar-widgets.php:672
3741
  msgid "Category or categories to display:"
3742
  msgstr ""
3743
 
3744
+ #: my-calendar-widgets.php:99 my-calendar-widgets.php:227
3745
  msgid "Author or authors to show:"
3746
  msgstr ""
3747
 
3748
+ #: my-calendar-widgets.php:103 my-calendar-widgets.php:231
3749
  msgid "Host or hosts to show:"
3750
  msgstr ""
3751
 
3752
+ #: my-calendar-widgets.php:126
3753
  msgid "My Calendar: Upcoming Events"
3754
  msgstr ""
3755
 
3756
+ #: my-calendar-widgets.php:185
3757
  msgid "Widget Options"
3758
  msgstr ""
3759
 
3760
+ #: my-calendar-widgets.php:193
3761
  msgid "Display upcoming events by:"
3762
  msgstr ""
3763
 
3764
+ #: my-calendar-widgets.php:194
3765
  msgid "Events (e.g. 2 past, 3 future)"
3766
  msgstr ""
3767
 
3768
+ #: my-calendar-widgets.php:195
3769
  msgid "Dates (e.g. 4 days past, 5 forward)"
3770
  msgstr ""
3771
 
3772
+ #: my-calendar-widgets.php:196
3773
  msgid "Show current month"
3774
  msgstr ""
3775
 
3776
+ #: my-calendar-widgets.php:197
3777
  msgid "Show current year"
3778
  msgstr ""
3779
 
3780
+ #: my-calendar-widgets.php:201
3781
  msgid "Skip the first <em>n</em> events"
3782
  msgstr ""
3783
 
3784
+ #: my-calendar-widgets.php:204
3785
  msgid "Events sort order:"
3786
  msgstr ""
3787
 
3788
+ #: my-calendar-widgets.php:205
3789
  msgid "Ascending (near to far)"
3790
  msgstr ""
3791
 
3792
+ #: my-calendar-widgets.php:206
3793
  msgid "Descending (far to near)"
3794
  msgstr ""
3795
 
3796
+ #: my-calendar-widgets.php:216
3797
  msgid "Include today's events"
3798
  msgstr ""
3799
 
3800
+ #: my-calendar-widgets.php:219
3801
  msgid "Show this text if there are no events meeting your criteria:"
3802
  msgstr ""
3803
 
3804
+ #: my-calendar-widgets.php:626
3805
  msgid "My Calendar: Mini Calendar"
3806
  msgstr ""
3807
 
3808
+ #: my-calendar-widgets.php:644
3809
  msgid "Calendar"
3810
  msgstr ""
3811
 
3812
+ #: my-calendar-widgets.php:668
3813
  msgid "Widget Title Link"
3814
  msgstr ""
3815
 
3816
+ #: my-calendar-widgets.php:698
3817
  msgid "Mini-Calendar Timespan:"
3818
  msgstr ""
3819
 
3820
+ #: my-calendar.php:145
3821
  msgid "My Calendar: Submissions"
3822
  msgstr ""
3823
 
3824
+ #: my-calendar.php:147
3825
  msgid ""
3826
  "Buy the <a href='http://www.joedolson.com/articles/my-calendar/submissions/' "
3827
+ "rel='external'>My Calendar Submissions add-on</a> &mdash; let your audience "
3828
+ "build your calendar."
3829
  msgstr ""
3830
 
3831
+ #: my-calendar.php:148
3832
  msgid "Learn more!"
3833
  msgstr ""
3834
 
3835
+ #: my-calendar.php:155
3836
  msgid "Support This Plug-in"
3837
  msgstr ""
3838
 
3839
+ #: my-calendar.php:161
3840
  msgid "Help me help you:"
3841
  msgstr ""
3842
 
3843
+ #: my-calendar.php:161
3844
  msgid "Buy the My Calendar User's Guide"
3845
  msgstr ""
3846
 
3847
+ #: my-calendar.php:162
3848
  msgid ""
3849
  "<strong>Or make a donation today!</strong> Every donation counts - donate "
3850
+ "$5, $20, or $100 and help me keep this plug-in running!"
3851
  msgstr ""
3852
 
3853
+ #: my-calendar.php:167 my-calendar.php:170
3854
  msgid "Make a Donation"
3855
  msgstr ""
3856
 
3857
+ #: my-calendar.php:178
3858
  msgid "Get Help"
3859
  msgstr ""
3860
 
3861
+ #: my-calendar.php:183
3862
  msgid "Get Support"
3863
  msgstr ""
3864
 
3865
+ #: my-calendar.php:185
3866
  msgid "Check out my other plug-ins"
3867
  msgstr ""
3868
 
3869
+ #: my-calendar.php:186
3870
  msgid "Rate this plug-in 5 stars!"
3871
  msgstr ""
3872
 
3873
+ #: my-calendar.php:187
3874
  msgid "Help translate this plug-in!"
3875
  msgstr ""
3876
 
3877
+ #: my-calendar.php:212
3878
  msgid "Title of the event."
3879
  msgstr ""
3880
 
3881
+ #: my-calendar.php:215
3882
  msgid ""
3883
  "Title of the event as a link if a URL is present, or the title alone if not."
3884
  msgstr ""
3885
 
3886
+ #: my-calendar.php:218
3887
  msgid "Start time for the event."
3888
  msgstr ""
3889
 
3890
+ #: my-calendar.php:221
 
 
 
 
3891
  msgid "Date on which the event begins."
3892
  msgstr ""
3893
 
3894
+ #: my-calendar.php:224
 
 
 
 
 
 
 
 
3895
  msgid "Beginning date to end date; excludes end date if same as beginning."
3896
  msgstr ""
3897
 
3898
+ #: my-calendar.php:227
3899
  msgid ""
3900
  "Multi-day events: an unordered list of dates/times. Otherwise, beginning "
3901
  "date/time."
3902
  msgstr ""
3903
 
3904
+ #: my-calendar.php:230
3905
  msgid "Author who posted the event."
3906
  msgstr ""
3907
 
3908
+ #: my-calendar.php:233
3909
  msgid "Name of the assigned host for the event."
3910
  msgstr ""
3911
 
3912
+ #: my-calendar.php:236
 
 
 
 
3913
  msgid "Short event description."
3914
  msgstr ""
3915
 
3916
+ #: my-calendar.php:239
3917
  msgid "Description of the event."
3918
  msgstr ""
3919
 
3920
+ #: my-calendar.php:242
3921
  msgid "Image associated with the event."
3922
  msgstr ""
3923
 
3924
+ #: my-calendar.php:245
3925
  msgid "URL provided for the event."
3926
  msgstr ""
3927
 
3928
+ #: my-calendar.php:248
3929
  msgid "Link to an auto-generated page containing information about the event."
3930
  msgstr ""
3931
 
3932
+ #: my-calendar.php:251
3933
  msgid "Whether event is currently open for registration."
3934
  msgstr ""
3935
 
3936
+ #: my-calendar.php:254
3937
  msgid "Current status of event: either \"Published\" or \"Reserved.\""
3938
  msgstr ""
3939
 
3940
+ #: my-calendar.php:260
3941
  msgid "Name of the location of the event."
3942
  msgstr ""
3943
 
3944
+ #: my-calendar.php:263
3945
  msgid "First line of the site address."
3946
  msgstr ""
3947
 
3948
+ #: my-calendar.php:266
3949
  msgid "Second line of the site address."
3950
  msgstr ""
3951
 
3952
+ #: my-calendar.php:278
3953
  msgid "Custom region."
3954
  msgstr ""
3955
 
3956
+ #: my-calendar.php:281
3957
  msgid "Country for the event location."
3958
  msgstr ""
3959
 
3960
+ #: my-calendar.php:284
3961
  msgid "Output the URL for the location."
3962
  msgstr ""
3963
 
3964
+ #: my-calendar.php:287
3965
  msgid ""
3966
  "Event address in <a href=\"http://microformats.org/wiki/hcard\">hcard</a> "
3967
  "format."
3968
  msgstr ""
3969
 
3970
+ #: my-calendar.php:290
3971
  msgid "Link to Google Map to the event, if address information is available."
3972
  msgstr ""
3973
 
3974
+ #: my-calendar.php:296
3975
  msgid "Name of the category of the event."
3976
  msgstr ""
3977
 
3978
+ #: my-calendar.php:299
3979
  msgid "URL for the event's category icon."
3980
  msgstr ""
3981
 
3982
+ #: my-calendar.php:302
3983
  msgid "Hex code for the event's category color."
3984
  msgstr ""
3985
 
3986
+ #: my-calendar.php:305
3987
  msgid "ID of the category of the event."
3988
  msgstr ""
3989
 
3990
+ #: my-calendar.php:308
3991
+ msgid "All Template Tags &raquo;"
3992
+ msgstr ""
3993
+
3994
+ #. #-#-#-#-# plugin.pot (My Calendar 2.2.14) #-#-#-#-#
3995
  #. Plugin Name of the plugin/theme
3996
  #: my-calendar.php:327 my-calendar.php:329 my-calendar.php:334
3997
  #: my-calendar.php:336
4002
  msgid "Add New Event"
4003
  msgstr ""
4004
 
4005
+ #: my-calendar.php:349
4006
+ msgid "Event Categories"
4007
+ msgstr ""
4008
+
4009
+ #: my-calendar.php:350
4010
+ msgid "Event Locations"
4011
+ msgstr ""
4012
+
4013
+ #: my-calendar.php:351
4014
+ msgid "Event Groups"
4015
  msgstr ""
4016
 
4017
  #: my-calendar.php:354
4018
+ msgid "Style Editor"
4019
  msgstr ""
4020
 
4021
  #: my-calendar.php:355
4022
+ msgid "Script Editor"
4023
  msgstr ""
4024
 
4025
+ #: my-calendar.php:356
4026
+ msgid "Template Editor"
4027
  msgstr ""
4028
 
4029
  #: my-calendar.php:364
4030
+ msgid "Event Submissions"
 
 
 
 
4031
  msgstr ""
4032
 
4033
+ #: my-calendar.php:365
4034
+ msgid "Payments"
4035
  msgstr ""
4036
 
4037
+ #: my-calendar.php:401
4038
  msgid "Apply"
4039
  msgstr ""
4040
 
4041
+ #: my-calendar.php:404
4042
  msgid "Event editing fields to show"
4043
  msgstr ""
4044
 
mc-styles.css DELETED
@@ -1,63 +0,0 @@
1
- #my-calendar legend {font-weight: 700;font-size: 1em}
2
- .mcbuy {font-size: 1.4em; line-height: 1.5}
3
- .mcsbuy { font-size: 1.3em; line-height: 1.5}
4
- .mc-button { text-align: center; font-size: 1.4em; padding: 10px 0 0}
5
- .mc-button a { padding: 3px 8px; border: 1px solid; border-radius: 5px; background: #fff}
6
- .mcsbuy img { margin-right: 10px; border: 1px solid #ccc}
7
- .mcd { text-align: center; font-size: 1.2em}
8
- .templating .resources {width: 250px}
9
- .resources form {margin: 0!important}
10
- #category_icon option {padding: 5px 0 5px 24px}
11
- #my-calendar-admin-table .delete {color: #c00}
12
- .import {background: #ffa;padding: 5px 10px;border: 1px solid #aaa;border-radius: 5px;margin: 15px 0}
13
- .n4 {width: 42px}
14
- .category-color {width: 1.2em;height: 1.2em;display: inline-block;border-radius: 3px;border: 1px solid #000}
15
- .jd-my-calendar .postbox h3 {cursor: text}
16
- .active-link {font-weight:700;text-decoration: underline}
17
- ul.links li {float: left;margin: 0 5px 10px;font-size: .9em}
18
- #my_calendar_old_styles {float: right;margin-left: 660px}
19
- #toggle {height: 2em}
20
- #toggle li {float: left;margin-right: 5px}
21
- .jd-my-calendar .spam {background: #ffa}
22
- .jd-my-calendar .pending { background: #eee}
23
- .jd-my-calendar .pending td {color: #777}
24
- .jd-my-calendar legend, .offscreen , .mc_filter span{position: absolute;left: -999em}
25
- .jd-my-calendar fieldset fieldset legend {position: static;font-weight: 700;width: 99%}
26
- .jd-my-calendar fieldset fieldset {margin: 0 0 20px 0;padding-top: 2px}
27
- #mceditor {border: 1px solid #ddd;margin: 0 0 5px}
28
- .mc_template_tags dt {font-weight: 700}
29
- .mc_template_tags dd {margin-left: 0; padding: 2px 1px}
30
- .mc_template_tags {clear: right}
31
- .clonedInput {margin-bottom: 10px;border-bottom: 1px solid #ddd}
32
- #my-calendar .apply {padding: 1px 5px 0;margin: 0 -5px;border-radius: 3px;box-shadow: 2px 2px 3px #aaa;background: #ffd}
33
- #my-calendar .apply legend {background: #ffd;padding: 2px 0}
34
- #my-calendar .apply .warning {background: #ffe;color: #a00;padding: 3px;border: 1px solid #333}
35
- #my-calendar .break ul {padding: 10px 10px 0;margin-right: 180px}
36
- #my-calendar .columns, .jd-my-calendar .columns {-moz-column-count: 3;-moz-column-gap: 20px;-webkit-column-count: 3;-webkit-column-gap: 20px;column-count: 3;column-gap: 20px}
37
- #my-calendar .two-columns {-moz-column-count: 2;-moz-column-gap: 30px;-webkit-column-count: 2;-webkit-column-gap: 30px;column-count: 2;column-gap: 30px}
38
- .jd-my-calendar .event_image { float: right; margin-left: 10px; }
39
- .jd-my-calendar .event_image img { width: 150px; height: auto; margin: 2px 0; border-radius: 3px; }
40
- .mc_support {font-family:'Courier New';background:#fff;padding:5px}
41
- .template-editor, .style-editor { width: 98%}
42
- .roles { width: 24%; float: left; min-height: 300px}
43
- .mc-settings li { display: inline; padding: 3px; margin: 3px}
44
- .jd-my-calendar .postbox { margin: 10px 10px 0 0}
45
- .jd-my-calendar .postbox .inside { overflow: visible!important} /* some plugins change this, but I need it at WP default. */
46
- .jd-my-calendar .meta-box-sortables { min-height: 0}
47
- .jd-my-calendar textarea { width: 100%}
48
- .mc-clear { clear: both}
49
- .jd-my-calendar pre { background: #fff; padding: 5px; border: 1px solid #ddd; box-shadow: 1px 1px 2px #ddd}
50
- .jd-my-calendar label span { font-size: .9em; color: #c33}
51
- .jd-my-calendar .default { background: #fff}
52
- .jd-my-calendar .button-adjust { top: 10px; right: 0}
53
- .jd-my-calendar hr { width: 20%; margin: 0 auto; border: none; border-top: 1px solid #ccc}
54
- #mc-shortcodes li code, #mc-shortcodes .example code { font-size: 1.4em; line-height: 1.5; display: inline-block}
55
- .jd-my-calendar .tablenav { float: right}
56
- input[id=event_label], input[id=event_title], input[id=location_label], input[id=mc_twitter] { font-size: 1.4em; padding: 5px; width: 100%}
57
- label[for=mc_twitter] { background: url(images/twitter.png) no-repeat; padding-left: 20px; }
58
- strong.label { font-weight: 400; }
59
- #my-calendar-text label { display: inline-block; width: 12em; }
60
- .wp-picker-container { position: relative; top:3px; }
61
- .jd-my-calendar .counter { padding-right: 6px; border-right: 16px solid green; border-radius: 20px; }
62
- .jd-my-calendar .counter.warning { border-color: orange; }
63
- .jd-my-calendar .counter.exceeded { border-color: red; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
my-calendar-api.php ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
+
4
+ function my_calendar_api() {
5
+ if ( isset( $_REQUEST['my-calendar-api'] ) ) {
6
+ if ( get_option( 'mc_api_enabled' ) == 'true' ) {
7
+ // use this filter to add custom scripting handling API keys
8
+ $api_key = apply_filters( 'mc_api_key', true );
9
+ if ( $api_key ) {
10
+ $format = ( isset( $_REQUEST['my-calendar-api'] ) ) ? $_REQUEST['my-calendar-api'] : 'json';
11
+ $from = ( isset( $_REQUEST['from'] ) ) ? $_REQUEST['from'] : date( 'Y-m-d', current_time( 'timestamp' ) );
12
+ $to = ( isset( $_REQUEST['to'] ) ) ? $_REQUEST['to'] : date( 'Y-m-d', strtotime( current_time( 'timestamp' ).apply_filters('mc_api_auto_date',' + 7 days') ) );
13
+ // sanitization is handled elsewhere.
14
+ $category = ( isset( $_REQUEST['mcat'] ) ) ? $_REQUEST['mcat'] : '' ;
15
+ $ltype = ( isset( $_REQUEST['ltype'] ) ) ? $_REQUEST['ltype'] : '' ;
16
+ $lvalue = ( isset( $_REQUEST['lvalue'] ) ) ? $_REQUEST['lvalue'] : '' ;
17
+ $author = ( isset( $_REQUEST['author'] ) ) ? $_REQUEST['author'] : '' ;
18
+ $host = ( isset( $_REQUEST['host'] ) ) ? $_REQUEST['host'] : '' ;
19
+ $data = my_calendar_events( $from, $to, $category, $ltype, $lvalue, 'api', $author, $host );
20
+ $output = mc_format_api( $data, $format );
21
+ echo $output;
22
+ }
23
+ die;
24
+ } else {
25
+ _e( 'The My Calendar API is not enabled.','my-calendar' );
26
+ }
27
+ }
28
+ }
29
+
30
+ function mc_format_api( $data, $format ) {
31
+ $output = '';
32
+ switch ( $format ) {
33
+ case 'json' : $output = mc_format_json( $data ); break;
34
+ case 'rss' : $output = mc_format_rss( $data ); break;
35
+ case 'csv' : $ooutput = mc_format_csv( $data ) ; break;
36
+ }
37
+ return $output;
38
+ }
39
+
40
+ function mc_format_json( $data ) {
41
+ return json_encode( $data );
42
+ }
43
+
44
+ function mc_format_csv( $data ) {
45
+ $keyed = false;
46
+ // Create a stream opening it with read / write mode
47
+ $stream = fopen('data://text/plain,' . "", 'w+');
48
+ // Iterate over the data, writting each line to the text stream
49
+ foreach ($data as $key => $val) {
50
+ foreach ( $val as $v ) {
51
+ $values = get_object_vars( $v );
52
+ if ( !$keyed ) {
53
+ $keys = array_keys( $values );
54
+ fputcsv($stream, $keys );
55
+ $keyed = true;
56
+ }
57
+ fputcsv($stream, $values);
58
+ }
59
+ }
60
+ // Rewind the stream
61
+ rewind($stream);
62
+ // You can now echo it's content
63
+ header("Content-type: text/csv");
64
+ header("Content-Disposition: attachment; filename=my-calendar.csv");
65
+ header("Pragma: no-cache");
66
+ header("Expires: 0");
67
+
68
+ echo stream_get_contents($stream);
69
+ // Close the stream
70
+ fclose($stream);
71
+ die;
72
+ }
73
+
74
+ function mc_format_rss( $data ) {
75
+ return my_calendar_rss( $data );
76
+ }
my-calendar-behaviors.php CHANGED
@@ -1,76 +1,56 @@
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
 
4
- // Display the admin configuration page
5
  function edit_my_calendar_behaviors() {
6
- global $wpdb, $initial_listjs, $initial_caljs, $initial_minijs, $initial_ajaxjs;
7
  $mcdb = $wpdb;
8
-
9
- // We can't use this page unless My Calendar is installed/upgraded
10
- check_my_calendar();
11
-
12
- if ( isset($_POST['mc_caljs'] ) ) {
13
- $nonce=$_REQUEST['_wpnonce'];
14
- if (! wp_verify_nonce($nonce,'my-calendar-nonce') ) die("Security check failed");
15
- $mc_caljs = $_POST['mc_caljs'];
16
- $mc_listjs = $_POST['mc_listjs'];
17
- $mc_minijs = $_POST['mc_minijs'];
18
- $mc_ajaxjs = $_POST['mc_ajaxjs'];
19
-
20
- update_option('mc_calendar_javascript', ( empty($_POST['calendar_javascript']) )?0:1);
21
- update_option('mc_list_javascript', ( empty($_POST['list_javascript']) )?0:1 );
22
- update_option('mc_mini_javascript', ( empty($_POST['mini_javascript']) )?0:1 );
23
- update_option('mc_ajax_javascript', ( empty($_POST['ajax_javascript']) )?0:1 );
24
- // set js
25
- update_option('mc_listjs',$mc_listjs);
26
- update_option('mc_minijs',$mc_minijs);
27
- update_option('mc_caljs',$mc_caljs);
28
- update_option('mc_ajaxjs',$mc_ajaxjs);
29
 
30
- $mc_show_js = ($_POST['mc_show_js']=='')?'':$_POST['mc_show_js'];
31
- update_option('mc_show_js',$mc_show_js);
32
-
33
- if ( !empty($_POST['reset_caljs']) ) {
34
- update_option('mc_caljs',$initial_caljs);
35
- }
36
- if ( !empty($_POST['reset_listjs']) ) {
37
- update_option('mc_listjs',$initial_listjs);
38
- }
39
- if ( !empty($_POST['reset_minijs']) ) {
40
- update_option('mc_minijs',$initial_minijs);
41
- }
42
- if ( !empty($_POST['reset_ajaxjs']) ) {
43
- update_option('mc_ajaxjs',$initial_ajaxjs);
44
- }
 
 
 
 
 
 
 
 
 
45
  echo "<div class=\"updated\"><p><strong>".__('Behavior Settings saved','my-calendar').".</strong></p></div>";
46
- }
47
 
48
  $mc_listjs = stripcslashes(get_option('mc_listjs'));
49
  $list_javascript = get_option('mc_list_javascript');
50
-
51
  $mc_caljs = stripcslashes(get_option('mc_caljs'));
52
  $calendar_javascript = get_option('mc_calendar_javascript');
53
-
54
  $mc_minijs = stripcslashes(get_option('mc_minijs'));
55
  $mini_javascript = get_option('mc_mini_javascript');
56
-
57
  $mc_ajaxjs = stripcslashes(get_option('mc_ajaxjs'));
58
  $ajax_javascript = get_option('mc_ajax_javascript');
59
-
60
  $mc_show_js = stripcslashes(get_option('mc_show_js'));
61
-
62
- // Now we render the form
63
- ?>
64
- <div class="wrap jd-my-calendar">
65
- <?php
66
- my_calendar_check_db();
67
- ?>
68
  <h2><?php _e('My Calendar Behaviors','my-calendar'); ?></h2>
69
- <div class="postbox-container" style="width: 70%">
70
- <div class="metabox-holder">
71
 
72
- <div class="ui-sortable meta-box-sortables">
73
- <div class="postbox" id="cdiff">
74
 
75
  <h3><?php _e('Calendar Behavior Settings','my-calendar'); ?></h3>
76
  <div class="inside">
@@ -80,12 +60,12 @@ my_calendar_check_db();
80
  <label for="mc_show_js"><?php _e('Insert scripts on these pages (comma separated post IDs)','my-calendar'); ?></label> <input type="text" id="mc_show_js" name="mc_show_js" value="<?php echo $mc_show_js; ?>" />
81
  </p>
82
  <fieldset>
83
- <legend><?php _e('Calendar Behaviors: Calendar View','my-calendar'); ?></legend>
84
  <p>
85
- <input type="checkbox" id="reset_caljs" name="reset_caljs" /> <label for="reset_caljs"><?php _e('Update/Reset the My Calendar Calendar Javascript','my-calendar'); ?></label> <input type="checkbox" id="calendar_javascript" name="calendar_javascript" value="1" <?php mc_is_checked('mc_calendar_javascript',1); ?>/> <label for="calendar_javascript"><?php _e('Disable Calendar Javascript Effects','my-calendar'); ?></label>
86
  </p>
87
  <p>
88
- <label for="calendar-javascript"><?php _e('Edit the jQuery scripts for My Calendar in Calendar format','my-calendar'); ?></label><br /><textarea id="calendar-javascript" name="mc_caljs" rows="8" cols="80"><?php echo $mc_caljs; ?></textarea>
89
  </p>
90
  <?php
91
  $left_string = normalize_whitespace($mc_caljs);
@@ -108,13 +88,11 @@ my_calendar_check_db();
108
  <input type="submit" name="save" class="button-secondary" value="<?php _e('Save','my-calendar'); ?>" />
109
  </p>
110
  </fieldset>
111
-
112
 
113
-
114
  <fieldset id="ldiff">
115
  <legend><?php _e('Calendar Behaviors: List View','my-calendar'); ?></legend>
116
  <p>
117
- <input type="checkbox" id="reset_listjs" name="reset_listjs" /> <label for="reset_listjs"><?php _e('Update/Reset the My Calendar List Javascript','my-calendar'); ?></label> <input type="checkbox" id="list_javascript" name="list_javascript" value="1" <?php mc_is_checked('mc_list_javascript',1); ?> /> <label for="list_javascript"><?php _e('Disable List Javascript Effects','my-calendar'); ?></label>
118
  </p>
119
  <p>
120
  <label for="list-javascript"><?php _e('Edit the jQuery scripts for My Calendar in List format','my-calendar'); ?></label><br /><textarea id="list-javascript" name="mc_listjs" rows="8" cols="80"><?php echo $mc_listjs; ?></textarea>
@@ -141,14 +119,13 @@ my_calendar_check_db();
141
  </p>
142
  </fieldset>
143
 
144
-
145
  <fieldset id="mdiff">
146
  <legend><?php _e('Calendar Behaviors: Mini Calendar View','my-calendar'); ?></legend>
147
  <p>
148
- <input type="checkbox" id="reset_minijs" name="reset_minijs" /> <label for="reset_minijs"><?php _e('Update/Reset the My Calendar Mini Format Javascript','my-calendar'); ?></label> <input type="checkbox" id="mini_javascript" name="mini_javascript" value="1" <?php mc_is_checked('mc_mini_javascript',1); ?> /> <label for="mini_javascript"><?php _e('Disable Mini Javascript Effects','my-calendar'); ?></label>
149
  </p>
150
  <p>
151
- <label for="mini-javascript"><?php _e('Edit the jQuery scripts for My Calendar in Mini Calendar format','my-calendar'); ?></label><br /><textarea id="mini-javascript" name="mc_minijs" rows="8" cols="80"><?php echo $mc_minijs; ?></textarea>
152
  </p>
153
  <?php
154
  $left_string = normalize_whitespace($mc_minijs);
@@ -172,15 +149,13 @@ my_calendar_check_db();
172
  </p>
173
  </fieldset>
174
 
175
-
176
-
177
  <fieldset id="adiff">
178
- <legend><?php _e('Calendar Behaviors: AJAX Navigation','my-calendar'); ?></legend>
179
  <p>
180
- <input type="checkbox" id="reset_ajaxjs" name="reset_ajaxjs" /> <label for="reset_ajaxjs"><?php _e('Update/Reset the My Calendar AJAX Javascript','my-calendar'); ?></label> <input type="checkbox" id="ajax_javascript" name="ajax_javascript" value="1" <?php mc_is_checked('mc_ajax_javascript',1); ?> /> <label for="ajax_javascript"><?php _e('Disable AJAX Effects','my-calendar'); ?></label>
181
  </p>
182
  <p>
183
- <label for="ajax-javascript"><?php _e('Edit the jQuery scripts for My Calendar AJAX navigation','my-calendar'); ?></label><br /><textarea id="ajax-javascript" name="mc_ajaxjs" rows="8" cols="80"><?php echo $mc_ajaxjs; ?></textarea>
184
  </p>
185
  <?php
186
  $left_string = normalize_whitespace($mc_ajaxjs);
@@ -210,7 +185,7 @@ my_calendar_check_db();
210
  <p><?php _e('Resetting JavaScript will set that script to the version currently distributed with the plug-in.','my-calendar'); ?></p>
211
  </div>
212
  </div>
213
- <?php jd_show_support_box(); ?>
214
  </div>
215
  <?php
216
  }
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
 
4
+ // Edit or configure scripts used with My Calendar
5
  function edit_my_calendar_behaviors() {
6
+ global $wpdb, $initial_listjs, $initial_caljs, $initial_minijs, $initial_ajaxjs;
7
  $mcdb = $wpdb;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
 
9
+ if ( isset($_POST['mc_caljs'] ) ) {
10
+ $nonce=$_REQUEST['_wpnonce'];
11
+ if ( !wp_verify_nonce( $nonce,'my-calendar-nonce' ) ) die( "Security check failed" );
12
+ $mc_caljs = $_POST['mc_caljs'];
13
+ $mc_listjs = $_POST['mc_listjs'];
14
+ $mc_minijs = $_POST['mc_minijs'];
15
+ $mc_ajaxjs = $_POST['mc_ajaxjs'];
16
+
17
+ update_option('mc_calendar_javascript', ( empty($_POST['calendar_javascript']) )?0:1);
18
+ update_option('mc_list_javascript', ( empty($_POST['list_javascript']) )?0:1 );
19
+ update_option('mc_mini_javascript', ( empty($_POST['mini_javascript']) )?0:1 );
20
+ update_option('mc_ajax_javascript', ( empty($_POST['ajax_javascript']) )?0:1 );
21
+ // set js
22
+ update_option('mc_listjs',$mc_listjs);
23
+ update_option('mc_minijs',$mc_minijs);
24
+ update_option('mc_caljs',$mc_caljs);
25
+ update_option('mc_ajaxjs',$mc_ajaxjs);
26
+
27
+ $mc_show_js = ($_POST['mc_show_js']=='')?'':$_POST['mc_show_js'];
28
+ update_option('mc_show_js',$mc_show_js);
29
+ if ( !empty($_POST['reset_caljs']) ) { update_option('mc_caljs',$initial_caljs); }
30
+ if ( !empty($_POST['reset_listjs']) ) { update_option('mc_listjs',$initial_listjs); }
31
+ if ( !empty($_POST['reset_minijs']) ) { update_option('mc_minijs',$initial_minijs); }
32
+ if ( !empty($_POST['reset_ajaxjs']) ) { update_option('mc_ajaxjs',$initial_ajaxjs); }
33
  echo "<div class=\"updated\"><p><strong>".__('Behavior Settings saved','my-calendar').".</strong></p></div>";
34
+ }
35
 
36
  $mc_listjs = stripcslashes(get_option('mc_listjs'));
37
  $list_javascript = get_option('mc_list_javascript');
 
38
  $mc_caljs = stripcslashes(get_option('mc_caljs'));
39
  $calendar_javascript = get_option('mc_calendar_javascript');
 
40
  $mc_minijs = stripcslashes(get_option('mc_minijs'));
41
  $mini_javascript = get_option('mc_mini_javascript');
 
42
  $mc_ajaxjs = stripcslashes(get_option('mc_ajaxjs'));
43
  $ajax_javascript = get_option('mc_ajax_javascript');
 
44
  $mc_show_js = stripcslashes(get_option('mc_show_js'));
45
+ // Now we render the form ?>
46
+ <div class="wrap jd-my-calendar">
47
+ <?php my_calendar_check_db(); ?>
 
 
 
 
48
  <h2><?php _e('My Calendar Behaviors','my-calendar'); ?></h2>
49
+ <div class="postbox-container jcd-wide">
50
+ <div class="metabox-holder">
51
 
52
+ <div class="ui-sortable meta-box-sortables">
53
+ <div class="postbox" id="cdiff">
54
 
55
  <h3><?php _e('Calendar Behavior Settings','my-calendar'); ?></h3>
56
  <div class="inside">
60
  <label for="mc_show_js"><?php _e('Insert scripts on these pages (comma separated post IDs)','my-calendar'); ?></label> <input type="text" id="mc_show_js" name="mc_show_js" value="<?php echo $mc_show_js; ?>" />
61
  </p>
62
  <fieldset>
63
+ <legend><?php _e('Calendar Behaviors: Grid View','my-calendar'); ?></legend>
64
  <p>
65
+ <input type="checkbox" id="reset_caljs" name="reset_caljs" /> <label for="reset_caljs"><?php _e('Update Grid View JavaScript','my-calendar'); ?></label> <input type="checkbox" id="calendar_javascript" name="calendar_javascript" value="1" <?php mc_is_checked('mc_calendar_javascript',1); ?>/> <label for="calendar_javascript"><?php _e('Disable Grid Javascript','my-calendar'); ?></label>
66
  </p>
67
  <p>
68
+ <label for="calendar-javascript"><?php _e('Edit jQuery scripts for My Calendar in Grid View','my-calendar'); ?></label><br /><textarea id="calendar-javascript" name="mc_caljs" rows="8" cols="80"><?php echo $mc_caljs; ?></textarea>
69
  </p>
70
  <?php
71
  $left_string = normalize_whitespace($mc_caljs);
88
  <input type="submit" name="save" class="button-secondary" value="<?php _e('Save','my-calendar'); ?>" />
89
  </p>
90
  </fieldset>
 
91
 
 
92
  <fieldset id="ldiff">
93
  <legend><?php _e('Calendar Behaviors: List View','my-calendar'); ?></legend>
94
  <p>
95
+ <input type="checkbox" id="reset_listjs" name="reset_listjs" /> <label for="reset_listjs"><?php _e('Update List JavaScript','my-calendar'); ?></label> <input type="checkbox" id="list_javascript" name="list_javascript" value="1" <?php mc_is_checked('mc_list_javascript',1); ?> /> <label for="list_javascript"><?php _e('Disable List JavaScript','my-calendar'); ?></label>
96
  </p>
97
  <p>
98
  <label for="list-javascript"><?php _e('Edit the jQuery scripts for My Calendar in List format','my-calendar'); ?></label><br /><textarea id="list-javascript" name="mc_listjs" rows="8" cols="80"><?php echo $mc_listjs; ?></textarea>
119
  </p>
120
  </fieldset>
121
 
 
122
  <fieldset id="mdiff">
123
  <legend><?php _e('Calendar Behaviors: Mini Calendar View','my-calendar'); ?></legend>
124
  <p>
125
+ <input type="checkbox" id="reset_minijs" name="reset_minijs" /> <label for="reset_minijs"><?php _e('Update Mini View JavaScript','my-calendar'); ?></label> <input type="checkbox" id="mini_javascript" name="mini_javascript" value="1" <?php mc_is_checked('mc_mini_javascript',1); ?> /> <label for="mini_javascript"><?php _e('Disable Mini JavaScript','my-calendar'); ?></label>
126
  </p>
127
  <p>
128
+ <label for="mini-javascript"><?php _e('Edit jQuery scripts in Mini view','my-calendar'); ?></label><br /><textarea id="mini-javascript" name="mc_minijs" rows="8" cols="80"><?php echo $mc_minijs; ?></textarea>
129
  </p>
130
  <?php
131
  $left_string = normalize_whitespace($mc_minijs);
149
  </p>
150
  </fieldset>
151
 
 
 
152
  <fieldset id="adiff">
153
+ <legend><?php _e('Calendar Behaviors: AJAX','my-calendar'); ?></legend>
154
  <p>
155
+ <input type="checkbox" id="reset_ajaxjs" name="reset_ajaxjs" /> <label for="reset_ajaxjs"><?php _e('Update AJAX JavaScript','my-calendar'); ?></label> <input type="checkbox" id="ajax_javascript" name="ajax_javascript" value="1" <?php mc_is_checked('mc_ajax_javascript',1); ?> /> <label for="ajax_javascript"><?php _e('Disable AJAX Navigation','my-calendar'); ?></label>
156
  </p>
157
  <p>
158
+ <label for="ajax-javascript"><?php _e('Edit jQuery scripts for AJAX navigation','my-calendar'); ?></label><br /><textarea id="ajax-javascript" name="mc_ajaxjs" rows="8" cols="80"><?php echo $mc_ajaxjs; ?></textarea>
159
  </p>
160
  <?php
161
  $left_string = normalize_whitespace($mc_ajaxjs);
185
  <p><?php _e('Resetting JavaScript will set that script to the version currently distributed with the plug-in.','my-calendar'); ?></p>
186
  </div>
187
  </div>
188
+ <?php mc_show_sidebar(); ?>
189
  </div>
190
  <?php
191
  }
my-calendar-categories.php CHANGED
@@ -9,14 +9,12 @@ if (!function_exists('exif_imagetype') ) {
9
  if ( !is_dir( $filename ) && ( list($width, $height, $type, $attr) = getimagesize( $filename ) ) !== false ) {
10
  return $type;
11
  }
12
- return false;
13
  }
14
  }
15
 
16
  function my_dirlist($directory) {
17
- // create an array to hold directory list
18
  $results = array();
19
- // create a handler for the directory
20
  $handler = opendir($directory);
21
  // keep going until all files in directory have been read
22
  while ($file = readdir($handler)) {
@@ -24,24 +22,20 @@ function my_dirlist($directory) {
24
  // add it to the results array
25
  if ( filesize( $directory.'/'.$file ) > 11 ) {
26
  if ( $file != '.' && $file != '..' && !is_dir($directory.'/'.$file) && (
27
- exif_imagetype($directory.'/'.$file) == IMAGETYPE_GIF ||
28
- exif_imagetype($directory.'/'.$file) == IMAGETYPE_PNG ||
29
- exif_imagetype($directory.'/'.$file) == IMAGETYPE_JPEG ) ) {
30
  $results[] = $file;
31
  }
32
  }
33
  }
34
- // tidy up: close the handler
35
  closedir($handler);
36
- // done!
37
  sort($results,SORT_STRING);
38
  return $results;
39
  }
40
 
41
  function my_csslist($directory) {
42
- // create an array to hold directory list
43
  $results = array();
44
- // create a handler for the directory
45
  $handler = opendir($directory);
46
  // keep going until all files in directory have been read
47
  while ($file = readdir($handler)) {
@@ -51,9 +45,7 @@ function my_csslist($directory) {
51
  $results[] = $file;
52
  }
53
  }
54
- // tidy up: close the handler
55
  closedir($handler);
56
- // done!
57
  sort($results,SORT_STRING);
58
  return $results;
59
  }
@@ -68,17 +60,15 @@ function is_custom_icon() {
68
  } else {
69
  return true;
70
  }
71
- } else {
72
- return false;
73
  }
 
74
  }
75
 
76
  function my_calendar_manage_categories() {
77
  global $wpdb;
78
  $mcdb = $wpdb;
79
  $formats = array( '%s', '%s', '%s' );
80
- // My Calendar must be installed and upgraded before this will work
81
- check_my_calendar();
82
  ?>
83
  <div class="wrap jd-my-calendar">
84
  <?php
@@ -90,18 +80,21 @@ function my_calendar_manage_categories() {
90
  }
91
 
92
  if (isset($_POST['mode']) && $_POST['mode'] == 'add') {
 
 
93
  $add = array(
94
- 'category_name'=>$_POST['category_name'],
95
- 'category_color'=>$_POST['category_color'],
96
- 'category_icon'=>$_POST['category_icon'],
97
- 'category_private'=>( (isset( $_POST['category_private'] ))?1:0 )
 
98
  );
99
  // actions and filters
100
  $add = apply_filters( 'mc_pre_add_category', $add, $_POST );
101
  $results = $mcdb->insert( my_calendar_categories_table(), $add, $formats );
102
  do_action( 'mc_post_add_category', $add, $results, $_POST );
103
 
104
- if ( isset($_POST['mc_default_category']) ) {
105
  $cat_ID = $mcdb->insert_id;
106
  update_option( 'mc_default_category',$cat_ID );
107
  $append = __('Default category changed.','my-calendar');
@@ -142,10 +135,18 @@ function my_calendar_manage_categories() {
142
  );
143
  $where = array( 'category_id'=>(int) $_POST['category_id'] );
144
  $append = '';
145
- if ( isset($_POST['mc_default_category']) ) {
146
  update_option( 'mc_default_category',(int) $_POST['category_id'] );
147
- $append = __('Default category changed.','my-calendar');
148
- }
 
 
 
 
 
 
 
 
149
  $results = $mcdb->update( my_calendar_categories_table(), $update, $where, $formats, '%d' );
150
  mc_delete_cache();
151
  if ($results) {
@@ -180,8 +181,8 @@ function mc_edit_category_form($view='edit',$catID='') {
180
  $path = '/my-calendar-custom';
181
  $iconlist = my_dirlist($directory);
182
  } else {
183
- $directory = dirname(__FILE__).'/icons/';
184
- $path = '/'.dirname(plugin_basename(__FILE__)).'/icons';
185
  $iconlist = my_dirlist($directory);
186
  }
187
  if ($view == 'add') { ?>
@@ -190,7 +191,7 @@ function mc_edit_category_form($view='edit',$catID='') {
190
  <h2><?php _e('Edit Category','my-calendar'); ?></h2>
191
  <?php } ?>
192
 
193
- <div class="postbox-container" style="width: 70%">
194
  <div class="metabox-holder">
195
 
196
  <div class="ui-sortable meta-box-sortables">
@@ -211,10 +212,15 @@ function mc_edit_category_form($view='edit',$catID='') {
211
  </div>
212
  <?php } ?>
213
  <fieldset>
214
- <legend><?php if ($view == 'add') { _e('Add Category','my-calendar'); } else { _e('Edit Category','my-calendar'); } ?></legend>
215
- <label for="cat_name"><?php _e('Category Name','my-calendar'); ?>:</label> <input type="text" id="cat_name" name="category_name" class="input" size="30" value="<?php if ( !empty($cur_cat) && is_object($cur_cat) ) echo stripslashes( esc_attr( $cur_cat->category_name ) ); ?>" /><br />
216
- <label for="cat_color"><?php _e('Category Color','my-calendar'); ?>:</label> <input type="text" id="cat_color" name="category_color" class="mc-color-input" size="10" maxlength="7" value="<?php if ( !empty($cur_cat) && is_object($cur_cat) ) { echo (strpos($cur_cat->category_color,'#') !== 0)?'#':''; echo $cur_cat->category_color; } else { echo '#'; } ?>" /><br />
217
- <label for="cat_icon"><?php _e('Category Icon','my-calendar'); ?>:</label> <select name="category_icon" id="cat_icon">
 
 
 
 
 
218
  <?php
219
  foreach ($iconlist as $value) {
220
  $selected = ( ( !empty($cur_cat) && is_object($cur_cat) ) && $cur_cat->category_icon == $value) ? " selected='selected'" : '';
@@ -222,10 +228,13 @@ function mc_edit_category_form($view='edit',$catID='') {
222
  }
223
  ?>
224
  </select>
225
- <?php $checked = ( $view == 'add' )?'':mc_is_checked( 'mc_default_category',$cur_cat->category_id,'',true); ?>
226
- <input type="checkbox" value="on" name="mc_default_category" id="mc_default_category"<?php echo $checked; ?> /> <label for="mc_default_category"><?php _e('Default category','my-calendar'); ?></label>
227
- <?php if ( $view == 'add' ) { $checked = ''; } else { if ( !empty($cur_cat) && is_object($cur_cat) && $cur_cat->category_private == 1 ) { $checked=' checked="checked"'; } else { $checked = ''; } } ?>
228
- <p><input type="checkbox" value="on" name="category_private" id="category_private"<?php echo $checked; ?> /> <label for="cat_private"><?php _e('Private category (logged-in users only)','my-calendar'); ?></label></p>
 
 
 
229
  </fieldset>
230
  <p>
231
  <input type="submit" name="save" class="button-primary" value="<?php if ($view == 'add') { _e('Add Category','my-calendar'); } else { _e('Save Changes','my-calendar'); } ?> &raquo;" />
@@ -248,15 +257,21 @@ function mc_edit_category_form($view='edit',$catID='') {
248
  </div>
249
  </div>
250
  </div>
251
- <?php jd_show_support_box();
 
 
 
 
 
 
 
252
  }
253
 
254
  function mc_manage_categories() {
255
  global $wpdb, $url;
256
  $mcdb = $wpdb;
257
  ?>
258
- <h2><?php _e('Manage Categories','my-calendar'); ?></h2>
259
- <?php
260
  $co = ( !isset($_GET['co']) )?1:(int) $_GET['co'];
261
  switch ( $co ) {
262
  case 1: $cat_order = 'category_id';break;
@@ -266,11 +281,11 @@ function mc_manage_categories() {
266
  // We pull the categories from the database
267
  $categories = $mcdb->get_results("SELECT * FROM " . my_calendar_categories_table() . " ORDER BY $cat_order ASC");
268
  if ( !empty($categories) ) { ?>
269
- <table class="widefat page fixed" id="my-calendar-admin-table">
270
  <thead>
271
  <tr>
272
- <th scope="col"><?php echo ($co==2)?"<a href='".admin_url("admin.php?page=my-calendar-categories&amp;co=1")."'>":''; ?><?php _e('ID','my-calendar') ?><?php echo ($co==2)?'</a>':''; ?></th>
273
- <th scope="col"><?php echo ($co==1)?"<a href='".admin_url("admin.php?page=my-calendar-categories&amp;co=2")."'>":''; ?><?php _e('Category Name','my-calendar') ?><?php echo ($co==1)?'</a>':''; ?></th>
274
  <th scope="col"><?php _e('Category Color','my-calendar'); ?></th>
275
  <th scope="col"><?php _e('Category Icon','my-calendar'); ?></th>
276
  <th scope="col"><?php _e('Private','my-calendar'); ?></th>
@@ -281,31 +296,26 @@ function mc_manage_categories() {
281
  <?php
282
  $class = '';
283
  foreach ( $categories as $cat ) {
284
- $class = ($class == 'alternate') ? '' : 'alternate';
285
- $icon_src = ( mc_file_exists( $cat->category_icon ) ) ? mc_get_file( $cat->category_icon, 'url' ) : plugins_url( 'my-calendar/icons/'.$cat->category_icon );
286
- $background = (strpos($cat->category_color,'#') !== 0)?'#':'' . $cat->category_color;
287
  $foreground = mc_inverse_color( $background );
288
  ?>
289
  <tr class="<?php echo $class; ?>">
290
  <th scope="row"><?php echo $cat->category_id; ?></th>
291
- <td><?php echo stripslashes( esc_attr( $cat->category_name ) ); echo ' '; if ( $cat->category_id == get_option( 'mc_default_category' ) ) { _e( '(Default)' ); } ?></td>
292
  <td style="background-color:<?php echo $background; ?>; color: <?php echo $foreground; ?>"><?php echo $background; ?></td>
293
  <td style="background-color:<?php echo $background; ?>;"><img src="<?php echo $icon_src; ?>" alt="" /></td>
294
  <td><?php echo ( $cat->category_private == 1 )?__('Yes','my-calendar'):__('No','my-calendar'); ?></td>
295
- <td><a href="<?php echo admin_url("admin.php?page=my-calendar-categories&amp;mode=edit&amp;category_id=$cat->category_id"); ?>" class='edit'><?php _e('Edit','my-calendar'); ?></a></td>
296
- <?php
297
- if ($cat->category_id == 1) {
298
- echo '<td>'.__('N/A','my-calendar').'</td>';
299
  } else { ?>
300
- <td><a href="<?php echo admin_url("admin.php?page=my-calendar-categories&amp;mode=delete&amp;category_id=$cat->category_id"); ?>" class="delete" onclick="return confirm('<?php _e('Are you sure you want to delete this category?','my-calendar'); ?>')"><?php _e('Delete','my-calendar'); ?></a></td>
301
- <?php
302
  } ?>
303
- </tr>
304
- <?php
305
- }
306
- ?>
307
- </table>
308
- <?php
309
  } else {
310
  echo '<p>'.__('There are no categories in the database - or something has gone wrong!','my-calendar').'</p>';
311
  }
9
  if ( !is_dir( $filename ) && ( list($width, $height, $type, $attr) = getimagesize( $filename ) ) !== false ) {
10
  return $type;
11
  }
12
+ return false;
13
  }
14
  }
15
 
16
  function my_dirlist($directory) {
 
17
  $results = array();
 
18
  $handler = opendir($directory);
19
  // keep going until all files in directory have been read
20
  while ($file = readdir($handler)) {
22
  // add it to the results array
23
  if ( filesize( $directory.'/'.$file ) > 11 ) {
24
  if ( $file != '.' && $file != '..' && !is_dir($directory.'/'.$file) && (
25
+ exif_imagetype($directory.'/'.$file) == IMAGETYPE_GIF ||
26
+ exif_imagetype($directory.'/'.$file) == IMAGETYPE_PNG ||
27
+ exif_imagetype($directory.'/'.$file) == IMAGETYPE_JPEG ) ) {
28
  $results[] = $file;
29
  }
30
  }
31
  }
 
32
  closedir($handler);
 
33
  sort($results,SORT_STRING);
34
  return $results;
35
  }
36
 
37
  function my_csslist($directory) {
 
38
  $results = array();
 
39
  $handler = opendir($directory);
40
  // keep going until all files in directory have been read
41
  while ($file = readdir($handler)) {
45
  $results[] = $file;
46
  }
47
  }
 
48
  closedir($handler);
 
49
  sort($results,SORT_STRING);
50
  return $results;
51
  }
60
  } else {
61
  return true;
62
  }
 
 
63
  }
64
+ return false;
65
  }
66
 
67
  function my_calendar_manage_categories() {
68
  global $wpdb;
69
  $mcdb = $wpdb;
70
  $formats = array( '%s', '%s', '%s' );
71
+
 
72
  ?>
73
  <div class="wrap jd-my-calendar">
74
  <?php
80
  }
81
 
82
  if (isset($_POST['mode']) && $_POST['mode'] == 'add') {
83
+ $term = wp_insert_term( $_POST['category_name'], 'mc-event-category' );
84
+ if ( !is_wp_error( $term ) ) { $term = $term['term_id']; } else { $term = false; }
85
  $add = array(
86
+ 'category_name'=>$_POST['category_name'],
87
+ 'category_color'=>$_POST['category_color'],
88
+ 'category_icon'=>$_POST['category_icon'],
89
+ 'category_private'=>( (isset( $_POST['category_private'] ))?1:0 ),
90
+ 'category_term'=>$term
91
  );
92
  // actions and filters
93
  $add = apply_filters( 'mc_pre_add_category', $add, $_POST );
94
  $results = $mcdb->insert( my_calendar_categories_table(), $add, $formats );
95
  do_action( 'mc_post_add_category', $add, $results, $_POST );
96
 
97
+ if ( isset( $_POST['mc_default_category'] ) ) {
98
  $cat_ID = $mcdb->insert_id;
99
  update_option( 'mc_default_category',$cat_ID );
100
  $append = __('Default category changed.','my-calendar');
135
  );
136
  $where = array( 'category_id'=>(int) $_POST['category_id'] );
137
  $append = '';
138
+ if ( isset( $_POST['mc_default_category'] ) ) {
139
  update_option( 'mc_default_category',(int) $_POST['category_id'] );
140
+ $append .= __( 'Default category changed.','my-calendar' );
141
+ } else {
142
+ if ( get_option( 'mc_default_category' ) == (int) $_POST['category_id'] ) { delete_option( 'mc_default_category' ); }
143
+ }
144
+ if ( isset( $_POST['mc_skip_holidays_category'] ) ) {
145
+ update_option( 'mc_skip_holidays_category',(int) $_POST['category_id'] );
146
+ $append .= __( 'Holiday category changed.','my-calendar' );
147
+ } else {
148
+ if ( get_option( 'mc_skip_holidays_category' ) == (int) $_POST['category_id'] ) { delete_option( 'mc_skip_holidays_category' ); }
149
+ }
150
  $results = $mcdb->update( my_calendar_categories_table(), $update, $where, $formats, '%d' );
151
  mc_delete_cache();
152
  if ($results) {
181
  $path = '/my-calendar-custom';
182
  $iconlist = my_dirlist($directory);
183
  } else {
184
+ $directory = dirname(__FILE__).'/images/icons/';
185
+ $path = '/'.dirname(plugin_basename(__FILE__)).'/images/icons';
186
  $iconlist = my_dirlist($directory);
187
  }
188
  if ($view == 'add') { ?>
191
  <h2><?php _e('Edit Category','my-calendar'); ?></h2>
192
  <?php } ?>
193
 
194
+ <div class="postbox-container jcd-wide">
195
  <div class="metabox-holder">
196
 
197
  <div class="ui-sortable meta-box-sortables">
212
  </div>
213
  <?php } ?>
214
  <fieldset>
215
+ <legend><?php if ( $view == 'add' ) { _e( 'Add Category','my-calendar' ); } else { _e( 'Edit Category','my-calendar' ); } ?></legend><?php
216
+ if ( !empty( $cur_cat ) && is_object( $cur_cat ) ) {
217
+ $color = ( strpos( $cur_cat->category_color,'#' ) !== 0 ) ? '#' : '';
218
+ $color .= $cur_cat->category_color;
219
+ } else {
220
+ $color = '';
221
+ } ?>
222
+ <label for="cat_name"><?php _e('Category Name','my-calendar'); ?>:</label> <input type="text" id="cat_name" name="category_name" class="input" size="30" value="<?php if ( !empty($cur_cat) && is_object( $cur_cat ) ) echo stripslashes( esc_attr( $cur_cat->category_name ) ); ?>" /> <label for="cat_color"><?php _e( 'Color','my-calendar' ); ?>:</label> <input type="text" id="cat_color" name="category_color" class="mc-color-input" size="10" maxlength="7" value="<?php echo $color; ?>" /><br />
223
+ <label for="cat_icon"><?php _e( 'Category Icon','my-calendar' ); ?>:</label> <select name="category_icon" id="cat_icon">
224
  <?php
225
  foreach ($iconlist as $value) {
226
  $selected = ( ( !empty($cur_cat) && is_object($cur_cat) ) && $cur_cat->category_icon == $value) ? " selected='selected'" : '';
228
  }
229
  ?>
230
  </select>
231
+ <p>
232
+ <?php if ( $view == 'add' ) { $private_checked = ''; } else { if ( !empty($cur_cat) && is_object($cur_cat) && $cur_cat->category_private == 1 ) { $private_checked=' checked="checked"'; } else { $private_checked = ''; } } ?>
233
+ <?php $checked = ( $view == 'add' )?'':mc_is_checked( 'mc_default_category',$cur_cat->category_id,'',true ); ?>
234
+ <?php $holiday_checked = ( $view == 'add' )?'':mc_is_checked( 'mc_skip_holidays_category',$cur_cat->category_id,'',true ); ?>
235
+ <input type="checkbox" value="on" name="category_private" id="cat_private"<?php echo $private_checked; ?> /> <label for="cat_private"><?php _e('Private category (logged-in users only)','my-calendar'); ?></label>
236
+ <input type="checkbox" value="on" name="mc_default_category" id="mc_default_category"<?php echo $checked; ?> /> <label for="mc_default_category"><?php _e('Default category','my-calendar'); ?></label>
237
+ <input type="checkbox" value="on" name="mc_skip_holidays_category" id="mc_shc"<?php echo $holiday_checked; ?> /> <label for="mc_shc"><?php _e( 'Holiday Category','my-calendar' ); ?></label></p>
238
  </fieldset>
239
  <p>
240
  <input type="submit" name="save" class="button-primary" value="<?php if ($view == 'add') { _e('Add Category','my-calendar'); } else { _e('Save Changes','my-calendar'); } ?> &raquo;" />
257
  </div>
258
  </div>
259
  </div>
260
+ <?php mc_show_sidebar();
261
+ }
262
+
263
+ function mc_get_category_detail( $cat_id, $field='category_name' ) {
264
+ global $wpdb, $url;
265
+ $mcdb = $wpdb;
266
+ $category = $mcdb->get_row( $wpdb->prepare( "SELECT * FROM " . my_calendar_categories_table() . " WHERE category_id=%d", $cat_id ) );
267
+ return $category->$field;
268
  }
269
 
270
  function mc_manage_categories() {
271
  global $wpdb, $url;
272
  $mcdb = $wpdb;
273
  ?>
274
+ <h2><?php _e('Manage Categories','my-calendar'); ?></h2><?php
 
275
  $co = ( !isset($_GET['co']) )?1:(int) $_GET['co'];
276
  switch ( $co ) {
277
  case 1: $cat_order = 'category_id';break;
281
  // We pull the categories from the database
282
  $categories = $mcdb->get_results("SELECT * FROM " . my_calendar_categories_table() . " ORDER BY $cat_order ASC");
283
  if ( !empty($categories) ) { ?>
284
+ <table class="widefat page fixed mc-categories" id="my-calendar-admin-table">
285
  <thead>
286
  <tr>
287
+ <th scope="col"><?php echo ( $co==2 ) ? "<a href='".admin_url("admin.php?page=my-calendar-categories&amp;co=1")."'>" : ''; ?><?php _e('ID','my-calendar') ?><?php echo ( $co==2 ) ? '</a>' : ''; ?></th>
288
+ <th scope="col"><?php echo ( $co==1 ) ? "<a href='".admin_url("admin.php?page=my-calendar-categories&amp;co=2")."'>" : ''; ?><?php _e('Category Name','my-calendar') ?><?php echo ( $co==1 ) ? '</a>' : ''; ?></th>
289
  <th scope="col"><?php _e('Category Color','my-calendar'); ?></th>
290
  <th scope="col"><?php _e('Category Icon','my-calendar'); ?></th>
291
  <th scope="col"><?php _e('Private','my-calendar'); ?></th>
296
  <?php
297
  $class = '';
298
  foreach ( $categories as $cat ) {
299
+ $class = ( $class == 'alternate' ) ? '' : 'alternate';
300
+ $icon_src = ( mc_file_exists( $cat->category_icon ) ) ? mc_get_file( $cat->category_icon, 'url' ) : plugins_url( 'my-calendar/images/icons/'.$cat->category_icon );
301
+ $background = ( strpos( $cat->category_color,'#' ) !== 0 ) ? '#' : '' . $cat->category_color;
302
  $foreground = mc_inverse_color( $background );
303
  ?>
304
  <tr class="<?php echo $class; ?>">
305
  <th scope="row"><?php echo $cat->category_id; ?></th>
306
+ <td><?php echo stripslashes( $cat->category_name ); if ( $cat->category_id == get_option( 'mc_default_category' ) ) { echo ' '.__( '(Default)' ); } if ( $cat->category_id == get_option( 'mc_skip_holidays_category' ) ) { echo ' '.__( '(Holiday)' ); }?></td>
307
  <td style="background-color:<?php echo $background; ?>; color: <?php echo $foreground; ?>"><?php echo $background; ?></td>
308
  <td style="background-color:<?php echo $background; ?>;"><img src="<?php echo $icon_src; ?>" alt="" /></td>
309
  <td><?php echo ( $cat->category_private == 1 )?__('Yes','my-calendar'):__('No','my-calendar'); ?></td>
310
+ <td><a href="<?php echo admin_url("admin.php?page=my-calendar-categories&amp;mode=edit&amp;category_id=$cat->category_id"); ?>" class='edit'><?php _e('Edit','my-calendar'); ?></a></td><?php
311
+ if ( $cat->category_id == 1 ) {
312
+ echo '<td>'.__( 'N/A','my-calendar' ).'</td>';
 
313
  } else { ?>
314
+ <td><a href="<?php echo admin_url("admin.php?page=my-calendar-categories&amp;mode=delete&amp;category_id=$cat->category_id"); ?>" class="delete" onclick="return confirm('<?php _e('Are you sure you want to delete this category?','my-calendar'); ?>')"><?php _e('Delete','my-calendar'); ?></a></td><?php
 
315
  } ?>
316
+ </tr><?php
317
+ } ?>
318
+ </table><?php
 
 
 
319
  } else {
320
  echo '<p>'.__('There are no categories in the database - or something has gone wrong!','my-calendar').'</p>';
321
  }
my-calendar-core.php CHANGED
@@ -27,16 +27,14 @@ if ( ! function_exists( 'is_ssl' ) ) {
27
  function my_calendar_getUsers() {
28
  global $blog_id, $wpdb;
29
  $mcdb = $wpdb;
30
- if ( version_compare( get_bloginfo( 'version' ), '3.1','<' ) ) {
31
- $authors = $mcdb->get_results( "SELECT ID, user_nicename, display_name from $mcdb->users ORDER BY display_name" );
32
- return $authors;
33
- } else {
34
- $users = new WP_User_Query( array(
35
  'blog_id' => $blog_id,
36
  'orderby' => 'display_name',
37
- 'fields' => array('ID', 'user_nicename','display_name')
38
- ) );
39
- }
 
40
  return $users->get_results();
41
  }
42
 
@@ -52,7 +50,7 @@ function mc_selected_users( $selected ) {
52
  return $options;
53
  }
54
 
55
- function jd_calendar_plugin_action($links, $file) {
56
  if ($file == plugin_basename(dirname(__FILE__).'/my-calendar.php')) {
57
  $links[] = "<a href='admin.php?page=my-calendar-config'>" . __('Settings', 'my-calendar') . "</a>";
58
  $links[] = "<a href='admin.php?page=my-calendar-help'>" . __('Help', 'my-calendar') . "</a>";
@@ -105,8 +103,8 @@ function mc_file_exists( $file ) {
105
  $base = basename( $dir );
106
  $return = apply_filters( 'mc_file_exists', false, $file );
107
  if ( $return ) { return true; }
108
- if ( file_exists( get_stylesheet_directory() . '/' . $file ) ) { return true; }
109
- if ( file_exists( str_replace($base,'my-calendar-custom',$dir ) . $file ) ) { return true; }
110
  return false;
111
  }
112
 
@@ -129,7 +127,7 @@ function mc_register_styles() {
129
  global $wp_query;
130
  $stylesheet = mc_get_style_path( get_option( 'mc_css_file' ),'url' );
131
  wp_register_style( 'my-calendar-style', $stylesheet );
132
- $admin_stylesheet = plugins_url( 'mc-admin.css', __FILE__ );
133
  wp_register_style( 'my-calendar-admin-style', $admin_stylesheet );
134
  if ( current_user_can( 'mc_manage_events' ) ) {
135
  wp_enqueue_style( 'my-calendar-admin-style' );
@@ -142,6 +140,10 @@ function mc_register_styles() {
142
  if ( get_option('mc_calendar_javascript') != 1 || get_option('mc_list_javascript') != 1 || get_option('mc_mini_javascript') != 1 || get_option('mc_ajax_javascript') != 1 ) {
143
  if ( @in_array( $id, $js_array ) || get_option( 'mc_show_js' ) == '' ) {
144
  wp_enqueue_script( 'jquery' );
 
 
 
 
145
  }
146
  }
147
  if ( get_option('mc_use_styles') != 'true' ) {
@@ -160,8 +162,8 @@ function mc_register_styles() {
160
  wp_enqueue_style( 'my-calendar-mobile-style' );
161
  }
162
  if ( function_exists( 'mcs_submissions' ) ) {
163
- $mcs = plugins_url('/my-calendar-submissions/mcs-styles.css');
164
- $mcs_ui = plugins_url('/my-calendar-submissions/css/smoothness/jquery-ui-1.8.23.custom.css');
165
  wp_register_style( 'my-calendar-submissions-ui-style', $mcs_ui );
166
  wp_enqueue_style( 'my-calendar-submissions-ui-style' );
167
  wp_register_style( 'my-calendar-submissions-style', $mcs );
@@ -174,8 +176,7 @@ function my_calendar_wp_head() {
174
  global $wpdb, $wp_query;
175
  $mcdb = $wpdb;
176
  $array = array();
177
- // If the calendar isn't installed or upgraded this won't work
178
- check_my_calendar();
179
  if ( get_option('mc_use_styles') != 'true' ) {
180
  $this_post = $wp_query->get_queried_object();
181
  $id = ( is_object($this_post) && isset( $this_post->ID ) ) ? $this_post->ID : false;
@@ -228,23 +229,26 @@ echo $all_styles;
228
  function mc_deal_with_deleted_user( $id ) {
229
  global $wpdb;
230
  $mcdb = $wpdb;
231
- check_my_calendar();
232
  // Do the queries
233
  // This may not work quite right in multi-site. Need to explore further when I have time.
234
- $mcdb->get_results( "UPDATE ".my_calendar_table()." SET event_author=".$mcdb->get_var("SELECT MIN(ID) FROM ".$mcdb->prefix."users",0,0)." WHERE event_author=".$id );
235
- $mcdb->get_results( "UPDATE ".my_calendar_table()." SET event_host=".$mcdb->get_var("SELECT MIN(ID) FROM ".$mcdb->prefix."users",0,0)." WHERE event_host=".$id );
236
  }
237
 
238
  // Function to add the javascript to the admin header
239
- function my_calendar_add_javascript() {
240
- if ( isset($_GET['page']) && $_GET['page'] == 'my-calendar' ) {
241
- wp_enqueue_script('jquery.calendrical',plugins_url( 'js/jquery.calendrical.js', __FILE__ ), array('jquery') );
242
- wp_localize_script('jquery.calendrical', 'mc_months', array(
 
 
 
 
243
  date_i18n( 'F', strtotime( 'January 1' ) ),
244
  date_i18n( 'F', strtotime( 'February 1' ) ),
245
  date_i18n( 'F', strtotime( 'March 1' ) ),
246
  date_i18n( 'F', strtotime( 'April 1' ) ),
247
- date_i18n( 'F', strtotime( 'May 1' ) ),
248
  date_i18n( 'F', strtotime( 'June 1' ) ),
249
  date_i18n( 'F', strtotime( 'July 1' ) ),
250
  date_i18n( 'F', strtotime( 'August 1' ) ),
@@ -253,49 +257,63 @@ function my_calendar_add_javascript() {
253
  date_i18n( 'F', strtotime( 'November 1' ) ),
254
  date_i18n( 'F', strtotime( 'December 1' ) )
255
  ) );
 
 
 
 
 
 
 
 
 
 
 
256
  wp_enqueue_script('jquery.addfields',plugins_url( 'js/jquery.addfields.js', __FILE__ ), array('jquery') );
257
- if ( version_compare( get_bloginfo( 'version' ) , '3.3' , '<' ) ) {
258
- wp_enqueue_script('media-upload');
259
- wp_enqueue_script('thickbox');
260
- }
261
- $mc_input = get_option( 'mc_input_options' );
262
- // If the editor is enabled, then don't modify the upload script.
263
- if ( !isset($mc_input['event_image']) ) { $mc_input['event_image'] = 'off'; }
264
- if ( $mc_input['event_use_editor'] != 'on' && $mc_input['event_image'] == 'on' ) {
265
- wp_register_script('mc-upload', plugins_url( 'js/upload.js', __FILE__ ), array('jquery','media-upload','thickbox'));
266
- wp_enqueue_script('mc-upload');
267
  }
 
 
 
 
 
 
 
 
 
 
 
268
  }
269
  if ( isset($_GET['page']) && ( $_GET['page'] == 'my-calendar-groups' || $_GET['page'] == 'my-calendar-manage' ) ) {
270
- wp_enqueue_script('jquery.checkall',plugins_url( 'js/jquery.checkall.js', __FILE__ ), array('jquery') );
271
  }
272
  }
273
 
274
  function my_calendar_write_js() {
275
- if ( isset($_GET['page']) && $_GET['page']=='my-calendar' ) {
276
  ?>
277
- <script type="text/javascript">
278
- //<![CDATA[
279
  jQuery(document).ready(function($) {
280
- $('#event_begin, #event_time,' + '#event_end, #event_endtime').calendricalDateTimeRange();
281
- <?php if ( function_exists( 'jd_doTwitterAPIPost' ) ) { ?>
282
- $('#mc_twitter').charCount( { allowed: 140, counterText: '<?php _e('Characters left: ','my-calendar') ?>' } );
283
- <?php } ?>
 
 
284
  });
285
- //]]>
286
- </script>
287
- <?php
288
- }
289
- if ( isset($_GET['page']) && $_GET['page']=='my-calendar-help') {
290
- ?>
291
- <script type="text/javascript">
292
- jQuery(document).ready( function($) {
293
- $('dd:even').css('background','#f6f6f6');
294
- });
295
- </script>
296
- <?php
297
  }
298
  }
 
299
  add_action( 'in_plugin_update_message-my-calendar/my-calendar.php', 'mc_plugin_update_message' );
300
  function mc_plugin_update_message() {
301
  global $mc_version;
@@ -311,12 +329,11 @@ function mc_plugin_update_message() {
311
  }
312
 
313
  function mc_footer_js() {
 
314
  if ( mc_is_mobile() && get_option('mc_convert') == 'true' ) {
315
  return;
316
  } else {
317
- $scripting_top = $scripting_bottom = $inner_scripting = '';
318
- global $wpdb, $wp_query;
319
- $mcdb = $wpdb;
320
  $list_js = stripcslashes( get_option( 'mc_listjs' ) );
321
  $cal_js = stripcslashes( get_option( 'mc_caljs' ) );
322
  if ( get_option('mc_open_uri') == 'true') { // remove sections of javascript if necessary.
@@ -324,61 +341,57 @@ function mc_footer_js() {
324
  $cal_js = str_replace($replacements,'',$cal_js);
325
  }
326
  $mini_js = stripcslashes( get_option( 'mc_minijs' ) );
327
- if ( get_option('mc_open_day_uri') == 'true' || get_option('mc_open_day_uri') == 'listanchor' || get_option('mc_open_day_uri') == 'calendaranchor') { $mini_js = str_replace('e.preventDefault();','',$mini_js); }
 
 
328
  $ajax_js = stripcslashes( get_option( 'mc_ajaxjs' ) );
329
-
330
- if ( is_object($wp_query) && isset($wp_query->post) ) {
331
- $id = $wp_query->post->ID;
332
- }
333
- if ( get_option( 'mc_show_js' ) != '' ) {
334
- $array = explode( ",",get_option( 'mc_show_js' ) );
335
- if (!is_array($array)) {
336
- $array = array();
337
- }
338
  }
339
- if ( @in_array( $id, $array ) || get_option( 'mc_show_js' ) == '' ) {
340
- $scripting_top = "
 
341
  <script type='text/javascript'>
342
- (function( $ ) { 'use strict'; \n";
343
- if ( get_option('mc_calendar_javascript') != 1 ) { $inner_scripting .= "\n".$cal_js; }
344
- if ( get_option('mc_list_javascript') != 1 ) { $inner_scripting .= "\n".$list_js; }
345
- if ( get_option('mc_mini_javascript') != 1 ) { $inner_scripting .= "\n".$mini_js; }
346
- if ( get_option('mc_ajax_javascript') != 1 ) { $inner_scripting .= "\n".$ajax_js; }
347
- $scripting_bottom .= "
348
- }(jQuery));
349
  </script>";
350
- }
351
- $inner_scripting = apply_filters( 'mc_filter_javascript_footer',$inner_scripting );
352
- echo ( $inner_scripting != '' )?$scripting_top.$inner_scripting.$scripting_bottom:'';
353
  }
354
  }
355
 
356
  function my_calendar_add_styles() {
357
  if ( !empty($_GET['page']) ) {
358
- if ( isset($_GET['page']) && ($_GET['page'] == 'my-calendar' || $_GET['page'] == 'my-calendar-manage' || $_GET['page'] == 'my-calendar-groups' || $_GET['page'] == 'my-calendar-categories' || $_GET['page'] == 'my-calendar-locations' || $_GET['page'] == 'my-calendar-config' || $_GET['page'] == 'my-calendar-styles' || $_GET['page'] == 'my-calendar-help' || $_GET['page'] == 'my-calendar-behaviors' ) || $_GET['page'] == 'my-calendar-templates' ) {
359
- echo '<link type="text/css" rel="stylesheet" href="'.plugins_url( 'mc-styles.css', __FILE__ ).'" />';
360
- }
361
- if ( isset($_GET['page']) && $_GET['page'] == 'my-calendar') {
362
- echo '<link type="text/css" rel="stylesheet" href="'.plugins_url( 'js/calendrical.css', __FILE__ ).'" />';
363
- $mc_input = get_option('mc_input_options');
364
- if ( !isset($mc_input['event_image']) ) { $mc_input['event_image'] = 'off'; }
365
- if ( $mc_input['event_image'] == 'on' || $mc_input['event_use_editor'] != 'on' || version_compare( get_bloginfo( 'version' ), '3.0','<' ) ) {
366
- echo '<link type="text/css" rel="stylesheet" href="'.includes_url( 'js/thickbox/thickbox.css' ).'" />';
367
  }
368
- if ( version_compare( get_bloginfo( 'version' ) , '3.3' , '<' ) ) {
369
- wp_enqueue_style('thickbox');
 
 
370
  }
371
  }
372
- }
373
  }
374
 
375
  function mc_get_current_url() {
376
  global $wp;
377
  $current_url = add_query_arg( $wp->query_string, '', home_url( $wp->request ) );
 
378
  return $current_url;
379
  }
380
 
381
- function csv_to_array($csv, $delimiter = ',', $enclosure = '"', $escape = '\\', $terminator = "\n") {
382
  $r = array();
383
  $rows = explode($terminator,trim($csv));
384
  foreach ($rows as $row) {
@@ -391,11 +404,11 @@ function csv_to_array($csv, $delimiter = ',', $enclosure = '"', $escape = '\\',
391
  }
392
 
393
  function mc_if_needs_permissions() {
394
- // this prevents administrators from losing privileges to edit my calendar
395
  $role = get_role( 'administrator' );
396
  if ( is_object( $role ) ) {
397
  $caps = $role->capabilities;
398
- if ( isset($caps['mc_add_events']) ) {
399
  return;
400
  } else {
401
  $role->add_cap( 'mc_add_events' );
@@ -429,7 +442,6 @@ function mc_add_roles( $add=false, $manage=false, $approve=false ) {
429
  $role->add_cap( 'mc_view_help' );
430
 
431
  // depending on permissions settings, grant other permissions
432
-
433
  if ( $add && $manage && $approve ) {
434
  // this is an upgrade;
435
  // Get Roles
@@ -441,7 +453,6 @@ function mc_add_roles( $add=false, $manage=false, $approve=false ) {
441
  $contributor->add_cap( 'mc_view_help' );
442
  $author->add_cap( 'mc_view_help' );
443
  $editor->add_cap( 'mc_view_help' );
444
-
445
  switch( $add ) {
446
  case 'read':
447
  $subscriber->add_cap( 'mc_add_events' );
@@ -512,7 +523,7 @@ function check_my_calendar() {
512
  mc_if_needs_permissions();
513
  $current_version = ( get_option('mc_version') == '') ? get_option('my_calendar_version') : get_option('mc_version');
514
  // If current version matches, don't bother running this.
515
- if ($current_version == $mc_version) {
516
  return true;
517
  }
518
  // Lets see if this is first run and create a table if it is!
@@ -533,7 +544,7 @@ function check_my_calendar() {
533
  }
534
  if ( $my_calendar_exists == true && $current_version == '' ) {
535
  // If the table exists, but I don't know what version it is, I have to run the full cycle of upgrades.
536
- $current_version = '1.3.9';
537
  }
538
 
539
  if ( $my_calendar_exists == false ) {
@@ -541,10 +552,6 @@ function check_my_calendar() {
541
  } else {
542
  // for each release requiring an upgrade path, add a version compare.
543
  // Loop will run every relevant upgrade cycle.
544
- if ( version_compare( $current_version, "1.5.0", "<" ) ) { $upgrade_path[] = "1.5.0"; }
545
- if ( version_compare( $current_version, "1.6.0", "<" ) ) { $upgrade_path[] = "1.6.0"; }
546
- if ( version_compare( $current_version, "1.6.2", "<" ) ) { $upgrade_path[] = "1.6.2"; }
547
- if ( version_compare( $current_version, "1.6.3", "<" ) ) { $upgrade_path[] = "1.6.3"; }
548
  if ( version_compare( $current_version, "1.7.0", "<" ) ) { $upgrade_path[] = "1.7.0"; }
549
  if ( version_compare( $current_version, "1.7.1", "<" ) ) { $upgrade_path[] = "1.7.1"; }
550
  if ( version_compare( $current_version, "1.8.0", "<" ) ) { $upgrade_path[] = "1.8.0"; }
@@ -560,7 +567,8 @@ function check_my_calendar() {
560
  if ( version_compare( $current_version, "2.1.0", "<" ) ) { $upgrade_path[] = "2.1.0"; }
561
  if ( version_compare( $current_version, "2.2.0", "<" ) ) { $upgrade_path[] = "2.2.0"; }
562
  if ( version_compare( $current_version, "2.2.6", "<" ) ) { $upgrade_path[] = "2.2.6"; }
563
- if ( version_compare( $current_version, "2.2.10", "<" ) ) { $upgrade_path[] = "2.2.10"; }
 
564
  }
565
  // having determined upgrade path, assign new version number
566
  update_option( 'mc_version' , $mc_version );
@@ -578,11 +586,52 @@ function check_my_calendar() {
578
  foreach ($upgrade_path as $upgrade) {
579
  switch ($upgrade) {
580
  // only upgrade db on most recent version
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
581
  case '2.2.10':
582
  delete_option( 'mc_show_print' );
583
  delete_option( 'mc_show_ical' );
584
  delete_option( 'mc_show_rss' );
585
- flush_rewrite_rules();
586
  break;
587
  case '2.2.8':
588
  delete_option( 'mc_draggable' );
@@ -592,7 +641,6 @@ function check_my_calendar() {
592
  break;
593
  case '2.2.0':
594
  add_option('mc_inverse_color','true');
595
- mc_upgrade_db();
596
  break;
597
  case '2.1.0':
598
  $templates = get_option( 'mc_templates' );
@@ -713,210 +761,10 @@ function check_my_calendar() {
713
  update_option('mc_db_version','1.9.0');
714
  case '1.8.0':
715
  $mc_input = get_option( 'mc_input_options' );
716
- if ( !isset( $mc_input['event_use_editor'] ) ) {
717
- $mc_input['event_use_editor'] = 'off';
718
- update_option( 'mc_input_options',$mc_input );
719
- }
720
  add_option( 'mc_show_weekends','true' );
721
  add_option( 'mc_uri','' );
722
  delete_option( 'my_calendar_stored_styles');
723
  break;
724
- case '1.7.1':
725
- if ( get_option('mc_location_type') == '' ) {
726
- update_option('mc_location_type','event_state');
727
- }
728
- break;
729
- case '1.7.0':
730
- add_option('mc_skip_holidays','false');
731
- add_option('mc_event_edit_perms','manage_options');
732
- $original_styles = get_option('mc_style');
733
- if ($original_styles != '') {
734
- $stylefile = mc_get_style_path('refresh.css');
735
- if ( mc_write_styles( $stylefile, $original_styles ) ) {
736
- delete_option('mc_style');
737
- } else {
738
- add_option('mc_file_permissions','false');
739
- }
740
- }
741
- if ( get_option( 'mc_css_file' ) == '' ) {
742
- update_option('mc_css_file','my-calendar.css');
743
- }
744
- // convert old widget settings into new defaults
745
- $type = get_option('display_upcoming_type');
746
- if ($type == 'events') {
747
- $before = get_option('display_upcoming_events');
748
- $after = get_option('display_past_events');
749
- } else {
750
- $before = get_option('display_upcoming_days');
751
- $after = get_option('display_past_days');
752
- }
753
- $category = get_option('display_in_category');
754
- $today_template = get_option('mc_today_template');
755
- $upcoming_template = get_option('mc_upcoming_template');
756
- $today_title = get_option('mc_today_title');
757
- $today_text = get_option('mc_no_events_text');
758
- $upcoming_title = get_option('mc_upcoming_title');
759
-
760
- $defaults = array(
761
- 'upcoming'=>array(
762
- 'type'=>$type,
763
- 'before'=>$before,
764
- 'after'=>$after,
765
- 'template'=>$upcoming_template,
766
- 'category'=>$category,
767
- 'text'=>'',
768
- 'title'=>$upcoming_title
769
- ),
770
- 'today'=>array(
771
- 'template'=>$today_template,
772
- 'category'=>'',
773
- 'title'=>$today_title,
774
- 'text'=>$today_text
775
- )
776
- );
777
- add_option('mc_widget_defaults',$defaults);
778
- delete_option('display_upcoming_type');
779
- delete_option('display_upcoming_events');
780
- delete_option('display_past_events');
781
- delete_option('display_upcoming_days');
782
- delete_option('display_todays','true');
783
- delete_option('display_upcoming','true');
784
- delete_option('display_upcoming_days',7);
785
- delete_option('display_past_days');
786
- delete_option('display_in_category');
787
- delete_option('mc_today_template');
788
- delete_option('mc_upcoming_template');
789
- delete_option('mc_today_title');
790
- delete_option('my_calendar_no_events_text');
791
- delete_option('mc_upcoming_title');
792
- break;
793
- case '1.6.3':
794
- add_option( 'mc_ajaxjs',$initial_ajaxjs );
795
- add_option( 'mc_ajax_javascript', 1 );
796
- break;
797
- case '1.6.2':
798
- $mc_user_settings = array(
799
- 'my_calendar_tz_default'=>array(
800
- 'enabled'=>'off',
801
- 'label'=>'My Calendar Default Timezone',
802
- 'values'=>array(
803
- "-12" => "(GMT -12:00) Eniwetok, Kwajalein",
804
- "-11" => "(GMT -11:00) Midway Island, Samoa",
805
- "-10" => "(GMT -10:00) Hawaii",
806
- "-9.5" => "(GMT -9:30) Marquesas Islands",
807
- "-9" => "(GMT -9:00) Alaska",
808
- "-8" => "(GMT -8:00) Pacific Time (US &amp; Canada)",
809
- "-7" => "(GMT -7:00) Mountain Time (US &amp; Canada)",
810
- "-6" => "(GMT -6:00) Central Time (US &amp; Canada), Mexico City",
811
- "-5" => "(GMT -5:00) Eastern Time (US &amp; Canada), Bogota, Lima",
812
- "-4.5" => "(GMT -4:30) Venezuela",
813
- "-4" => "(GMT -4:00) Atlantic Time (Canada), Caracas, La Paz",
814
- "-3.5" => "(GMT -3:30) Newfoundland",
815
- "-3" => "(GMT -3:00) Brazil, Buenos Aires, Georgetown",
816
- "-2" => "(GMT -2:00) Mid-Atlantic",
817
- "-1" => "(GMT -1:00 hour) Azores, Cape Verde Islands",
818
- "0" => "(GMT) Western Europe Time, London, Lisbon, Casablanca",
819
- "1" => "(GMT +1:00 hour) Brussels, Copenhagen, Madrid, Paris",
820
- "2" => "(GMT +2:00) Kaliningrad, South Africa",
821
- "3" => "(GMT +3:00) Baghdad, Riyadh, Moscow, St. Petersburg",
822
- "3.5" => "(GMT +3:30) Tehran",
823
- "4" => "(GMT +4:00) Abu Dhabi, Muscat, Baku, Tbilisi",
824
- "4.5" => "(GMT +4:30) Afghanistan",
825
- "5" => "(GMT +5:00) Ekaterinburg, Islamabad, Karachi, Tashkent",
826
- "5.5" => "(GMT +5:30) Bombay, Calcutta, Madras, New Delhi",
827
- "5.75" => "(GMT +5:45) Nepal",
828
- "6" => "(GMT +6:00) Almaty, Dhaka, Colombo",
829
- "6.5" => "(GMT +6:30) Myanmar, Cocos Islands",
830
- "7" => "(GMT +7:00) Bangkok, Hanoi, Jakarta",
831
- "8" => "(GMT +8:00) Beijing, Perth, Singapore, Hong Kong",
832
- "9" => "(GMT +9:00) Tokyo, Seoul, Osaka, Sapporo, Yakutsk",
833
- "9.5" => "(GMT +9:30) Adelaide, Darwin",
834
- "10" => "(GMT +10:00) Eastern Australia, Guam, Vladivostok",
835
- "10.5" => "(GMT +10:30) Lord Howe Island",
836
- "11" => "(GMT +11:00) Magadan, Solomon Islands, New Caledonia",
837
- "11.5" => "(GMT +11:30) Norfolk Island",
838
- "12" => "(GMT +12:00) Auckland, Wellington, Fiji, Kamchatka",
839
- "12.75" => "(GMT +12:45) Chatham Islands",
840
- "13" => "(GMT +13:00) Tonga",
841
- "14" => "(GMT +14:00) Line Islands"
842
- ),
843
- ),
844
- 'my_calendar_location_default'=>array(
845
- 'enabled'=>'off',
846
- 'label'=>'My Calendar Default Location',
847
- 'values'=>array(
848
- 'AL'=>"Alabama",
849
- 'AK'=>"Alaska",
850
- 'AZ'=>"Arizona",
851
- 'AR'=>"Arkansas",
852
- 'CA'=>"California",
853
- 'CO'=>"Colorado",
854
- 'CT'=>"Connecticut",
855
- 'DE'=>"Delaware",
856
- 'DC'=>"District Of Columbia",
857
- 'FL'=>"Florida",
858
- 'GA'=>"Georgia",
859
- 'HI'=>"Hawaii",
860
- 'ID'=>"Idaho",
861
- 'IL'=>"Illinois",
862
- 'IN'=>"Indiana",
863
- 'IA'=>"Iowa",
864
- 'KS'=>"Kansas",
865
- 'KY'=>"Kentucky",
866
- 'LA'=>"Louisiana",
867
- 'ME'=>"Maine",
868
- 'MD'=>"Maryland",
869
- 'MA'=>"Massachusetts",
870
- 'MI'=>"Michigan",
871
- 'MN'=>"Minnesota",
872
- 'MS'=>"Mississippi",
873
- 'MO'=>"Missouri",
874
- 'MT'=>"Montana",
875
- 'NE'=>"Nebraska",
876
- 'NV'=>"Nevada",
877
- 'NH'=>"New Hampshire",
878
- 'NJ'=>"New Jersey",
879
- 'NM'=>"New Mexico",
880
- 'NY'=>"New York",
881
- 'NC'=>"North Carolina",
882
- 'ND'=>"North Dakota",
883
- 'OH'=>"Ohio",
884
- 'OK'=>"Oklahoma",
885
- 'OR'=>"Oregon",
886
- 'PA'=>"Pennsylvania",
887
- 'RI'=>"Rhode Island",
888
- 'SC'=>"South Carolina",
889
- 'SD'=>"South Dakota",
890
- 'TN'=>"Tennessee",
891
- 'TX'=>"Texas",
892
- 'UT'=>"Utah",
893
- 'VT'=>"Vermont",
894
- 'VA'=>"Virginia",
895
- 'WA'=>"Washington",
896
- 'WV'=>"West Virginia",
897
- 'WI'=>"Wisconsin",
898
- 'WY'=>"Wyoming"),
899
- )
900
- );
901
- $check = get_option('mc_user_settings');
902
- if ( !is_array( $check['my_calendar_location_default'] ) ) {
903
- update_option('mc_user_settings',$mc_user_settings);
904
- }
905
- break;
906
- case '1.6.0':
907
- add_option('mc_user_settings_enabled',false);
908
- add_option('mc_user_location_type','state');
909
- add_option('mc_show_js',get_option('mc_show_css') );
910
- break;
911
- case '1.5.0':
912
- add_option('mc_event_mail','false');
913
- add_option('mc_event_mail_subject','');
914
- add_option('mc_event_mail_to','');
915
- add_option('mc_event_mail_message','');
916
- add_option('mc_event_approve','false');
917
- add_option('mc_event_approve_perms','manage_options');
918
- add_option('mc_no_fifth_week','true');
919
- break;
920
  default:
921
  break;
922
  }
@@ -939,27 +787,27 @@ function mc_category_select( $data=false, $option=true ) {
939
  // Grab all the categories and list them
940
  $list = $default = '';
941
  $sql = "SELECT * FROM " . my_calendar_categories_table() . " ORDER BY category_name ASC";
942
- $cats = $mcdb->get_results($sql);
943
- foreach($cats as $cat) {
944
- $c = '<option value="'.$cat->category_id.'"';
945
- if ( !empty($data) ) {
946
- if ( !is_object($data) ) { $category = $data; } else { $category = $data->event_category; }
947
- if ($category == $cat->category_id){
948
- $c .= ' selected="selected"';
949
- }
950
- }
951
- $c .= '>'.stripslashes($cat->category_name).'</option>';
952
- if ( $cat->category_id != get_option('mc_default_category') ) {
953
- $list .= $c;
954
- } else {
955
- $default = $c;
956
  }
957
  }
958
- if ( !$option ) {
959
- $default = ( get_option( 'mc_default_category' ) ) ? get_option( 'mc_default_category' ) : 1 ;
960
- return ( is_object( $data ) ) ? $data->event_category : $default;
 
 
961
  }
962
- return $default.$list;
 
 
 
 
 
963
  }
964
 
965
  // @data object with event_location value
@@ -999,12 +847,12 @@ function mc_is_checked( $theFieldname,$theValue,$theArray='',$return=false ){
999
  function mc_is_selected( $theFieldname,$theValue,$theArray='' ){
1000
  if (!is_array( get_option( $theFieldname ) ) ) {
1001
  if( get_option( $theFieldname ) == $theValue ){
1002
- echo 'selected="selected"';
1003
  }
1004
  } else {
1005
  $theSetting = get_option( $theFieldname );
1006
  if ( $theSetting[$theArray]['enabled'] == $theValue ) {
1007
- echo 'selected="selected"';
1008
  }
1009
  }
1010
  }
@@ -1014,9 +862,10 @@ global $wp_query;
1014
  $array = array();
1015
  if ( get_option('mc_calendar_javascript') != 1 || get_option('mc_list_javascript') != 1 || get_option('mc_mini_javascript') != 1 ) {
1016
  $scripting = "\n<script type='text/javascript'>\n";
1017
- $scripting .= "jQuery('html').addClass('mcjs');\n";
1018
- $scripting .= "jQuery(document).ready(function($) { \$('html').removeClass('mcjs') });\n";
1019
  $scripting .= "</script>\n";
 
1020
  if ( !is_404() ) {
1021
  if ( is_object($wp_query) && isset($wp_query->post) ) {
1022
  $id = $wp_query->post->ID;
@@ -1033,7 +882,7 @@ global $wp_query;
1033
  }
1034
  }
1035
 
1036
- function mc_month_comparison($month) {
1037
  $current_month = date("n", current_time('timestamp'));
1038
  if (isset($_GET['yr']) && isset($_GET['month'])) {
1039
  if ($month == $_GET['month']) {
@@ -1044,7 +893,7 @@ function mc_month_comparison($month) {
1044
  }
1045
  }
1046
 
1047
- function mc_year_comparison($year) {
1048
  $current_year = date("Y", current_time('timestamp'));
1049
  if (isset($_GET['yr']) && isset($_GET['month'])) {
1050
  if ($year == $_GET['yr']) {
@@ -1087,12 +936,12 @@ function my_calendar_is_odd( $int ) {
1087
  return( $int & 1 );
1088
  }
1089
 
1090
- function mc_can_edit_event($author_id) {
1091
  if ( !is_user_logged_in() ) { return false; }
1092
  global $user_ID;
1093
  get_currentuserinfo();
1094
  $user = get_userdata($user_ID);
1095
-
1096
  if ( current_user_can( 'mc_manage_events' ) ) {
1097
  $return = true;
1098
  } elseif ( $user_ID == $author_id ) {
@@ -1122,12 +971,12 @@ function jd_option_selected($field,$value,$type='checkbox') {
1122
  }
1123
 
1124
  // compatibility of clone keyword between PHP 5 and 4
1125
- if (version_compare(phpversion(), '5.0') < 0) {
1126
- eval('
1127
  function clone($object) {
1128
  return $object;
1129
  }
1130
- ');
1131
  }
1132
 
1133
  add_action( 'admin_bar_menu','my_calendar_admin_bar', 200 );
@@ -1135,9 +984,24 @@ function my_calendar_admin_bar() {
1135
  global $wp_admin_bar;
1136
  if ( current_user_can( 'mc_add_events' ) ) {
1137
  $url = admin_url('admin.php?page=my-calendar');
1138
- $args = array( 'id'=>'my-calendar','title'=>__('Add Event','my-calendar'),'href'=>$url );
 
 
 
 
 
1139
  $wp_admin_bar->add_node($args);
1140
  }
 
 
 
 
 
 
 
 
 
 
1141
  }
1142
 
1143
  // functions to route db queries
@@ -1183,20 +1047,21 @@ function my_calendar_locations_table() {
1183
  }
1184
 
1185
  // Mail functions (originally by Roland)
1186
- function my_calendar_send_email( $details ) {
1187
- $event = event_as_array($details);
1188
  // shift to boolean
1189
  $send_email_option = ( get_option( 'mc_event_mail' ) == 'true' ) ? true : false;
1190
- $send_email = apply_filters( 'mc_send_notification', $send_email_option, $event );
1191
  if ( $send_email == true ) {
1192
  add_filter('wp_mail_content_type',create_function('', 'return "text/html";'));
1193
  }
1194
  if ( get_option('mc_event_mail') == 'true' ) {
1195
- $to = apply_filters( 'mc_event_mail_to', get_option('mc_event_mail_to'), $event );
1196
  $from = ( get_option('mc_event_mail_from') == '' )?get_bloginfo('admin_email'):get_option('mc_event_mail_from');
 
1197
  $from = "From: ".__('Event Notifications','my-calendar')." <$from>";
1198
- $subject = jd_draw_template( $event, get_option('mc_event_mail_subject') );
1199
- $message = jd_draw_template( $event, get_option('mc_event_mail_message') );
1200
  $mail = wp_mail($to, $subject, $message, $from);
1201
  }
1202
  if ( get_option( 'mc_html_email' ) == 'true' ) {
@@ -1204,9 +1069,7 @@ function my_calendar_send_email( $details ) {
1204
  }
1205
  }
1206
 
1207
-
1208
-
1209
- // checks submitted events against akismet, if available, otherwise just returns false
1210
  function mc_spam( $event_url='', $description='', $post=array() ) {
1211
  global $akismet_api_host, $akismet_api_port, $current_user;
1212
  get_currentuserinfo();
@@ -1279,7 +1142,6 @@ function _mc_is_url($url) {
1279
  return preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $url);
1280
  }
1281
 
1282
-
1283
  function mc_external_link( $link, $type='event' ) {
1284
  if ( !_mc_is_url($link) ) return "class='error-link'";
1285
 
@@ -1288,67 +1150,15 @@ function mc_external_link( $link, $type='event' ) {
1288
  $site = parse_url( get_option( 'siteurl' ) );
1289
  $known = $site['host'];
1290
  if ( strpos( $host, $known ) === false ) {
1291
- return "class='$type-link external'";
1292
- } else {
1293
- return "class='$type-link'";
1294
  }
1295
- return;
1296
- }
1297
-
1298
- // Adding button to the MCE toolbar (Visual Mode)
1299
- add_action('init', 'mc_addbuttons');
1300
-
1301
- // Add button hooks to the Tiny MCE
1302
- function mc_addbuttons() {
1303
- global $mc_version;
1304
- if ( !current_user_can('edit_posts') && !current_user_can('edit_pages') ) { return; }
1305
- if ( get_user_option('rich_editing') == 'true') {
1306
- add_filter( 'tiny_mce_version', 'mc_tiny_mce_version', 0 );
1307
- add_filter( 'mce_external_plugins', 'mc_plugin', 0 );
1308
- add_filter( 'mce_buttons', 'mc_button', 0 );
1309
- }
1310
- // Register Hooks
1311
- if (is_admin()) {
1312
- // Add Quicktag
1313
- add_action( 'edit_form_advanced', 'mc_add_quicktags' );
1314
- add_action( 'edit_page_form', 'mc_add_quicktags' );
1315
-
1316
- // Queue Embed JS
1317
- add_action( 'admin_head', 'mc_admin_js_vars');
1318
- wp_enqueue_script( 'mcqt', plugins_url('button/mcb.js',__FILE__), array(), $mc_version );
1319
- }
1320
- }
1321
-
1322
- // Break the browser cache of TinyMCE
1323
- function mc_tiny_mce_version( ) {
1324
- global $mc_version;
1325
- return 'mcb-' . $mc_version;
1326
- }
1327
-
1328
- // Load the custom TinyMCE plugin
1329
- function mc_plugin( $plugins ) {
1330
- $plugins['mcqt'] = plugins_url('button/tinymce3/editor_plugin.js', __FILE__ );
1331
- return $plugins;
1332
- }
1333
-
1334
- // Add the buttons: separator, custom
1335
- function mc_button( $buttons ) {
1336
- array_push( $buttons, 'separator', 'myCalendar' );
1337
- return $buttons;
1338
  }
1339
 
1340
-
1341
  add_action('admin_enqueue_scripts', 'mc_scripts');
1342
  function mc_scripts( $hook ) {
1343
- if ( $hook == 'edit.php' || $hook == 'post.php' ) {
1344
- wp_enqueue_script(
1345
- 'mc_quicktags',
1346
- plugin_dir_url(__FILE__) . 'js/mc-quicktags.js',
1347
- array('quicktags')
1348
- );
1349
- }
1350
  global $current_screen;
1351
- if ( $current_screen->id == 'toplevel_page_my-calendar' ) {
1352
  // later.
1353
  wp_enqueue_script( 'charCount', plugins_url( 'wp-to-twitter/js/jquery.charcount.js'), array('jquery') );
1354
  }
@@ -1358,45 +1168,13 @@ function mc_scripts( $hook ) {
1358
  }
1359
  }
1360
 
1361
- // Add a button to the quicktag view (HTML Mode) >>>
1362
- function mc_add_quicktags(){
1363
- ?>
1364
- <script type="text/javascript">
1365
- // <![CDATA[
1366
- (function(){
1367
- if (typeof jQuery === 'undefined') {
1368
- return;
1369
- }
1370
- jQuery(document).ready(function($){
1371
- // Add the buttons to the HTML view
1372
- $("#ed_toolbar").append('<input type="button" class="ed_button" onclick="myCalQT.Tag.embed.apply(myCalQT.Tag); return false;" title="Insert My Calendar" value="My Calendar" />');
1373
- });
1374
- }());
1375
- // ]]>
1376
- </script>
1377
- <?php
1378
- }
1379
-
1380
  function mc_newline_replace($string) {
1381
  return (string)str_replace(array("\r", "\r\n", "\n"), '', $string);
1382
  }
1383
 
1384
- // Set URL for the generator page
1385
- function mc_admin_js_vars(){
1386
- ?>
1387
- <script type="text/javascript">
1388
- // <![CDATA[
1389
- if (typeof myCalQT !== 'undefined' && typeof myCalQT.Tag !== 'undefined') {
1390
- myCalQT.Tag.configUrl = "<?php echo plugins_url( 'button/generator.php',__FILE__ ); ?>";
1391
- }
1392
- // ]]>
1393
- </script>
1394
- <?php
1395
- }
1396
-
1397
- function reverse_array($array, $boolean, $order) {
1398
  if ( $order == 'desc' ) {
1399
- return array_reverse($array, $boolean);
1400
  } else {
1401
  return $array;
1402
  }
@@ -1411,8 +1189,7 @@ if ( !function_exists( 'wp_is_mobile' ) ) {
1411
  if ( !is_plugin_active_for_network( 'my-calendar/my-calendar.php' ) ) {
1412
  function wp_is_mobile() { return false; }
1413
  }
1414
- }
1415
-
1416
 
1417
  function mc_is_mobile() {
1418
  return apply_filters( 'mc_is_mobile', wp_is_mobile() );
@@ -1433,7 +1210,7 @@ function mc_guess_calendar() {
1433
  if ( $value && get_option( 'mc_uri' ) == '' ) {
1434
  $link = get_permalink( $value );
1435
  update_option( 'mc_uri', $link );
1436
- $return = __('Is this your calendar page?','my-calendar'); echo ' <code>'.$link.'</code>';
1437
  return $return;
1438
  }
1439
  }
@@ -1535,13 +1312,16 @@ $plugins_string
1535
  } else if ( !$request ) {
1536
  echo "<div class='message error'><p>".__('Please describe your problem in detail. I\'m not psychic.','my-calendar')."</p></div>";
1537
  } else {
1538
- wp_mail( "plugins@joedolson.com",$subject,$message,$from );
1539
-
1540
- if ( $has_donated == 'Donor' || $has_purchased == 'Purchaser' ) {
1541
- echo "<div class='message updated'><p>".__('Thank you for supporting the continuing development of this plug-in! I\'ll get back to you as soon as I can.','my-calendar')."</p></div>";
 
 
 
1542
  } else {
1543
- echo "<div class='message updated'><p>".__('I\'ll get back to you as soon as I can, after dealing with any support requests from plug-in supporters.','my-calendar')."</p></div>";
1544
- }
1545
  }
1546
  }
1547
 
@@ -1555,19 +1335,19 @@ $plugins_string
1555
  <code>".__('From:','my-calendar')." \"$current_user->display_name\" &lt;$current_user->user_email&gt;</code>
1556
  </p>
1557
  <p>
1558
- <input type='checkbox' name='has_read_faq' id='has_read_faq' value='on' /> <label for='has_read_faq'>".__('I have read <a href="http://www.joedolson.com/articles/my-calendar/faq/">the FAQ for this plug-in</a>.','my-calendar')." <span>(required)</span></label>
1559
  </p>
1560
  <p>
1561
- <input type='checkbox' name='has_donated' id='has_donated' value='on' /> <label for='has_donated'>".__('I have <a href="http://www.joedolson.com/donate.php">made a donation to help support this plug-in</a>.','my-calendar')."</label>
1562
  </p>
1563
  <p>
1564
- <input type='checkbox' name='has_purchased' id='has_purchased' value='on' /> <label for='has_purchased'>".__('I have <a href="http://www.joedolson.com/articles/my-calendar/users-guide/">purchased the User\'s Guide</a>, but could not find an answer to this question.','my-calendar')."</label>
1565
  </p>
1566
  <p>
1567
- <label for='support_request'>Support Request:</label><br /><textarea name='support_request' id='support_request' cols='80' rows='10'>".stripslashes($request)."</textarea>
1568
  </p>
1569
  <p>
1570
- <input type='submit' value='".__('Send Support Request','my-calendar')."' name='mc_support' class='button-primary' />
1571
  </p>
1572
  <p>".
1573
  __('The following additional information will be sent with your support request:','my-calendar')
@@ -1668,7 +1448,7 @@ function mc_change_instances( $id, $repeats, $begin=false ) {
1668
  return true;
1669
  }
1670
 
1671
- /* indiscriminately deletes all instances of an event without deleting the event details. Sets stage for rebuilding event instances. */
1672
  function mc_delete_instances( $id ) {
1673
  global $wpdb;
1674
  $id = (int) $id;
@@ -1695,7 +1475,7 @@ function mc_increment_event( $id, $post=array(), $test=false ) {
1695
  $group_id = $event->event_group_id;
1696
  $format = array( '%d','%s','%s','%d' );
1697
  $recurs = str_split( $event->event_recur, 1 );
1698
- $recur = $recurs[0];
1699
  $every = ( isset($recurs[1]) )?$recurs[1]:1;
1700
  if ($recur != "S") {
1701
  // if this event had a rep of 0, translate that.
@@ -1804,46 +1584,144 @@ function mc_increment_event( $id, $post=array(), $test=false ) {
1804
  return $data;
1805
  }
1806
 
1807
- function xml_entity_decode($text, $charset = 'UTF-8'){
1808
- // Double decode, so if the value was &amp;trade; it will become Trademark
1809
- $text = html_entity_decode($text, ENT_COMPAT, $charset);
1810
- $text = html_entity_decode($text, ENT_COMPAT, $charset);
1811
- return $text;
1812
- }
1813
-
1814
- function xml_entities($text, $charset = 'UTF-8'){
1815
- // Debug and Test
1816
- // $text = "test &amp; &trade; &amp;trade; abc &reg; &amp;reg; &#45;";
1817
- // First we encode html characters that are also invalid in xml
1818
- $text = htmlentities($text, ENT_COMPAT, $charset, false);
1819
-
1820
- // XML character entity array from Wiki
1821
- // Note: &apos; is useless in UTF-8 or in UTF-16
1822
- $arr_xml_special_char = array("&quot;","&amp;","&apos;","&lt;","&gt;");
1823
-
1824
- // Building the regex string to exclude all strings with xml special char
1825
- $arr_xml_special_char_regex = "(?";
1826
- foreach($arr_xml_special_char as $key => $value){
1827
- $arr_xml_special_char_regex .= "(?!$value)";
1828
- }
1829
- $arr_xml_special_char_regex .= ")";
1830
-
1831
- // Scan the array for &something_not_xml; syntax
1832
- $pattern = "/$arr_xml_special_char_regex&([a-zA-Z0-9]+;)/";
1833
-
1834
- // Replace the &something_not_xml; with &amp;something_not_xml;
1835
- $replacement = '&amp;${1}';
1836
- //echo $text;
1837
- return preg_replace($pattern, $replacement, $text);
1838
  }
1839
 
1840
  // Actions -- these are action hooks attached to My Calendar events, usable to add additional actions during those events.
1841
-
1842
  add_action( 'init', 'mc_register_actions' );
1843
  function mc_register_actions() {
1844
  apply_filters( "debug", 'my_calendar add actions/filters' );
1845
- add_action( 'mc_event_registration', 'mc_standard_event', 10, 2 );
 
1846
  add_action( 'mc_transition_event', 'mc_tweet_approval', 10, 2 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1847
  }
1848
 
1849
  // Actions are only performed after their respective My Calendar events have been successfully completed.
27
  function my_calendar_getUsers() {
28
  global $blog_id, $wpdb;
29
  $mcdb = $wpdb;
30
+ $count = count_users('time');
31
+ $args = array(
 
 
 
32
  'blog_id' => $blog_id,
33
  'orderby' => 'display_name',
34
+ 'fields' => array( 'ID', 'user_nicename','display_name' )
35
+ );
36
+ $args = apply_filters( 'mc_filter_user_arguments', $args, $count );
37
+ $users = new WP_User_Query( $args );
38
  return $users->get_results();
39
  }
40
 
50
  return $options;
51
  }
52
 
53
+ function mc_plugin_action($links, $file) {
54
  if ($file == plugin_basename(dirname(__FILE__).'/my-calendar.php')) {
55
  $links[] = "<a href='admin.php?page=my-calendar-config'>" . __('Settings', 'my-calendar') . "</a>";
56
  $links[] = "<a href='admin.php?page=my-calendar-help'>" . __('Help', 'my-calendar') . "</a>";
103
  $base = basename( $dir );
104
  $return = apply_filters( 'mc_file_exists', false, $file );
105
  if ( $return ) { return true; }
106
+ if ( file_exists( get_stylesheet_directory() . '/' . $file ) ) { return true; }
107
+ if ( file_exists( str_replace( $base,'my-calendar-custom',$dir ) . $file ) ) { return true; }
108
  return false;
109
  }
110
 
127
  global $wp_query;
128
  $stylesheet = mc_get_style_path( get_option( 'mc_css_file' ),'url' );
129
  wp_register_style( 'my-calendar-style', $stylesheet );
130
+ $admin_stylesheet = plugins_url( 'css/mc-admin.css', __FILE__ );
131
  wp_register_style( 'my-calendar-admin-style', $admin_stylesheet );
132
  if ( current_user_can( 'mc_manage_events' ) ) {
133
  wp_enqueue_style( 'my-calendar-admin-style' );
140
  if ( get_option('mc_calendar_javascript') != 1 || get_option('mc_list_javascript') != 1 || get_option('mc_mini_javascript') != 1 || get_option('mc_ajax_javascript') != 1 ) {
141
  if ( @in_array( $id, $js_array ) || get_option( 'mc_show_js' ) == '' ) {
142
  wp_enqueue_script( 'jquery' );
143
+ wp_register_script( 'gmaps', "//maps.google.com/maps/api/js?sensor=true" );
144
+ wp_register_script( 'gmap3', plugins_url( 'js/gmap3.min.js', __FILE__ ), array( 'jquery' ) );
145
+ wp_enqueue_script( 'gmaps' );
146
+ wp_enqueue_script( 'gmap3' );
147
  }
148
  }
149
  if ( get_option('mc_use_styles') != 'true' ) {
162
  wp_enqueue_style( 'my-calendar-mobile-style' );
163
  }
164
  if ( function_exists( 'mcs_submissions' ) ) {
165
+ $mcs = plugins_url( '/my-calendar-submissions/mcs-styles.css' );
166
+ $mcs_ui = plugins_url( '/my-calendar-submissions/css/smoothness/jquery-ui-1.8.23.custom.css' );
167
  wp_register_style( 'my-calendar-submissions-ui-style', $mcs_ui );
168
  wp_enqueue_style( 'my-calendar-submissions-ui-style' );
169
  wp_register_style( 'my-calendar-submissions-style', $mcs );
176
  global $wpdb, $wp_query;
177
  $mcdb = $wpdb;
178
  $array = array();
179
+
 
180
  if ( get_option('mc_use_styles') != 'true' ) {
181
  $this_post = $wp_query->get_queried_object();
182
  $id = ( is_object($this_post) && isset( $this_post->ID ) ) ? $this_post->ID : false;
229
  function mc_deal_with_deleted_user( $id ) {
230
  global $wpdb;
231
  $mcdb = $wpdb;
 
232
  // Do the queries
233
  // This may not work quite right in multi-site. Need to explore further when I have time.
234
+ $mcdb->get_results( "UPDATE ".my_calendar_table()." SET event_author=".apply_filters( 'mc_deleted_author', $mcdb->get_var("SELECT MIN(ID) FROM ".$mcdb->prefix."users",0,0 ) )." WHERE event_author=".$id );
235
+ $mcdb->get_results( "UPDATE ".my_calendar_table()." SET event_host=".apply_filters( 'mc_deleted_host', $mcdb->get_var("SELECT MIN(ID) FROM ".$mcdb->prefix."users",0,0 ) )." WHERE event_host=".$id );
236
  }
237
 
238
  // Function to add the javascript to the admin header
239
+ function my_calendar_add_javascript() {
240
+ if ( isset( $_GET['page'] ) && ( $_GET['page'] == 'my-calendar' || $_GET['page'] == 'my-calendar-groups' || $_GET['page'] == 'my-calendar-locations' ) ) {
241
+ wp_enqueue_script('jquery-ui-autocomplete');
242
+ wp_enqueue_script('jquery-ui-accordion');
243
+ wp_enqueue_script('pickadate',plugins_url( 'js/pickadate/picker.js', __FILE__ ), array('jquery') );
244
+ wp_enqueue_script('pickadate.date',plugins_url( 'js/pickadate/picker.date.js', __FILE__ ), array('pickadate') );
245
+ wp_enqueue_script('pickadate.time',plugins_url( 'js/pickadate/picker.time.js', __FILE__ ), array('pickadate') );
246
+ wp_localize_script('pickadate.date', 'mc_months', array(
247
  date_i18n( 'F', strtotime( 'January 1' ) ),
248
  date_i18n( 'F', strtotime( 'February 1' ) ),
249
  date_i18n( 'F', strtotime( 'March 1' ) ),
250
  date_i18n( 'F', strtotime( 'April 1' ) ),
251
+ date_i18n( 'F', strtotime( 'May 1' ) ),
252
  date_i18n( 'F', strtotime( 'June 1' ) ),
253
  date_i18n( 'F', strtotime( 'July 1' ) ),
254
  date_i18n( 'F', strtotime( 'August 1' ) ),
257
  date_i18n( 'F', strtotime( 'November 1' ) ),
258
  date_i18n( 'F', strtotime( 'December 1' ) )
259
  ) );
260
+ wp_localize_script('pickadate.date', 'mc_days', array(
261
+ date_i18n( 'D', strtotime( 'Monday' ) ),
262
+ date_i18n( 'D', strtotime( 'Tuesday' ) ),
263
+ date_i18n( 'D', strtotime( 'Wednesday' ) ),
264
+ date_i18n( 'D', strtotime( 'Thursday' ) ),
265
+ date_i18n( 'D', strtotime( 'Friday' ) ),
266
+ date_i18n( 'D', strtotime( 'Saturday' ) ),
267
+ date_i18n( 'D', strtotime( 'Sunday' ) )
268
+ ) );
269
+ wp_enqueue_script('pickadate.config',plugins_url( 'js/pickadate/picker.config.js', __FILE__ ), array('pickadate') );
270
+
271
  wp_enqueue_script('jquery.addfields',plugins_url( 'js/jquery.addfields.js', __FILE__ ), array('jquery') );
272
+ if ( function_exists('wp_enqueue_media') && !did_action( 'wp_enqueue_media' ) ) {
273
+ wp_enqueue_media();
 
 
 
 
 
 
 
 
274
  }
275
+ wp_register_script( 'mc-upload', plugins_url( 'js/upload.js', __FILE__ ), array( 'jquery' ) );
276
+ wp_enqueue_script( 'mc-upload' );
277
+ wp_localize_script( 'mc-upload', 'thumbHeight', get_option( 'thumbnail_size_h' ) );
278
+ }
279
+ if ( isset($_GET['page']) && ( $_GET['page'] == 'my-calendar-config' || $_GET['page'] == 'my-calendar-help' ) ) {
280
+ wp_register_script( 'mc.tabs', plugins_url( 'js/tabs.js', __FILE__ ), array( 'jquery' ) );
281
+ wp_register_script( 'mc.sortable', plugins_url( 'js/sortable.js', __FILE__ ), array( 'jquery','jquery-ui-sortable' ) );
282
+ wp_enqueue_script( 'mc.tabs' );
283
+ wp_enqueue_script( 'mc.sortable' );
284
+ $firstItem = ( $_GET['page'] == 'my-calendar-config' ) ? 'mc_editor' : 'mc_main' ;
285
+ wp_localize_script( 'mc.tabs', 'firstItem', $firstItem );
286
  }
287
  if ( isset($_GET['page']) && ( $_GET['page'] == 'my-calendar-groups' || $_GET['page'] == 'my-calendar-manage' ) ) {
288
+ wp_enqueue_script( 'jquery.checkall', plugins_url( 'js/jquery.checkall.js', __FILE__ ), array( 'jquery' ) );
289
  }
290
  }
291
 
292
  function my_calendar_write_js() {
293
+ if ( isset( $_GET['page'] ) && ( $_GET['page']=='my-calendar' || $_GET['page'] == 'my-calendar-locations' ) ) {
294
  ?>
295
+ <script type="text/javascript">
296
+ //<![CDATA[
297
  jQuery(document).ready(function($) {
298
+ $('#e_begin,' + '#e_end').pickadate({
299
+ monthsFull: mc_months,
300
+ weekdaysShort: mc_days,
301
+ format: 'yyyy-mm-dd',
302
+ selectYears: true,
303
+ selectMonths: true
304
  });
305
+
306
+ $('#mc-accordion').accordion({ collapsible:true, active:false });
307
+ <?php
308
+ if ( function_exists( 'jd_doTwitterAPIPost' ) ) { ?>
309
+ $('#mc_twitter').charCount( { allowed: 140, counterText: '<?php _e('Characters left: ','my-calendar') ?>' } );
310
+ <?php } ?>
311
+ });
312
+ //]]>
313
+ </script><?php
 
 
 
314
  }
315
  }
316
+
317
  add_action( 'in_plugin_update_message-my-calendar/my-calendar.php', 'mc_plugin_update_message' );
318
  function mc_plugin_update_message() {
319
  global $mc_version;
329
  }
330
 
331
  function mc_footer_js() {
332
+ global $wp_query;
333
  if ( mc_is_mobile() && get_option('mc_convert') == 'true' ) {
334
  return;
335
  } else {
336
+ $top = $bottom = $inner = '';
 
 
337
  $list_js = stripcslashes( get_option( 'mc_listjs' ) );
338
  $cal_js = stripcslashes( get_option( 'mc_caljs' ) );
339
  if ( get_option('mc_open_uri') == 'true') { // remove sections of javascript if necessary.
341
  $cal_js = str_replace($replacements,'',$cal_js);
342
  }
343
  $mini_js = stripcslashes( get_option( 'mc_minijs' ) );
344
+ if ( get_option( 'mc_open_day_uri' ) == 'true' || get_option( 'mc_open_day_uri' ) == 'listanchor' || get_option( 'mc_open_day_uri' ) == 'calendaranchor' ) {
345
+ $mini_js = str_replace( 'e.preventDefault();','',$mini_js );
346
+ }
347
  $ajax_js = stripcslashes( get_option( 'mc_ajaxjs' ) );
348
+ if ( is_object( $wp_query ) && isset( $wp_query->post ) ) {
349
+ $id = $wp_query->post->ID;
350
+ }
351
+ if ( get_option( 'mc_show_js' ) != '' ) {
352
+ $array = explode( ",",get_option( 'mc_show_js' ) );
353
+ if ( !is_array( $array ) ) {
354
+ $array = array();
 
 
355
  }
356
+ }
357
+ if ( @in_array( $id, $array ) || get_option( 'mc_show_js' ) == '' ) {
358
+ $top = "
359
  <script type='text/javascript'>
360
+ (function( $ ) { 'use strict'; \n";
361
+ if ( get_option( 'mc_calendar_javascript' ) != 1 ) { $inner .= "\n".$cal_js; }
362
+ if ( get_option( 'mc_list_javascript' ) != 1 ) { $inner .= "\n".$list_js; }
363
+ if ( get_option( 'mc_mini_javascript' ) != 1 ) { $inner .= "\n".$mini_js; }
364
+ if ( get_option( 'mc_ajax_javascript' ) != 1 ) { $inner .= "\n".$ajax_js; }
365
+ $bottom .= "
366
+ }(jQuery));
367
  </script>";
368
+ }
369
+ $inner = apply_filters( 'mc_filter_javascript_footer',$inner );
370
+ echo ( $inner != '' )?$top.$inner.$bottom:'';
371
  }
372
  }
373
 
374
  function my_calendar_add_styles() {
375
  if ( !empty($_GET['page']) ) {
376
+ if ( isset($_GET['page']) && ($_GET['page'] == 'my-calendar' || $_GET['page'] == 'my-calendar-manage' || $_GET['page'] == 'my-calendar-groups' || $_GET['page'] == 'my-calendar-categories' || $_GET['page'] == 'my-calendar-locations' || $_GET['page'] == 'my-calendar-config' || $_GET['page'] == 'my-calendar-styles' || $_GET['page'] == 'my-calendar-help' || $_GET['page'] == 'my-calendar-behaviors' ) || $_GET['page'] == 'my-calendar-templates' ) {
377
+ echo '<link type="text/css" rel="stylesheet" href="'.plugins_url( 'css/mc-styles.css', __FILE__ ).'" />';
 
 
 
 
 
 
 
378
  }
379
+ if ( isset($_GET['page']) && $_GET['page'] == 'my-calendar') {
380
+ echo '<link type="text/css" rel="stylesheet" href="'.plugins_url( 'js/pickadate/themes/default.css', __FILE__ ).'" />';
381
+ echo '<link type="text/css" rel="stylesheet" href="'.plugins_url( 'js/pickadate/themes/default.date.css', __FILE__ ).'" />';
382
+ echo '<link type="text/css" rel="stylesheet" href="'.plugins_url( 'js/pickadate/themes/default.time.css', __FILE__ ).'" />';
383
  }
384
  }
 
385
  }
386
 
387
  function mc_get_current_url() {
388
  global $wp;
389
  $current_url = add_query_arg( $wp->query_string, '', home_url( $wp->request ) );
390
+ $current_url = home_url( add_query_arg( array(),$wp->request ) );
391
  return $current_url;
392
  }
393
 
394
+ function mc_csv_to_array( $csv, $delimiter = ',', $enclosure = '"', $escape = '\\', $terminator = "\n" ) {
395
  $r = array();
396
  $rows = explode($terminator,trim($csv));
397
  foreach ($rows as $row) {
404
  }
405
 
406
  function mc_if_needs_permissions() {
407
+ // prevent administrators from losing privileges to edit my calendar
408
  $role = get_role( 'administrator' );
409
  if ( is_object( $role ) ) {
410
  $caps = $role->capabilities;
411
+ if ( isset( $caps['mc_add_events'] ) ) {
412
  return;
413
  } else {
414
  $role->add_cap( 'mc_add_events' );
442
  $role->add_cap( 'mc_view_help' );
443
 
444
  // depending on permissions settings, grant other permissions
 
445
  if ( $add && $manage && $approve ) {
446
  // this is an upgrade;
447
  // Get Roles
453
  $contributor->add_cap( 'mc_view_help' );
454
  $author->add_cap( 'mc_view_help' );
455
  $editor->add_cap( 'mc_view_help' );
 
456
  switch( $add ) {
457
  case 'read':
458
  $subscriber->add_cap( 'mc_add_events' );
523
  mc_if_needs_permissions();
524
  $current_version = ( get_option('mc_version') == '') ? get_option('my_calendar_version') : get_option('mc_version');
525
  // If current version matches, don't bother running this.
526
+ if ( $current_version == $mc_version ) {
527
  return true;
528
  }
529
  // Lets see if this is first run and create a table if it is!
544
  }
545
  if ( $my_calendar_exists == true && $current_version == '' ) {
546
  // If the table exists, but I don't know what version it is, I have to run the full cycle of upgrades.
547
+ $current_version = '1.5.9';
548
  }
549
 
550
  if ( $my_calendar_exists == false ) {
552
  } else {
553
  // for each release requiring an upgrade path, add a version compare.
554
  // Loop will run every relevant upgrade cycle.
 
 
 
 
555
  if ( version_compare( $current_version, "1.7.0", "<" ) ) { $upgrade_path[] = "1.7.0"; }
556
  if ( version_compare( $current_version, "1.7.1", "<" ) ) { $upgrade_path[] = "1.7.1"; }
557
  if ( version_compare( $current_version, "1.8.0", "<" ) ) { $upgrade_path[] = "1.8.0"; }
567
  if ( version_compare( $current_version, "2.1.0", "<" ) ) { $upgrade_path[] = "2.1.0"; }
568
  if ( version_compare( $current_version, "2.2.0", "<" ) ) { $upgrade_path[] = "2.2.0"; }
569
  if ( version_compare( $current_version, "2.2.6", "<" ) ) { $upgrade_path[] = "2.2.6"; }
570
+ if ( version_compare( $current_version, "2.2.10", "<" ) ) { $upgrade_path[] = "2.2.10"; }
571
+ if ( version_compare( $current_version, "2.3.0", "<" ) ) { $upgrade_path[] = "2.3.0"; }
572
  }
573
  // having determined upgrade path, assign new version number
574
  update_option( 'mc_version' , $mc_version );
586
  foreach ($upgrade_path as $upgrade) {
587
  switch ($upgrade) {
588
  // only upgrade db on most recent version
589
+ case '2.3.0':
590
+ delete_option('mc_location_control' );
591
+ $user_data = get_option( 'mc_user_settings' );
592
+ $loc_type = ( get_option( 'mc_location_type' ) == '' ) ? 'event_state' : get_option( 'mc_location_type' );
593
+ $locations[$loc_type] = $user_data['my_calendar_location_default']['values'];
594
+ add_option( 'mc_use_permalinks', false );
595
+ delete_option( 'mc_modified_feeds' );
596
+ add_option( 'mc_location_controls', $locations );
597
+ add_option( 'mc_location_access', array(
598
+ '1'=> __('Accessible Entrance','my-calendar'),
599
+ '2'=> __('Accessible Parking Designated','my-calendar'),
600
+ '3'=> __('Accessible Restrooms','my-calendar'),
601
+ '4'=> __('Accessible Seating','my-calendar'),
602
+ '5'=> __('Accessible Transportation Available','my-calendar'),
603
+ '6'=> __('Wheelchair Accessible','my-calendar'),
604
+ '7'=> __('Courtesy Wheelchairs','my-calendar'),
605
+ '8'=> __('Bariatric Seating Available','my-calendar'),
606
+ '9'=> __('Elevator to all public areas','my-calendar'),
607
+ '10'=> __('Braille Signage','my-calendar'),
608
+ '11'=> __('Fragrance-Free Policy','my-calendar'),
609
+ '12'=> __('Other','my-calendar')
610
+ ) );
611
+ add_option( 'mc_event_access', array(
612
+ '1'=> __('Audio Description','my-calendar'),
613
+ '2'=> __('ASL Interpretation', 'my-calendar'),
614
+ '3'=> __('ASL Interpretation with voicing','my-calendar'),
615
+ '4'=> __('Deaf-Blind ASL','my-calendar'),
616
+ '5'=> __('Real-time Captioning','my-calendar'),
617
+ '6'=> __('Scripted Captioning', 'my-calendar' ),
618
+ '7'=> __('Assisted Listening Devices','my-calendar'),
619
+ '8'=> __('Tactile/Touch Tour','my-calendar'),
620
+ '9'=> __('Braille Playbill','my-calendar'),
621
+ '10'=> __('Large Print Playbill','my-calendar'),
622
+ '11'=> __( 'Sensory Friendly','my-calendar'),
623
+ '12'=> __( 'Other','my-calendar' )
624
+ ) );
625
+ $mc_input_options = get_option( 'mc_input_options' );
626
+ $mc_input_options['event_access'] = 'on';
627
+ update_option( 'mc_input_options', $mc_input_options );
628
+ mc_upgrade_db();
629
+ mc_transition_db();
630
+ break;
631
  case '2.2.10':
632
  delete_option( 'mc_show_print' );
633
  delete_option( 'mc_show_ical' );
634
  delete_option( 'mc_show_rss' );
 
635
  break;
636
  case '2.2.8':
637
  delete_option( 'mc_draggable' );
641
  break;
642
  case '2.2.0':
643
  add_option('mc_inverse_color','true');
 
644
  break;
645
  case '2.1.0':
646
  $templates = get_option( 'mc_templates' );
761
  update_option('mc_db_version','1.9.0');
762
  case '1.8.0':
763
  $mc_input = get_option( 'mc_input_options' );
 
 
 
 
764
  add_option( 'mc_show_weekends','true' );
765
  add_option( 'mc_uri','' );
766
  delete_option( 'my_calendar_stored_styles');
767
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
768
  default:
769
  break;
770
  }
787
  // Grab all the categories and list them
788
  $list = $default = '';
789
  $sql = "SELECT * FROM " . my_calendar_categories_table() . " ORDER BY category_name ASC";
790
+ $cats = $mcdb->get_results($sql);
791
+ foreach($cats as $cat) {
792
+ $c = '<option value="'.$cat->category_id.'"';
793
+ if ( !empty($data) ) {
794
+ if ( !is_object($data) ) { $category = $data; } else { $category = $data->event_category; }
795
+ if ($category == $cat->category_id){
796
+ $c .= ' selected="selected"';
 
 
 
 
 
 
 
797
  }
798
  }
799
+ $c .= '>'.stripslashes($cat->category_name).'</option>';
800
+ if ( $cat->category_id != get_option('mc_default_category') ) {
801
+ $list .= $c;
802
+ } else {
803
+ $default = $c;
804
  }
805
+ }
806
+ if ( !$option ) {
807
+ $default = ( get_option( 'mc_default_category' ) ) ? get_option( 'mc_default_category' ) : 1 ;
808
+ return ( is_object( $data ) ) ? $data->event_category : $default;
809
+ }
810
+ return $default.$list;
811
  }
812
 
813
  // @data object with event_location value
847
  function mc_is_selected( $theFieldname,$theValue,$theArray='' ){
848
  if (!is_array( get_option( $theFieldname ) ) ) {
849
  if( get_option( $theFieldname ) == $theValue ){
850
+ return 'selected="selected"';
851
  }
852
  } else {
853
  $theSetting = get_option( $theFieldname );
854
  if ( $theSetting[$theArray]['enabled'] == $theValue ) {
855
+ return 'selected="selected"';
856
  }
857
  }
858
  }
862
  $array = array();
863
  if ( get_option('mc_calendar_javascript') != 1 || get_option('mc_list_javascript') != 1 || get_option('mc_mini_javascript') != 1 ) {
864
  $scripting = "\n<script type='text/javascript'>\n";
865
+ $scripting .= " jQuery('html').addClass('mcjs');\n";
866
+ $scripting .= " jQuery(document).ready( function($) { \$('html').removeClass('mcjs') } );\n";
867
  $scripting .= "</script>\n";
868
+
869
  if ( !is_404() ) {
870
  if ( is_object($wp_query) && isset($wp_query->post) ) {
871
  $id = $wp_query->post->ID;
882
  }
883
  }
884
 
885
+ function mc_month_comparison( $month ) {
886
  $current_month = date("n", current_time('timestamp'));
887
  if (isset($_GET['yr']) && isset($_GET['month'])) {
888
  if ($month == $_GET['month']) {
893
  }
894
  }
895
 
896
+ function mc_year_comparison( $year ) {
897
  $current_year = date("Y", current_time('timestamp'));
898
  if (isset($_GET['yr']) && isset($_GET['month'])) {
899
  if ($year == $_GET['yr']) {
936
  return( $int & 1 );
937
  }
938
 
939
+ function mc_can_edit_event( $author_id ) {
940
  if ( !is_user_logged_in() ) { return false; }
941
  global $user_ID;
942
  get_currentuserinfo();
943
  $user = get_userdata($user_ID);
944
+
945
  if ( current_user_can( 'mc_manage_events' ) ) {
946
  $return = true;
947
  } elseif ( $user_ID == $author_id ) {
971
  }
972
 
973
  // compatibility of clone keyword between PHP 5 and 4
974
+ if ( version_compare( phpversion(), '5.0' ) < 0 ) {
975
+ eval( '
976
  function clone($object) {
977
  return $object;
978
  }
979
+ ' );
980
  }
981
 
982
  add_action( 'admin_bar_menu','my_calendar_admin_bar', 200 );
984
  global $wp_admin_bar;
985
  if ( current_user_can( 'mc_add_events' ) ) {
986
  $url = admin_url('admin.php?page=my-calendar');
987
+ $args = array( 'id'=>'mc-add-event','title'=>__('Add Event','my-calendar'),'href'=>$url );
988
+ $wp_admin_bar->add_node($args);
989
+ }
990
+ if ( current_user_can( 'mc_manage_events' ) && current_user_can( 'mc_add_events' ) ) {
991
+ $url = admin_url('admin.php?page=my-calendar-manage');
992
+ $args = array( 'id'=>'mc-manage-events','title'=>__('Events','my-calendar'),'href'=>$url, 'parent'=>'mc-add-event' );
993
  $wp_admin_bar->add_node($args);
994
  }
995
+ if ( current_user_can( 'mc_edit_cats' ) && current_user_can( 'mc_add_events' ) ) {
996
+ $url = admin_url('admin.php?page=my-calendar-categories');
997
+ $args = array( 'id'=>'mc-manage-categories','title'=>__('Categories','my-calendar'),'href'=>$url, 'parent'=>'mc-add-event' );
998
+ $wp_admin_bar->add_node($args);
999
+ }
1000
+ if ( current_user_can( 'mc_edit_locations' ) && current_user_can( 'mc_add_events' ) ) {
1001
+ $url = admin_url('admin.php?page=my-calendar-locations');
1002
+ $args = array( 'id'=>'mc-manage-locations','title'=>__('Locations','my-calendar'),'href'=>$url, 'parent'=>'mc-add-event' );
1003
+ $wp_admin_bar->add_node($args);
1004
+ }
1005
  }
1006
 
1007
  // functions to route db queries
1047
  }
1048
 
1049
  // Mail functions (originally by Roland)
1050
+ function my_calendar_send_email( $event ) {
1051
+ $details = mc_create_tags($event);
1052
  // shift to boolean
1053
  $send_email_option = ( get_option( 'mc_event_mail' ) == 'true' ) ? true : false;
1054
+ $send_email = apply_filters( 'mc_send_notification', $send_email_option, $details );
1055
  if ( $send_email == true ) {
1056
  add_filter('wp_mail_content_type',create_function('', 'return "text/html";'));
1057
  }
1058
  if ( get_option('mc_event_mail') == 'true' ) {
1059
+ $to = apply_filters( 'mc_event_mail_to', get_option('mc_event_mail_to'), $details );
1060
  $from = ( get_option('mc_event_mail_from') == '' )?get_bloginfo('admin_email'):get_option('mc_event_mail_from');
1061
+ $from = apply_filters( 'mc_event_mail_from', $from, $details );
1062
  $from = "From: ".__('Event Notifications','my-calendar')." <$from>";
1063
+ $subject = jd_draw_template( $details, get_option('mc_event_mail_subject') );
1064
+ $message = jd_draw_template( $details, get_option('mc_event_mail_message') );
1065
  $mail = wp_mail($to, $subject, $message, $from);
1066
  }
1067
  if ( get_option( 'mc_html_email' ) == 'true' ) {
1069
  }
1070
  }
1071
 
1072
+ // checks submitted events against akismet or botsmasher, if available, otherwise just returns false
 
 
1073
  function mc_spam( $event_url='', $description='', $post=array() ) {
1074
  global $akismet_api_host, $akismet_api_port, $current_user;
1075
  get_currentuserinfo();
1142
  return preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $url);
1143
  }
1144
 
 
1145
  function mc_external_link( $link, $type='event' ) {
1146
  if ( !_mc_is_url($link) ) return "class='error-link'";
1147
 
1150
  $site = parse_url( get_option( 'siteurl' ) );
1151
  $known = $site['host'];
1152
  if ( strpos( $host, $known ) === false ) {
1153
+ return true;
 
 
1154
  }
1155
+ return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1156
  }
1157
 
 
1158
  add_action('admin_enqueue_scripts', 'mc_scripts');
1159
  function mc_scripts( $hook ) {
 
 
 
 
 
 
 
1160
  global $current_screen;
1161
+ if ( $current_screen->id == 'toplevel_page_my-calendar' && function_exists( 'jd_doTwitterAPIPost' ) ) {
1162
  // later.
1163
  wp_enqueue_script( 'charCount', plugins_url( 'wp-to-twitter/js/jquery.charcount.js'), array('jquery') );
1164
  }
1168
  }
1169
  }
1170
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1171
  function mc_newline_replace($string) {
1172
  return (string)str_replace(array("\r", "\r\n", "\n"), '', $string);
1173
  }
1174
 
1175
+ function reverse_array( $array, $boolean, $order ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
1176
  if ( $order == 'desc' ) {
1177
+ return array_reverse( $array, $boolean );
1178
  } else {
1179
  return $array;
1180
  }
1189
  if ( !is_plugin_active_for_network( 'my-calendar/my-calendar.php' ) ) {
1190
  function wp_is_mobile() { return false; }
1191
  }
1192
+ }
 
1193
 
1194
  function mc_is_mobile() {
1195
  return apply_filters( 'mc_is_mobile', wp_is_mobile() );
1210
  if ( $value && get_option( 'mc_uri' ) == '' ) {
1211
  $link = get_permalink( $value );
1212
  update_option( 'mc_uri', $link );
1213
+ $return = __( 'Is this your calendar page?','my-calendar' ) . ' <code>'.$link.'</code>';
1214
  return $return;
1215
  }
1216
  }
1312
  } else if ( !$request ) {
1313
  echo "<div class='message error'><p>".__('Please describe your problem in detail. I\'m not psychic.','my-calendar')."</p></div>";
1314
  } else {
1315
+ $sent = wp_mail( "plugins@joedolson.com",$subject,$message,$from );
1316
+ if ( $sent ) {
1317
+ if ( $has_donated == 'Donor' || $has_purchased == 'Purchaser' ) {
1318
+ echo "<div class='message updated'><p>".__('Thank you for supporting the continuing development of this plug-in! I\'ll get back to you as soon as I can.','my-calendar')."</p></div>";
1319
+ } else {
1320
+ echo "<div class='message updated'><p>".__('I\'ll get back to you as soon as I can, after dealing with any support requests from plug-in supporters.','my-calendar')."</p></div>";
1321
+ }
1322
  } else {
1323
+ echo "<div class='message error'><p>".__( "Sorry! I couldn't send that message. Here's the text of your request:", 'my-calendar' )."</p><pre>$request</pre></div>";
1324
+ }
1325
  }
1326
  }
1327
 
1335
  <code>".__('From:','my-calendar')." \"$current_user->display_name\" &lt;$current_user->user_email&gt;</code>
1336
  </p>
1337
  <p>
1338
+ <input type='checkbox' name='has_read_faq' id='has_read_faq' value='on' required='required' aria-required='true' /> <label for='has_read_faq'>".__('I have read <a href="http://www.joedolson.com/articles/my-calendar/faq/">the FAQ for this plug-in</a>.','my-calendar')." <span>(required)</span></label>
1339
  </p>
1340
  <p>
1341
+ <input type='checkbox' name='has_donated' id='has_donated' value='on' /> <label for='has_donated'>".__('I have <a href="http://www.joedolson.com/donate.php">made a donation to help support this plug-in</a>.','my-calendar')."</label>
1342
  </p>
1343
  <p>
1344
+ <input type='checkbox' name='has_purchased' id='has_purchased' value='on' /> <label for='has_purchased'>".__('I have <a href="http://www.joedolson.com/articles/my-calendar/users-guide/">purchased the User\'s Guide</a>, but could not find an answer to this question.','my-calendar')."</label>
1345
  </p>
1346
  <p>
1347
+ <label for='support_request'>Support Request:</label><br /><textarea name='support_request' id='support_request' required aria-required='true' cols='80' rows='10'>".stripslashes($request)."</textarea>
1348
  </p>
1349
  <p>
1350
+ <input type='submit' value='".__('Send Support Request','my-calendar')."' name='mc_support' class='button-primary' />
1351
  </p>
1352
  <p>".
1353
  __('The following additional information will be sent with your support request:','my-calendar')
1448
  return true;
1449
  }
1450
 
1451
+ /* deletes all instances of an event without deleting the event details. Sets stage for rebuilding event instances. */
1452
  function mc_delete_instances( $id ) {
1453
  global $wpdb;
1454
  $id = (int) $id;
1475
  $group_id = $event->event_group_id;
1476
  $format = array( '%d','%s','%s','%d' );
1477
  $recurs = str_split( $event->event_recur, 1 );
1478
+ $recur = $recurs[0];
1479
  $every = ( isset($recurs[1]) )?$recurs[1]:1;
1480
  if ($recur != "S") {
1481
  // if this event had a rep of 0, translate that.
1584
  return $data;
1585
  }
1586
 
1587
+ function mc_get_details_link( $event ) {
1588
+ // if available, and not querying remotely, use permalink.
1589
+ $permalinks = get_option( 'mc_use_permalinks' );
1590
+ $permalinks = ( $permalinks === 1 || $permalinks === true || $permalinks === 'true' ) ? true : false;
1591
+ $details_link = $event->event_link;
1592
+ if ( $event->event_post != 0 && get_option( 'mc_remote' ) != 'true' && $permalinks ) {
1593
+ $details_link = add_query_arg( 'mc_id', $event->occur_id, get_permalink( $event->event_post ) );
1594
+ } else {
1595
+ if ( get_option( 'mc_uri' ) != '' && !is_numeric( get_option( 'mc_uri' ) ) ) {
1596
+ $details_link = mc_build_url( array( 'mc_id'=>$event->occur_id ), array( 'month','dy','yr','ltype','loc','mcat','format','feed','page_id','p','mcs','time' ), get_option( 'mc_uri' ) );
1597
+ }
1598
+ }
1599
+ return $details_link;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1600
  }
1601
 
1602
  // Actions -- these are action hooks attached to My Calendar events, usable to add additional actions during those events.
 
1603
  add_action( 'init', 'mc_register_actions' );
1604
  function mc_register_actions() {
1605
  apply_filters( "debug", 'my_calendar add actions/filters' );
1606
+ add_filter( 'mc_event_registration', 'mc_standard_event_registration', 10, 4 );
1607
+ add_filter( 'mc_datetime_inputs', 'mc_standard_datetime_input', 10, 4 );
1608
  add_action( 'mc_transition_event', 'mc_tweet_approval', 10, 2 );
1609
+ add_action( 'mc_save_event', 'mc_event_post', 10, 3 );
1610
+ add_action( 'mc_delete_event', 'mc_event_delete_post', 10, 2 );
1611
+ add_action( 'parse_request', 'my_calendar_api' );
1612
+ }
1613
+
1614
+ // Filters
1615
+ add_filter( 'post_updated_messages', 'mc_posttypes_messages');
1616
+
1617
+ // Actions
1618
+ add_action( 'init', 'mc_taxonomies', 0);
1619
+ add_action( 'init', 'mc_posttypes' );
1620
+
1621
+ function mc_posttypes() {
1622
+ $arguments = array(
1623
+ 'public' => true,
1624
+ 'publicly_queryable' => true,
1625
+ 'exclude_from_search'=> true,
1626
+ 'show_ui' => true,
1627
+ 'show_in_menu' => apply_filters( 'mc_show_custom_posts_in_menu', false ),
1628
+ 'show_ui' => true,
1629
+ 'menu_icon' => null,
1630
+ 'supports' => array( 'title','editor','author','thumbnail','excerpt','custom-fields' )
1631
+ );
1632
+
1633
+ $types = array(
1634
+ 'mc-events'=>array(
1635
+ __('event','my-calendar'),
1636
+ __('events','my-calendar'),
1637
+ __('Event','my-calendar'),
1638
+ __('Events','my-calendar'),
1639
+ $arguments),
1640
+ );
1641
+ $enabled = array( 'mc-events' );
1642
+ if ( is_array( $enabled ) ) {
1643
+ foreach ( $enabled as $key ) {
1644
+ $value =& $types[$key];
1645
+ $labels = array(
1646
+ 'name' => _x($value[3], 'post type general name'),
1647
+ 'singular_name' => _x($value[2], 'post type singular name'),
1648
+ 'add_new' => _x( 'Add New' , $key, 'my-calendar' ),
1649
+ 'add_new_item' => sprintf( __( 'Create New %s','my-calendar' ), $value[2] ),
1650
+ 'edit_item' => sprintf( __( 'Modify %s','my-calendar' ), $value[2] ),
1651
+ 'new_item' => sprintf( __( 'New %s','my-calendar' ), $value[2] ),
1652
+ 'view_item' => sprintf( __( 'View %s','my-calendar' ), $value[2] ),
1653
+ 'search_items' => sprintf( __( 'Search %s','my-calendar' ), $value[3] ),
1654
+ 'not_found' => sprintf( __( 'No %s found','my-calendar' ), $value[1] ),
1655
+ 'not_found_in_trash' => sprintf( __( 'No %s found in Trash','my-calendar' ), $value[1] ),
1656
+ 'parent_item_colon' => ''
1657
+ );
1658
+ $raw = $value[4];
1659
+ $args = array(
1660
+ 'labels' => $labels,
1661
+ 'public' => $raw['public'],
1662
+ 'publicly_queryable' => $raw['publicly_queryable'],
1663
+ 'exclude_from_search'=> $raw['exclude_from_search'],
1664
+ 'show_ui' => $raw['show_ui'],
1665
+ 'show_in_menu' => $raw['show_in_menu'],
1666
+ 'show_ui' => $raw['show_ui'],
1667
+ 'menu_icon' => ( $raw['menu_icon']==null ) ? plugins_url( 'images',__FILE__ )."/icon.png" : $raw['menu_icon'],
1668
+ 'query_var' => true,
1669
+ 'rewrite' => array( 'with_front'=>false, 'slug'=>apply_filters( 'mc_event_slug','mc-events' ) ),
1670
+ 'hierarchical' => false,
1671
+ 'menu_position' => 20,
1672
+ 'supports' => $raw['supports']
1673
+ );
1674
+ register_post_type($key,$args);
1675
+ }
1676
+ }
1677
+ }
1678
+
1679
+ function mc_taxonomies() {
1680
+ global $mc_types;
1681
+ $types = $mc_types;
1682
+ $enabled = array( 'mc-events' );
1683
+ if ( is_array( $enabled ) ) {
1684
+ foreach ( $enabled as $key ) {
1685
+ $value = $types[$key];
1686
+ register_taxonomy(
1687
+ "mc-event-category", // internal name = machine-readable taxonomy name
1688
+ array( $key ), // object type = post, page, link, or custom post-type
1689
+ array(
1690
+ 'hierarchical' => true,
1691
+ 'label' => sprintf( __('%s Categories','my-calendar'), $value[2] ), // the human-readable taxonomy name
1692
+ 'query_var' => true, // enable taxonomy-specific querying
1693
+ 'rewrite' => array( 'slug' => apply_filters( 'mc_event_category_slug','mc-event-category' ) ), // pretty permalinks for your taxonomy?
1694
+ )
1695
+ );
1696
+ }
1697
+ }
1698
+ }
1699
+
1700
+ function mc_posttypes_messages( $messages ) {
1701
+ global $post, $post_ID, $mc_types;
1702
+ $types = $mc_types;
1703
+ $enabled = array('mc-events');
1704
+ if ( is_array( $enabled ) ) {
1705
+ foreach ( $enabled as $key ) {
1706
+ $value = $types[$key];
1707
+ $messages[$key] = array(
1708
+ 0 => '', // Unused. Messages start at index 1.
1709
+ 1 => sprintf( __('%1$s updated. <a href="%2$s">View %1$s</a>'), $value[2], esc_url( get_permalink($post_ID) ) ),
1710
+ 2 => __('Custom field updated.'),
1711
+ 3 => __('Custom field deleted.'),
1712
+ 4 => sprintf( __('%s updated.'), $value[2] ),
1713
+ /* translators: %s: date and time of the revision */
1714
+ 5 => isset($_GET['revision']) ? sprintf( __('%1$s restored to revision from %2$ss'), $value[2], wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
1715
+ 6 => sprintf( __('%1$s published. <a href="%2$s">View %3$s</a>'), $value[2], esc_url( get_permalink($post_ID) ), $value[0] ),
1716
+ 7 => sprintf( __('%s saved.'), $value[2] ),
1717
+ 8 => sprintf( __('%1$s submitted. <a target="_blank" href="%2$s">Preview %3$s</a>'), $value[2], esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ), $value[0] ),
1718
+ 9 => sprintf( __('%1$s scheduled for: <strong>%2$s</strong>. <a target="_blank" href="%3$s">Preview %4$s</a>'),
1719
+ $value[2], date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), esc_url( get_permalink($post_ID) ), $value[0] ),
1720
+ 10 => sprintf( __('%1$s draft updated. <a target="_blank" href="%2$s">Preview %3$s</a>'), $value[2], esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ), $value[0] ),
1721
+ );
1722
+ }
1723
+ }
1724
+ return $messages;
1725
  }
1726
 
1727
  // Actions are only performed after their respective My Calendar events have been successfully completed.
my-calendar-event-manager.php CHANGED
@@ -1,12 +1,151 @@
1
  <?php
2
- if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
  function manage_my_calendar() {
5
- check_my_calendar();
6
  global $wpdb,$event_author;
7
  $mcdb = $wpdb;
8
-
9
- if ( isset( $_GET['mode'] ) && $_GET['mode'] == 'delete' ) {
10
  $sql = "SELECT event_title, event_author FROM " . my_calendar_table() . " WHERE event_id=" . (int) $_GET['event_id'];
11
  $result = $mcdb->get_results( $sql, ARRAY_A );
12
  if ( mc_can_edit_event( $result[0]['event_author'] ) ) {
@@ -14,11 +153,10 @@ check_my_calendar();
14
  $event_instance = (int) $_GET['date'];
15
  $sql = "SELECT occur_begin FROM " . my_calendar_event_table() . " WHERE occur_id=" . $event_instance;
16
  $inst = $mcdb->get_var( $sql );
17
- $instance_date = ' ('.date('Y-m-d',strtotime($inst) ).')';
18
  } else {
19
  $instance_date = '';
20
- }
21
- ?>
22
  <div class="error">
23
  <form action="<?php echo admin_url('admin.php?page=my-calendar'); ?>" method="post">
24
  <p><strong><?php _e('Delete Event','my-calendar'); ?>:</strong> <?php _e('Are you sure you want to delete this event?','my-calendar'); ?>
@@ -37,14 +175,14 @@ check_my_calendar();
37
  </div><?php
38
  } else { ?>
39
  <div class="error">
40
- <p><strong><?php _e( 'You do not have permission to delete that event.','my-calendar' ); ?></strong></p>
41
  </div><?php
42
  }
43
  }
44
 
45
  // Approve and show an Event ...originally by Roland
46
- if ( isset( $_GET['mode'] ) && $_GET['mode'] == 'approve' ) {
47
- if ( current_user_can( 'mc_approve_events' ) ) {
48
  $sql = "UPDATE " . my_calendar_table() . " SET event_approved = 1 WHERE event_id=" . (int) $_GET['event_id'];
49
  $result = $mcdb->get_results( $sql, ARRAY_A );
50
  mc_delete_cache();
@@ -58,8 +196,8 @@ check_my_calendar();
58
  }
59
 
60
  // Reject and hide an Event ...by Roland
61
- if ( isset( $_GET['mode'] ) && $_GET['mode'] == 'reject' ) {
62
- if ( current_user_can( 'mc_approve_events' ) ) {
63
  $sql = "UPDATE " . my_calendar_table() . " SET event_approved = 2 WHERE event_id=" . (int) $_GET['event_id'];
64
  $result = $mcdb->get_results( $sql, ARRAY_A );
65
  mc_delete_cache();
@@ -76,7 +214,6 @@ check_my_calendar();
76
  $nonce=$_REQUEST['_wpnonce'];
77
  if (! wp_verify_nonce($nonce,'my-calendar-nonce') ) die("Security check failed");
78
  $events = $_POST['mass_edit'];
79
- $sql = 'DELETE FROM ' . my_calendar_table() . ' WHERE event_id IN (';
80
  $i=0;
81
  $deleted = array();
82
  foreach ($events as $value) {
@@ -87,13 +224,13 @@ check_my_calendar();
87
  if ( mc_can_edit_event( $result[0]['event_author'] ) ) {
88
  $delete_occurrences = "DELETE FROM ".my_calendar_event_table()." WHERE occur_event_id = $value";
89
  $delete = $mcdb->query($delete_occurrences);
90
- $sql .= mysql_real_escape_string($value).',';
91
  $deleted[] = $value;
92
  $i++;
93
  }
94
  }
95
- $sql = substr( $sql, 0, -1 );
96
- $sql .= ')';
97
  $result = $mcdb->query($sql);
98
  if ( $result !== 0 && $result !== false ) {
99
  mc_delete_cache();
@@ -106,11 +243,11 @@ check_my_calendar();
106
  echo $message;
107
  }
108
 
109
- if ( !empty($_POST['mass_edit']) && isset($_POST['mass_approve']) ) {
110
  $nonce=$_REQUEST['_wpnonce'];
111
  if (! wp_verify_nonce($nonce,'my-calendar-nonce') ) die("Security check failed");
112
  $events = $_POST['mass_edit'];
113
- $sql = 'UPDATE ' . my_calendar_table() . ' SET event_approved = 1 WHERE event_id IN (';
114
  $i=0;
115
  $approved = array();
116
  foreach ($events as $value) {
@@ -135,33 +272,67 @@ check_my_calendar();
135
  }
136
  echo $message;
137
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
138
  ?>
139
  <div class='wrap jd-my-calendar'>
140
  <div id="icon-edit" class="icon32"></div>
141
- <h2 class='mc-clear' id='mc-manage'><?php _e('Manage Events','my-calendar'); ?></h2>
142
- <div class="postbox-container" style="width: 75%">
143
  <div class="metabox-holder">
144
  <div class="ui-sortable meta-box-sortables">
145
  <div class="postbox">
146
  <h3><?php _e('My Events','my-calendar'); ?></h3>
147
  <div class="inside">
148
- <?php jd_events_display_list(); ?>
149
  </div>
150
  </div>
151
  </div>
152
  </div>
153
  </div>
154
- <?php jd_show_support_box(); ?>
 
 
 
 
 
 
155
  </div>
156
  <?php
157
  }
158
 
159
  function edit_my_calendar() {
160
  global $current_user, $wpdb, $users_entries;
161
- $mcdb = $wpdb;
162
- if ( get_option('ko_calendar_imported') != 'true' ) {
 
163
  if (function_exists('check_calendar')) {
164
- echo "<div id='message' class='updated'>";
165
  echo "<p>";
166
  _e('My Calendar has identified that you have the Calendar plugin by Kieran O\'Shea installed. You can import those events and categories into the My Calendar database. Would you like to import these events?','my-calendar');
167
  echo "</p>";
@@ -184,39 +355,36 @@ function edit_my_calendar() {
184
  // First some quick cleaning up
185
  $edit = $create = $save = $delete = false;
186
 
187
- $action = !empty($_POST['event_action']) ? $_POST['event_action'] : '';
188
- $event_id = !empty($_POST['event_id']) ? $_POST['event_id'] : '';
189
 
190
  if ( isset( $_GET['mode'] ) ) {
191
  $action = $_GET['mode'];
192
- if ( $action == 'edit' || $action == 'copy' ) {
193
  $event_id = (int) $_GET['event_id'];
194
  }
195
  }
196
 
197
- // Check whether My Calendar is up to date and installed.
198
- check_my_calendar();
199
-
200
  if ( isset( $_POST['event_action'] ) ) {
201
- $nonce=$_REQUEST['_wpnonce'];
202
- if (! wp_verify_nonce($nonce,'my-calendar-nonce') ) die("Security check failed");
203
  $proceed = false;
204
  global $mc_output;
205
  $count = 0;
206
- if ( isset($_POST['event_begin']) && is_array( $_POST['event_begin'] ) ) {
207
- $count = count($_POST['event_begin']);
208
  } else {
209
- $response = my_calendar_save($action,$mc_output,(int) $_POST['event_id']);
210
- echo $response;
211
  }
212
  for ($i=0;$i<$count;$i++) {
213
- $mc_output = mc_check_data($action,$_POST, $i);
214
- if ($action == 'add' || $action == 'copy' ) {
215
- $response = my_calendar_save($action,$mc_output);
216
  } else {
217
- $response = my_calendar_save($action,$mc_output,(int) $_POST['event_id']);
218
  }
219
- echo $response;
220
  }
221
  if ( isset($_POST['ref']) ) {
222
  $url = esc_url( urldecode( $_POST['ref'] ) );
@@ -227,48 +395,44 @@ if ( isset( $_POST['event_action'] ) ) {
227
  ?>
228
 
229
  <div class="wrap jd-my-calendar">
230
-
231
- <?php my_calendar_check_db();?>
232
- <?php
233
- if ( get_site_option('mc_multisite') == 2 ) {
234
- if ( get_option('mc_current_table') == 0 ) {
235
- $message = __('Currently editing your local calendar','my-calendar');
236
- } else {
237
- $message = __('Currently editing your central calendar','my-calendar');
238
- }
239
- echo "<div class='message updated'><p>$message</p></div>";
240
- } ?>
241
- <?php if ( $action == 'edit' || ($action == 'edit' && $error_with_saving == 1) ) { ?>
242
- <div id="icon-edit" class="icon32"></div>
243
  <h2><?php _e('Edit Event','my-calendar'); ?></h2>
244
  <?php
245
  if ( empty($event_id) ) {
246
  echo "<div class=\"error\"><p>".__("You must provide an event id in order to edit it",'my-calendar')."</p></div>";
247
  } else {
248
- jd_events_edit_form('edit', $event_id);
249
  }
250
- } else if ( $action == 'copy' || ($action == 'copy' && $error_with_saving == 1)) { ?>
251
- <div id="icon-edit" class="icon32"></div>
252
  <h2><?php _e('Copy Event','my-calendar'); ?></h2>
253
  <?php
254
  if ( empty($event_id) ) {
255
  echo "<div class=\"error\"><p>".__("You must provide an event id in order to edit it",'my-calendar')."</p></div>";
256
  } else {
257
- jd_events_edit_form('copy', $event_id);
258
  }
259
- } else {
260
- ?>
261
- <div id="icon-edit" class="icon32"></div>
262
- <h2><?php _e('Add Event','my-calendar'); ?></h2>
263
- <?php jd_events_edit_form(); ?>
264
- <?php } ?>
265
- <?php jd_show_support_box(); ?>
266
- </div>
267
- <?php
268
  }
269
 
270
  function mc_tweet_approval( $prev, $new ) {
271
- if ( function_exists( 'jd_doTwitterAPIPost' ) && isset( $_POST['mc_twitter'] ) && trim($_POST['mc_twitter']) != '' ) {
272
  if ( ( $prev == 0 || $prev == 2 ) && $new == 1 ) {
273
  jd_doTwitterAPIPost( stripslashes( $_POST['mc_twitter'] ) );
274
  }
@@ -281,45 +445,50 @@ function my_calendar_save( $action,$output,$event_id=false ) {
281
  $proceed = $output[0];
282
  $message = '';
283
  $formats = array(
284
- '%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s',
285
  '%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d',
286
  '%f','%f'
287
  );
288
- if ( ( $action == 'add' || $action == 'copy' ) && $proceed == true ) {
289
  $add = $output[2]; // add format here
290
  $add = apply_filters( 'mc_before_save_insert', $add );
291
- $result = $mcdb->insert(
292
- my_calendar_table(),
293
- $add,
294
- $formats
295
- );
296
- $new_event = $mcdb->insert_id;
297
- // create all occurrences of event
298
- $occurrences = mc_increment_event( $new_event );
299
  if ( !$result ) {
300
  $message = "<div class='error notice'><p><strong>". __('Error','my-calendar') .":</strong> ". __('I\'m sorry! I couldn\'t add that event to the database.','my-calendar') . "</p></div>";
301
  } else {
302
  // do an action using the $action and processed event data
303
  $data = $add;
304
- do_action( 'mc_save_event', $action, $data, $new_event );
305
  // Call mail function
306
- if ( get_option('mc_event_mail') == 'true' ) {
307
  $event = mc_get_event( $mcdb->insert_id ); // insert_id is last occurrence inserted in the db
308
  my_calendar_send_email( $event );
309
  }
310
  if ( $add['event_approved'] == 0 ) {
311
  $message = "<div class='updated notice'><p>".__('Event saved. An administrator will review and approve your event.','my-calendar')."</p></div>";
312
  } else {
313
- if ( function_exists( 'jd_doTwitterAPIPost' ) && isset( $_POST['mc_twitter'] ) && trim($_POST['mc_twitter']) != '' ) {
314
  jd_doTwitterAPIPost( stripslashes($_POST['mc_twitter']) );
315
  }
316
- $message = "<div class='updated notice'><p>". __('Event added. It will now show on the calendar.','my-calendar') . "</p></div>";
 
 
 
 
 
 
 
 
 
 
317
  }
318
  mc_delete_cache();
319
  }
320
  }
321
- if ( $action == 'edit' && $proceed == true ) {
322
- $url = ( get_option('mc_uri') != '' && !is_numeric( get_option('mc_uri') ) )?' '.sprintf(__('View <a href="%s">your calendar</a>.','my-calendar'),get_option('mc_uri') ):'';
323
  $event_author = (int) ($_POST['event_author']);
324
  if ( mc_can_edit_event( $event_author ) ) {
325
  $update = $output[2];
@@ -328,7 +497,7 @@ function my_calendar_save( $action,$output,$event_id=false ) {
328
  $update['event_begin'] != $_POST['prev_event_begin'] ||
329
  $update['event_time'] != $_POST['prev_event_time'] ||
330
  $update['event_end'] != $_POST['prev_event_end'] ||
331
- ( $update['event_endtime'] != $_POST['prev_event_endtime'] && ( $_POST['prev_event_endtime'] != '' && $update['event_endtime']!= '00:00:00' ) ) )
332
  ?true:false;
333
  if ( isset($_POST['event_instance']) ) {
334
  $is_changed = mc_compare( $update, $event_id );// compares the information sent to the information saved for a given event.
@@ -348,7 +517,6 @@ function my_calendar_save( $action,$output,$event_id=false ) {
348
  } else {
349
  if ( $update['event_begin'][0] == $_POST['prev_event_begin'] && $update['event_end'][0] == $_POST['prev_event_end'] ) {
350
  // There were no changes at all.
351
- $message = "<div class='updated notice'><p>".__('Nothing was changed in that update.','my-calendar')."$url</p></div>";
352
  } else {
353
  $result = mc_update_instance( $event_instance, $event_id, $update );
354
  // Only dates were changed
@@ -363,7 +531,7 @@ function my_calendar_save( $action,$output,$event_id=false ) {
363
  $update,
364
  array( 'event_id'=>$event_id ),
365
  $formats,
366
- '%d' );
367
  $recur_changed = ( $update['event_repeats'] != $_POST['prev_event_repeats'] || $update['event_recur'] != $_POST['prev_event_recur'] )?true:false;
368
  if ( $date_changed || $recur_changed ) {
369
  $delete_instances = mc_delete_instances( $event_id );
@@ -376,8 +544,6 @@ function my_calendar_save( $action,$output,$event_id=false ) {
376
  //$mcdb->print_error();
377
  if ( $result === false ) {
378
  $message = "<div class='error'><p><strong>".__('Error','my-calendar').":</strong>".__('Your event was not updated.','my-calendar')."$url</p></div>";
379
- } else if ( $result === 0 ) {
380
- $message = "<div class='updated'><p>".__('No event data was changed in that update.','my-calendar')."$url</p></div>";
381
  } else {
382
  // do an action using the $action and processed event data
383
  do_action( 'mc_transition_event', (int) $_POST['prev_event_status'], (int) $_POST['event_approved'] );
@@ -389,11 +555,12 @@ function my_calendar_save( $action,$output,$event_id=false ) {
389
  }
390
  }
391
 
392
- if ( $action == 'delete' ) {
393
  // Deal with deleting an event from the database
394
- if ( empty($event_id) ) {
395
  $message = "<div class='error'><p><strong>".__('Error','my-calendar').":</strong>".__("You can't delete an event if you haven't submitted an event id",'my-calendar')."</p></div>";
396
  } else {
 
397
  if ( empty( $_POST['event_instance'] ) ) {
398
  $sql = "DELETE FROM " . my_calendar_table() . " WHERE event_id='" . (int) $event_id . "'";
399
  $delete_occurrences = "DELETE FROM ".my_calendar_event_table()." WHERE occur_event_id = ".(int) $event_id;
@@ -408,7 +575,7 @@ function my_calendar_save( $action,$output,$event_id=false ) {
408
  if ( empty($result) || empty($result[0]->event_id) ) {
409
  mc_delete_cache();
410
  // do an action using the event_id
411
- do_action( 'mc_delete_event', $event_id );
412
  $message = "<div class='updated'><p>".__('Event deleted successfully','my-calendar')."</p></div>";
413
  } else {
414
  $message = "<div class='error'><p><strong>".__('Error','my-calendar').":</strong>".__('Despite issuing a request to delete, the event still remains in the database. Please investigate.','my-calendar')."</p></div>";
@@ -416,17 +583,17 @@ function my_calendar_save( $action,$output,$event_id=false ) {
416
  }
417
  }
418
  $message = $message ."\n". $output[3];
419
- return $message;
420
  }
421
 
422
- function jd_acquire_form_data($event_id=false) {
423
  global $wpdb,$users_entries;
424
  $mcdb = $wpdb;
425
  if ( $event_id !== false ) {
426
  if ( intval($event_id) != $event_id ) {
427
  return "<div class=\"error\"><p>".__('Sorry! That\'s an invalid event key.','my-calendar')."</p></div>";
428
  } else {
429
- $data = $mcdb->get_results("SELECT * FROM " . my_calendar_table() . " WHERE event_id='" . (int) $event_id . "' LIMIT 1");
430
  if ( empty($data) ) {
431
  return "<div class=\"error\"><p>".__("Sorry! We couldn't find an event with that ID.",'my-calendar')."</p></div>";
432
  }
@@ -444,21 +611,21 @@ global $wpdb,$users_entries;
444
  }
445
 
446
  // The event edit form for the manage events admin page
447
- function jd_events_edit_form($mode='add', $event_id=false) {
448
  global $wpdb,$users_entries,$output;
449
  $mcdb = $wpdb;
450
  if ($event_id != false) {
451
- $data = jd_acquire_form_data($event_id);
452
  } else {
453
  $data = $users_entries;
454
  }
455
- if ( is_object($data) && $data->event_approved != 1 && $mode == 'edit' ) {
456
  $message = __('This event must be approved in order for it to appear on the calendar.','my-calendar');
457
  } else {
458
  $message = "";
459
  }
460
  echo ($message != '')?"<div class='error'><p>$message</p></div>":'';
461
- my_calendar_print_form_fields($data,$mode,$event_id);
462
  }
463
 
464
  function mc_get_instance_data( $instance_id ) {
@@ -469,33 +636,223 @@ function mc_get_instance_data( $instance_id ) {
469
  }
470
 
471
  function mc_show_edit_block( $field ) {
472
- $admin = (get_option('mc_input_options_administrators')=='true' && current_user_can('manage_options'))?true:false;
473
  $input = get_option('mc_input_options');
474
  $user = get_current_user_id();
475
  $screen = get_current_screen();
476
  $option = $screen->get_option('mc_show_on_page', 'option');
477
- $show = get_user_meta($user, $option, true);
478
  if ( empty ( $show) || $show < 1 ) {
479
- $show = $screen->get_option( 'mc_show_on_page', 'default' );
 
 
 
 
480
  }
481
  if ( $admin ) {
482
- if ( $show[$field] == 'on' ) { return true; } else { return false; }
483
  } else {
484
- if ( !isset($input[$field]) ) { return true; } // if this doesn't exist, leave it on
485
- if ( $input[$field] == 'off' || $input[$field] == '' ) { return false; } else if ( $show[$field] == 'off' ) { return false; } else { return true; }
486
  }
487
  return true;
488
  }
489
 
490
- function my_calendar_print_form_fields( $data,$mode,$event_id ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
491
  global $wpdb, $user_ID;
492
  $mcdb = $wpdb;
493
  $has_data = ( empty($data) ) ? false : true;
494
  $warning = '';
495
  if ( $data ) {
496
- if ( !( $data->event_recur == 'S' || $data->event_recur == 'S1' ) ) {
497
- $check = mc_increment_event( $data->event_id, array(), 'test' );
498
- if ( my_calendar_date_xcomp( $check['occur_begin'] , $data->event_end .' '.$data->event_endtime ) ) {
499
  $warning = "<div class='updated'><p>".__('This event ends after the next occurrence begins. Events must end <strong>before</strong> the next occurrence begins.','my-calendar')."</p><p>".sprintf( __('Event end date: <strong>%s %s</strong>. Next occurrence starts: <strong>%s</strong>','my-calendar'), $data->event_end, $data->event_endtime, $check['occur_begin'] )."</p></div>";
500
  echo $warning;
501
  }
@@ -505,18 +862,18 @@ function my_calendar_print_form_fields( $data,$mode,$event_id ) {
505
  if ( $instance ) { $ins = mc_get_instance_data( $instance ); $event_id = $ins->occur_event_id; $data = mc_get_event_core( $event_id );}
506
  ?>
507
 
508
- <div class="postbox-container" style="width: 70%">
509
  <div class="metabox-holder">
510
- <?php if ( $mode == 'add' || $mode == 'copy' ) { $edit_args = ''; } else {
511
  $edit_args = "&amp;mode=$mode&amp;event_id=$event_id";
512
  if ( $instance ) { $edit_args .= "&amp;date=$instance"; }
513
  }
514
  ?>
515
- <form id="my-calendar" method="post" action="<?php echo admin_url('admin.php?page=my-calendar').$edit_args; ?>">
516
  <div>
517
- <input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" />
518
- <?php if ( isset($_GET['ref']) ) { ?>
519
- <input type="hidden" name="ref" value="<?php echo esc_url($_GET['ref']); ?>" />
520
  <?php } ?>
521
  <input type="hidden" name="event_group_id" value="<?php if ( !empty( $data->event_group_id ) && $mode != 'copy' ) { echo $data->event_group_id; } else { echo mc_group_id(); } ?>" />
522
  <input type="hidden" name="event_action" value="<?php echo $mode; ?>" />
@@ -524,20 +881,40 @@ function my_calendar_print_form_fields( $data,$mode,$event_id ) {
524
  <input type="hidden" name="event_instance" value="<?php echo (int) $_GET['date']; ?>" />
525
  <?php } ?>
526
  <input type="hidden" name="event_id" value="<?php echo (int) $event_id; ?>" />
527
- <?php if ( $mode != 'edit' ) { ?>
528
- <input type="hidden" name="event_author" value="<?php echo $user_ID; ?>" />
529
- <?php } else { ?>
530
- <input type="hidden" name="event_author" value="<?php echo $data->event_author; ?>" />
531
  <?php } ?>
 
532
  <input type="hidden" name="event_nonce_name" value="<?php echo wp_create_nonce('event_nonce'); ?>" />
533
  </div>
534
 
535
  <div class="ui-sortable meta-box-sortables">
536
- <div class="postbox">
537
- <h3><?php _e('Add/Edit Event','my-calendar'); ?> <small>(<a href="<?php echo admin_url('admin.php?page=my-calendar-manage'); ?>"><?php _e('Edit events','my-calendar'); ?></a>)</small></h3>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
538
  <div class="inside">
539
- <?php
540
- if ( !empty( $_GET['date'] ) && $data->event_recur != 'S' ) {
541
  $event = mc_get_event( $instance );
542
  $date = date_i18n( get_option('mc_date_format'),strtotime( $event->occur_begin ) );
543
  $message = __("You are editing the <strong>$date</strong> instance of this event. Other instances of this event will not be changed.",'my-calendar');
@@ -548,122 +925,78 @@ function my_calendar_print_form_fields( $data,$mode,$event_id ) {
548
  }
549
  ?>
550
  <fieldset>
551
- <legend><?php _e('Enter your Event Information','my-calendar'); ?></legend>
552
  <p>
553
- <label for="event_title"><?php _e('Event Title','my-calendar'); ?> <span><?php _e('(required)','my-calendar'); ?></span></label><br /><input type="text" id="event_title" name="event_title" class="input" size="60" value="<?php if ( $has_data ) echo apply_filters( 'mc_manage_event_title',stripslashes(esc_attr($data->event_title)), $data ); ?>" />
554
- <?php if ( $mode == 'edit' ) { ?>
555
- <input type='hidden' name='prev_event_status' value='<?php echo $data->event_approved; ?>' />
556
- <?php if ( get_option( 'mc_event_approve' ) == 'true' ) { ?>
557
- <?php if ( current_user_can( 'mc_approve_events' ) ) { // Added by Roland P. ?>
558
- <input type="checkbox" value="1" id="event_approved" name="event_approved"<?php if ( $has_data && $data->event_approved == '1' ) { echo " checked=\"checked\""; } else if ( $has_data && $data->event_approved == '0' ) { echo ""; } else if ( get_option( 'mc_event_approve' ) == 'true' ) { echo "checked=\"checked\""; } ?> /> <label for="event_approved"><?php _e('Publish','my-calendar'); ?><?php if ($data->event_approved != 1) { ?> <small>[<?php _e('You must approve this event to promote it to the calendar.','my-calendar'); ?>]</small> <?php } ?></label>
559
- <?php } else { // case: editing, approval enabled, user cannot approve ?>
560
- <input type="hidden" value="0" name="event_approved" /><?php _e('An administrator must approve your new event.','my-calendar');
 
 
 
 
 
 
 
 
 
 
561
  }
562
- } else { // Case: editing, approval system is disabled - auto approve ?>
563
- <input type="hidden" value="1" name="event_approved" />
564
- <?php }
565
- } else { // case: adding new event (if use can, then 1, else 0) ?>
566
- <?php if ( get_option( 'mc_event_approve') != 'true' ) {
567
  $dvalue = 1;
568
- } else if ( current_user_can( 'mc_approve_events' ) ) { $dvalue = 1; } else { $dvalue = 0; } ?>
569
- <input type="hidden" value="<?php echo $dvalue; ?>" name="event_approved" />
570
- <?php } ?>
571
  </p>
572
  <?php if ( is_object($data) && $data->event_flagged == 1 ) { ?>
573
  <div class="error">
574
  <p>
575
- <input type="checkbox" value="0" id="event_flagged" name="event_flagged"<?php if ( $has_data && $data->event_flagged == '0' ) { echo " checked=\"checked\""; } else if ( $has_data && $data->event_flagged == '1' ) { echo ""; } ?> /> <label for="event_flagged"><?php _e('This event is not spam','my-calendar'); ?></label>
576
  </p>
577
  </div>
578
  <?php }
579
- if ( function_exists( 'jd_doTwitterAPIPost' ) && current_user_can ( 'wpt_can_tweet' ) ) { ?>
580
- <?php if ( !( $mode == 'edit' && $data->event_approved == 1 ) ) { ?>
581
  <p>
582
  <label for='mc_twitter'><?php _e('Post to Twitter (via WP to Twitter)','my-calendar'); ?></label><br />
583
  <textarea cols='70' rows='2' id='mc_twitter' name='mc_twitter'><?php do_action( 'mc_twitter_text', $data ); ?></textarea>
584
- </p>
585
- <?php } ?>
586
- <?php }
587
- if ( mc_show_edit_block( 'event_desc' ) ) { ?>
588
- <div class="event_description">
589
- <?php if ( $has_data ) { $description = $data->event_desc; } else { $description = ''; } ?>
590
- <label for="content"><?php _e('Event Description (<abbr title="hypertext markup language">HTML</abbr> allowed)','my-calendar'); ?></label><br />
591
- <?php
592
- if ( mc_show_edit_block( 'event_use_editor' ) ) {
593
- if ( version_compare( get_bloginfo( 'version' ) , '3.3' , '>=' ) ) {
594
- wp_editor( stripslashes($description), 'content', array( 'textarea_rows'=>10 ) );
595
- } else {
596
- the_editor( stripslashes($description) );
597
  }
598
- } else {
599
- ?><textarea id="content" name="content" class="event_desc" rows="5" cols="80"><?php echo stripslashes(esc_attr($description)); ?></textarea>
600
- <?php if ( mc_show_edit_block( 'event_use_editor' ) ) { ?></div><?php }
601
- } ?>
602
- </div>
603
- <?php } ?>
604
- <?php if ( mc_show_edit_block( 'event_short' ) ) { ?>
605
- <p>
606
- <label for="event_short"><?php _e('Event Short Description (<abbr title="hypertext markup language">HTML</abbr> allowed)','my-calendar'); ?></label><br /><textarea id="event_short" name="event_short" class="input" rows="2" cols="80"><?php if ( $has_data ) echo stripslashes(esc_attr($data->event_short)); ?></textarea>
607
- </p>
608
- <?php } ?>
609
- <?php
610
- // If the editor is enabled, shouldn't display the image uploader.
611
- // It restricts use of the image uploader to a single image and forces it to be in
612
- // the event image field, rather than the event description.
613
- if ( mc_show_edit_block( 'event_image' ) ) { ?>
614
  <p>
615
- <?php if ( !empty($data->event_image) ) { ?>
616
- <div class="event_image"><img src="<?php if ( $has_data ) echo esc_attr($data->event_image); ?>" alt="" /></div>
617
- <?php } ?>
618
- <label for="event_image"><?php _e("Add an image:",'my-calendar'); ?></label> <input type="text" name="event_image" id="event_image" size="60" value="<?php if ( $has_data ) echo esc_attr($data->event_image); ?>" placeholder="http://yourdomain.com/image.jpg" />
619
- <?php if ( mc_show_edit_block( 'event_use_editor' ) ) { ?>
620
- <?php echo " "; _e('(URL to Event image)','my-calendar'); ?>
621
- <?php } else { ?>
622
- <input id="upload_image_button" type="button" class="button" value="<?php _e('Upload Image','my-calendar'); ?>" /><br /><?php _e('Include your image URL or upload an image.','my-calendar'); ?>
623
- <?php } ?>
624
- </p>
625
- <?php } else { ?>
626
- <div>
627
- <input type="hidden" name="event_image" value="<?php if ( $has_data ) echo esc_attr($data->event_image); ?>" />
628
- <?php if ( !empty($data->event_image) ) { ?>
629
- <div class="event_image"><img src="<?php echo esc_attr($data->event_image); ?>" alt="" /></div>
630
- <?php } ?>
631
- </div>
632
- <?php } ?>
633
- <p>
634
- <label for="event_host"><?php _e('Event Host','my-calendar'); ?></label>
635
- <select id="event_host" name="event_host">
636
- <?php
637
- // Grab all the categories and list them
638
- $users = my_calendar_getUsers();
639
- foreach($users as $u) {
640
- echo '<option value="'.$u->ID.'"';
641
  if ( is_object($data) && $data->event_host == $u->ID ) {
642
- echo ' selected="selected"';
643
- } else if( is_object($u) && $u->ID == $user_ID && empty($data->event_host) ) {
644
- echo ' selected="selected"';
 
 
645
  }
646
- $display_name = ( $u->display_name == '' ) ? $u->user_nicename : $u->display_name;
647
- echo ">$display_name</option>\n";
648
- }
649
- ?>
650
- </select>
651
- </p>
652
- <?php if ( mc_show_edit_block( 'event_category' ) ) { ?>
653
- <p>
654
- <label for="event_category"><?php _e('Event Category','my-calendar'); ?></label>
655
- <select id="event_category" name="event_category">
656
- <?php echo mc_category_select( $data ); ?>
657
  </select>
658
- </p>
659
- <?php } else { ?>
660
- <div><input type="hidden" name="event_category" value="<?php echo mc_category_select( $data, false ); ?>" /></div>
661
- <?php } ?>
662
- <?php if ( mc_show_edit_block( 'event_link' ) ) { ?>
663
- <p>
664
- <label for="event_link"><?php _e('Event Link (Optional)','my-calendar'); ?></label> <input type="text" id="event_link" name="event_link" class="input" size="40" value="<?php if ( $has_data ) { echo esc_url($data->event_link); } ?>" /> <input type="checkbox" value="1" id="event_link_expires" name="event_link_expires"<?php if ( $has_data && $data->event_link_expires == '1' ) { echo " checked=\"checked\""; } else if ( $has_data && $data->event_link_expires == '0' ) { echo ""; } else if ( get_option( 'mc_event_link_expires' ) == 'true' ) { echo " checked=\"checked\""; } ?> /> <label for="event_link_expires"><?php _e('Link will expire after event','my-calendar'); ?></label>
665
- </p>
666
- <?php } ?>
667
  </fieldset>
668
  </div>
669
  </div>
@@ -671,444 +1004,294 @@ function my_calendar_print_form_fields( $data,$mode,$event_id ) {
671
 
672
  <div class="ui-sortable meta-box-sortables">
673
  <div class="postbox">
674
- <h3><?php _e('Event Date and Time','my-calendar'); ?></h3>
675
  <div class="inside">
676
- <?php if ( is_object($data) ) { // information for rewriting recurring data ?>
677
  <input type="hidden" name="prev_event_begin" value="<?php echo $data->event_begin; ?>" />
678
  <input type="hidden" name="prev_event_time" value="<?php echo $data->event_time; ?>" />
679
  <input type="hidden" name="prev_event_end" value="<?php echo $data->event_end; ?>" />
680
  <input type="hidden" name="prev_event_endtime" value="<?php echo $data->event_endtime; ?>" />
681
  <?php } ?>
682
  <fieldset><legend><?php _e('Event Date and Time','my-calendar'); ?></legend>
683
- <div id="event_schedule">
684
- <div id="event1" class="clonedInput">
685
- <?php
686
- if ( $has_data ) {
687
- $event_begin = esc_attr($data->event_begin);
688
- $event_end = esc_attr($data->event_end);
689
- if ( !empty($_GET['date'] ) ) {
690
- $event = mc_get_event( $instance );
691
- $event_begin = date( 'Y-m-d', strtotime( $event->occur_begin ) );
692
- $event_end = date( 'Y-m-d', strtotime( $event->occur_end ) );
693
- }
694
- } else {
695
- $event_begin = date("Y-m-d");
696
- $event_end = '';
697
- }
698
- ?>
699
- <p>
700
- <label for="event_begin" id="eblabel"><?php _e('Start Date (YYYY-MM-DD)','my-calendar'); ?> <span><?php _e('(required)','my-calendar'); ?></span></label> <input type="text" id="event_begin" name="event_begin[]" class="event_begin calendar_input" size="11" value="<?php echo $event_begin; ?>" /> <label for="event_time"><?php _e('Time (hh:mm am/pm)','my-calendar'); ?></label> <input type="text" id="event_time" name="event_time[]" class="input" size="10" value="<?php
701
- if ( $has_data ) {
702
- echo ($data->event_time == "00:00:00" && $data->event_endtime == "00:00:00")?'':date("h:i a",strtotime($data->event_time));
703
- } else {
704
- echo date_i18n("h:i a",current_time('timestamp') );
705
- } ?>" /> <input type="checkbox" value="1" id="event_allday" name="event_allday"<?php if ( $has_data && ( $data->event_time == '00:00:00' && $data->event_endtime == '00:00:00' ) ) { echo " checked=\"checked\""; } ?> /> <label for="event_allday"><?php _e('All day event','my-calendar'); ?></label>
706
- </p>
707
- <p>
708
- <label for="event_end" id="eelabel"><?php _e('End Date (YYYY-MM-DD)','my-calendar'); ?> <small><?php _e('(optional)','my-calendar'); ?></small></label> <input type="text" name="event_end[]" id="event_end" class="event_end calendar_input" size="11" value="<?php echo $event_end; ?>" /> <label for="event_endtime"><?php _e('End Time (hh:mm am/pm)','my-calendar'); ?></label> <input type="text" id="event_endtime" name="event_endtime[]" class="input" size="10" value="<?php
709
- if ( $has_data ) {
710
- echo ($data->event_endtime == "00:00:00" && $data->event_time == "00:00:00")?'':date("h:i a",strtotime($data->event_endtime));
711
- } else {
712
- echo date_i18n( "h:i a",strtotime( "+1 hour" )+(60*60*get_option('gmt_offset') ) );
713
- }?>" /> <input type="checkbox" value="1" id="event_hide_end" name="event_hide_end"<?php if ( $has_data && $data->event_hide_end == '1' ) { echo " checked=\"checked\""; } ?> /> <label for="event_hide_end"><?php _e('Hide end time','my-calendar'); ?></label>
714
-
715
- </p>
716
  </div>
717
- <?php if ( $mode != 'edit' ) { ?>
718
- <p>
719
- <input type="checkbox" value="1" id="event_span" name="event_span"<?php if ( $has_data && $data->event_span == '1' ) { echo " checked=\"checked\""; } else if ( $has_data && $data->event_span == '0' ) { echo ""; } else if ( get_option( 'mc_event_span' ) == 'true' ) { echo " checked=\"checked\""; } ?> /> <label for="event_span"><?php _e('This is a multi-day event.','my-calendar'); ?></label>
720
  </p>
721
- <p class="note"><em><?php _e('Enter the beginning and ending dates/times for each occurrence of the event.','my-calendar'); ?> <?php _e('If this is a multi-day event, it creates a single event with multiple dates/times; otherwise it creates separate events for each occurrence.','my-calendar'); ?></em></p>
722
  <div>
723
  <input type="button" id="add_field" value="<?php _e('Add another occurrence','my-calendar'); ?>" class="button" />
724
  <input type="button" id="del_field" value="<?php _e('Remove last occurrence','my-calendar'); ?>" class="button" />
725
  </div>
726
  <?php } else { ?>
727
- <?php if ( $data->event_recur != 'S' ) { ?>
728
- <h4><?php _e('Dates for this event:','my-calendar'); ?></h4>
729
- <?php _e('Editing a single date of an event changes only that event. Editing the root event changes all events in the series.','my-calendar'); ?>
 
 
730
  <ul class="columns">
731
- <?php if ( isset($_GET['date']) ) { $date = (int) $_GET['date']; } else { $date = false; } ?>
732
  <?php echo mc_instance_list( $data->event_id, $date ); ?>
733
  </ul>
 
734
  <?php } ?>
735
  <?php if ( $data->event_group_id != 0 ) { ?>
736
  <?php
737
  $edit_group_url = admin_url('admin.php?page=my-calendar-groups&mode=edit&event_id='.$data->event_id.'&group_id='.$data->event_group_id);
738
  ?>
739
  <h4><?php _e('Related Events:','my-calendar'); ?> (<a href='<?php echo $edit_group_url; ?>'><?php _e('Edit group','my-calendar'); ?></a>)</h4>
 
740
  <ul class="columns">
741
  <?php mc_related_events( $data->event_group_id ); ?>
742
- </ul>
 
743
  <?php } ?>
 
744
  <?php } ?>
745
- <p>
746
- <?php _e('Current time difference from GMT is ','my-calendar'); echo get_option('gmt_offset'); _e(' hour(s)', 'my-calendar'); ?>
747
- </p>
748
- </div>
749
- </fieldset>
750
- <p>
751
- <input type="submit" name="save" class="button-primary" value="<?php _e('Save Event','my-calendar'); ?>" />
752
- </p>
753
- </div>
754
- </div>
755
- </div>
756
- <?php if ( ( mc_show_edit_block( 'event_recurs' ) ) && empty( $_GET['date'] ) ) { ?>
757
- <div class="ui-sortable meta-box-sortables">
758
- <div class="postbox">
759
- <h3><?php _e('Recurring Events','my-calendar'); ?></h3>
760
- <div class="inside">
761
- <?php if ( is_object($data) ) { // information for rewriting recurring data ?>
762
- <?php
763
- $event_recur = ( is_object($data) )?$data->event_recur:'';
764
- $recurs = str_split( $event_recur, 1 );
765
- $recur = $recurs[0];
766
- $every = ( isset($recurs[1]) )?$recurs[1]:1;
767
- if ( $every == 1 && $recur == 'B' ) { $every = 2; }
768
- ?>
769
- <input type="hidden" name="prev_event_repeats" value="<?php echo $data->event_repeats; ?>" />
770
- <input type="hidden" name="prev_event_recur" value="<?php echo $data->event_recur; ?>" />
771
- <?php } else {
772
- $recur = $every = false;
773
- } ?>
774
- <fieldset>
775
- <legend><?php _e('Recurring Events','my-calendar'); ?></legend>
776
- <?php if ( is_object($data) && $data->event_repeats != NULL ) { $repeats = $data->event_repeats; } else { $repeats = 0; } ?>
777
- <p>
778
- <label for="event_repeats"><?php _e('Repeats','my-calendar'); ?> <input type="text" name="event_repeats" aria-labelledby='event_repeats_label' id="event_repeats" class="input" size="1" value="<?php echo $repeats; ?>" /> <span id='event_repeats_label'><?php _e('times','my-calendar'); ?></span>, </label>
779
- <label for="event_every"><?php _e('every','my-calendar'); ?></label> <input type="number" name="event_every" id="event_every" class="input" size="1" min="1" max="9" maxlength="1" value="<?php echo (is_object($data))?$every:1; ?>" />
780
- <label for="event_recur" class='offscreen'><?php _e('Units','my-calendar'); ?></label> <select name="event_recur" class="input" id="event_recur">
781
- <?php echo mc_recur_options($recur); ?>
782
- </select><br />
783
- <?php _e('Your entry is the number of events after the first occurrence of the event: a recurrence of <em>2</em> means the event will happen three times.','my-calendar'); ?>
784
- </p>
785
- </fieldset>
786
- </div>
787
- </div>
788
- </div>
789
- <?php } else { ?>
790
- <div>
791
- <?php if ( is_object($data) ) { // information for rewriting recurring data ?>
792
- <input type="hidden" name="prev_event_repeats" value="<?php echo $data->event_repeats; ?>" />
793
- <input type="hidden" name="prev_event_recur" value="<?php echo $data->event_recur; ?>" />
794
- <?php } ?>
795
- <input type="hidden" name="event_repeats" value="0" />
796
- <input type="hidden" name="event_recur" value="S" />
797
- </div>
798
-
799
- <?php } ?>
800
-
801
- <?php if ( mc_show_edit_block( 'event_open' ) ) { ?>
802
- <div class="ui-sortable meta-box-sortables">
803
- <div class="postbox">
804
- <h3><?php _e('Event Registration Settings','my-calendar'); ?></h3>
805
- <div class="inside">
806
- <fieldset>
807
- <legend><?php _e('Event Registration','my-calendar'); ?></legend>
808
- <?php // need to add filters/actions to replace this. ?>
809
- <?php do_action( 'mc_event_registration', $has_data, $data ); ?>
810
- </fieldset>
811
- </div>
812
- </div>
813
- </div>
814
- <?php } else { ?>
815
- <div>
816
- <input type="hidden" name="event_open" value="2" />
817
  </div>
 
 
 
 
 
 
 
 
818
 
819
- <?php } ?>
820
-
821
- <?php if ( mc_show_edit_block( 'event_location' ) || mc_show_edit_block( 'event_location_dropdown' ) ) { ?>
822
 
823
- <div class="ui-sortable meta-box-sortables">
824
- <div class="postbox">
825
- <h3><?php _e('Event Location','my-calendar'); ?></h3>
826
- <div class="inside location_form">
827
- <fieldset>
828
- <legend><?php _e('Event Location','my-calendar'); ?></legend>
829
- <?php } ?>
830
- <?php if ( mc_show_edit_block( 'event_location_dropdown' ) ) { ?>
831
- <?php $locations = $mcdb->get_results("SELECT location_id,location_label FROM " . my_calendar_locations_table() . " ORDER BY location_label ASC");
832
- if ( !empty($locations) ) {
833
- ?>
834
- <p>
835
- <label for="location_preset"><?php _e('Choose a preset location:','my-calendar'); ?></label> <select name="location_preset" id="location_preset">
836
- <option value="none"> -- </option>
837
- <?php foreach ( $locations as $location ) {
838
- //if ( !empty($data) && $data->event_label == $location->location_label ) { $checked = ' selected="selected"'; } else { $checked = ''; }
839
- echo "<option value=\"".$location->location_id."\">".stripslashes($location->location_label)."</option>";
840
- } ?>
841
- </select>
842
- </p>
843
- <?php } else { ?>
844
- <input type="hidden" name="location_preset" value="none" />
845
- <p><a href="<?php echo admin_url('admin.php?page=my-calendar-locations'); ?>"><?php _e('Add recurring locations for later use.','my-calendar'); ?></a></p>
846
- <?php } ?>
847
- <?php } else { ?>
848
- <input type="hidden" name="location_preset" value="none" />
849
- <?php } ?>
850
- <?php if ( mc_show_edit_block( 'event_location' ) ) { ?>
851
- <p>
852
- <?php _e('All location fields are optional: <em>insufficient information may result in an inaccurate map</em>.','my-calendar'); ?>
853
- </p>
854
- <?php if ( current_user_can( 'mc_edit_locations' ) ) { ?><p><input type="checkbox" value="on" name="mc_copy_location" id="mc_copy_location" /> <label for="mc_copy_location"><?php _e('Copy this location into the locations table','my-calendar'); ?></label></p><?php } ?>
855
- <p>
856
- <label for="event_label"><?php _e('Name of Location (e.g. <em>Joe\'s Bar and Grill</em>)','my-calendar'); ?></label><br />
857
- <?php if ( mc_controlled_field( 'label' ) ) {
858
- if ( !empty( $data ) ) $cur_label = ( stripslashes( $data->event_label ) );
859
- echo mc_location_controller( 'label', $cur_label );
860
- } else { ?>
861
- <input type="text" id="event_label" name="event_label" class="input" size="40" value="<?php if ( $has_data ) esc_attr_e(stripslashes($data->event_label)); ?>" />
862
- <?php } ?>
863
- </p>
864
- <p>
865
- <label for="event_street"><?php _e('Street Address','my-calendar'); ?></label> <input type="text" id="event_street" name="event_street" class="input" size="40" value="<?php if ( $has_data ) esc_attr_e(stripslashes($data->event_street)); ?>" />
866
- </p>
867
- <p>
868
- <label for="event_street2"><?php _e('Street Address (2)','my-calendar'); ?></label> <input type="text" id="event_street2" name="event_street2" class="input" size="40" value="<?php if ( $has_data ) esc_attr_e(stripslashes($data->event_street2)); ?>" />
869
- </p>
870
- <p>
871
- <label for="event_phone"><?php _e('Phone','my-calendar'); ?></label> <input type="text" id="event_phone" name="event_phone" class="input" size="32" value="<?php if ( $has_data ) esc_attr_e(stripslashes($data->event_phone)); ?>" />
872
- </p>
873
- <p>
874
- <label for="event_city"><?php _e('City','my-calendar'); ?></label>
875
- <?php if ( mc_controlled_field( 'city' ) ) {
876
- if ( !empty( $data ) ) $cur_label = ( stripslashes( $data->event_city ) );
877
- echo mc_location_controller( 'city', $cur_label );
878
- } else { ?>
879
- <input type="text" id="event_city" name="event_city" class="input" size="40" value="<?php if ( $has_data ) esc_attr_e(stripslashes($data->event_city)); ?>" />
880
- <?php } ?>
881
- <label for="event_state"><?php _e('State/Province','my-calendar'); ?></label>
882
- <?php if ( mc_controlled_field( 'state' ) ) {
883
- if ( !empty( $data ) ) $cur_label = ( stripslashes( $data->event_state ) );
884
- echo mc_location_controller( 'state', $cur_label );
885
- } else { ?>
886
- <input type="text" id="event_state" name="event_state" class="input" size="10" value="<?php if ( $has_data ) esc_attr_e(stripslashes($data->event_state)); ?>" />
887
- <?php } ?>
888
- </p>
889
- <p>
890
- <label for="event_postcode"><?php _e('Postal Code','my-calendar'); ?></label>
891
- <?php if ( mc_controlled_field( 'postcode' ) ) {
892
- if ( !empty( $data ) ) $cur_label = ( stripslashes( $data->event_postcode ) );
893
- echo mc_location_controller( 'postcode', $cur_label );
894
- } else { ?>
895
- <input type="text" id="event_postcode" name="event_postcode" class="input" size="10" value="<?php if ( $has_data ) esc_attr_e(stripslashes($data->event_postcode)); ?>" />
896
- <?php } ?>
897
- <label for="event_region"><?php _e('Region','my-calendar'); ?></label>
898
- <?php if ( mc_controlled_field( 'region' ) ) {
899
- if ( !empty( $data ) ) $cur_label = ( stripslashes( $data->event_region ) );
900
- echo mc_location_controller( 'region', $cur_label );
901
  } else { ?>
902
- <input type="text" id="event_region" name="event_region" class="input" size="40" value="<?php if ( !empty( $data ) ) esc_attr_e(stripslashes($data->event_region)); ?>" />
903
- <?php } ?>
904
- </p>
905
- <p>
906
- <label for="event_country"><?php _e('Country','my-calendar'); ?></label>
907
- <?php if ( mc_controlled_field( 'country' ) ) {
908
- if ( !empty( $data ) ) $cur_label = ( stripslashes( $data->event_country ) );
909
- echo mc_location_controller( 'country', $cur_label );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
910
  } else { ?>
911
- <input type="text" id="event_country" name="event_country" class="input" size="10" value="<?php if ( $has_data ) esc_attr_e(stripslashes($data->event_country)); ?>" />
912
- <?php } ?>
913
- </p>
914
- <p>
915
- <label for="event_zoom"><?php _e('Initial Zoom','my-calendar'); ?></label>
916
- <select name="event_zoom" id="event_zoom">
917
- <option value="16"<?php if ( !empty( $data ) && ( $data->event_zoom == 16 ) ) { echo " selected=\"selected\""; } ?>><?php _e('Neighborhood','my-calendar'); ?></option>
918
- <option value="14"<?php if ( !empty( $data ) && ( $data->event_zoom == 14 ) ) { echo " selected=\"selected\""; } ?>><?php _e('Small City','my-calendar'); ?></option>
919
- <option value="12"<?php if ( !empty( $data ) && ( $data->event_zoom == 12 ) ) { echo " selected=\"selected\""; } ?>><?php _e('Large City','my-calendar'); ?></option>
920
- <option value="10"<?php if ( !empty( $data ) && ( $data->event_zoom == 10 ) ) { echo " selected=\"selected\""; } ?>><?php _e('Greater Metro Area','my-calendar'); ?></option>
921
- <option value="8"<?php if ( !empty( $data ) && ( $data->event_zoom == 8 ) ) { echo " selected=\"selected\""; } ?>><?php _e('State','my-calendar'); ?></option>
922
- <option value="6"<?php if ( !empty( $data ) && ( $data->event_zoom == 6 ) ) { echo " selected=\"selected\""; } ?>><?php _e('Region','my-calendar'); ?></option>
923
- </select>
924
- </p>
925
- <p>
926
- <label for="event_url"><?php _e('Location URL','my-calendar'); ?></label> <input type="text" id="event_url" name="event_url" class="input" size="40" value="<?php if ( !empty( $data ) ) esc_attr_e(stripslashes($data->event_url)); ?>" />
927
- </p>
928
- <fieldset>
929
- <legend><?php _e('GPS Coordinates (optional)','my-calendar'); ?></legend>
930
- <p>
931
- <?php _e('If you supply GPS coordinates for your location, they will be used in place of any other address information to provide your map link.','my-calendar'); ?>
932
- </p>
933
- <p>
934
- <label for="event_latitude"><?php _e('Latitude','my-calendar'); ?></label> <input type="text" id="event_latitude" name="event_latitude" class="input" size="10" value="<?php if ( !empty( $data ) ) esc_attr_e(stripslashes($data->event_latitude)); ?>" /> <label for="event_longitude"><?php _e('Longitude','my-calendar'); ?></label> <input type="text" id="event_longitude" name="event_longitude" class="input" size="10" value="<?php if ( !empty( $data ) ) esc_attr_e(stripslashes($data->event_longitude)); ?>" />
935
- </p>
936
- </fieldset>
937
- <?php } else { ?>
938
- <div>
939
- <input type='hidden' name='event_label' value='<?php if ( !empty( $data ) ) esc_attr_e(stripslashes($data->event_label)); ?>' />
940
- <input type='hidden' name='event_street' value='<?php if ( !empty( $data ) ) esc_attr_e(stripslashes($data->event_street)); ?>' />
941
- <input type='hidden' name='event_street2' value='<?php if ( !empty( $data ) ) esc_attr_e(stripslashes($data->event_street2)); ?>' />
942
- <input type='hidden' name='event_phone' value='<?php if ( !empty( $data ) ) esc_attr_e(stripslashes($data->event_phone)); ?>' />
943
- <input type='hidden' name='event_city' value='<?php if ( !empty( $data ) ) esc_attr_e(stripslashes($data->event_city)); ?>' />
944
- <input type='hidden' name='event_state' value='<?php if ( !empty( $data ) ) esc_attr_e(stripslashes($data->event_state)); ?>' />
945
- <input type='hidden' name='event_postcode' value='<?php if ( !empty( $data ) ) esc_attr_e(stripslashes($data->event_postcode)); ?>' />
946
- <input type='hidden' name='event_region' value='<?php if ( !empty( $data ) ) esc_attr_e(stripslashes($data->event_region)); ?>' />
947
- <input type='hidden' name='event_country' value='<?php if ( !empty( $data ) ) esc_attr_e(stripslashes($data->event_country)); ?>' />
948
- <input type='hidden' name='event_zoom' value='<?php if ( !empty( $data ) ) esc_attr_e(stripslashes($data->event_zoom)); ?>' />
949
- <input type='hidden' name='event_url' value='<?php if ( !empty( $data ) ) esc_attr_e(stripslashes($data->event_url)); ?>' />
950
- <input type='hidden' name='event_latitude' value='<?php if ( !empty( $data ) ) esc_attr_e(stripslashes($data->event_latitude)); ?>' />
951
- <input type='hidden' name='event_longitude' value='<?php if ( !empty( $data ) ) esc_attr_e(stripslashes($data->event_longitude)); ?>' />
952
- </div>
953
- <?php } ?>
954
- <?php if ( mc_show_edit_block( 'event_location' ) || mc_show_edit_block( 'event_location_dropdown' ) ) { ?>
955
- </fieldset>
956
- </div>
957
- </div>
958
- </div>
959
- <?php } ?>
960
- <?php if ( mc_show_edit_block( 'event_specials' ) ) { ?>
961
- <div class="ui-sortable meta-box-sortables">
962
- <div class="postbox">
963
- <h3><?php _e('Special scheduling options','my-calendar'); ?></h3>
964
- <div class="inside">
965
- <fieldset>
966
- <legend><?php _e('Special Options','my-calendar'); ?></legend>
967
- <p>
968
- <label for="event_holiday"><?php _e('Cancel this event if it occurs on a date with an event in the Holidays category','my-calendar'); ?></label> <input type="checkbox" value="true" id="event_holiday" name="event_holiday"<?php if ( $has_data && $data->event_holiday == '1' ) { echo " checked=\"checked\""; } else if ( $has_data && $data->event_holiday == '0' ) { echo ""; } else if ( get_option( 'mc_skip_holidays' ) == 'true' ) { echo " checked=\"checked\""; } ?> />
969
- </p>
970
- <p>
971
- <label for="event_fifth_week"><?php _e('If this event recurs, and falls on the 5th week of the month in a month with only four weeks, move it back one week.','my-calendar'); ?></label> <input type="checkbox" value="true" id="event_fifth_week" name="event_fifth_week"<?php if ( $has_data && $data->event_fifth_week == '1' ) { echo " checked=\"checked\""; } else if ( $has_data && $data->event_fifth_week == '0' ) { echo ""; } else if ( get_option( 'mc_no_fifth_week' ) == 'true' ) { echo " checked=\"checked\""; } ?> />
972
- </p>
973
- </fieldset>
974
- </div>
975
- </div>
976
- </div>
977
- <?php } else { ?>
978
  <div>
979
- <input type="hidden" name="event_holiday" value="true"<?php if ( get_option( 'mc_skip_holidays' ) == 'true' ) { echo " checked=\"checked\""; } ?> />
980
- <input type="hidden" name="event_fifth_week" value="true"<?php if ( get_option( 'mc_no_fifth_week' ) == 'true' ) { echo " checked=\"checked\""; } ?>/>
981
- </div>
982
- <?php } ?>
983
  <p>
984
- <input type="submit" name="save" class="button-secondary" value="<?php _e('Save Event','my-calendar'); ?>" />
985
  </p>
986
- </form>
987
- </div>
988
- </div>
 
989
 
990
- <?php }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
991
 
992
  // Used on the manage events admin page to display a list of events
993
- function jd_events_display_list( $type='normal' ) {
994
  global $wpdb;
995
  $mcdb = $wpdb;
996
- if ( current_user_can('mc_approve_events') || current_user_can('mc_manage_events') ) {
997
  $sortby = ( isset( $_GET['sort'] ) )?(int) $_GET['sort']:get_option('mc_default_sort');
998
 
999
  if ( isset( $_GET['order'] ) ) {
1000
- $sortdir = ( isset($_GET['order']) && $_GET['order'] == 'ASC' )?'ASC':'default';
1001
  } else {
1002
  $sortdir = 'default';
1003
  }
1004
-
1005
- if ( empty($sortby) ) {
1006
- $sortbyvalue = 'event_begin';
1007
- } else {
1008
- switch ($sortby) {
1009
- case 1:$sortbyvalue = 'event_ID';break;
1010
- case 2:$sortbyvalue = 'event_title';break;
1011
- case 3:$sortbyvalue = 'event_desc';break;
1012
- case 4:$sortbyvalue = 'event_begin';break;
1013
- case 5:$sortbyvalue = 'event_author';break;
1014
- case 6:$sortbyvalue = 'event_category';break;
1015
- case 7:$sortbyvalue = 'event_label';break;
1016
- default:$sortbyvalue = 'event_begin';
1017
  }
1018
- }
1019
- $sortbydirection = ($sortdir == 'default')?'DESC':$sortdir;
1020
- $sorting = ($sortbydirection == 'DESC')?"&amp;order=ASC":'';
1021
-
1022
- $status = ( isset($_GET['limit']) )?$_GET['limit']:'all';
1023
- $restrict = ( isset( $_GET['restrict'] ) )?$_GET['restrict']:'all';
1024
- switch ($status) {
1025
- case 'all':$limit = '';break;
1026
- case 'reserved':$limit = 'WHERE event_approved <> 1';break;
1027
- case 'published':$limit = 'WHERE event_approved = 1';break;
1028
- default:$limit = '';
1029
- }
1030
- switch ( $restrict ) {
1031
- case 'all':$filter='';break;
1032
- case 'where':$filter =( isset( $_GET['filter'] ) )?$_GET['filter']:''; $restrict = "event_label"; break;
1033
- case 'author':$filter =( isset( $_GET['filter'] ) )?(int) $_GET['filter']:''; $restrict = "event_author"; break;
1034
- case 'category':$filter =( isset( $_GET['filter'] ) )?(int) $_GET['filter']:''; $restrict = "event_category"; break;
1035
- case 'flagged':$filter = ( isset( $_GET['filter'] ) )?(int) $_GET['filter']:''; $restrict = "event_flagged"; break;
1036
- default:$filter='';
1037
- }
1038
- $filter = esc_sql(urldecode($filter));
1039
- if ( $restrict == "event_label" ) { $filter = "'$filter'"; }
1040
- if ( $limit == '' && $filter != '' ) {
1041
- $limit = "WHERE $restrict = $filter";
1042
- } else if ( $limit != '' && $filter != '' ) {
1043
- $limit .= "AND $restrict = $filter";
1044
- }
1045
- if ( $filter == '' ) { $filtered = ""; } else { $filtered = "<a href='".admin_url('admin.php?page=my-calendar-manage')."'>".__('Clear filters','my-calendar')."</a>"; }
1046
- $current = empty($_GET['paged']) ? 1 : intval($_GET['paged']);
1047
-
1048
- $user = get_current_user_id();
1049
- $screen = get_current_screen();
1050
- $option = $screen->get_option('per_page', 'option');
1051
- $items_per_page = get_user_meta($user, $option, true);
1052
- if ( empty( $items_per_page ) || $items_per_page < 1 ) {
1053
- $items_per_page = $screen->get_option( 'per_page', 'default' );
1054
- }
1055
- if ( $limit == '' ) {
1056
- $flagged = ( $restrict != 'event_flagged' )?" WHERE event_flagged = 0":'';
1057
- } else {
1058
- $flagged = ( $restrict != 'event_flagged' )?" AND event_flagged = 0":'';
1059
- }
1060
- $events = $mcdb->get_results("SELECT SQL_CALC_FOUND_ROWS * FROM " . my_calendar_table() . " $limit $flagged ORDER BY $sortbyvalue $sortbydirection LIMIT ".(($current-1)*$items_per_page).", ".$items_per_page );
1061
- $found_rows = $wpdb->get_col("SELECT FOUND_ROWS();");
1062
- $items = $found_rows[0];
1063
- ?>
1064
- <?php if ( function_exists( 'akismet_http_post' ) || function_exists( 'bs_checker' ) ) { ?>
1065
- <ul class="links">
1066
- <li><a <?php echo ( isset($_GET['restrict']) && $_GET['restrict']=='flagged')?' class="active-link"':''; ?> href="<?php echo admin_url('admin.php?page=my-calendar-manage&amp;restrict=flagged&amp;filter=1'); ?>"><?php _e('Spam','my-calendar'); ?></a></li>
1067
- </ul>
1068
- <?php } ?>
1069
- <?php if ( get_option('mc_event_approve') == 'true' ) { ?>
1070
- <ul class="links">
1071
- <li><a <?php echo ( isset($_GET['limit']) && $_GET['limit']=='published' )?' class="active-link"':''; ?> href="<?php echo admin_url('admin.php?page=my-calendar-manage&amp;limit=published'); ?>"><?php _e('Published','my-calendar'); ?></a></li>
1072
- <li><a <?php echo ( isset($_GET['limit']) && $_GET['limit']=='reserved')?' class="active-link"':''; ?> href="<?php echo admin_url('admin.php?page=my-calendar-manage&amp;limit=reserved'); ?>"><?php _e('Reserved','my-calendar'); ?></a></li>
1073
- <li><a <?php echo ( isset($_GET['limit']) && $_GET['limit']=='all' || !isset($_GET['limit']))?' class="active-link"':''; ?> href="<?php echo admin_url('admin.php?page=my-calendar-manage&amp;limit=all'); ?>"><?php _e('All','my-calendar'); ?></a></li>
1074
- </ul>
1075
- <?php } ?>
1076
-
1077
- <?php echo $filtered; ?>
1078
- <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1079
  $num_pages = ceil($items / $items_per_page);
1080
  if ( $num_pages > 1 ) {
1081
  $page_links = paginate_links( array(
1082
- 'base' => add_query_arg( 'paged', '%#%' ),
1083
- 'format' => '',
1084
- 'prev_text' => __('&laquo; Previous Page','my-calendar'),
1085
- 'next_text' => __('Next Page &raquo;','my-calendar'),
1086
- 'total' => $num_pages,
1087
- 'current' => $current
 
1088
  ));
1089
- echo "<div class='tablenav'>";
1090
- echo "<div class='tablenav-pages'>";
1091
- echo $page_links;
1092
- echo "</div>";
1093
- echo "</div>";
1094
  }
1095
- ?>
1096
- <?php
1097
- if ( !empty($events) ) {
1098
  ?>
1099
- <form action="<?php echo admin_url('admin.php?page=my-calendar-manage'); ?>" method="post">
1100
  <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div>
1101
- <div style="clear:left">
1102
- <input type="submit" class="button-secondary delete" name="mass_delete" value="<?php _e('Delete checked events','my-calendar'); ?>" />
1103
  <?php if ( current_user_can('mc_approve_events') ) { ?>
1104
- <input type="submit" class="button-secondary mc-approve" name="mass_approve" value="<?php _e('Approve checked events','my-calendar'); ?>" />
 
 
 
1105
  <?php } ?>
1106
  </div>
1107
 
1108
  <table class="widefat wp-list-table" id="my-calendar-admin-table">
1109
  <thead>
1110
  <tr>
1111
- <th scope="col" style="width: 50px;"><input type='checkbox' class='selectall' id='mass_edit' /> <label for='mass_edit'><b><?php __('Check/Uncheck all','my-calendar'); ?></b></label> <a href="<?php echo admin_url("admin.php?page=my-calendar-manage&amp;sort=1$sorting"); ?>"><?php _e('ID','my-calendar') ?></a></th>
1112
  <th scope="col"><a href="<?php echo admin_url("admin.php?page=my-calendar-manage&amp;sort=2$sorting"); ?>"><?php _e('Title','my-calendar') ?></a></th>
1113
  <th scope="col"><a href="<?php echo admin_url("admin.php?page=my-calendar-manage&amp;sort=7$sorting"); ?>"><?php _e('Location','my-calendar') ?></a></th>
1114
  <th scope="col"><a href="<?php echo admin_url("admin.php?page=my-calendar-manage&amp;sort=4$sorting"); ?>"><?php _e('Date/Time','my-calendar') ?></a></th>
@@ -1123,29 +1306,30 @@ function jd_events_display_list( $type='normal' ) {
1123
 
1124
  foreach ( array_keys($events) as $key ) {
1125
  $event =& $events[$key];
1126
- $class = ($class == 'alternate') ? '' : 'alternate';
1127
- $pending = ($event->event_approved == 0) ? ' pending' : '';
1128
  $author = ( $event->event_author != 0 )?get_userdata($event->event_author):'Public Submitter';
1129
  $title = $event->event_title;
1130
 
1131
- if ( $event->event_flagged == 1 && ( isset( $_GET['restrict'] ) && $_GET['restrict'] == 'flagged' ) ) {
1132
- $spam = ' spam';
1133
  $pending = '';
1134
  $spam_label = '<strong>'.__('Possible spam','my-calendar').':</strong> ';
1135
  } else {
1136
  $spam = '';
1137
  $spam_label = '';
1138
  }
 
1139
  ?>
1140
  <tr class="<?php echo "$class $spam $pending"; ?>">
1141
- <th scope="row"><input type="checkbox" value="<?php echo $event->event_id; ?>" name="mass_edit[]" id="mc<?php echo $event->event_id; ?>" <?php echo ($event->event_flagged == 1)?' checked="checked"':''; ?> /> <label for="mc<?php echo $event->event_id; ?>"><?php echo $event->event_id; ?></label></th>
1142
  <td title="<?php echo esc_attr(substr(strip_tags(stripslashes($event->event_desc)),0,240)); ?>">
1143
  <strong><?php if ( mc_can_edit_event( $event->event_author ) ) { ?>
1144
  <a href="<?php echo admin_url("admin.php?page=my-calendar&amp;mode=edit&amp;event_id=$event->event_id"); ?>" class='edit'>
1145
  <?php } ?>
1146
  <?php echo $spam_label; echo stripslashes($title); ?>
1147
  <?php if ( mc_can_edit_event( $event->event_author ) ) { echo "</a>"; } ?></strong>
1148
- <div class='row-actions' style="visibility:visible;">
1149
  <a href="<?php echo admin_url("admin.php?page=my-calendar&amp;mode=copy&amp;event_id=$event->event_id"); ?>" class='copy'><?php _e('Copy','my-calendar'); ?></a> |
1150
  <?php if ( mc_can_edit_event( $event->event_author ) ) { ?>
1151
  <a href="<?php echo admin_url("admin.php?page=my-calendar&amp;mode=edit&amp;event_id=$event->event_id"); ?>" class='edit'><?php _e('Edit','my-calendar'); ?></a> <?php if ( mc_event_is_grouped( $event->event_group_id ) ) { ?>
@@ -1153,10 +1337,10 @@ function jd_events_display_list( $type='normal' ) {
1153
  <?php } ?>
1154
  | <a href="<?php echo admin_url("admin.php?page=my-calendar-manage&amp;mode=delete&amp;event_id=$event->event_id"); ?>" class="delete"><?php _e('Delete','my-calendar'); ?></a>
1155
  <?php } else { _e("Not editable.",'my-calendar'); } ?>
1156
- <?php if ( get_option( 'mc_event_approve' ) == 'true' ) { ?>
1157
  |
1158
- <?php if ( current_user_can( 'mc_approve_events' ) ) { // Added by Roland P.?>
1159
- <?php if ( $event->event_approved == '1' ) { $mo = 'reject'; $te = __('Reject','my-calendar'); } else { $mo = 'publish'; $te = __('Approve','my-calendar'); } ?>
1160
  <a href="<?php echo admin_url("admin.php?page=my-calendar-manage&amp;mode=$mo&amp;event_id=$event->event_id"); ?>" class='<?php echo $mo; ?>'><?php echo $te; ?></a>
1161
  <?php
1162
  } else {
@@ -1169,7 +1353,7 @@ function jd_events_display_list( $type='normal' ) {
1169
  } ?>
1170
  </div>
1171
  </td>
1172
- <td><?php if ( $event->event_label != '' ) { ?><a class='mc_filter' href='<?php $elabel = urlencode($event->event_label); echo admin_url("admin.php?page=my-calendar-manage&amp;filter=$elabel&amp;restrict=where"); ?>' title="<?php _e('Filter by location','my-calendar'); ?>"><span><?php _e('Show only: ', 'my-calendar' ); ?></span><?php echo stripslashes($event->event_label); ?></a><?php } ?></td>
1173
  <?php if ($event->event_time != "00:00:00") { $eventTime = date_i18n(get_option('mc_time_format'), strtotime($event->event_time)); } else { $eventTime = get_option('mc_notime_text'); } ?>
1174
  <td><?php $begin = date_i18n( get_option('mc_date_format'), strtotime( $event->event_begin ) ); echo "$begin, $eventTime"; ?>
1175
  <div class="recurs">
@@ -1197,7 +1381,7 @@ function jd_events_display_list( $type='normal' ) {
1197
  ?>
1198
  </div>
1199
  </td>
1200
- <td><a class='mc_filter' href="<?php $auth = (is_object($author))?$author->ID:0; echo admin_url("admin.php?page=my-calendar-manage&amp;filter=$auth&amp;restrict=author"); ?>" title="<?php _e('Filter by author','my-calendar'); ?>"><span><?php _e('Show only: ', 'my-calendar' ); ?></span><?php echo ( is_object($author)?$author->display_name:$author ); ?></a></td>
1201
  <?php
1202
  $this_category = $event->event_category;
1203
  foreach ($categories as $key=>$value) {
@@ -1206,29 +1390,35 @@ function jd_events_display_list( $type='normal' ) {
1206
  }
1207
  }
1208
  ?>
1209
- <td><div class="category-color" style="background-color:<?php echo (strpos($this_cat->category_color,'#') !== 0)?'#':''; echo $this_cat->category_color;?>;"> </div> <a class='mc_filter' href='<?php echo admin_url("admin.php?page=my-calendar-manage&amp;filter=$event->event_category&amp;restrict=category"); ?>' title="<?php _e('Filter by category','my-calendar'); ?>"><span><?php _e('Show only: ', 'my-calendar' ); ?></span><?php echo stripslashes($this_cat->category_name); ?></a></td>
1210
  <?php unset($this_cat); ?>
1211
  </tr>
1212
  <?php
 
1213
  }
1214
  ?>
1215
  </table>
1216
  <p>
1217
- <input type="submit" class="button-secondary delete" name="mass_delete" value="<?php _e('Delete checked events','my-calendar'); ?>" />
1218
  <?php if ( current_user_can('mc_approve_events') ) { ?>
1219
- <input type="submit" class="button-secondary mc-approve" name="mass_approve" value="<?php _e('Approve checked events','my-calendar'); ?>" />
 
 
 
 
 
 
 
 
 
 
1220
  <?php } ?>
1221
  </p>
1222
  </form>
1223
  <?php
1224
- /* LATER
1225
- if ( get_option('mc_admin_calendar') == 'on' ) {
1226
- echo do_shortcode("[my_calendar]");
1227
  }
1228
- */
1229
- } else { ?>
1230
- <p><?php _e("There are no events in the database meeting your current criteria.",'my-calendar') ?></p><?php
1231
- }
1232
  }
1233
  }
1234
 
@@ -1236,16 +1426,13 @@ function mc_check_data( $action, $post, $i ) {
1236
  $post = apply_filters( 'mc_pre_checkdata', $post, $action, $i );
1237
  global $wpdb, $current_user, $users_entries;
1238
  $mcdb = $wpdb;
1239
- $start_date_ok = $end_date_ok = $time_ok = $endtime_ok = $url_ok = $title_ok = $recurring_ok = 0;
1240
- $proceed = true;
1241
  $submit=array();
1242
-
 
1243
  if ( get_magic_quotes_gpc() ) { $post = array_map( 'stripslashes_deep', $post ); }
 
1244
 
1245
- if (!wp_verify_nonce($post['event_nonce_name'],'event_nonce')) { return; }
1246
-
1247
- $errors = "";
1248
- if ( $action == 'add' || $action == 'edit' || $action == 'copy' ) {
1249
  $title = !empty($post['event_title']) ? trim($post['event_title']) : '';
1250
  $desc = !empty($post['content']) ? trim($post['content']) : '';
1251
  $short = !empty($post['event_short']) ? trim($post['event_short']) : '';
@@ -1253,9 +1440,9 @@ function mc_check_data( $action, $post, $i ) {
1253
  $every = !empty($post['event_every']) ? (int) $post['event_every'] : 1;
1254
  // if this is an all weekdays event, and it's been scheduled to start on a weekend, the math gets nasty.
1255
  // ...AND there's no reason to allow it, since weekday events will NEVER happen on the weekend.
1256
- $begin = trim($post['event_begin'][$i]);
1257
- $end = trim($post['event_end'][$i]);
1258
- if ( $recur == 'E' && ( date( 'w', strtotime( $begin ) ) == 0 || date( 'w', strtotime( $begin ) ) == 6 ) ) {
1259
  if ( date( 'w', strtotime( $begin ) ) == 0 ) {
1260
  $newbegin = my_calendar_add_date( $begin, 1 );
1261
  if ( !empty( $post['event_end'][$i] ) ) {
@@ -1278,34 +1465,41 @@ function mc_check_data( $action, $post, $i ) {
1278
  $end = !empty($post['event_end'][$i]) ? trim($post['event_end'][$i]) : $begin;
1279
  }
1280
 
1281
- $begin = date( 'Y-m-d',strtotime($begin) );// regardless of entry format, convert.
1282
- $end = date( 'Y-m-d',strtotime($end) );// regardless of entry format, convert.
1283
  $time = !empty($post['event_time'][$i]) ? trim($post['event_time'][$i]) : '';
1284
- $endtime = !empty($post['event_endtime'][$i]) ? trim($post['event_endtime'][$i]) : date('H:i:s',strtotime( $time . ' +1 hour' ) );
1285
- $endtime = ( $time == '' || $time == '00:00:00' )?'00:00:00':$endtime; // set at midnight if all day.
1286
- if ( isset($post['event_allday']) ) { $time = $endtime = '00:00:00'; }
1287
- $repeats = ( !empty($post['event_repeats']) || trim($post['event_repeats'])=='' ) ? trim($post['event_repeats']) : 0;
 
 
 
 
 
 
1288
  $host = !empty($post['event_host']) ? $post['event_host'] : $current_user->ID;
1289
  $category = !empty($post['event_category']) ? $post['event_category'] : '';
1290
- $linky = !empty($post['event_link']) ? trim($post['event_link']) : '';
1291
  $expires = !empty($post['event_link_expires']) ? $post['event_link_expires'] : '0';
1292
  $approved = !empty($post['event_approved']) ? $post['event_approved'] : '0';
1293
  $location_preset = !empty($post['location_preset']) ? $post['location_preset'] : '';
1294
  $event_author = !empty($post['event_author']) ? $post['event_author'] : $current_user->ID;
1295
  $event_open = (isset($post['event_open']) && $post['event_open']!==0) ? $post['event_open'] : '2';
 
 
1296
  $event_group = !empty($post['event_group']) ? 1 : 0;
1297
  $event_flagged = ( !isset($post['event_flagged']) || $post['event_flagged']===0 )?0:1;
1298
  $event_image = ( isset($post['event_image']) )?esc_url_raw( $post['event_image'] ):'';
1299
  $event_fifth_week = !empty($post['event_fifth_week']) ? 1 : 0;
1300
  $event_holiday = !empty($post['event_holiday']) ? 1 : 0;
1301
  // get group id: if multiple events submitted, auto group OR if event being submitted is already part of a group; otherwise zero.
1302
- $group_id_submitted = (int) $post['event_group_id'];
1303
  $event_group_id = ( ( is_array($post['event_begin']) && count($post['event_begin'])>1 ) || mc_event_is_grouped( $group_id_submitted) )?$group_id_submitted:0;
1304
- $event_span = (!empty($post['event_span']) && $event_group_id != 0 ) ? 1 : 0;
1305
- $event_hide_end = (!empty($post['event_hide_end']) ) ? 1 : 0;
1306
- $event_hide_end = ( $time == '' || $time == '00:00:00' )?1:$event_hide_end; // hide end time automatically on all day events
1307
  // set location
1308
- if ( $location_preset != 'none' ) {
1309
  $sql = "SELECT * FROM " . my_calendar_locations_table() . " WHERE location_id = $location_preset";
1310
  $location = $mcdb->get_row($sql);
1311
  $event_label = $location->location_label;
@@ -1316,11 +1510,13 @@ function mc_check_data( $action, $post, $i ) {
1316
  $event_postcode = $location->location_postcode;
1317
  $event_region = $location->location_region;
1318
  $event_country = $location->location_country;
1319
- $event_url = $location->location_url;
1320
  $event_longitude = $location->location_longitude;
1321
  $event_latitude = $location->location_latitude;
1322
  $event_zoom = $location->location_zoom;
1323
  $event_phone = $location->location_phone;
 
 
1324
  } else {
1325
  $event_label = !empty($post['event_label']) ? $post['event_label'] : '';
1326
  $event_street = !empty($post['event_street']) ? $post['event_street'] : '';
@@ -1335,7 +1531,10 @@ function mc_check_data( $action, $post, $i ) {
1335
  $event_latitude = !empty($post['event_latitude']) ? $post['event_latitude'] : '';
1336
  $event_zoom = !empty($post['event_zoom']) ? $post['event_zoom'] : '';
1337
  $event_phone = !empty($post['event_phone'])? $post['event_phone'] : '';
1338
- if ( isset($post['mc_copy_location']) && $post['mc_copy_location'] == 'on' ) {
 
 
 
1339
  $add_loc = array(
1340
  'location_label'=>$event_label,
1341
  'location_street'=>$event_street,
@@ -1349,28 +1548,18 @@ function mc_check_data( $action, $post, $i ) {
1349
  'location_longitude'=>$event_longitude,
1350
  'location_latitude'=>$event_latitude,
1351
  'location_zoom'=>$event_zoom,
1352
- 'location_phone'=>$event_phone
 
 
1353
  );
1354
- $loc_formats = array( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%f', '%f', '%d', '%s' );
1355
  $results = $mcdb->insert( my_calendar_locations_table(), $add_loc, $loc_formats );
1356
  }
1357
  }
1358
- // Perform some validation on the submitted dates - this checks for valid years and months
1359
- // We know we have a valid year and month and valid integers for days so now we do a final check on the date
1360
- $begin_split = explode('-',$begin);
1361
- $begin_y = $begin_split[0];
1362
- $begin_m = $begin_split[1];
1363
- $begin_d = $begin_split[2];
1364
- $end_split = explode('-',$end);
1365
- $end_y = $end_split[0];
1366
- $end_m = $end_split[1];
1367
- $end_d = $end_split[2];
1368
- if (checkdate($begin_m,$begin_d,$begin_y) && checkdate($end_m,$end_d,$end_y)) {
1369
- // Ok, now we know we have valid dates, we want to make sure that they are either equal or that the end date is later than the start date
1370
- if (strtotime($end) >= strtotime($begin)) {
1371
- $start_date_ok = 1;
1372
- $end_date_ok = 1;
1373
- } else {
1374
  $errors .= "<div class='error'><p><strong>".__('Error','my-calendar').":</strong> ".__('Your event end date must be either after or the same as your event begin date','my-calendar')."</p></div>";
1375
  }
1376
  } else {
@@ -1378,40 +1567,33 @@ function mc_check_data( $action, $post, $i ) {
1378
  }
1379
 
1380
  // We check for a valid time, or an empty one
1381
- $time = ($time == '')?'00:00:00':date( 'H:i:00',strtotime($time) );
1382
  $time_format_one = '/^([0-1][0-9]):([0-5][0-9]):([0-5][0-9])$/';
1383
  $time_format_two = '/^([2][0-3]):([0-5][0-9]):([0-5][0-9])$/';
1384
- if (preg_match($time_format_one,$time) || preg_match($time_format_two,$time) || $time == '') {
1385
- $time_ok = 1;
1386
  } else {
1387
- $errors .= "<div class='error'><p><strong>".__('Error','my-calendar').":</strong> ".__('The time field must either be blank or be entered in the format hh:mm am/pm','my-calendar')."</p></div>";
1388
  }
1389
  // We check for a valid end time, or an empty one
1390
- $endtime = ($endtime == '')?'00:00:00':date( 'H:i:00',strtotime($endtime) );
1391
- if (preg_match($time_format_one,$endtime) || preg_match($time_format_two,$endtime) || $endtime == '') {
1392
- $endtime_ok = 1;
1393
  } else {
1394
  $errors .= "<div class='error'><p><strong>".__('Error','my-calendar').":</strong> ".__('The end time field must either be blank or be entered in the format hh:mm am/pm','my-calendar')."</p></div>";
1395
  }
1396
- // We check to make sure the URL is acceptable (blank or starting with http://)
1397
- if ($linky == '') {
1398
- $url_ok = 1;
1399
- } else if ( preg_match('/^(http)(s?)(:)\/\//',$linky) ) {
1400
- $url_ok = 1;
1401
  } else {
1402
- $linky = "http://" . $linky;
1403
  }
1404
  }
1405
- // The title must be at least one character in length and no more than 255 - only basic punctuation is allowed
1406
  $title_length = strlen($title);
1407
  if ( $title_length >= 1 && $title_length <= 255 ) {
1408
- $title_ok = 1;
1409
  } else {
1410
- $errors .= "<div class='error'><p><strong>".__('Error','my-calendar').":</strong> ".__('The event title must be between 1 and 255 characters in length.','my-calendar')."</p></div>";
1411
  }
1412
- // We run some checks on recurrance
1413
- if (( $repeats == 0 && $recur == 'S' ) || (($repeats >= 0) && ($recur == 'W' || $recur == 'B' || $recur == 'M' || $recur == 'U' || $recur == 'Y' || $recur == 'D' || $recur == 'E' ))) {
1414
- $recurring_ok = 1;
1415
  $recur = $recur . $every;
1416
  } else {
1417
  $errors .= "<div class='error'><p><strong>".__('Error','my-calendar').":</strong> ".__('The repetition value must be 0 unless a type of recurrence is selected.','my-calendar')."</p></div>";
@@ -1420,11 +1602,14 @@ function mc_check_data( $action, $post, $i ) {
1420
  $conflicts = mcs_check_conflicts( $begin, $time, $end, $endtime, $event_label );
1421
  if ( $conflicts ) {
1422
  $errors .= "<div class='error'><p><strong>".__('Error','my-calendar').":</strong> ".__('That event conflicts with a previously scheduled event.','my-calendar')."</p></div>";
1423
- $proceed = false;
1424
  }
1425
- }
1426
- if ($start_date_ok == 1 && $end_date_ok == 1 && $time_ok == 1 && $endtime_ok == 1 && $url_ok == 1 && $title_ok == 1 && $recurring_ok == 1 && $proceed != false) {
1427
- $proceed = true;
 
 
 
 
1428
  $submit = array(
1429
  // strings
1430
  'event_begin'=>$begin,
@@ -1434,7 +1619,7 @@ function mc_check_data( $action, $post, $i ) {
1434
  'event_short'=>$short,
1435
  'event_time'=>$time,
1436
  'event_endtime'=>$endtime,
1437
- 'event_link'=>$linky,
1438
  'event_label'=>$event_label,
1439
  'event_street'=>$event_street,
1440
  'event_street2'=>$event_street2,
@@ -1447,6 +1632,10 @@ function mc_check_data( $action, $post, $i ) {
1447
  'event_recur'=>$recur,
1448
  'event_image'=>$event_image,
1449
  'event_phone'=>$event_phone,
 
 
 
 
1450
  // integers
1451
  'event_repeats'=>$repeats,
1452
  'event_author'=>$event_author,
@@ -1457,7 +1646,7 @@ function mc_check_data( $action, $post, $i ) {
1457
  'event_group'=>$event_group,
1458
  'event_approved'=>$approved,
1459
  'event_host'=>$host,
1460
- 'event_flagged'=> mc_spam( $linky, $desc, $post ),
1461
  'event_fifth_week'=>$event_fifth_week,
1462
  'event_holiday'=>$event_holiday,
1463
  'event_group_id'=>$event_group_id,
@@ -1468,7 +1657,9 @@ function mc_check_data( $action, $post, $i ) {
1468
  'event_latitude'=>$event_latitude
1469
  );
1470
  } else {
 
1471
  // The form is going to be rejected due to field validation issues, so we preserve the users entries here
 
1472
  $users_entries->event_title = $title;
1473
  $users_entries->event_desc = $desc;
1474
  $users_entries->event_begin = $begin;
@@ -1479,7 +1670,7 @@ function mc_check_data( $action, $post, $i ) {
1479
  $users_entries->event_repeats = $repeats;
1480
  $users_entries->event_host = $host;
1481
  $users_entries->event_category = $category;
1482
- $users_entries->event_link = $linky;
1483
  $users_entries->event_link_expires = $expires;
1484
  $users_entries->event_label = $event_label;
1485
  $users_entries->event_street = $event_street;
@@ -1494,6 +1685,7 @@ function mc_check_data( $action, $post, $i ) {
1494
  $users_entries->event_latitude = $event_latitude;
1495
  $users_entries->event_zoom = $event_zoom;
1496
  $users_entries->event_phone = $event_phone;
 
1497
  $users_entries->event_author = $event_author;
1498
  $users_entries->event_open = $event_open;
1499
  $users_entries->event_short = $short;
@@ -1506,28 +1698,26 @@ function mc_check_data( $action, $post, $i ) {
1506
  $users_entries->event_group_id = $event_group_id;
1507
  $users_entries->event_span = $event_span;
1508
  $users_entries->event_hide_end = $event_hide_end;
1509
- $proceed = false;
 
 
 
1510
  }
1511
- $data = array($proceed, $users_entries, $submit, $errors );
1512
-
1513
  return $data;
1514
  }
1515
 
1516
  function mcs_check_conflicts( $begin, $time, $end, $endtime, $event_label ) {
1517
  global $wpdb;
1518
- $select_location = ( $event_label != '' )?"event_label = '$event_label' AND":'';
1519
  $event_query = "SELECT occur_id
1520
  FROM " . MY_CALENDAR_EVENTS_TABLE . "
1521
  JOIN " . MY_CALENDAR_TABLE ."
1522
  ON (event_id=occur_event_id)
1523
  WHERE $select_location
1524
- ( occur_begin BETWEEN '$begin $time' AND '$end $endtime' OR occur_end BETWEEN '$begin $time' AND '$end $endtime' )";
1525
- $results = $wpdb->get_results($event_query);
1526
- if ( !empty($results) ) {
1527
- return $results;
1528
- } else {
1529
- return false;
1530
- }
1531
  }
1532
 
1533
  /* Event editing utilities */
@@ -1537,7 +1727,7 @@ function mc_compare( $update, $id ) {
1537
  //$comparison_test = array();
1538
  foreach ( $update as $k=>$v ) {
1539
  // event_recur and event_repeats always set to single and 0; event_begin and event_end need to be checked elsewhere.
1540
- if ( $k != 'event_recur' && $k != 'event_repeats' && $k != 'event_begin' && $k != 'event_end' ) {
1541
  $update_string .= trim($v);
1542
  $event_string .= trim($event->$k);
1543
  $v2 = $event->$k;
@@ -1558,12 +1748,12 @@ function mc_update_instance( $event_instance, $event_id, $update=array() ) {
1558
  global $wpdb;
1559
  $mcdb = $wpdb;
1560
  if ( !empty($update) ) {
1561
- $formats = array( '%d','%s','%s','%d' );
1562
- $begin = ( !empty($update) )?$update['event_begin'].' '.$update['event_time']:$event->occur_begin;
1563
- $end = ( !empty($update) )?$update['event_end'].' '.$update['event_endtime']:$event->occur_end;
1564
  $data = array( 'occur_event_id'=>$event_id, 'occur_begin'=>$begin,'occur_end'=>$end,'occur_group_id'=>$update['event_group_id'] );
1565
  } else {
1566
- $formats = array( '%d','%d' );
1567
  $group_id = mc_get_data( 'event_group_id', $event_id );
1568
  $data = array( 'occur_event_id'=>$event_id,'occur_group_id'=>$group_id );
1569
  }
@@ -1573,22 +1763,24 @@ function mc_update_instance( $event_instance, $event_id, $update=array() ) {
1573
  $data,
1574
  array( 'occur_id'=>$event_instance ),
1575
  $formats,
1576
- '%d' );
1577
  return $result;
1578
  }
1579
  // arbitrary field update to event table
1580
  function mc_update_data( $event_id, $field, $value, $format='%d' ) {
1581
  global $wpdb;
1582
  $data = array( $field=>$value );
 
1583
  $formats = ( $format );
1584
  $result = $wpdb->update(
1585
  my_calendar_table(),
1586
  $data,
1587
  array( 'event_id'=>$event_id ),
1588
  $formats,
1589
- '%d' );
1590
  return $result;
1591
  }
 
1592
  /* returns next available group ID */
1593
  function mc_group_id() {
1594
  global $wpdb;
@@ -1607,24 +1799,34 @@ function mc_instance_list( $id, $occur=false, $template='<h3>{title}</h3>{descri
1607
  $results = $wpdb->get_results($sql);
1608
  if ( is_array($results) && is_admin() ) {
1609
  foreach ( $results as $result ) {
1610
- if ( $result->occur_id == $occur ) {
 
1611
  $current = "<em>".__('Editing: ','my-calendar')."</em>"; $end = '';
1612
- } else {
 
1613
  $current = "<a href='".admin_url('admin.php?page=my-calendar')."&amp;mode=edit&amp;event_id=$id&amp;date=$result->occur_id'>"; $end = "</a>";
1614
  }
1615
- $begin = date_i18n( get_option('mc_date_format'),strtotime($result->occur_begin) ) . ' ' . date( get_option('mc_time_format'),strtotime($result->occur_begin) );
1616
- $output.= "<li>$current$begin$end</li>";
1617
  }
1618
- } else {
1619
  $details = '';
1620
- foreach ( $results as $result ) {
1621
  $event_id = $result->occur_id;
1622
  $event = mc_get_event( $event_id );
1623
- $array = event_as_array($event);
1624
- if ( $details == '' ) {
1625
- $details = ( $template != '' )?jd_draw_template( $array, $template ):' ';
 
 
 
 
 
1626
  }
1627
- $item = ( $list != '' )?jd_draw_template( $array, $list ):'';
 
 
 
1628
  $output.= $item;
1629
  }
1630
  $output = $details . $before . $output . $after;
@@ -1632,36 +1834,6 @@ function mc_instance_list( $id, $occur=false, $template='<h3>{title}</h3>{descri
1632
  return $output;
1633
  }
1634
 
1635
- function mc_get_data( $field, $id ) {
1636
- global $wpdb;
1637
- $mcdb = $wpdb;
1638
- if ( get_option( 'mc_remote' ) == 'true' && function_exists('mc_remote_db') ) { $mcdb = mc_remote_db(); }
1639
- $sql = "SELECT $field FROM ".my_calendar_table()." WHERE event_id=$id";
1640
- $result = $mcdb->get_var($sql);
1641
- return $result;
1642
- }
1643
-
1644
- function mc_related_events( $id ) {
1645
- global $wpdb;
1646
- $id = (int) $id;
1647
- if ( $id === 0 ) { echo "<li>".__('No related events','my-calendar')."</li>"; return; }
1648
- $output = '';
1649
- $sql = "SELECT * FROM ".my_calendar_event_table()." WHERE occur_group_id=$id";
1650
- $results = $wpdb->get_results($sql);
1651
- if ( is_array($results) && !empty($results) ) {
1652
- foreach ( $results as $result ) {
1653
- $event = $result->occur_event_id;
1654
- $current = "<a href='".admin_url('admin.php?page=my-calendar')."&amp;mode=edit&amp;event_id=$event'>"; $end = "</a>";
1655
- $begin = date_i18n( get_option('mc_date_format'),strtotime($result->occur_begin) ) . ' ' . date( get_option('mc_time_format'),strtotime($result->occur_begin) );
1656
- $output.= "<li>$current$begin$end</li>";
1657
- }
1658
- } else {
1659
- $output = "<li>".__('No related events','my-calendar')."</li>";
1660
- }
1661
- echo $output;
1662
- }
1663
-
1664
-
1665
  function mc_event_is_grouped( $group_id ) {
1666
  global $wpdb;
1667
  $mcdb = $wpdb;
@@ -1676,28 +1848,91 @@ function mc_event_is_grouped( $group_id ) {
1676
  }
1677
  }
1678
 
1679
- function mc_standard_event( $has_data, $data ) {
1680
- $form = "
1681
- <p><em>".__('My Calendar does not manage event registrations. Use this for information only.','my-calendar')."</em></p>
1682
- <p>
1683
- <input type='radio' id='event_open' name='event_open' value='1'";
1684
- if ($has_data) { $form .= jd_option_selected( $data->event_open,'1'); }
1685
- $form .= "/> <label for='event_open'>".__('Open','my-calendar')."</label>
1686
- <input type='radio' id='event_closed' name='event_open' value='0'";
1687
- if ($has_data) { $form .= jd_option_selected( $data->event_open,'0'); }
1688
- $form .= "/> <label for='event_closed'>".__('Closed','my-calendar')."</label>
1689
- <input type='radio' id='event_none' name='event_open' value='2'";
1690
- if ($has_data) {
1691
- $form .= jd_option_selected( $data->event_open, '2' );
1692
- } else {
1693
- $form .= " checked='checked'";
1694
  }
1695
- $form .= "/> <label for='event_none'>".__('Does not apply','my-calendar')."</label>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1696
  </p>
1697
  <p>
1698
- <input type='checkbox' name='event_group' id='event_group'";
1699
- if ( $has_data ) { $form .= jd_option_selected( $data->event_group,'1'); }
1700
- $form .= "/> <label for='event_group'>".__('If this event recurs, it can only be registered for as a complete series.','my-calendar')."</label>
1701
  </p>";
1702
- echo apply_filters( 'mc_event_registration_form', $form, $has_data, $data );
 
 
 
 
 
 
 
 
 
1703
  }
1
  <?php
2
+ if ( ! defined( 'ABSPATH') ) exit; // Exit if accessed directly
3
+
4
+ function mc_switch_sites() {
5
+ if ( function_exists('is_multisite') && is_multisite() ) {
6
+ if ( get_site_option('mc_multisite') == 2 && MY_CALENDAR_TABLE != MY_CALENDAR_GLOBAL_TABLE ) {
7
+ if ( get_option( 'mc_current_table' ) == '1' ) {
8
+ // can post to either, but is currently set to post to central table
9
+ return true;
10
+ }
11
+ } else if ( get_site_option('mc_multisite') == 1 && MY_CALENDAR_TABLE != MY_CALENDAR_GLOBAL_TABLE ) {
12
+ // can only post to central table
13
+ return true;
14
+ }
15
+ }
16
+ return false;
17
+ }
18
+
19
+ function mc_event_post( $action, $data, $event_id ) {
20
+ // if the event save was successful.
21
+ if ( $action == 'add' ) {
22
+ $post_id = mc_create_event_post( $data, $event_id );
23
+ }
24
+ if ( $action == 'edit' ) {
25
+ if ( $_POST['event_post'] == 0 || $_POST['event_post'] == '' ) {
26
+ $post_id = mc_create_event_post( $data, $event_id );
27
+ } else {
28
+ $post_id = $_POST['event_post'];
29
+ }
30
+ $term = mc_get_category_detail( $data['event_category'], 'category_term');
31
+ $privacy = ( mc_get_category_detail( $data['event_category'], 'category_private') == 1 ) ? 'private': 'publish';
32
+ $title = $data['event_title'];
33
+ $template = apply_filters( 'mc_post_template', 'details', $term );
34
+ $data['shortcode'] = "[my_calendar_event event='$event_id' template='$template' list='']";
35
+ $description = $data['event_desc'];
36
+ $excerpt = $data['event_short'];
37
+ $post_status = $privacy;
38
+ $auth = $data['event_author'];
39
+ $type = 'mc-events';
40
+ $my_post = array(
41
+ 'ID'=> $post_id,
42
+ 'post_title'=> $title,
43
+ 'post_content'=> $description,
44
+ 'post_status'=> $post_status,
45
+ 'post_author'=> $auth,
46
+ 'post_name'=> sanitize_title( $title ),
47
+ 'post_date'=> date( 'Y-m-d H:i:s', current_time( 'timestamp') ),
48
+ 'post_type'=> $type,
49
+ 'post_excerpt'=> $excerpt
50
+ );
51
+ if ( mc_switch_sites() ) { switch_to_blog( BLOG_ID_CURRENT_SITE ); }
52
+ $post_id = wp_update_post( $my_post );
53
+ wp_set_object_terms( $post_id, (int) $term, 'mc-event-category');
54
+ if ( $data['event_image'] == '' ) {
55
+ delete_post_thumbnail( $post_id );
56
+ } else {
57
+ $attachment_id = ( isset( $_POST['event_image_id'] ) && is_numeric( $_POST['event_image_id'] ) ) ? $_POST['event_image_id'] : false;
58
+ if ( $attachment_id ) { set_post_thumbnail( $post_id, $attachment_id ); }
59
+ }
60
+ $access_terms = implode( ',', array_values( $_POST['events_access'] ) );
61
+ mc_update_event( 'event_access', $access_terms, $event_id, '%s' );
62
+ do_action( 'mc_update_event_post', $post_id, $_POST, $data, $event_id );
63
+ if ( mc_switch_sites() ) { restore_current_blog(); }
64
+ }
65
+ }
66
+
67
+ // use this action to add any $_POST data; e.g., things not saved elsewhere.
68
+ add_action( 'mc_update_event_post', 'mc_add_post_meta_data', 10, 4 );
69
+ function mc_add_post_meta_data( $post_id, $post, $data, $event_id ) {
70
+ // access features for the event
71
+ update_post_meta( $post_id, '_mc_event_shortcode', $data['shortcode'] );
72
+ update_post_meta( $post_id, '_mc_event_access', ( isset( $_POST['events_access'] ) ) ? $_POST['events_access'] : '' );
73
+ update_post_meta( $post_id, '_mc_event_id', $event_id );
74
+ update_post_meta( $post_id, '_mc_event_desc', $data['event_desc'] );
75
+ update_post_meta( $post_id, '_mc_event_image', $data['event_image'] );
76
+ $location_id = ( isset( $_POST['location_preset'] ) ) ? (int) $_POST['location_preset'] : 0 ;
77
+ if ( $location_id ) { // only change location ID if dropdown set.
78
+ update_post_meta( $post_id, '_mc_event_location', $location_id );
79
+ mc_update_event( 'event_location', $location_id, $event_id );
80
+ }
81
+ update_post_meta( $post_id, '_mc_event_data', $data );
82
+ }
83
+
84
+ function mc_create_event_post( $data, $event_id ) {
85
+ $term = mc_get_category_detail( $data['event_category'], 'category_term');
86
+ $privacy = ( mc_get_category_detail( $data['event_category'], 'category_private') == 1 ) ? 'private': 'publish';
87
+ $title = $data['event_title'];
88
+ $template = apply_filters( 'mc_post_template', 'details', $term );
89
+ $data['shortcode'] = "[my_calendar_event event='$event_id' template='$template' list='']";
90
+ $description = $data['event_desc'];
91
+ $excerpt = $data['event_short'];
92
+ $location_id = ( isset( $_POST['location_preset'] ) ) ? (int) $_POST['location_preset'] : 0 ;
93
+ $post_status = $privacy;
94
+ $auth = $data['event_author'];
95
+ $type = 'mc-events';
96
+ $my_post = array(
97
+ 'post_title'=> $title,
98
+ 'post_content'=> $description,
99
+ 'post_status'=> $post_status,
100
+ 'post_author'=> $auth,
101
+ 'post_name'=> sanitize_title( $title ),
102
+ 'post_date'=> date( 'Y-m-d H:i:s', current_time( 'timestamp' ) ),
103
+ 'post_type'=> $type,
104
+ 'post_excerpt'=> $excerpt
105
+ );
106
+ $post_id = wp_insert_post( $my_post );
107
+ wp_set_object_terms( $post_id, (int) $term, 'mc-event-category');
108
+ $attachment_id = ( isset( $_POST['event_image_id'] ) && is_numeric( $_POST['event_image_id'] ) ) ? $_POST['event_image_id'] : false;
109
+ if ( $attachment_id ) { set_post_thumbnail( $post_id, $attachment_id ); }
110
+ mc_update_event( 'event_post', $post_id, $event_id );
111
+ mc_update_event( 'event_location', $location_id, $event_id );
112
+ do_action( 'mc_update_event_post', $post_id, $_POST, $data, $event_id );
113
+ wp_publish_post( $post_id );
114
+ return $post_id;
115
+ }
116
+
117
+ function mc_update_event( $field, $data, $event, $type='%d' ) {
118
+ global $wpdb;
119
+ $field = sanitize_key( $field );
120
+ $type = esc_sql( $type );
121
+ $result = $wpdb->query( $wpdb->prepare( "UPDATE ".my_calendar_table()." SET $field = $type WHERE event_id=$type", $data, $event ) );
122
+ return $result;
123
+ }
124
+
125
+ function mc_update_category( $field, $data, $category ) {
126
+ global $wpdb;
127
+ $field = sanitize_key( $field );
128
+ $result = $wpdb->query( $wpdb->prepare( "UPDATE ".my_calendar_categories_table()." SET $field = %d WHERE category_id=%d", $data, $category ) );
129
+ return $result;
130
+ }
131
+
132
+ function mc_update_location( $field, $data, $location ) {
133
+ global $wpdb;
134
+ $field = sanitize_key( $field );
135
+ $result = $wpdb->query( $wpdb->prepare( "UPDATE ".my_calendar_locations_table()." SET $field = %d WHERE location_id=%d", $data, $location ) );
136
+ return $result;
137
+ }
138
+
139
+ function mc_event_delete_post( $event_id, $post_id ) {
140
+ wp_delete_post( $post_id, true );
141
+ }
142
 
143
  function manage_my_calendar() {
144
+ check_my_calendar();
145
  global $wpdb,$event_author;
146
  $mcdb = $wpdb;
147
+
148
+ if ( isset( $_GET['mode'] ) && $_GET['mode'] == 'delete') {
149
  $sql = "SELECT event_title, event_author FROM " . my_calendar_table() . " WHERE event_id=" . (int) $_GET['event_id'];
150
  $result = $mcdb->get_results( $sql, ARRAY_A );
151
  if ( mc_can_edit_event( $result[0]['event_author'] ) ) {
153
  $event_instance = (int) $_GET['date'];
154
  $sql = "SELECT occur_begin FROM " . my_calendar_event_table() . " WHERE occur_id=" . $event_instance;
155
  $inst = $mcdb->get_var( $sql );
156
+ $instance_date = '('.date('Y-m-d',strtotime($inst) ).')';
157
  } else {
158
  $instance_date = '';
159
+ } ?>
 
160
  <div class="error">
161
  <form action="<?php echo admin_url('admin.php?page=my-calendar'); ?>" method="post">
162
  <p><strong><?php _e('Delete Event','my-calendar'); ?>:</strong> <?php _e('Are you sure you want to delete this event?','my-calendar'); ?>
175
  </div><?php
176
  } else { ?>
177
  <div class="error">
178
+ <p><strong><?php _e( 'You do not have permission to delete that event.','my-calendar'); ?></strong></p>
179
  </div><?php
180
  }
181
  }
182
 
183
  // Approve and show an Event ...originally by Roland
184
+ if ( isset( $_GET['mode'] ) && $_GET['mode'] == 'approve') {
185
+ if ( current_user_can( 'mc_approve_events') ) {
186
  $sql = "UPDATE " . my_calendar_table() . " SET event_approved = 1 WHERE event_id=" . (int) $_GET['event_id'];
187
  $result = $mcdb->get_results( $sql, ARRAY_A );
188
  mc_delete_cache();
196
  }
197
 
198
  // Reject and hide an Event ...by Roland
199
+ if ( isset( $_GET['mode'] ) && $_GET['mode'] == 'reject') {
200
+ if ( current_user_can( 'mc_approve_events') ) {
201
  $sql = "UPDATE " . my_calendar_table() . " SET event_approved = 2 WHERE event_id=" . (int) $_GET['event_id'];
202
  $result = $mcdb->get_results( $sql, ARRAY_A );
203
  mc_delete_cache();
214
  $nonce=$_REQUEST['_wpnonce'];
215
  if (! wp_verify_nonce($nonce,'my-calendar-nonce') ) die("Security check failed");
216
  $events = $_POST['mass_edit'];
 
217
  $i=0;
218
  $deleted = array();
219
  foreach ($events as $value) {
224
  if ( mc_can_edit_event( $result[0]['event_author'] ) ) {
225
  $delete_occurrences = "DELETE FROM ".my_calendar_event_table()." WHERE occur_event_id = $value";
226
  $delete = $mcdb->query($delete_occurrences);
227
+ $ids[] = mysql_real_escape_string($value);
228
  $deleted[] = $value;
229
  $i++;
230
  }
231
  }
232
+ $statement = implode( ',', $ids );
233
+ $sql = 'DELETE FROM '. my_calendar_table() ." WHERE event_id IN ($statement)";
234
  $result = $mcdb->query($sql);
235
  if ( $result !== 0 && $result !== false ) {
236
  mc_delete_cache();
243
  echo $message;
244
  }
245
 
246
+ if ( !empty( $_POST['mass_edit'] ) && isset( $_POST['mass_approve'] ) ) {
247
  $nonce=$_REQUEST['_wpnonce'];
248
  if (! wp_verify_nonce($nonce,'my-calendar-nonce') ) die("Security check failed");
249
  $events = $_POST['mass_edit'];
250
+ $sql = 'UPDATE '. my_calendar_table() . 'SET event_approved = 1 WHERE event_id IN (';
251
  $i=0;
252
  $approved = array();
253
  foreach ($events as $value) {
272
  }
273
  echo $message;
274
  }
275
+
276
+ if ( !empty( $_POST['mass_edit'] ) && isset( $_POST['mass_archive'] ) ) {
277
+ $nonce=$_REQUEST['_wpnonce'];
278
+ if (! wp_verify_nonce($nonce,'my-calendar-nonce') ) die( "Security check failed" );
279
+ $events = $_POST['mass_edit'];
280
+ $sql = 'UPDATE '. my_calendar_table() . ' SET event_status = 0 WHERE event_id IN (';
281
+ $i=0;
282
+ $archived = array();
283
+ foreach ( $events as $value ) {
284
+ $total = count($events);
285
+ $sql .= (int) $value.',';
286
+ $archived[] = $value;
287
+ $i++;
288
+ }
289
+ $sql = substr( $sql, 0, -1 );
290
+ $sql .= ')';
291
+ $result = $mcdb->query($sql);
292
+ if ( $result == 0 || $result == false ) {
293
+ $message = "<div class='error'><p><strong>".__('Error','my-calendar').":</strong>".__('Could not archive those events.','my-calendar')."</p></div>";
294
+ } else {
295
+ mc_delete_cache();
296
+ // argument: array of event IDs
297
+ do_action( 'mc_mass_archive_events', $archived );
298
+ $message = "<div class='updated'><p>".sprintf(__('%1$d events archived successfully out of %2$d selected.','my-calendar'), $i, $total )."</p></div>";
299
+ }
300
+ echo $message;
301
+ }
302
  ?>
303
  <div class='wrap jd-my-calendar'>
304
  <div id="icon-edit" class="icon32"></div>
305
+ <h2 class='mc-clear'id='mc-manage'><?php _e('Manage Events','my-calendar'); ?></h2>
306
+ <div class="postbox-container jcd-wide">
307
  <div class="metabox-holder">
308
  <div class="ui-sortable meta-box-sortables">
309
  <div class="postbox">
310
  <h3><?php _e('My Events','my-calendar'); ?></h3>
311
  <div class="inside">
312
+ <?php mc_list_events(); ?>
313
  </div>
314
  </div>
315
  </div>
316
  </div>
317
  </div>
318
+
319
+ <?php /* Todo
320
+ if ( isset( $_POST['mc-import-csv'] ) ) {
321
+
322
+ }
323
+ $add = array( 'Import Events'=>'<form action="'.admin_url('admin.php?page=my-calendar-manage').'" method="POST"><div><label for="mc-import-csv">'.__('Upload CSV File','my-calendar').'<input type="file" name="mc-import-csv" id="mc-import-csv" /><input type="submit" value="'.__('Import Events','my-calendar').'" /></div></form>'); */
324
+ mc_show_sidebar(); ?>
325
  </div>
326
  <?php
327
  }
328
 
329
  function edit_my_calendar() {
330
  global $current_user, $wpdb, $users_entries;
331
+ $mcdb = $wpdb;
332
+
333
+ if ( get_option('ko_calendar_imported') != 'true') {
334
  if (function_exists('check_calendar')) {
335
+ echo "<div id='message'class='updated'>";
336
  echo "<p>";
337
  _e('My Calendar has identified that you have the Calendar plugin by Kieran O\'Shea installed. You can import those events and categories into the My Calendar database. Would you like to import these events?','my-calendar');
338
  echo "</p>";
355
  // First some quick cleaning up
356
  $edit = $create = $save = $delete = false;
357
 
358
+ $action = !empty( $_POST['event_action'] ) ? $_POST['event_action'] : '';
359
+ $event_id = !empty( $_POST['event_id'] ) ? $_POST['event_id'] : '';
360
 
361
  if ( isset( $_GET['mode'] ) ) {
362
  $action = $_GET['mode'];
363
+ if ( $action == 'edit'|| $action == 'copy') {
364
  $event_id = (int) $_GET['event_id'];
365
  }
366
  }
367
 
 
 
 
368
  if ( isset( $_POST['event_action'] ) ) {
369
+ $nonce = $_REQUEST['_wpnonce'];
370
+ if (! wp_verify_nonce( $nonce,'my-calendar-nonce' ) ) die( "Security check failed" );
371
  $proceed = false;
372
  global $mc_output;
373
  $count = 0;
374
+ if ( isset( $_POST['event_begin'] ) && is_array( $_POST['event_begin'] ) ) {
375
+ $count = count( $_POST['event_begin'] );
376
  } else {
377
+ $response = my_calendar_save( $action, $mc_output, (int) $_POST['event_id'] );
378
+ echo $response['message'];
379
  }
380
  for ($i=0;$i<$count;$i++) {
381
+ $mc_output = mc_check_data( $action,$_POST, $i );
382
+ if ($action == 'add'|| $action == 'copy') {
383
+ $response = my_calendar_save( $action,$mc_output );
384
  } else {
385
+ $response = my_calendar_save( $action,$mc_output,(int) $_POST['event_id'] );
386
  }
387
+ echo $response['message'];
388
  }
389
  if ( isset($_POST['ref']) ) {
390
  $url = esc_url( urldecode( $_POST['ref'] ) );
395
  ?>
396
 
397
  <div class="wrap jd-my-calendar">
398
+ <?php my_calendar_check_db();
399
+ if ( get_site_option('mc_multisite') == 2 ) {
400
+ if ( get_option('mc_current_table') == 0 ) {
401
+ $message = __('Currently editing your local calendar','my-calendar');
402
+ } else {
403
+ $message = __('Currently editing your central calendar','my-calendar');
404
+ }
405
+ echo "<div class='message updated'><p>$message</p></div>";
406
+ }
407
+ if ( $action == 'edit'|| ($action == 'edit'&& $error_with_saving == 1) ) { ?>
408
+ <div id="icon-edit" class="icon32"></div>
 
 
409
  <h2><?php _e('Edit Event','my-calendar'); ?></h2>
410
  <?php
411
  if ( empty($event_id) ) {
412
  echo "<div class=\"error\"><p>".__("You must provide an event id in order to edit it",'my-calendar')."</p></div>";
413
  } else {
414
+ mc_edit_event_form('edit', $event_id);
415
  }
416
+ } else if ( $action == 'copy'|| ($action == 'copy'&& $error_with_saving == 1)) { ?>
417
+ <div id="icon-edit" class="icon32"></div>
418
  <h2><?php _e('Copy Event','my-calendar'); ?></h2>
419
  <?php
420
  if ( empty($event_id) ) {
421
  echo "<div class=\"error\"><p>".__("You must provide an event id in order to edit it",'my-calendar')."</p></div>";
422
  } else {
423
+ mc_edit_event_form('copy', $event_id);
424
  }
425
+ } else { ?>
426
+ <div id="icon-edit" class="icon32"></div>
427
+ <h2><?php _e('Add Event','my-calendar'); ?></h2><?php
428
+ mc_edit_event_form();
429
+ }
430
+ mc_show_sidebar(); ?>
431
+ </div><?php
 
 
432
  }
433
 
434
  function mc_tweet_approval( $prev, $new ) {
435
+ if ( function_exists( 'jd_doTwitterAPIPost' ) && isset( $_POST['mc_twitter'] ) && trim( $_POST['mc_twitter'] ) != '' ) {
436
  if ( ( $prev == 0 || $prev == 2 ) && $new == 1 ) {
437
  jd_doTwitterAPIPost( stripslashes( $_POST['mc_twitter'] ) );
438
  }
445
  $proceed = $output[0];
446
  $message = '';
447
  $formats = array(
448
+ '%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s',
449
  '%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d',
450
  '%f','%f'
451
  );
452
+ if ( ( $action == 'add'|| $action == 'copy') && $proceed == true ) {
453
  $add = $output[2]; // add format here
454
  $add = apply_filters( 'mc_before_save_insert', $add );
455
+ $result = $mcdb->insert( my_calendar_table(), $add, $formats );
456
+ $event_id = $mcdb->insert_id;
457
+ mc_increment_event( $event_id );
 
 
 
 
 
458
  if ( !$result ) {
459
  $message = "<div class='error notice'><p><strong>". __('Error','my-calendar') .":</strong> ". __('I\'m sorry! I couldn\'t add that event to the database.','my-calendar') . "</p></div>";
460
  } else {
461
  // do an action using the $action and processed event data
462
  $data = $add;
463
+ do_action( 'mc_save_event', $action, $data, $event_id, $result );
464
  // Call mail function
465
+ if ( get_option('mc_event_mail') == 'true') {
466
  $event = mc_get_event( $mcdb->insert_id ); // insert_id is last occurrence inserted in the db
467
  my_calendar_send_email( $event );
468
  }
469
  if ( $add['event_approved'] == 0 ) {
470
  $message = "<div class='updated notice'><p>".__('Event saved. An administrator will review and approve your event.','my-calendar')."</p></div>";
471
  } else {
472
+ if ( function_exists( 'jd_doTwitterAPIPost') && isset( $_POST['mc_twitter'] ) && trim($_POST['mc_twitter']) != '') {
473
  jd_doTwitterAPIPost( stripslashes($_POST['mc_twitter']) );
474
  }
475
+ if ( get_option( 'mc_uri' ) != '' ) {
476
+ $event_ids = mc_get_occurrences( $event_id );
477
+ $event_link = mc_build_url( array( 'mc_id'=>$event_ids[0]->occur_id ), array( 'page' ), get_option( 'mc_uri' ) );
478
+ } else {
479
+ $event_link = false;
480
+ }
481
+ $message = "<div class='updated notice'><p>".__('Event added. It will now show on the calendar.','my-calendar');
482
+ if ( $event_link !== false ) {
483
+ $message .= sprintf( __(' <a href="%s">View Event</a>', 'my-calendar' ), $event_link );
484
+ }
485
+ $message .= "</p></div>";
486
  }
487
  mc_delete_cache();
488
  }
489
  }
490
+ if ( $action == 'edit'&& $proceed == true ) {
491
+ $url = ( get_option( 'mc_uri' ) != ''&& !is_numeric( get_option( 'mc_uri' ) ) )?''.sprintf(__('View <a href="%s">your calendar</a>.','my-calendar'), get_option( 'mc_uri' ) ):'';
492
  $event_author = (int) ($_POST['event_author']);
493
  if ( mc_can_edit_event( $event_author ) ) {
494
  $update = $output[2];
497
  $update['event_begin'] != $_POST['prev_event_begin'] ||
498
  $update['event_time'] != $_POST['prev_event_time'] ||
499
  $update['event_end'] != $_POST['prev_event_end'] ||
500
+ ( $update['event_endtime'] != $_POST['prev_event_endtime'] && ( $_POST['prev_event_endtime'] != ''&& $update['event_endtime']!= '00:00:00') ) )
501
  ?true:false;
502
  if ( isset($_POST['event_instance']) ) {
503
  $is_changed = mc_compare( $update, $event_id );// compares the information sent to the information saved for a given event.
517
  } else {
518
  if ( $update['event_begin'][0] == $_POST['prev_event_begin'] && $update['event_end'][0] == $_POST['prev_event_end'] ) {
519
  // There were no changes at all.
 
520
  } else {
521
  $result = mc_update_instance( $event_instance, $event_id, $update );
522
  // Only dates were changed
531
  $update,
532
  array( 'event_id'=>$event_id ),
533
  $formats,
534
+ '%d');
535
  $recur_changed = ( $update['event_repeats'] != $_POST['prev_event_repeats'] || $update['event_recur'] != $_POST['prev_event_recur'] )?true:false;
536
  if ( $date_changed || $recur_changed ) {
537
  $delete_instances = mc_delete_instances( $event_id );
544
  //$mcdb->print_error();
545
  if ( $result === false ) {
546
  $message = "<div class='error'><p><strong>".__('Error','my-calendar').":</strong>".__('Your event was not updated.','my-calendar')."$url</p></div>";
 
 
547
  } else {
548
  // do an action using the $action and processed event data
549
  do_action( 'mc_transition_event', (int) $_POST['prev_event_status'], (int) $_POST['event_approved'] );
555
  }
556
  }
557
 
558
+ if ( $action == 'delete') {
559
  // Deal with deleting an event from the database
560
+ if ( empty( $event_id ) ) {
561
  $message = "<div class='error'><p><strong>".__('Error','my-calendar').":</strong>".__("You can't delete an event if you haven't submitted an event id",'my-calendar')."</p></div>";
562
  } else {
563
+ $post_id = mc_get_data( 'event_post', $event_id );
564
  if ( empty( $_POST['event_instance'] ) ) {
565
  $sql = "DELETE FROM " . my_calendar_table() . " WHERE event_id='" . (int) $event_id . "'";
566
  $delete_occurrences = "DELETE FROM ".my_calendar_event_table()." WHERE occur_event_id = ".(int) $event_id;
575
  if ( empty($result) || empty($result[0]->event_id) ) {
576
  mc_delete_cache();
577
  // do an action using the event_id
578
+ do_action( 'mc_delete_event', $event_id, $post_id );
579
  $message = "<div class='updated'><p>".__('Event deleted successfully','my-calendar')."</p></div>";
580
  } else {
581
  $message = "<div class='error'><p><strong>".__('Error','my-calendar').":</strong>".__('Despite issuing a request to delete, the event still remains in the database. Please investigate.','my-calendar')."</p></div>";
583
  }
584
  }
585
  $message = $message ."\n". $output[3];
586
+ return array ( 'event_id'=>$event_id, 'message'=>$message );
587
  }
588
 
589
+ function mc_form_data($event_id=false) {
590
  global $wpdb,$users_entries;
591
  $mcdb = $wpdb;
592
  if ( $event_id !== false ) {
593
  if ( intval($event_id) != $event_id ) {
594
  return "<div class=\"error\"><p>".__('Sorry! That\'s an invalid event key.','my-calendar')."</p></div>";
595
  } else {
596
+ $data = $mcdb->get_results("SELECT * FROM " . my_calendar_table() . " WHERE event_id='" . (int) $event_id . "'LIMIT 1");
597
  if ( empty($data) ) {
598
  return "<div class=\"error\"><p>".__("Sorry! We couldn't find an event with that ID.",'my-calendar')."</p></div>";
599
  }
611
  }
612
 
613
  // The event edit form for the manage events admin page
614
+ function mc_edit_event_form($mode='add', $event_id=false) {
615
  global $wpdb,$users_entries,$output;
616
  $mcdb = $wpdb;
617
  if ($event_id != false) {
618
+ $data = mc_form_data($event_id);
619
  } else {
620
  $data = $users_entries;
621
  }
622
+ if ( is_object($data) && $data->event_approved != 1 && $mode == 'edit') {
623
  $message = __('This event must be approved in order for it to appear on the calendar.','my-calendar');
624
  } else {
625
  $message = "";
626
  }
627
  echo ($message != '')?"<div class='error'><p>$message</p></div>":'';
628
+ mc_form_fields($data,$mode,$event_id);
629
  }
630
 
631
  function mc_get_instance_data( $instance_id ) {
636
  }
637
 
638
  function mc_show_edit_block( $field ) {
639
+ $admin = ( get_option('mc_input_options_administrators' ) == 'true' && current_user_can( 'manage_options' ) ) ? true : false;
640
  $input = get_option('mc_input_options');
641
  $user = get_current_user_id();
642
  $screen = get_current_screen();
643
  $option = $screen->get_option('mc_show_on_page', 'option');
644
+ $show = get_user_meta( $user, $option, true );
645
  if ( empty ( $show) || $show < 1 ) {
646
+ $show = $screen->get_option( 'mc_show_on_page', 'default');
647
+ }
648
+ // if this doesn't exist in array, leave it on
649
+ if ( !isset( $input[$field] ) || !isset( $show[$field] ) ) {
650
+ return true;
651
  }
652
  if ( $admin ) {
653
+ if ( isset( $show[$field] ) && $show[$field] == 'on') { return true; } else { return false; }
654
  } else {
655
+ if ( $input[$field] == 'off'|| $input[$field] == '') { return false; } else if ( $show[$field] == 'off') { return false; } else { return true; }
 
656
  }
657
  return true;
658
  }
659
 
660
+ function mc_show_block( $field, $has_data, $data ) {
661
+ $return = $checked = $value = '';
662
+ $show_block = mc_show_edit_block( $field );
663
+ $pre = '<div class="ui-sortable meta-box-sortables"><div class="postbox">';
664
+ $post = '</div></div>';
665
+ switch ( $field ) {
666
+ case 'event_desc' :
667
+ if ( $show_block ) {
668
+ // because wp_editor cannot return a value, event_desc fields cannot be filtered if its enabled.
669
+ $value = ( $has_data ) ? stripslashes( $data->event_desc ) : '';
670
+ echo '
671
+ <div class="event_description">
672
+ <label for="content">'.__( 'Event Description','my-calendar' ).'</label><br />';
673
+ if ( user_can_richedit() ) {
674
+ if ( version_compare( get_bloginfo( 'version') , '3.3', '>=') ) {
675
+ wp_editor( $value, 'content', array( 'textarea_rows'=>10 ) );
676
+ } else {
677
+ the_editor( $value );
678
+ }
679
+ } else {
680
+ echo '<textarea id="content" name="content" class="event_desc" rows="8" cols="80">'.stripslashes( esc_attr( $value ) ).'</textarea>';
681
+ }
682
+ echo '</div>';
683
+ }
684
+ break;
685
+ case 'event_short' :
686
+ if ( $show_block ) {
687
+ $value = ( $has_data ) ? stripslashes( esc_attr( $data->event_short ) ) : '';
688
+ $return = '
689
+ <p>
690
+ <label for="e_short">'.__( 'Short Description','my-calendar' ).'</label><br /><textarea id="e_short" name="event_short" rows="2" cols="80">'.$value.'</textarea>
691
+ </p>';
692
+ }
693
+ break;
694
+ case 'event_image' :
695
+ if ( $show_block ) {
696
+ $value = ( $has_data ) ? esc_attr( $data->event_image ) : '';
697
+ $return = '
698
+ <div class="mc-image-upload field-holder">
699
+ <input type="hidden" name="event_image_id" value="" class="textfield" id="e_image_id" />
700
+ <label for="e_image">'.__( "Add an image:",'my-calendar' ).'</label><br /><input type="text" name="event_image" id="e_image" size="60" value="'.$value.'" placeholder="http://yourdomain.com/image.jpg" /> <a href="#" class="button textfield-field">'.__( "Upload",'my-calendar' ).'</a>';
701
+ if ( !empty( $data->event_image ) ) {
702
+ $return .= '<div class="event_image"><img src="'.esc_attr( $data->event_image ).'" alt="" /></div>';
703
+ } else {
704
+ $return .= '<div class="event_image"></div>';
705
+ }
706
+ $return .= '</div>';
707
+ } else {
708
+ $return = '<input type="hidden" name="event_image" value="'.$value.'" />';
709
+ }
710
+ break;
711
+ case 'event_category' :
712
+ if ( $show_block ) {
713
+ $return = '<p>
714
+ <label for="e_category">'.__('Category','my-calendar').'</label>
715
+ <select id="e_category" name="event_category">'.
716
+ mc_category_select( $data ).'
717
+ </select>
718
+ </p>';
719
+ } else {
720
+ $return = '<div><input type="hidden" name="event_category" value="'.mc_category_select( $data, false ).'" /></div>';
721
+ }
722
+ break;
723
+ case 'event_link' :
724
+ if ( $show_block ) {
725
+ $value = ( $has_data ) ? esc_url( $data->event_link ) : '';
726
+ if ( $has_data && $data->event_link_expires == '1' ) {
727
+ $checked = " checked=\"checked\"";
728
+ } else if ( $has_data && $data->event_link_expires == '0' ) {
729
+ $checked = "";
730
+ } else if ( get_option( 'mc_event_link_expires') == 'true' ) {
731
+ $checked = " checked=\"checked\"";
732
+ }
733
+ $return = '
734
+ <p>
735
+ <label for="e_link">'.__( 'URL','my-calendar' ).'</label> <input type="text" id="e_link" name="event_link" size="40" value="'.$value.'" /> <input type="checkbox" value="1" id="e_link_expires" name="event_link_expires"'.$checked.' /> <label for="e_link_expires">'.__('Link will expire after event','my-calendar').'</label>
736
+ </p>';
737
+ }
738
+ break;
739
+ case 'event_recur' :
740
+ if ( is_object($data) ) {
741
+ $event_recur = ( is_object($data) )?$data->event_recur:'';
742
+ $recurs = str_split( $event_recur, 1 );
743
+ $recur = $recurs[0];
744
+ $every = ( isset($recurs[1]) )?$recurs[1]:1;
745
+ if ( $every == 1 && $recur == 'B') { $every = 2; }
746
+ $prev = '<input type="hidden" name="prev_event_repeats" value="'.$data->event_repeats.'" /><input type="hidden" name="prev_event_recur" value="'.$data->event_recur.'" />';
747
+ } else {
748
+ $recur = $every = false;
749
+ $prev = '';
750
+ }
751
+ if ( $show_block && empty( $_GET['date'] ) ) {
752
+ if ( is_object($data) && $data->event_repeats != NULL ) {
753
+ $repeats = $data->event_repeats;
754
+ } else {
755
+ $repeats = 0;
756
+ }
757
+ $return = $pre.'
758
+ <h3>'.__( 'Recurring','my-calendar' ).'</h3>
759
+ <div class="inside">'.$prev.'
760
+ <fieldset>
761
+ <legend>'.__('Recurring Events','my-calendar').'</legend>
762
+ <p>
763
+ <label for="e_repeats">'.__('Repeats','my-calendar').' <input type="text" name="event_repeats" aria-labelledby="e_repeats_label" id="e_repeats" size="1" value="'.$repeats.'" /> <span id="e_repeats_label">'.__('times','my-calendar').'</span>, </label>
764
+ <label for="e_every">'.__('every','my-calendar').'</label> <input type="number" name="event_every" id="e_every" size="1" min="1" max="9" maxlength="1" value="'.$every.'" />
765
+ <label for="e_recur" class="screen-reader-text">'.__('Units','my-calendar').'</label>
766
+ <select name="event_recur" id="e_recur">
767
+ '.mc_recur_options($recur).'
768
+ </select><br />
769
+ '.__('Your entry is the number of events after the first occurrence of the event: a recurrence of <em>2</em> means the event will happen three times.','my-calendar').'
770
+ </p>
771
+ </fieldset>
772
+ </div>
773
+ '.$post;
774
+ } else {
775
+ $return = '
776
+ <div>'.
777
+ $prev.'
778
+ <input type="hidden" name="event_repeats" value="0" />
779
+ <input type="hidden" name="event_recur" value="S" />
780
+ </div>';
781
+ }
782
+ break;
783
+ case 'event_access' :
784
+ if ( $show_block ) {
785
+ $label = __('Event Access','my-calendar');
786
+ $return = $pre.'
787
+ <h3>'.$label.'</h3>
788
+ <div class="inside">
789
+ '.mc_event_accessibility( '', $data, $label ).
790
+ apply_filters( 'mc_event_access_fields', '', $has_data, $data ).'
791
+ </div>'.$post;
792
+ }
793
+ break;
794
+ case 'event_open' :
795
+ if ( $show_block ) {
796
+ $return= $pre.'
797
+ <h3>'.__('Event Registration Settings','my-calendar').'</h3>
798
+ <div class="inside">
799
+ <fieldset>
800
+ <legend>'.__('Event Registration','my-calendar').'</legend>
801
+ '.apply_filters( 'mc_event_registration', '', $has_data, $data, 'admin' ).'
802
+ </fieldset>
803
+ </div>
804
+ '.$post;
805
+ } else {
806
+ $open = ( $has_data ) ? $data->event_open : '2' ;
807
+ $tickets = ( $has_data ) ? esc_attr( esc_url( $data->event_tickets ) ) : '' ;
808
+ $registration = ( $has_data ) ? esc_attr( $data->event_registration ) : '' ;
809
+ $return = '
810
+ <div>
811
+ <input type="hidden" name="event_open" value="'.$open.'" />
812
+ <input type="hidden" name="event_tickets" value="'.$tickets.'" />
813
+ <input type="hidden" name="event_registration" value="'.$registration.'" />
814
+ </div>';
815
+ }
816
+ break;
817
+ case 'event_location' :
818
+ if ( $show_block ) {
819
+ $return = mc_locations_fields( $has_data, $data, 'event' );
820
+ } else {
821
+ if ( $has_data ) {
822
+ $return = "
823
+ <div>
824
+ <input type='hidden' name='event_label' value='".esc_attr(stripslashes($data->event_label))."' />
825
+ <input type='hidden' name='event_street' value='".(stripslashes($data->event_street))."' />
826
+ <input type='hidden' name='event_street2' value='".(stripslashes($data->event_street2))."' />
827
+ <input type='hidden' name='event_phone' value='".(stripslashes($data->event_phone))."' />
828
+ <input type='hidden' name='event_phone2' value='".(stripslashes($data->event_phone2))."' />
829
+ <input type='hidden' name='event_city' value='".(stripslashes($data->event_city))."' />
830
+ <input type='hidden' name='event_state' value='".(stripslashes($data->event_state))."' />
831
+ <input type='hidden' name='event_postcode' value='".(stripslashes($data->event_postcode))."' />
832
+ <input type='hidden' name='event_region' value='".(stripslashes($data->event_region))."' />
833
+ <input type='hidden' name='event_country' value='".(stripslashes($data->event_country))."' />
834
+ <input type='hidden' name='event_zoom' value='".(stripslashes($data->event_zoom))."' />
835
+ <input type='hidden' name='event_url' value='".(stripslashes($data->event_url))."' />
836
+ <input type='hidden' name='event_latitude' value='".(stripslashes($data->event_latitude))."' />
837
+ <input type='hidden' name='event_longitude' value='".(stripslashes($data->event_longitude))."' />
838
+ </div>";
839
+ }
840
+ }
841
+ break;
842
+ default: return;
843
+ }
844
+ echo apply_filters( 'mc_show_block', $return, $data, $field );
845
+ }
846
+
847
+ function mc_form_fields( $data,$mode,$event_id ) {
848
  global $wpdb, $user_ID;
849
  $mcdb = $wpdb;
850
  $has_data = ( empty($data) ) ? false : true;
851
  $warning = '';
852
  if ( $data ) {
853
+ if ( !( $data->event_recur == 'S'|| $data->event_recur == 'S1') ) {
854
+ $check = mc_increment_event( $data->event_id, array(), 'test');
855
+ if ( my_calendar_date_xcomp( $check['occur_begin'] , $data->event_end .''.$data->event_endtime ) ) {
856
  $warning = "<div class='updated'><p>".__('This event ends after the next occurrence begins. Events must end <strong>before</strong> the next occurrence begins.','my-calendar')."</p><p>".sprintf( __('Event end date: <strong>%s %s</strong>. Next occurrence starts: <strong>%s</strong>','my-calendar'), $data->event_end, $data->event_endtime, $check['occur_begin'] )."</p></div>";
857
  echo $warning;
858
  }
862
  if ( $instance ) { $ins = mc_get_instance_data( $instance ); $event_id = $ins->occur_event_id; $data = mc_get_event_core( $event_id );}
863
  ?>
864
 
865
+ <div class="postbox-container jcd-wide">
866
  <div class="metabox-holder">
867
+ <?php if ( $mode == 'add'|| $mode == 'copy') { $edit_args = ''; } else {
868
  $edit_args = "&amp;mode=$mode&amp;event_id=$event_id";
869
  if ( $instance ) { $edit_args .= "&amp;date=$instance"; }
870
  }
871
  ?>
872
+ <form id="my-calendar" method="post" action="<?php echo admin_url( 'admin.php?page=my-calendar' ).$edit_args; ?>">
873
  <div>
874
+ <input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce( 'my-calendar-nonce' ); ?>" />
875
+ <?php if ( isset( $_GET['ref'] ) ) { ?>
876
+ <input type="hidden" name="ref" value="<?php echo esc_url( $_GET['ref'] ); ?>" />
877
  <?php } ?>
878
  <input type="hidden" name="event_group_id" value="<?php if ( !empty( $data->event_group_id ) && $mode != 'copy' ) { echo $data->event_group_id; } else { echo mc_group_id(); } ?>" />
879
  <input type="hidden" name="event_action" value="<?php echo $mode; ?>" />
881
  <input type="hidden" name="event_instance" value="<?php echo (int) $_GET['date']; ?>" />
882
  <?php } ?>
883
  <input type="hidden" name="event_id" value="<?php echo (int) $event_id; ?>" />
884
+ <?php if ( $mode == 'edit') { ?>
885
+ <input type='hidden' name='event_post' value="<?php echo $data->event_post; ?>" />
 
 
886
  <?php } ?>
887
+ <input type="hidden" name="event_author" value="<?php if ( $mode != 'edit') { echo $user_ID; } else { echo $data->event_author; } ?>" />
888
  <input type="hidden" name="event_nonce_name" value="<?php echo wp_create_nonce('event_nonce'); ?>" />
889
  </div>
890
 
891
  <div class="ui-sortable meta-box-sortables">
892
+ <div class="postbox">
893
+ <?php
894
+ if ( isset($_GET['mode']) && $_GET['mode'] == 'edit' ) {
895
+ $text = __( 'Edit Event', 'my-calendar' );
896
+ $delete = " &middot; <a href='".admin_url("admin.php?page=my-calendar-manage&amp;mode=delete&amp;event_id=$data->event_id")."' class='delete'>".__('Delete','my-calendar')."</a>";
897
+ } else {
898
+ $text = __('Add Event', 'my-calendar' );
899
+ $delete = '';
900
+ }
901
+ $post_id = ( $has_data ) ? $data->event_post : false;
902
+ if ( $has_data && !$data->event_post ) {
903
+ $array_data = (array) $data;
904
+ $post_id = mc_event_post( 'add', $array_data, $data->event_id );
905
+ }
906
+ if ( get_option( 'mc_use_permalinks' ) == 'true' ) {
907
+ $post_link = ( $post_id ) ? get_edit_post_link( $post_id ) : false;
908
+ $text_link = ( $post_link ) ? sprintf( " &middot; <a href='%s'>".__('Edit Event Post','my-calendar')."</a>", $post_link ) : '';
909
+ } else {
910
+ $text_link = '';
911
+ }
912
+ ?>
913
+ <h3><?php echo $text; ?> <span class="alignright"><a href="<?php echo admin_url('admin.php?page=my-calendar-manage'); ?>"><?php _e('Manage events','my-calendar'); ?></a><?php echo $delete; echo $text_link; ?></span>
914
+ </h3>
915
  <div class="inside">
916
+ <?php
917
+ if ( !empty( $_GET['date'] ) && $data->event_recur != 'S') {
918
  $event = mc_get_event( $instance );
919
  $date = date_i18n( get_option('mc_date_format'),strtotime( $event->occur_begin ) );
920
  $message = __("You are editing the <strong>$date</strong> instance of this event. Other instances of this event will not be changed.",'my-calendar');
925
  }
926
  ?>
927
  <fieldset>
928
+ <legend><?php _e( 'Event Details','my-calendar' ); ?></legend>
929
  <p>
930
+ <label for="e_title"><?php _e('Event Title','my-calendar'); ?> <span class='required'><?php _e('(required)','my-calendar'); ?></span></label><br /><input type="text" id="e_title" name="event_title" size="50" maxlength="255" value="<?php if ( $has_data ) echo apply_filters( 'mc_manage_event_title',stripslashes( esc_attr( $data->event_title ) ), $data ); ?>" /><?php
931
+ if ( $mode == 'edit') { ?>
932
+ <input type='hidden' name='prev_event_status' value='<?php echo $data->event_approved; ?>' /><?php
933
+ if ( get_option( 'mc_event_approve') == 'true') {
934
+ if ( current_user_can( 'mc_approve_events') ) { // Added by Roland P.
935
+ if ( $has_data && $data->event_approved == '1') {
936
+ $checked = " checked=\"checked\"";
937
+ } else if ( $has_data && $data->event_approved == '0') {
938
+ $checked = "";
939
+ } else if ( get_option( 'mc_event_approve') == 'true' ) {
940
+ $checked = "checked=\"checked\"";
941
+ } ?>
942
+ <input type="checkbox" value="1" id="e_approved" name="event_approved"<?php echo $checked; ?> /> <label for="e_approved"><?php _e('Approve','my-calendar'); ?></label><?php
943
+ } else { // case: editing, approval enabled, user cannot approve ?>
944
+ <input type="hidden" value="0" name="event_approved" /><?php _e( 'An administrator must approve your new event.','my-calendar' );
945
+ }
946
+ } else { // Case: editing, approval system is disabled - auto approve ?>
947
+ <input type="hidden" value="1" name="event_approved" /><?php
948
  }
949
+ } else { // case: adding new event (if use can, then 1, else 0)
950
+ if ( get_option( 'mc_event_approve') != 'true') {
 
 
 
951
  $dvalue = 1;
952
+ } else if ( current_user_can( 'mc_approve_events') ) { $dvalue = 1; } else { $dvalue = 0; } ?>
953
+ <input type="hidden" value="<?php echo $dvalue; ?>" name="event_approved" /><?php
954
+ } ?>
955
  </p>
956
  <?php if ( is_object($data) && $data->event_flagged == 1 ) { ?>
957
  <div class="error">
958
  <p>
959
+ <input type="checkbox" value="0" id="e_flagged" name="event_flagged"<?php if ( $has_data && $data->event_flagged == '0') { echo " checked=\"checked\""; } else if ( $has_data && $data->event_flagged == '1') { echo ""; } ?> /> <label for="e_flagged"><?php _e('This event is not spam','my-calendar'); ?></label>
960
  </p>
961
  </div>
962
  <?php }
963
+ if ( function_exists( 'jd_doTwitterAPIPost' ) && current_user_can ( 'wpt_can_tweet') ) {
964
+ if ( !( $mode == 'edit'&& $data->event_approved == 1 ) ) { ?>
965
  <p>
966
  <label for='mc_twitter'><?php _e('Post to Twitter (via WP to Twitter)','my-calendar'); ?></label><br />
967
  <textarea cols='70' rows='2' id='mc_twitter' name='mc_twitter'><?php do_action( 'mc_twitter_text', $data ); ?></textarea>
968
+ </p><?php
 
 
 
 
 
 
 
 
 
 
 
 
969
  }
970
+ }
971
+ mc_show_block( 'event_desc', $has_data, $data );
972
+ mc_show_block( 'event_short', $has_data, $data );
973
+ mc_show_block( 'event_image', $has_data, $data );
974
+ ?>
 
 
 
 
 
 
 
 
 
 
 
975
  <p>
976
+ <label for="e_host"><?php _e('Host','my-calendar'); ?></label>
977
+ <select id="e_host" name="event_host">
978
+ <?php
979
+ // Grab all the categories and list them
980
+ $users = my_calendar_getUsers();
981
+ foreach( $users as $u ) {
982
+ $display_name = ( $u->display_name == '') ? $u->user_nicename : $u->display_name;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
983
  if ( is_object($data) && $data->event_host == $u->ID ) {
984
+ $selected = ' selected="selected"';
985
+ } else if ( is_object($u) && $u->ID == $user_ID && empty( $data->event_host ) ) {
986
+ $selected = ' selected="selected"';
987
+ } else {
988
+ $selected = '';
989
  }
990
+ echo "<option value='$u->ID'$selected>$display_name</option>\n";
991
+ }
992
+ ?>
 
 
 
 
 
 
 
 
993
  </select>
994
+ </p>
995
+ <?php
996
+ mc_show_block( 'event_category', $has_data, $data );
997
+ mc_show_block( 'event_link', $has_data, $data );
998
+ echo apply_filters( 'mc_event_details', '', $has_data, $data, 'admin' );
999
+ ?>
 
 
 
1000
  </fieldset>
1001
  </div>
1002
  </div>
1004
 
1005
  <div class="ui-sortable meta-box-sortables">
1006
  <div class="postbox">
1007
+ <h3><?php _e('Date and Time','my-calendar'); ?></h3>
1008
  <div class="inside">
1009
+ <?php if ( is_object( $data ) ) { // information for rewriting recurring data ?>
1010
  <input type="hidden" name="prev_event_begin" value="<?php echo $data->event_begin; ?>" />
1011
  <input type="hidden" name="prev_event_time" value="<?php echo $data->event_time; ?>" />
1012
  <input type="hidden" name="prev_event_end" value="<?php echo $data->event_end; ?>" />
1013
  <input type="hidden" name="prev_event_endtime" value="<?php echo $data->event_endtime; ?>" />
1014
  <?php } ?>
1015
  <fieldset><legend><?php _e('Event Date and Time','my-calendar'); ?></legend>
1016
+ <div id="e_schedule">
1017
+ <div id="event1" class="clonedInput" aria-live="polite">
1018
+ <?php echo apply_filters( 'mc_datetime_inputs', '', $has_data, $data, 'admin' ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1019
  </div>
1020
+ <?php if ( $mode != 'edit') { ?>
1021
+ <p id="event_span">
1022
+ <input type="checkbox" value="1" id="e_span" name="event_span"<?php if ( $has_data && $data->event_span == '1') { echo " checked=\"checked\""; } else if ( $has_data && $data->event_span == '0') { echo ""; } else if ( get_option( 'mc_event_span') == 'true') { echo " checked=\"checked\""; } ?> /> <label for="e_span"><?php _e('This is a multi-day event.','my-calendar'); ?></label>
1023
  </p>
1024
+ <p class="note"><em><?php _e('Enter start and end dates/times for each occurrence of the event.','my-calendar'); ?></em></p>
1025
  <div>
1026
  <input type="button" id="add_field" value="<?php _e('Add another occurrence','my-calendar'); ?>" class="button" />
1027
  <input type="button" id="del_field" value="<?php _e('Remove last occurrence','my-calendar'); ?>" class="button" />
1028
  </div>
1029
  <?php } else { ?>
1030
+ <div id='mc-accordion'>
1031
+ <?php if ( $data->event_recur != 'S') { ?>
1032
+ <h4><?php _e('Scheduled dates for this event','my-calendar'); ?></h4>
1033
+ <div>
1034
+ <?php _e('Editing a single date of an event changes only that date. Editing the root event changes all events in the series.','my-calendar'); ?>
1035
  <ul class="columns">
1036
+ <?php if ( isset( $_GET['date'] ) ) { $date = (int) $_GET['date']; } else { $date = false; } ?>
1037
  <?php echo mc_instance_list( $data->event_id, $date ); ?>
1038
  </ul>
1039
+ </div>
1040
  <?php } ?>
1041
  <?php if ( $data->event_group_id != 0 ) { ?>
1042
  <?php
1043
  $edit_group_url = admin_url('admin.php?page=my-calendar-groups&mode=edit&event_id='.$data->event_id.'&group_id='.$data->event_group_id);
1044
  ?>
1045
  <h4><?php _e('Related Events:','my-calendar'); ?> (<a href='<?php echo $edit_group_url; ?>'><?php _e('Edit group','my-calendar'); ?></a>)</h4>
1046
+ <div>
1047
  <ul class="columns">
1048
  <?php mc_related_events( $data->event_group_id ); ?>
1049
+ </ul>
1050
+ </div>
1051
  <?php } ?>
1052
+ </div>
1053
  <?php } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1054
  </div>
1055
+ </fieldset>
1056
+ </div>
1057
+ </div>
1058
+ </div>
1059
+ <?php
1060
+ mc_show_block( 'event_recur', $has_data, $data );
1061
+ mc_show_block( 'event_access', $has_data, $data );
1062
+ mc_show_block( 'event_open', $has_data, $data );
1063
 
1064
+ if ( mc_show_edit_block( 'event_location') || mc_show_edit_block( 'event_location_dropdown') ) { ?>
 
 
1065
 
1066
+ <div class="ui-sortable meta-box-sortables">
1067
+ <div class="postbox">
1068
+ <h3><?php _e('Event Location','my-calendar'); ?></h3>
1069
+ <div class="inside location_form">
1070
+ <fieldset>
1071
+ <legend><?php _e('Event Location','my-calendar'); ?></legend><?php
1072
+ }
1073
+ if ( mc_show_edit_block( 'event_location_dropdown') ) {
1074
+ $locs = $mcdb->get_results( "SELECT location_id,location_label FROM " . my_calendar_locations_table() . " ORDER BY location_label ASC" );
1075
+ if ( !empty($locs) ) { ?>
1076
+ <p>
1077
+ <label for="l_preset"><?php _e('Choose a preset location:','my-calendar'); ?></label> <select name="location_preset" id="l_preset">
1078
+ <option value="none"> -- </option><?php
1079
+ foreach ( $locs as $loc ) {
1080
+ echo "<option value=\"".$loc->location_id."\">".stripslashes( $loc->location_label )."</option>";
1081
+ } ?>
1082
+ </select>
1083
+ </p><?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1084
  } else { ?>
1085
+ <input type="hidden" name="location_preset" value="none" />
1086
+ <p><a href="<?php echo admin_url('admin.php?page=my-calendar-locations'); ?>"><?php _e('Add recurring locations for later use.','my-calendar'); ?></a></p><?php
1087
+ }
1088
+ } else { ?>
1089
+ <input type="hidden" name="location_preset" value="none" /><?php
1090
+ }
1091
+ mc_show_block( 'event_location', $has_data, $data );
1092
+ if ( mc_show_edit_block( 'event_location') || mc_show_edit_block( 'event_location_dropdown') ) { ?>
1093
+ </fieldset>
1094
+ </div>
1095
+ </div>
1096
+ </div><?php
1097
+ }
1098
+ if ( mc_show_edit_block( 'event_specials') ) { ?>
1099
+ <div class="ui-sortable meta-box-sortables">
1100
+ <div class="postbox">
1101
+ <h3><?php _e('Special scheduling options','my-calendar'); ?></h3>
1102
+ <div class="inside">
1103
+ <fieldset>
1104
+ <legend><?php _e('Special Options','my-calendar'); ?></legend>
1105
+ <p>
1106
+ <label for="e_holiday"><?php _e('Cancel this event if it occurs on a date with an event in the Holidays category','my-calendar'); ?></label> <input type="checkbox" value="true" id="e_holiday" name="event_holiday"<?php if ( $has_data && $data->event_holiday == '1') { echo " checked=\"checked\""; } else if ( $has_data && $data->event_holiday == '0') { echo ""; } else if ( get_option( 'mc_skip_holidays') == 'true') { echo " checked=\"checked\""; } ?> />
1107
+ </p>
1108
+ <p>
1109
+ <label for="e_fifth_week"><?php _e('If this event recurs, and falls on the 5th week of the month in a month with only four weeks, move it back one week.','my-calendar'); ?></label> <input type="checkbox" value="true" id="e_fifth_week" name="event_fifth_week"<?php if ( $has_data && $data->event_fifth_week == '1') { echo " checked=\"checked\""; } else if ( $has_data && $data->event_fifth_week == '0') { echo ""; } else if ( get_option( 'mc_no_fifth_week') == 'true') { echo " checked=\"checked\""; } ?> />
1110
+ </p>
1111
+ </fieldset>
1112
+ </div>
1113
+ </div>
1114
+ </div><?php
1115
  } else { ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1116
  <div>
1117
+ <input type="hidden" name="event_holiday" value="true"<?php if ( get_option( 'mc_skip_holidays') == 'true') { echo " checked=\"checked\""; } ?> />
1118
+ <input type="hidden" name="event_fifth_week" value="true"<?php if ( get_option( 'mc_no_fifth_week') == 'true') { echo " checked=\"checked\""; } ?>/>
1119
+ </div><?php
1120
+ } ?>
1121
  <p>
1122
+ <input type="submit" name="save" class="button-primary" value="<?php _e('Save Event','my-calendar'); ?>" />
1123
  </p>
1124
+ </form>
1125
+ </div>
1126
+ </div><?php
1127
+ }
1128
 
1129
+ function mc_event_accessibility( $form, $data, $label ) {
1130
+ $note_value = '';
1131
+ $events_access = array();
1132
+ $form .= "
1133
+ <fieldset>
1134
+ <legend>$label</legend>
1135
+ <ul class='accessibility-features checkboxes'>";
1136
+ $access = apply_filters( 'mc_event_accessibility', get_option( 'mc_event_access') );
1137
+ if ( !empty( $data ) ) {
1138
+ $events_access = get_post_meta( $data->event_post, '_mc_event_access', true );
1139
+ }
1140
+ foreach ( $access as $k=>$a ) {
1141
+ $id = "events_access_$k";
1142
+ $label = $a;
1143
+ $checked = '';
1144
+ if ( is_array( $events_access ) ) {
1145
+ $checked = ( in_array( $k, $events_access ) || in_array( $a, $events_access ) ) ? " checked='checked'" : '';
1146
+ }
1147
+ $item = sprintf( '<li><input type="checkbox" id="%1$s" name="events_access[]" value="%4$s" class="checkbox" %2$s /> <label for="%1$s">%3$s</label></li>', $id, $checked, $label, $a );
1148
+ $form .= $item;
1149
+ }
1150
+ if ( isset( $events_access['notes'] ) ) { $note_value = esc_attr( $events_access['notes'] ); }
1151
+ $form .= '<li><label for="events_access_notes">'.__('Notes','my-calendar').'</label> <input type="text" name="events_access[notes]" value="'.$note_value.'" /></li>';
1152
+ $form .= "</ul>
1153
+ </fieldset>";
1154
+ return $form;
1155
+ }
1156
 
1157
  // Used on the manage events admin page to display a list of events
1158
+ function mc_list_events( $type='normal') {
1159
  global $wpdb;
1160
  $mcdb = $wpdb;
1161
+ if ( current_user_can( 'mc_approve_events') || current_user_can( 'mc_manage_events') || current_user_can( 'mc_add_events') ) {
1162
  $sortby = ( isset( $_GET['sort'] ) )?(int) $_GET['sort']:get_option('mc_default_sort');
1163
 
1164
  if ( isset( $_GET['order'] ) ) {
1165
+ $sortdir = ( isset($_GET['order']) && $_GET['order'] == 'ASC')?'ASC':'default';
1166
  } else {
1167
  $sortdir = 'default';
1168
  }
1169
+ if ( empty($sortby) ) {
1170
+ $sortbyvalue = 'event_begin';
1171
+ } else {
1172
+ switch ($sortby) {
1173
+ case 1:$sortbyvalue = 'event_ID';break;
1174
+ case 2:$sortbyvalue = 'event_title';break;
1175
+ case 3:$sortbyvalue = 'event_desc';break;
1176
+ case 4:$sortbyvalue = 'event_begin';break;
1177
+ case 5:$sortbyvalue = 'event_author';break;
1178
+ case 6:$sortbyvalue = 'event_category';break;
1179
+ case 7:$sortbyvalue = 'event_label';break;
1180
+ default:$sortbyvalue = 'event_begin';
1181
+ }
1182
  }
1183
+ $sortbydirection = ($sortdir == 'default')?'DESC':$sortdir;
1184
+ $sorting = ($sortbydirection == 'DESC')?"&amp;order=ASC":'';
1185
+ $allow_filters = true;
1186
+ $status = ( isset($_GET['limit']) )?$_GET['limit']:'all';
1187
+ $restrict = ( isset( $_GET['restrict'] ) )?$_GET['restrict']:'all';
1188
+ switch ($status) {
1189
+ case 'all':$limit = '';break;
1190
+ case 'reserved':$limit = 'WHERE event_approved <> 1';break;
1191
+ case 'published':$limit = 'WHERE event_approved = 1';break;
1192
+ default:$limit = '';
1193
+ }
1194
+ switch ( $restrict ) {
1195
+ case 'all':$filter='';break;
1196
+ case 'where':$filter =( isset( $_GET['filter'] ) )?$_GET['filter']:''; $restrict = "event_label"; break;
1197
+ case 'author':$filter =( isset( $_GET['filter'] ) )?(int) $_GET['filter']:''; $restrict = "event_author"; break;
1198
+ case 'category':$filter =( isset( $_GET['filter'] ) )?(int) $_GET['filter']:''; $restrict = "event_category"; break;
1199
+ case 'flagged':$filter = ( isset( $_GET['filter'] ) )?(int) $_GET['filter']:''; $restrict = "event_flagged"; break;
1200
+ default:$filter='';
1201
+ }
1202
+ if ( !current_user_can( 'mc_manage_events') && !current_user_can( 'mc_approve_events') ) {
1203
+ $restrict = 'event_author'; $filter = get_current_user_id();
1204
+ $allow_filters = false;
1205
+ }
1206
+ $filter = esc_sql( urldecode( $filter ) );
1207
+ if ( $restrict == "event_label" ) { $filter = "'$filter'"; }
1208
+ if ( $limit == '' && $filter != '' ) {
1209
+ $limit = "WHERE $restrict = $filter";
1210
+ } else if ( $limit != ''&& $filter != '' ) {
1211
+ $limit .= "AND $restrict = $filter";
1212
+ }
1213
+ if ( $filter == '' || !$allow_filters ) {
1214
+ $filtered = "";
1215
+ } else {
1216
+ $filtered = "<span class='dashicons dashicons-no'></span><a href='".admin_url('admin.php?page=my-calendar-manage')."'>".__('Clear filters','my-calendar')."</a>";
1217
+ }
1218
+ $current = empty( $_GET['paged'] ) ? 1 : intval( $_GET['paged'] );
1219
+ $user = get_current_user_id();
1220
+ $screen = get_current_screen();
1221
+ $option = $screen->get_option( 'per_page', 'option' );
1222
+ $items_per_page = get_user_meta( $user, $option, true );
1223
+ if ( empty( $items_per_page ) || $items_per_page < 1 ) {
1224
+ $items_per_page = $screen->get_option( 'per_page', 'default');
1225
+ }
1226
+ // default limits
1227
+ if ( $limit == '' ) {
1228
+ $limit .= ( $restrict != 'event_flagged' ) ? " WHERE event_flagged = 0" : '';
1229
+ } else {
1230
+ $limit .= ( $restrict != 'event_flagged' ) ? " AND event_flagged = 0" : '';
1231
+ }
1232
+ if ( isset( $_POST['mcs'] ) ) {
1233
+ $query = esc_sql( $_POST['mcs'] );
1234
+ $limit .= " AND MATCH(event_title,event_desc,event_short,event_label,event_city) AGAINST ('$query' IN BOOLEAN MODE) ";
1235
+ }
1236
+ $limit .= ( $restrict != 'archived' ) ? " AND event_status = 1" : ' AND event_status = 0';
1237
+ $events = $mcdb->get_results( "SELECT SQL_CALC_FOUND_ROWS * FROM " . my_calendar_table() . " $limit ORDER BY $sortbyvalue $sortbydirection LIMIT ".( ( $current-1 )*$items_per_page ).", ".$items_per_page );
1238
+ $found_rows = $wpdb->get_col("SELECT FOUND_ROWS();");
1239
+ $items = $found_rows[0];
1240
+ if ( ( function_exists( 'akismet_http_post') || function_exists( 'bs_checker') ) && $allow_filters ) { ?>
1241
+ <ul class="links">
1242
+ <li><a <?php echo ( isset($_GET['restrict']) && $_GET['restrict']=='flagged')?'class="active-link"':''; ?> href="<?php echo admin_url('admin.php?page=my-calendar-manage&amp;restrict=flagged&amp;filter=1'); ?>"><?php _e('Spam','my-calendar'); ?></a></li>
1243
+ </ul><?php
1244
+ }
1245
+ ?>
1246
+ <div class='mc-search'>
1247
+ <form action="<?php echo add_query_arg( $_GET, admin_url('admin.php') ); ?>" method="post">
1248
+ <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div>
1249
+ <div>
1250
+ <label for="mc_search" class='screen-reader-text'><?php _e( 'Search','my-calendar' ); ?></label> <input type='text' role='search' name='mcs' id='mc_search' value='<?php if ( isset( $_POST['mcs'] ) ) { esc_attr_e( $_POST['mcs'] ); } ?>' /> <input type='submit' value='<?php _e('Search Events','my-calendar'); ?>' class='button-secondary' />
1251
+ </div>
1252
+ </form>
1253
+ </div>
1254
+ <?php
1255
+ if ( get_option('mc_event_approve') == 'true' ) { ?>
1256
+ <ul class="links">
1257
+ <li><a <?php echo ( isset($_GET['limit']) && $_GET['limit']=='published')?'class="active-link"':''; ?> href="<?php echo admin_url('admin.php?page=my-calendar-manage&amp;limit=published'); ?>"><?php _e('Published','my-calendar'); ?></a></li>
1258
+ <li><a <?php echo ( isset($_GET['limit']) && $_GET['limit']=='reserved')?'class="active-link"':''; ?> href="<?php echo admin_url('admin.php?page=my-calendar-manage&amp;limit=reserved'); ?>"><?php _e('Reserved','my-calendar'); ?></a></li>
1259
+ <li><a <?php echo ( isset($_GET['limit']) && $_GET['limit']=='all'|| !isset($_GET['limit']))?'class="active-link"':''; ?> href="<?php echo admin_url('admin.php?page=my-calendar-manage&amp;limit=archived'); ?>"><?php _e('Archived','my-calendar'); ?></a></li>
1260
+ <li><a <?php echo ( isset($_GET['limit']) && $_GET['limit']=='all'|| !isset($_GET['limit']))?'class="active-link"':''; ?> href="<?php echo admin_url('admin.php?page=my-calendar-manage&amp;limit=all'); ?>"><?php _e('All','my-calendar'); ?></a></li>
1261
+ </ul><?php
1262
+ }
1263
+ echo $filtered;
1264
  $num_pages = ceil($items / $items_per_page);
1265
  if ( $num_pages > 1 ) {
1266
  $page_links = paginate_links( array(
1267
+ 'base'=> add_query_arg( 'paged', '%#%'),
1268
+ 'format'=> '',
1269
+ 'prev_text'=> __( '&laquo; Previous<span class="screen-reader-text"> Events</span>','my-calendar' ),
1270
+ 'next_text'=> __( 'Next<span class="screen-reader-text"> Events</span> &raquo;','my-calendar' ),
1271
+ 'total'=> $num_pages,
1272
+ 'current'=> $current,
1273
+ 'mid_size'=> 1
1274
  ));
1275
+ printf( "<div class='tablenav'><div class='tablenav-pages'>%s</div></div>", $page_links );
 
 
 
 
1276
  }
1277
+ if ( !empty($events) ) {
 
 
1278
  ?>
1279
+ <form action="<?php echo add_query_arg( $_GET, admin_url('admin.php') ); ?>" method="post">
1280
  <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div>
1281
+ <div class='mc-actions'>
1282
+ <input type="submit" class="button-secondary delete" name="mass_delete" value="<?php _e( 'Delete events','my-calendar' ); ?>" />
1283
  <?php if ( current_user_can('mc_approve_events') ) { ?>
1284
+ <input type="submit" class="button-secondary mc-approve" name="mass_approve" value="<?php _e( 'Approve events','my-calendar' ); ?>" />
1285
+ <?php } ?>
1286
+ <?php if ( !( isset($_GET['restrict']) && $_GET['restrict'] == 'archived' ) ) { ?>
1287
+ <input type="submit" class="button-secondary mc-archive" name="mass_archive" value="<?php _e( 'Archive events','my-calendar' ); ?>" />
1288
  <?php } ?>
1289
  </div>
1290
 
1291
  <table class="widefat wp-list-table" id="my-calendar-admin-table">
1292
  <thead>
1293
  <tr>
1294
+ <th scope="col" style="width: 50px;"><input type='checkbox'class='selectall'id='mass_edit'/> <label for='mass_edit'><b><?php __('Check/Uncheck all','my-calendar'); ?></b></label> <a href="<?php echo admin_url("admin.php?page=my-calendar-manage&amp;sort=1$sorting"); ?>"><?php _e('ID','my-calendar') ?></a></th>
1295
  <th scope="col"><a href="<?php echo admin_url("admin.php?page=my-calendar-manage&amp;sort=2$sorting"); ?>"><?php _e('Title','my-calendar') ?></a></th>
1296
  <th scope="col"><a href="<?php echo admin_url("admin.php?page=my-calendar-manage&amp;sort=7$sorting"); ?>"><?php _e('Location','my-calendar') ?></a></th>
1297
  <th scope="col"><a href="<?php echo admin_url("admin.php?page=my-calendar-manage&amp;sort=4$sorting"); ?>"><?php _e('Date/Time','my-calendar') ?></a></th>
1306
 
1307
  foreach ( array_keys($events) as $key ) {
1308
  $event =& $events[$key];
1309
+ $class = ($class == 'alternate') ? '': 'alternate';
1310
+ $pending = ($event->event_approved == 0) ? 'pending': '';
1311
  $author = ( $event->event_author != 0 )?get_userdata($event->event_author):'Public Submitter';
1312
  $title = $event->event_title;
1313
 
1314
+ if ( $event->event_flagged == 1 && ( isset( $_GET['restrict'] ) && $_GET['restrict'] == 'flagged') ) {
1315
+ $spam = 'spam';
1316
  $pending = '';
1317
  $spam_label = '<strong>'.__('Possible spam','my-calendar').':</strong> ';
1318
  } else {
1319
  $spam = '';
1320
  $spam_label = '';
1321
  }
1322
+ if ( current_user_can( 'mc_manage_events') || current_user_can( 'mc_approve_events') || mc_can_edit_event( $event->event_author ) ) {
1323
  ?>
1324
  <tr class="<?php echo "$class $spam $pending"; ?>">
1325
+ <th scope="row"><input type="checkbox" value="<?php echo $event->event_id; ?>" name="mass_edit[]" id="mc<?php echo $event->event_id; ?>" <?php echo ($event->event_flagged == 1)?'checked="checked"':''; ?> /> <label for="mc<?php echo $event->event_id; ?>"><?php echo $event->event_id; ?></label></th>
1326
  <td title="<?php echo esc_attr(substr(strip_tags(stripslashes($event->event_desc)),0,240)); ?>">
1327
  <strong><?php if ( mc_can_edit_event( $event->event_author ) ) { ?>
1328
  <a href="<?php echo admin_url("admin.php?page=my-calendar&amp;mode=edit&amp;event_id=$event->event_id"); ?>" class='edit'>
1329
  <?php } ?>
1330
  <?php echo $spam_label; echo stripslashes($title); ?>
1331
  <?php if ( mc_can_edit_event( $event->event_author ) ) { echo "</a>"; } ?></strong>
1332
+ <div class='row-actions'style="visibility:visible;">
1333
  <a href="<?php echo admin_url("admin.php?page=my-calendar&amp;mode=copy&amp;event_id=$event->event_id"); ?>" class='copy'><?php _e('Copy','my-calendar'); ?></a> |
1334
  <?php if ( mc_can_edit_event( $event->event_author ) ) { ?>
1335
  <a href="<?php echo admin_url("admin.php?page=my-calendar&amp;mode=edit&amp;event_id=$event->event_id"); ?>" class='edit'><?php _e('Edit','my-calendar'); ?></a> <?php if ( mc_event_is_grouped( $event->event_group_id ) ) { ?>
1337
  <?php } ?>
1338
  | <a href="<?php echo admin_url("admin.php?page=my-calendar-manage&amp;mode=delete&amp;event_id=$event->event_id"); ?>" class="delete"><?php _e('Delete','my-calendar'); ?></a>
1339
  <?php } else { _e("Not editable.",'my-calendar'); } ?>
1340
+ <?php if ( get_option( 'mc_event_approve') == 'true') { ?>
1341
  |
1342
+ <?php if ( current_user_can( 'mc_approve_events') ) { // Added by Roland P.?>
1343
+ <?php if ( $event->event_approved == '1') { $mo = 'reject'; $te = __('Reject','my-calendar'); } else { $mo = 'publish'; $te = __('Approve','my-calendar'); } ?>
1344
  <a href="<?php echo admin_url("admin.php?page=my-calendar-manage&amp;mode=$mo&amp;event_id=$event->event_id"); ?>" class='<?php echo $mo; ?>'><?php echo $te; ?></a>
1345
  <?php
1346
  } else {
1353
  } ?>
1354
  </div>
1355
  </td>
1356
+ <td><?php if ( $event->event_label != '') { ?><a class='mc_filter'href='<?php $elabel = urlencode($event->event_label); echo admin_url("admin.php?page=my-calendar-manage&amp;filter=$elabel&amp;restrict=where"); ?>' title="<?php _e('Filter by location','my-calendar'); ?>"><span class="screen-reader-text"><?php _e('Show only: ', 'my-calendar'); ?></span><?php echo stripslashes($event->event_label); ?></a><?php } ?></td>
1357
  <?php if ($event->event_time != "00:00:00") { $eventTime = date_i18n(get_option('mc_time_format'), strtotime($event->event_time)); } else { $eventTime = get_option('mc_notime_text'); } ?>
1358
  <td><?php $begin = date_i18n( get_option('mc_date_format'), strtotime( $event->event_begin ) ); echo "$begin, $eventTime"; ?>
1359
  <div class="recurs">
1381
  ?>
1382
  </div>
1383
  </td>
1384
+ <td><a class='mc_filter' href="<?php $auth = (is_object($author))?$author->ID:0; echo admin_url("admin.php?page=my-calendar-manage&amp;filter=$auth&amp;restrict=author"); ?>" title="<?php _e('Filter by author','my-calendar'); ?>"><span class="screen-reader-text"><?php _e('Show only: ', 'my-calendar'); ?></span><?php echo ( is_object($author)?$author->display_name:$author ); ?></a></td>
1385
  <?php
1386
  $this_category = $event->event_category;
1387
  foreach ($categories as $key=>$value) {
1390
  }
1391
  }
1392
  ?>
1393
+ <td><div class="category-color" style="background-color:<?php echo (strpos($this_cat->category_color,'#') !== 0)?'#':''; echo $this_cat->category_color;?>;"> </div> <a class='mc_filter' href='<?php echo admin_url("admin.php?page=my-calendar-manage&amp;filter=$event->event_category&amp;restrict=category"); ?>' title="<?php _e('Filter by category','my-calendar'); ?>"><span class="screen-reader-text"><?php _e('Show only: ', 'my-calendar'); ?></span><?php echo stripslashes($this_cat->category_name); ?></a></td>
1394
  <?php unset($this_cat); ?>
1395
  </tr>
1396
  <?php
1397
+ }
1398
  }
1399
  ?>
1400
  </table>
1401
  <p>
1402
+ <input type="submit" class="button-secondary delete" name="mass_delete" value="<?php _e('Delete events','my-calendar'); ?>" />
1403
  <?php if ( current_user_can('mc_approve_events') ) { ?>
1404
+ <input type="submit" class="button-secondary mc-approve" name="mass_approve" value="<?php _e('Approve events','my-calendar'); ?>" />
1405
+ <?php } ?>
1406
+ <?php if ( !( isset($_GET['restrict']) && $_GET['restrict'] == 'archived' ) ) { ?>
1407
+ <input type="submit" class="button-secondary mc-archive" name="mass_archive" value="<?php _e( 'Archive events','my-calendar' ); ?>" />
1408
+ <?php } ?>
1409
+ </p>
1410
+ <p>
1411
+ <?php if ( !( isset($_GET['restrict']) && $_GET['restrict'] == 'archived' ) ) { ?>
1412
+ <a class='mc_filter' href='<?php echo admin_url("admin.php?page=my-calendar-manage&amp;restrict=archived"); ?>'><?php _e('View Archived Events','my-calendar'); ?></a>
1413
+ <?php } else { ?>
1414
+ <a class='mc_filter' href='<?php echo admin_url("admin.php?page=my-calendar-manage"); ?>'><?php _e('Return to Manage Events','my-calendar'); ?></a>
1415
  <?php } ?>
1416
  </p>
1417
  </form>
1418
  <?php
1419
+ } else { ?>
1420
+ <p><?php _e("There are no events in the database meeting your current criteria.",'my-calendar') ?></p><?php
 
1421
  }
 
 
 
 
1422
  }
1423
  }
1424
 
1426
  $post = apply_filters( 'mc_pre_checkdata', $post, $action, $i );
1427
  global $wpdb, $current_user, $users_entries;
1428
  $mcdb = $wpdb;
 
 
1429
  $submit=array();
1430
+ $errors = '';
1431
+
1432
  if ( get_magic_quotes_gpc() ) { $post = array_map( 'stripslashes_deep', $post ); }
1433
+ if ( !wp_verify_nonce($post['event_nonce_name'],'event_nonce') ) { return; }
1434
 
1435
+ if ( $action == 'add'|| $action == 'edit'|| $action == 'copy') {
 
 
 
1436
  $title = !empty($post['event_title']) ? trim($post['event_title']) : '';
1437
  $desc = !empty($post['content']) ? trim($post['content']) : '';
1438
  $short = !empty($post['event_short']) ? trim($post['event_short']) : '';
1440
  $every = !empty($post['event_every']) ? (int) $post['event_every'] : 1;
1441
  // if this is an all weekdays event, and it's been scheduled to start on a weekend, the math gets nasty.
1442
  // ...AND there's no reason to allow it, since weekday events will NEVER happen on the weekend.
1443
+ $begin = trim( $post['event_begin'][$i] );
1444
+ $end = trim( $post['event_end'][$i] );
1445
+ if ( $recur == 'E'&& ( date( 'w', strtotime( $begin ) ) == 0 || date( 'w', strtotime( $begin ) ) == 6 ) ) {
1446
  if ( date( 'w', strtotime( $begin ) ) == 0 ) {
1447
  $newbegin = my_calendar_add_date( $begin, 1 );
1448
  if ( !empty( $post['event_end'][$i] ) ) {
1465
  $end = !empty($post['event_end'][$i]) ? trim($post['event_end'][$i]) : $begin;
1466
  }
1467
 
1468
+ $begin = date( 'Y-m-d',strtotime( $begin ) );// regardless of entry format, convert.
 
1469
  $time = !empty($post['event_time'][$i]) ? trim($post['event_time'][$i]) : '';
1470
+ $endtime = !empty($post['event_endtime'][$i]) ? trim( $post['event_endtime'][$i] ) : date( 'H:i:s',strtotime( $time . '+1 hour') );
1471
+ $endtime = ( $time == '' || $time == '00:00:00')?'00:00:00':$endtime; // set at midnight if all day.
1472
+ $endtime = ($endtime == '')?'00:00:00':date( 'H:i:00',strtotime($endtime) );
1473
+ // if the end time is midnight but the date is empty, change to tomorrow.
1474
+ if ( $endtime == '00:00:00' && $end == $begin ) {
1475
+ $end = date( 'Y-m-d', strtotime( $begin . ' +1 day' ) );
1476
+ }
1477
+ if ( isset($post['event_allday']) && (int) $post['event_allday'] !== 0 ) { $time = $endtime = '00:00:00'; }
1478
+ $end = date( 'Y-m-d',strtotime( $end ) );// regardless of entry format, convert.
1479
+ $repeats = ( !empty($post['event_repeats']) || trim($post['event_repeats'])=='') ? trim($post['event_repeats']) : 0;
1480
  $host = !empty($post['event_host']) ? $post['event_host'] : $current_user->ID;
1481
  $category = !empty($post['event_category']) ? $post['event_category'] : '';
1482
+ $event_link = !empty($post['event_link']) ? trim($post['event_link']) : '';
1483
  $expires = !empty($post['event_link_expires']) ? $post['event_link_expires'] : '0';
1484
  $approved = !empty($post['event_approved']) ? $post['event_approved'] : '0';
1485
  $location_preset = !empty($post['location_preset']) ? $post['location_preset'] : '';
1486
  $event_author = !empty($post['event_author']) ? $post['event_author'] : $current_user->ID;
1487
  $event_open = (isset($post['event_open']) && $post['event_open']!==0) ? $post['event_open'] : '2';
1488
+ $event_tickets = ( isset( $post['event_tickets'] ) ) ? trim($post['event_tickets']) : '';
1489
+ $event_registration = ( isset( $post['event_registration'] ) ) ? trim( $post['event_registration'] ) : '';
1490
  $event_group = !empty($post['event_group']) ? 1 : 0;
1491
  $event_flagged = ( !isset($post['event_flagged']) || $post['event_flagged']===0 )?0:1;
1492
  $event_image = ( isset($post['event_image']) )?esc_url_raw( $post['event_image'] ):'';
1493
  $event_fifth_week = !empty($post['event_fifth_week']) ? 1 : 0;
1494
  $event_holiday = !empty($post['event_holiday']) ? 1 : 0;
1495
  // get group id: if multiple events submitted, auto group OR if event being submitted is already part of a group; otherwise zero.
1496
+ $group_id_submitted = (int) $post['event_group_id'];
1497
  $event_group_id = ( ( is_array($post['event_begin']) && count($post['event_begin'])>1 ) || mc_event_is_grouped( $group_id_submitted) )?$group_id_submitted:0;
1498
+ $event_span = ( !empty( $post['event_span'] ) && $event_group_id != 0 ) ? 1 : 0;
1499
+ $event_hide_end = ( !empty( $post['event_hide_end'] ) ) ? (int) $post['event_hide_end'] : 0 ;
1500
+ $event_hide_end = ( $time == ''|| $time == '00:00:00')?1:$event_hide_end; // hide end time automatically on all day events
1501
  // set location
1502
+ if ( $location_preset != 'none') {
1503
  $sql = "SELECT * FROM " . my_calendar_locations_table() . " WHERE location_id = $location_preset";
1504
  $location = $mcdb->get_row($sql);
1505
  $event_label = $location->location_label;
1510
  $event_postcode = $location->location_postcode;
1511
  $event_region = $location->location_region;
1512
  $event_country = $location->location_country;
1513
+ $event_url = $location->location_url;
1514
  $event_longitude = $location->location_longitude;
1515
  $event_latitude = $location->location_latitude;
1516
  $event_zoom = $location->location_zoom;
1517
  $event_phone = $location->location_phone;
1518
+ $event_phone2 = $location->location_phone2;
1519
+ $event_access = $location->location_access;
1520
  } else {
1521
  $event_label = !empty($post['event_label']) ? $post['event_label'] : '';
1522
  $event_street = !empty($post['event_street']) ? $post['event_street'] : '';
1531
  $event_latitude = !empty($post['event_latitude']) ? $post['event_latitude'] : '';
1532
  $event_zoom = !empty($post['event_zoom']) ? $post['event_zoom'] : '';
1533
  $event_phone = !empty($post['event_phone'])? $post['event_phone'] : '';
1534
+ $event_phone2 = !empty($post['event_phone2'])? $post['event_phone2'] : '';
1535
+ $event_access = !empty($post['event_access'])? $post['event_access'] : array();
1536
+ $event_access = !empty($post['event_access_hidden']) ? unserialize( $post['event_access_hidden'] ) : $event_access;
1537
+ if ( isset($post['mc_copy_location']) && $post['mc_copy_location'] == 'on' && $i == 0 ) { // only the first event, if adding multiples.
1538
  $add_loc = array(
1539
  'location_label'=>$event_label,
1540
  'location_street'=>$event_street,
1548
  'location_longitude'=>$event_longitude,
1549
  'location_latitude'=>$event_latitude,
1550
  'location_zoom'=>$event_zoom,
1551
+ 'location_phone'=>$event_phone,
1552
+ 'location_phone2'=>$event_phone2,
1553
+ 'location_access'=>serialize( $event_access )
1554
  );
1555
+ $loc_formats = array( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%f', '%f', '%d', '%s', '%s', '%s' );
1556
  $results = $mcdb->insert( my_calendar_locations_table(), $add_loc, $loc_formats );
1557
  }
1558
  }
1559
+ // Perform validation on the submitted dates - checks for valid years and months
1560
+ if ( mc_checkdate( $begin ) && mc_checkdate( $end ) ) {
1561
+ // Make sure dates are equal or end date is later than start date
1562
+ if ( strtotime( $end ) < strtotime( $begin ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
1563
  $errors .= "<div class='error'><p><strong>".__('Error','my-calendar').":</strong> ".__('Your event end date must be either after or the same as your event begin date','my-calendar')."</p></div>";
1564
  }
1565
  } else {
1567
  }
1568
 
1569
  // We check for a valid time, or an empty one
1570
+ $time = ($time == '')?'00:00:00':date( 'H:i:00',strtotime( $time ) );
1571
  $time_format_one = '/^([0-1][0-9]):([0-5][0-9]):([0-5][0-9])$/';
1572
  $time_format_two = '/^([2][0-3]):([0-5][0-9]):([0-5][0-9])$/';
1573
+ if ( preg_match( $time_format_one,$time ) || preg_match( $time_format_two,$time ) || $time == '' ) {
 
1574
  } else {
1575
+ $errors .= "<div class='error'><p><strong>".__( 'Error','my-calendar' ).":</strong> ".__('The time field must either be blank or be entered in the format hh:mm am/pm','my-calendar')."</p></div>";
1576
  }
1577
  // We check for a valid end time, or an empty one
1578
+ if ( preg_match( $time_format_one,$endtime ) || preg_match( $time_format_two,$endtime ) || $endtime == '' ) {
 
 
1579
  } else {
1580
  $errors .= "<div class='error'><p><strong>".__('Error','my-calendar').":</strong> ".__('The end time field must either be blank or be entered in the format hh:mm am/pm','my-calendar')."</p></div>";
1581
  }
1582
+ // We check to make sure the URL is acceptable (blank or starting with http://)
1583
+ if ( $event_link == '' || preg_match('/^(http)(s?)(:)\/\//',$event_link) ) {
1584
+ $event_link = $event_link;
 
 
1585
  } else {
1586
+ $event_link = "http://" . $event_link;
1587
  }
1588
  }
1589
+ // A title is required, and can't be more than 255 characters.
1590
  $title_length = strlen($title);
1591
  if ( $title_length >= 1 && $title_length <= 255 ) {
 
1592
  } else {
1593
+ $errors .= "<div class='error'><p><strong>".__('Error','my-calendar').":</strong> ".__('An event title is required.','my-calendar')."</p></div>";
1594
  }
1595
+ // Run checks on recurrence profile
1596
+ if (( $repeats == 0 && $recur == 'S') || (($repeats >= 0) && ($recur == 'W'|| $recur == 'B'|| $recur == 'M'|| $recur == 'U'|| $recur == 'Y'|| $recur == 'D'|| $recur == 'E'))) {
 
1597
  $recur = $recur . $every;
1598
  } else {
1599
  $errors .= "<div class='error'><p><strong>".__('Error','my-calendar').":</strong> ".__('The repetition value must be 0 unless a type of recurrence is selected.','my-calendar')."</p></div>";
1602
  $conflicts = mcs_check_conflicts( $begin, $time, $end, $endtime, $event_label );
1603
  if ( $conflicts ) {
1604
  $errors .= "<div class='error'><p><strong>".__('Error','my-calendar').":</strong> ".__('That event conflicts with a previously scheduled event.','my-calendar')."</p></div>";
 
1605
  }
1606
+ }
1607
+ $spam = mc_spam( $event_link, $desc, $post );
1608
+ // the likelihood that something will be both flagged as spam and have a zero start time
1609
+ // and yet be legitimate is crazy minimal. Just kill it.
1610
+ if ( $spam == 1 && $begin == '1970-01-01' ) { echo $begin; die; }
1611
+ if ( $errors == '' ) {
1612
+ $ok = true;
1613
  $submit = array(
1614
  // strings
1615
  'event_begin'=>$begin,
1619
  'event_short'=>$short,
1620
  'event_time'=>$time,
1621
  'event_endtime'=>$endtime,
1622
+ 'event_link'=>$event_link,
1623
  'event_label'=>$event_label,
1624
  'event_street'=>$event_street,
1625
  'event_street2'=>$event_street2,
1632
  'event_recur'=>$recur,
1633
  'event_image'=>$event_image,
1634
  'event_phone'=>$event_phone,
1635
+ 'event_phone2'=>$event_phone2,
1636
+ 'event_access'=>serialize($event_access),
1637
+ 'event_tickets'=>$event_tickets,
1638
+ 'event_registration'=>$event_registration,
1639
  // integers
1640
  'event_repeats'=>$repeats,
1641
  'event_author'=>$event_author,
1646
  'event_group'=>$event_group,
1647
  'event_approved'=>$approved,
1648
  'event_host'=>$host,
1649
+ 'event_flagged'=> $spam,
1650
  'event_fifth_week'=>$event_fifth_week,
1651
  'event_holiday'=>$event_holiday,
1652
  'event_group_id'=>$event_group_id,
1657
  'event_latitude'=>$event_latitude
1658
  );
1659
  } else {
1660
+ $ok = false;
1661
  // The form is going to be rejected due to field validation issues, so we preserve the users entries here
1662
+ // all submitted data should be in this object, regardless of data destination.
1663
  $users_entries->event_title = $title;
1664
  $users_entries->event_desc = $desc;
1665
  $users_entries->event_begin = $begin;
1670
  $users_entries->event_repeats = $repeats;
1671
  $users_entries->event_host = $host;
1672
  $users_entries->event_category = $category;
1673
+ $users_entries->event_link = $event_link;
1674
  $users_entries->event_link_expires = $expires;
1675
  $users_entries->event_label = $event_label;
1676
  $users_entries->event_street = $event_street;
1685
  $users_entries->event_latitude = $event_latitude;
1686
  $users_entries->event_zoom = $event_zoom;
1687
  $users_entries->event_phone = $event_phone;
1688
+ $users_entries->event_phone2 = $event_phone2;
1689
  $users_entries->event_author = $event_author;
1690
  $users_entries->event_open = $event_open;
1691
  $users_entries->event_short = $short;
1698
  $users_entries->event_group_id = $event_group_id;
1699
  $users_entries->event_span = $event_span;
1700
  $users_entries->event_hide_end = $event_hide_end;
1701
+ $users_entries->event_access = serialize( $event_access );
1702
+ $users_entries->events_access = serialize( $events_access );
1703
+ $users_entries->event_tickets = $event_tickets;
1704
+ $users_entries->event_registration = $event_registration;
1705
  }
1706
+ $data = array( $ok, $users_entries, $submit, $errors );
 
1707
  return $data;
1708
  }
1709
 
1710
  function mcs_check_conflicts( $begin, $time, $end, $endtime, $event_label ) {
1711
  global $wpdb;
1712
+ $select_location = ( $event_label != '')?"event_label = '$event_label'AND":'';
1713
  $event_query = "SELECT occur_id
1714
  FROM " . MY_CALENDAR_EVENTS_TABLE . "
1715
  JOIN " . MY_CALENDAR_TABLE ."
1716
  ON (event_id=occur_event_id)
1717
  WHERE $select_location
1718
+ ( occur_begin BETWEEN '$begin $time'AND '$end $endtime'OR occur_end BETWEEN '$begin $time'AND '$end $endtime')";
1719
+ $results = $wpdb->get_results( $event_query );
1720
+ return ( !empty( $results ) ) ? $results : false;
 
 
 
 
1721
  }
1722
 
1723
  /* Event editing utilities */
1727
  //$comparison_test = array();
1728
  foreach ( $update as $k=>$v ) {
1729
  // event_recur and event_repeats always set to single and 0; event_begin and event_end need to be checked elsewhere.
1730
+ if ( $k != 'event_recur'&& $k != 'event_repeats'&& $k != 'event_begin'&& $k != 'event_end') {
1731
  $update_string .= trim($v);
1732
  $event_string .= trim($event->$k);
1733
  $v2 = $event->$k;
1748
  global $wpdb;
1749
  $mcdb = $wpdb;
1750
  if ( !empty($update) ) {
1751
+ $formats = array( '%d','%s','%s','%d');
1752
+ $begin = ( !empty($update) )?$update['event_begin'].''.$update['event_time']:$event->occur_begin;
1753
+ $end = ( !empty($update) )?$update['event_end'].''.$update['event_endtime']:$event->occur_end;
1754
  $data = array( 'occur_event_id'=>$event_id, 'occur_begin'=>$begin,'occur_end'=>$end,'occur_group_id'=>$update['event_group_id'] );
1755
  } else {
1756
+ $formats = array( '%d','%d');
1757
  $group_id = mc_get_data( 'event_group_id', $event_id );
1758
  $data = array( 'occur_event_id'=>$event_id,'occur_group_id'=>$group_id );
1759
  }
1763
  $data,
1764
  array( 'occur_id'=>$event_instance ),
1765
  $formats,
1766
+ '%d');
1767
  return $result;
1768
  }
1769
  // arbitrary field update to event table
1770
  function mc_update_data( $event_id, $field, $value, $format='%d' ) {
1771
  global $wpdb;
1772
  $data = array( $field=>$value );
1773
+ $format = esc_sql( $format );
1774
  $formats = ( $format );
1775
  $result = $wpdb->update(
1776
  my_calendar_table(),
1777
  $data,
1778
  array( 'event_id'=>$event_id ),
1779
  $formats,
1780
+ '%d');
1781
  return $result;
1782
  }
1783
+
1784
  /* returns next available group ID */
1785
  function mc_group_id() {
1786
  global $wpdb;
1799
  $results = $wpdb->get_results($sql);
1800
  if ( is_array($results) && is_admin() ) {
1801
  foreach ( $results as $result ) {
1802
+ if ( $result->occur_id == $occur ) {
1803
+ $form_control = '';
1804
  $current = "<em>".__('Editing: ','my-calendar')."</em>"; $end = '';
1805
+ } else {
1806
+ $form_control = "<input type='checkbox' name='delete_occurrences[]' id='delete_$result->occur_id' value='$result->occur_id' aria-labelledby='occur_label occur_date' /> <label id='occur_label' for='delete_$result->occur_id'>Delete</label> ";
1807
  $current = "<a href='".admin_url('admin.php?page=my-calendar')."&amp;mode=edit&amp;event_id=$id&amp;date=$result->occur_id'>"; $end = "</a>";
1808
  }
1809
+ $begin = "<span id='occur_date'>".date_i18n( get_option('mc_date_format'),strtotime($result->occur_begin) ) . ', ' . date( get_option('mc_time_format'),strtotime($result->occur_begin) )."</span>";
1810
+ $output.= "<li>$form_control$current$begin$end</li>";
1811
  }
1812
+ } else {
1813
  $details = '';
1814
+ foreach ( $results as $result ) {
1815
  $event_id = $result->occur_id;
1816
  $event = mc_get_event( $event_id );
1817
+ $array = mc_create_tags($event);
1818
+ if ( in_array( $template, array( 'details','grid','list','mini') ) ) {
1819
+ if ( get_option( 'mc_use_'.$template.'_template') == 1 ) {
1820
+ $template = mc_get_template( $template );
1821
+ } else {
1822
+ $template = false;
1823
+ $details = my_calendar_draw_event( $event, $type="single", $event->event_begin, $event->event_time, '');
1824
+ }
1825
  }
1826
+ $item = ( $list != '') ? jd_draw_template( $array, $list ) : '';
1827
+ if ( $details == '') {
1828
+ $details = ( $template != '') ? jd_draw_template( $array, $template ) :'';
1829
+ }
1830
  $output.= $item;
1831
  }
1832
  $output = $details . $before . $output . $after;
1834
  return $output;
1835
  }
1836
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1837
  function mc_event_is_grouped( $group_id ) {
1838
  global $wpdb;
1839
  $mcdb = $wpdb;
1848
  }
1849
  }
1850
 
1851
+ function mc_standard_datetime_input( $form, $has_data, $data, $instance, $context='admin' ) {
1852
+ if ( $has_data ) {
1853
+ $event_begin = esc_attr($data->event_begin);
1854
+ $event_end = esc_attr($data->event_end);
1855
+ if ( !empty($_GET['date'] ) ) {
1856
+ $event = mc_get_event( (int) $_GET['date'] );
1857
+ $event_begin = date( 'Y-m-d', strtotime( $event->occur_begin ) );
1858
+ $event_end = date( 'Y-m-d', strtotime( $event->occur_end ) );
 
 
 
 
 
 
 
1859
  }
1860
+ $starttime = ( $data->event_time == "00:00:00" && $data->event_endtime == "00:00:00" )?'':date( "h:i A",strtotime( $data->event_time ) );
1861
+ $endtime = ( $data->event_endtime == "00:00:00" && $data->event_time == "00:00:00" )?'':date( "h:i A",strtotime( $data->event_endtime ) );
1862
+ } else {
1863
+ $event_begin = date( "Y-m-d" );
1864
+ $event_end = $starttime = $endtime = '';
1865
+ }
1866
+ $allday = $hide = '';
1867
+ if ( $has_data && ( $data->event_time == '00:00:00'&& $data->event_endtime == '00:00:00' ) ) {
1868
+ $allday = " checked=\"checked\"";
1869
+ }
1870
+ if ( $has_data && $data->event_hide_end == '1' ) {
1871
+ $hide = " checked=\"checked\"";
1872
+ }
1873
+ $scripting = '
1874
+ <script type="text/javascript">
1875
+ //<![CDATA[
1876
+ jQuery(document).ready(function($) {
1877
+ $("#e_time").pickatime({
1878
+ interval: 15,
1879
+ format: "'.apply_filters( 'mc_time_format', 'h:i A' ).'",
1880
+ });
1881
+ $("#e_endtime").pickatime({
1882
+ interval: 15,
1883
+ format: "'.apply_filters( 'mc_time_format', 'h:i A' ).'",
1884
+ });
1885
+ });
1886
+ //]]>
1887
+ </script>';
1888
+ $form .= $scripting;
1889
+ $form .= '<p>
1890
+ <label for="e_begin" id="eblabel">'.__('Date (YYYY-MM-DD)','my-calendar').'</label> <input type="text" id="e_begin" name="event_begin[]" size="10" value="" data-value="'.$event_begin.'" />
1891
+ <label for="e_time">'.__('From','my-calendar').'</label>
1892
+ <input type="text" id="e_time" name="event_time[]" size="8" value="'.$starttime.'" />
1893
+ <label for="e_endtime">'.__('To','my-calendar').'</label>
1894
+ <input type="text" id="e_endtime" name="event_endtime[]" size="8" value="'.$endtime.'" />
1895
+ </p>
1896
+ <ul>
1897
+ <li><input type="checkbox" value="1" id="e_allday" name="event_allday"'.$allday.' /> <label for="e_allday">'.__('All day event','my-calendar').'</label> </li>
1898
+ <li><input type="checkbox" value="1" id="e_hide_end" name="event_hide_end"'.$hide.' /> <label for="e_hide_end">'.__('Hide end time','my-calendar').'</label></li>
1899
+ </ul>
1900
+ <p>
1901
+ <label for="e_end" id="eelabel"><em>'.__('End Date (YYYY-MM-DD, optional)','my-calendar').'</em></label> <input type="text" name="event_end[]" id="e_end" size="10" value="" data-value="'.$event_end.'" />
1902
+ </p>';
1903
+ return $form;
1904
+ }
1905
+
1906
+ function mc_standard_event_registration( $form, $has_data, $data, $context='admin' ) {
1907
+ if ( $has_data ) {
1908
+ $event_open = jd_option_selected( $data->event_open,'1' );
1909
+ $not_open = jd_option_selected( $data->event_open,'0' );
1910
+ $default = jd_option_selected( $data->event_open, '2' );
1911
+ $group = jd_option_selected( $data->event_group,'1' );
1912
+ $tickets = esc_attr( $data->event_tickets );
1913
+ $registration = stripslashes( esc_attr( $data->event_registration ) );
1914
+ } else {
1915
+ $event_open = $not_open = $group = $tickets = $registration = '';
1916
+ $default = 'checked="checked"';
1917
+ }
1918
+ if ( $context == 'admin' ) {
1919
+ $form .= "
1920
+ <p>
1921
+ <input type='radio' id='event_open' name='event_open' value='1' $event_open /> <label for='event_open'>".__('Open','my-calendar')."</label>
1922
+ <input type='radio' id='event_closed' name='event_open' value='0' $not_open /> <label for='event_closed'>".__('Closed','my-calendar')."</label>
1923
+ <input type='radio' id='event_none' name='event_open' value='2' $default /> <label for='event_none'>".__('Does not apply','my-calendar')."</label>
1924
  </p>
1925
  <p>
1926
+ <input type='checkbox' name='event_group' id='event_group' $group /> <label for='event_group'>".__('If this event recurs, it can only be registered for as a complete series.','my-calendar')."</label>
 
 
1927
  </p>";
1928
+ } else {
1929
+ $form .= '<input type="hidden" name="event_open" value="2" />';
1930
+ }
1931
+ $form .= "<p>
1932
+ <label for='event_tickets'>".__('Tickets URL','my-calendar')."</label> <input type='url' name='event_tickets' id='event_tickets' value='$tickets' />
1933
+ </p>
1934
+ <p>
1935
+ <label for='event_registration'>".__('Registration Information','my-calendar')."</label> <textarea name='event_registration'id='event_registration'cols='40'rows='4'/>$registration</textarea>
1936
+ </p>";
1937
+ return apply_filters( 'mc_event_registration_form', $form, $has_data, $data, 'admin' );
1938
  }
my-calendar-events.php CHANGED
@@ -1,49 +1,81 @@
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  // used to generate upcoming events lists
5
- function mc_get_all_events( $category, $before, $after, $today, $author, $host ) {
6
- global $wpdb;
7
  $mcdb = $wpdb;
8
- if ( get_option( 'mc_remote' ) == 'true' && function_exists('mc_remote_db') ) { $mcdb = mc_remote_db(); }
9
- $select_category = ( $category!='default' )?mc_select_category($category):'';
 
10
  $limit_string = mc_limit_string();
11
  $select_author = ( $author != 'default' )?mc_select_author($author):'';
12
  $select_host = ( $host != 'default' )?mc_select_host($host):'';
13
-
14
  $date = date('Y', current_time('timestamp')).'-'.date('m', current_time('timestamp')).'-'.date('d', current_time('timestamp'));
15
  // if a value is non-zero, I'll grab a handful of extra events so I can throw out holidays and others like that.
16
  if ( $before > 0 ) {
17
- $before = $before + 5;
18
  $events1 = $mcdb->get_results("SELECT *, UNIX_TIMESTAMP(occur_begin) AS ts_occur_begin, UNIX_TIMESTAMP(occur_end) AS ts_occur_end
19
  FROM " . MY_CALENDAR_EVENTS_TABLE . "
20
  JOIN " . MY_CALENDAR_TABLE . "
21
  ON (event_id=occur_event_id)
22
  JOIN " . MY_CALENDAR_CATEGORIES_TABLE . "
23
- ON (event_category=category_id) WHERE $select_category $select_author $select_host $limit_string event_approved = 1 AND event_flagged <> 1
24
- AND DATE(occur_begin) < '$date' ORDER BY occur_begin DESC LIMIT 0,$before");
25
- } else { $events1 = array(); }
 
 
 
 
 
26
  if ( $today == 'yes' ) {
27
  $events3 = $mcdb->get_results("SELECT *, UNIX_TIMESTAMP(occur_begin) AS ts_occur_begin, UNIX_TIMESTAMP(occur_end) AS ts_occur_end
28
  FROM " . MY_CALENDAR_EVENTS_TABLE . "
29
  JOIN " . MY_CALENDAR_TABLE . "
30
  ON (event_id=occur_event_id)
31
  JOIN " . MY_CALENDAR_CATEGORIES_TABLE . "
32
- ON (event_category=category_id) WHERE $select_category $select_author $select_host $limit_string event_approved = 1 AND event_flagged <> 1
 
 
33
  AND ( ( DATE(occur_begin) < '$date' AND DATE(occur_end) > '$date' ) OR DATE(occur_begin) = '$date' )"); // event crosses or equals
34
  } else {
35
  $events3 = array();
36
  }
37
  if ( $after > 0 ) {
38
- $after = $after + 5;
39
  $events2 = $mcdb->get_results("SELECT *, UNIX_TIMESTAMP(occur_begin) AS ts_occur_begin, UNIX_TIMESTAMP(occur_end) AS ts_occur_end
40
  FROM " . MY_CALENDAR_EVENTS_TABLE . "
41
  JOIN " . MY_CALENDAR_TABLE . "
42
  ON (event_id=occur_event_id)
43
  JOIN " . MY_CALENDAR_CATEGORIES_TABLE . "
44
- ON (event_category=category_id) WHERE $select_category $select_author $select_host $limit_string event_approved = 1 AND event_flagged <> 1
 
 
45
  AND DATE(occur_begin) > '$date' ORDER BY occur_begin ASC LIMIT 0,$after");
46
- } else { $events2 = array(); }
 
 
47
  $arr_events = array();
48
  if (!empty($events1) || !empty($events2) || !empty($events3) ) {
49
  $arr_events = array_merge( $events1, $events3, $events2);
@@ -102,10 +134,16 @@ function mc_get_rss_events( $cat_id=false) {
102
  $mcdb = $wpdb;
103
  if ( get_option( 'mc_remote' ) == 'true' && function_exists('mc_remote_db') ) { $mcdb = mc_remote_db(); }
104
  if ( $cat_id ) { $cat = "WHERE event_category = $cat_id AND event_approved = 1"; } else { $cat = 'WHERE event_approved = 1'; }
105
- $events = $mcdb->get_results("SELECT *, UNIX_TIMESTAMP(occur_begin) AS ts_occur_begin, UNIX_TIMESTAMP(occur_end) AS ts_occur_end FROM " . MY_CALENDAR_EVENTS_TABLE . " JOIN " . MY_CALENDAR_TABLE . " ON (event_id=occur_event_id) JOIN " . MY_CALENDAR_CATEGORIES_TABLE . " ON (event_category=category_id) $cat ORDER BY event_added DESC LIMIT 0,30" );
106
- foreach ( array_keys($events) as $key ) {
107
- $event =& $events[$key];
108
- $output[] = $event;
 
 
 
 
 
 
109
  }
110
  return $output;
111
  }
@@ -120,23 +158,103 @@ function mc_get_event_core( $id ) {
120
  }
121
 
122
  // get event instance (object or html)
123
- function mc_get_event( $id,$type='object' ) {
124
  // indicates whether you want a specific instance, or a general event
125
  global $wpdb;
126
  $mcdb = $wpdb;
127
  if ( get_option( 'mc_remote' ) == 'true' && function_exists('mc_remote_db') ) { $mcdb = mc_remote_db(); }
128
  $event = $mcdb->get_row("SELECT *, UNIX_TIMESTAMP(occur_begin) AS ts_occur_begin, UNIX_TIMESTAMP(occur_end) AS ts_occur_end FROM " . MY_CALENDAR_EVENTS_TABLE . " JOIN " . MY_CALENDAR_TABLE . " ON (event_id=occur_event_id) JOIN " . MY_CALENDAR_CATEGORIES_TABLE . " ON (event_category=category_id) WHERE occur_id=$id");
129
- $date = date('Y-m-d',strtotime($event->occur_begin) );
 
130
  if ( $type == 'object' ) {
131
- return $event;
132
  } else {
133
- $value = " <div id='mc_event'>".my_calendar_draw_event( $event,'single',"$date",'single' )."</div>\n";
134
  return $value;
135
  }
136
  }
137
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
138
  // Grab all events for the requested date from calendar
139
- function my_calendar_grab_events($from, $to,$category=null,$ltype='',$lvalue='',$source='calendar',$author=null, $host=null) {
140
  if ( isset($_GET['mcat']) ) { $ccategory = $_GET['mcat']; } else { $ccategory = $category; }
141
  if ( isset($_GET['ltype']) ) { $cltype = $_GET['ltype']; } else { $cltype = $ltype; }
142
  if ( isset($_GET['loc']) ) { $clvalue = $_GET['loc']; } else { $clvalue = $lvalue; }
@@ -180,11 +298,11 @@ function my_calendar_grab_events($from, $to,$category=null,$ltype='',$lvalue='',
180
  ON (event_id=occur_event_id)
181
  JOIN " . MY_CALENDAR_CATEGORIES_TABLE . "
182
  ON (event_category=category_id)
183
- WHERE $select_category $select_location $select_author $select_host $limit_string
184
  AND ( DATE(occur_begin) BETWEEN '$from 00:00:00' AND '$to 23:59:59'
185
  OR DATE(occur_end) BETWEEN '$from 00:00:00' and '$to 23:59:59'
186
  OR ( DATE('$from') BETWEEN DATE(occur_begin) AND DATE(occur_end) )
187
- OR ( DATE('$to') BETWEEN DATE(occur_begin) AND DATE(occur_end) ))
188
  ORDER BY occur_begin";
189
  $events = $mcdb->get_results( $event_query );
190
  if (!empty($events)) {
@@ -230,49 +348,46 @@ global $wpdb;
230
  $type = ($ltype != 'all')?"event_$ltype":"event_state";
231
  $return = false;
232
  if ( is_array($cache) ) {
233
- if ( strpos( $category, ',' ) !== false ) {
234
- $cats = explode(',',$category);
235
- } else if ( strpos( $category, '|' ) !== false ) {
236
- $cats = explode('|',$category);
237
- } else {
238
- $cats = array( $category );
239
- }
240
- if ( strpos( $auth, ',' ) !== false ) {
241
- $authors = explode(',',$auth);
242
- } else if ( strpos( $auth, '|' ) !== false ) {
243
- $authors = explode('|',$auth);
244
- } else {
245
- $authors = array($auth);
246
- }
247
- if ( strpos( $host, ',' ) !== false ) {
248
- $authors = explode(',',$host);
249
- } else if ( strpos( $host, '|' ) !== false ) {
250
- $authors = explode('|',$host);
251
- } else {
252
- $hosts = array($host);
253
- }
254
- foreach ( $authors as $k=>$v ) {
255
- if ( !is_numeric($v) && $v != 'all' ) {
256
- $u = get_user_by('login',$v);
257
- $id = $u->ID;
258
- $authors[$k]= $id;
259
- }
260
  }
261
- foreach ( $hosts as $k=>$v ) {
262
- if ( !is_numeric($v) && $v != 'all' ) {
263
- $u = get_user_by('login',$v);
264
- $id = $u->ID;
265
- $hosts[$k]= $id;
266
- }
267
  }
268
- foreach ( $cache as $key=>$value ) {
 
269
  foreach ( $cats as $cat ) {
270
  if ( is_numeric($cat) ) { $cat = (int) $cat; }
271
- if ( ( $value->event_category == $cat || $category == 'all' || $value->category_name == $cat )
272
- && ( $value->event_author == $auth || $auth == 'all' || in_array( $value->event_author,$authors ) )
273
- && ( $value->event_host == $host || $host == 'all' || in_array( $value->event_host,$hosts ) )
274
- && ( $value->{$type} == urldecode($lvalue) || ( $ltype == 'all' && $lvalue == 'all' ) ) ) {
275
- $return[$key]=$value;
276
  }
277
  }
278
  }
@@ -280,7 +395,7 @@ global $wpdb;
280
  }
281
  }
282
 
283
- function mc_create_cache($arr_events, $hash, $category, $ltype, $lvalue, $author, $host ) {
284
  $caching = apply_filters( 'mc_caching_enabled', false, $category, $ltype, $lvalue, $author, $host );
285
  if ( $arr_events == false ) { $arr_events = 'empty'; }
286
  if ( $caching == true ) {
@@ -288,10 +403,10 @@ function mc_create_cache($arr_events, $hash, $category, $ltype, $lvalue, $author
288
  $ret = mc_get_cache("mc_cache");
289
  $after = memory_get_usage();
290
  $mem_limit = mc_allocated_memory( $before, $after );
291
- if ( $mem_limit ) { return false; } // if cache is maxed, don't add additional references. Cache expires every two days.
292
  $cache = mc_get_cache("mc_cache");
293
  $cache[$hash] = $arr_events;
294
- mc_set_cache( "mc_cache",$cache, 60*60*48 );
295
  return true;
296
  }
297
  return false;
@@ -319,33 +434,4 @@ function mc_set_cache( $cache, $time ) {
319
  }
320
  function mc_remove_cache( $cache ) {
321
  delete_transient( $cache );
322
- }
323
-
324
- /* Implement for 2.3.
325
- // Notes: switch to file-based caching.
326
- // $cache will need to become the data array/object, not the cache name
327
- mc_get_cache( $cache ) {
328
- $file = plugin_dir_path(__FILE__).'.mc_cache';
329
- if (is_file($file)) {
330
- $cache = file_get_contents($file);
331
- $cache = maybe_unserialize($cache,true);
332
-
333
- if (!isset($cache)) {
334
- unlink($file);
335
- return false;
336
- }
337
- }
338
- }
339
- mc_set_cache( $cache ) {
340
- $file = plugin_dir_path(__FILE__).'.mc_cache';
341
- if (!isset($cache)) {
342
- unset( $cache );
343
- file_put_contents($file, serialize( $cache ) );
344
- return false;
345
- }
346
- }
347
- mc_remove_cache( $cache ) {
348
- $file = plugin_dir_path(__FILE__).'.mc_cache';
349
- unlink($file);
350
- }
351
- */
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
 
4
+ function mc_private_categories() {
5
+ $cats = array();
6
+ if ( !is_user_logged_in() ) {
7
+ global $wpdb;
8
+ $mcdb = $wpdb;
9
+ if ( get_option( 'mc_remote' ) == 'true' && function_exists('mc_remote_db') ) { $mcdb = mc_remote_db(); }
10
+ $query = "SELECT category_id FROM ".MY_CALENDAR_CATEGORIES_TABLE." WHERE category_private = 1";
11
+ $results = $mcdb->get_results( $query );
12
+ foreach ( $results as $result ) {
13
+ $cats[] = $result->category_id;
14
+ }
15
+ $cats = implode( ',',$cats );
16
+ if ( $cats != '' ) {
17
+ $cats = " AND category_id NOT IN ($cats)";
18
+ return $cats;
19
+ }
20
+ }
21
+ return;
22
+ }
23
+
24
  // used to generate upcoming events lists
25
+ function mc_get_all_events( $category, $before, $after, $today, $author, $host, $ltype='', $lvalue='' ) {
26
+ global $wpdb;
27
  $mcdb = $wpdb;
28
+ if ( get_option( 'mc_remote' ) == 'true' && function_exists('mc_remote_db') ) { $mcdb = mc_remote_db(); }
29
+ $exclude_categories = mc_private_categories();
30
+ $select_category = ( $category != 'default' ) ? mc_select_category( $category ) : '';
31
  $limit_string = mc_limit_string();
32
  $select_author = ( $author != 'default' )?mc_select_author($author):'';
33
  $select_host = ( $host != 'default' )?mc_select_host($host):'';
34
+ $select_location = mc_limit_string( 'grab', $ltype, $lvalue );
35
  $date = date('Y', current_time('timestamp')).'-'.date('m', current_time('timestamp')).'-'.date('d', current_time('timestamp'));
36
  // if a value is non-zero, I'll grab a handful of extra events so I can throw out holidays and others like that.
37
  if ( $before > 0 ) {
38
+ $before = $before + 10;
39
  $events1 = $mcdb->get_results("SELECT *, UNIX_TIMESTAMP(occur_begin) AS ts_occur_begin, UNIX_TIMESTAMP(occur_end) AS ts_occur_end
40
  FROM " . MY_CALENDAR_EVENTS_TABLE . "
41
  JOIN " . MY_CALENDAR_TABLE . "
42
  ON (event_id=occur_event_id)
43
  JOIN " . MY_CALENDAR_CATEGORIES_TABLE . "
44
+ ON (event_category=category_id) WHERE $select_category $select_author $select_host $limit_string event_approved = 1
45
+ AND event_flagged <> 1
46
+ AND DATE(occur_begin) < '$date'
47
+ $exclude_categories
48
+ ORDER BY occur_begin DESC LIMIT 0,$before");
49
+ } else {
50
+ $events1 = array();
51
+ }
52
  if ( $today == 'yes' ) {
53
  $events3 = $mcdb->get_results("SELECT *, UNIX_TIMESTAMP(occur_begin) AS ts_occur_begin, UNIX_TIMESTAMP(occur_end) AS ts_occur_end
54
  FROM " . MY_CALENDAR_EVENTS_TABLE . "
55
  JOIN " . MY_CALENDAR_TABLE . "
56
  ON (event_id=occur_event_id)
57
  JOIN " . MY_CALENDAR_CATEGORIES_TABLE . "
58
+ ON (event_category=category_id) WHERE $select_category $select_author $select_host $limit_string event_approved = 1
59
+ AND event_flagged <> 1
60
+ $exclude_categories
61
  AND ( ( DATE(occur_begin) < '$date' AND DATE(occur_end) > '$date' ) OR DATE(occur_begin) = '$date' )"); // event crosses or equals
62
  } else {
63
  $events3 = array();
64
  }
65
  if ( $after > 0 ) {
66
+ $after = $after + 10;
67
  $events2 = $mcdb->get_results("SELECT *, UNIX_TIMESTAMP(occur_begin) AS ts_occur_begin, UNIX_TIMESTAMP(occur_end) AS ts_occur_end
68
  FROM " . MY_CALENDAR_EVENTS_TABLE . "
69
  JOIN " . MY_CALENDAR_TABLE . "
70
  ON (event_id=occur_event_id)
71
  JOIN " . MY_CALENDAR_CATEGORIES_TABLE . "
72
+ ON (event_category=category_id) WHERE $select_category $select_author $select_host $limit_string event_approved = 1
73
+ AND event_flagged <> 1
74
+ $exclude_categories
75
  AND DATE(occur_begin) > '$date' ORDER BY occur_begin ASC LIMIT 0,$after");
76
+ } else {
77
+ $events2 = array();
78
+ }
79
  $arr_events = array();
80
  if (!empty($events1) || !empty($events2) || !empty($events3) ) {
81
  $arr_events = array_merge( $events1, $events3, $events2);
134
  $mcdb = $wpdb;
135
  if ( get_option( 'mc_remote' ) == 'true' && function_exists('mc_remote_db') ) { $mcdb = mc_remote_db(); }
136
  if ( $cat_id ) { $cat = "WHERE event_category = $cat_id AND event_approved = 1"; } else { $cat = 'WHERE event_approved = 1'; }
137
+ $events = $mcdb->get_results( "SELECT *, UNIX_TIMESTAMP(occur_begin) AS ts_occur_begin, UNIX_TIMESTAMP(occur_end) AS ts_occur_end FROM " . MY_CALENDAR_EVENTS_TABLE . " JOIN " . MY_CALENDAR_TABLE . " ON (event_id=occur_event_id) JOIN " . MY_CALENDAR_CATEGORIES_TABLE . " ON (event_category=category_id) $cat ORDER BY event_added DESC LIMIT 0,30" );
138
+ $groups = array();
139
+ foreach ( array_keys( $events ) as $key ) {
140
+ $event =& $events[$key];
141
+ if ( !in_array( $event->occur_group_id, $groups ) ) {
142
+ $output[$event->event_begin][] = $event;
143
+ }
144
+ if ( $event->event_span == 1 ) {
145
+ $groups[] = $event->occur_group_id;
146
+ }
147
  }
148
  return $output;
149
  }
158
  }
159
 
160
  // get event instance (object or html)
161
+ function mc_get_event( $id, $type='object' ) {
162
  // indicates whether you want a specific instance, or a general event
163
  global $wpdb;
164
  $mcdb = $wpdb;
165
  if ( get_option( 'mc_remote' ) == 'true' && function_exists('mc_remote_db') ) { $mcdb = mc_remote_db(); }
166
  $event = $mcdb->get_row("SELECT *, UNIX_TIMESTAMP(occur_begin) AS ts_occur_begin, UNIX_TIMESTAMP(occur_end) AS ts_occur_end FROM " . MY_CALENDAR_EVENTS_TABLE . " JOIN " . MY_CALENDAR_TABLE . " ON (event_id=occur_event_id) JOIN " . MY_CALENDAR_CATEGORIES_TABLE . " ON (event_category=category_id) WHERE occur_id=$id");
167
+ $date = date( 'Y-m-d',strtotime( $event->occur_begin ) );
168
+ $time = date( 'H:i:s',strtotime( $event->occur_begin ) );
169
  if ( $type == 'object' ) {
170
+ return $event;
171
  } else {
172
+ $value = " <div id='mc_event'>".my_calendar_draw_event( $event,'single',$date,$time,'single' )."</div>\n";
173
  return $value;
174
  }
175
  }
176
 
177
+ // get a specific field with an event ID
178
+ function mc_get_data( $field, $id ) {
179
+ global $wpdb;
180
+ $mcdb = $wpdb;
181
+ if ( get_option( 'mc_remote') == 'true'&& function_exists('mc_remote_db') ) { $mcdb = mc_remote_db(); }
182
+ $field = esc_sql( $field );
183
+ $sql = $wpdb->prepare( "SELECT $field FROM ".my_calendar_table()." WHERE event_id = %d", $id );
184
+ $result = $mcdb->get_var($sql);
185
+ return $result;
186
+ }
187
+
188
+ // get all occurrences associated with an event.
189
+ function mc_get_occurrences( $id ) {
190
+ global $wpdb;
191
+ $id = (int) $id;
192
+ if ( $id === 0 ) { return array(); }
193
+ $sql = "SELECT * FROM ".my_calendar_event_table()." WHERE occur_event_id=$id";
194
+ $results = $wpdb->get_results( $sql );
195
+ return $results;
196
+ }
197
+
198
+ // get all events related to an event ID (group IDs)
199
+ function mc_related_events( $id, $return=false ) {
200
+ global $wpdb;
201
+ $id = (int) $id;
202
+ if ( $id === 0 && $return === false ) { echo "<li>".__('No related events','my-calendar')."</li>"; return; }
203
+ if ( $id === 0 && $return ) { return array(); }
204
+ $output = '';
205
+ $sql = "SELECT * FROM ".my_calendar_event_table()." WHERE occur_group_id=$id";
206
+ $results = $wpdb->get_results($sql);
207
+ if ( $return ) return $results;
208
+ if ( is_array($results) && !empty($results) ) {
209
+ foreach ( $results as $result ) {
210
+ $event = $result->occur_event_id;
211
+ $current = "<a href='".admin_url('admin.php?page=my-calendar')."&amp;mode=edit&amp;event_id=$event'>"; $end = "</a>";
212
+ $begin = date_i18n( get_option('mc_date_format'),strtotime($result->occur_begin) ) . ', '. date( get_option('mc_time_format'),strtotime($result->occur_begin) );
213
+ $output.= "<li>$current$begin$end</li>";
214
+ }
215
+ } else {
216
+ $output = "<li>".__('No related events','my-calendar')."</li>";
217
+ }
218
+ echo $output;
219
+ }
220
+
221
+ /*
222
+ * Main My Calendar event fetch
223
+ * @since 2.3.0
224
+ *
225
+ * Fetch all events according to date parameters and supported limits.
226
+ *
227
+ * @param string $from Date formatted string 2014-2-10
228
+ * @param string $to Date formatted string 2014-2-17
229
+ * @param string/int $category Category ID or category name.
230
+ * @param string/int $ltype Location filter type.
231
+ * @param string $lvalue Location data to filter to.
232
+ * @param string $source Source of data request.
233
+ * @param int $author Author ID to filter to.
234
+ * @return array Array of events with dates as keys.
235
+ */
236
+ function my_calendar_events( $from, $to, $category, $ltype, $lvalue, $source, $author ) {
237
+ $events = my_calendar_grab_events( $from, $to, $category, $ltype, $lvalue, $source ,$author );
238
+ if ( !get_option('mc_skip_holidays_category') || get_option('mc_skip_holidays_category') == '' ) {
239
+ $holidays = array();
240
+ } else {
241
+ $holidays = my_calendar_grab_events( $from, $to, get_option('mc_skip_holidays_category'),$ltype, $lvalue, $source, $author );
242
+ $holiday_array = mc_set_date_array( $holidays );
243
+ }
244
+ // get events into an easily parseable set, keyed by date.
245
+ if ( is_array( $events ) && !empty($events) ) {
246
+ $event_array = mc_set_date_array( $events );
247
+ if ( is_array( $holidays ) && count($holidays) > 0 ) {
248
+ $event_array = mc_holiday_limit( $event_array, $holiday_array ); // if there are holidays, rejigger.
249
+ }
250
+ } else {
251
+ $event_array = array();
252
+ }
253
+ return $event_array;
254
+ }
255
+
256
  // Grab all events for the requested date from calendar
257
+ function my_calendar_grab_events( $from, $to,$category=null,$ltype='',$lvalue='',$source='calendar',$author=null, $host=null ) {
258
  if ( isset($_GET['mcat']) ) { $ccategory = $_GET['mcat']; } else { $ccategory = $category; }
259
  if ( isset($_GET['ltype']) ) { $cltype = $_GET['ltype']; } else { $cltype = $ltype; }
260
  if ( isset($_GET['loc']) ) { $clvalue = $_GET['loc']; } else { $clvalue = $lvalue; }
298
  ON (event_id=occur_event_id)
299
  JOIN " . MY_CALENDAR_CATEGORIES_TABLE . "
300
  ON (event_category=category_id)
301
+ WHERE $select_category $select_location $select_author $select_host $limit_string
302
  AND ( DATE(occur_begin) BETWEEN '$from 00:00:00' AND '$to 23:59:59'
303
  OR DATE(occur_end) BETWEEN '$from 00:00:00' and '$to 23:59:59'
304
  OR ( DATE('$from') BETWEEN DATE(occur_begin) AND DATE(occur_end) )
305
+ OR ( DATE('$to') BETWEEN DATE(occur_begin) AND DATE(occur_end) ) )
306
  ORDER BY occur_begin";
307
  $events = $mcdb->get_results( $event_query );
308
  if (!empty($events)) {
348
  $type = ($ltype != 'all')?"event_$ltype":"event_state";
349
  $return = false;
350
  if ( is_array($cache) ) {
351
+ $cats = array( $category );
352
+ if ( strpos( $category, ',' ) !== false ) {
353
+ $cats = explode( ',',$category );
354
+ } else if ( strpos( $category, '|' ) !== false ) {
355
+ $cats = explode( '|',$category );
356
+ }
357
+ $authors = array($auth);
358
+ if ( strpos( $auth, ',' ) !== false ) {
359
+ $authors = explode( ',',$auth );
360
+ } else if ( strpos( $auth, '|' ) !== false ) {
361
+ $authors = explode( '|',$auth );
362
+ }
363
+ $hosts = array($host);
364
+ if ( strpos( $host, ',' ) !== false ) {
365
+ $authors = explode( ',',$host );
366
+ } else if ( strpos( $host, '|' ) !== false ) {
367
+ $authors = explode( '|',$host );
368
+ }
369
+ foreach ( $authors as $k=>$v ) {
370
+ if ( !is_numeric($v) && $v != 'all' ) {
371
+ $u = get_user_by('login',$v);
372
+ $id = $u->ID;
373
+ $authors[$k]= $id;
 
 
 
 
374
  }
375
+ }
376
+ foreach ( $hosts as $k=>$v ) {
377
+ if ( !is_numeric($v) && $v != 'all' ) {
378
+ $u = get_user_by('login',$v);
379
+ $id = $u->ID;
380
+ $hosts[$k]= $id;
381
  }
382
+ }
383
+ foreach ( $cache as $k=>$v ) {
384
  foreach ( $cats as $cat ) {
385
  if ( is_numeric($cat) ) { $cat = (int) $cat; }
386
+ if ( ( $v->event_category == $cat || $category == 'all' || $v->category_name == $cat )
387
+ && ( $v->event_author == $auth || $auth == 'all' || in_array( $v->event_author,$authors ) )
388
+ && ( $v->event_host == $host || $host == 'all' || in_array( $v->event_host,$hosts ) )
389
+ && ( $v->{$type} == urldecode($lvalue) || ( $ltype == 'all' && $lvalue == 'all' ) ) ) {
390
+ $return[$k]=$v;
391
  }
392
  }
393
  }
395
  }
396
  }
397
 
398
+ function mc_create_cache( $arr_events, $hash, $category, $ltype, $lvalue, $author, $host ) {
399
  $caching = apply_filters( 'mc_caching_enabled', false, $category, $ltype, $lvalue, $author, $host );
400
  if ( $arr_events == false ) { $arr_events = 'empty'; }
401
  if ( $caching == true ) {
403
  $ret = mc_get_cache("mc_cache");
404
  $after = memory_get_usage();
405
  $mem_limit = mc_allocated_memory( $before, $after );
406
+ if ( $mem_limit ) { return false; } // if cache is maxed, don't add additional references. Cache expires every 12 hours.
407
  $cache = mc_get_cache("mc_cache");
408
  $cache[$hash] = $arr_events;
409
+ mc_set_cache( "mc_cache",$cache, 60*60*12 );
410
  return true;
411
  }
412
  return false;
434
  }
435
  function mc_remove_cache( $cache ) {
436
  delete_transient( $cache );
437
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
my-calendar-export.php CHANGED
@@ -2,7 +2,7 @@
2
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
 
4
  // Export single event as iCal file
5
- function my_calendar_export_vcal() {
6
  if (isset($_GET['vcal'])) {
7
  $vcal = $_GET['vcal'];
8
  print my_calendar_send_vcal( $vcal );
@@ -25,12 +25,12 @@ function my_calendar_generate_vcal( $event_id ) {
25
  $mc_id = (int) str_replace( 'mc_','',$_GET['vcal']);
26
  $event = mc_get_event( $mc_id,'object' );
27
  // need to modify date values to match real values using date above
28
- $array = event_as_array($event, 'ical' );
29
 
30
  $template = "BEGIN:VCALENDAR
31
  VERSION:2.0
32
  METHOD:PUBLISH
33
- PRODID:-//Accessible Web Design//My Calendar//http://www.mywpcal.com//v$mc_version//EN';
34
  BEGIN:VEVENT
35
  UID:{dateid}-{id}
36
  LOCATION:{ical_location}
@@ -47,4 +47,90 @@ END:VCALENDAR";
47
  $template = apply_filters( 'mc_single_ical_template', $template, $array );
48
  $output = jd_draw_template($array, $template);
49
  return $output;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  }
2
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
 
4
  // Export single event as iCal file
5
+ function mc_export_vcal() {
6
  if (isset($_GET['vcal'])) {
7
  $vcal = $_GET['vcal'];
8
  print my_calendar_send_vcal( $vcal );
25
  $mc_id = (int) str_replace( 'mc_','',$_GET['vcal']);
26
  $event = mc_get_event( $mc_id,'object' );
27
  // need to modify date values to match real values using date above
28
+ $array = mc_create_tags( $event );
29
 
30
  $template = "BEGIN:VCALENDAR
31
  VERSION:2.0
32
  METHOD:PUBLISH
33
+ PRODID:-//Accessible Web Design//My Calendar//http://www.joedolson.com//v$mc_version//EN';
34
  BEGIN:VEVENT
35
  UID:{dateid}-{id}
36
  LOCATION:{ical_location}
47
  $template = apply_filters( 'mc_single_ical_template', $template, $array );
48
  $output = jd_draw_template($array, $template);
49
  return $output;
50
+ }
51
+
52
+ function my_calendar_rss( $events=array() ) {
53
+ // establish template
54
+ if ( isset($_GET['mcat']) ) { $cat_id = (int) $_GET['mcat']; } else { $cat_id = false; }
55
+ $template = "\n<item>
56
+ <title>{rss_title}</title>
57
+ <link>{details_link}</link>
58
+ <pubDate>{rssdate}</pubDate>
59
+ <dc:creator>{author}</dc:creator>
60
+ <description><![CDATA[{rss_description}]]></description>
61
+ <content:encoded><![CDATA[<div class='vevent'>
62
+ <h1 class='summary'>{rss_title}</h1>
63
+ <div class='description'>{rss_description}</div>
64
+ <p class='dtstart' title='{ical_start}'>Begins: {time} on {date}</p>
65
+ <p class='dtend' title='{ical_end}'>Ends: {endtime} on {enddate}</p>
66
+ <p>Recurrance: {recurs}</p>
67
+ <p>Repetition: {repeats} times</p>
68
+ <div class='location'>{rss_hcard}</div>
69
+ {rss_link_title}
70
+ </div>]]></content:encoded>
71
+ <dc:format xmlns:dc='http://purl.org/dc/elements/1.1/'>text/html</dc:format>
72
+ <dc:source xmlns:dc='http://purl.org/dc/elements/1.1/'>".home_url()."</dc:source>
73
+ {guid}
74
+ </item>\n";
75
+ if ( get_option( 'mc_use_rss_template' ) == 1 ) { $templates = get_option('mc_templates'); $template = $templates['rss']; }
76
+ // add RSS headers
77
+ $charset = get_bloginfo('charset');
78
+ $output = '<?xml version="1.0" encoding="'.$charset.'"?>
79
+ <rss version="2.0"
80
+ xmlns:content="http://purl.org/rss/1.0/modules/content/"
81
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
82
+ xmlns:atom="http://www.w3.org/2005/Atom"
83
+ xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
84
+ xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
85
+ >
86
+ <channel>
87
+ <title>'. get_bloginfo('name') .' Calendar</title>
88
+ <link>'. home_url() .'</link>
89
+ <description>'. get_bloginfo('description') . ': My Calendar Events</description>
90
+ <language>'. get_bloginfo('language') .'</language>
91
+ <managingEditor>'. get_bloginfo('admin_email') .' (' . get_bloginfo('name') . ' Admin)</managingEditor>
92
+ <generator>My Calendar WordPress Plugin http://www.joedolson.com/articles/my-calendar/</generator>
93
+ <lastBuildDate>'. mysql2date('D, d M Y H:i:s +0000', current_time( 'timestamp' ) ) .'</lastBuildDate>
94
+ <atom:link href="'. mc_get_current_url() .'" rel="self" type="application/rss+xml" />';
95
+
96
+ if ( empty( $events ) ) {
97
+ $events = mc_get_rss_events( $cat_id );
98
+ }
99
+ foreach ( $events as $date ) {
100
+ foreach ( array_keys( $date ) as $key ) {
101
+ $event =& $date[$key];
102
+ $array = mc_create_tags( $event );
103
+ $output .= jd_draw_template( $array, $template, 'rss' );
104
+ }
105
+ }
106
+ $output .= '</channel>
107
+ </rss>';
108
+ header('Content-type: application/rss+xml');
109
+ header("Pragma: no-cache");
110
+ header("Expires: 0");
111
+ echo mc_strip_to_xml($output);
112
+ }
113
+
114
+ // just a double check to try to ensure that the XML feed can be rendered.
115
+ function mc_strip_to_xml($value) {
116
+ $ret = "";
117
+ $current;
118
+ if ( empty( $value ) ) {
119
+ return $ret;
120
+ }
121
+ $length = strlen($value);
122
+ for ($i=0; $i < $length; $i++) {
123
+ $current = ord($value{$i});
124
+ if (($current == 0x9) ||
125
+ ($current == 0xA) ||
126
+ ($current == 0xD) ||
127
+ (($current >= 0x20) && ($current <= 0xD7FF)) ||
128
+ (($current >= 0xE000) && ($current <= 0xFFFD)) ||
129
+ (($current >= 0x10000) && ($current <= 0x10FFFF))) {
130
+ $ret .= chr($current);
131
+ } else {
132
+ $ret .= " ";
133
+ }
134
+ }
135
+ return $ret;
136
  }
my-calendar-generator.php ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
+
4
+ function mc_generate() {
5
+ if ( isset( $_POST['generator'] ) ) {
6
+ $string = '';
7
+ switch ( $_POST['shortcode'] ) {
8
+ case 'main': $shortcode = 'my_calendar'; break;
9
+ case 'upcoming': $shortcode = 'my_calendar_upcoming'; break;
10
+ case 'today': $shortcode = 'my_calendar_today'; break;
11
+ default: $shortcode = 'my_calendar';
12
+ }
13
+ foreach ( $_POST as $key => $value ) {
14
+ if ( $key != 'generator' && $key != 'shortcode' ) {
15
+ if ( is_array( $value ) ) {
16
+ if ( in_array( 'all', $value ) ) { unset( $value[0] ); }
17
+ $v = implode( ',', $value );
18
+ } else {
19
+ $v = $value;
20
+ }
21
+ if ( $v != '' ) {
22
+ $string .= " $key=&quot;$v&quot;";
23
+ }
24
+ }
25
+ }
26
+ $output = $shortcode.$string;
27
+ $output = apply_filters( 'mc_shortcode_generator', $output, $_POST );
28
+ $return = "<div class='updated'><textarea disabled>[$output]</textarea></div>";
29
+ echo $return;
30
+ }
31
+ }
32
+
33
+ function mc_generator( $type ) { ?>
34
+ <form action="<?php echo admin_url('admin.php?page=my-calendar-help'); ?>" method="POST" id="my-calendar-generate">
35
+ <fieldset>
36
+ <legend><strong><?php echo ucfirst($type); ?></strong>: <?php _e('Shortcode Attributes', 'my-calendar'); ?></legend>
37
+ <div id="mc-generator" class="generator">
38
+ <input type='hidden' name='shortcode' value='<?php echo $type; ?>' />
39
+ <?php // Common Elements to all Shortcodes ?>
40
+ <p><?php echo my_calendar_categories_list( 'select','admin' ); ?></p>
41
+ <p>
42
+ <label for="ltype"><?php _e('Location filter type:','my-calendar'); ?></label>
43
+ <select name="ltype" id="ltype">
44
+ <option value="" selected="selected"><?php _e('All locations','my-calendar'); ?></option>
45
+ <option value='event_label'><?php _e('Location Name','my-calendar'); ?></option>
46
+ <option value='event_city'><?php _e('City','my-calendar'); ?></option>
47
+ <option value='event_state'><?php _e('State','my-calendar'); ?></option>
48
+ <option value='event_postcode'><?php _e('Postal Code','my-calendar'); ?></option>
49
+ <option value='event_country'><?php _e('Country','my-calendar'); ?></option>
50
+ <option value='event_region'><?php _e('Region','my-calendar'); ?></option>
51
+ </select>
52
+ </p>
53
+ <p>
54
+ <label for="lvalue" id='lval'><?php _e('Location filter value:','my-calendar'); ?></label>
55
+ <input type="text" name="lvalue" id="lvalue" aria-labelledby='lval location-info' />
56
+ </p>
57
+ <p id='location-info'>
58
+ <?php _e( '<strong>Note:</strong> If you provide a location filter value, it must be an exact match for that information as saved with your events. (e.g. "Saint Paul" is not equivalent to "saint paul" or "St. Paul")','my-calendar' ); ?>
59
+ </p>
60
+ <?php
61
+ // Grab users and list them
62
+ $users = my_calendar_getUsers();
63
+ $options = '';
64
+ foreach ( $users as $u ) {
65
+ $options = '<option value="'.$u->ID.'">'.$u->display_name."</option>\n";
66
+ } ?>
67
+ <p>
68
+ <label for="author"><?php _e('Limit by Author','my-calendar'); ?></label>
69
+ <select name="author[]" id="author" multiple="multiple">
70
+ <option value="all"><?php _e('All authors','my-calendar'); ?></option>
71
+ <?php echo $options; ?>
72
+ </select>
73
+ </p>
74
+ <p>
75
+ <label for="host"><?php _e('Limit by Host','my-calendar'); ?></label>
76
+ <select name="host[]" id="host" multiple="multiple">
77
+ <option value="all"><?php _e('All hosts','my-calendar'); ?></option>
78
+ <?php echo $options; ?>
79
+ </select>
80
+ </p>
81
+ <?php
82
+ // Main shortcode only
83
+ if ( $type == 'main' ) { ?>
84
+ <p>
85
+ <label for="format"><?php _e( 'Format', 'my-calendar' ); ?></label>
86
+ <select name="format" id="format">
87
+ <option value="calendar" selected="selected"><?php _e( 'Grid','my-calendar' ); ?></option>
88
+ <option value="list"><?php _e( 'List','my-calendar' ); ?></option>
89
+ </select>
90
+ </p>
91
+ <p>
92
+ <label for="time"><?php _e('Time Segment', 'my-calendar'); ?></label>
93
+ <select name="time" id="time">
94
+ <option value="month" selected="selected"><?php _e( 'Month','my-calendar' ); ?></option>
95
+ <option value="week"><?php _e( 'Week','my-calendar' ); ?></option>
96
+ <option value="day"><?php _e( 'Day','my-calendar' ); ?></option>
97
+ </select>
98
+ </p>
99
+ <p id='navigation-info'>
100
+ <?php _e( "For navigational fields above and below the calendar: the defaults specified in your settings will be used if the attribute is left blank. Use <code>none</code> to hide all navigation elements.",'my-calendar' ); ?>
101
+ </p>
102
+ <p>
103
+ <label for="above" id='labove'><?php _e('Navigation above calendar','my-calendar'); ?></label>
104
+ <input type="text" name="above" id="above" value="nav,toggle,jump,print,timeframe" aria-labelledby='labove navigation-info' /><br />
105
+ </p>
106
+ <p>
107
+ <label for="below" id='lbelow'><?php _e('Navigation below calendar','my-calendar'); ?></label>
108
+ <input type="text" name="below" id="below" value="key,feeds" aria-labelledby='lbelow navigation-info' /><br />
109
+ </p>
110
+ <?php
111
+ }
112
+ if ( $type == 'upcoming' || $type == 'today' ) {
113
+ // Upcoming Events & Today's Events shortcodes ?>
114
+ <p>
115
+ <label for="fallback"><?php _e('Fallback Text','my-calendar'); ?></label>
116
+ <input type="text" name="fallback" id="fallback" value="" />
117
+ </p>
118
+ <p>
119
+ <label for="template"><?php _e('Template','my-calendar'); ?></label>
120
+ <textarea cols="40" rows="4" name="template" id="template"><?php echo htmlentities( "<strong>{date}</strong>, {time}: {link_title}" ); ?></textarea>
121
+ </p>
122
+ <?php
123
+ }
124
+ if ( $type == 'upcoming' ) {
125
+ // Upcoming events only ?>
126
+ <p>
127
+ <label for="before"><?php _e('Events/Days Before Current Day','my-calendar'); ?></label>
128
+ <input type="number" name="before" id="before" value="" />
129
+ </p>
130
+ <p>
131
+ <label for="after"><?php _e('Events/Days After Current Day','my-calendar'); ?></label>
132
+ <input type="number" name="after" id="after" value="" />
133
+ </p>
134
+ <p>
135
+ <label for="skip"><?php _e('Events/Days to Skip','my-calendar'); ?></label>
136
+ <input type="number" name="skip" id="skip" value="" />
137
+ </p>
138
+ <p>
139
+ <label for="show_today"><?php _e('Fallback','my-calendar'); ?></label>
140
+ <input type="checkbox" name="show_today" id="show_today" value="yes" />
141
+ </p>
142
+ <p>
143
+ <label for="type"><?php _e('Type of Upcoming Events List','my-calendar'); ?></label>
144
+ <select name="type" id="type">
145
+ <option value="events" selected="selected"><?php _e( 'Events','my-calendar' ); ?></option>
146
+ <option value="days"><?php _e( 'Days','my-calendar' ); ?></option>
147
+ </select>
148
+ </p>
149
+ <p>
150
+ <label for="order"><?php _e('Time Segment', 'my-calendar'); ?></label>
151
+ <select name="order" id="order">
152
+ <option value="asc" selected="selected"><?php _e( 'Ascending','my-calendar' ); ?></option>
153
+ <option value="desc"><?php _e( 'Descending','my-calendar' ); ?></option>
154
+ </select>
155
+ </p>
156
+ <?php } ?>
157
+ </div>
158
+ </fieldset>
159
+ <p>
160
+ <input type="submit" class="button-primary" name="generator" value="<?php _e('Generate Shortcode', 'my-calendar'); ?>" />
161
+ </p>
162
+ </form><?php
163
+ }
my-calendar-group-manager.php CHANGED
@@ -4,137 +4,129 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
  function edit_my_calendar_groups() {
5
  global $current_user, $wpdb, $users_entries;
6
  $mcdb = $wpdb;
7
-
8
- // First some quick cleaning up
9
- $edit = $save = false;
10
-
11
- $action = !empty($_POST['event_action']) ? $_POST['event_action'] : '';
12
- $event_id = !empty($_POST['event_id']) ? $_POST['event_id'] : '';
13
- $group_id = !empty($_POST['group_id']) ? $_POST['group_id'] : '';
14
-
15
-
16
- if ( isset( $_GET['mode'] ) ) {
17
- if ( $_GET['mode'] == 'edit' ) {
18
- $action = "edit";
19
- $event_id = (int) $_GET['event_id'];
20
- $group_id = (int) $_GET['group_id'];
21
  }
22
- }
23
-
24
- // Lets see if this is first run and create us a table if it is!
25
- check_my_calendar();
26
 
27
- if ( isset( $_POST['event_action'] ) ) {
28
- global $mc_output;
29
- $nonce=$_REQUEST['_wpnonce'];
30
- if (! wp_verify_nonce($nonce,'my-calendar-nonce') ) die("Security check failed");
31
- $proceed = false;
32
- switch ( $_POST['event_action'] ) {
33
- case 'edit':
34
- if ( isset( $_POST['apply'] ) && is_array($_POST['apply']) ) {
35
- $mc_output = mc_check_group_data( $action,$_POST );
36
- foreach ( $_POST['apply'] as $event_id ) {
37
- $response = my_calendar_save_group($action,$mc_output,$event_id);
38
- echo $response;
39
- }
40
- }
41
- break;
42
- case 'break':
43
- foreach ( $_POST['break'] as $event_id ) {
44
- $update = array( 'event_group_id'=>0 );
45
- $formats = array( '%d' );
46
- //$mcdb->show_errors();
47
- $result = $mcdb->update(
48
- my_calendar_table(),
49
- $update,
50
- array( 'event_id'=>$event_id ),
51
- $formats,
52
- '%d' );
53
- //$mcdb->print_error();
54
- $url = ( get_option('mc_uri') != '' && !is_numeric( get_option('mc_uri') ) )?' '.sprintf(__('View <a href="%s">your calendar</a>.','my-calendar'),get_option('mc_uri') ):'';
55
- if ( $result === false ) {
56
- $message = "<div class='error'><p><strong>".__('Error','my-calendar').":</strong>".__('Event not updated.','my-calendar')."$url</p></div>";
57
- } else if ( $result === 0 ) {
58
- $message = "<div class='updated'><p>#$event_id: ".__('Nothing was changed in that update.','my-calendar')."$url</p></div>";
59
- } else {
60
- $message = "<div class='updated'><p>#$event_id: ".__('Event updated successfully','my-calendar').".$url</p></div>";
61
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  }
63
- break;
64
- case 'group':
65
- if ( isset($_POST['group']) && is_array( $_POST['group']) ) {
66
- $events = $_POST['group'];
67
- sort($events);
68
- }
69
- foreach ( $events as $event_id ) {
70
- $group_id = $events[0];
71
- $update = array( 'event_group_id'=>$group_id );
72
- $formats = array( '%d' );
73
- //$mcdb->show_errors();
74
- $result = $mcdb->update(
75
- my_calendar_table(),
76
- $update,
77
- array( 'event_id'=>$event_id ),
78
- $formats,
79
- '%d' );
80
- //$mcdb->print_error();
81
- if ( $result === false ) {
82
- $message = "<div class='error'><p><strong>".__('Error','my-calendar').":</strong>".__('Event not grouped.','my-calendar')."</p></div>";
83
- } else if ( $result === 0 ) {
84
- $message = "<div class='updated'><p>#$event_id: ".__('Nothing was changed in that update.','my-calendar')."</p></div>";
85
- } else {
86
- $message = "<div class='updated'><p>#$event_id: ".__('Event grouped successfully','my-calendar')."</p></div>";
87
- }
88
- }
89
- break;
90
- }
91
- }
92
-
93
- ?>
94
-
95
- <div class="wrap jd-my-calendar" id="my-calendar">
96
- <?php my_calendar_check_db();?>
97
- <?php
98
- if ( $action == 'edit' || ($action == 'edit' && $error_with_saving == 1) ) {
99
- ?>
100
- <div id="icon-edit" class="icon32"></div>
101
- <h2><?php _e('Edit Event Group','my-calendar'); ?></h2>
102
- <?php
103
- if ( empty($event_id) || empty($group_id) ) {
104
- echo "<div class=\"error\"><p>".__("You must provide an event group id in order to edit it",'my-calendar')."</p></div>";
105
- } else {
106
- jd_groups_edit_form('edit', $event_id, $group_id );
107
- }
108
- } else {
109
- ?>
110
- <div id="icon-edit" class="icon32"></div>
111
  <h2><?php _e('Manage Event Groups','my-calendar'); ?></h2>
112
- <p><?php _e('Grouped events can be edited simultaneously. When you choose a group of events to edit, the form will be pre-filled with the content applicable to the member of the event group you started from. (e.g., if you click on the "Edit Group" link for the 3rd of a set of events, the boxes will use the content applicable to that event.). You will also receive a set of checkboxes which will indicate which events in the group should have these changes applied. (All grouped events can also be edited individually.)','my-calendar'); ?></p>
113
- <p><?php _e('The following fields will never be changed when editing groups: registration availability, event publication status, spam flagging, event recurrence, event repetitions, and the start and end dates and times for that event.','my-calendar'); ?></p>
 
114
 
115
- <div class="postbox-container" style="width: 70%">
116
- <div class="metabox-holder">
117
- <div class="ui-sortable meta-box-sortables">
118
- <div class="postbox">
119
- <h3><?php _e('Manage Event Groups','my-calendar'); ?></h3>
120
- <div class="inside">
121
- <p><?php _e('Select an event group to edit.','my-calendar'); ?></p>
 
 
 
 
 
 
 
 
122
  </div>
123
  </div>
124
- </div>
125
- </div>
126
- </div>
127
-
128
- <?php } ?>
129
-
130
- <?php jd_show_support_box(); ?>
131
- <?php jd_groups_display_list(); ?>
132
- </div>
133
- <?php
134
  }
135
 
136
  function my_calendar_save_group( $action,$output,$event_id=false ) {
137
- global $wpdb,$event_author;
138
  $mcdb = $wpdb;
139
  $proceed = $output[0];
140
  $message = '';
@@ -144,7 +136,7 @@ global $wpdb,$event_author;
144
  $update = $output[2];
145
  $update = apply_filters( 'mc_update_group_data', $update, $event_author, $action, $event_id );
146
  $formats = array(
147
- '%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s',
148
  '%d','%d','%d','%d','%d',
149
  '%f','%f'
150
  );
@@ -157,6 +149,7 @@ global $wpdb,$event_author;
157
  '%d' );
158
  //$mcdb->print_error();
159
  $url = ( get_option('mc_uri') != '' && !is_numeric( get_option('mc_uri') ) )?' '.sprintf(__('View <a href="%s">your calendar</a>.','my-calendar'),get_option('mc_uri') ):'';
 
160
  do_action( 'mc_save_grouped_events', $result, $event_id, $update );
161
  if ( $result === false ) {
162
  $message = "<div class='error'><p><strong>#$event_id; ".__('Error','my-calendar').":</strong>".__('Your event was not updated.','my-calendar')."$url</p></div>";
@@ -174,8 +167,8 @@ global $wpdb,$event_author;
174
  return $message;
175
  }
176
 
177
- function jd_acquire_group_data($event_id=false) {
178
- global $wpdb,$users_entries;
179
  $mcdb = $wpdb;
180
  if ( $event_id !== false ) {
181
  if ( intval($event_id) != $event_id ) {
@@ -238,11 +231,11 @@ function mc_group_form( $group_id, $type='break' ) {
238
  $class = ($type == 'break')?'break':'apply';
239
  $group = "<div class='group $class'>";
240
  $group .= $warning;
241
- $group .= ($type == 'apply')?"<fieldset><legend>".__('Apply these changes to:','my-calendar')."</legend>":'';
242
- $group .= ($type == 'break')?"<form method='post' action='".admin_url("admin.php?page=my-calendar-groups&amp;mode=edit&amp;event_id=$event_id&amp;group_id=$group_id")."'>
243
  <div><input type='hidden' value='$group_id' name='group_id' /><input type='hidden' value='$type' name='event_action' /><input type='hidden' name='_wpnonce' value='$nonce' />
244
- </div>":'';
245
- $group .= "<ul class='columns'>";
246
  $checked = ( $type=='apply' )?' checked="checked"':'';
247
  foreach ( $results as $result ) {
248
  $date = date_i18n( 'D, j M, Y', strtotime( $result->event_begin ) );
@@ -250,19 +243,19 @@ function mc_group_form( $group_id, $type='break' ) {
250
  $group .= "<li><input type='checkbox' name='$type"."[]' value='$result->event_id' id='$type$result->event_id'$checked /> <label for='break$result->event_id'><a href='#event$result->event_id'>#$result->event_id</a>: $date; $time</label></li>\n";
251
  }
252
  $group .= "<li><input type='checkbox' class='selectall' id='$type'$checked /> <label for='$type'><b>".__('Check/Uncheck all','my-calendar')."</b></label></li>\n</ul>";
253
- $group .= ($type == 'apply')?"</fieldset>":'';
254
- $group .= ($type == 'break')?"<p><input type='submit' class='button' value='".__('Remove checked events from this group','my-calendar')."' /></p></form>":'';
255
  $group .= "</div>";
256
  return $group;
257
  }
258
 
259
  // The event edit form for the manage events admin page
260
- function jd_groups_edit_form( $mode='edit', $event_id=false, $group_id=false ) {
261
  global $wpdb,$users_entries,$user_ID, $output;
262
  $mcdb = $wpdb;
263
  $message = '';
264
  if ($event_id != false) {
265
- $data = jd_acquire_group_data( $event_id );
266
  } else {
267
  $data = $users_entries;
268
  }
@@ -271,90 +264,91 @@ function jd_groups_edit_form( $mode='edit', $event_id=false, $group_id=false ) {
271
  } else {
272
  $message .= __('You must provide a group ID to edit groups','my-calendar');
273
  }
274
-
275
- ?>
276
-
277
- <?php echo ($message != '')?"<div class='error'><p>$message</p></div>":''; ?>
278
- <?php echo $group; ?>
279
- <?php my_calendar_print_group_fields($data,$mode,$event_id, $group_id); ?>
280
-
281
- <?php
282
  }
283
 
284
  function my_calendar_print_group_fields( $data,$mode,$event_id,$group_id='' ) {
285
  global $user_ID, $wpdb;
286
  $mcdb = $wpdb;
287
  get_currentuserinfo();
 
288
  $user = get_userdata($user_ID);
289
  $mc_input_administrator = (get_option('mc_input_options_administrators')=='true' && current_user_can('manage_options'))?true:false;
290
- $mc_input = get_option('mc_input_options');
291
- ?>
292
 
293
- <div class="postbox-container" style="width: 70%">
294
- <div class="metabox-holder">
295
- <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-groups&amp;mode=edit&amp;event_id=$event_id&amp;group_id=$group_id"); ?>">
296
- <div>
297
- <input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" />
298
- <input type="hidden" name="group_id" value="<?php if ( !empty( $data->event_group_id ) ) { echo $data->event_group_id; } else { echo mc_group_id(); } ?>" />
299
- <input type="hidden" name="event_action" value="<?php echo $mode; ?>" />
300
- <input type="hidden" name="event_id" value="<?php echo $event_id; ?>" />
301
- <input type="hidden" name="event_author" value="<?php echo $user_ID; ?>" />
302
- <input type="hidden" name="event_nonce_name" value="<?php echo wp_create_nonce('event_nonce'); ?>" />
303
- </div>
304
- <div class="ui-sortable meta-box-sortables">
 
305
  <div class="postbox">
306
  <h3><?php _e('Manage Event Groups','my-calendar'); ?></h3>
307
  <div class="inside">
308
  <fieldset>
309
  <legend><?php _e('Enter your Event Information','my-calendar'); ?></legend>
310
  <p>
311
- <label for="event_title"><?php _e('Event Title','my-calendar'); ?> <span><?php _e('(required)','my-calendar'); ?></span><?php if ( !mc_compare_group_members( $group_id,'event_title' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label><br /><input type="text" id="event_title" name="event_title" class="input" size="60" value="<?php if ( !empty($data) ) echo stripslashes(esc_attr($data->event_title)); ?>" />
312
  </p>
313
  <?php
314
  $apply = mc_group_form( $group_id, 'apply' );
315
  echo $apply;
316
- ?>
317
- <?php if ( $data->event_repeats == 0 && ( $data->event_recur == 'S1' || $data->event_recur == 'S' ) ) { ?>
318
  <p>
319
- <input type="checkbox" value="1" id="event_span" name="event_span"<?php if ( !empty($data) && $data->event_span == '1' ) { echo " checked=\"checked\""; } else if ( !empty($data) && $data->event_span == '0' ) { echo ""; } else if ( get_option( 'mc_event_span' ) == 'true' ) { echo " checked=\"checked\""; } ?> /> <label for="event_span"><?php _e('Selected dates are a single multi-day event.','my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_span' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label>
320
  </p>
321
  <?php } else { ?>
322
  <div><input type='hidden' name='event_span' value='<?php echo $data->event_span; ?>' /></div>
323
  <?php } ?>
324
  <?php if ($mc_input['event_desc'] == 'on' || $mc_input_administrator ) { ?>
325
- <div id="group_description">
326
- <?php if ( !empty($data) ) { $description = $data->event_desc; } else { $description = ''; } ?>
327
- <label for="content"><?php _e('Event Description (<abbr title="hypertext markup language">HTML</abbr> allowed)','my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_desc' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label><br /><?php if ( $mc_input['event_use_editor'] == 'on' ) { if ( version_compare( get_bloginfo( 'version' ) , '3.3' , '>=' ) ) { wp_editor( stripslashes($description), 'content', array( 'textarea_rows'=>10 ) ); } else { the_editor( stripslashes($description) ); } } else { ?><textarea id="content" name="content" class="event_desc" rows="5" cols="80"><?php echo stripslashes(esc_attr($description)); ?></textarea><?php if ( $mc_input['event_use_editor'] == 'on' ) { ?></div><?php } } ?>
328
- </div>
 
 
 
 
 
 
 
 
329
  <?php } ?>
330
  <?php if ($mc_input['event_short'] == 'on' || $mc_input_administrator ) { ?>
331
  <p>
332
- <label for="event_short"><?php _e('Event Short Description (<abbr title="hypertext markup language">HTML</abbr> allowed)','my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_short' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label><br /><textarea id="event_short" name="event_short" class="input" rows="2" cols="80"><?php if ( !empty($data) ) echo stripslashes(esc_attr($data->event_short)); ?></textarea>
333
- </p>
334
- <?php } ?>
335
- <?php
336
- // If the editor is enabled, shouldn't display the image uploader.
337
- // It restricts use of the image uploader to a single image and forces it to be in
338
- // the event image field, rather than the event description.
339
- if ( !isset($mc_input['event_image']) ) { $mc_input['event_image'] = 'off'; }
340
- if ( ( $mc_input['event_image'] == 'on' && $mc_input['event_use_editor'] != 'on' ) || ( $mc_input_administrator && $mc_input['event_use_editor'] != 'on' ) ) { ?>
341
- <p>
342
- <?php if ( !empty($data->event_image) ) { ?>
343
- <div class="event_image"><img src="<?php if ( !empty($data) ) echo esc_attr($data->event_image); ?>" alt="" /></div>
344
- <?php } ?>
345
- <label for="event_image"><?php _e("Add an image:",'my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_image' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label> <input type="text" name="event_image" id="event_image" size="60" value="<?php if ( !empty($data) ) echo esc_attr($data->event_image); ?>" placeholder="http://yourdomain.com/image.jpg" /> <input id="upload_image_button" type="button" class="button" value="<?php _e('Upload Image','my-calendar'); ?>" /><br /><?php _e('Include your image URL or upload an image.','my-calendar'); ?>
346
  </p>
 
 
 
 
 
 
 
 
 
 
 
347
  <?php } else { ?>
348
  <div>
349
- <input type="hidden" name="event_image" value="<?php if ( !empty($data) ) echo esc_attr($data->event_image); ?>" />
350
- <?php if ( !empty($data->event_image) ) { ?>
351
- <div class="event_image"><img src="<?php echo esc_attr($data->event_image); ?>" alt="" /></div>
352
- <?php } ?>
353
  </div>
354
- <?php } ?>
355
  <p>
356
- <label for="event_host"><?php _e('Event Host','my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_host' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label>
357
- <select id="event_host" name="event_host">
358
  <?php
359
  // Grab all the categories and list them
360
  $userList = my_calendar_getUsers();
@@ -373,8 +367,8 @@ function my_calendar_print_group_fields( $data,$mode,$event_id,$group_id='' ) {
373
  </p>
374
  <?php if ($mc_input['event_category'] == 'on' || $mc_input_administrator ) { ?>
375
  <p>
376
- <label for="event_category"><?php _e('Event Category','my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_category' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label>
377
- <select id="event_category" name="event_category">
378
  <?php echo mc_category_select( $data ); ?>
379
  </select>
380
  </p>
@@ -385,7 +379,7 @@ function my_calendar_print_group_fields( $data,$mode,$event_id,$group_id='' ) {
385
  <?php } ?>
386
  <?php if ($mc_input['event_link'] == 'on' || $mc_input_administrator ) { ?>
387
  <p>
388
- <label for="event_link"><?php _e('Event Link (Optional)','my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_link' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label> <input type="text" id="event_link" name="event_link" class="input" size="40" value="<?php if ( !empty($data) ) { echo esc_url($data->event_link); } ?>" /> <input type="checkbox" value="1" id="event_link_expires" name="event_link_expires"<?php if ( !empty($data) && $data->event_link_expires == '1' ) { echo " checked=\"checked\""; } else if ( !empty($data) && $data->event_link_expires == '0' ) { echo ""; } else if ( get_option( 'mc_event_link_expires' ) == 'true' ) { echo " checked=\"checked\""; } ?> /> <label for="event_link_expires"><?php _e('Link will expire after event.','my-calendar'); ?></label>
389
  </p>
390
  <?php } ?>
391
  </fieldset>
@@ -398,27 +392,21 @@ function my_calendar_print_group_fields( $data,$mode,$event_id,$group_id='' ) {
398
  <?php if ($mc_input['event_open'] == 'on' || $mc_input_administrator ) {
399
  // add a "don't change" option here ?>
400
  <div class="ui-sortable meta-box-sortables">
401
- <div class="postbox">
402
- <h3><?php _e('Event Registration Options','my-calendar'); ?></h3>
403
- <div class="inside">
404
  <fieldset>
405
  <legend><?php _e('Event Registration Status','my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_open' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></legend>
406
- <p><em><?php _e('My Calendar does not manage event registrations. Use this for information only.','my-calendar'); ?></em></p>
407
- <p>
408
- <input type="radio" id="event_open" name="event_open" value="1" <?php if (!empty($data)) { echo jd_option_selected( $data->event_open,'1'); } ?> /> <label for="event_open"><?php _e('Open','my-calendar'); ?></label>
409
- <input type="radio" id="event_closed" name="event_open" value="0" <?php if (!empty($data)) { echo jd_option_selected( $data->event_open,'0'); } ?> /> <label for="event_closed"><?php _e('Closed','my-calendar'); ?></label>
410
- <input type="radio" id="event_none" name="event_open" value="2" <?php if (!empty($data)) { echo jd_option_selected( $data->event_open, '2' ); } else { echo " checked='checked'"; } ?> /> <label for="event_none"><?php _e('Does not apply','my-calendar'); ?></label>
411
- </p>
412
- <p>
413
- <input type="checkbox" name="event_group" id="event_group" <?php if ( is_object($data) ) { echo jd_option_selected( $data->event_group,'1'); } ?> /> <label for="event_group"><?php _e('If this event recurs, it can only be registered for as a complete series.','my-calendar'); ?></label>
414
- </p>
415
  </fieldset>
416
- </div>
417
- </div>
418
  </div>
419
  <?php } else { ?>
420
  <div>
421
- <input type="hidden" name="event_open" value="2" />
 
 
422
  </div>
423
 
424
  <?php } ?>
@@ -459,33 +447,27 @@ function my_calendar_print_group_fields( $data,$mode,$event_id,$group_id='' ) {
459
  <?php } ?>
460
  <?php if ($mc_input['event_location'] == 'on' || $mc_input_administrator ) { ?>
461
  <p>
462
- <?php _e('All location fields are optional: <em>insufficient information may result in an inaccurate map</em>.','my-calendar'); ?>
463
  </p>
464
  <p>
465
- <label for="event_label"><?php _e('Name of Location (e.g. <em>Joe\'s Bar and Grill</em>)','my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_label' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label><br /><input type="text" id="event_label" name="event_label" class="input" size="40" value="<?php if ( !empty($data) ) esc_attr_e(stripslashes($data->event_label)); ?>" />
466
  </p>
467
  <p>
468
- <label for="event_street"><?php _e('Street Address','my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_street' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label> <input type="text" id="event_street" name="event_street" class="input" size="40" value="<?php if ( !empty($data) ) esc_attr_e(stripslashes($data->event_street)); ?>" />
469
- </p>
470
- <p>
471
- <label for="event_street2"><?php _e('Street Address (2)','my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_street2' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label> <input type="text" id="event_street2" name="event_street2" class="input" size="40" value="<?php if ( !empty($data) ) esc_attr_e(stripslashes($data->event_street2)); ?>" />
472
- </p>
473
- <p>
474
- <label for="event_phone"><?php _e('Phone','my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_phone' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label> <input type="text" id="event_phone" name="event_phone" class="input" size="32" value="<?php if ( !empty($data) ) esc_attr_e(stripslashes($data->event_phone)); ?>" />
475
  </p>
476
  <p>
477
- <label for="event_city"><?php _e('City','my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_city' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label> <input type="text" id="event_city" name="event_city" class="input" size="40" value="<?php if ( !empty($data) ) esc_attr_e(stripslashes($data->event_city)); ?>" /> <label for="event_state"><?php _e('State/Province','my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_state' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label> <input type="text" id="event_state" name="event_state" class="input" size="10" value="<?php if ( !empty($data) ) esc_attr_e(stripslashes($data->event_state)); ?>" />
478
  </p>
479
  <p>
480
- <label for="event_postcode"><?php _e('Postal Code','my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_postcode' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label> <input type="text" id="event_postcode" name="event_postcode" class="input" size="10" value="<?php if ( !empty($data) ) esc_attr_e(stripslashes($data->event_postcode)); ?>" />
481
- <label for="event_region"><?php _e('Region','my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_region' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label> <input type="text" id="event_region" name="event_region" class="input" size="40" value="<?php if ( !empty( $data ) ) esc_attr_e(stripslashes($data->event_region)); ?>" />
482
  </p>
483
  <p>
484
- <label for="event_country"><?php _e('Country','my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_country' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label> <input type="text" id="event_country" name="event_country" class="input" size="10" value="<?php if ( !empty($data) ) esc_attr_e(stripslashes($data->event_country)); ?>" />
485
  </p>
486
  <p>
487
- <label for="event_zoom"><?php _e('Initial Zoom','my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_zoom' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label>
488
- <select name="event_zoom" id="event_zoom">
489
  <option value="16"<?php if ( !empty( $data ) && ( $data->event_zoom == 16 ) ) { echo " selected=\"selected\""; } ?>><?php _e('Neighborhood','my-calendar'); ?></option>
490
  <option value="14"<?php if ( !empty( $data ) && ( $data->event_zoom == 14 ) ) { echo " selected=\"selected\""; } ?>><?php _e('Small City','my-calendar'); ?></option>
491
  <option value="12"<?php if ( !empty( $data ) && ( $data->event_zoom == 12 ) ) { echo " selected=\"selected\""; } ?>><?php _e('Large City','my-calendar'); ?></option>
@@ -495,14 +477,42 @@ function my_calendar_print_group_fields( $data,$mode,$event_id,$group_id='' ) {
495
  </select>
496
  </p>
497
  <p>
498
- <label for="event_url"><?php _e('Location URL','my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_url' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label> <input type="text" id="event_url" name="event_url" class="input" size="40" value="<?php if ( !empty( $data ) ) esc_attr_e(stripslashes($data->event_url)); ?>" />
 
 
 
499
  </p>
500
  <fieldset>
501
  <legend><?php _e('GPS Coordinates (optional)','my-calendar'); ?></legend>
502
  <p>
503
- <label for="event_latitude"><?php _e('Latitude','my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_latitude' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?><?php if ( !mc_compare_group_members( $group_id,'event_longitude' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label> <input type="text" id="event_latitude" name="event_latitude" class="input" size="10" value="<?php if ( !empty( $data ) ) esc_attr_e(stripslashes($data->event_latitude)); ?>" /> <label for="event_longitude"><?php _e('Longitude','my-calendar'); ?></label> <input type="text" id="event_longitude" name="event_longitude" class="input" size="10" value="<?php if ( !empty( $data ) ) esc_attr_e(stripslashes($data->event_longitude)); ?>" />
504
  </p>
505
- </fieldset>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
506
  <?php } ?>
507
  <?php if ( ( $mc_input['event_location'] == 'on' || $mc_input['event_location_dropdown'] == 'on' ) || $mc_input_administrator ) { ?>
508
  </fieldset>
@@ -513,8 +523,7 @@ function my_calendar_print_group_fields( $data,$mode,$event_id,$group_id='' ) {
513
  <p>
514
  <input type="submit" name="save" class="button-secondary" value="<?php _e('Edit Event Group','my-calendar'); ?>" />
515
  </p>
516
- </form>
517
-
518
  </div>
519
  </div>
520
  <?php }
@@ -523,34 +532,32 @@ function mc_check_group_data( $action,$post ) {
523
  $post = apply_filters( 'mc_groups_pre_checkdata', $post, $action );
524
  global $wpdb, $current_user, $users_entries;
525
  $mcdb = $wpdb;
526
-
527
  $url_ok = 0;
528
  $title_ok = 0;
529
  $submit=array();
530
-
531
  if ( get_magic_quotes_gpc() ) {
532
  $post = array_map( 'stripslashes_deep', $post );
533
  }
534
-
535
  if (!wp_verify_nonce($post['event_nonce_name'],'event_nonce')) {
536
  return;
537
  }
538
-
539
- $errors = "";
540
- if ( $action == 'add' || $action == 'edit' || $action == 'copy' ) {
541
- $title = !empty($post['event_title']) ? trim($post['event_title']) : '';
542
- $desc = !empty($post['content']) ? trim($post['content']) : '';
543
- $short = !empty($post['event_short']) ? trim($post['event_short']) : '';
544
- $repeats = ( empty($post['event_repeats']) || trim($post['event_repeats'])=='' ) ? 0 : trim($post['event_repeats']);
545
- $host = !empty($post['event_host']) ? $post['event_host'] : $current_user->ID;
546
- $category = !empty($post['event_category']) ? $post['event_category'] : '';
547
- $linky = !empty($post['event_link']) ? trim($post['event_link']) : '';
548
- $expires = !empty($post['event_link_expires']) ? $post['event_link_expires'] : '0';
549
- $location_preset = !empty($post['location_preset']) ? $post['location_preset'] : '';
550
- $event_open = !empty($post['event_open']) ? $post['event_open'] : '2';
551
- $event_image = esc_url_raw( $post['event_image'] );
552
- $event_span = !empty($post['event_span']) ? 1 : 0;
553
- // set location
 
554
  if ($location_preset != 'none') {
555
  $sql = "SELECT * FROM " . my_calendar_locations_table() . " WHERE location_id = $location_preset";
556
  $location = $mcdb->get_row($sql);
@@ -567,6 +574,7 @@ if ( $action == 'add' || $action == 'edit' || $action == 'copy' ) {
567
  $event_latitude = $location->location_latitude;
568
  $event_zoom = $location->location_zoom;
569
  $event_phone = $location->location_phone;
 
570
  } else {
571
  $event_label = !empty($post['event_label']) ? $post['event_label'] : '';
572
  $event_street = !empty($post['event_street']) ? $post['event_street'] : '';
@@ -581,15 +589,16 @@ if ( $action == 'add' || $action == 'edit' || $action == 'copy' ) {
581
  $event_latitude = !empty($post['event_latitude']) ? $post['event_latitude'] : '';
582
  $event_zoom = !empty($post['event_zoom']) ? $post['event_zoom'] : '';
583
  $event_phone = !empty($post['event_phone']) ? $post['event_phone'] : '';
 
 
584
  }
585
-
586
- // We check to make sure the URL is acceptable (blank or starting with http://)
587
- if ($linky == '') {
588
  $url_ok = 1;
589
- } else if ( preg_match('/^(http)(s?)(:)\/\//',$linky) ) {
590
  $url_ok = 1;
591
  } else {
592
- $linky = "http://" . $linky;
593
  }
594
  }
595
  // The title must be at least one character in length and no more than 255 - only basic punctuation is allowed
@@ -607,7 +616,7 @@ if ( $action == 'add' || $action == 'edit' || $action == 'copy' ) {
607
  'event_title'=>$title,
608
  'event_desc'=>$desc,
609
  'event_short'=>$short,
610
- 'event_link'=>$linky,
611
  'event_label'=>$event_label,
612
  'event_street'=>$event_street,
613
  'event_street2'=>$event_street2,
@@ -619,6 +628,9 @@ if ( $action == 'add' || $action == 'edit' || $action == 'copy' ) {
619
  'event_url'=>$event_url,
620
  'event_image'=>$event_image,
621
  'event_phone'=>$event_phone,
 
 
 
622
  // integers
623
  'event_category'=>$category,
624
  'event_link_expires'=>$expires,
@@ -637,7 +649,7 @@ if ( $action == 'add' || $action == 'edit' || $action == 'copy' ) {
637
  $users_entries->event_desc = $desc;
638
  $users_entries->event_host = $host;
639
  $users_entries->event_category = $category;
640
- $users_entries->event_link = $linky;
641
  $users_entries->event_link_expires = $expires;
642
  $users_entries->event_label = $event_label;
643
  $users_entries->event_street = $event_street;
@@ -656,6 +668,10 @@ if ( $action == 'add' || $action == 'edit' || $action == 'copy' ) {
656
  $users_entries->event_short = $short;
657
  $users_entries->event_image = $event_image;
658
  $users_entries->event_span = $event_span;
 
 
 
 
659
  $proceed = false;
660
  }
661
  $data = array($proceed, $users_entries, $submit,$errors);
@@ -664,51 +680,40 @@ if ( $action == 'add' || $action == 'edit' || $action == 'copy' ) {
664
 
665
 
666
  // Used on the manage events admin page to display a list of events
667
- function jd_groups_display_list() {
668
  global $wpdb;
669
  $mcdb = $wpdb;
670
-
671
- $sortby = ( isset( $_GET['sort'] ) )?(int) $_GET['sort']:get_option('mc_default_sort');
672
-
673
- if ( isset( $_GET['order'] ) ) {
674
- $sortdir = ( isset($_GET['order']) && $_GET['order'] == 'ASC' )?'ASC':'default';
675
- } else {
676
- $sortdir = 'default';
677
- }
678
-
679
  if ( empty($sortby) ) {
680
  $sortbyvalue = 'event_begin';
681
  } else {
682
  switch ($sortby) {
683
- case 1:$sortbyvalue = 'event_ID';
684
- break;
685
- case 2:$sortbyvalue = 'event_title';
686
- break;
687
- case 3:$sortbyvalue = 'event_desc';
688
- break;
689
- case 4:$sortbyvalue = 'event_begin';
690
- break;
691
- case 5:$sortbyvalue = 'event_author';
692
- break;
693
- case 6:$sortbyvalue = 'event_category';
694
- break;
695
- case 7:$sortbyvalue = 'event_label';
696
- break;
697
- case 8:$sortbyvalue = 'group_id';
698
- break;
699
  default:$sortbyvalue = 'event_begin';
700
  }
701
  }
702
- if ($sortdir == 'default') {
703
- $sortbydirection = 'DESC';
704
- } else {
705
- $sortbydirection = $sortdir;
706
- }
707
 
708
- if ($sortbydirection == 'DESC') {
709
- $sorting = "&amp;order=ASC";
710
- } else {
711
- $sorting = '';
 
 
 
712
  }
713
  $limit = ( isset($_GET['limit']) )?$_GET['limit']:'all';
714
  switch ( $limit ) {
@@ -717,30 +722,42 @@ function jd_groups_display_list() {
717
  case 'ungrouped':$limit = 'WHERE event_group_id = 0';break;
718
  default:$limit = '';
719
  }
720
- $events = $mcdb->get_results("SELECT * FROM " . my_calendar_table() . " $limit ORDER BY $sortbyvalue $sortbydirection");
721
- ?>
722
- <h2 class="mc-clear"><?php _e('Create/Modify Groups','my-calendar'); ?></h2>
723
- <?php if ( get_option('mc_event_approve') == 'true' ) { ?>
 
724
  <ul class="links">
725
  <li><a <?php echo ( isset($_GET['limit']) && $_GET['limit']=='groupeed' )?' class="active-link"':''; ?> href="<?php echo admin_url('admin.php?page=my-calendar-groups&amp;limit=grouped#my-calendar-admin-table'); ?>"><?php _e('Grouped Events','my-calendar'); ?></a></li>
726
  <li><a <?php echo ( isset($_GET['limit']) && $_GET['limit']=='ungrouped')?' class="active-link"':''; ?> href="<?php echo admin_url('admin.php?page=my-calendar-groups&amp;limit=ungrouped#my-calendar-admin-table'); ?>"><?php _e('Ungrouped Events','my-calendar'); ?></a></li>
727
  <li><a <?php echo ( isset($_GET['limit']) && $_GET['limit']=='all' || !isset($_GET['limit']))?' class="active-link"':''; ?> href="<?php echo admin_url('admin.php?page=my-calendar-groups#my-calendar-admin-table'); ?>"><?php _e('All','my-calendar'); ?></a></li>
728
  </ul>
729
  <?php } ?>
730
-
731
- <p><?php _e('Check a set of events to group them for mass editing.','my-calendar'); ?></p>
732
- <?php
733
- if ( !empty($events) ) {
734
- ?>
 
 
 
 
 
 
 
 
 
 
735
  <form action="<?php echo admin_url("admin.php?page=my-calendar-groups"); ?>" method="post">
736
  <div>
737
  <input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" />
738
  <input type="hidden" name="event_action" value="group" />
739
  </div>
740
- <p style="position:relative;">
741
  <input type="submit" class="button-primary group" value="<?php _e('Group checked events for mass editing','my-calendar'); ?>" />
742
- </p>
743
- <table class="widefat wp-list-table" id="my-calendar-admin-table">
 
744
  <thead>
745
  <tr>
746
  <th scope="col" style="width: 50px;"><a href="<?php echo admin_url("admin.php?page=my-calendar-groups&amp;sort=1$sorting"); ?>"><?php _e('ID','my-calendar') ?></a></th>
@@ -764,19 +781,18 @@ function jd_groups_display_list() {
764
  $spam_label = ($event->event_flagged == 1) ? '<strong>Possible spam:</strong> ' : '';
765
  $author = ( $event->event_author != 0 )?get_userdata($event->event_author):'Public Submitter';
766
  if ($event->event_link != '') {
767
- $title = "<a href='".esc_attr($event->event_link)."'>$event->event_title</a>";
768
  } else {
769
- $title = $event->event_title;
770
- }
771
- ?>
772
  <tr class="<?php echo $class; echo $spam; ?>" id="event<?php echo $event->event_id; ?>">
773
  <th scope="row"><input type="checkbox" value="<?php echo $event->event_id; ?>" name="group[]" id="mc<?php echo $event->event_id; ?>" <?php echo (mc_event_is_grouped( $event->event_group_id ))?' disabled="disabled"':''; ?> /> <label for="mc<?php echo $event->event_id; ?>"><?php echo $event->event_id; ?></label></th>
774
  <th scope="row"><?php echo ($event->event_group_id == 0)?'-':$event->event_group_id; ?></th>
775
- <td title="<?php echo esc_attr(substr(strip_tags(stripslashes($event->event_desc)),0,240)); ?>">
776
  <strong><?php if ( mc_can_edit_event( $event->event_author ) ) { ?>
777
  <a href="<?php echo admin_url("admin.php?page=my-calendar&amp;mode=edit&amp;event_id=$event->event_id"); ?>" class='edit'>
778
- <?php } ?>
779
- <?php echo $spam_label; echo stripslashes($title); ?>
780
  <?php if ( mc_can_edit_event( $event->event_author ) ) { echo "</a>"; } ?></strong>
781
  <div class='row-actions' style="visibility:visible;">
782
  <?php if ( mc_can_edit_event( $event->event_author ) ) { ?>
@@ -785,21 +801,20 @@ function jd_groups_display_list() {
785
  <a href="<?php echo admin_url("admin.php?page=my-calendar-groups&amp;mode=edit&amp;event_id=$event->event_id&amp;group_id=$event->event_group_id"); ?>" class='edit group'><?php _e('Edit Group','my-calendar'); ?></a>
786
  <?php } else { ?>
787
  <em><?php _e('Ungrouped','my-calendar'); ?></em>
788
- <?php } ?>
789
- <?php } else { _e("Not editable.",'my-calendar'); } ?>
790
  </div>
791
  </td>
792
- <td><?php echo stripslashes($event->event_label); ?></td>
793
- <?php if ($event->event_time != "00:00:00") { $eventTime = date_i18n(get_option('mc_time_format'), strtotime($event->event_time)); } else { $eventTime = get_option('mc_notime_text'); } ?>
794
- <td><?php echo "$event->event_begin, $eventTime"; ?></td>
795
- <?php /* <td><?php echo $event->event_end; ?></td> */ ?>
796
  <td>
797
  <?php
798
  $recurs = str_split( $event->event_recur, 1 );
799
  $recur = $recurs[0];
800
  $every = ( isset($recurs[1]) )?$recurs[1]:1;
801
  // Interpret the DB values into something human readable
802
- if ($recur == 'S') { _e('Never','my-calendar'); }
803
  else if ($recur == 'D') { _e('Daily','my-calendar'); }
804
  else if ($recur == 'E') { _e('Weekdays','my-calendar'); }
805
  else if ($recur == 'W') { _e('Weekly','my-calendar'); }
@@ -808,38 +823,36 @@ function jd_groups_display_list() {
808
  else if ($recur == 'U') { _e('Monthly (by day)','my-calendar'); }
809
  else if ($recur == 'Y') { _e('Yearly','my-calendar'); }
810
  ?>&ndash;<?php
811
- if ($recur == 'S') { _e('N/A','my-calendar'); }
812
- else if ( mc_event_repeats_forever( $recur, $event->event_repeats ) ) { _e('Forever','my-calendar'); }
813
- else if ( $event->event_repeats > 0 ) { printf(__('%d Times','my-calendar'),$event->event_repeats ); }
 
 
 
 
814
  ?>
815
  </td>
816
  <td><?php echo ( is_object($author) )?$author->display_name:$author; ?></td>
817
- <?php
818
- $this_category = $event->event_category;
819
- foreach ($categories as $key=>$value) {
820
- if ($value->category_id == $this_category) {
821
- $this_cat = $categories[$key];
822
- }
823
- }
824
- ?>
825
  <td><div class="category-color" style="background-color:<?php echo (strpos($this_cat->category_color,'#') !== 0)?'#':''; echo $this_cat->category_color;?>;"> </div> <?php echo stripslashes($this_cat->category_name); ?></td>
826
  <?php unset($this_cat); ?>
827
- </tr>
828
- <?php
829
- }
830
- ?>
831
  </table>
832
- <p>
833
- <input type="submit" class="button-secondary group" value="<?php _e('Group checked events for mass editing','my-calendar'); ?>" />
834
- </p>
835
- </form>
836
- <?php
837
- } else {
838
- ?>
839
- <p><?php _e("There are no events in the database!",'my-calendar') ?></p>
840
- <?php
841
  }
842
- }
843
-
844
-
845
- ?>
4
  function edit_my_calendar_groups() {
5
  global $current_user, $wpdb, $users_entries;
6
  $mcdb = $wpdb;
7
+ // First some quick cleaning up
8
+ $edit = $save = false;
9
+ $action = !empty( $_POST['event_action'] ) ? $_POST['event_action'] : '';
10
+ $event_id = !empty( $_POST['event_id'] ) ? $_POST['event_id'] : '';
11
+ $group_id = !empty( $_POST['group_id'] ) ? $_POST['group_id'] : '';
12
+
13
+ if ( isset( $_GET['mode'] ) ) {
14
+ if ( $_GET['mode'] == 'edit' ) {
15
+ $action = "edit";
16
+ $event_id = (int) $_GET['event_id'];
17
+ $group_id = (int) $_GET['group_id'];
18
+ }
 
 
19
  }
 
 
 
 
20
 
21
+ if ( isset( $_POST['event_action'] ) ) {
22
+ global $mc_output;
23
+ $nonce = $_REQUEST['_wpnonce'];
24
+ if ( !wp_verify_nonce( $nonce,'my-calendar-nonce' ) ) wp_die( "Security check failed" );
25
+ $proceed = false;
26
+ switch ( $_POST['event_action'] ) {
27
+ case 'edit':
28
+ if ( isset( $_POST['apply'] ) && is_array( $_POST['apply'] ) ) {
29
+ $mc_output = mc_check_group_data( $action, $_POST );
30
+ foreach ( $_POST['apply'] as $event_id ) {
31
+ $response = my_calendar_save_group( $action,$mc_output,$event_id );
32
+ echo $response;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  }
34
+ }
35
+ break;
36
+ case 'break':
37
+ foreach ( $_POST['break'] as $event_id ) {
38
+ $update = array( 'event_group_id'=>0 );
39
+ $formats = array( '%d' );
40
+ //$mcdb->show_errors();
41
+ $result = $mcdb->update(
42
+ my_calendar_table(),
43
+ $update,
44
+ array( 'event_id'=>$event_id ),
45
+ $formats,
46
+ '%d' );
47
+ //$mcdb->print_error();
48
+ $url = ( get_option('mc_uri') != '' && !is_numeric( get_option('mc_uri') ) )?' '.sprintf( __( 'View <a href="%s">your calendar</a>.','my-calendar' ),get_option( 'mc_uri' ) ):'';
49
+ if ( $result === false ) {
50
+ $message = "<div class='error'><p><strong>".__( 'Error','my-calendar' ).":</strong>".__('Event not updated.','my-calendar')."$url</p></div>";
51
+ } else if ( $result === 0 ) {
52
+ $message = "<div class='updated'><p>#$event_id: ".__( 'Nothing was changed in that update.','my-calendar' )."$url</p></div>";
53
+ } else {
54
+ $message = "<div class='updated'><p>#$event_id: ".__( 'Event updated successfully','my-calendar' ).".$url</p></div>";
55
+ }
56
+ }
57
+ break;
58
+ case 'group':
59
+ if ( isset($_POST['group']) && is_array( $_POST['group']) ) {
60
+ $events = $_POST['group'];
61
+ sort($events);
62
+ }
63
+ foreach ( $events as $event_id ) {
64
+ $group_id = $events[0];
65
+ $update = array( 'event_group_id'=>$group_id );
66
+ $formats = array( '%d' );
67
+ //$mcdb->show_errors();
68
+ $result = $mcdb->update(
69
+ my_calendar_table(),
70
+ $update,
71
+ array( 'event_id'=>$event_id ),
72
+ $formats,
73
+ '%d' );
74
+ //$mcdb->print_error();
75
+ if ( $result === false ) {
76
+ $message = "<div class='error'><p><strong>".__('Error','my-calendar').":</strong>".__('Event not grouped.','my-calendar')."</p></div>";
77
+ } else if ( $result === 0 ) {
78
+ $message = "<div class='updated'><p>#$event_id: ".__('Nothing was changed in that update.','my-calendar')."</p></div>";
79
+ } else {
80
+ $message = "<div class='updated'><p>#$event_id: ".__('Event grouped successfully','my-calendar')."</p></div>";
81
+ }
82
+ }
83
+ break;
84
  }
85
+ } ?>
86
+
87
+ <div class="wrap jd-my-calendar" id="my-calendar"><?php
88
+ my_calendar_check_db();
89
+ if ( $action == 'edit' || ($action == 'edit' && $error_with_saving == 1) ) { ?>
90
+ <div id="icon-edit" class="icon32"></div>
91
+ <h2><?php _e('Edit Event Group','my-calendar'); ?></h2>
92
+ <?php
93
+ if ( empty($event_id) || empty($group_id) ) {
94
+ echo "<div class=\"error\"><p>".__("You must provide an event group id in order to edit it",'my-calendar')."</p></div>";
95
+ } else {
96
+ mc_edit_groups('edit', $event_id, $group_id );
97
+ }
98
+ } else { ?>
99
+ <div id="icon-edit" class="icon32"></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
  <h2><?php _e('Manage Event Groups','my-calendar'); ?></h2>
101
+ <p>
102
+ <?php _e('Grouped events can be edited simultaneously. When you choose a group of events to edit, the form will be pre-filled with the content applicable to the member of the event group you started from. (e.g., if you click on the "Edit Group" link for the 3rd of a set of events, the boxes will use the content applicable to that event.). You will also receive a set of checkboxes which will indicate which events in the group should have these changes applied. (All grouped events can also be edited individually.)','my-calendar'); ?>
103
+ </p>
104
 
105
+ <div class="postbox-container jcd-wide">
106
+ <div class="metabox-holder">
107
+ <div class="ui-sortable meta-box-sortables">
108
+ <div class="postbox">
109
+ <h3><?php _e('Manage Event Groups','my-calendar'); ?></h3>
110
+ <div class="inside">
111
+ <p><?php _e('Select an event group to edit.','my-calendar'); ?></p>
112
+ </div>
113
+ </div>
114
+ </div>
115
+ <div class="ui-sortable meta-box-sortables">
116
+ <div class="postbox">
117
+ <h3><?php _e('Create/Modify Groups','my-calendar'); ?></h3>
118
+ <?php mc_list_groups(); ?>
119
+ </div>
120
  </div>
121
  </div>
122
+ </div><?php
123
+ }
124
+ mc_show_sidebar(); ?>
125
+ </div><?php
 
 
 
 
 
 
126
  }
127
 
128
  function my_calendar_save_group( $action,$output,$event_id=false ) {
129
+ global $wpdb,$event_author;
130
  $mcdb = $wpdb;
131
  $proceed = $output[0];
132
  $message = '';
136
  $update = $output[2];
137
  $update = apply_filters( 'mc_update_group_data', $update, $event_author, $action, $event_id );
138
  $formats = array(
139
+ '%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s',
140
  '%d','%d','%d','%d','%d',
141
  '%f','%f'
142
  );
149
  '%d' );
150
  //$mcdb->print_error();
151
  $url = ( get_option('mc_uri') != '' && !is_numeric( get_option('mc_uri') ) )?' '.sprintf(__('View <a href="%s">your calendar</a>.','my-calendar'),get_option('mc_uri') ):'';
152
+ do_action( 'mc_save_event', 'edit', $update, $event_id, $result ); // same as action on basic save
153
  do_action( 'mc_save_grouped_events', $result, $event_id, $update );
154
  if ( $result === false ) {
155
  $message = "<div class='error'><p><strong>#$event_id; ".__('Error','my-calendar').":</strong>".__('Your event was not updated.','my-calendar')."$url</p></div>";
167
  return $message;
168
  }
169
 
170
+ function mc_group_data($event_id=false) {
171
+ global $wpdb,$users_entries;
172
  $mcdb = $wpdb;
173
  if ( $event_id !== false ) {
174
  if ( intval($event_id) != $event_id ) {
231
  $class = ($type == 'break')?'break':'apply';
232
  $group = "<div class='group $class'>";
233
  $group .= $warning;
234
+ $group .= ( $type == 'apply' )?"<fieldset><legend>".__('Apply these changes to:','my-calendar')."</legend>":'';
235
+ $group .= ( $type == 'break' )?"<form method='post' action='".admin_url("admin.php?page=my-calendar-groups&amp;mode=edit&amp;event_id=$event_id&amp;group_id=$group_id")."'>
236
  <div><input type='hidden' value='$group_id' name='group_id' /><input type='hidden' value='$type' name='event_action' /><input type='hidden' name='_wpnonce' value='$nonce' />
237
+ </div>":'';
238
+ $group .= "<ul class='checkboxes'>";
239
  $checked = ( $type=='apply' )?' checked="checked"':'';
240
  foreach ( $results as $result ) {
241
  $date = date_i18n( 'D, j M, Y', strtotime( $result->event_begin ) );
243
  $group .= "<li><input type='checkbox' name='$type"."[]' value='$result->event_id' id='$type$result->event_id'$checked /> <label for='break$result->event_id'><a href='#event$result->event_id'>#$result->event_id</a>: $date; $time</label></li>\n";
244
  }
245
  $group .= "<li><input type='checkbox' class='selectall' id='$type'$checked /> <label for='$type'><b>".__('Check/Uncheck all','my-calendar')."</b></label></li>\n</ul>";
246
+ $group .= ( $type == 'apply' )?"</fieldset>":'';
247
+ $group .= ( $type == 'break' )?"<p><input type='submit' class='button' value='".__('Remove checked events from this group','my-calendar')."' /></p></form>":'';
248
  $group .= "</div>";
249
  return $group;
250
  }
251
 
252
  // The event edit form for the manage events admin page
253
+ function mc_edit_groups( $mode='edit', $event_id=false, $group_id=false ) {
254
  global $wpdb,$users_entries,$user_ID, $output;
255
  $mcdb = $wpdb;
256
  $message = '';
257
  if ($event_id != false) {
258
+ $data = mc_group_data( $event_id );
259
  } else {
260
  $data = $users_entries;
261
  }
264
  } else {
265
  $message .= __('You must provide a group ID to edit groups','my-calendar');
266
  }
267
+ echo ($message != '')?"<div class='error'><p>$message</p></div>":'';
268
+ echo $group;
269
+ my_calendar_print_group_fields($data,$mode,$event_id, $group_id);
 
 
 
 
 
270
  }
271
 
272
  function my_calendar_print_group_fields( $data,$mode,$event_id,$group_id='' ) {
273
  global $user_ID, $wpdb;
274
  $mcdb = $wpdb;
275
  get_currentuserinfo();
276
+ $has_data = ( empty($data) ) ? false : true;
277
  $user = get_userdata($user_ID);
278
  $mc_input_administrator = (get_option('mc_input_options_administrators')=='true' && current_user_can('manage_options'))?true:false;
279
+ $mc_input = get_option('mc_input_options'); ?>
 
280
 
281
+ <div class="postbox-container jcd-wide">
282
+ <div class="metabox-holder">
283
+ <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-groups&amp;mode=edit&amp;event_id=$event_id&amp;group_id=$group_id"); ?>">
284
+ <div>
285
+ <input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" />
286
+ <input type="hidden" name="group_id" value="<?php if ( !empty( $data->event_group_id ) ) { echo $data->event_group_id; } else { echo mc_group_id(); } ?>" />
287
+ <input type="hidden" name="event_action" value="<?php echo $mode; ?>" />
288
+ <input type="hidden" name="event_id" value="<?php echo $event_id; ?>" />
289
+ <input type="hidden" name="event_author" value="<?php echo $user_ID; ?>" />
290
+ <input type="hidden" name="event_post" value="<?php echo $data->event_post; ?>" />
291
+ <input type="hidden" name="event_nonce_name" value="<?php echo wp_create_nonce('event_nonce'); ?>" />
292
+ </div>
293
+ <div class="ui-sortable meta-box-sortables">
294
  <div class="postbox">
295
  <h3><?php _e('Manage Event Groups','my-calendar'); ?></h3>
296
  <div class="inside">
297
  <fieldset>
298
  <legend><?php _e('Enter your Event Information','my-calendar'); ?></legend>
299
  <p>
300
+ <label for="e_title"><?php _e('Event Title','my-calendar'); ?> <span><?php _e('(required)','my-calendar'); ?></span><?php if ( !mc_compare_group_members( $group_id,'event_title' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label><br /><input type="text" id="e_title" name="event_title" size="60" value="<?php if ( !empty($data) ) echo stripslashes(esc_attr($data->event_title)); ?>" />
301
  </p>
302
  <?php
303
  $apply = mc_group_form( $group_id, 'apply' );
304
  echo $apply;
305
+ if ( $data->event_repeats == 0 && ( $data->event_recur == 'S1' || $data->event_recur == 'S' ) ) { ?>
 
306
  <p>
307
+ <input type="checkbox" value="1" id="e_span" name="event_span"<?php if ( !empty($data) && $data->event_span == '1' ) { echo " checked=\"checked\""; } else if ( !empty($data) && $data->event_span == '0' ) { echo ""; } else if ( get_option( 'mc_event_span' ) == 'true' ) { echo " checked=\"checked\""; } ?> /> <label for="e_span"><?php _e('Selected dates are a single multi-day event.','my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_span' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label>
308
  </p>
309
  <?php } else { ?>
310
  <div><input type='hidden' name='event_span' value='<?php echo $data->event_span; ?>' /></div>
311
  <?php } ?>
312
  <?php if ($mc_input['event_desc'] == 'on' || $mc_input_administrator ) { ?>
313
+ <div id="group_description"><?php
314
+ if ( !empty($data) ) { $description = $data->event_desc; } else { $description = ''; } ?>
315
+ <label for="content"><?php _e('Event Description (<abbr title="hypertext markup language">HTML</abbr> allowed)','my-calendar');
316
+ if ( !mc_compare_group_members( $group_id,'event_desc' ) ) {
317
+ echo " <span>".__('Fields do not match','my-calendar')."</span>";
318
+ } ?></label><br /><?php
319
+ if ( version_compare( get_bloginfo( 'version' ) , '3.3' , '>=' ) ) {
320
+ wp_editor( stripslashes($description), 'content', array( 'textarea_rows'=>10 ) );
321
+ } else {
322
+ the_editor( stripslashes($description) );
323
+ } ?>
324
+ </div>
325
  <?php } ?>
326
  <?php if ($mc_input['event_short'] == 'on' || $mc_input_administrator ) { ?>
327
  <p>
328
+ <label for="e_short"><?php _e('Event Short Description (<abbr title="hypertext markup language">HTML</abbr> allowed)','my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_short' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label><br /><textarea id="e_short" name="event_short" rows="2" cols="80"><?php if ( !empty($data) ) echo stripslashes(esc_attr($data->event_short)); ?></textarea>
 
 
 
 
 
 
 
 
 
 
 
 
 
329
  </p>
330
+ <?php }
331
+ if ( mc_show_edit_block( 'event_image') ) { ?>
332
+ <div class='mc-image-upload field-holder'>
333
+ <?php if ( !empty($data->event_image) ) { ?>
334
+ <div class="event_image"><img src="<?php if ( $has_data ) echo esc_attr($data->event_image); ?>" alt="" /></div>
335
+ <?php } else { ?>
336
+ <div class="event_image"></div>
337
+ <?php } ?>
338
+ <input type="hidden" name="event_image_id" value="" class="textfield" id="e_image_id" />
339
+ <label for="e_image"><?php _e("Add an image:",'my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_image' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label> <input type="text" name="event_image" id="e_image" size="60" value="<?php if ( $has_data ) echo esc_attr($data->event_image); ?>" placeholder="http://yourdomain.com/image.jpg" /> <a href="#" class="button textfield-field"><?php _e("Upload",'my-calendar'); ?></a>
340
+ </div>
341
  <?php } else { ?>
342
  <div>
343
+ <input type="hidden" name="event_image" value="<?php if ( $has_data ) echo esc_attr($data->event_image); ?>" />
344
+ <?php if ( !empty($data->event_image) ) { ?>
345
+ <div class="event_image"><img src="<?php echo esc_attr($data->event_image); ?>" alt="" /></div>
346
+ <?php } ?>
347
  </div>
348
+ <?php } ?>
349
  <p>
350
+ <label for="e_host"><?php _e('Event Host','my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_host' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label>
351
+ <select id="e_host" name="event_host">
352
  <?php
353
  // Grab all the categories and list them
354
  $userList = my_calendar_getUsers();
367
  </p>
368
  <?php if ($mc_input['event_category'] == 'on' || $mc_input_administrator ) { ?>
369
  <p>
370
+ <label for="e_category"><?php _e('Event Category','my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_category' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label>
371
+ <select id="e_category" name="event_category">
372
  <?php echo mc_category_select( $data ); ?>
373
  </select>
374
  </p>
379
  <?php } ?>
380
  <?php if ($mc_input['event_link'] == 'on' || $mc_input_administrator ) { ?>
381
  <p>
382
+ <label for="e_link"><?php _e('Event Link (Optional)','my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_link' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label> <input type="text" id="e_link" name="event_link" size="40" value="<?php if ( !empty($data) ) { echo esc_url($data->event_link); } ?>" /> <input type="checkbox" value="1" id="e_link_expires" name="event_link_expires"<?php if ( !empty($data) && $data->event_link_expires == '1' ) { echo " checked=\"checked\""; } else if ( !empty($data) && $data->event_link_expires == '0' ) { echo ""; } else if ( get_option( 'mc_event_link_expires' ) == 'true' ) { echo " checked=\"checked\""; } ?> /> <label for="e_link_expires"><?php _e('Link will expire after event.','my-calendar'); ?></label>
383
  </p>
384
  <?php } ?>
385
  </fieldset>
392
  <?php if ($mc_input['event_open'] == 'on' || $mc_input_administrator ) {
393
  // add a "don't change" option here ?>
394
  <div class="ui-sortable meta-box-sortables">
395
+ <div class="postbox">
396
+ <h3><?php _e('Event Registration Options','my-calendar'); ?></h3>
397
+ <div class="inside">
398
  <fieldset>
399
  <legend><?php _e('Event Registration Status','my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_open' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></legend>
400
+ <?php echo apply_filters( 'mc_event_registration', '', $has_data, $data, 'admin' ); ?>
 
 
 
 
 
 
 
 
401
  </fieldset>
402
+ </div>
403
+ </div>
404
  </div>
405
  <?php } else { ?>
406
  <div>
407
+ <input type="hidden" name="event_open" value="<?php echo ( $has_data ) ? $data->event_open : '2'; ?>" />
408
+ <input type="hidden" name="event_tickets" value="<?php echo ( $has_data ) ? esc_attr( $data->event_tickets ) : ''; ?>" />
409
+ <input type="hidden" name="event_registration" value="<?php echo ( $has_data ) ? esc_attr( $data->event_registration ) : ''; ?>" />
410
  </div>
411
 
412
  <?php } ?>
447
  <?php } ?>
448
  <?php if ($mc_input['event_location'] == 'on' || $mc_input_administrator ) { ?>
449
  <p>
450
+ <label for="e_label"><?php _e('Name of Location (e.g. <em>Joe\'s Bar and Grill</em>)','my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_label' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label><br /><input type="text" id="e_label" name="event_label" size="40" value="<?php if ( !empty($data) ) esc_attr_e(stripslashes($data->event_label)); ?>" />
451
  </p>
452
  <p>
453
+ <label for="e_street"><?php _e('Street Address','my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_street' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label> <input type="text" id="e_street" name="event_street" size="40" value="<?php if ( !empty($data) ) esc_attr_e(stripslashes($data->event_street)); ?>" />
454
  </p>
455
  <p>
456
+ <label for="e_street2"><?php _e('Street Address (2)','my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_street2' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label> <input type="text" id="e_street2" name="event_street2" size="40" value="<?php if ( !empty($data) ) esc_attr_e(stripslashes($data->event_street2)); ?>" />
 
 
 
 
 
 
457
  </p>
458
  <p>
459
+ <label for="e_city"><?php _e('City','my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_city' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label> <input type="text" id="e_city" name="event_city" size="40" value="<?php if ( !empty($data) ) esc_attr_e(stripslashes($data->event_city)); ?>" /> <label for="e_state"><?php _e('State/Province','my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_state' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label> <input type="text" id="e_state" name="event_state" size="10" value="<?php if ( !empty($data) ) esc_attr_e(stripslashes($data->event_state)); ?>" />
460
  </p>
461
  <p>
462
+ <label for="e_postcode"><?php _e('Postal Code','my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_postcode' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label> <input type="text" id="e_postcode" name="event_postcode" size="10" value="<?php if ( !empty($data) ) esc_attr_e(stripslashes($data->event_postcode)); ?>" />
463
+ <label for="e_region"><?php _e('Region','my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_region' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label> <input type="text" id="e_region" name="event_region" size="40" value="<?php if ( !empty( $data ) ) esc_attr_e(stripslashes($data->event_region)); ?>" />
464
  </p>
465
  <p>
466
+ <label for="e_country"><?php _e('Country','my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_country' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label> <input type="text" id="e_country" name="event_country" size="10" value="<?php if ( !empty($data) ) esc_attr_e(stripslashes($data->event_country)); ?>" />
467
  </p>
468
  <p>
469
+ <label for="e_zoom"><?php _e('Initial Zoom','my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_zoom' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label>
470
+ <select name="event_zoom" id="e_zoom">
471
  <option value="16"<?php if ( !empty( $data ) && ( $data->event_zoom == 16 ) ) { echo " selected=\"selected\""; } ?>><?php _e('Neighborhood','my-calendar'); ?></option>
472
  <option value="14"<?php if ( !empty( $data ) && ( $data->event_zoom == 14 ) ) { echo " selected=\"selected\""; } ?>><?php _e('Small City','my-calendar'); ?></option>
473
  <option value="12"<?php if ( !empty( $data ) && ( $data->event_zoom == 12 ) ) { echo " selected=\"selected\""; } ?>><?php _e('Large City','my-calendar'); ?></option>
477
  </select>
478
  </p>
479
  <p>
480
+ <label for="e_phone"><?php _e('Phone','my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_phone' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label> <input type="text" id="e_phone" name="event_phone" size="32" value="<?php if ( !empty($data) ) esc_attr_e(stripslashes($data->event_phone)); ?>" />
481
+ </p>
482
+ <p>
483
+ <label for="e_url"><?php _e('Location URL','my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_url' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label> <input type="text" id="e_url" name="event_url" size="40" value="<?php if ( !empty( $data ) ) esc_attr_e(stripslashes($data->event_url)); ?>" />
484
  </p>
485
  <fieldset>
486
  <legend><?php _e('GPS Coordinates (optional)','my-calendar'); ?></legend>
487
  <p>
488
+ <label for="e_latitude"><?php _e('Latitude','my-calendar'); ?><?php if ( !mc_compare_group_members( $group_id,'event_latitude' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?><?php if ( !mc_compare_group_members( $group_id,'event_longitude' ) ) { echo " <span>".__('Fields do not match','my-calendar')."</span>"; } ?></label> <input type="text" id="e_latitude" name="event_latitude" size="10" value="<?php if ( !empty( $data ) ) esc_attr_e(stripslashes($data->event_latitude)); ?>" /> <label for="e_longitude"><?php _e('Longitude','my-calendar'); ?></label> <input type="text" id="e_longitude" name="event_longitude" size="10" value="<?php if ( !empty( $data ) ) esc_attr_e(stripslashes($data->event_longitude)); ?>" />
489
  </p>
490
+ </fieldset>
491
+ <fieldset>
492
+ <legend><?php _e('Location Accessibility','my-calendar'); ?></legend>
493
+ <ul class='checkboxes'>
494
+ <?php
495
+ $access = apply_filters( 'mc_venue_accessibility', get_option( 'mc_location_access' ) );
496
+ $access_list = '';
497
+ if ( !empty( $data ) ) {
498
+ $location_access = unserialize( $data->event_access );
499
+ } else {
500
+ $location_access = array();
501
+ }
502
+ foreach ( $access as $k=>$a ) {
503
+ $id = "loc_access_$k";
504
+ $label = $a;
505
+ $checked = '';
506
+ if ( is_array( $location_access ) ) {
507
+ $checked = ( in_array( $k, $location_access ) ) ? " checked='checked'" : '';
508
+ }
509
+ $item = sprintf( '<li><input type="checkbox" id="%1$s" name="event_access[]" value="%4$s" class="checkbox" %2$s /> <label for="%1$s">%3$s</label></li>', $id, $checked, $label, $k );
510
+ $access_list .= $item;
511
+ }
512
+ echo $access_list;
513
+ ?>
514
+ </ul>
515
+ </fieldset>
516
  <?php } ?>
517
  <?php if ( ( $mc_input['event_location'] == 'on' || $mc_input['event_location_dropdown'] == 'on' ) || $mc_input_administrator ) { ?>
518
  </fieldset>
523
  <p>
524
  <input type="submit" name="save" class="button-secondary" value="<?php _e('Edit Event Group','my-calendar'); ?>" />
525
  </p>
526
+ </form>
 
527
  </div>
528
  </div>
529
  <?php }
532
  $post = apply_filters( 'mc_groups_pre_checkdata', $post, $action );
533
  global $wpdb, $current_user, $users_entries;
534
  $mcdb = $wpdb;
 
535
  $url_ok = 0;
536
  $title_ok = 0;
537
  $submit=array();
 
538
  if ( get_magic_quotes_gpc() ) {
539
  $post = array_map( 'stripslashes_deep', $post );
540
  }
 
541
  if (!wp_verify_nonce($post['event_nonce_name'],'event_nonce')) {
542
  return;
543
  }
544
+ $errors = "";
545
+ if ( $action == 'add' || $action == 'edit' || $action == 'copy' ) {
546
+ $title = !empty($post['event_title']) ? trim($post['event_title']) : '';
547
+ $desc = !empty($post['content']) ? trim($post['content']) : '';
548
+ $short = !empty($post['event_short']) ? trim($post['event_short']) : '';
549
+ $repeats = ( empty($post['event_repeats']) || trim($post['event_repeats'])=='' ) ? 0 : trim($post['event_repeats']);
550
+ $host = !empty($post['event_host']) ? $post['event_host'] : $current_user->ID;
551
+ $category = !empty($post['event_category']) ? $post['event_category'] : '';
552
+ $event_link = !empty($post['event_link']) ? trim($post['event_link']) : '';
553
+ $expires = !empty($post['event_link_expires']) ? $post['event_link_expires'] : '0';
554
+ $location_preset = !empty($post['location_preset']) ? $post['location_preset'] : '';
555
+ $event_open = !empty($post['event_open']) ? $post['event_open'] : '2';
556
+ $event_tickets = !empty( $post['event_tickets'] ) ? trim( $post['event_tickets'] ) : '';
557
+ $event_registration = !empty( $post['event_registration'] ) ? trim( $post['event_registration'] ) : '';
558
+ $event_image = esc_url_raw( $post['event_image'] );
559
+ $event_span = !empty($post['event_span']) ? 1 : 0;
560
+ // set location
561
  if ($location_preset != 'none') {
562
  $sql = "SELECT * FROM " . my_calendar_locations_table() . " WHERE location_id = $location_preset";
563
  $location = $mcdb->get_row($sql);
574
  $event_latitude = $location->location_latitude;
575
  $event_zoom = $location->location_zoom;
576
  $event_phone = $location->location_phone;
577
+ $event_access = $location->location_access;
578
  } else {
579
  $event_label = !empty($post['event_label']) ? $post['event_label'] : '';
580
  $event_street = !empty($post['event_street']) ? $post['event_street'] : '';
589
  $event_latitude = !empty($post['event_latitude']) ? $post['event_latitude'] : '';
590
  $event_zoom = !empty($post['event_zoom']) ? $post['event_zoom'] : '';
591
  $event_phone = !empty($post['event_phone']) ? $post['event_phone'] : '';
592
+ $event_access = !empty($post['event_access']) ? $post['event_access'] : array();
593
+ $event_access = !empty($post['event_access_hidden']) ? unserialize( $post['event_access_hidden'] ) : $event_access;
594
  }
595
+ // We check to make sure the URL is acceptable (blank or starting with http://)
596
+ if ( $event_link == '' ) {
 
597
  $url_ok = 1;
598
+ } else if ( preg_match('/^(http)(s?)(:)\/\//',$event_link) ) {
599
  $url_ok = 1;
600
  } else {
601
+ $event_link = "http://" . $event_link;
602
  }
603
  }
604
  // The title must be at least one character in length and no more than 255 - only basic punctuation is allowed
616
  'event_title'=>$title,
617
  'event_desc'=>$desc,
618
  'event_short'=>$short,
619
+ 'event_link'=>$event_link,
620
  'event_label'=>$event_label,
621
  'event_street'=>$event_street,
622
  'event_street2'=>$event_street2,
628
  'event_url'=>$event_url,
629
  'event_image'=>$event_image,
630
  'event_phone'=>$event_phone,
631
+ 'event_access'=>serialize($event_access),
632
+ 'event_tickets'=>$event_tickets,
633
+ 'event_registration'=>$event_registration,
634
  // integers
635
  'event_category'=>$category,
636
  'event_link_expires'=>$expires,
649
  $users_entries->event_desc = $desc;
650
  $users_entries->event_host = $host;
651
  $users_entries->event_category = $category;
652
+ $users_entries->event_link = $event_link;
653
  $users_entries->event_link_expires = $expires;
654
  $users_entries->event_label = $event_label;
655
  $users_entries->event_street = $event_street;
668
  $users_entries->event_short = $short;
669
  $users_entries->event_image = $event_image;
670
  $users_entries->event_span = $event_span;
671
+ $users_entries->event_access = serialize( $event_access );
672
+ $users_entries->events_access = serialize( $events_access );
673
+ $users_entries->event_tickets = $event_tickets;
674
+ $users_entries->event_registration = $event_registration;
675
  $proceed = false;
676
  }
677
  $data = array($proceed, $users_entries, $submit,$errors);
680
 
681
 
682
  // Used on the manage events admin page to display a list of events
683
+ function mc_list_groups() {
684
  global $wpdb;
685
  $mcdb = $wpdb;
686
+ $sortby = ( isset( $_GET['sort'] ) )?(int) $_GET['sort']:get_option('mc_default_sort');
687
+ if ( isset( $_GET['order'] ) ) {
688
+ $sortdir = ( isset($_GET['order']) && $_GET['order'] == 'ASC' )?'ASC':'default';
689
+ } else {
690
+ $sortdir = 'default';
691
+ }
 
 
 
692
  if ( empty($sortby) ) {
693
  $sortbyvalue = 'event_begin';
694
  } else {
695
  switch ($sortby) {
696
+ case 1:$sortbyvalue = 'event_ID'; break;
697
+ case 2:$sortbyvalue = 'event_title'; break;
698
+ case 3:$sortbyvalue = 'event_desc'; break;
699
+ case 4:$sortbyvalue = 'event_begin'; break;
700
+ case 5:$sortbyvalue = 'event_author'; break;
701
+ case 6:$sortbyvalue = 'event_category'; break;
702
+ case 7:$sortbyvalue = 'event_label'; break;
703
+ case 8:$sortbyvalue = 'group_id'; break;
 
 
 
 
 
 
 
 
704
  default:$sortbyvalue = 'event_begin';
705
  }
706
  }
707
+ $sortbydirection = ( $sortdir == 'default' ) ? 'DESC' : $sortdir;
708
+ $sorting = ( $sortbydirection == 'DESC' ) ? "&amp;order=ASC" : '';
 
 
 
709
 
710
+ $current = empty($_GET['paged']) ? 1 : intval($_GET['paged']);
711
+ $user = get_current_user_id();
712
+ $screen = get_current_screen();
713
+ $option = $screen->get_option( 'per_page', 'option' );
714
+ $items_per_page = get_user_meta( $user, $option, true );
715
+ if ( empty( $items_per_page ) || $items_per_page < 1 ) {
716
+ $items_per_page = $screen->get_option( 'per_page', 'default' );
717
  }
718
  $limit = ( isset($_GET['limit']) )?$_GET['limit']:'all';
719
  switch ( $limit ) {
722
  case 'ungrouped':$limit = 'WHERE event_group_id = 0';break;
723
  default:$limit = '';
724
  }
725
+ $events = $mcdb->get_results( "SELECT SQL_CALC_FOUND_ROWS * FROM " . my_calendar_table() . " $limit ORDER BY $sortbyvalue $sortbydirection LIMIT ".(($current-1)*$items_per_page).", ".$items_per_page );
726
+ $found_rows = $wpdb->get_col("SELECT FOUND_ROWS();");
727
+ $items = $found_rows[0];
728
+ ?><div class='inside'><?php
729
+ if ( get_option('mc_event_approve') == 'true' ) { ?>
730
  <ul class="links">
731
  <li><a <?php echo ( isset($_GET['limit']) && $_GET['limit']=='groupeed' )?' class="active-link"':''; ?> href="<?php echo admin_url('admin.php?page=my-calendar-groups&amp;limit=grouped#my-calendar-admin-table'); ?>"><?php _e('Grouped Events','my-calendar'); ?></a></li>
732
  <li><a <?php echo ( isset($_GET['limit']) && $_GET['limit']=='ungrouped')?' class="active-link"':''; ?> href="<?php echo admin_url('admin.php?page=my-calendar-groups&amp;limit=ungrouped#my-calendar-admin-table'); ?>"><?php _e('Ungrouped Events','my-calendar'); ?></a></li>
733
  <li><a <?php echo ( isset($_GET['limit']) && $_GET['limit']=='all' || !isset($_GET['limit']))?' class="active-link"':''; ?> href="<?php echo admin_url('admin.php?page=my-calendar-groups#my-calendar-admin-table'); ?>"><?php _e('All','my-calendar'); ?></a></li>
734
  </ul>
735
  <?php } ?>
736
+ <p><?php _e('Check a set of events to group them for mass editing.','my-calendar'); ?></p><?php
737
+ $num_pages = ceil($items / $items_per_page);
738
+ if ( $num_pages > 1 ) {
739
+ $page_links = paginate_links( array(
740
+ 'base'=> add_query_arg( 'paged', '%#%'),
741
+ 'format'=> '',
742
+ 'prev_text'=> __( '&laquo; Previous<span class="screen-reader-text"> Events</span>','my-calendar' ),
743
+ 'next_text'=> __( 'Next<span class="screen-reader-text"> Events</span> &raquo;','my-calendar' ),
744
+ 'total'=> $num_pages,
745
+ 'current'=> $current,
746
+ 'mid_size'=> 1
747
+ ));
748
+ printf( "<div class='tablenav'><div class='tablenav-pages'>%s</div></div>", $page_links );
749
+ }
750
+ if ( !empty($events) ) { ?>
751
  <form action="<?php echo admin_url("admin.php?page=my-calendar-groups"); ?>" method="post">
752
  <div>
753
  <input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" />
754
  <input type="hidden" name="event_action" value="group" />
755
  </div>
756
+ <p style="position:relative;display:inline-block;">
757
  <input type="submit" class="button-primary group" value="<?php _e('Group checked events for mass editing','my-calendar'); ?>" />
758
+ </p>
759
+ </div>
760
+ <table class="widefat wp-list-table" id="my-calendar-admin-table">
761
  <thead>
762
  <tr>
763
  <th scope="col" style="width: 50px;"><a href="<?php echo admin_url("admin.php?page=my-calendar-groups&amp;sort=1$sorting"); ?>"><?php _e('ID','my-calendar') ?></a></th>
781
  $spam_label = ($event->event_flagged == 1) ? '<strong>Possible spam:</strong> ' : '';
782
  $author = ( $event->event_author != 0 )?get_userdata($event->event_author):'Public Submitter';
783
  if ($event->event_link != '') {
784
+ $title = "<a href='".esc_attr($event->event_link)."'>$event->event_title</a>";
785
  } else {
786
+ $title = $event->event_title;
787
+ } ?>
 
788
  <tr class="<?php echo $class; echo $spam; ?>" id="event<?php echo $event->event_id; ?>">
789
  <th scope="row"><input type="checkbox" value="<?php echo $event->event_id; ?>" name="group[]" id="mc<?php echo $event->event_id; ?>" <?php echo (mc_event_is_grouped( $event->event_group_id ))?' disabled="disabled"':''; ?> /> <label for="mc<?php echo $event->event_id; ?>"><?php echo $event->event_id; ?></label></th>
790
  <th scope="row"><?php echo ($event->event_group_id == 0)?'-':$event->event_group_id; ?></th>
791
+ <td title="<?php echo esc_attr(substr(strip_tags(stripslashes($event->event_desc)),0,240)); ?>">
792
  <strong><?php if ( mc_can_edit_event( $event->event_author ) ) { ?>
793
  <a href="<?php echo admin_url("admin.php?page=my-calendar&amp;mode=edit&amp;event_id=$event->event_id"); ?>" class='edit'>
794
+ <?php }
795
+ echo $spam_label; echo stripslashes($title); ?>
796
  <?php if ( mc_can_edit_event( $event->event_author ) ) { echo "</a>"; } ?></strong>
797
  <div class='row-actions' style="visibility:visible;">
798
  <?php if ( mc_can_edit_event( $event->event_author ) ) { ?>
801
  <a href="<?php echo admin_url("admin.php?page=my-calendar-groups&amp;mode=edit&amp;event_id=$event->event_id&amp;group_id=$event->event_group_id"); ?>" class='edit group'><?php _e('Edit Group','my-calendar'); ?></a>
802
  <?php } else { ?>
803
  <em><?php _e('Ungrouped','my-calendar'); ?></em>
804
+ <?php }
805
+ } else { _e("Not editable.",'my-calendar'); } ?>
806
  </div>
807
  </td>
808
+ <td><?php echo stripslashes( $event->event_label ); ?></td>
809
+ <?php if ( $event->event_time != "00:00:00" ) { $eventTime = date_i18n(get_option('mc_time_format'), strtotime($event->event_time)); } else { $eventTime = get_option('mc_notime_text'); } ?>
810
+ <td><?php echo "$event->event_begin<br />$eventTime"; ?></td>
 
811
  <td>
812
  <?php
813
  $recurs = str_split( $event->event_recur, 1 );
814
  $recur = $recurs[0];
815
  $every = ( isset($recurs[1]) )?$recurs[1]:1;
816
  // Interpret the DB values into something human readable
817
+ if ($recur == 'S') { _e('Never','my-calendar'); }
818
  else if ($recur == 'D') { _e('Daily','my-calendar'); }
819
  else if ($recur == 'E') { _e('Weekdays','my-calendar'); }
820
  else if ($recur == 'W') { _e('Weekly','my-calendar'); }
823
  else if ($recur == 'U') { _e('Monthly (by day)','my-calendar'); }
824
  else if ($recur == 'Y') { _e('Yearly','my-calendar'); }
825
  ?>&ndash;<?php
826
+ if ( $recur == 'S' ) {
827
+ _e('N/A','my-calendar');
828
+ } else if ( mc_event_repeats_forever( $recur, $event->event_repeats ) ) {
829
+ _e('Forever','my-calendar');
830
+ } else if ( $event->event_repeats > 0 ) {
831
+ printf(__('%d Times','my-calendar'),$event->event_repeats );
832
+ }
833
  ?>
834
  </td>
835
  <td><?php echo ( is_object($author) )?$author->display_name:$author; ?></td>
836
+ <?php
837
+ $this_category = $event->event_category;
838
+ foreach ( $categories as $key=>$value ) {
839
+ if ($value->category_id == $this_category) {
840
+ $this_cat = $categories[$key];
841
+ }
842
+ }
843
+ ?>
844
  <td><div class="category-color" style="background-color:<?php echo (strpos($this_cat->category_color,'#') !== 0)?'#':''; echo $this_cat->category_color;?>;"> </div> <?php echo stripslashes($this_cat->category_name); ?></td>
845
  <?php unset($this_cat); ?>
846
+ </tr><?php
847
+ } ?>
 
 
848
  </table>
849
+ <div class="inside">
850
+ <p>
851
+ <input type="submit" class="button-secondary group" value="<?php _e( 'Group checked events for mass editing', 'my-calendar' ); ?>" />
852
+ </p>
853
+ </div>
854
+ </form><?php
855
+ } else { ?>
856
+ <div class="inside"><p><?php _e("There are no events in the database!",'my-calendar') ?></p></div><?php
 
857
  }
858
+ }
 
 
 
my-calendar-help.php CHANGED
@@ -5,7 +5,7 @@ function my_calendar_help() { ?>
5
 
6
  <div class="wrap jd-my-calendar">
7
  <h2><?php _e('How to use My Calendar','my-calendar'); ?></h2>
8
- <div class="postbox-container" style="width: 70%">
9
  <div class="metabox-holder">
10
 
11
  <div class="ui-sortable meta-box-sortables">
@@ -13,7 +13,8 @@ function my_calendar_help() { ?>
13
  <h3><?php _e('My Calendar Help','my-calendar'); ?></h3>
14
  <div class="inside">
15
  <?php do_action( 'mc_before_help' ); ?>
16
- <ul class="mc-settings">
 
17
  <li><a href="#mc-shortcodes"><?php _e('Shortcodes','my-calendar'); ?></a></li>
18
  <li><a href="#icons"><?php _e('Icons','my-calendar'); ?></a></li>
19
  <li><a href="#mc-styles"><?php _e('Styles','my-calendar'); ?></a></li>
@@ -29,83 +30,117 @@ function my_calendar_help() { ?>
29
  <div class="postbox">
30
  <h3 id="help"><?php _e('Getting Started','my-calendar'); ?></h3>
31
  <div class="inside">
32
- <p>
33
- <?php _e('Although the My Calendar plug-in is very complicated in terms of what can be customized, the basic usage is quite simple.','my-calendar'); ?>
34
- </p>
35
  <ul>
36
- <li> - <?php _e('Add the My Calendar shortcode (<code>[my_calendar]</code>) to a page.','my-calendar'); ?></li>
37
- <li> - <?php _e('Add events by clicking on the Add/Edit Events link in the admin sidebar or on "Add Events" in the admin toolbar.','my-calendar'); ?></li>
38
- <li> - <?php _e('Select your preferred stylesheet in the Styles Editor','my-calendar'); ?></li>
39
  </ul>
40
  <p>
41
- <?php _e('Read more of the basic help documentation on this page or purchase the My Calendar User\'s Guide to customize further -- but the above is all that you need to do to begin using the calendar.','my-calendar'); ?>
42
  </p>
43
  </div>
44
  </div>
45
  </div>
46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  <div class="ui-sortable meta-box-sortables">
48
  <div class="postbox" id="mc-shortcodes">
49
  <h3><?php _e('Shortcode Syntax','my-calendar'); ?></h3>
50
  <div class="inside">
51
- <p>
52
- <?php _e('These shortcodes can be used in Posts, Pages, or in text widgets.','my-calendar'); ?>
53
- </p>
54
  <h4><?php _e('Main Calendar Shortcode (List or Grid, Weekly or Monthly view)','my-calendar'); ?></h4>
55
  <p class="example"><code>[my_calendar]</code></p>
 
 
56
  <p>
57
- <?php _e('This basic shortcode will show the one-week view of the calendar on a post or page including all categories and the category key, in a list format. The standard previous/next navigation will be included above the calendar, the link to the print format (if enabled) will be shown below.','my-calendar'); ?>
58
  </p>
59
- <p class="example"><code>[my_calendar format="list" above="nav" below="print" time="week"]</code></p>
60
  <p>
61
- <?php _e('The shortcode supports these attributes:','my-calendar'); ?>
62
  </p>
63
  <ul>
64
- <li><code>category</code>: <?php _e('Names or IDs of categories included in this calendar, comma or pipe separated.','my-calendar'); ?></li>
65
- <li><code>format</code>: <?php _e('Either "list" or "mini" to show the list view or the mini calendar; exclude or any other value to show the main grid calendar.','my-calendar'); ?></li>
66
- <li><code>above</code>, <code>below</code>: <?php _e("Comma-separated list of navigational features to display above or below the calendar. Available: <strong>nav, toggle, jump, print, key, feeds, timeframe</strong>. Order listed determines the order displayed. Feed links and print view will only display if they are enabled on the settings page. All other fields will appear if specified; the defaults specified in settings will be used if the attribute is left blank. Use <em>none</em> to hide all navigation elements.",'my-calendar'); ?></li>
67
- <li><code>time</code>: <?php _e('Set to "week" to show a one week view or to "day" to show a single day view. Any other value will show a month view. (Day view shows as a list regardless of format setting.)','my-calendar'); ?></li>
68
- <li><code>ltype</code>: <?php _e('The type of location data to restrict by.','my-calendar'); ?></li>
69
- <li><code>lvalue</code>: <?php _e('The specific location information to filter to.','my-calendar'); ?></li>
70
- <li><code>author</code>: <?php _e('Author or comma-separated list of authors (usernames or IDs) to show events from.','my-calendar'); ?></li>
71
- <li><code>host</code>: <?php _e('Host or comma-separated list of hosts (WordPress usernames or IDs) to show events from.','my-calendar'); ?></li>
72
- <li><code>id</code>: <?php _e('String to give this specific calendar shortcode a unique ID. Use when showing multiple calendars in a Page or post.','my-calendar'); ?></li>
73
  </ul>
74
  <p>
75
  <em><?php _e('The main My Calendar shortcode can be generated from a button in your post and page editor. The mini calendar can also be accessed and configured as a widget.','my-calendar'); ?></em>
76
  </p>
77
- <h4><?php _e('Additional Calendar Views (Upcoming events, today\'s events)','my-calendar'); ?></h4>
78
- <p class="example"><code>[my_calendar_upcoming before="3" after="3" type="event" fallback="No events coming up!" category="General" author="1" host="1" template="{title} {date}" order="asc" show_today="yes" skip="0"]</code></p>
79
  <p>
80
- <?php _e('Displays the output of the Upcoming Events widget. The <code>before</code> and <code>after</code> attributes should be numbers; the <code>type</code> attribute can be either "event" or "days", and the <code>category</code> and <code>author</code> attributes work the same way as on the main calendar shortcode. Templates work using the template codes listed below. <code>fallback</code> provides text in case there are no events meeting your criteria. Order provides a sort order for the events list &ndash; either ascending (<code>asc</code>) or descending (<code>desc</code>). <code>show_today</code> is an indicator whether or not to include today\'s events in the list. <code>Skip</code> is the number of events to skip in the upcoming events.','my-calendar'); ?>
81
  </p>
82
  <p class="example"><code>[my_calendar_today category="" author="1" host="1" fallback="Nothing today!" template="{title} {date}"]</code></p>
83
  <p>
84
  <?php _e('Displays the output of the Today\'s Events widget, with four configurable attributes: category, author, template and fallback text.','my-calendar'); ?>
85
  </p>
86
  <p>
87
- <em><?php _e('Both Upcoming Events and Today\'s Events can also be configured using widgets.','my-calendar'); ?></em>
88
  </p>
89
  <p class="example"><code>[my_calendar_event event="" template="&lt;h3&gt;{title}&lt;/h3&gt;{description}" list="&lt;li&gt;{date}, {time}&lt;/li&gt;" before="&lt;ul&gt;" after="&lt;/ul&gt;"]</code></p>
90
  <p>
91
  <?php _e('Displays a single event and/or all dates for that event. If template is set to a blank value, will only display the list of occurrences. If the list attribute is set blank, will only show the event template','my-calendar'); ?>
92
  </p>
93
 
94
- <h4><?php _e('Supplement Features (Locations filter, Categories filter)','my-calendar'); ?></h4>
95
 
96
- <p class="example"><code>[my_calendar_locations show="list" type="saved" datatype="name"]</code></p>
 
 
97
  <p>
98
- <?php _e('List of event locations, either as a list of links or as a select form. The <code>show</code> attribute can either be <code>list</code> or <code>form</code>, <code>type</code> is either <code>saved</code> (to show items from your stored locations), or <code>custom</code> (to show the options configured in your user settings). <code>datatype</code> must be the type of data your limits are choosing from: <code>name</code> (business name), <code>city</code>, <code>state</code>, <code>country</code>, <code>zip</code> (postal code), or <code>region</code>.','my-calendar'); ?>
99
  </p>
100
- <p class="example"><code>[my_calendar_show_locations datatype="" template=""]</code></p>
101
  <p>
102
- <?php _e('Display a list of locations. The <code>datatype</code> is the type of data displayed; all lists will include a link to the map of that location. In addition to basic location information as in the above shortcode, you can also use "hcard" to display all available location information.','my-calendar'); ?>
103
- <?php _e('Use the <code>template</code> attribute to show your customized set of data. Sorted by the <code>datatype</code> value.','my-calendar'); ?>
104
- </p>
105
  <p class="example"><code>[my_calendar_categories show="list"]</code></p>
106
  <p>
107
  <?php _e('List of event categories, either as a list of links or as a select dropdown form. The <code>show</code> attribute can either be <code>list</code> or <code>form</code>.','my-calendar'); ?>
108
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
109
  </div>
110
  </div>
111
 
@@ -142,7 +177,7 @@ function my_calendar_help() { ?>
142
 
143
  <div class="ui-sortable meta-box-sortables" id="templates">
144
  <div class="postbox">
145
- <h3 id="template"><?php _e('Widget Templating','my-calendar'); ?></h3>
146
  <div class="inside">
147
  <p>
148
  <?php _e('All template tags support two attributes: before="value" and after="value". The values of the attributes will be placed before and after the output value. These attribute values <strong>must</strong> be wrapped in double quotes.','my-calendar'); ?>
@@ -164,6 +199,9 @@ function my_calendar_help() { ?>
164
  <dt><code>{time}</code></dt>
165
  <dd><?php _e('Displays the start time for the event.','my-calendar'); ?></dd>
166
 
 
 
 
167
  <dt><code>{usertime}</code></dt>
168
  <dd><?php _e('Displays the start time for the event adjusted to the current user\'s time zone settings. Returns <code>{time}</code> if user settings are disabled or if the user has not selected a preferred time zone.','my-calendar'); ?></dd>
169
 
@@ -221,6 +259,9 @@ function my_calendar_help() { ?>
221
  <dt><code>{shortdesc_stripped}</code></dt>
222
  <dd><?php _e('Displays short description with any HTML stripped out.','my-calendar'); ?></dd>
223
 
 
 
 
224
  <dt><code>{description}</code></dt>
225
  <dd><?php _e('Displays the description of the event.','my-calendar'); ?></dd>
226
 
@@ -230,11 +271,26 @@ function my_calendar_help() { ?>
230
  <dt><code>{description_stripped}</code></dt>
231
  <dd><?php _e('Displays description with any HTML stripped out.','my-calendar'); ?></dd>
232
 
 
 
 
233
  <dt><code>{image}</code></dt>
234
  <dd><?php _e('Image associated with the event. (HTMl)','my-calendar'); ?></dd>
235
 
236
  <dt><code>{image_url}</code></dt>
237
- <dd><?php _e('Image associated with the event. (image URL only)','my-calendar'); ?></dd>
 
 
 
 
 
 
 
 
 
 
 
 
238
 
239
  <dt><code>{link}</code></dt>
240
  <dd><?php _e('Displays the URL provided for the event.','my-calendar'); ?></dd>
@@ -245,6 +301,12 @@ function my_calendar_help() { ?>
245
  <dt><code>{ical_html}</code></dt>
246
  <dd><?php _e('Produces a hyperlink to download an iCal formatted record for the event.','my-calendar'); ?></dd>
247
 
 
 
 
 
 
 
248
  <dt><code>{recurs}</code></dt>
249
  <dd><?php _e('Shows the recurrence status of the event. (Daily, Weekly, etc.)','my-calendar'); ?></dd>
250
 
@@ -254,15 +316,25 @@ function my_calendar_help() { ?>
254
  <dt><code>{details}</code></dt>
255
  <dd><?php _e('Provides a link to an auto-generated page containing all information on the given event.','my-calendar'); ?> <strong><?php _e('Requires that the site URL has been provided on the Settings page','my-calendar'); ?></strong>
256
 
 
 
 
257
  <dt><code>{linking}</code></dt>
258
  <dd><?php _e('Provides a link to the defined event URL when present, otherwise the {details} link.','my-calendar'); ?> <strong><?php _e('Requires that the site URL has been provided on the Settings page','my-calendar'); ?></strong>
259
 
260
  <dt><code>{event_open}</code></dt>
261
  <dd><?php _e('Displays text indicating whether registration for the event is currently open or closed; displays nothing if that choice is selected in the event.','my-calendar'); ?></dd>
262
 
 
 
 
 
 
 
263
  <dt><code>{event_status}</code></dt>
264
  <dd><?php _e('Displays the current status of the event: either "Published" or "Reserved" - primary used in email templates.','my-calendar'); ?></dd>
265
  </dl>
 
266
  <h4><?php _e('Location Template Tags','my-calendar'); ?></h4>
267
 
268
  <dl>
@@ -307,6 +379,13 @@ function my_calendar_help() { ?>
307
 
308
  <dt><code>{map_url}</code></dt>
309
  <dd><?php _e('Produces the URL for the Google Map for the event location if sufficient address information is available. If not, will be empty.','my-calendar'); ?></dd>
 
 
 
 
 
 
 
310
  </dl>
311
  <h4><?php _e('Category Template Tags','my-calendar'); ?></h4>
312
 
@@ -324,8 +403,7 @@ function my_calendar_help() { ?>
324
  <dd><?php _e('Produces the hex code for the current event\'s category color.','my-calendar'); ?></dd>
325
 
326
  <dt><code>{cat_id}</code></dt>
327
- <dd><?php _e('Displays the ID for
328
- the category the event is in.','my-calendar'); ?></dd>
329
  </dl>
330
 
331
  <h4><?php _e('Special use Template Tags','my-calendar'); ?></h4>
@@ -373,7 +451,7 @@ function my_calendar_help() { ?>
373
  </div>
374
  </div>
375
  </div>
376
- <?php jd_show_support_box(); ?>
377
 
378
  </div>
379
  <?php } ?>
5
 
6
  <div class="wrap jd-my-calendar">
7
  <h2><?php _e('How to use My Calendar','my-calendar'); ?></h2>
8
+ <div class="postbox-container jcd-wide">
9
  <div class="metabox-holder">
10
 
11
  <div class="ui-sortable meta-box-sortables">
13
  <h3><?php _e('My Calendar Help','my-calendar'); ?></h3>
14
  <div class="inside">
15
  <?php do_action( 'mc_before_help' ); ?>
16
+ <ul class="mc-settings checkboxes">
17
+ <li><a href="#mc-generator"><?php _e('Shortcode Generator','my-calendar'); ?></a></li>
18
  <li><a href="#mc-shortcodes"><?php _e('Shortcodes','my-calendar'); ?></a></li>
19
  <li><a href="#icons"><?php _e('Icons','my-calendar'); ?></a></li>
20
  <li><a href="#mc-styles"><?php _e('Styles','my-calendar'); ?></a></li>
30
  <div class="postbox">
31
  <h3 id="help"><?php _e('Getting Started','my-calendar'); ?></h3>
32
  <div class="inside">
 
 
 
33
  <ul>
34
+ <li><?php _e('Add the My Calendar shortcode (<code>[my_calendar]</code>) to a page.','my-calendar'); ?></li>
35
+ <li><?php _e('Add events by clicking on the Add/Edit Events link in the admin or on "Add Events" in the toolbar.','my-calendar'); ?></li>
36
+ <li><?php _e('Select your preferred stylesheet in the Styles Editor','my-calendar'); ?></li>
37
  </ul>
38
  <p>
39
+ <?php printf( __('Read more help documentation below or <a href="%s">purchase the My Calendar User\'s Guide</a> to learn more -- but the above is all that you need to do to begin using the calendar.','my-calendar'), 'https://www.joedolson.com/articles/my-calendar/users-guide/' ); ?>
40
  </p>
41
  </div>
42
  </div>
43
  </div>
44
 
45
+ <div class="ui-sortable meta-box-sortables" id="mc-generator">
46
+ <div class="postbox">
47
+ <h3 id="help"><?php _e("My Calendar Shortcode Generator",'my-calendar'); ?></h3>
48
+ <div class="inside mc-tabs">
49
+ <?php mc_generate(); ?>
50
+ <ul class='tabs'>
51
+ <li><a href='#mc_main'><?php _e( 'Main','my-calendar' ); ?></a></li>
52
+ <li><a href='#mc_upcoming'><?php _e( 'Upcoming','my-calendar' ); ?></a></li>
53
+ <li><a href='#mc_today'><?php _e( 'Today','my-calendar' ); ?></a></li>
54
+ <?php echo apply_filters( 'mc_generator_tabs', '' ); ?>
55
+ </ul>
56
+ <div class='wptab mc_main' id='mc_main' aria-live='polite'>
57
+ <?php mc_generator( 'main' ); ?>
58
+ </div>
59
+ <div class='wptab mc_upcoming' id='mc_upcoming' aria-live='polite'>
60
+ <?php mc_generator( 'upcoming' ); ?>
61
+ </div>
62
+ <div class='wptab mc_today' id='mc_today' aria-live='polite'>
63
+ <?php mc_generator( 'today' ); ?>
64
+ </div>
65
+ <?php echo apply_filters( 'mc_generator_tab_content', '' ); ?>
66
+ </div>
67
+ </div>
68
+ </div>
69
+
70
+
71
  <div class="ui-sortable meta-box-sortables">
72
  <div class="postbox" id="mc-shortcodes">
73
  <h3><?php _e('Shortcode Syntax','my-calendar'); ?></h3>
74
  <div class="inside">
75
+
 
 
76
  <h4><?php _e('Main Calendar Shortcode (List or Grid, Weekly or Monthly view)','my-calendar'); ?></h4>
77
  <p class="example"><code>[my_calendar]</code></p>
78
+ <h4><?php _e('Example Customized Shortcode','my-calendar'); ?></h4>
79
+ <p class="example"><code>[my_calendar format="list" above="nav" below="print" time="week"]</code></p>
80
  <p>
81
+ <?php _e('This shortcode shows the one-week view of the calendar on a post or page including all categories and the category key, in a list format. The standard previous/next navigation will be included above the calendar, the link to the print format (if enabled) will be shown below.','my-calendar'); ?>
82
  </p>
 
83
  <p>
84
+ <?php _e('Shortcode attributes:','my-calendar'); ?>
85
  </p>
86
  <ul>
87
+ <li><code>category</code>: <?php _e('Names or IDs of categories in the calendar, comma or pipe separated.','my-calendar'); ?></li>
88
+ <li><code>format</code>: <?php _e('"list" or "mini"; exclude or any other value to show a calendar grid.','my-calendar'); ?></li>
89
+ <li><code>above</code>, <code>below</code>: <?php _e("Comma-separated list of navigation to display above or below the calendar. Available: <strong>nav, toggle, jump, print, key, feeds, timeframe</strong>. Order listed determines the order displayed. Defaults in settings will be used if the attribute is blank. Use <em>none</em> to hide all navigation.",'my-calendar'); ?></li>
90
+ <li><code>time</code>: <?php _e('Set to "week" to show a one week view or to "day" to show a single day view. Any other value will show a month view. (Day view always shows as a list.)','my-calendar'); ?></li>
91
+ <li><code>ltype</code>: <?php _e('Type of location data to restrict by.','my-calendar'); ?></li>
92
+ <li><code>lvalue</code>: <?php _e('Specific location information to filter to.','my-calendar'); ?></li>
93
+ <li><code>author</code>: <?php _e('Author or comma-separated list (usernames or IDs) to show events from.','my-calendar'); ?></li>
94
+ <li><code>host</code>: <?php _e('Host or comma-separated list (usernames or IDs) to show events from.','my-calendar'); ?></li>
95
+ <li><code>id</code>: <?php _e('String to give shortcode a unique ID.','my-calendar'); ?></li>
96
  </ul>
97
  <p>
98
  <em><?php _e('The main My Calendar shortcode can be generated from a button in your post and page editor. The mini calendar can also be accessed and configured as a widget.','my-calendar'); ?></em>
99
  </p>
100
+ <h4><?php _e('Additional Views (Upcoming events, today\'s events)','my-calendar'); ?></h4>
101
+ <p class="example"><code>[my_calendar_upcoming before="3" after="3" type="event" fallback="No events coming up!" category="General" author="1" host="1" template="{title} {date}" order="asc" show_today="yes" skip="0" ltype="" lvalue=""]</code></p>
102
  <p>
103
+ <?php _e('Displays the output of the Upcoming Events widget. <code>before</code> and <code>after</code> are numbers; <code>type</code> is either "event" or "days", and <code>category</code> and <code>author</code> work the same as in the main calendar shortcode. Templates use the template codes listed below. <code>fallback</code> provides text if no events meet your criteria. Order sets sort order for the list &ndash; ascending (<code>asc</code>) or descending (<code>desc</code>). <code>show_today</code> indicates whether to include today\'s events in the list. <code>Skip</code> is how many events to skip in the list.','my-calendar'); ?>
104
  </p>
105
  <p class="example"><code>[my_calendar_today category="" author="1" host="1" fallback="Nothing today!" template="{title} {date}"]</code></p>
106
  <p>
107
  <?php _e('Displays the output of the Today\'s Events widget, with four configurable attributes: category, author, template and fallback text.','my-calendar'); ?>
108
  </p>
109
  <p>
110
+ <em><?php _e('Upcoming Events and Today\'s Events can also be configured as widgets.','my-calendar'); ?></em>
111
  </p>
112
  <p class="example"><code>[my_calendar_event event="" template="&lt;h3&gt;{title}&lt;/h3&gt;{description}" list="&lt;li&gt;{date}, {time}&lt;/li&gt;" before="&lt;ul&gt;" after="&lt;/ul&gt;"]</code></p>
113
  <p>
114
  <?php _e('Displays a single event and/or all dates for that event. If template is set to a blank value, will only display the list of occurrences. If the list attribute is set blank, will only show the event template','my-calendar'); ?>
115
  </p>
116
 
 
117
 
118
+ <h4><?php _e( 'Calendar Filter Shortcodes', 'my-calendar' ); ?></h4>
119
+
120
+ <p class="example"><code>[mc_filters show="categories,locations"]</code></p>
121
  <p>
122
+ <?php _e('Displays all available filters as a single form. The <code>show</code> attribute takes three keywords: categories, locations, and access, to indicate which filters to show and in what order.','my-calendar'); ?>
123
  </p>
124
+ <p class="example"><code>[my_calendar_locations show="list" type="saved" datatype="name"]</code></p>
125
  <p>
126
+ <?php _e('List of event locations, as a list of links or as a select form. <code>show</code> is either <code>list</code> or <code>form</code>, <code>type</code> is <code>saved</code> (to show items from stored locations), or <code>custom</code> (to show options configured in location settings). <code>datatype</code> must be the type of data your limits are using: <code>name</code> (business name), <code>city</code>, <code>state</code>, <code>country</code>, <code>zip</code> (postal code), or <code>region</code>.','my-calendar'); ?>
127
+ </p>
 
128
  <p class="example"><code>[my_calendar_categories show="list"]</code></p>
129
  <p>
130
  <?php _e('List of event categories, either as a list of links or as a select dropdown form. The <code>show</code> attribute can either be <code>list</code> or <code>form</code>.','my-calendar'); ?>
131
+ </p>
132
+ <p class="example"><code>[my_calendar_access show="list"]</code></p>
133
+ <p>
134
+ <?php _e('List of filterable accessibility services, either as a list of links or as a select dropdown form. The <code>show</code> attribute can either be <code>list</code> or <code>form</code>.','my-calendar'); ?>
135
+ </p>
136
+ <h4><?php _e( 'Information Listing Shortcodes', 'my-calendar' ); ?></h4>
137
+
138
+ <p class="example"><code>[my_calendar_show_locations datatype="" template=""]</code></p>
139
+ <p>
140
+ <?php _e('List of locations. <code>datatype</code> is the type of data displayed; all lists include a link to the map to that location. In addition to basic location information as in the above shortcode, you can also use "hcard" to display all available location information.','my-calendar'); ?>
141
+ <?php _e('Use <code>template</code> to show customized data, sorted by the <code>datatype</code> value.','my-calendar'); ?>
142
+ </p>
143
+
144
  </div>
145
  </div>
146
 
177
 
178
  <div class="ui-sortable meta-box-sortables" id="templates">
179
  <div class="postbox">
180
+ <h3 id="template"><?php _e('Template Tags','my-calendar'); ?></h3>
181
  <div class="inside">
182
  <p>
183
  <?php _e('All template tags support two attributes: before="value" and after="value". The values of the attributes will be placed before and after the output value. These attribute values <strong>must</strong> be wrapped in double quotes.','my-calendar'); ?>
199
  <dt><code>{time}</code></dt>
200
  <dd><?php _e('Displays the start time for the event.','my-calendar'); ?></dd>
201
 
202
+ <dt><code>{runtime}</code></dt>
203
+ <dd><?php _e('Human language estimate of how long an event will run.','my-calendar'); ?></dd>
204
+
205
  <dt><code>{usertime}</code></dt>
206
  <dd><?php _e('Displays the start time for the event adjusted to the current user\'s time zone settings. Returns <code>{time}</code> if user settings are disabled or if the user has not selected a preferred time zone.','my-calendar'); ?></dd>
207
 
259
  <dt><code>{shortdesc_stripped}</code></dt>
260
  <dd><?php _e('Displays short description with any HTML stripped out.','my-calendar'); ?></dd>
261
 
262
+ <dt><code>{excerpt}</code></dt>
263
+ <dd><?php _e('Like <code>the_excerpt();</code> displays shortdesc if provided, otherwise excerpts description.','my-calendar'); ?></dd>
264
+
265
  <dt><code>{description}</code></dt>
266
  <dd><?php _e('Displays the description of the event.','my-calendar'); ?></dd>
267
 
271
  <dt><code>{description_stripped}</code></dt>
272
  <dd><?php _e('Displays description with any HTML stripped out.','my-calendar'); ?></dd>
273
 
274
+ <dt><code>{access}</code></dt>
275
+ <dd><?php _e('Unordered list of accessibility options for this event.','my-calendar'); ?></dd>
276
+
277
  <dt><code>{image}</code></dt>
278
  <dd><?php _e('Image associated with the event. (HTMl)','my-calendar'); ?></dd>
279
 
280
  <dt><code>{image_url}</code></dt>
281
+ <dd><?php _e('Image associated with the event. (image URL only)','my-calendar'); ?></dd>
282
+
283
+ <dt><code>{full}</code></dt>
284
+ <dd><?php _e('Event post thumbnail, full size, full HTML','my-calendar'); ?></dd>
285
+ <?php
286
+ $sizes = get_intermediate_image_sizes();
287
+ foreach ( $sizes as $size ) {
288
+ ?>
289
+ <dt><code>{<?php echo $size; ?>}</code></dt>
290
+ <dd><?php printf( __('Event post thumbnail, %s size, full HTML','my-calendar'), $size ); ?></dd>
291
+ <?php
292
+ }
293
+ ?>
294
 
295
  <dt><code>{link}</code></dt>
296
  <dd><?php _e('Displays the URL provided for the event.','my-calendar'); ?></dd>
301
  <dt><code>{ical_html}</code></dt>
302
  <dd><?php _e('Produces a hyperlink to download an iCal formatted record for the event.','my-calendar'); ?></dd>
303
 
304
+ <dt><code>{gcal}</code></dt>
305
+ <dd><?php _e('URL to submit event to Google Calendar','my-calendar'); ?></dd>
306
+
307
+ <dt><code>{gcal_link}</code></dt>
308
+ <dd><?php _e('Link to submit event to Google Calendar, with class "gcal"','my-calendar'); ?></dd>
309
+
310
  <dt><code>{recurs}</code></dt>
311
  <dd><?php _e('Shows the recurrence status of the event. (Daily, Weekly, etc.)','my-calendar'); ?></dd>
312
 
316
  <dt><code>{details}</code></dt>
317
  <dd><?php _e('Provides a link to an auto-generated page containing all information on the given event.','my-calendar'); ?> <strong><?php _e('Requires that the site URL has been provided on the Settings page','my-calendar'); ?></strong>
318
 
319
+ <dt><code>{details_link}</code></dt>
320
+ <dd><?php _e('Raw URL for the details link; empty if target URL not defined.','my-calendar'); ?>
321
+
322
  <dt><code>{linking}</code></dt>
323
  <dd><?php _e('Provides a link to the defined event URL when present, otherwise the {details} link.','my-calendar'); ?> <strong><?php _e('Requires that the site URL has been provided on the Settings page','my-calendar'); ?></strong>
324
 
325
  <dt><code>{event_open}</code></dt>
326
  <dd><?php _e('Displays text indicating whether registration for the event is currently open or closed; displays nothing if that choice is selected in the event.','my-calendar'); ?></dd>
327
 
328
+ <dt><code>{event_tickets}</code></dt>
329
+ <dd><?php _e('URL to ticketing for event.','my-calendar'); ?></dd>
330
+
331
+ <dt><code>{event_registration}</code></dt>
332
+ <dd><?php _e('Registration information about this event.','my-calendar'); ?></dd>
333
+
334
  <dt><code>{event_status}</code></dt>
335
  <dd><?php _e('Displays the current status of the event: either "Published" or "Reserved" - primary used in email templates.','my-calendar'); ?></dd>
336
  </dl>
337
+
338
  <h4><?php _e('Location Template Tags','my-calendar'); ?></h4>
339
 
340
  <dl>
379
 
380
  <dt><code>{map_url}</code></dt>
381
  <dd><?php _e('Produces the URL for the Google Map for the event location if sufficient address information is available. If not, will be empty.','my-calendar'); ?></dd>
382
+
383
+ <dt><code>{map}</code></dt>
384
+ <dd><?php _e('Output Google Map if sufficient address information is available. If not, will be empty.','my-calendar'); ?></dd>
385
+
386
+ <dt><code>{location_access}</code></dt>
387
+ <dd><?php _e('Unordered list of accessibility options for this location.','my-calendar'); ?></dd>
388
+
389
  </dl>
390
  <h4><?php _e('Category Template Tags','my-calendar'); ?></h4>
391
 
403
  <dd><?php _e('Produces the hex code for the current event\'s category color.','my-calendar'); ?></dd>
404
 
405
  <dt><code>{cat_id}</code></dt>
406
+ <dd><?php _e('Displays the ID for the category the event is in.','my-calendar'); ?></dd>
 
407
  </dl>
408
 
409
  <h4><?php _e('Special use Template Tags','my-calendar'); ?></h4>
451
  </div>
452
  </div>
453
  </div>
454
+ <?php mc_show_sidebar(); ?>
455
 
456
  </div>
457
  <?php } ?>
my-calendar-ical.php CHANGED
@@ -2,27 +2,28 @@
2
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
 
4
  function my_calendar_ical() {
 
 
 
 
 
5
 
6
- $p = ( isset($_GET['span']) )?'year':false;
7
- $y = ( isset($_GET['yr']) )?$_GET['yr']:date('Y');
8
- $m = ( isset($_GET['month']) )?$_GET['month']:date('n');
9
-
10
- if ( $p ) {
11
- $from = "$y-1-1";
12
- $to = "$y-12-31";
13
- } else {
14
- $d = date( 't',mktime( 0,0,0,$m,1,$y ) );
15
- $from = "$y-$m-1";
16
- $to = "$y-$m-$d";
17
- }
18
 
19
- $from = apply_filters( 'mc_ical_download_from', $from, $p );
20
- $to = apply_filters( 'mc_ical_download_to', $to, $p );
21
- $atts = array( 'category'=>null, 'ltype'=>'', 'lvalue'=>'', 'source'=>'calendar', 'author'=>null, 'host'=> null );
22
- $atts = apply_filters( 'mc_ical_attributes', $atts );
23
- extract( $atts );
24
 
25
- global $mc_version;
26
  // establish template
27
  $template = "BEGIN:VEVENT
28
  UID:{dateid}-{id}
@@ -40,7 +41,7 @@ END:VEVENT";
40
  $output = 'BEGIN:VCALENDAR
41
  VERSION:2.0
42
  METHOD:PUBLISH
43
- PRODID:-//Accessible Web Design//My Calendar//http://www.mywpcal.com//v'.$mc_version.'//EN';
44
 
45
  $events = my_calendar_grab_events( $from, $to, $category, $ltype, $lvalue, $source, $author, $host );
46
  if ( is_array($events) && !empty($events) ) {
@@ -48,7 +49,7 @@ PRODID:-//Accessible Web Design//My Calendar//http://www.mywpcal.com//v'.$mc_ver
48
  $event =& $events[$key];
49
  if ( is_object($event) ) {
50
  if ( !( $event->category_private == 1 && !is_user_logged_in() ) ) {
51
- $array = event_as_array($event);
52
  $output .= "\n".jd_draw_template($array,$template,'ical');
53
  }
54
  }
2
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
 
4
  function my_calendar_ical() {
5
+ $p = ( isset( $_GET['span'] ) ) ? 'year' : false;
6
+ $y = ( isset( $_GET['yr'] ) ) ? $_GET['yr'] : date('Y');
7
+ $m = ( isset( $_GET['month'] ) ) ? $_GET['month'] : date('n');
8
+ $ny = ( isset( $_GET['nyr'] ) ) ? $_GET['nyr'] : $m;
9
+ $nm = ( isset( $_GET['nmonth'] ) ) ? $_GET['nmonth'] : $y;
10
 
11
+ if ( $p ) {
12
+ $from = "$y-1-1";
13
+ $to = "$y-12-31";
14
+ } else {
15
+ $d = date( 't',mktime( 0,0,0,$m,1,$y ) );
16
+ $from = "$y-$m-1";
17
+ $to = "$ny-$nm-$d";
18
+ }
 
 
 
 
19
 
20
+ $from = apply_filters( 'mc_ical_download_from', $from, $p );
21
+ $to = apply_filters( 'mc_ical_download_to', $to, $p );
22
+ $atts = array( 'category'=>null, 'ltype'=>'', 'lvalue'=>'', 'source'=>'calendar', 'author'=>null, 'host'=> null );
23
+ $atts = apply_filters( 'mc_ical_attributes', $atts );
24
+ extract( $atts );
25
 
26
+ global $mc_version;
27
  // establish template
28
  $template = "BEGIN:VEVENT
29
  UID:{dateid}-{id}
41
  $output = 'BEGIN:VCALENDAR
42
  VERSION:2.0
43
  METHOD:PUBLISH
44
+ PRODID:-//Accessible Web Design//My Calendar//http://www.joedolson.com//v'.$mc_version.'//EN';
45
 
46
  $events = my_calendar_grab_events( $from, $to, $category, $ltype, $lvalue, $source, $author, $host );
47
  if ( is_array($events) && !empty($events) ) {
49
  $event =& $events[$key];
50
  if ( is_object($event) ) {
51
  if ( !( $event->category_private == 1 && !is_user_logged_in() ) ) {
52
+ $array = mc_create_tags($event);
53
  $output .= "\n".jd_draw_template($array,$template,'ical');
54
  }
55
  }
my-calendar-importer.php DELETED
@@ -1,117 +0,0 @@
1
- <?php
2
-
3
- /* use SplFileObject to parse CSV
4
- $file = 'data.csv';
5
- try {
6
- $csv = new SplFileObject($file, 'r');
7
- } catch ( RuntimeException $e ) {
8
- printf( "Error opening csv: %s\n", $e->getMessage() );
9
- }
10
-
11
- while( !$csv->eof() && ( $row = $csv->fgetcsv() ) && $row[0] !== null ) {
12
- // $row is a numerical keyed array with
13
- // a string per field (zero based).
14
- }
15
- */
16
-
17
- // Display the admin configuration page
18
- function my_calendar_import( $importer='ko_calendar' ) {
19
- global $wpdb;
20
- $mcdb = $wpdb;
21
- $ko_format = array(
22
- 'has_cats'=>1,
23
- 'event'=>array(
24
- 'title'=>'event_title',
25
- 'desc'=>'event_desc',
26
- 'begin'=>'event_begin',
27
- 'end'=>'event_end',
28
- 'time'=>'event_time',
29
- 'recur'=>'event_recur',
30
- 'repeats'=>'event_repeats',
31
- 'author'=>'event_author',
32
- 'category'=>'event_category',
33
- 'link'=>'event_link',
34
- 'table'=>'calendar'),
35
- 'cats'=>array( 'table'=>'calendar_categories','name'=>'category_name','color'=>'category_colour','id'=>'category_id' )
36
- );
37
- $ev_format = array(
38
- 'has_cats'=>0,
39
- 'event'=>array(
40
- 'title'=>'eventTitle',
41
- 'desc'=>'eventDesc',
42
- 'begin'=>'eventStartDate',
43
- 'end'=>'eventEndDate',
44
- 'time'=>'eventStartTime',
45
- 'endtime'=>'eventEndTime',
46
- 'author'=>'postID',
47
- 'link'=>'eventLinkout',
48
- 'table'=>'eventscalendar_main')
49
- );
50
- switch ($importer) {
51
- case 'ko_calendar':$format = $ko_format;break;
52
- case 'events_calendar':$format = $ev_format;break;
53
- }
54
- if ( get_option( $importer.'_imported' ) != 'true' ) {
55
- define('IMPORT_CALENDAR_TABLE', $mcdb->prefix . $format['table'] );
56
- if ( $format['has_cats'] == 1 ) {
57
- define('IMPORT_CALENDAR_CATS', $mcdb->prefix . $format['cats']['table'] );
58
- }
59
- $events = $mcdb->get_results("SELECT * FROM " . IMPORT_CALENDAR_TABLE, 'ARRAY_A');
60
- $sql = "";
61
- foreach ($events as $key) {
62
- foreach( $format as $k=>$v ) {
63
- ${$k} = mysql_real_escape_string( $key[$v[$k]] );
64
- }
65
- // figure this out later
66
- $title = mysql_real_escape_string($key[$format['title']]);
67
- $desc = mysql_real_escape_string($key[$format['desc']]);
68
- $begin = mysql_real_escape_string($key[$format['begin']]);
69
- $end = mysql_real_escape_string($key[$format['end']]);
70
- $time = mysql_real_escape_string($key[$format['time']]);
71
- $recur = mysql_real_escape_string($key[$format['recur']]);
72
- $repeats = mysql_real_escape_string($key[$format['repeats']]);
73
- $author = mysql_real_escape_string($key[$format['author']]);
74
- $category = mysql_real_escape_string($key[$format['category']]);
75
- $link = mysql_real_escape_string($key[$format['link']]);
76
- $sql = "INSERT INTO " . my_calendar_table() . " SET
77
- event_title='" . ($title) . "',
78
- event_desc='" . ($desc) . "',
79
- event_begin='" . ($begin) . "',
80
- event_end='" . ($end) . "',
81
- event_time='" . ($time) . "',
82
- event_recur='" . ($recur) . "',
83
- event_repeats='" . ($repeats) . "',
84
- event_author=".($author).",
85
- event_category=".($category).",
86
- event_link='".($link)."';
87
- ";
88
- $events_results = $mcdb->query($sql);
89
- }
90
- if ( $format['has_cats'] == 1 ) {
91
- $cats = $mcdb->get_results("SELECT * FROM " . KO_CALENDAR_CATS, 'ARRAY_A');
92
- $catsql = "";
93
- foreach ($cats as $key) {
94
- $name = mysql_real_escape_string($key['category_name']);
95
- $color = mysql_real_escape_string($key['category_colour']);
96
- $id = mysql_real_escape_string($key['category_id']);
97
- $catsql = "INSERT INTO " . my_calendar_categories_table() . " SET
98
- category_id='".$id."',
99
- category_name='".$name."',
100
- category_color='".$color."'
101
- ON DUPLICATE KEY UPDATE
102
- category_name='".$name."',
103
- category_color='".$color."';
104
- ";
105
- $cats_results = $mcdb->query($catsql);
106
- //$mcdb->print_error();
107
- }
108
- $message = ( $cats_results !== false )?__('Categories imported successfully.','my-calendar'):__('Categories not imported.','my-calendar');
109
- }
110
- $e_message = ( $events_results !== false )?__('Events imported successfully.','my-calendar'):__('Events not imported.','my-calendar');
111
- $return = "<div id='message' class='updated fade'><ul><li>$message</li><li>$e_message</li></ul></div>";
112
- echo $return;
113
- if ( $cats_results !== false && $events_results !== false ) {
114
- update_option( $importer.'_imported','true' );
115
- }
116
- }
117
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
my-calendar-install.php CHANGED
@@ -2,7 +2,7 @@
2
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
 
4
  // define global variables;
5
- global $initial_listjs, $initial_caljs, $initial_minijs, $initial_ajaxjs, $initial_db, $initial_occur_db, $initial_loc_db, $initial_cat_db, $default_template,$default_user_settings, $mcdb,$grid_template,$list_template,$rss_template,$mini_template,$single_template, $defaults;
6
 
7
  $defaults = array(
8
  'upcoming'=>array(
@@ -22,47 +22,38 @@ $defaults = array(
22
  )
23
  );
24
 
25
- $grid_template = addslashes('<span class="event-time dtstart" title="{dtstart}">{time}<span class="time-separator"> - </span><span class="end-time dtend" title="{dtend}">{endtime}</span></span>
26
 
27
- <div class="sub-details"><span class="event-author">Posted by: <span class="author-name">{author}</span></span><br />
28
  {hcard}
29
- <p class="mc_details">{details}</p>
30
- <p>{ical_html}</p>
31
- <div class="shortdesc">{image}
32
- {shortdesc}
33
- </div>
34
- <p><a href="{link}" class="event-link external">{title}</a></p></div>');
35
 
36
- $list_template = addslashes('<span class="event-time dtstart" title="{dtstart}">{time}<span class="time-separator"> - </span><span class="end-time dtend" title="{dtend}">{endtime}</span></span>
37
 
38
  <div class="sub-details">
39
- <h3 class="event-title summary">{icon_html}{title}</h3>
40
- <span class="event-author">Posted by: <span class="author-name">{author}</span></span><br />
41
  {hcard}
42
- <p class="mc_details">{details}</p>
43
- <p>{ical_html}</p>
44
- <div class="shortdesc">{image}{shortdesc}</div>
45
- <p><a href="{link}" class="event-link external">{title}</a></p></div>');
46
 
47
- $mini_template = addslashes('<span class="event-time dtstart" title="{dtstart}">{time}<span class="time-separator"> - </span><span class="end-time dtend" title="{dtend}">{endtime}</span></span>
48
 
49
- <div class="sub-details"><span class="event-author">Posted by: <span class="author-name">{author}</span></span><br />
 
50
  {hcard}
51
- <p class="mc_details">{details}</p>
52
- <p>{ical_html}</p>
53
- <p><a href="{link}" class="event-link external">{title}</a></p></div>');
54
 
55
- $single_template = addslashes('<span class="event-time dtstart" title="{dtstart}">{time}<span class="time-separator"> - </span><span class="end-time dtend" title="{dtend}">{endtime}</span></span>
56
 
57
- <div class="sub-details"><span class="event-author">Posted by: <span class="author-name">{author}</span></span><br />
58
  {hcard}
59
- <p class="mc_details">{details}</p>
60
- <p>{ical_html}</p>
61
- <div class="shortdesc">{image}{description}</div>
62
- <p><a href="{link}" class="event-link external">{title}</a></p></div>');
63
 
64
- $rss_template = addslashes("\n<item>
65
- <title>{title}: {date}, {time}</title>
66
  <link>{link}</link>
67
  <pubDate>{rssdate}</pubDate>
68
  <dc:creator>{author}</dc:creator>
@@ -72,7 +63,7 @@ $rss_template = addslashes("\n<item>
72
  <div class='description'>{rss_description}</div>
73
  <p class='dtstart' title='{ical_start}'>Begins: {time} on {date}</p>
74
  <p class='dtend' title='{ical_end}'>Ends: {endtime} on {enddate}</p>
75
- <p>Recurrance: {recurs}</p>
76
  <p>Repetition: {repeats} times</p>
77
  <div class='location'>{rss_hcard}</div>
78
  {link_title}
@@ -80,7 +71,7 @@ $rss_template = addslashes("\n<item>
80
  <dc:format xmlns:dc='http://purl.org/dc/elements/1.1/'>text/html</dc:format>
81
  <dc:source xmlns:dc='http://purl.org/dc/elements/1.1/'>".home_url()."</dc:source>
82
  {guid}
83
- </item>\n");
84
 
85
  $initial_ajaxjs = "$(function(){
86
  $(document).on('click', '.calendar .my-calendar-nav a', function(e){
@@ -112,6 +103,7 @@ $initial_ajaxjs = "$(function(){
112
  });
113
  });
114
  });";
 
115
  // defaults will go into the options table on a new install
116
  $initial_caljs = '$(function() {
117
  $(".calendar-event").children().not(".event-title").hide();
@@ -152,16 +144,16 @@ $initial_minijs = '$(function() {
152
  });';
153
 
154
  $default_template = "<strong>{date}</strong> &#8211; {link_title}<br /><span>{time}, {category}</span>";
155
- $charset_collate = '';
156
- if ( ! empty($mcdb->charset) ) {
157
- $charset_collate = "DEFAULT CHARACTER SET $mcdb->charset";
158
- }
159
- if ( ! empty($mcdb->collate) ) {
160
- $charset_collate .= " COLLATE $mcdb->collate";
 
161
  }
162
 
163
- $event_holiday = (get_option('mc_skip_holidays') == 'true' )?1:0;
164
- $event_fifth_week = (get_option('mc_no_fifth_week') == 'true' )?1:0;
165
 
166
  $initial_db = "CREATE TABLE " . my_calendar_table() . " (
167
  event_id INT(11) NOT NULL AUTO_INCREMENT,
@@ -171,6 +163,8 @@ $initial_db = "CREATE TABLE " . my_calendar_table() . " (
171
  event_desc TEXT NOT NULL,
172
  event_short TEXT NOT NULL,
173
  event_open INT(3) DEFAULT '2',
 
 
174
  event_time TIME,
175
  event_endtime TIME,
176
  event_recur CHAR(2),
@@ -180,7 +174,9 @@ $initial_db = "CREATE TABLE " . my_calendar_table() . " (
180
  event_host BIGINT(20) UNSIGNED,
181
  event_category BIGINT(20) UNSIGNED NOT NULL DEFAULT '1',
182
  event_link TEXT,
 
183
  event_link_expires TINYINT(1) NOT NULL,
 
184
  event_label VARCHAR(60) NOT NULL,
185
  event_street VARCHAR(60) NOT NULL,
186
  event_street2 VARCHAR(60) NOT NULL,
@@ -194,13 +190,15 @@ $initial_db = "CREATE TABLE " . my_calendar_table() . " (
194
  event_latitude FLOAT(10,6) NOT NULL DEFAULT '0',
195
  event_zoom INT(2) NOT NULL DEFAULT '14',
196
  event_phone VARCHAR(32) NOT NULL,
 
 
197
  event_group INT(1) NOT NULL DEFAULT '0',
198
  event_group_id INT(11) NOT NULL DEFAULT '0',
199
  event_span INT(1) NOT NULL DEFAULT '0',
200
  event_approved INT(1) NOT NULL DEFAULT '1',
201
  event_flagged INT(1) NOT NULL DEFAULT '0',
202
  event_hide_end INT(1) NOT NULL DEFAULT '0',
203
- event_holiday INT(1) NOT NULL DEFAULT '$event_holiday',
204
  event_fifth_week INT(1) NOT NULL DEFAULT '$event_fifth_week',
205
  event_image TEXT,
206
  event_added TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
@@ -224,6 +222,7 @@ $initial_cat_db = "CREATE TABLE " . my_calendar_categories_table() . " (
224
  category_color VARCHAR(7) NOT NULL,
225
  category_icon VARCHAR(128) NOT NULL,
226
  category_private INT(1) NOT NULL DEFAULT '0',
 
227
  PRIMARY KEY (category_id)
228
  ) $charset_collate;";
229
 
@@ -242,121 +241,47 @@ $initial_loc_db = "CREATE TABLE " . my_calendar_locations_table() . " (
242
  location_latitude FLOAT(10,6) NOT NULL DEFAULT '0',
243
  location_zoom INT(2) NOT NULL DEFAULT '14',
244
  location_phone VARCHAR(32) NOT NULL,
 
 
245
  PRIMARY KEY (location_id)
246
  ) $charset_collate;";
247
 
248
- $default_user_settings = array(
249
- 'my_calendar_tz_default'=>array(
250
- 'enabled'=>'off',
251
- 'label'=>__('My Calendar Default Timezone','my-calendar'),
252
- 'values'=>array(
253
- "-12" => "(GMT -12:00) Eniwetok, Kwajalein",
254
- "-11" => "(GMT -11:00) Midway Island, Samoa",
255
- "-10" => "(GMT -10:00) Hawaii",
256
- "-9.5" => "(GMT -9:30) Marquesas Islands",
257
- "-9" => "(GMT -9:00) Alaska",
258
- "-8" => "(GMT -8:00) Pacific Time (US &amp; Canada)",
259
- "-7" => "(GMT -7:00) Mountain Time (US &amp; Canada)",
260
- "-6" => "(GMT -6:00) Central Time (US &amp; Canada), Mexico City",
261
- "-5" => "(GMT -5:00) Eastern Time (US &amp; Canada), Bogota, Lima",
262
- "-4.5" => "(GMT -4:30) Venezuela",
263
- "-4" => "(GMT -4:00) Atlantic Time (Canada), Caracas, La Paz",
264
- "-3.5" => "(GMT -3:30) Newfoundland",
265
- "-3" => "(GMT -3:00) Brazil, Buenos Aires, Georgetown",
266
- "-2" => "(GMT -2:00) Mid-Atlantic",
267
- "-1" => "(GMT -1:00 hour) Azores, Cape Verde Islands",
268
- "0" => "(GMT) Western Europe Time, London, Lisbon, Casablanca",
269
- "1" => "(GMT +1:00 hour) Brussels, Copenhagen, Madrid, Paris",
270
- "2" => "(GMT +2:00) Kaliningrad, South Africa",
271
- "3" => "(GMT +3:00) Baghdad, Riyadh, Moscow, St. Petersburg",
272
- "3.5" => "(GMT +3:30) Tehran",
273
- "4" => "(GMT +4:00) Abu Dhabi, Muscat, Baku, Tbilisi",
274
- "4.5" => "(GMT +4:30) Afghanistan",
275
- "5" => "(GMT +5:00) Ekaterinburg, Islamabad, Karachi, Tashkent",
276
- "5.5" => "(GMT +5:30) Bombay, Calcutta, Madras, New Delhi",
277
- "5.75" => "(GMT +5:45) Nepal",
278
- "6" => "(GMT +6:00) Almaty, Dhaka, Colombo",
279
- "6.5" => "(GMT +6:30) Myanmar, Cocos Islands",
280
- "7" => "(GMT +7:00) Bangkok, Hanoi, Jakarta",
281
- "8" => "(GMT +8:00) Beijing, Perth, Singapore, Hong Kong",
282
- "9" => "(GMT +9:00) Tokyo, Seoul, Osaka, Sapporo, Yakutsk",
283
- "9.5" => "(GMT +9:30) Adelaide, Darwin",
284
- "10" => "(GMT +10:00) Eastern Australia, Guam, Vladivostok",
285
- "10.5" => "(GMT +10:30) Lord Howe Island",
286
- "11" => "(GMT +11:00) Magadan, Solomon Islands, New Caledonia",
287
- "11.5" => "(GMT +11:30) Norfolk Island",
288
- "12" => "(GMT +12:00) Auckland, Wellington, Fiji, Kamchatka",
289
- "12.75" => "(GMT +12:45) Chatham Islands",
290
- "13" => "(GMT +13:00) Tonga",
291
- "14" => "(GMT +14:00) Line Islands"
292
- ),
293
- ),
294
- 'my_calendar_location_default'=>array(
295
- 'enabled'=>'off',
296
- 'label'=>__('My Calendar Default Location','my-calendar'),
297
- 'values'=>array(
298
- 'AL'=>"Alabama",
299
- 'AK'=>"Alaska",
300
- 'AZ'=>"Arizona",
301
- 'AR'=>"Arkansas",
302
- 'CA'=>"California",
303
- 'CO'=>"Colorado",
304
- 'CT'=>"Connecticut",
305
- 'DE'=>"Delaware",
306
- 'DC'=>"District Of Columbia",
307
- 'FL'=>"Florida",
308
- 'GA'=>"Georgia",
309
- 'HI'=>"Hawaii",
310
- 'ID'=>"Idaho",
311
- 'IL'=>"Illinois",
312
- 'IN'=>"Indiana",
313
- 'IA'=>"Iowa",
314
- 'KS'=>"Kansas",
315
- 'KY'=>"Kentucky",
316
- 'LA'=>"Louisiana",
317
- 'ME'=>"Maine",
318
- 'MD'=>"Maryland",
319
- 'MA'=>"Massachusetts",
320
- 'MI'=>"Michigan",
321
- 'MN'=>"Minnesota",
322
- 'MS'=>"Mississippi",
323
- 'MO'=>"Missouri",
324
- 'MT'=>"Montana",
325
- 'NE'=>"Nebraska",
326
- 'NV'=>"Nevada",
327
- 'NH'=>"New Hampshire",
328
- 'NJ'=>"New Jersey",
329
- 'NM'=>"New Mexico",
330
- 'NY'=>"New York",
331
- 'NC'=>"North Carolina",
332
- 'ND'=>"North Dakota",
333
- 'OH'=>"Ohio",
334
- 'OK'=>"Oklahoma",
335
- 'OR'=>"Oregon",
336
- 'PA'=>"Pennsylvania",
337
- 'RI'=>"Rhode Island",
338
- 'SC'=>"South Carolina",
339
- 'SD'=>"South Dakota",
340
- 'TN'=>"Tennessee",
341
- 'TX'=>"Texas",
342
- 'UT'=>"Utah",
343
- 'VT'=>"Vermont",
344
- 'VA'=>"Virginia",
345
- 'WA'=>"Washington",
346
- 'WV'=>"West Virginia",
347
- 'WI'=>"Wisconsin",
348
- 'WY'=>"Wyoming"),
349
- )
350
- );
351
-
352
- function mc_default_settings( ) {
353
- global $default_template, $initial_listjs, $initial_caljs, $initial_minijs, $initial_ajaxjs, $initial_db, $initial_occur_db, $initial_loc_db, $initial_cat_db, $default_user_settings,$grid_template,$rss_template, $list_template,$mini_template,$single_template,$mc_version, $defaults;
354
  // no arguments
355
- add_option('mc_display_author','false');
356
- add_option('mc_display_jump','false');
357
- add_option('mc_version',$mc_version);
358
- add_option('mc_use_styles','false');
359
- add_option('mc_show_months',1);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
360
  add_option('mc_show_map','true');
361
  add_option('mc_show_address','false');
362
  add_option('mc_calendar_javascript',0);
@@ -372,7 +297,7 @@ global $default_template, $initial_listjs, $initial_caljs, $initial_minijs, $ini
372
  add_option('mc_event_link_expires','no');
373
  add_option('mc_apply_color','background');
374
  add_option('mc_inverse_color','true');
375
- add_option('mc_input_options',array('event_short'=>'off','event_desc'=>'on','event_category'=>'on','event_image'=>'on','event_link'=>'on','event_recurs'=>'on','event_open'=>'off','event_location'=>'on','event_location_dropdown'=>'on','event_use_editor'=>'off','event_specials'=>'on') );
376
  add_option('mc_input_options_administrators','false');
377
  add_site_option('mc_multisite', '0' );
378
  add_option('mc_event_mail','false');
@@ -386,14 +311,11 @@ global $default_template, $initial_listjs, $initial_caljs, $initial_minijs, $ini
386
  add_option('mc_event_approve_perms','manage_options');
387
  add_option('mc_no_fifth_week','true');
388
  add_option( 'mc_week_format', "M j, 'y" );
389
- $mc_user_settings = $default_user_settings;
390
- add_option('mc_user_settings',$mc_user_settings);
391
  add_option('mc_location_type','event_state');
392
  add_option('mc_user_settings_enabled',false);
393
  add_option('mc_user_location_type','state');
394
  add_option('mc_show_js','' );
395
  add_option('mc_show_css','' );
396
- add_option( 'mc_location_control','' );
397
  add_option('mc_date_format',get_option('date_format') );
398
  add_option('mc_templates', array(
399
  'title'=>'{title}',
@@ -405,9 +327,9 @@ global $default_template, $initial_listjs, $initial_caljs, $initial_minijs, $ini
405
  'details'=>$single_template,
406
  'label'=>'{title}'
407
  ));
408
- add_option('mc_skip_holidays','false');
409
- add_option('mc_css_file','refresh.css');
410
- add_option('mc_time_format',get_option('time_format'));
411
  add_option( 'mc_widget_defaults',$defaults);
412
  add_option( 'mc_show_weekends','true' );
413
  add_option( 'mc_convert','true' );
@@ -429,36 +351,36 @@ function mc_migrate_db() {
429
  global $wpdb, $initial_occur_db;
430
  // this function migrates the DB from version 1.10.x to version 2.0.
431
  $tables = $wpdb->get_results("show tables;");
432
- foreach ( $tables as $table ) {
433
- foreach ( $table as $value ) {
434
- if ( $value == my_calendar_event_table() ) {
435
- $count = $wpdb->get_var( 'SELECT count(1) from '.my_calendar_event_table() );
436
- $count2 = $wpdb->get_var( 'SELECT count(1) from '.my_calendar_table() );
437
- if ( $count2 > 0 && $count > 0 ) {
438
- $migrated = true; // both tables have event data
439
- return;
440
- }
441
- if ( $count2 == 0 && $count == 0 ) {
442
- return; // no events, migration unnecessary
443
- }
444
- break 2;
445
  }
 
446
  }
447
  }
448
- // 2) create new occurrences database, if necessary
449
- //dbDelta($initial_occur_db);
450
- // 3) migrate events
451
- $sql = "SELECT event_id, event_begin, event_time, event_end, event_endtime FROM ".my_calendar_table();
452
- $events = $wpdb->get_results($sql);
453
- foreach ( $events as $event ) {
454
- // assign endtimes to all events
455
- if ( $event->event_endtime == '00:00:00' && $event->event_time != '00:00:00' ) {
456
- $event->event_endtime = date('H:i:s',strtotime( "$event->event_time +1 hour" ) );
457
- mc_flag_event( $event->event_id, $event->event_endtime );
458
- }
459
- $dates = array( 'event_begin'=>$event->event_begin,'event_end'=>$event->event_end,'event_time'=>$event->event_time,'event_endtime'=>$event->event_endtime );
460
- $event = mc_increment_event( $event->event_id, $dates );
461
  }
 
 
 
462
  }
463
 
464
  function mc_flag_event( $id,$time ) {
@@ -484,86 +406,180 @@ global $mc_version, $initial_db, $initial_occur_db, $initial_loc_db, $initial_ca
484
  update_option('mc_db_version',$mc_version);
485
  }
486
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
487
  function my_calendar_copyr($source, $dest) {
488
  // Sanity check
489
  if ( !file_exists($source) ) {
490
  return false;
491
  }
492
  // Check for symlinks
493
- if (is_link($source)) {
494
- return symlink(readlink($source), $dest);
495
  }
496
  // Simple copy for a file
497
- if (is_file($source)) {
498
- return @copy($source, $dest);
499
  }
500
  // Make destination directory
501
- if (!is_dir($dest)) {
502
- @mkdir($dest);
503
  }
504
  // Loop through the folder
505
- $dir = dir($source);
506
- while (false !== $entry = $dir->read()) {
507
  // Skip pointers
508
- if ($entry == '.' || $entry == '..') {
509
  continue;
510
  }
511
  // Deep copy directories
512
- my_calendar_copyr("$source/$entry", "$dest/$entry");
513
  }
514
  // Clean up
515
  $dir->close();
516
  return true;
517
  }
518
- function my_calendar_rmdirr($dirname) {
519
  // Sanity check
520
- if (!file_exists($dirname)) {
521
- return false;
522
  }
523
  // Simple delete for a file
524
- if (is_file($dirname)) {
525
- return unlink($dirname);
526
  }
527
  // Loop through the folder
528
- $dir = dir($dirname);
529
- while (false !== $entry = $dir->read()) {
530
  // Skip pointers
531
- if ($entry == '.' || $entry == '..') {
532
- continue;
533
  }
534
  // Recurse
535
- my_calendar_rmdirr("$dirname/$entry");
536
  }
537
  // Clean up
538
  $dir->close();
539
- return @rmdir($dirname);
540
  }
541
  function my_calendar_backup( $process, $plugin ) {
542
  if ( isset( $plugin['plugin'] ) && $plugin['plugin'] == 'my-calendar/my-calendar.php' ) {
543
- $to = dirname(__FILE__)."/../styles_backup/";
544
- $from = dirname(__FILE__)."/styles/";
545
- my_calendar_copyr($from, $to);
546
 
547
- $to = dirname(__FILE__)."/../icons_backup/";
548
- $from = dirname(__FILE__)."/icons/";
549
- my_calendar_copyr($from, $to);
550
  }
551
  }
552
  function my_calendar_recover( $process, $plugin ) {
553
  if ( isset( $plugin['plugin'] ) && $plugin['plugin'] == 'my-calendar/my-calendar.php' ) {
554
- $from = dirname(__FILE__)."/../styles_backup/";
555
- $to = dirname(__FILE__)."/styles/";
556
- my_calendar_copyr($from, $to);
557
- if (is_dir($from)) {
558
- my_calendar_rmdirr($from);
559
  }
560
- $from = dirname(__FILE__)."/../icons_backup/";
561
- $to = dirname(__FILE__)."/icons/";
562
- my_calendar_copyr($from, $to);
563
- if (is_dir($from)) {
564
- my_calendar_rmdirr($from);
565
  }
566
  }
567
  }
568
- add_filter('upgrader_pre_install', 'my_calendar_backup', 10, 2);
569
- add_filter('upgrader_post_install', 'my_calendar_recover', 10, 2);
2
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
 
4
  // define global variables;
5
+ global $initial_listjs, $initial_caljs, $initial_minijs, $initial_ajaxjs, $initial_db, $initial_occur_db, $initial_loc_db, $initial_cat_db, $default_template, $wpdb, $grid_template, $list_template, $rss_template, $mini_template, $single_template, $defaults;
6
 
7
  $defaults = array(
8
  'upcoming'=>array(
22
  )
23
  );
24
 
25
+ $grid_template = addslashes( '<span class="event-time dtstart" title="{dtstart}">{time}<span class="time-separator"> - </span>{endtime before="<span class=\'end-time dtend\' title=\'{dtend}\'>" after="</span>"}</span>
26
 
27
+ <div class="sub-details">
28
  {hcard}
29
+ {details before="<p class=\'mc_details\'>" after="</p>"}
30
+ <p><a href="{linking}" class="event-link external">{title}</a></p></div>' );
 
 
 
 
31
 
32
+ $list_template = addslashes( '<span class="event-time dtstart" title="{dtstart}">{time}<span class="time-separator"> - </span>{endtime before="<span class=\'end-time dtend\' title=\'{dtend}\'>" after="</span>"}</span>
33
 
34
  <div class="sub-details">
 
 
35
  {hcard}
36
+ {details before="<p class=\'mc_details\'>" after="</p>"}
37
+ <p><a href="{linking}" class="event-link external">{title}</a></p></div>' );
 
 
38
 
39
+ $mini_template = addslashes( '<span class="event-time dtstart" title="{dtstart}">{time}<span class="time-separator"> - </span>{endtime before="<span class=\'end-time dtend\' title=\'{dtend}\'>" after="</span>"}</span>
40
 
41
+ <div class="sub-details">
42
+ {excerpt before="<div class=\'excerpt\'>" after="</div>"}
43
  {hcard}
44
+ <p><a href="{linking}" class="event-link external">{title}</a></p></div>' );
 
 
45
 
46
+ $single_template = addslashes( '<span class="event-time dtstart" title="{dtstart}">{time}<span class="time-separator"> - </span><span class="end-time dtend" title="{dtend}">{endtime}</span></span>
47
 
48
+ <div class="sub-details">
49
  {hcard}
50
+ <div class="mc-description">{image}{description}</div>
51
+ <p>{ical_html} &bull; {gcal}</p>
52
+ {map}
53
+ <p><a href="{linking}" class="event-link external">{title}</a></p></div>' );
54
 
55
+ $rss_template = addslashes( "\n<item>
56
+ <title>{rss_title}: {date}, {time}</title>
57
  <link>{link}</link>
58
  <pubDate>{rssdate}</pubDate>
59
  <dc:creator>{author}</dc:creator>
63
  <div class='description'>{rss_description}</div>
64
  <p class='dtstart' title='{ical_start}'>Begins: {time} on {date}</p>
65
  <p class='dtend' title='{ical_end}'>Ends: {endtime} on {enddate}</p>
66
+ <p>Recurrence: {recurs}</p>
67
  <p>Repetition: {repeats} times</p>
68
  <div class='location'>{rss_hcard}</div>
69
  {link_title}
71
  <dc:format xmlns:dc='http://purl.org/dc/elements/1.1/'>text/html</dc:format>
72
  <dc:source xmlns:dc='http://purl.org/dc/elements/1.1/'>".home_url()."</dc:source>
73
  {guid}
74
+ </item>\n" );
75
 
76
  $initial_ajaxjs = "$(function(){
77
  $(document).on('click', '.calendar .my-calendar-nav a', function(e){
103
  });
104
  });
105
  });";
106
+
107
  // defaults will go into the options table on a new install
108
  $initial_caljs = '$(function() {
109
  $(".calendar-event").children().not(".event-title").hide();
144
  });';
145
 
146
  $default_template = "<strong>{date}</strong> &#8211; {link_title}<br /><span>{time}, {category}</span>";
147
+ $charset_collate = '';
148
+ if ( ! empty( $wpdb->charset ) ) {
149
+ $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
150
+ }
151
+
152
+ if ( ! empty( $wpdb->collate ) && $charset_collate != '' ) {
153
+ $charset_collate .= " COLLATE $wpdb->collate";
154
  }
155
 
156
+ $event_fifth_week = ( get_option('mc_no_fifth_week') == 'true' )?1:0;
 
157
 
158
  $initial_db = "CREATE TABLE " . my_calendar_table() . " (
159
  event_id INT(11) NOT NULL AUTO_INCREMENT,
163
  event_desc TEXT NOT NULL,
164
  event_short TEXT NOT NULL,
165
  event_open INT(3) DEFAULT '2',
166
+ event_registration TEXT NOT NULL,
167
+ event_tickets VARCHAR(255) NOT NULL,
168
  event_time TIME,
169
  event_endtime TIME,
170
  event_recur CHAR(2),
174
  event_host BIGINT(20) UNSIGNED,
175
  event_category BIGINT(20) UNSIGNED NOT NULL DEFAULT '1',
176
  event_link TEXT,
177
+ event_post BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
178
  event_link_expires TINYINT(1) NOT NULL,
179
+ event_location BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
180
  event_label VARCHAR(60) NOT NULL,
181
  event_street VARCHAR(60) NOT NULL,
182
  event_street2 VARCHAR(60) NOT NULL,
190
  event_latitude FLOAT(10,6) NOT NULL DEFAULT '0',
191
  event_zoom INT(2) NOT NULL DEFAULT '14',
192
  event_phone VARCHAR(32) NOT NULL,
193
+ event_phone2 VARCHAR(32) NOT NULL,
194
+ event_access TEXT,
195
  event_group INT(1) NOT NULL DEFAULT '0',
196
  event_group_id INT(11) NOT NULL DEFAULT '0',
197
  event_span INT(1) NOT NULL DEFAULT '0',
198
  event_approved INT(1) NOT NULL DEFAULT '1',
199
  event_flagged INT(1) NOT NULL DEFAULT '0',
200
  event_hide_end INT(1) NOT NULL DEFAULT '0',
201
+ event_holiday INT(1) NOT NULL DEFAULT '0',
202
  event_fifth_week INT(1) NOT NULL DEFAULT '$event_fifth_week',
203
  event_image TEXT,
204
  event_added TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
222
  category_color VARCHAR(7) NOT NULL,
223
  category_icon VARCHAR(128) NOT NULL,
224
  category_private INT(1) NOT NULL DEFAULT '0',
225
+ category_term INT(11) NOT NULL DEFAULT '0',
226
  PRIMARY KEY (category_id)
227
  ) $charset_collate;";
228
 
241
  location_latitude FLOAT(10,6) NOT NULL DEFAULT '0',
242
  location_zoom INT(2) NOT NULL DEFAULT '14',
243
  location_phone VARCHAR(32) NOT NULL,
244
+ location_phone2 VARCHAR(32) NOT NULL,
245
+ location_access TEXT,
246
  PRIMARY KEY (location_id)
247
  ) $charset_collate;";
248
 
249
+ function mc_default_settings() {
250
+ global $default_template, $initial_listjs, $initial_caljs, $initial_minijs, $initial_ajaxjs, $initial_db, $initial_occur_db, $initial_loc_db, $initial_cat_db, $grid_template,$rss_template, $list_template, $mini_template, $single_template, $mc_version, $defaults;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
251
  // no arguments
252
+ add_option( 'mc_location_access', array(
253
+ '1'=> __('Accessible Entrance','my-calendar'),
254
+ '2'=> __('Accessible Parking Designated','my-calendar'),
255
+ '3'=> __('Accessible Restrooms','my-calendar'),
256
+ '4'=> __('Accessible Seating','my-calendar'),
257
+ '5'=> __('Accessible Transportation Available','my-calendar'),
258
+ '6'=> __('Wheelchair Accessible','my-calendar'),
259
+ '7'=> __('Courtesy Wheelchairs','my-calendar'),
260
+ '8'=> __('Bariatric Seating Available','my-calendar'),
261
+ '9'=> __('Elevator to all public areas','my-calendar'),
262
+ '10'=> __('Braille Signage','my-calendar'),
263
+ '11'=> __('Fragrance-Free Policy','my-calendar'),
264
+ '12'=> __('Other','my-calendar')
265
+ ) );
266
+ add_option( 'mc_event_access', array(
267
+ '1'=> __('Audio Description','my-calendar'),
268
+ '2'=> __('ASL Interpretation', 'my-calendar'),
269
+ '3'=> __('ASL Interpretation with voicing','my-calendar'),
270
+ '4'=> __('Deaf-Blind ASL','my-calendar'),
271
+ '5'=> __('Real-time Captioning','my-calendar'),
272
+ '6'=> __('Scripted Captioning', 'my-calendar' ),
273
+ '7'=> __('Assisted Listening Devices','my-calendar'),
274
+ '8'=> __('Tactile/Touch Tour','my-calendar'),
275
+ '9'=> __('Braille Playbill','my-calendar'),
276
+ '10'=> __('Large Print Playbill','my-calendar'),
277
+ '11'=> __( 'Sensory Friendly','my-calendar'),
278
+ '12'=> __( 'Other','my-calendar' )
279
+ ) );
280
+ add_option( 'mc_display_author','false' );
281
+ add_option( 'mc_display_jump','false' );
282
+ add_option( 'mc_version',$mc_version );
283
+ add_option( 'mc_use_styles','false' );
284
+ add_option( 'mc_show_months',1 );
285
  add_option('mc_show_map','true');
286
  add_option('mc_show_address','false');
287
  add_option('mc_calendar_javascript',0);
297
  add_option('mc_event_link_expires','no');
298
  add_option('mc_apply_color','background');
299
  add_option('mc_inverse_color','true');
300
+ add_option('mc_input_options',array( 'event_short'=>'off','event_desc'=>'on','event_category'=>'on','event_image'=>'on','event_link'=>'on','event_recurs'=>'on','event_open'=>'off','event_location'=>'on','event_location_dropdown'=>'on','event_specials'=>'on', 'event_access'=>'on' ) );
301
  add_option('mc_input_options_administrators','false');
302
  add_site_option('mc_multisite', '0' );
303
  add_option('mc_event_mail','false');
311
  add_option('mc_event_approve_perms','manage_options');
312
  add_option('mc_no_fifth_week','true');
313
  add_option( 'mc_week_format', "M j, 'y" );
 
 
314
  add_option('mc_location_type','event_state');
315
  add_option('mc_user_settings_enabled',false);
316
  add_option('mc_user_location_type','state');
317
  add_option('mc_show_js','' );
318
  add_option('mc_show_css','' );
 
319
  add_option('mc_date_format',get_option('date_format') );
320
  add_option('mc_templates', array(
321
  'title'=>'{title}',
327
  'details'=>$single_template,
328
  'label'=>'{title}'
329
  ));
330
+ add_option( 'mc_skip_holidays','false' );
331
+ add_option( 'mc_css_file','twentyfourteen.css' );
332
+ add_option( 'mc_time_format',get_option('time_format') );
333
  add_option( 'mc_widget_defaults',$defaults);
334
  add_option( 'mc_show_weekends','true' );
335
  add_option( 'mc_convert','true' );
351
  global $wpdb, $initial_occur_db;
352
  // this function migrates the DB from version 1.10.x to version 2.0.
353
  $tables = $wpdb->get_results("show tables;");
354
+ foreach ( $tables as $table ) {
355
+ foreach ( $table as $value ) {
356
+ if ( $value == my_calendar_event_table() ) {
357
+ $count = $wpdb->get_var( 'SELECT count(1) from '.my_calendar_event_table() );
358
+ $count2 = $wpdb->get_var( 'SELECT count(1) from '.my_calendar_table() );
359
+ if ( $count2 > 0 && $count > 0 ) {
360
+ $migrated = true; // both tables have event data
361
+ return;
362
+ }
363
+ if ( $count2 == 0 && $count == 0 ) {
364
+ return; // no events, migration unnecessary
 
 
365
  }
366
+ break 2;
367
  }
368
  }
369
+ }
370
+ // 2) create new occurrences database, if necessary
371
+ //dbDelta($initial_occur_db);
372
+ // 3) migrate events
373
+ $sql = "SELECT event_id, event_begin, event_time, event_end, event_endtime FROM ".my_calendar_table();
374
+ $events = $wpdb->get_results($sql);
375
+ foreach ( $events as $event ) {
376
+ // assign endtimes to all events
377
+ if ( $event->event_endtime == '00:00:00' && $event->event_time != '00:00:00' ) {
378
+ $event->event_endtime = date('H:i:s',strtotime( "$event->event_time +1 hour" ) );
379
+ mc_flag_event( $event->event_id, $event->event_endtime );
 
 
380
  }
381
+ $dates = array( 'event_begin'=>$event->event_begin,'event_end'=>$event->event_end,'event_time'=>$event->event_time,'event_endtime'=>$event->event_endtime );
382
+ $event = mc_increment_event( $event->event_id, $dates );
383
+ }
384
  }
385
 
386
  function mc_flag_event( $id,$time ) {
406
  update_option('mc_db_version',$mc_version);
407
  }
408
 
409
+ function mc_check_location_table( $event, $locations ) {
410
+ $location = array(
411
+ 'location_label'=>$event['event_label'],
412
+ 'location_street'=>$event['event_street'],
413
+ 'location_street2'=>$event['event_street2'],
414
+ 'location_city'=>$event['event_city'],
415
+ 'location_state'=>$event['event_state'],
416
+ 'location_postcode'=>$event['event_postcode'],
417
+ 'location_region'=>$event['event_region'],
418
+ 'location_url'=>$event['event_url'],
419
+ 'location_country'=>$event['event_country'],
420
+ 'location_longitude'=>$event['event_longitude'],
421
+ 'location_latitude'=>$event['event_latitude'],
422
+ 'location_zoom'=>$event['event_zoom'],
423
+ 'location_phone'=>$event['event_phone'],
424
+ 'location_phone2'=>$event['event_phone2'],
425
+ 'location_access'=>$event['event_access']
426
+ );
427
+ //ksort( $location );
428
+
429
+ foreach ( $locations as $id => $loc ) {
430
+ // compare locations - if there are differences, return as not existing
431
+ $diff = array_diff( $location, $loc );
432
+ if ( empty( $diff ) ) {
433
+ return $id;
434
+ }
435
+ }
436
+ return false;
437
+ }
438
+
439
+ function mc_transition_db() {
440
+ // copy to post types. Don't do this if referencing remote sites.
441
+ if ( get_option( 'mc_remote' ) != 'true' ) {
442
+ global $wpdb;
443
+ $results = $wpdb->get_results( 'SELECT * FROM '.my_calendar_locations_table(), ARRAY_A );
444
+ $locations = array();
445
+ foreach ( $results as $result ) {
446
+ $location_id = $result['location_id'];
447
+ unset( $result['location_id'] );
448
+ $hash = md5( serialize( $result ) );
449
+ $locations[$location_id] = $result;
450
+ }
451
+ $results = $wpdb->get_results( 'SELECT * FROM '.my_calendar_categories_table() );
452
+ foreach ( $results as $category ) {
453
+ $term = wp_insert_term( $category->category_name, 'mc-event-category' );
454
+ if ( !is_wp_error( $term ) ) {
455
+ $term_id = $term['term_id'];
456
+ mc_update_category( 'category_term', $term_id, $category->category_id );
457
+ } else {
458
+ $term_id = $term->error_data['term_exists'];
459
+ mc_update_category( 'category_term', $term_id, $category->category_id );
460
+ }
461
+ }
462
+ $results = $wpdb->get_results( 'SELECT * FROM '.my_calendar_table(), ARRAY_A );
463
+ foreach ( $results as $event ) {
464
+ $post_id = mc_create_event_post( $event, $event['event_id'] );
465
+ mc_update_event( 'event_post', $post_id, $event['event_id'] );
466
+ // false if not found, id if found.
467
+ $location = mc_check_location_table( $event, $locations );
468
+ if ( $location ) {
469
+ mc_update_event( 'event_location', $location, $event['event_id'] );
470
+ } else {
471
+ if ( $event['event_label'] == '' &&
472
+ $event['event_street'] == '' &&
473
+ $event['event_url'] == '' &&
474
+ $event['event_city'] == '' &&
475
+ $event['event_state'] == '' &&
476
+ $event['event_country'] == '' ) {
477
+ // don't insert the row if location does not have basic data.
478
+ } else {
479
+ $add = array(
480
+ 'location_label'=>$event['event_label'],
481
+ 'location_street'=>$event['event_street'],
482
+ 'location_street2'=>$event['event_street2'],
483
+ 'location_city'=>$event['event_city'],
484
+ 'location_state'=>$event['event_state'],
485
+ 'location_postcode'=>$event['event_postcode'],
486
+ 'location_region'=>$event['event_region'],
487
+ 'location_country'=>$event['event_country'],
488
+ 'location_url'=>$event['event_url'],
489
+ 'location_longitude'=>$event['event_longitude'],
490
+ 'location_latitude'=>$event['event_latitude'],
491
+ 'location_zoom'=>$event['event_zoom'],
492
+ 'location_phone'=>$event['event_phone'],
493
+ 'location_access'=>'' // no events in this transition will have access data.
494
+ );
495
+ mc_insert_location( $add );
496
+ }
497
+ // could add delete routine to allow user to select what location to use for events using a given location.
498
+ }
499
+ }
500
+ }
501
+ }
502
+
503
  function my_calendar_copyr($source, $dest) {
504
  // Sanity check
505
  if ( !file_exists($source) ) {
506
  return false;
507
  }
508
  // Check for symlinks
509
+ if ( is_link( $source ) ) {
510
+ return symlink( readlink( $source ), $dest );
511
  }
512
  // Simple copy for a file
513
+ if ( is_file( $source ) ) {
514
+ return @copy( $source, $dest );
515
  }
516
  // Make destination directory
517
+ if ( !is_dir( $dest ) ) {
518
+ @mkdir( $dest );
519
  }
520
  // Loop through the folder
521
+ $dir = dir( $source );
522
+ while ( false !== $entry = $dir->read() ) {
523
  // Skip pointers
524
+ if ( $entry == '.' || $entry == '..' ) {
525
  continue;
526
  }
527
  // Deep copy directories
528
+ my_calendar_copyr( "$source/$entry", "$dest/$entry" );
529
  }
530
  // Clean up
531
  $dir->close();
532
  return true;
533
  }
534
+ function my_calendar_rmdirr( $dirname ) {
535
  // Sanity check
536
+ if ( !file_exists( $dirname ) ) {
537
+ return false;
538
  }
539
  // Simple delete for a file
540
+ if ( is_file( $dirname ) ) {
541
+ return unlink( $dirname );
542
  }
543
  // Loop through the folder
544
+ $dir = dir( $dirname );
545
+ while ( false !== $entry = $dir->read() ) {
546
  // Skip pointers
547
+ if ( $entry == '.' || $entry == '..' ) {
548
+ continue;
549
  }
550
  // Recurse
551
+ my_calendar_rmdirr( "$dirname/$entry" );
552
  }
553
  // Clean up
554
  $dir->close();
555
+ return @rmdir( $dirname );
556
  }
557
  function my_calendar_backup( $process, $plugin ) {
558
  if ( isset( $plugin['plugin'] ) && $plugin['plugin'] == 'my-calendar/my-calendar.php' ) {
559
+ $to = dirname( __FILE__ )."/../styles_backup/";
560
+ $from = dirname( __FILE__ )."/styles/";
561
+ my_calendar_copyr( $from, $to );
562
 
563
+ $to = dirname( __FILE__ )."/../icons_backup/";
564
+ $from = dirname( __FILE__ )."/images/icons/";
565
+ my_calendar_copyr( $from, $to );
566
  }
567
  }
568
  function my_calendar_recover( $process, $plugin ) {
569
  if ( isset( $plugin['plugin'] ) && $plugin['plugin'] == 'my-calendar/my-calendar.php' ) {
570
+ $from = dirname( __FILE__ )."/../styles_backup/";
571
+ $to = dirname( __FILE__ )."/styles/";
572
+ my_calendar_copyr( $from, $to );
573
+ if ( is_dir( $from ) ) {
574
+ my_calendar_rmdirr( $from );
575
  }
576
+ $from = dirname( __FILE__ )."/../icons_backup/";
577
+ $to = dirname( __FILE__ )."/images/icons/";
578
+ my_calendar_copyr( $from, $to );
579
+ if ( is_dir( $from ) ) {
580
+ my_calendar_rmdirr( $from );
581
  }
582
  }
583
  }
584
+ add_filter( 'upgrader_pre_install', 'my_calendar_backup', 10, 2 );
585
+ add_filter( 'upgrader_post_install', 'my_calendar_recover', 10, 2 );
my-calendar-limits.php CHANGED
@@ -18,7 +18,7 @@ global $wpdb;
18
  } else {
19
  $categories = explode( ",", $category );
20
  }
21
- $numcat = count($categories);
22
  $i = 1;
23
  foreach ($categories as $key) {
24
  if ( is_numeric($key) ) {
@@ -196,11 +196,11 @@ global $wpdb;
196
  }
197
  }
198
 
199
- function mc_limit_string($type='',$ltype='',$lvalue='') {
200
- global $user_ID;
201
- $user_settings = get_option('mc_user_settings');
202
- $limit_string = "";
203
- if ( ( get_option('mc_user_settings_enabled') == 'true' && isset( $user_settings['my_calendar_location_default']['enabled'] ) && $user_settings['my_calendar_location_default']['enabled'] == 'on' ) || isset($_GET['loc']) && isset($_GET['ltype']) || ( $ltype !='' && $lvalue != '' ) ) {
204
  if ( !isset($_GET['loc']) && !isset($_GET['ltype']) ) {
205
  if ( $ltype == '' && $lvalue == '' ) {
206
  if ( is_user_logged_in() ) {
@@ -214,36 +214,39 @@ global $user_ID;
214
  $current_location = esc_sql( $lvalue );
215
  }
216
  } else {
217
- $current_location = urldecode($_GET['loc']);
218
- $location = urldecode($_GET['ltype']);
219
  }
220
- switch ($location) {
221
- case "name":$location_type = "event_label";
222
- break;
223
- case "city":$location_type = "event_city";
224
- break;
225
- case "state":$location_type = "event_state";
226
- break;
227
- case "zip":$location_type = "event_postcode";
228
- break;
229
- case "country":$location_type = "event_country";
230
- break;
231
- case "region":$location_type = "event_region";
232
- break;
233
- default:$location_type = $location;
234
- break;
235
- }
236
  if ($current_location != 'all' && $current_location != '') {
237
  $limit_string = "$location_type='$current_location' AND";
238
  //$limit_string .= ($type=='all')?' AND':"";
239
  }
240
- }
241
- if ( $limit_string != '' ) {
242
- if ( isset($_GET['loc2']) && isset($_GET['ltype2']) ) {
243
  $limit_string .= mc_secondary_limit( $_GET['ltype2'],$_GET['loc2'] );
244
  }
245
- }
246
- return $limit_string;
 
 
 
 
 
 
 
 
 
 
247
  }
248
 
249
  // set up a secondary limit on location
@@ -252,20 +255,13 @@ function mc_secondary_limit($ltype='',$lvalue='') {
252
  $current_location = urldecode( $lvalue );
253
  $location = urldecode( $ltype );
254
  switch ($location) {
255
- case "name":$location_type = "event_label";
256
- break;
257
- case "city":$location_type = "event_city";
258
- break;
259
- case "state":$location_type = "event_state";
260
- break;
261
- case "zip":$location_type = "event_postcode";
262
- break;
263
- case "country":$location_type = "event_country";
264
- break;
265
- case "region":$location_type = "event_region";
266
- break;
267
  default:$location_type = "event_label";
268
- break;
269
  }
270
  if ($current_location != 'all' && $current_location != '') {
271
  $limit_string = " $location_type='$current_location' AND ";
18
  } else {
19
  $categories = explode( ",", $category );
20
  }
21
+ $numcat = count( $categories );
22
  $i = 1;
23
  foreach ($categories as $key) {
24
  if ( is_numeric($key) ) {
196
  }
197
  }
198
 
199
+ function mc_limit_string( $type='', $ltype='', $lvalue='' ) {
200
+ global $user_ID;
201
+ $user_settings = get_option('mc_user_settings');
202
+ $limit_string = "";
203
+ if ( ( get_option('mc_user_settings_enabled') == 'true' && isset( $user_settings['my_calendar_location_default']['enabled'] ) && $user_settings['my_calendar_location_default']['enabled'] == 'on' ) || isset($_GET['loc']) && isset($_GET['ltype']) || ( $ltype !='' && $lvalue != '' ) ) {
204
  if ( !isset($_GET['loc']) && !isset($_GET['ltype']) ) {
205
  if ( $ltype == '' && $lvalue == '' ) {
206
  if ( is_user_logged_in() ) {
214
  $current_location = esc_sql( $lvalue );
215
  }
216
  } else {
217
+ $current_location = urldecode( $_GET['loc'] );
218
+ $location = urldecode( $_GET['ltype'] );
219
  }
220
+ switch ($location) {
221
+ case "name" : $location_type = "event_label"; break;
222
+ case "city" : $location_type = "event_city"; break;
223
+ case "state" : $location_type = "event_state"; break;
224
+ case "zip" : $location_type = "event_postcode"; break;
225
+ case "country" : $location_type = "event_country"; break;
226
+ case "region" : $location_type = "event_region"; break;
227
+ default : $location_type = $location;
228
+ }
 
 
 
 
 
 
 
229
  if ($current_location != 'all' && $current_location != '') {
230
  $limit_string = "$location_type='$current_location' AND";
231
  //$limit_string .= ($type=='all')?' AND':"";
232
  }
233
+ }
234
+ if ( $limit_string != '' ) {
235
+ if ( isset( $_GET['loc2'] ) && isset( $_GET['ltype2'] ) ) {
236
  $limit_string .= mc_secondary_limit( $_GET['ltype2'],$_GET['loc2'] );
237
  }
238
+ }
239
+ if ( isset( $_GET['access'] ) ) {
240
+ $limit_string .= mc_access_limit( $_GET['access'] );
241
+ }
242
+ return $limit_string;
243
+ }
244
+
245
+ function mc_access_limit( $access ) {
246
+ $options = get_option( 'mc_event_access' );
247
+ $format = ( isset( $options[$access] ) )? esc_sql( $options[$access] ) : false ;
248
+ $limit_string = ( $format ) ? " event_access LIKE '%$format%' AND" : '';
249
+ return $limit_string;
250
  }
251
 
252
  // set up a secondary limit on location
255
  $current_location = urldecode( $lvalue );
256
  $location = urldecode( $ltype );
257
  switch ($location) {
258
+ case "name":$location_type = "event_label"; break;
259
+ case "city":$location_type = "event_city"; break;
260
+ case "state":$location_type = "event_state";break;
261
+ case "zip":$location_type = "event_postcode";break;
262
+ case "country":$location_type = "event_country";break;
263
+ case "region":$location_type = "event_region";break;
 
 
 
 
 
 
264
  default:$location_type = "event_label";
 
265
  }
266
  if ($current_location != 'all' && $current_location != '') {
267
  $limit_string = " $location_type='$current_location' AND ";
my-calendar-locations.php CHANGED
@@ -1,22 +1,48 @@
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
 
4
- if (!empty($_SERVER['SCRIPT_FILENAME']) && 'my-calendar-locations.php' == basename($_SERVER['SCRIPT_FILENAME'])) {
5
  die ('Please do not load this page directly. Thanks!');
6
  }
7
- // Function to handle the management of locations
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
 
9
  function my_calendar_manage_locations() {
10
  global $wpdb;
11
  $mcdb = $wpdb;
12
- // My Calendar must be installed and upgraded before this will work
13
- check_my_calendar();
14
- $formats = array( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%f', '%f', '%d', '%s' )
15
  ?>
16
  <div class="wrap jd-my-calendar">
17
  <?php my_calendar_check_db();
18
  // We do some checking to see what we're doing
19
- if ( !empty($_POST) ) {
 
20
  $nonce=$_REQUEST['_wpnonce'];
21
  if (! wp_verify_nonce($nonce,'my-calendar-nonce') ) die("Security check failed");
22
  }
@@ -34,9 +60,11 @@ function my_calendar_manage_locations() {
34
  'location_longitude'=>$_POST['location_longitude'],
35
  'location_latitude'=>$_POST['location_latitude'],
36
  'location_zoom'=>$_POST['location_zoom'],
37
- 'location_phone'=>$_POST['location_phone']
 
 
38
  );
39
- $results = $mcdb->insert( my_calendar_locations_table(), $add, $formats );
40
  do_action( 'mc_save_location', $results, $add );
41
  if ($results) {
42
  echo "<div class=\"updated\"><p><strong>".__('Location added successfully','my-calendar')."</strong></p></div>";
@@ -69,12 +97,14 @@ function my_calendar_manage_locations() {
69
  'location_longitude'=>$_POST['location_longitude'],
70
  'location_latitude'=>$_POST['location_latitude'],
71
  'location_zoom'=>$_POST['location_zoom'],
72
- 'location_phone'=>$_POST['location_phone']
 
 
73
  );
74
  $where = array(
75
  'location_id'=>(int) $_POST['location_id']
76
  );
77
- $results = $mcdb->update( my_calendar_locations_table(), $update, $where, $formats, '%d' );
78
  if ( $results === false ) {
79
  echo "<div class=\"error\"><p><strong>".__('Location could not be edited.','my-calendar')."</strong></p></div>";
80
  } else if ( $results == 0 ) {
@@ -93,19 +123,20 @@ function my_calendar_manage_locations() {
93
  }
94
 
95
  function mc_show_location_form( $view='add',$curID='' ) {
96
- global $wpdb;
97
  $mcdb = $wpdb;
98
- if ($curID != '') {
 
99
  $sql = "SELECT * FROM " . my_calendar_locations_table() . " WHERE location_id=$curID";
100
  $cur_loc = $mcdb->get_row($sql);
101
  }
102
- ?>
103
- <?php if ($view == 'add') { ?>
104
- <h2><?php _e('Add New Location','my-calendar'); ?></h2>
105
  <?php } else { ?>
106
- <h2><?php _e('Edit Location','my-calendar'); ?></h2>
107
  <?php } ?>
108
- <div class="postbox-container" style="width: 70%">
109
  <div class="metabox-holder">
110
 
111
  <div class="ui-sortable meta-box-sortables">
@@ -124,90 +155,9 @@ global $wpdb;
124
  <input type="hidden" name="mode" value="edit" />
125
  <input type="hidden" name="location_id" value="<?php echo $cur_loc->location_id ?>" />
126
  </div>
127
- <?php } ?>
128
- <fieldset>
129
- <legend><?php _e('Event Location','my-calendar'); ?></legend>
130
- <p>
131
- <?php _e('All location fields are optional: <em>insufficient information may result in an inaccurate map</em>.','my-calendar'); ?>
132
- </p>
133
- <p>
134
- <label for="loc_label"><?php _e('Name of Location (e.g. <em>Joe\'s Bar and Grill</em>)','my-calendar'); ?></label><br />
135
- <?php if ( mc_controlled_field( 'label' ) ) {
136
- if ( !empty( $cur_loc ) ) $cur_label = (stripslashes($cur_loc->location_label));
137
- echo mc_location_controller( 'label', $cur_label );
138
- } else { ?>
139
- <input type="text" id="loc_label" name="location_label" class="input" size="40" value="<?php if ( !empty( $cur_loc ) ) esc_attr_e(stripslashes($cur_loc->location_label)); ?>" />
140
- <?php } ?>
141
- </p>
142
- <p>
143
- <label for="loc_street"><?php _e('Street Address','my-calendar'); ?></label> <input type="text" id="loc_street" name="location_street" class="input" size="40" value="<?php if ( !empty( $cur_loc ) ) esc_attr_e(stripslashes($cur_loc->location_street)); ?>" />
144
- </p>
145
- <p>
146
- <label for="loc_street2"><?php _e('Street Address (2)','my-calendar'); ?></label> <input type="text" id="loc_street2" name="location_street2" class="input" size="40" value="<?php if ( !empty( $cur_loc ) ) esc_attr_e(stripslashes($cur_loc->location_street2)); ?>" />
147
- </p>
148
- <p>
149
- <label for="loc_phone"><?php _e('Phone','my-calendar'); ?></label> <input type="text" id="loc_phone" name="location_phone" class="input" size="32" value="<?php if ( !empty( $cur_loc ) ) esc_attr_e(stripslashes($cur_loc->location_phone)); ?>" />
150
- </p>
151
- <p>
152
- <label for="loc_city"><?php _e('City','my-calendar'); ?></label>
153
- <?php if ( mc_controlled_field( 'city' ) ) {
154
- if ( !empty( $cur_loc ) ) $cur_label = ( stripslashes( $cur_loc->location_city ) );
155
- echo mc_location_controller( 'city', $cur_label );
156
- } else { ?>
157
- <input type="text" id="loc_city" name="location_city" class="input" size="40" value="<?php if ( !empty( $cur_loc ) ) esc_attr_e(stripslashes($cur_loc->location_city)); ?>" />
158
- <?php } ?>
159
- <label for="loc_state"><?php _e('State/Province','my-calendar'); ?></label>
160
- <?php if ( mc_controlled_field( 'state' ) ) {
161
- if ( !empty( $cur_loc ) ) $cur_label = (stripslashes($cur_loc->location_state));
162
- echo mc_location_controller( 'state', $cur_label );
163
- } else { ?>
164
- <input type="text" id="loc_state" name="location_state" class="input" size="10" value="<?php if ( !empty( $cur_loc ) ) echo stripslashes(esc_attr($cur_loc->location_state)); ?>" />
165
- <?php } ?>
166
- </p>
167
- <p>
168
- <label for="loc_postcode"><?php _e('Postal Code','my-calendar'); ?></label><?php
169
- if ( mc_controlled_field( 'postcode' ) ) {
170
- if ( !empty( $cur_loc ) ) { $cur_label = (stripslashes($cur_loc->location_postcode)); }
171
- echo mc_location_controller( 'postcode', $cur_label );
172
- } else { ?>
173
- <input type="text" id="loc_postcode" name="location_postcode" class="input" size="10" value="<?php if ( !empty( $cur_loc ) ) echo stripslashes(esc_attr($cur_loc->location_postcode)); ?>" />
174
- <?php } ?>
175
- <label for="loc_region"><?php _e('Region','my-calendar'); ?></label>
176
- <?php if ( mc_controlled_field( 'region' ) ) {
177
- if ( !empty( $cur_loc ) ) $cur_label = (stripslashes($cur_loc->location_region));
178
- echo mc_location_controller( 'region', $cur_label );
179
- } else { ?>
180
- <input type="text" id="loc_region" name="location_region" class="input" size="40" value="<?php if ( !empty( $cur_loc ) ) esc_attr_e(stripslashes($cur_loc->location_region)); ?>" />
181
- <?php } ?>
182
- </p>
183
- <p>
184
- <label for="loc_country"><?php _e('Country','my-calendar'); ?></label>
185
- <?php if ( mc_controlled_field( 'country' ) ) {
186
- if ( !empty( $cur_loc ) ) $cur_label = (stripslashes($cur_loc->location_country));
187
- echo mc_location_controller( 'country', $cur_label );
188
- } else { ?>
189
- <input type="text" id="loc_country" name="location_country" class="input" size="10" value="<?php if ( !empty( $cur_loc ) ) esc_attr_e(stripslashes($cur_loc->location_country)); ?>" />
190
- <?php } ?>
191
- <label for="loc_zoom"><?php _e('Initial Zoom','my-calendar'); ?></label>
192
- <select name="location_zoom" id="loc_zoom">
193
- <option value="16"<?php if ( !empty( $cur_loc ) && ( $cur_loc->location_zoom == 16 ) ) { echo " selected=\"selected\""; } ?>><?php _e('Neighborhood','my-calendar'); ?></option>
194
- <option value="14"<?php if ( !empty( $cur_loc ) && ( $cur_loc->location_zoom == 14 ) ) { echo " selected=\"selected\""; } ?>><?php _e('Small City','my-calendar'); ?></option>
195
- <option value="12"<?php if ( !empty( $cur_loc ) && ( $cur_loc->location_zoom == 12 ) ) { echo " selected=\"selected\""; } ?>><?php _e('Large City','my-calendar'); ?></option>
196
- <option value="10"<?php if ( !empty( $cur_loc ) && ( $cur_loc->location_zoom == 10 ) ) { echo " selected=\"selected\""; } ?>><?php _e('Greater Metro Area','my-calendar'); ?></option>
197
- <option value="8"<?php if ( !empty( $cur_loc ) && ( $cur_loc->location_zoom == 8 ) ) { echo " selected=\"selected\""; } ?>><?php _e('State','my-calendar'); ?></option>
198
- <option value="6"<?php if ( !empty( $cur_loc ) && ( $cur_loc->location_zoom == 6 ) ) { echo " selected=\"selected\""; } ?>><?php _e('Region','my-calendar'); ?></option>
199
- </select>
200
- </p>
201
- <p>
202
- <label for="loc_url"><?php _e('Website','my-calendar'); ?></label> <input type="text" id="loc_url" name="location_url" class="input" size="40" value="<?php if ( !empty( $cur_loc ) ) esc_attr_e(stripslashes($cur_loc->location_url)); ?>" />
203
- </p>
204
- <fieldset>
205
- <legend><?php _e('GPS Coordinates (optional)','my-calendar'); ?></legend>
206
- <p>
207
- <label for="loc_latitude"><?php _e('Latitude','my-calendar'); ?></label> <input type="text" id="loc_latitude" name="location_latitude" class="input" size="10" value="<?php if ( !empty( $cur_loc ) ) { esc_attr_e(stripslashes($cur_loc->location_latitude)); } else { echo '0.000000'; } ?>" />
208
- <label for="loc_longitude"><?php _e('Longitude','my-calendar'); ?></label> <input type="text" id="loc_longitude" name="location_longitude" class="input" size="10" value="<?php if ( !empty( $cur_loc ) ) { esc_attr_e(stripslashes($cur_loc->location_longitude)); } else { echo '0.000000'; } ?>" />
209
- </p>
210
- </fieldset>
211
  <p>
212
  <input type="submit" name="save" class="button-primary" value="<?php if ($view == 'edit') { _e('Save Changes','my-calendar'); } else { _e('Add Location','my-calendar'); } ?> &raquo;" />
213
  </p>
@@ -228,7 +178,7 @@ global $wpdb;
228
  </div>
229
  </div>
230
  </div>
231
- <?php jd_show_support_box(); ?>
232
  </div>
233
 
234
  <?php
@@ -236,32 +186,29 @@ global $wpdb;
236
 
237
  function mc_controlled_field( $this_field ) {
238
  $this_field = trim($this_field);
239
- $controlled = get_option( 'mc_location_control' );
240
- if ( $controlled == 'on' ) {
241
- $controlled_field = trim(str_replace( 'event_','',get_option('mc_location_type') ));
242
- return ( $controlled_field==$this_field )?true:false;
 
243
  } else {
244
  return false;
245
  }
246
  }
247
 
248
- function mc_location_controller( $fieldname, $selected ) {
249
- if ( isset($_GET['page']) && $_GET['page'] == 'my-calendar-locations' ) {
250
- $fieldname = 'location_'.$fieldname;
251
- } else {
252
- $fieldname = 'event_'.$fieldname;
253
- }
254
- $selected = trim($selected);
255
- $options = get_option('mc_user_settings');
256
- $regions = $options['my_calendar_location_default']['values'];
257
- $form .= "<select name='$fieldname' id='$fieldname'>";
258
- $form .= "<option value='none'>No preference</option>\n";
259
- foreach ($regions as $key=>$value) {
260
- $key = trim($key);
261
- $aselected = ($selected==$key)?" selected='selected'":'';
262
- $form .= "<option value='$key'$aselected>$value</option>\n";
263
- }
264
- $form .= "</select>";
265
  return $form;
266
  }
267
 
@@ -269,8 +216,27 @@ function mc_manage_locations() {
269
  global $wpdb;
270
  $mcdb = $wpdb;
271
  // pull the locations from the database
272
- $locations = $mcdb->get_results("SELECT * FROM " . my_calendar_locations_table() . " ORDER BY location_label ASC");
273
- if ( !empty($locations) ) { ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
274
  <table class="widefat page" id="my-calendar-admin-table">
275
  <thead>
276
  <tr>
@@ -299,6 +265,194 @@ function mc_manage_locations() {
299
  <p><em>
300
  <?php _e('Please note: editing or deleting locations stored for re-use will have no effect on any event previously scheduled at that location. The location database exists purely as a shorthand method to enter frequently used locations into event records.','my-calendar'); ?>
301
  </em></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
302
  </div>
303
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
304
  }
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
 
4
+ if ( !empty( $_SERVER['SCRIPT_FILENAME'] ) && 'my-calendar-locations.php' == basename( $_SERVER['SCRIPT_FILENAME'] ) ) {
5
  die ('Please do not load this page directly. Thanks!');
6
  }
7
+
8
+ function mc_update_location_controls() {
9
+ if ( isset( $_POST['mc_locations'] ) && $_POST['mc_locations'] == 'true' ) {
10
+ $nonce = $_POST['_wpnonce'];
11
+ if ( !wp_verify_nonce($nonce,'my-calendar-locations-nonce') ) wp_die( "Invalid nonce" );
12
+ $locations = $_POST['mc_location_controls'];
13
+ foreach ( $locations as $key=>$value ) {
14
+ $mc_location_controls[$key] = mc_csv_to_array( $value[0] );
15
+ }
16
+ update_option( 'mc_location_controls', $mc_location_controls );
17
+ echo "<div class='notice updated'><p>".__( 'Location Controls Updated','my-calendar' )."</p></div>";
18
+ }
19
+ }
20
+
21
+ function mc_insert_location( $add ) {
22
+ global $wpdb;
23
+ $mcdb = $wpdb;
24
+ $formats = array( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%f', '%f', '%d', '%s', '%s', '%s' );
25
+ $results = $mcdb->insert( my_calendar_locations_table(), $add, $formats );
26
+ return $results;
27
+ }
28
+
29
+ function mc_modify_location( $update, $where ) {
30
+ global $wpdb;
31
+ $mcdb = $wpdb;
32
+ $formats = array( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%f', '%f', '%d', '%s', '%s', '%s' );
33
+ $results = $mcdb->update( my_calendar_locations_table(), $update, $where, $formats, '%d' );
34
+ return $results;
35
+ }
36
 
37
  function my_calendar_manage_locations() {
38
  global $wpdb;
39
  $mcdb = $wpdb;
 
 
 
40
  ?>
41
  <div class="wrap jd-my-calendar">
42
  <?php my_calendar_check_db();
43
  // We do some checking to see what we're doing
44
+ mc_update_location_controls();
45
+ if ( !empty( $_POST ) && !isset( $_POST['mc_locations'] ) ) {
46
  $nonce=$_REQUEST['_wpnonce'];
47
  if (! wp_verify_nonce($nonce,'my-calendar-nonce') ) die("Security check failed");
48
  }
60
  'location_longitude'=>$_POST['location_longitude'],
61
  'location_latitude'=>$_POST['location_latitude'],
62
  'location_zoom'=>$_POST['location_zoom'],
63
+ 'location_phone'=>$_POST['location_phone'],
64
+ 'location_phone2'=>$_POST['location_phone2'],
65
+ 'location_access'=>serialize( $_POST['location_access'] )
66
  );
67
+ $results = mc_insert_location( $add, $formats );
68
  do_action( 'mc_save_location', $results, $add );
69
  if ($results) {
70
  echo "<div class=\"updated\"><p><strong>".__('Location added successfully','my-calendar')."</strong></p></div>";
97
  'location_longitude'=>$_POST['location_longitude'],
98
  'location_latitude'=>$_POST['location_latitude'],
99
  'location_zoom'=>$_POST['location_zoom'],
100
+ 'location_phone'=>$_POST['location_phone'],
101
+ 'location_phone2'=>$_POST['location_phone2'],
102
+ 'location_access'=>serialize( $_POST['location_access'] )
103
  );
104
  $where = array(
105
  'location_id'=>(int) $_POST['location_id']
106
  );
107
+ $results = mc_modify_location( $update, $where );
108
  if ( $results === false ) {
109
  echo "<div class=\"error\"><p><strong>".__('Location could not be edited.','my-calendar')."</strong></p></div>";
110
  } else if ( $results == 0 ) {
123
  }
124
 
125
  function mc_show_location_form( $view='add',$curID='' ) {
126
+ global $wpdb;
127
  $mcdb = $wpdb;
128
+ $cur_loc = false;
129
+ if ( $curID != '' ) {
130
  $sql = "SELECT * FROM " . my_calendar_locations_table() . " WHERE location_id=$curID";
131
  $cur_loc = $mcdb->get_row($sql);
132
  }
133
+ $has_data = ( empty( $cur_loc ) ) ? false : true;
134
+ if ($view == 'add') { ?>
135
+ <h2><?php _e( 'Add New Location','my-calendar' ); ?></h2>
136
  <?php } else { ?>
137
+ <h2><?php _e( 'Edit Location','my-calendar' ); ?></h2>
138
  <?php } ?>
139
+ <div class="postbox-container jcd-wide">
140
  <div class="metabox-holder">
141
 
142
  <div class="ui-sortable meta-box-sortables">
155
  <input type="hidden" name="mode" value="edit" />
156
  <input type="hidden" name="location_id" value="<?php echo $cur_loc->location_id ?>" />
157
  </div>
158
+ <?php }
159
+ echo mc_locations_fields( $has_data, $cur_loc, 'location' );
160
+ ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
  <p>
162
  <input type="submit" name="save" class="button-primary" value="<?php if ($view == 'edit') { _e('Save Changes','my-calendar'); } else { _e('Add Location','my-calendar'); } ?> &raquo;" />
163
  </p>
178
  </div>
179
  </div>
180
  </div>
181
+ <?php mc_show_sidebar(); ?>
182
  </div>
183
 
184
  <?php
186
 
187
  function mc_controlled_field( $this_field ) {
188
  $this_field = trim($this_field);
189
+ $controls = get_option( 'mc_location_controls' );
190
+ if ( !is_array( $controls ) || empty( $controls ) ) { return false; }
191
+ $controlled = array_keys( $controls );
192
+ if ( in_array( 'event_'.$this_field, $controlled ) && !empty( $controls['event_'.$this_field] ) ) {
193
+ return true;
194
  } else {
195
  return false;
196
  }
197
  }
198
 
199
+ function mc_location_controller( $fieldname, $selected, $context='location' ) {
200
+ $field = ( $context == 'location' ) ? 'location_'.$fieldname : 'e_'.$fieldname ;
201
+ $selected = trim($selected);
202
+ $options = get_option('mc_location_controls');
203
+ $regions = $options['event_'.$fieldname];
204
+ $form = "<select name='$field' id='$field'>";
205
+ $form .= "<option value='none'>No preference</option>\n";
206
+ foreach ( $regions as $key=>$value ) {
207
+ $key = trim($key);
208
+ $aselected = ( $selected == $key )?" selected='selected'":'';
209
+ $form .= "<option value='$key'$aselected>$value</option>\n";
210
+ }
211
+ $form .= "</select>";
 
 
 
 
212
  return $form;
213
  }
214
 
216
  global $wpdb;
217
  $mcdb = $wpdb;
218
  // pull the locations from the database
219
+ $items_per_page = 50;
220
+ $current = empty( $_GET['paged'] ) ? 1 : intval( $_GET['paged'] );
221
+ $locations = $mcdb->get_results("SELECT SQL_CALC_FOUND_ROWS * FROM " . my_calendar_locations_table() . " ORDER BY location_label ASC LIMIT ".( ( $current-1 )*$items_per_page ).", ".$items_per_page );
222
+ $found_rows = $wpdb->get_col( "SELECT FOUND_ROWS();" );
223
+ $items = $found_rows[0];
224
+
225
+ $num_pages = ceil( $items / $items_per_page );
226
+ if ( $num_pages > 1 ) {
227
+ $page_links = paginate_links( array(
228
+ 'base'=> add_query_arg( 'paged', '%#%'),
229
+ 'format'=> '',
230
+ 'prev_text'=> __( '&laquo; Previous<span class="screen-reader-text"> Locations</span>','my-calendar' ),
231
+ 'next_text'=> __( 'Next<span class="screen-reader-text"> Locations</span> &raquo;','my-calendar' ),
232
+ 'total'=> $num_pages,
233
+ 'current'=> $current,
234
+ 'mid_size'=> 1
235
+ ) );
236
+ printf( "<div class='tablenav'><div class='tablenav-pages'>%s</div></div>", $page_links );
237
+ }
238
+
239
+ if ( !empty( $locations ) ) { ?>
240
  <table class="widefat page" id="my-calendar-admin-table">
241
  <thead>
242
  <tr>
265
  <p><em>
266
  <?php _e('Please note: editing or deleting locations stored for re-use will have no effect on any event previously scheduled at that location. The location database exists purely as a shorthand method to enter frequently used locations into event records.','my-calendar'); ?>
267
  </em></p>
268
+
269
+ <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-locations"); ?>">
270
+ <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-locations-nonce'); ?>" /></div>
271
+ <div><input type="hidden" name="mc_locations" value="true" /></div>
272
+ <fieldset>
273
+ <legend><?php _e( 'Control Input Options for Location Fields','my-calendar' ); ?></legend>
274
+ <div id="mc-accordion">
275
+ <?php
276
+ // array of fields allowing input control.
277
+ $location_fields = array( 'event_label', 'event_city', 'event_state', 'event_country', 'event_postcode', 'event_region' );
278
+ $mc_location_controls = get_option( 'mc_location_controls' );
279
+ foreach ( $location_fields as $field ) { ?>
280
+ <h4><?php echo ucfirst( str_replace( 'event_','',$field ) ); ?></h4>
281
+ <div>
282
+ <label for="loc_values_<?php echo $field; ?>"><?php printf( __('Location Controls for %s','my-calendar'), ucfirst( str_replace( 'event_','',$field ) ) ); ?> (<?php _e('Value, Label; one per line','my-calendar'); ?>)</label><br />
283
+ <?php
284
+ $locations = '';
285
+ if ( is_array( $mc_location_controls ) && isset( $mc_location_controls[$field] ) ) {
286
+ foreach ( $mc_location_controls[$field] as $key=>$value ) {
287
+ $locations .= stripslashes( "$key,$value" )."\n";
288
+ }
289
+ }
290
+ ?>
291
+ <textarea name="mc_location_controls[<?php echo $field; ?>][]" id="loc_values_<?php echo $field; ?>" cols="80" rows="6"><?php echo trim($locations); ?></textarea>
292
+ </div>
293
+ <?php } ?>
294
+ </div>
295
+ <p><input type='submit' class='button secondary' value='<?php _e( 'Save Location Controls','my-calendar' ); ?>' /></p>
296
+ </fieldset>
297
  </div>
298
  <?php
299
+ }
300
+
301
+ function mc_locations_fields( $has_data, $data, $context = 'location' ) {
302
+ $return = '<div class="mc-locations">';
303
+ if ( current_user_can( 'mc_edit_locations') && $context == 'event' ) {
304
+ $return .= '<p><input type="checkbox" value="on" name="mc_copy_location" id="mc_copy_location" /> <label for="mc_copy_location">'.__('Copy this location into the locations table','my-calendar').'</label></p>';
305
+ }
306
+ $return .= '
307
+ <p class="checkbox">
308
+ <label for="e_label">'.__('Name of Location (e.g. <em>Joe\'s Bar and Grill</em>)','my-calendar').'</label>';
309
+ $cur_label = ( !empty( $data ) ) ? ( stripslashes( $data->{$context.'_label'} ) ):'';
310
+ if ( mc_controlled_field( 'label' ) ) {
311
+ $return .= mc_location_controller( 'label', $cur_label, $context );
312
+ } else {
313
+ $return .= '<input type="text" id="e_label" name="'.$context.'_label" size="40" value="'.esc_attr( $cur_label ).'" />';
314
+ }
315
+ $street_address = ( $has_data ) ? esc_attr( stripslashes( $data->{$context.'_street'} ) ) : '';
316
+ $street_address2 = ( $has_data ) ? esc_attr( stripslashes( $data->{$context.'_street2'} ) ) : '';
317
+ $return .= '
318
+ </p>
319
+ <div class="locations-container">
320
+ <div class="location-primary">
321
+ <fieldset>
322
+ <legend>'.__( 'Location Address','my-calendar' ).'</legend>
323
+ <p>
324
+ <label for="e_street">'.__('Street Address','my-calendar').'</label> <input type="text" id="e_street" name="'.$context.'_street" size="40" value="'.$street_address.'" />
325
+ </p>
326
+ <p>
327
+ <label for="e_street2">'.__('Street Address (2)','my-calendar').'</label> <input type="text" id="e_street2" name="'.$context.'_street2" size="40" value="'.$street_address2.'" />
328
+ </p>
329
+ <p>
330
+ <label for="e_city">'.__('City','my-calendar').'</label> ';
331
+ $cur_city = ( !empty( $data ) )?( stripslashes( $data->{$context.'_city'} ) ):'';
332
+ if ( mc_controlled_field( 'city' ) ) {
333
+ $return .= mc_location_controller( 'city', $cur_city, $context );
334
+ } else {
335
+ $return .= '<input type="text" id="e_city" name="'.$context.'_city" size="40" value="'.esc_attr( $cur_city ).'" />';
336
+ }
337
+ $return .= "</p>
338
+ <p>";
339
+ $return .= '<label for="e_state">'.__('State/Province','my-calendar').'</label> ';
340
+ $cur_state = ( !empty( $data ) )?( stripslashes( $data->{$context.'_state'} ) ):'';
341
+ if ( mc_controlled_field( 'state' ) ) {
342
+ $return .= mc_location_controller( 'state', $cur_state, $context );
343
+ } else {
344
+ $return .= '<input type="text" id="e_state" name="'.$context.'_state" size="10" value="'.esc_attr( $cur_state ).'" />';
345
+ }
346
+ $return .= '</p>
347
+ <p>
348
+ <label for="e_postcode">'.__('Postal Code','my-calendar').'</label> ';
349
+ $cur_postcode = ( !empty( $data ) )?( stripslashes( $data->{$context.'_postcode'} ) ):'';
350
+ if ( mc_controlled_field( 'postcode') ) {
351
+ $return .= mc_location_controller( 'postcode', $cur_postcode, $context );
352
+ } else {
353
+ $return .= '<input type="text" id="e_postcode" name="'.$context.'_postcode" size="40" value="'.esc_attr( $cur_postcode ).'" />';
354
+ }
355
+ $return .= "</p>
356
+ <p>";
357
+ $return .= '<label for="e_region">'.__('Region','my-calendar').'</label> ';
358
+ $cur_region = ( !empty( $data ) )?( stripslashes( $data->{$context.'_region'} ) ):'';
359
+ if ( mc_controlled_field( 'region' ) ) {
360
+ $return .= mc_location_controller( 'region', $cur_region, $context );
361
+ } else {
362
+ $return .= '<input type="text" id="e_region" name="'.$context.'_region" size="40" value="'.esc_attr( $cur_region ).'" />';
363
+ }
364
+ $return .= '</p>
365
+ <p>
366
+ <label for="e_country">'.__('Country','my-calendar').'</label> ';
367
+ $cur_country = ( $has_data )?( stripslashes( $data->{$context.'_country'} ) ):'';
368
+ if ( mc_controlled_field( 'country' ) ) {
369
+ $return .= mc_location_controller( 'country', $cur_country, $context );
370
+ } else {
371
+ $return .= '<input type="text" id="e_country" name="'.$context.'_country" size="10" value="'.esc_attr( $cur_country ).'" />';
372
+ }
373
+ $zoom = ( $has_data ) ? $data->{$context.'_zoom'} : '16' ;
374
+ $event_phone = ( $has_data ) ? esc_attr( stripslashes( $data->{$context.'_phone'} ) ) : '';
375
+ $event_phone2 = ( $has_data ) ? esc_attr( stripslashes( $data->{$context.'_phone2'} ) ) : '';
376
+ $event_url = ( $has_data ) ? esc_attr( stripslashes( $data->{$context.'_url'} ) ) : '';
377
+ $event_lat = ( $has_data ) ? esc_attr( stripslashes( $data->{$context.'_latitude'} ) ) : '';
378
+ $event_lon = ( $has_data ) ? esc_attr( stripslashes( $data->{$context.'_longitude'} ) ) : '';
379
+ $return .= '</p>
380
+ <p>
381
+ <label for="e_zoom">'.__('Initial Zoom','my-calendar').'</label>
382
+ <select name="'.$context.'_zoom" id="e_zoom">
383
+ <option value="16"'.jd_option_selected( $zoom, '16', 'option' ).'>'.__('Neighborhood','my-calendar').'</option>
384
+ <option value="14"'.jd_option_selected( $zoom, '14', 'option' ).'>'.__('Small City','my-calendar').'</option>
385
+ <option value="12"'.jd_option_selected( $zoom, '12', 'option' ).'>'.__('Large City','my-calendar').'</option>
386
+ <option value="10"'.jd_option_selected( $zoom, '10', 'option' ).'>'.__('Greater Metro Area','my-calendar').'</option>
387
+ <option value="8"'.jd_option_selected( $zoom, '8', 'option' ).'>'.__('State','my-calendar').'</option>
388
+ <option value="6"'.jd_option_selected( $zoom, '6', 'option' ).'>'.__('Region','my-calendar').'</option>
389
+ </select>
390
+ </p>
391
+ </fieldset>
392
+ <fieldset>
393
+ <legend>'.__('GPS Coordinates (optional)','my-calendar').'</legend>
394
+ <p>
395
+ '.__('If you supply GPS coordinates for your location, they will be used in place of any other address information to provide your map link.','my-calendar').'
396
+ </p>
397
+ <p>
398
+ <label for="e_latitude">'.__('Latitude','my-calendar').'</label> <input type="text" id="e_latitude" name="'.$context.'_latitude" size="10" value="'.$event_lat.'" /> <label for="e_longitude">'.__('Longitude','my-calendar').'</label> <input type="text" id="e_longitude" name="'.$context.'_longitude" size="10" value="'.$event_lon.'" />
399
+ </p>
400
+ </fieldset>
401
+ </div>
402
+ <div class="location-secondary">
403
+ <fieldset>
404
+ <legend>'.__( 'Location Contact Information', 'my-calendar' ).'</legend>
405
+ <p>
406
+ <label for="e_phone">'.__('Phone','my-calendar').'</label> <input type="text" id="e_phone" name="'.$context.'_phone" size="32" value="'.$event_phone.'" />
407
+ </p>
408
+ <p>
409
+ <label for="e_phone2">'.__('Secondary Phone','my-calendar').'</label> <input type="text" id="e_phone2" name="'.$context.'_phone2" size="32" value="'.$event_phone2.'" />
410
+ </p>
411
+ <p>
412
+ <label for="e_url">'.__('Location URL','my-calendar').'</label> <input type="text" id="e_url" name="'.$context.'_url" size="40" value="'.$event_url.'" />
413
+ </p>
414
+ </fieldset>
415
+ <fieldset>
416
+ <legend>'.__('Location Accessibility','my-calendar').'</legend>
417
+ <ul class="accessibility-features checkboxes">';
418
+ $access = apply_filters( 'mc_venue_accessibility', get_option( 'mc_location_access') );
419
+ $access_list = '';
420
+ if ( $has_data ) {
421
+ if ( $context == 'location' ) {
422
+ $location_access = unserialize( $data->{$context.'_access'} );
423
+ } else {
424
+ $location_access = unserialize( mc_location_data( 'location_access', $data->event_location ) );
425
+ }
426
+ } else {
427
+ $location_access = array();
428
+ }
429
+ foreach ( $access as $k=>$a ) {
430
+ $id = "loc_access_$k";
431
+ $label = $a;
432
+ $checked = '';
433
+ if ( is_array( $location_access ) ) {
434
+ $checked = ( in_array( $a, $location_access ) || in_array( $k, $location_access ) ) ? " checked='checked'" : '';
435
+ }
436
+ $item = sprintf( '<li><input type="checkbox" id="%1$s" name="'.$context.'_access[]" value="%4$s" class="checkbox" %2$s /> <label for="%1$s">%3$s</label></li>', $id, $checked, $label, $a );
437
+ $access_list .= $item;
438
+ }
439
+ $return .= $access_list;
440
+ $return .= '</ul>
441
+ </fieldset></div>
442
+ </div>
443
+ </div>';
444
+ return $return;
445
+ }
446
+
447
+ // get a specific field with an location ID
448
+ function mc_location_data( $field, $id ) {
449
+ if ( $id ) {
450
+ global $wpdb;
451
+ $mcdb = $wpdb;
452
+ if ( get_option( 'mc_remote') == 'true'&& function_exists('mc_remote_db') ) { $mcdb = mc_remote_db(); }
453
+ $field = esc_sql( $field );
454
+ $sql = $wpdb->prepare( "SELECT $field FROM ".my_calendar_locations_table()." WHERE location_id = %d", $id );
455
+ $result = $mcdb->get_var($sql);
456
+ return $result;
457
+ }
458
  }
my-calendar-output.php CHANGED
@@ -37,6 +37,8 @@ function mc_set_date_array( $events ) {
37
  }
38
 
39
  function my_calendar_draw_events($events, $type, $process_date, $time, $template='') {
 
 
40
  if ( $type == 'mini' && ( get_option('mc_open_day_uri') == 'true' || get_option('mc_open_day_uri') == 'listanchor' || get_option('mc_open_day_uri') == 'calendaranchor' ) ) return true;
41
  // We need to sort arrays of objects by time
42
  if ( is_array($events) ) {
@@ -47,64 +49,141 @@ function my_calendar_draw_events($events, $type, $process_date, $time, $template
47
  }
48
  // By default, skip no events.
49
  $skipping = false;
50
- foreach(array_keys($events) as $key ) {
51
  $event =& $events[$key];
52
  $output_array[] = my_calendar_draw_event( $event,$type,$process_date,$time,$template );
53
  }
54
- if ( is_array($output_array) ) {
55
- foreach (array_keys($output_array) as $key) {
56
  $value =& $output_array[$key];
57
  $event_output .= $value;
58
  }
59
  }
60
  if ( $event_output == '' ) { return; }
61
- if ( $type == "mini" && count($events) > 0 ) { $end .= "</div>"; }
62
  return $begin . $event_output . $end;
63
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  }
65
  // Used to draw an event to the screen
66
- function my_calendar_draw_event($event, $type="calendar", $process_date, $time, $template='') {
 
 
 
 
 
 
 
 
67
  global $wpdb;
68
  $url = plugin_dir_url( __FILE__ );
69
-
70
  $mcdb = $wpdb;
71
  if ( get_option( 'mc_remote' ) == 'true' && function_exists('mc_remote_db') ) { $mcdb = mc_remote_db(); }
72
- // My Calendar must be updated to run this function
73
- check_my_calendar();
74
  if ( $event->category_private == 1 && !is_user_logged_in() ) { return; }
75
- $header_details = $body_details = $address = $output = '';
76
- $date_format = ( get_option('mc_date_format') != '' )?get_option('mc_date_format'):get_option('date_format');
77
- $data = event_as_array($event);
 
78
  $details = apply_filters( 'mc_custom_template', false, $data, $event, $type, $process_date, $time, $template );
 
79
  if ( $details === false ) {
80
- $templates = get_option('mc_templates');
81
- if ( $template != '' && mc_file_exists( $template ) ) {
82
- $template = @file_get_contents( mc_get_file( $template ) );
83
  $details = jd_draw_template( $data, $template );
84
  } else {
85
  switch ($type) {
86
  case 'mini':
87
  $template = $templates['mini'];
88
- if ( get_option('mc_use_mini_template')==1 ) {
89
  $details = jd_draw_template( $data, $template );
90
  }
91
  break;
92
  case 'list':
93
  $template = $templates['list'];
94
- if ( get_option('mc_use_list_template')==1 ) {
95
  $details = jd_draw_template( $data, $template );
96
  }
97
  break;
98
  case 'single':
99
  $template = $templates['details'];
100
- if ( get_option('mc_use_details_template')==1 ) {
101
  $details = jd_draw_template( $data, $template );
102
  }
103
  break;
104
  case 'calendar':
105
  default:
106
  $template = $templates['grid'];
107
- if ( get_option('mc_use_grid_template')==1 ) {
108
  $details = jd_draw_template( $data, $template );
109
  }
110
  }
@@ -114,144 +193,90 @@ function my_calendar_draw_event($event, $type="calendar", $process_date, $time,
114
  $display_map = get_option('mc_show_map');
115
  $display_address = get_option('mc_show_address');
116
  $display_details = get_option('mc_details');
117
- $id_start = date('Y-m-d',strtotime($event->event_begin));
118
- $id_end = date('Y-m-d',strtotime($event->event_end));
119
  $uid = 'mc_'.$event->occur_id;
120
- $day_id = date('d',strtotime($process_date) );
121
  $mc_id = $event->occur_id;
122
  $this_category = $event->event_category;
123
- // get user-specific data
124
- $tz = mc_user_timezone();
125
- $category = "mc_".sanitize_title( $event->category_name );
126
- if ( get_option('mc_hide_icons')=='true' ) {
127
- $image = "";
128
- } else {
129
- if ($event->category_icon != "") {
130
- $path = (is_custom_icon())?str_replace('my-calendar','',$url).'/my-calendar-custom/':plugins_url('icons',__FILE__).'/';
131
- $hex = (strpos($event->category_color,'#') !== 0)?'#':'';
132
- $image = '<img src="'.$path.$event->category_icon.'" alt="'.__('Category','my-calendar').': '.esc_attr($event->category_name).'" class="category-icon" style="background:'.$hex.$event->category_color.'" />';
133
- } else {
134
- $image = "";
135
- }
136
- }
137
- // move this div start for custom.
138
- $header_details .= "<div id='$uid-$day_id-$type' class='$type-event $category vevent'>\n";
139
- $templates = get_option('mc_templates');
140
- $title_template = ($templates['title'] == '' )?'{title}':$templates['title'];
141
- $mytitle = jd_draw_template($data,$title_template);
142
- if ( $mytitle == '' ) { $mytitle = jd_draw_template($data,'{title}'); } //prevent empty titles
143
- if ( strpos( $mytitle,'http' ) === false && $type != 'mini' && $type != 'list' ) {
144
  if ( get_option('mc_open_uri') == 'true' ) {
145
- $details_link = mc_build_url( array( 'mc_id'=>$mc_id ), array('month','dy','yr','ltype','loc','mcat'), get_option( 'mc_uri' ) );
146
- $wrap = "<a href='$details_link'>"; $balance = "</a>";
 
147
  } else {
148
- $wrap = "<a href='#$uid-$day_id-$type-details'>"; $balance = "</a>";
 
149
  }
150
  } else {
151
  $wrap = $balance = '';
152
  }
153
- $current_date = date_i18n($date_format,strtotime($process_date));
154
- if ( $event->event_span == 1 ) { $group_class = ' multidate group'.$event->event_group_id; } else { $group_class = ''; }
155
- $header_details .= ( $type != 'single' && $type != 'list' )?"<h3 class='event-title summary$group_class'>$wrap$image".$mytitle."$balance</h3>\n":'';
156
- $title = ($type == 'single' )?"<h2 class='event-title summary'>$image $mytitle</h2>\n":'';
157
- $title = apply_filters( 'mc_event_title', $title, $event, $mytitle, $image );
158
- $header_details .= $title;
159
-
160
- $dateid = $event->occur_id;
161
- $container = '';
162
  if ( $details === false ) {
 
163
  // put together address information as vcard
164
- if (($display_address == 'true' || $display_map == 'true') ) {
165
- $address .= mc_hcard( $event, $display_address, $display_map );
166
  }
167
  // end vcard
168
- $container .= " <div id='$uid-$day_id-$type-details' class='details'>\n";
169
- $container .= apply_filters('mc_before_event','',$event);
170
- $body_details .= ($type == 'calendar' || $type == 'mini' )?"<span class='close'><a href='#$uid-$day_id-$type' class='mc-toggle mc-close'><img src='".plugin_dir_url(__FILE__)."images/event-close.png' alt='".__('Close','my-calendar')."' /></a></span>":'';
171
- $body_details .= "<div class='time-block'>";
172
- $cur_date = ( $type == 'list' )?'':"<span class='mc-event-date'>$current_date</span>";
173
- $body_details .= "<p>$cur_date";
174
- if ( $event->event_time != "00:00:00" && $event->event_time != '' ) {
175
- $body_details .= "\n<span class='event-time dtstart'><time datetime='".$id_start.'T'.$event->event_time."'>".date_i18n(get_option('mc_time_format'), strtotime($event->event_time)).'</time>';
176
- if ( $event->event_hide_end == 0 ) {
177
- if ($event->event_endtime != '' && $event->event_endtime != $event->event_time ) {
178
- $body_details .= "<span class='time-separator'> &ndash; </span><time class='end-time dtend' datetime='".$id_end.'T'.$event->event_endtime."'>".date_i18n(get_option('mc_time_format'), strtotime($event->event_endtime))."</span>";
179
- }
180
- }
181
- if ($tz != '') {
182
- $local_begin = date_i18n( get_option('mc_time_format'), strtotime($event->event_time ."+$tz hours") );
183
- $body_details .= "<hr /><small class='local-time'>". sprintf(__('(%s in your time zone)','my-calendar'),$local_begin)."</small>";
184
- }
185
- $body_details .= "</span>\n";
186
- } else {
187
- $body_details .= "<span class='event-time'>";
188
- if ( get_option('mc_notime_text') == '' || get_option('mc_notime_text') == "N/A" ) {
189
- $body_details .= "<abbr title='".__('Not Applicable','my-calendar')."'>".__('N/A','my-calendar')."</abbr>\n";
190
- } else {
191
- $body_details .= get_option('mc_notime_text');
192
- }
193
- $body_details .= "</span></p>";
194
- }
195
- $body_details .= "
196
- </div>";
197
- $subdetails = '';
198
- if ($type == "list") {
199
- $subdetails .= "<h3 class='event-title summary'>$image".$mytitle."</h3>\n";
200
- }
201
- if ($mc_display_author == 'true') {
202
- if ( $event->event_author != 0 ) {
203
- $e = get_userdata($event->event_author);
204
- $subdetails .= '<span class="event-author">'.__('Posted by', 'my-calendar').': <span class="author-name">'.$e->display_name."</span></span><br />\n";
205
- }
206
- }
207
- if (($display_address == 'true' || $display_map == 'true') ) {
208
- $subdetails .= $address;
209
  }
210
- if ($display_details == 'true' && !isset($_GET['mc_id']) ) {
211
- $id = $event->event_id;
212
- $details_template = ( !empty($templates['label']) )? stripcslashes($templates['label']):__('Details about','my-calendar').' {title}';
213
- $tags = array( "{title}","{location}","{color}","{icon}","{date}","{time}" );
214
- $current_time = date_i18n(get_option('mc_time_format'), strtotime($event->event_time));
215
- $replacements = array( stripslashes($event->event_title), stripslashes($event->event_label), $event->category_color, $event->category_icon, $current_date, $current_time );
216
- $details_label = str_replace($tags,$replacements,$details_template );
217
- // this should be drawn from templating
218
- $details_link = mc_build_url( array('mc_id'=>$mc_id), array('month','dy','yr','ltype','loc','mcat'), get_option( 'mc_uri' ) );
219
- $subdetails .= ( get_option( 'mc_uri' ) != '' )?"<p class='mc_details'><a href='$details_link'>$details_label</a></p>\n":'';
220
- }
221
- // handle link expiration
222
- if ( $event->event_link_expires == 0 ) {
223
- $event_link = esc_url($event->event_link);
224
- } else {
225
- if ( my_calendar_date_xcomp( $event->occur_end,date_i18n('Y-m-d',current_time('timestamp') ) ) ) {
226
- $event_link = '';
227
- } else {
228
- $event_link = esc_url($event->event_link);
229
  }
230
  }
 
 
 
 
 
 
 
231
 
232
  if ( function_exists('mc_google_cal') && get_option('mc_show_gcal') == 'true' ) {
233
  $gcal_link = "<p class='gcal'>".jd_draw_template( $data, '{gcal_link}' )."</p>";
234
- $subdetails .= $gcal_link;
235
  }
236
 
237
  if ( function_exists('my_calendar_generate_vcal') && get_option('mc_show_event_vcal') == 'true' ) {
238
  $nonce = wp_create_nonce('my-calendar-nonce');
239
  $vcal_link = "<p class='ical'><a rel='nofollow' href='".home_url()."?vcal=$uid"."'>".__('iCal','my-calendar')."</a></p>\n";
240
- $subdetails .= $vcal_link;
241
  }
242
-
243
- $event_image = ($event->event_image!='')?"<img src='$event->event_image' alt='' class='mc-image' />":'';
244
- $short = '';
245
- if ( get_option('mc_short') == 'true' && $type != 'single' ) {
246
- $short = ( get_option('mc_process_shortcodes') == 'true' )?apply_filters('the_content',stripcslashes($event->event_short)):wpautop(stripcslashes($event->event_short),1);
247
- $short = "<div class='shortdesc'>$event_image".$short."</div>";
248
  }
249
  if ( get_option('mc_desc') == 'true' || $type == 'single' ) {
250
  $description = ( get_option('mc_process_shortcodes') == 'true' )?apply_filters('the_content',stripcslashes($event->event_desc)):wpautop(stripcslashes($event->event_desc),1);
251
- $description = "<div class='longdesc'>$event_image".$description."</div>";
252
- } else {
253
- $description = '';
 
 
254
  }
 
255
  if ( get_option('mc_event_registration') == 'true' ) {
256
  switch ($event->event_open) {
257
  case '0':$status = get_option('mc_event_closed');break;
@@ -262,78 +287,94 @@ function my_calendar_draw_event($event, $type="calendar", $process_date, $time,
262
  } else {
263
  $status = '';
264
  }
 
 
265
  // if the event is a member of a group of events, but not the first, note that.
266
- if ($event->event_group == 1 ) {
267
  $info = array();
268
  $info[] = $event->event_id;
269
  update_option( 'mc_event_groups' , $info );
270
  }
 
271
  if ( is_array( get_option( 'mc_event_groups' ) ) ) {
272
  if ( in_array ( $event->event_id , get_option( 'mc_event_groups') ) ) {
273
- if ( $process_date != $event->event_original_begin ) {
274
- $status = __("This class is part of a series. You must register for the first event in this series to attend.",'my-calendar');
275
  }
276
  }
277
  }
 
278
  $status = ($status != '')?"<p>$status</p>":'';
279
  $status = apply_filters( 'mc_registration_state', $status, $event );
280
  $return = ($type == 'single')?"<p><a href='".get_option('mc_uri')."'>".__('View full calendar','my-calendar')."</a></p>":'';
281
- // if we're opening in a new page, there's no reason to display any of that. Later, re-write this section to make this easier to skip.
282
- if ( $type == 'calendar' && get_option('mc_open_uri') == 'true' && $time != 'day' ) $body_details = $description = $short = $status = '';
283
 
284
- $subdetails = ( get_option('mc_open_uri') == 'true' && $type == 'grid' || $type == 'mini' )?"":"<div class='sub-details'>$subdetails</div>";
285
- $body_details .= $subdetails;
 
 
286
  if ( $event_link != '' && get_option( 'mc_event_link' ) != 'false' ) {
287
  $is_external = mc_external_link( $event_link );
 
288
  $link_template = ( isset($templates['link']))?$templates['link']:'{title}';
289
  $link_text = jd_draw_template($data,$link_template);
290
- $details = "\n". $header_details . $container . $body_details . $description . $short . $status."<p><a href='$event_link' $is_external>".$link_text.'</a></p>'.$return;
291
- } else {
292
- $details = "\n". $header_details . $container . $body_details . $description . $short . $status . $return;
293
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
294
  } else {
295
- $toggle = ($type == 'calendar' || $type == 'mini' )?"<a href='#$uid-$day_id-$type' class='mc-toggle mc-close close'><img src='".plugin_dir_url(__FILE__)."images/event-close.png' alt='".__('Close','my-calendar')."' /></a>":'';
296
- $details = $header_details."\n<div id='$uid-$day_id-$type-details' class='details'>\n ".$toggle.$details."\n";
 
 
297
  }
 
 
 
 
 
 
 
 
 
 
 
298
  // create edit links
 
299
  if ( mc_can_edit_event( $event->event_author ) && get_option('mc_remote') != 'true' ) {
 
300
  $groupedit = ( $event->event_group_id != 0 )?" &bull; <a href='".admin_url("admin.php?page=my-calendar-groups&amp;mode=edit&amp;event_id=$event->event_id&amp;group_id=$event->event_group_id")."' class='group'>".__('Edit Group','my-calendar')."</a>\n":'';
301
  $recurs = str_split( $event->event_recur, 1 );
302
  $recur = $recurs[0];
303
- $every = ( isset($recurs[1]) )?$recurs[1]:1;
304
  $referer = urlencode( mc_get_current_url() );
 
305
  if ( $recur == 'S' ) {
306
- $edit = "
307
- <div class='mc_edit_links'>
308
- <p>
309
- <a href='".admin_url("admin.php?page=my-calendar&amp;mode=edit&amp;event_id=$event->event_id&amp;ref=$referer")."' class='edit'>".__('Edit','my-calendar')."</a> &bull; <a href='".admin_url("admin.php?page=my-calendar-manage&amp;mode=delete&amp;event_id=$event->event_id&amp;ref=$referer")."' class='delete'>".__('Delete','my-calendar')."</a>$groupedit
310
- </p>
311
- </div>";
312
  } else {
313
- $edit = "<div class='mc_edit_links'>
314
- <p>
315
- <a href='".admin_url("admin.php?page=my-calendar&amp;mode=edit&amp;event_id=$event->event_id&amp;date=$dateid&amp;ref=$referer")."' class='edit'>".__('Edit This Date','my-calendar')."</a> &bull; <a href='".admin_url("admin.php?page=my-calendar&amp;mode=edit&amp;event_id=$event->event_id&amp;ref=$referer")."' class='edit'>".__('Edit All','my-calendar')."</a> &bull; <a href='".admin_url("admin.php?page=my-calendar-manage&amp;mode=delete&amp;event_id=$event->event_id&amp;date=$dateid&amp;ref=$referer")."' class='delete'>".__('Delete This Date','my-calendar')."</a> &bull; <a href='".admin_url("admin.php?page=my-calendar-manage&amp;mode=delete&amp;event_id=$event->event_id&amp;ref=$referer")."' class='delete'>".__('Delete All','my-calendar')."</a>
316
- $groupedit
317
- </p>
318
- </div>";
319
  }
320
- } else {
321
- $edit = '';
322
  }
323
  if ( $type == 'calendar' && get_option('mc_open_uri') == 'true' && $time != 'day' ) { $edit = ''; }
324
- $details .= apply_filters( 'mc_details_append', '', $event, $type );
325
- $details .= $edit;
326
- $details .= apply_filters('mc_after_event','',$event);
327
- $details .= "</div><!--ends .details--></div>";
328
- $details = apply_filters('mc_event_content',$details,$event,$type);
329
-
330
- if ( get_option( 'mc_event_approve' ) == 'true' ) {
331
- if ( $event->event_approved == 1 ) {
332
- return $details;
333
- }
334
- } else {
335
- return $details;
336
- }
337
  }
338
 
339
  function mc_build_date_switcher( $type='calendar', $cid='all' ) {
@@ -403,9 +444,6 @@ $ltype=(isset($_GET['ltype']))?$_GET['ltype']:'';
403
  $lvalue=(isset($_GET['lvalue']))?$_GET['lvalue']:'';
404
  header('Content-Type: '.get_bloginfo('html_type').'; charset='.get_bloginfo('charset'));
405
  echo '<!DOCTYPE html>
406
- <!--[if IE 6]>
407
- <html id="ie6" dir="'.get_bloginfo('text_direction').'" lang="'.get_bloginfo('language').'">
408
- <![endif]-->
409
  <!--[if IE 7]>
410
  <html id="ie7" dir="'.get_bloginfo('text_direction').'" lang="'.get_bloginfo('language').'">
411
  <![endif]-->
@@ -421,22 +459,22 @@ echo '<!DOCTYPE html>
421
  <title>'.get_bloginfo('name').' - '.__('Calendar: Print View','my-calendar').'</title>
422
  <meta name="generator" content="My Calendar for WordPress" />
423
  <meta name="robots" content="noindex,nofollow" />';
424
- if ( mc_file_exists( 'mc-print.css' ) ) {
425
- $stylesheet = mc_get_file( 'mc-print.css', 'url' );
426
  } else {
427
- $stylesheet = $url."mc-print.css";
428
  }
429
  echo "
430
  <!-- Copy mc-print.css to your theme directory if you wish to replace the default print styles -->
431
  <link rel='stylesheet' href='$stylesheet' type='text/css' media='screen,print' />
432
  </head>
433
  <body>\n";
434
- echo my_calendar('print','calendar',$category,'','','','',$time,$ltype,$lvalue,'mc-print-view','','',null,null,'','');
435
  $return_url = ( get_option('mc_uri') != '' && !is_numeric( get_option('mc_uri') ) )?get_option('mc_uri'):home_url();
436
  $add = $_GET;
437
  unset( $add['cid'] );
438
  unset( $add['feed'] );
439
- $return_url = mc_build_url( $add, array('feed','cid'), $return_url );
440
  echo "<p class='return'><a href='$return_url'>".__('Return to site','my-calendar')."</a></p>";
441
  echo '
442
  </body>
@@ -464,28 +502,28 @@ function mc_format_toggle( $format, $toggle ) {
464
  return $toggle;
465
  }
466
 
467
- function mc_time_toggle( $format, $time, $toggle, $day, $month ) {
468
  if ( $format != 'mini' && $toggle == 'yes' ) {
469
  $toggle = "<div class='mc-time'>";
470
  $current_url = mc_get_current_url();
471
  switch ($time) {
472
  case 'week':
473
- $url = mc_build_url( array('time'=>'month'), array() );
474
  $toggle .= "<a href='$url'>".__('Month','my-calendar')."</a> ";
475
  $toggle .= __('Week','my-calendar');
476
- $url = mc_build_url( array( 'time'=>'day','dy'=>$day ), array('dy') );
477
  $toggle .= " <a href='$url'>".__('Day','my-calendar')."</a>";
478
  break;
479
  case 'day':
480
  $url = mc_build_url( array('time'=>'month'), array() );
481
  $toggle .= "<a href='$url'>".__('Month','my-calendar')."</a>";
482
- $url = mc_build_url( array('time'=>'week','dy'=>$day,'month'=>$month ), array('dy','month') );
483
  $toggle .= " <a href='$url'>".__('Week','my-calendar')."</a> ";
484
  $toggle .= __('Day','my-calendar');
485
  break;
486
  default:
487
  $toggle .= __('Month','my-calendar');
488
- $url = mc_build_url( array('time'=>'week','dy'=>$day,'month'=>$month ), array('dy','month') );
489
  $toggle .= " <a href='$url'>".__('Week','my-calendar')."</a> ";
490
  $url = mc_build_url( array('time'=>'day'), array() );
491
  $toggle .= "<a href='$url'>".__('Day','my-calendar')."</a>";
@@ -557,20 +595,19 @@ function mc_list_title( $events ) {
557
 
558
  function mc_search_results( $query ) {
559
  $limits = true;
560
- $output = '<h2>'.sprintf(__('Event search results for &ldquo;%1$s&rdquo;','my-calendar'), stripslashes($query) ).'</h2>';
561
  $before = apply_filters( 'mc_past_search_results', 0 );
562
  $after = apply_filters( 'mc_future_search_results', 10 ); // return only future events, nearest 10
563
- if ( is_string($query) ) {
564
  $select_category = $limit_string = $select_author = $select_host = '';
565
- $search = " MATCH(event_title,event_desc,event_short,event_label) AGAINST ('$query' IN BOOLEAN MODE) AND ";
566
  } else {
567
- extract($query);
568
- $select_category = ( $category!='default' )?mc_select_category($category):'';
569
  $limit_string = mc_limit_string();
570
- $select_author = ( $author != 'default' )?mc_select_author($author):'';
571
- $select_host = ( $host != 'default' )?mc_select_host($host):'';
572
- $prefix = ( $select_category . $limit_string . $select_author . $select_host != '' )?' AND':'';
573
- $search = "$prefix MATCH(event_title,event_desc,event_short,event_label) AGAINST ('$query' IN BOOLEAN MODE) AND ";
574
  }
575
  global $wpdb;
576
  $mcdb = $wpdb;
@@ -588,15 +625,13 @@ function mc_search_results( $query ) {
588
  ON (event_category=category_id) WHERE $select_category $select_author $select_host $limit_string $search event_approved = 1 AND event_flagged <> 1
589
  AND DATE(occur_begin) < '$date' ORDER BY occur_begin DESC LIMIT 0,$before");
590
  } else { $events1 = array(); }
591
-
592
- $events3 = $mcdb->get_results("SELECT *, UNIX_TIMESTAMP(occur_begin) AS ts_occur_begin, UNIX_TIMESTAMP(occur_end) AS ts_occur_end
593
- FROM " . MY_CALENDAR_EVENTS_TABLE . "
594
- JOIN " . MY_CALENDAR_TABLE . "
595
- ON (event_id=occur_event_id)
596
- JOIN " . MY_CALENDAR_CATEGORIES_TABLE . "
597
- ON (event_category=category_id) WHERE $select_category $select_author $select_host $limit_string $search event_approved = 1 AND event_flagged <> 1
598
- AND DATE(occur_begin) = '$date'");
599
-
600
  if ( $after > 0 ) {
601
  $after = $after + 5;
602
  $events2 = $mcdb->get_results("SELECT *, UNIX_TIMESTAMP(occur_begin) AS ts_occur_begin, UNIX_TIMESTAMP(occur_end) AS ts_occur_end
@@ -608,7 +643,7 @@ function mc_search_results( $query ) {
608
  AND DATE(occur_begin) > '$date' ORDER BY occur_begin ASC LIMIT 0,$after");
609
  } else { $events2 = array(); }
610
  $arr_events = array();
611
- if (!empty($events1) || !empty($events2) || !empty($events3) ) {
612
  $arr_events = array_merge( $events1, $events3, $events2);
613
  }
614
  if ( !get_option('mc_skip_holidays_category') || get_option('mc_skip_holidays_category') == '' ) {
@@ -627,22 +662,31 @@ function mc_search_results( $query ) {
627
  if ( !empty($event_array) ) {
628
  $template = '<strong>{date}</strong> {title} {details}';
629
  $template = apply_filters( 'mc_search_template', $template );
630
- $output .= mc_produce_upcoming_events( $event_array,$template,'list','ASC',0,$before, $after, 'yes' );
 
631
  } else {
632
- $output .= "<p class='no-results'>".__('Sorry, your search produced no results.','my-calendar')."</p>";
633
  }
634
- return $output;
635
  }
636
 
637
- add_filter( 'the_content','mc_show_search_results' );
 
 
 
 
 
 
 
638
 
 
639
  function mc_show_search_results( $content ) {
640
  // if this is the result of a search, show search output.
641
  $ret = false;
642
  if ( isset( $_GET['mcs'] ) ) { // simple search
643
  $ret = true;
644
  $query = $_GET['mcs'];
645
- } else if ( isset ($_POST['mcs']) ) { // advanced search
646
  $ret = true;
647
  $query = $_POST;
648
  }
@@ -653,25 +697,30 @@ function mc_show_search_results( $content ) {
653
  }
654
  }
655
 
 
 
 
 
 
 
 
 
 
656
  // Actually do the printing of the calendar
657
- function my_calendar( $name, $format, $category, $showkey, $shownav, $showjump, $toggle, $time='month', $ltype='', $lvalue='', $id='jd-calendar', $template='', $content='', $author=null, $host=null, $above='', $below='' ) {
658
  check_my_calendar();
659
  apply_filters("debug", "my_calendar( $name ) draw");
660
  $mc_toporder = array( 'nav','toggle','jump','print','timeframe' );
661
  $mc_bottomorder = array( 'key','feeds' );
662
  if ( $above != '' || $below != '' ) {
663
- $aboves = ( $above == 'none' )?array():explode(',',$above);
664
- $belows = ( $below == 'none' )?array():explode(',',$below);
665
  } else {
666
  $aboves = $mc_toporder;
667
  $belows = $mc_bottomorder;
668
  }
669
  $used = array_merge( $aboves, $belows );
670
- if ( $showkey.$shownav.$showjump.$toggle != '' && current_user_can( 'manage_options' ) && $format != 'mini' ) {
671
- $deprecated = "<p class='deprecated'>".__('<strong>Admin Notice:</strong> The <code>showkey</code>, <code>shownav</code>, <code>showjump</code>, and <code>toggle</code> shortcode attributes have been deprecated. Use <code>above</code> and <code>below</code> instead.','my-calendar')."</p>";
672
- } else {
673
- $deprecated = '';
674
- }
675
  if ( isset($_GET['time']) && in_array( $_GET['time'], array( 'day','week','month' ) ) && $format != 'mini' ) {
676
  $time = $_GET['time'];
677
  }
@@ -680,19 +729,17 @@ function my_calendar( $name, $format, $category, $showkey, $shownav, $showjump,
680
  $offset = (60*60*get_option('gmt_offset'));
681
 
682
  if ( get_option( 'mc_remote' ) == 'true' && function_exists('mc_remote_db') ) { $mcdb = mc_remote_db(); }
683
- $my_calendar_body = $deprecated;
684
  /* filter */
685
  if ( $time == 'day' ) { $format = 'list'; }
686
- $args = array( 'name'=>$name,'format'=>$format,'category'=>$category,'above'=>$above,'below'=>$below,'time'=>$time,'ltype'=>$ltype,'lvalue'=>$lvalue, 'author'=>$author );
687
  $my_calendar_body .= apply_filters('mc_before_calendar','',$args);
688
 
689
- //echo "<p>Debug:<br /><pre>".print_r( $args, 1 )."</pre></p>";
690
-
691
  $main_class = ( $name !='' )?sanitize_title($name):'all';
692
  $cid = ( isset( $_GET['cid'] ) )?esc_attr(strip_tags($_GET['cid'])):$main_class;
693
 
694
  // mc body wrapper
695
- $mc_wrapper = "<div id=\"$id\" class=\"mc-main $format $time $main_class\" aria-live='polite' aria-atomic='true'>";
696
  $mc_closer = "</div>";
697
 
698
  if ( get_option('mc_convert') == 'true' ) { $format = ( mc_is_mobile() )?'list':$format; }
@@ -756,17 +803,19 @@ function my_calendar( $name, $format, $category, $showkey, $shownav, $showjump,
756
  $c_month = (int) $_GET['month'];
757
  if ( !isset($_GET['dy']) ) { $c_day = 1; }
758
  } else {
759
- $xnow = date('Y-m-d',time()+($offset));
760
  $c_month = ($c_m == 0)?date("m",time()+($offset)):date("m",strtotime( $xnow.' -1 month'));
761
  }
762
-
 
763
  if ( isset($_GET['yr']) && $main_class == $cid ) {
764
  $c_year = (int) $_GET['yr'];
765
  } else {
766
- if ( $time == 'week' && date('j', current_time( 'timestamp' ) ) <= 6 && date('n', current_time( 'timestamp' ) ) == 1 ) {
767
- $c_year = ( date("Y",current_time( 'timestamp' ) ) )-1;
 
768
  } else {
769
- $c_year = date("Y",current_time( 'timestamp' ) );
770
  }
771
  }
772
  // Years get funny if we exceed 3000, so we use this check
@@ -782,17 +831,14 @@ function my_calendar( $name, $format, $category, $showkey, $shownav, $showjump,
782
  $c_day = apply_filters( 'mc_filter_day', $c_day, $args );
783
  }
784
  $c_day = ( $c_day == 0 )?1:$c_day; // c_day can't equal 0.
785
- // if today is June 15th, get current month = June. Get day of first of month = FRI. Based on start of week, get date of beginning of that week. = FROM
786
- // get last day of month = Sat. based on start of week, get date of END of that week. = TO
787
- // calculate again for next month and previous month.
788
- $n_month = ( $c_month + 1 > 12 )?1:$c_month+1;
789
- $p_month = ( $c_month - 1 < 1 )?12:$c_month-1;
790
  $current_date = mktime( 0,0,0,$c_month,$c_day,$c_year );
791
  $c_month = str_pad( $c_month, 2, '0', STR_PAD_LEFT );
792
  $n_month = str_pad( $n_month, 2, '0', STR_PAD_LEFT );
793
  $p_month = str_pad( $p_month, 2, '0', STR_PAD_LEFT );
794
  //echo "<p>Debug:<br />Day: $c_day<br />Month: $c_month<br />Year: $c_year<br />Date: ".date('Y-m-d',$current_date)."</p>";
795
- $num = get_option( 'mc_show_months' ) - 1; // the number set is how months to show; but this is how many *additional* months to show.
796
 
797
  if ( $format == "list" && $time != 'week' ) { // grid calendar can't show multiple months
798
  if ( $num > 0 && $time != 'day' && $time != 'week' ) {
@@ -804,48 +850,31 @@ function my_calendar( $name, $format, $category, $showkey, $shownav, $showjump,
804
  $from = date( 'Y-m-d',mktime(0,0,0,$c_month,1,$c_year) );
805
  $to = date( 'Y-m-d',mktime(0,0,0,$c_month,date( 't',mktime(0,0,0,$c_month,1,$c_year) ),$c_year) );
806
  }
807
- $this_dates = array( 'from'=>$from, 'to'=>$to );
808
  } else {
809
  $this_dates = mc_date_array( $current_date, $time, $num );
810
  }
811
  $from = $this_dates['from'];
812
  $to = $this_dates['to'];
813
  //echo "<pre>$num $from, $to ($c_month,$c_day,$c_year)</pre>";
814
-
815
- $events = my_calendar_grab_events( $from, $to, $category, $ltype, $lvalue,'calendar',$author );
816
- if ( !get_option('mc_skip_holidays_category') || get_option('mc_skip_holidays_category') == '' ) {
817
- $holidays = array();
818
- } else {
819
- $holidays = my_calendar_grab_events( $from, $to, get_option('mc_skip_holidays_category'),$ltype, $lvalue, 'calendar', $author );
820
- $holiday_array = mc_set_date_array( $holidays );
821
- }
822
- // get events into an easily parseable set, keyed by date.
823
- if ( is_array( $events ) && !empty($events) ) {
824
- $no_events = false;
825
- $event_array = mc_set_date_array( $events );
826
- if ( is_array( $holidays ) && count($holidays) > 0 ) {
827
- $event_array = mc_holiday_limit( $event_array, $holiday_array ); // if there are holidays, rejigger.
828
- }
829
- } else {
830
- $no_events = true;
831
- }
832
- // if convert to strings, can iterate using for with +86400 to get each day.
833
- // if use strtotime can do +1 day to get each date.
834
-
835
  // setup print link
836
  $add = array( 'time'=>$time,'ltype'=>$ltype,'lvalue'=>$lvalue,'mcat'=>$category,'yr'=>$c_year,'month'=>$c_month,'dy'=>$c_day, 'cid'=>'print' );
837
  $subtract = array();
838
  if ( $ltype == '' ) { $subtract[] = 'ltype'; unset( $add['ltype'] ); }
839
- if ( $lvalue == '' ) { $subtract[] = 'lvalue'; unset( $add['lvalue'] ); }
840
- if ( $category == 'all' ) { $subtract[] = 'mcat'; unset( $add['mcat'] ); }
841
  $mc_print_url = mc_build_url( $add, $subtract, mc_feed_base() . 'my-calendar-print' );
842
  $print = "<div class='mc-print'><a href='$mc_print_url'>".__('Print View','my-calendar')."</a></div>";
843
  // set up format toggle
844
- if ( $toggle == 'yes' || in_array( 'toggle', $used ) ) {
845
- $toggle = mc_format_toggle( $format, 'yes' );
846
- } else {
847
- $toggle = '';
848
- }
849
  // set up time toggle
850
  if ( in_array( 'timeframe', $used ) ) {
851
  // if dy parameter not set, use today's date instead of first day of month.
@@ -855,27 +884,17 @@ function my_calendar( $name, $format, $category, $showkey, $shownav, $showjump,
855
  $weeks_day = first_day_of_week( current_time( 'timestamp' ) );
856
  }
857
  $day = $weeks_day[0];
858
- $month = ( $c_month > 1 )?$c_month + $weeks_day[1]:12;
859
- $timeframe = mc_time_toggle( $format, $time, 'yes', $day, $month );
860
- } else {
861
- $timeframe = '';
862
- }
 
 
863
  // set up category key
864
- if ( $showkey == 'yes' || in_array( 'key', $used ) ) {
865
- $key = my_category_key( $category );
866
- } else {
867
- $key = '';
868
- }
869
- // set up rss feeds
870
- if ($format != 'mini') {
871
- $ical_m = (isset($_GET['month']))?(int) $_GET['month']:date('n');
872
- $ical_y = (isset($_GET['yr']))?(int) $_GET['yr']:date('Y');
873
- $feeds = mc_rss_links($ical_y,$ical_m);
874
- } else {
875
- $feeds = '';
876
- }
877
  // set up navigation links
878
- if ( $shownav == 'yes' || in_array( 'nav', $used ) ) {
879
  $pLink = my_calendar_prev_link($c_year,$c_month,$c_day,$format,$time);
880
  $nLink = my_calendar_next_link($c_year,$c_month,$c_day,$format,$time);
881
  $prevLink = mc_build_url( array( 'yr'=>$pLink['yr'],'month'=>$pLink['month'],'dy'=>$pLink['day'],'cid'=>$main_class ),array() );
@@ -889,21 +908,20 @@ function my_calendar( $name, $format, $category, $showkey, $shownav, $showjump,
889
  '.$next_link.'
890
  </ul>
891
  </div>';
892
- } else {
893
- $nav = '';
894
- }
 
 
 
 
895
  // set up date switcher
896
- $showjump = ( $showjump == 'yes' )?'yes':get_option('mc_display_jump');
897
- $showjump = ( $showjump == 'true' )?'yes':$showjump;
898
- if ( $showjump == 'yes' || in_array( 'jump', $used ) ) {
899
  $jump = ( $time != 'week' && $time != 'day' )?mc_build_date_switcher( $format, $main_class ):'';
900
- } else {
901
- $jump = '';
902
- }
903
  // set up above-calendar order of fields
904
  if ( get_option('mc_topnav') != '' ) { $mc_toporder = explode( ',', get_option('mc_topnav') ); }
905
  if ( $above != '' ) { $mc_toporder = explode( ',', $above ); }
906
- $mc_topnav = '';
907
  foreach ( $mc_toporder as $value ) {
908
  if ( $value != 'none' ) {
909
  $value = trim($value);
@@ -914,9 +932,8 @@ function my_calendar( $name, $format, $category, $showkey, $shownav, $showjump,
914
 
915
  if ( get_option('mc_bottomnav') != '' ) { $mc_bottomorder = explode( ',', get_option('mc_bottomnav') ); }
916
  if ( $below != '' ) { $mc_bottomorder = explode( ',', $below ); }
917
- $mc_bottomnav = '';
918
  foreach ( $mc_bottomorder as $value ) {
919
- if ( $value != 'none' ) {
920
  $value = trim($value);
921
  $mc_bottomnav .= ${$value};
922
  }
@@ -924,9 +941,11 @@ function my_calendar( $name, $format, $category, $showkey, $shownav, $showjump,
924
  if ( $mc_bottomnav != '' ) { $mc_bottomnav = "<div class='mc_bottomnav'>$mc_bottomnav</div>"; }
925
 
926
  if ( $time == 'day' ) {
 
 
927
  $my_calendar_body .= "<div class='mc-main $format $time'>".$mc_topnav;
928
  // single day uses independent cycling.
929
- $dayclass = strtolower(date_i18n('D',mktime (0,0,0,$c_month,$c_day,$c_year)));
930
  $from = $to = "$c_year-$c_month-$c_day";
931
  //echo "<p>Debug: $from, $to, $category, $ltype, $lvalue, $author</p>";
932
  $events = my_calendar_grab_events($from,$to,$category,$ltype,$lvalue,'calendar',$author);
@@ -947,12 +966,15 @@ function my_calendar( $name, $format, $category, $showkey, $shownav, $showjump,
947
  }
948
  } else {
949
  $mc_events .= __( 'No events scheduled for today!','my-calendar');
950
- }
 
951
  $my_calendar_body .= "
952
- <h3 class='mc-single'>".date_i18n( $date_format,strtotime("$c_year-$c_month-$c_day")).'</h3>
953
  <div id="mc-day" class="'.$dayclass.' '.$dateclass.' '.$events_class.'">'."$mc_events\n</div>
954
  </div>";
 
955
  } else {
 
956
  // if showing multiple months, figure out how far we're going.
957
  $num_months = ($time == 'week')?1:get_option('mc_show_months');
958
  $through_date = mktime(0,0,0,$c_month+($num_months-1),$c_day,$c_year);
@@ -970,7 +992,8 @@ function my_calendar( $name, $format, $category, $showkey, $shownav, $showjump,
970
  if ($format == "calendar" || $format == "mini" ) {
971
  $my_calendar_body .= "\n<table class=\"my-calendar-table\">\n";
972
  $values = array( 'date'=>date('Y-m-d',$current_date) );
973
- $week_caption = jd_draw_template( $values, stripslashes(get_option('mc_week_caption')) );
 
974
  $caption_heading = ($time != 'week')?$current_date_header.$caption_text:$week_caption.$caption_text;
975
  $my_calendar_body .= "<caption class=\"my-calendar-$time\">".$caption_heading."</caption>\n";
976
  } else {
@@ -981,7 +1004,7 @@ function my_calendar( $name, $format, $category, $showkey, $shownav, $showjump,
981
  $values = array( 'date'=>date('Y-m-d',$current_date) );
982
  $list_heading = jd_draw_template( $values, stripslashes(get_option('mc_week_caption')) );
983
  }
984
- $my_calendar_body .= "<h3 class=\"my-calendar-$time\">$list_heading</h3>\n";
985
  }
986
  // If in a calendar format, print the headings of the days of the week
987
  if ( $format == "calendar" || $format == "mini" || $format == "list" ) {
@@ -1004,10 +1027,10 @@ function my_calendar( $name, $format, $category, $showkey, $shownav, $showjump,
1004
  $my_calendar_body .= "\n</tr>\n</thead>\n<tbody>";
1005
  }
1006
  $odd = 'odd';
1007
- // get and display all the events
1008
  $show_all = false; // show all dates in list format.
1009
  if ( $no_events && $format == "list" && $show_all == false ) {
1010
- // if there are no events in list format, just display that info.
1011
  $no_events = ( $content == '' )?__('There are no events scheduled during this period.','my-calendar'):$content;
1012
  $my_calendar_body .= "<li class='no-events'>$no_events</li>";
1013
  } else {
@@ -1029,8 +1052,8 @@ function my_calendar( $name, $format, $category, $showkey, $shownav, $showjump,
1029
  $week_date_format = date_i18n( $week_format,$start );
1030
  $thisday_heading = ($time == 'week')?"<small>$week_date_format</small>":date( 'j',$start );
1031
  $events = ( isset( $event_array[$date] ) )?$event_array[$date]:array();
1032
- if ( !empty($events) ) {
1033
- $event_output = my_calendar_draw_events($events, $format, $date, $time, $template, $holidays);
1034
  if ( $event_output === true ) { $event_output = ' '; }
1035
  $events_class = ( $event_output != '' )?mc_events_class($events):'no-events';
1036
  if ($format == 'mini' && $event_output != '' ) {
@@ -1038,13 +1061,13 @@ function my_calendar( $name, $format, $category, $showkey, $shownav, $showjump,
1038
  // yes, this is weird. it's from some old settings...
1039
  $target = array('yr'=>date('Y',$start),'month'=>date('m',$start),'dy'=>date( 'j',$start ),'time'=>'day' );
1040
  if ( $category != '' ) { $target['mcat'] = $category; }
1041
- $day_url = mc_build_url( $target, array('month','dy','yr','ltype','loc','mcat','cid'), apply_filters ( 'mc_modify_day_uri', get_option( 'mc_uri' ) ) );
1042
  $link = ( get_option('mc_uri') != '' && !is_numeric( get_option('mc_uri') ) )?$day_url:'#';
1043
  } else {
1044
  $atype = str_replace( 'anchor','',get_option('mc_open_day_uri') );
1045
  $ad = str_pad( date( 'j',$start ), 2, '0', STR_PAD_LEFT ); // need to match format in ID
1046
  $am = str_pad( $c_month, 2, '0', STR_PAD_LEFT );
1047
- $date_url = mc_build_url( array('yr'=>$c_year,'month'=>$c_month,'dy'=>date( 'j',$start ) ), array('month','dy','yr','ltype','loc','mcat','cid'), get_option( 'mc_mini_uri' ) );
1048
  $link = ( get_option('mc_mini_uri') != '' ) ?$date_url.'#'.$atype.'-'.$c_year.'-'.$am.'-'.$ad:'#';
1049
  }
1050
  $element = "a href='$link'";
@@ -1059,7 +1082,7 @@ function my_calendar( $name, $format, $category, $showkey, $shownav, $showjump,
1059
  if ( ( $is_weekend && get_option('mc_show_weekends') == 'true' ) || !$is_weekend ) {
1060
  $weekend_class = ( $is_weekend )?'weekend':'';
1061
  if ( $format == "list" ) {
1062
- if ( get_option('list_javascript') != 1) {
1063
  $is_anchor = "<a href='#'>";
1064
  $is_close_anchor = "</a>";
1065
  } else {
@@ -1069,12 +1092,12 @@ function my_calendar( $name, $format, $category, $showkey, $shownav, $showjump,
1069
  $title = ' - '.$is_anchor . mc_list_title($events) . $is_close_anchor;
1070
  } else {
1071
  $title = '';
1072
- }
1073
  //if ( $monthclass != 'nextmonth' ) { // only show current month in list view.
1074
  if ( $event_output != '' ) {
1075
  $my_calendar_body .= "
1076
  <li id='$format-$date' class='mc-events $dayclass $dateclass $events_class $odd'>
1077
- <strong class=\"event-date\">$is_anchor".date_i18n( $date_format, $start )."$is_close_anchor"."$title</strong>".
1078
  $event_output."
1079
  </li>";
1080
  $odd = ( $odd == 'odd' )?'even':'odd';
@@ -1085,7 +1108,7 @@ function my_calendar( $name, $format, $category, $showkey, $shownav, $showjump,
1085
  <td id='$format-$date' class='$dayclass $dateclass $weekend_class $monthclass $events_class day-with-date'>"."
1086
  <$element class='mc-date $trigger'>$thisday_heading</$close>".
1087
  $event_output."
1088
- </td>\n";
1089
  }
1090
  }
1091
  } else {
@@ -1112,19 +1135,20 @@ function my_calendar( $name, $format, $category, $showkey, $shownav, $showjump,
1112
  }
1113
  $start = strtotime( "+1 day",$start );
1114
 
1115
- } while ( $start <= $end );
1116
  }
1117
  $my_calendar_body .= ( $format == "list" )?"\n</ul>":"\n</tbody>\n</table>";
1118
  } else {
1119
  $my_calendar_body .= __("Unrecognized calendar format. Please use one of 'list','calendar', or 'mini'.",'my-calendar')." '<code>$format</code>.'";
1120
  }
1121
  $my_calendar_body .= $mc_bottomnav;
 
1122
  }
1123
  }
1124
  // The actual printing is done by the shortcode function.
1125
- $my_calendar_body .= apply_filters('mc_after_calendar','',$args);
1126
  apply_filters("debug", "my_calendar( $name ) draw completed");
1127
- return $mc_wrapper . $my_calendar_body . $mc_closer;
1128
  }
1129
 
1130
  function my_category_key( $category ) {
@@ -1139,35 +1163,40 @@ if ( get_option( 'mc_remote' ) == 'true' && function_exists('mc_remote_db') ) {
1139
  $sql = "SELECT * FROM " . MY_CALENDAR_CATEGORIES_TABLE . " $cat_limit ORDER BY category_name ASC";
1140
  $cat_details = $mcdb->get_results($sql);
1141
  $category_key .= '<div class="category-key">
1142
- <h3>'.__('Category Key','my-calendar')."</h3>\n<ul>\n";
1143
- $subpath = (is_custom_icon())?'my-calendar-custom/':'my-calendar/icons/';
1144
  $path = str_replace( basename( $dir ) . '/','',$url) . $subpath;
1145
  foreach($cat_details as $cat_detail) {
1146
  $hex = ( strpos( $cat_detail->category_color,'#' ) !== 0 )?'#':'';
1147
  $title_class = sanitize_title($cat_detail->category_name);
1148
  if ( $cat_detail->category_private == 1 ) { $title_class .= " private"; }
 
1149
  if ($cat_detail->category_icon != "" && get_option('mc_hide_icons')!='true') {
1150
- $category_key .= '<li class="cat_'.$title_class.'"><span class="category-color-sample"><img src="'.$path.$cat_detail->category_icon.'" alt="" style="background:'.$hex.$cat_detail->category_color.';" /></span>'.stripcslashes($cat_detail->category_name)."</li>\n";
1151
  } else {
1152
- $category_key .= '<li class="cat_'.$title_class.'"><span class="category-color-sample no-icon" style="background:'.$hex.$cat_detail->category_color.';"> &nbsp; </span>'.stripcslashes($cat_detail->category_name)."</li>\n";
1153
  }
1154
  }
 
 
 
1155
  $category_key .= "</ul>\n</div>";
1156
  $category_key = apply_filters('mc_category_key',$category_key,$cat_details);
1157
  return $category_key;
1158
  }
1159
 
1160
- function mc_rss_links($y,$m) {
1161
- global $wp_rewrite;
1162
  $feed = mc_feed_base().'my-calendar-rss';
1163
- $ics_extend = ( $wp_rewrite->using_permalinks() )?"my-calendar-ics/?yr=$y&amp;month=$m":"my-calendar-ics&amp;yr=$y&amp;month=$m";
 
1164
  $ics = mc_feed_base(). $ics_extend;
1165
- $rss = " <li class='rss'><a href='".$feed."'>".__('Subscribe by <abbr title="Really Simple Syndication">RSS</abbr>','my-calendar')."</a></li>";
1166
- $ical = " <li class='ics'><a href='".$ics."'>".__('Download as <abbr title="iCal Events Export">iCal</abbr>','my-calendar')."</a></li>";
1167
  $output = "\n
1168
- <ul id='mc-export'>$rss
1169
- $ical
1170
- </ul>\n";
1171
  return $output;
1172
  }
1173
 
@@ -1186,7 +1215,7 @@ function mc_feed_base() {
1186
  // Configure the "Next" link in the calendar
1187
  function my_calendar_next_link($cur_year,$cur_month,$cur_day,$format,$time='month') {
1188
  $next_year = $cur_year + 1;
1189
- $next_events = ( get_option( 'mc_next_events') == '' )?__("Next events &raquo;",'my-calendar'):stripcslashes( get_option( 'mc_next_events') );
1190
  $num_months = get_option('mc_show_months');
1191
  $nYr = $cur_year;
1192
  if ($num_months <= 1 || $format != "list" ) {
@@ -1197,11 +1226,11 @@ function my_calendar_next_link($cur_year,$cur_month,$cur_day,$format,$time='mont
1197
  }
1198
  } else {
1199
  $next_month = (($cur_month + $num_months) > 12)?(($cur_month + $num_months) - 12):($cur_month + $num_months);
1200
- if ($cur_month >= (13-$num_months)) {
1201
- $nMonth = $next_month;$nYr = $next_year;
1202
  } else {
1203
  $nMonth = $next_month;$nYr = $cur_year;
1204
- }
1205
  }
1206
  $nDay = '';
1207
  if ( $nYr != $cur_year ) { $format = 'F, Y'; } else { $format = 'F'; }
@@ -1211,8 +1240,8 @@ function my_calendar_next_link($cur_year,$cur_month,$cur_day,$format,$time='mont
1211
  $nDay = date('d',$nextdate);
1212
  $nYr = date('Y',$nextdate);
1213
  $nMonth = date('m',$nextdate);
1214
- if ( $nYr != $cur_year ) { $format = 'F j, Y'; } else { $format = 'F j'; }
1215
- $date = __('Week of ','my-calendar').date_i18n($format,mktime( 0,0,0,$nMonth,$nDay,$nYr ) );
1216
  }
1217
  if ( $time == 'day' ) {
1218
  $nextdate = strtotime( "$cur_year-$cur_month-$cur_day"."+ 1 days" );
@@ -1222,7 +1251,7 @@ function my_calendar_next_link($cur_year,$cur_month,$cur_day,$format,$time='mont
1222
  if ( $nYr != $cur_year ) { $format = 'F j, Y'; } else { $format = 'F j'; }
1223
  $date = date_i18n($format,mktime( 0,0,0,$nMonth,$nDay,$nYr ) );
1224
  }
1225
- $next_events = str_replace( '{date}', $date, $next_events );
1226
  $output = array('month'=>$nMonth,'yr'=>$nYr,'day'=>$nDay,'label'=>$next_events);
1227
  return $output;
1228
  }
@@ -1230,7 +1259,7 @@ function my_calendar_next_link($cur_year,$cur_month,$cur_day,$format,$time='mont
1230
  // Configure the "Previous" link in the calendar
1231
  function my_calendar_prev_link($cur_year,$cur_month,$cur_day,$format,$time='month') {
1232
  $last_year = $cur_year - 1;
1233
- $previous_events = ( get_option( 'mc_previous_events') == '' )?__("&laquo; Previous events",'my-calendar'):stripcslashes( get_option( 'mc_previous_events') );
1234
  $num_months = get_option('mc_show_months');
1235
  $pYr = $cur_year;
1236
  if ($num_months <= 1 || $format!="list" ) {
@@ -1255,7 +1284,7 @@ function my_calendar_prev_link($cur_year,$cur_month,$cur_day,$format,$time='mont
1255
  $pDay = date('d',$prevdate);
1256
  $pYr = date('Y',$prevdate);
1257
  $pMonth = date('m',$prevdate);
1258
- if ( $pYr != $cur_year ) { $format = 'F j, Y'; } else { $format = 'F j'; }
1259
  $date = __('Week of ','my-calendar').date_i18n($format,mktime( 0,0,0,$pMonth,$pDay,$pYr ) );
1260
  }
1261
  if ( $time == 'day' ) {
@@ -1263,28 +1292,61 @@ function my_calendar_prev_link($cur_year,$cur_month,$cur_day,$format,$time='mont
1263
  $pDay = date('d',$prevdate);
1264
  $pYr = date('Y',$prevdate);
1265
  $pMonth = date('m',$prevdate);
1266
- if ( $pYr != $cur_year ) { $format = 'F j, Y'; } else { $format = 'F j'; }
1267
  $date = date_i18n($format,mktime( 0,0,0,$pMonth,$pDay,$pYr ) );
1268
  }
1269
- $previous_events = str_replace( '{date}', $date, $previous_events );
1270
  $output = array( 'month'=>$pMonth,'yr'=>$pYr,'day'=>$pDay,'label'=>$previous_events );
1271
  return $output;
1272
  }
1273
 
1274
- function my_calendar_categories_list($show='list',$context='public') {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1275
  global $wpdb;
1276
  $mcdb = $wpdb;
1277
  if ( get_option( 'mc_remote' ) == 'true' && function_exists('mc_remote_db') ) { $mcdb = mc_remote_db(); }
1278
- if ( isset($_GET['mc_id']) ) {
1279
- return;
1280
- }
1281
  $output = '';
1282
  $current_url = mc_get_current_url();
1283
 
1284
- $admin_fields = ($context == 'public')?' ':' multiple="multiple" size="5" ';
 
1285
  $admin_label = ($context == 'public')?'':__('(select to include)','my-calendar');
1286
- $form = "<form action='".$current_url."' method='get'>
1287
- <div>";
 
1288
  $qsa = array();
1289
  parse_str($_SERVER['QUERY_STRING'],$qsa);
1290
  if ( !isset( $_GET['cid'] ) ) { $form .= '<input type="hidden" name="cid" value="all" />'; }
@@ -1295,59 +1357,114 @@ function my_calendar_categories_list($show='list',$context='public') {
1295
  $form .= ' <input type="hidden" name="'.$name.'" value="'.$argument.'" />'."\n";
1296
  }
1297
  }
1298
- $form .= ($show == 'list')?'':'
 
1299
  </div><p>';
1300
  $public_form = ($context == 'public')?$form:'';
1301
- $name = ($context == 'public')?'mcat':'category';
1302
 
1303
- $categories = $mcdb->get_results("SELECT * FROM " . MY_CALENDAR_CATEGORIES_TABLE . " ORDER BY category_id ASC");
1304
- if ( !empty($categories) && count($categories)>=1 ) {
1305
  $output = "<div id='mc_categories'>\n";
1306
- $url = mc_build_url( array('mcat'=>'all'),array() );
1307
  $output .= ($show == 'list')?"
1308
  <ul>
1309
  <li><a href='$url'>".__('All Categories','my-calendar')."</a></li>":$public_form.'
1310
- <label for="category">'.__('Categories','my-calendar').' '.$admin_label.'</label>
1311
- <select'.$admin_fields.'name="'.$name.'" id="category">
1312
  <option value="all" selected="selected">'.__('All Categories','my-calendar').'</option>'."\n";
1313
 
1314
  foreach ($categories as $category) {
1315
  $category_name = stripcslashes($category->category_name);
1316
- if ( empty($_GET['mcat']) ) {
1317
- $mcat = '';
1318
- } else {
1319
- $mcat = (int) $_GET['mcat'];
1320
- }
1321
  if ($show == 'list') {
1322
- $this_url = mc_build_url( array('mcat'=>$category->category_id ),array() );
1323
- $selected = ($category->category_id == $mcat )?' class="selected"':'';
1324
- $output .= " <li$selected><a rel='nofollow' href='$this_url'>$category_name</a></li>";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1325
  } else {
1326
- $selected = ($category->category_id == $mcat )?' selected="selected"':'';
1327
- $output .= " <option$selected value='$category->category_id'>$category_name</option>\n";
1328
  }
1329
  }
1330
  $output .= ($show == 'list')?'</ul>':'</select>';
1331
- $output .= ($context != 'admin' && $show != 'list')?"<input type='submit' value=".__('Submit','my-calendar')." /></p></form>":'';
1332
  $output .= "\n</div>";
1333
  }
1334
- $output = apply_filters('mc_category_selector',$output,$categories);
1335
  return $output;
1336
  }
 
1337
  // array $add == keys and values to add
1338
  // array $subtract == keys to subtract
1339
-
1340
  function mc_build_url( $add, $subtract, $root='' ) {
1341
- global $wp_rewrite;
1342
- $home = '';
1343
  if ( $root != '' ) { $home = $root; }
1344
  if ( is_numeric( $root ) ) { $home = get_permalink( $root ); }
1345
  if ( $home == '' ) {
1346
  if ( is_front_page() ) {
1347
- $home = get_bloginfo('url') . '/';
1348
  } else if ( is_home() ) {
1349
  $page = get_option('page_for_posts');
1350
- $home = get_permalink( $page );
1351
  } else if ( is_archive() ) {
1352
  $home = ''; // an empty string seems to work best; leaving it open.
1353
  } else {
@@ -1356,44 +1473,37 @@ $home = '';
1356
  }
1357
  }
1358
  $variables = $_GET;
1359
- foreach($subtract as $value) {
1360
- unset($variables[$value]);
 
1361
  }
1362
- foreach ($add as $key=>$value) {
1363
  $variables[$key] = $value;
1364
  }
1365
- unset($variables['page_id']);
1366
  if ( $root == '' ) {
1367
  // root is set to empty when I want to reference the current location
1368
  $char = ( $wp_rewrite->using_permalinks() || is_front_page() || is_archive() )?'?':'&amp;';
1369
  } else {
1370
  $char = ( $wp_rewrite->using_permalinks() )?'?':'&amp;'; // this doesn't work -- may *never* need to be &. Consider
1371
  }
1372
- return $home.$char.http_build_query($variables, '', '&amp;');
1373
  }
1374
 
1375
- function my_calendar_show_locations($show='list',$datatype='name',$template='') {
1376
  global $wpdb;
1377
  $mcdb = $wpdb;
1378
- if ( get_option( 'mc_remote' ) == 'true' && function_exists('mc_remote_db') ) { $mcdb = mc_remote_db(); }
1379
- switch ( $datatype ) {
1380
- case "name":$data = "location_label";
1381
- break;
1382
- case "city":$data = "location_city";
1383
- break;
1384
- case "state":$data = "location_state";
1385
- break;
1386
- case "zip":$data = "location_postcode";
1387
- break;
1388
- case "country":$data = "location_country";
1389
- break;
1390
- case "hcard":$data = "location_label";
1391
- break;
1392
- case "region":$data = "location_region";
1393
- break;
1394
- default:$data = "location_label";
1395
- break;
1396
- }
1397
  $locations = $mcdb->get_results("SELECT DISTINCT * FROM " . MY_CALENDAR_LOCATIONS_TABLE . " ORDER BY $data ASC" );
1398
  if ( $locations ) {
1399
  $output = "<ul class='mc-locations'>";
@@ -1428,46 +1538,38 @@ function my_calendar_show_locations($show='list',$datatype='name',$template='')
1428
  function my_calendar_searchform($type) {
1429
  $query = ( isset($_GET['mcs']) )?esc_attr($_GET['mcs']):'';
1430
  if ( $type == 'simple' ) {
1431
- return '
1432
- <form role="search" method="get" id="mcsearchform" action="'.home_url().'" >
1433
- <div><label class="screen-reader-text" for="mcs">'.__('Search Events','my-calendar').'</label>
1434
- <input type="text" value="'.stripslashes($query).'" name="mcs" id="mcs" />
1435
- <input type="submit" id="searchsubmit" value="'.__('Search Events','my-calendar').'" />
1436
- </div>
1437
- </form>';
 
1438
  }
1439
  }
1440
 
1441
- function my_calendar_locations_list($show='list',$type='saved',$datatype='name') {
1442
  global $wpdb;
1443
  $mcdb = $wpdb;
1444
  if ( get_option( 'mc_remote' ) == 'true' && function_exists('mc_remote_db') ) { $mcdb = mc_remote_db(); }
1445
  $output = '';
1446
- if ( isset( $_GET['mc_id'] ) ) {
1447
- return;
1448
- }
1449
  if ( $type == 'saved' ) {
1450
  switch ( $datatype ) {
1451
- case "name":$data = "location_label";
1452
- break;
1453
- case "city":$data = "location_city";
1454
- break;
1455
- case "state":$data = "location_state";
1456
- break;
1457
- case "zip":$data = "location_postcode";
1458
- break;
1459
- case "country":$data = "location_country";
1460
- break;
1461
- case "region":$data = "location_region";
1462
- break;
1463
  default:$data = "location_label";
1464
- break;
1465
  }
1466
  } else {
1467
  $data = $datatype;
1468
  }
1469
  $current_url = mc_get_current_url();
1470
- if ($type == 'saved') {
1471
  $locations = $mcdb->get_results("SELECT DISTINCT $data FROM " . MY_CALENDAR_LOCATIONS_TABLE . " ORDER BY $data ASC", ARRAY_A );
1472
  } else {
1473
  $data = get_option( 'mc_user_settings' );
@@ -1476,30 +1578,32 @@ global $wpdb;
1476
  $datatype = ($datatype=='label')?'name':$datatype;
1477
  $datatype = ($datatype=='postcode')?'zip':$datatype;
1478
  }
1479
- if ( count($locations) > 1 ) {
1480
- if ($show == 'list') {
1481
  $url = mc_build_url( array('loc'=>'all','ltype'=>'all'),array() );
1482
  $output .= "<ul id='mc-locations-list'>
1483
  <li><a href='$url'>".__('Show all','my-calendar')."</a></li>\n";
1484
  } else {
1485
- $ltype = (!isset($_GET['ltype']))?$datatype:$_GET['ltype'];
1486
- $output .= "
1487
- <div id='mc_locations'>
1488
  <form action='".$current_url."' method='get'>
1489
- <div>
1490
- <input type='hidden' name='ltype' value='$ltype' />";
 
1491
  $qsa = array();
1492
  parse_str($_SERVER['QUERY_STRING'],$qsa);
1493
- if ( !isset( $_GET['cid'] ) ) { $output .= '<input type="hidden" name="cid" value="all" />'; }
1494
- foreach ($qsa as $name => $argument) {
1495
- $name = esc_attr(strip_tags($name));
1496
- $argument = esc_attr(strip_tags($argument));
1497
- if ($name != 'loc' && $name != 'ltype') {
1498
- $output .= "\n ".'<input type="hidden" name="'.$name.'" value="'.$argument.'" />';
1499
- }
1500
  }
 
1501
  $output .= "
1502
- <label for='mc-locations-list'>".__('Show events in:','my-calendar')."</label>
1503
  <select name='loc' id='mc-locations-list'>
1504
  <option value='all'>".__('Show all','my-calendar')."</option>\n";
1505
  }
@@ -1508,6 +1612,7 @@ global $wpdb;
1508
  foreach ( $location as $key=>$value ) {
1509
  $vt = urlencode(trim($value));
1510
  $value = stripcslashes($value);
 
1511
  if ( empty($_GET['loc']) ) {
1512
  $loc = '';
1513
  } else {
@@ -1516,33 +1621,37 @@ global $wpdb;
1516
  if ($show == 'list') {
1517
  $selected = ( $vt == $loc )?" class='selected'":'';
1518
  $this_url = mc_build_url( array('loc'=>$vt,'ltype'=>$datatype),array() );
1519
- $output .= " <li$selected><a rel='nofollow' href='$this_url'>$value</a></li>\n";
1520
  } else {
1521
  $selected = ( $vt == $loc )?" selected='selected'":'';
1522
- $output .= " <option value='$vt'$selected>$value</option>\n";
 
 
1523
  }
1524
  }
1525
  } else {
1526
  $vk = urlencode(trim($key));
1527
  $location = trim($location);
 
1528
  if ($show == 'list') {
1529
  $selected = ($vk == $_GET['loc'])?" class='selected'":'';
1530
  $this_url = mc_build_url( array('loc'=>$vk,'ltype'=>$datatype),array() );
1531
- $output .= " <li$selected><a rel='nofollow' href='$this_url'>$location</a></li>\n";
1532
  } else {
1533
- $selected = ($vk == $_GET['loc'])?" selected='selected'":'';
1534
- $output .= " <option value='$vk'$selected>$location</option>\n";
1535
- }
1536
  }
1537
  }
1538
  if ($show == 'list') {
1539
  $output .= "</ul>";
1540
  } else {
1541
- $output .= " </select>
1542
- <input type='submit' value=".__('Submit','my-calendar')." />
1543
- </div>
1544
- </form>
1545
- </div>";
 
1546
  }
1547
  $output = apply_filters('mc_location_selector',$output,$locations);
1548
  return $output;
37
  }
38
 
39
  function my_calendar_draw_events($events, $type, $process_date, $time, $template='') {
40
+ apply_filters( 'debug', "my_calendar( $type ) begin draw events" );
41
+
42
  if ( $type == 'mini' && ( get_option('mc_open_day_uri') == 'true' || get_option('mc_open_day_uri') == 'listanchor' || get_option('mc_open_day_uri') == 'calendaranchor' ) ) return true;
43
  // We need to sort arrays of objects by time
44
  if ( is_array($events) ) {
49
  }
50
  // By default, skip no events.
51
  $skipping = false;
52
+ foreach( array_keys( $events ) as $key ) {
53
  $event =& $events[$key];
54
  $output_array[] = my_calendar_draw_event( $event,$type,$process_date,$time,$template );
55
  }
56
+ if ( is_array( $output_array ) ) {
57
+ foreach( array_keys( $output_array ) as $key ) {
58
  $value =& $output_array[$key];
59
  $event_output .= $value;
60
  }
61
  }
62
  if ( $event_output == '' ) { return; }
63
+ if ( $type == "mini" && count( $events ) > 0 ) { $end .= "</div>"; }
64
  return $begin . $event_output . $end;
65
  }
66
+ apply_filters( "debug", "my_calendar( $name ) end draw events" );
67
+
68
+ }
69
+
70
+ function mc_get_template( $template ) {
71
+ $templates = get_option('mc_templates');
72
+ $template = $templates[$template];
73
+ return $template;
74
+ }
75
+
76
+ function mc_time_html( $event, $type, $current_date ) {
77
+ $id_start = date('Y-m-d',strtotime($event->event_begin));
78
+ $id_end = date('Y-m-d',strtotime($event->event_end));
79
+ $tz = mc_user_timezone();
80
+ $cur_date = ( $type == 'list' )?'':"<span class='mc-event-date'>$current_date</span>";
81
+
82
+ $time = "<div class='time-block'>";
83
+ $time .= "<p>$cur_date";
84
+ if ( $event->event_time != "00:00:00" && $event->event_time != '' ) {
85
+ $time .= "\n<span class='event-time dtstart'><time datetime='".$id_start.'T'.$event->event_time."'>".date_i18n(get_option('mc_time_format'), strtotime($event->event_time)).'</time>';
86
+ if ( $event->event_hide_end == 0 ) {
87
+ if ($event->event_endtime != '' && $event->event_endtime != $event->event_time ) {
88
+ $time .= "<span class='time-separator'> &ndash; </span><time class='end-time dtend' datetime='".$id_end.'T'.$event->event_endtime."'>".date_i18n(get_option('mc_time_format'), strtotime($event->event_endtime))."</span>";
89
+ }
90
+ }
91
+ if ( $tz != '' ) {
92
+ $local_begin = date_i18n( get_option('mc_time_format'), strtotime($event->event_time ."+$tz hours") );
93
+ $time .= "<hr /><small class='local-time'>". sprintf(__('(%s in your time zone)','my-calendar'),$local_begin)."</small>";
94
+ }
95
+ $time .= "</span>\n";
96
+ } else {
97
+ $time .= "<span class='event-time'>";
98
+ if ( get_option('mc_notime_text') == '' || get_option('mc_notime_text') == "N/A" ) {
99
+ $time .= "<abbr title='".__('Not Applicable','my-calendar')."'>".__('N/A','my-calendar')."</abbr>\n";
100
+ } else {
101
+ $time .= get_option('mc_notime_text');
102
+ }
103
+ $time .= "</span></p>";
104
+ }
105
+ $time .= apply_filters( 'mcs_end_time_block', '', $event );
106
+ $time .= "
107
+ </div>";
108
+ return $time;
109
+ }
110
+
111
+ function mc_category_icon( $event,$html='html' ) {
112
+ $url = plugin_dir_url( __FILE__ );
113
+ $image = '';
114
+ if ( get_option( 'mc_hide_icons' ) != 'true' ) {
115
+ if ( $event->category_icon != '' ) {
116
+ $path = ( is_custom_icon() ) ? str_replace( 'my-calendar','my-calendar-custom',$url ) : plugins_url( 'images/icons', __FILE__ ).'/';
117
+ $hex = ( strpos( $event->category_color,'#' ) !== 0 )?'#':'';
118
+ if ( $html == 'html' ) {
119
+ $image = '<img src="'.$path.$event->category_icon.'" alt="'.__( 'Category','my-calendar' ).': '.esc_attr( $event->category_name ).'" class="category-icon" style="background:'.$hex.$event->category_color.'" />';
120
+ } else {
121
+ $image = $path.$event->category_icon;
122
+ }
123
+ }
124
+ }
125
+ return $image;
126
+ }
127
+
128
+ add_filter( 'the_title', 'mc_category_icon_title' );
129
+ function mc_category_icon_title( $title ) {
130
+ if ( is_singular( 'mc-events' ) && in_the_loop() ) {
131
+ $event_id = get_post_meta( get_the_ID(), '_mc_event_id', true );
132
+ $event = mc_get_event_core( $event_id );
133
+ $icon = mc_category_icon( $event );
134
+ $title = $icon .' '. $title;
135
+ }
136
+ return $title;
137
  }
138
  // Used to draw an event to the screen
139
+ function my_calendar_draw_event( $event, $type="calendar", $process_date, $time, $template='' ) {
140
+ // if event is not approved, return without processing
141
+ if ( get_option( 'mc_event_approve' ) == 'true' && (int) $event->event_approved !== 1 ) {
142
+ return;
143
+ }
144
+ // if event ends at midnight today (e.g., very first thing of the day), exit without re-drawing
145
+ if ( $event->event_endtime == '00:00:00' && $event->event_end == $process_date && $event->event_begin != $process_date ) {
146
+ return;
147
+ }
148
  global $wpdb;
149
  $url = plugin_dir_url( __FILE__ );
 
150
  $mcdb = $wpdb;
151
  if ( get_option( 'mc_remote' ) == 'true' && function_exists('mc_remote_db') ) { $mcdb = mc_remote_db(); }
 
 
152
  if ( $event->category_private == 1 && !is_user_logged_in() ) { return; }
153
+ // assign empty values to template sections
154
+ $header = $address = $more = $author = $list_title = $title = $output = $container = $short = $description = $link = $vcal = $gcal = '';
155
+ $date_format = ( get_option('mc_date_format') != '' ) ? get_option('mc_date_format') : get_option('date_format');
156
+ $data = mc_create_tags($event);
157
  $details = apply_filters( 'mc_custom_template', false, $data, $event, $type, $process_date, $time, $template );
158
+ $templates = get_option('mc_templates');
159
  if ( $details === false ) {
160
+ if ( $template != '' && mc_file_exists( sanitize_file_name( $template ) ) ) {
161
+ $template = @file_get_contents( mc_get_file( sanitize_file_name( $template ) ) );
 
162
  $details = jd_draw_template( $data, $template );
163
  } else {
164
  switch ($type) {
165
  case 'mini':
166
  $template = $templates['mini'];
167
+ if ( get_option( 'mc_use_mini_template' ) == 1 ) {
168
  $details = jd_draw_template( $data, $template );
169
  }
170
  break;
171
  case 'list':
172
  $template = $templates['list'];
173
+ if ( get_option( 'mc_use_list_template' ) == 1 ) {
174
  $details = jd_draw_template( $data, $template );
175
  }
176
  break;
177
  case 'single':
178
  $template = $templates['details'];
179
+ if ( get_option( 'mc_use_details_template' ) == 1 ) {
180
  $details = jd_draw_template( $data, $template );
181
  }
182
  break;
183
  case 'calendar':
184
  default:
185
  $template = $templates['grid'];
186
+ if ( get_option( 'mc_use_grid_template' ) == 1 ) {
187
  $details = jd_draw_template( $data, $template );
188
  }
189
  }
193
  $display_map = get_option('mc_show_map');
194
  $display_address = get_option('mc_show_address');
195
  $display_details = get_option('mc_details');
 
 
196
  $uid = 'mc_'.$event->occur_id;
197
+ $day_id = date( 'd',strtotime( $process_date ) );
198
  $mc_id = $event->occur_id;
199
  $this_category = $event->event_category;
200
+
201
+ $image = mc_category_icon( $event );
202
+ $header .= "<div id='$uid-$day_id-$type' class='$type-event "."mc_".sanitize_title( $event->category_name )." vevent'>\n";
203
+
204
+ $title_template = ($templates['title'] == '' ) ? '{title}' : $templates['title'];
205
+ $event_title = jd_draw_template($data,$title_template);
206
+ $event_title = ( $event_title == '' ) ? jd_draw_template( $data, '{title}' ) : $event_title; //prevent empty titles
207
+
208
+ if ( strpos( $event_title,'http' ) === false && $type != 'mini' && $type != 'list' ) {
 
 
 
 
 
 
 
 
 
 
 
 
209
  if ( get_option('mc_open_uri') == 'true' ) {
210
+ $details_link = mc_get_details_link( $event );
211
+ $wrap = "<a href='$details_link'>";
212
+ $balance = "</a>";
213
  } else {
214
+ $wrap = "<a href='#$uid-$day_id-$type-details'>";
215
+ $balance = "</a>";
216
  }
217
  } else {
218
  $wrap = $balance = '';
219
  }
220
+ $current_date = date_i18n( apply_filters( 'mc_date_format', $date_format, 'details' ), strtotime( $process_date ) );
221
+ $group_class = ( $event->event_span == 1 ) ? ' multidate group'.$event->event_group_id : '' ;
222
+ $heading_level = apply_filters( 'mc_heading_level_table','h3',$type,$time,$template );
223
+ $header .= ( $type != 'single' && $type != 'list' ) ? "<$heading_level class='event-title summary$group_class'>$wrap$image$event_title$balance</$heading_level>\n" : '';
224
+ $event_title = ( $type == 'single' ) ? apply_filters( 'mc_single_event_title', $event_title, $event ) : $event_title ;
225
+ $title = ( $type == 'single' && !is_singular( 'mc-events' ) )?"<h2 class='event-title summary'>$image $event_title</h2>\n":'';
226
+ $title = apply_filters( 'mc_event_title', $title, $event, $event_title, $image );
227
+ $header .= $title;
 
228
  if ( $details === false ) {
229
+ $custom = false;
230
  // put together address information as vcard
231
+ if ( ( $display_address == 'true' || $display_map == 'true' ) ) {
232
+ $address = mc_hcard( $event, $display_address, $display_map );
233
  }
234
  // end vcard
235
+ $close = ( $type == 'calendar' || $type == 'mini' ) ? "<a href=\"#$uid-$day_id-$type\" class='mc-toggle mc-close close'><img src=\"".plugin_dir_url(__FILE__)."images/event-close.png\" alt='".__('Close','my-calendar')."' /></a>" : '' ;
236
+ $time = mc_time_html( $event, $type, $current_date );
237
+ if ($type == "list") {
238
+ $heading_level = apply_filters('mc_heading_level_list','h3',$format,$time,$template );
239
+ $list_title = "<$heading_level class='event-title summary'>$image".$event_title."</$heading_level>\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
240
  }
241
+ if ($mc_display_author == 'true') {
242
+ if ( $event->event_author != 0 ) {
243
+ $e = get_userdata( $event->event_author );
244
+ $author = '<p class="event-author">'.__('Posted by', 'my-calendar').' <span class="author-name">'.$e->display_name."</span></p>\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
245
  }
246
  }
247
+ if ( $display_details == 'true' && !isset( $_GET['mc_id'] ) ) {
248
+ $details_label = mc_get_details_label( $event, $data );
249
+ $details_link = mc_get_details_link( $event );
250
+ $more = ( get_option( 'mc_uri' ) != '' )?"<p class='mc_details'><a href='$details_link'>$details_label</a></p>\n":'';
251
+ }
252
+ // handle link expiration
253
+ $event_link = mc_event_link( $event );
254
 
255
  if ( function_exists('mc_google_cal') && get_option('mc_show_gcal') == 'true' ) {
256
  $gcal_link = "<p class='gcal'>".jd_draw_template( $data, '{gcal_link}' )."</p>";
257
+ $gcal = $gcal_link;
258
  }
259
 
260
  if ( function_exists('my_calendar_generate_vcal') && get_option('mc_show_event_vcal') == 'true' ) {
261
  $nonce = wp_create_nonce('my-calendar-nonce');
262
  $vcal_link = "<p class='ical'><a rel='nofollow' href='".home_url()."?vcal=$uid"."'>".__('iCal','my-calendar')."</a></p>\n";
263
+ $vcal = $vcal_link;
264
  }
265
+ if ( is_numeric( $event->event_post ) && $event->event_post != 0 ) {
266
+ $atts = apply_filters( 'mc_post_thumbnail_atts', array( 'class'=>'mc-image' ) );
267
+ $image = get_the_post_thumbnail( $event->event_post, 'medium', $atts );
268
+ } else {
269
+ $image = ($event->event_image!='')?"<img src='$event->event_image' alt='' class='mc-image' />":'';
 
270
  }
271
  if ( get_option('mc_desc') == 'true' || $type == 'single' ) {
272
  $description = ( get_option('mc_process_shortcodes') == 'true' )?apply_filters('the_content',stripcslashes($event->event_desc)):wpautop(stripcslashes($event->event_desc),1);
273
+ $description = "<div class='longdesc'>$description</div>";
274
+ }
275
+ if ( get_option('mc_short') == 'true' && $type != 'single' ) {
276
+ $short = ( get_option('mc_process_shortcodes') == 'true' )?apply_filters('the_content',stripcslashes($event->event_short)):wpautop(stripcslashes($event->event_short),1);
277
+ $short = "<div class='shortdesc'>$short</div>";
278
  }
279
+
280
  if ( get_option('mc_event_registration') == 'true' ) {
281
  switch ($event->event_open) {
282
  case '0':$status = get_option('mc_event_closed');break;
287
  } else {
288
  $status = '';
289
  }
290
+
291
+ // JCD TODO - this is really wonky. What was I thinking?
292
  // if the event is a member of a group of events, but not the first, note that.
293
+ if ( $event->event_group == 1 ) {
294
  $info = array();
295
  $info[] = $event->event_id;
296
  update_option( 'mc_event_groups' , $info );
297
  }
298
+
299
  if ( is_array( get_option( 'mc_event_groups' ) ) ) {
300
  if ( in_array ( $event->event_id , get_option( 'mc_event_groups') ) ) {
301
+ if ( $process_date != $event->event_begin ) {
302
+ $status = __( "This event is in a series. Register for the first event in this series to attend.",'my-calendar' );
303
  }
304
  }
305
  }
306
+
307
  $status = ($status != '')?"<p>$status</p>":'';
308
  $status = apply_filters( 'mc_registration_state', $status, $event );
309
  $return = ($type == 'single')?"<p><a href='".get_option('mc_uri')."'>".__('View full calendar','my-calendar')."</a></p>":'';
 
 
310
 
311
+ if ( $type == 'calendar' && get_option('mc_open_uri') == 'true' && $time != 'day' ) $description = $short = $status = '';
312
+
313
+ $map = ( is_singular( 'mc-event' ) || $type == 'single' )? mc_generate_map( $event ) : '' ;
314
+
315
  if ( $event_link != '' && get_option( 'mc_event_link' ) != 'false' ) {
316
  $is_external = mc_external_link( $event_link );
317
+ $external_class = ( $is_external ) ? "class='$type-link external'" : "class='$type-link'";
318
  $link_template = ( isset($templates['link']))?$templates['link']:'{title}';
319
  $link_text = jd_draw_template($data,$link_template);
320
+ $link = "<p><a href='$event_link' $is_external>".$link_text."</a></p>";
 
 
321
  }
322
+ $details = "\n"
323
+ . $close
324
+ . $time
325
+ . $list_title
326
+ . $image
327
+ ."<div class='location'>"
328
+ . $map
329
+ . $address
330
+ . "</div>"
331
+ . $description
332
+ . $short
333
+ . $link
334
+ . $status
335
+ . $author
336
+ . "<div class='sharing'>"
337
+ . $vcal
338
+ . $gcal
339
+ . $more
340
+ . "</div>"
341
+ . $return;
342
  } else {
343
+ $custom = true;
344
+ // if a custom template is in use
345
+ $toggle = ( $type == 'calendar' || $type == 'mini' )?"<a href=\"#$uid-$day_id-$type\" class='mc-toggle mc-close close'><img src=\"".plugin_dir_url(__FILE__)."images/event-close.png\" alt='".__('Close','my-calendar')."' /></a>":'';
346
+ $details = $toggle.$details."\n";
347
  }
348
+ $container = "<div id='$uid-$day_id-$type-details' class='details'>\n";
349
+ $container = apply_filters( 'mc_before_event', $container, $event, $type, $time );
350
+ $details = $header . $container . $details;
351
+ $details .= apply_filters( 'mc_after_event' ,'',$event, $type, $time );
352
+ $details .= "</div><!--ends .details--></div>";
353
+ $details = apply_filters( 'mc_event_content', $details, $event, $type, $time );
354
+ return $details;
355
+ }
356
+
357
+ add_filter( 'mc_after_event', 'mc_edit_panel', 10, 4 );
358
+ function mc_edit_panel( $html, $event, $type, $time ) {
359
  // create edit links
360
+ $edit = '';
361
  if ( mc_can_edit_event( $event->event_author ) && get_option('mc_remote') != 'true' ) {
362
+ $mc_id = $event->occur_id;
363
  $groupedit = ( $event->event_group_id != 0 )?" &bull; <a href='".admin_url("admin.php?page=my-calendar-groups&amp;mode=edit&amp;event_id=$event->event_id&amp;group_id=$event->event_group_id")."' class='group'>".__('Edit Group','my-calendar')."</a>\n":'';
364
  $recurs = str_split( $event->event_recur, 1 );
365
  $recur = $recurs[0];
 
366
  $referer = urlencode( mc_get_current_url() );
367
+ $edit = "<div class='mc_edit_links'><p>";
368
  if ( $recur == 'S' ) {
369
+ $edit .= "<a href='".admin_url("admin.php?page=my-calendar&amp;mode=edit&amp;event_id=$event->event_id&amp;ref=$referer")."' class='edit'>".__('Edit','my-calendar')."</a> &bull; <a href='".admin_url("admin.php?page=my-calendar-manage&amp;mode=delete&amp;event_id=$event->event_id&amp;ref=$referer")."' class='delete'>".__('Delete','my-calendar')."</a>$groupedit";
 
 
 
 
 
370
  } else {
371
+ $edit .= "<a href='".admin_url("admin.php?page=my-calendar&amp;mode=edit&amp;event_id=$event->event_id&amp;date=$mc_id&amp;ref=$referer")."' class='edit'>".__('Edit This Date','my-calendar')."</a> &bull; <a href='".admin_url("admin.php?page=my-calendar&amp;mode=edit&amp;event_id=$event->event_id&amp;ref=$referer")."' class='edit'>".__('Edit All','my-calendar')."</a> &bull; <a href='".admin_url("admin.php?page=my-calendar-manage&amp;mode=delete&amp;event_id=$event->event_id&amp;date=$mc_id&amp;ref=$referer")."' class='delete'>".__('Delete This Date','my-calendar')."</a> &bull; <a href='".admin_url("admin.php?page=my-calendar-manage&amp;mode=delete&amp;event_id=$event->event_id&amp;ref=$referer")."' class='delete'>".__('Delete All','my-calendar')."</a>
372
+ $groupedit";
 
 
 
 
373
  }
374
+ $edit .= "</p></div>";
 
375
  }
376
  if ( $type == 'calendar' && get_option('mc_open_uri') == 'true' && $time != 'day' ) { $edit = ''; }
377
+ return $html . $edit;
 
 
 
 
 
 
 
 
 
 
 
 
378
  }
379
 
380
  function mc_build_date_switcher( $type='calendar', $cid='all' ) {
444
  $lvalue=(isset($_GET['lvalue']))?$_GET['lvalue']:'';
445
  header('Content-Type: '.get_bloginfo('html_type').'; charset='.get_bloginfo('charset'));
446
  echo '<!DOCTYPE html>
 
 
 
447
  <!--[if IE 7]>
448
  <html id="ie7" dir="'.get_bloginfo('text_direction').'" lang="'.get_bloginfo('language').'">
449
  <![endif]-->
459
  <title>'.get_bloginfo('name').' - '.__('Calendar: Print View','my-calendar').'</title>
460
  <meta name="generator" content="My Calendar for WordPress" />
461
  <meta name="robots" content="noindex,nofollow" />';
462
+ if ( mc_file_exists( 'css/mc-print.css' ) ) {
463
+ $stylesheet = mc_get_file( 'css/mc-print.css', 'url' );
464
  } else {
465
+ $stylesheet = $url."css/mc-print.css";
466
  }
467
  echo "
468
  <!-- Copy mc-print.css to your theme directory if you wish to replace the default print styles -->
469
  <link rel='stylesheet' href='$stylesheet' type='text/css' media='screen,print' />
470
  </head>
471
  <body>\n";
472
+ echo my_calendar('print','calendar',$category,$time,$ltype,$lvalue,'mc-print-view','','',null,null,'','');
473
  $return_url = ( get_option('mc_uri') != '' && !is_numeric( get_option('mc_uri') ) )?get_option('mc_uri'):home_url();
474
  $add = $_GET;
475
  unset( $add['cid'] );
476
  unset( $add['feed'] );
477
+ $return_url = mc_build_url( $add, array( 'feed','cid' ), $return_url );
478
  echo "<p class='return'><a href='$return_url'>".__('Return to site','my-calendar')."</a></p>";
479
  echo '
480
  </body>
502
  return $toggle;
503
  }
504
 
505
+ function mc_time_toggle( $format, $time, $toggle, $day, $month, $year ) {
506
  if ( $format != 'mini' && $toggle == 'yes' ) {
507
  $toggle = "<div class='mc-time'>";
508
  $current_url = mc_get_current_url();
509
  switch ($time) {
510
  case 'week':
511
+ $url = mc_build_url( array('time'=>'month'), array( 'mc_id' ) );
512
  $toggle .= "<a href='$url'>".__('Month','my-calendar')."</a> ";
513
  $toggle .= __('Week','my-calendar');
514
+ $url = mc_build_url( array( 'time'=>'day','dy'=>$day ), array('dy','mc_id') );
515
  $toggle .= " <a href='$url'>".__('Day','my-calendar')."</a>";
516
  break;
517
  case 'day':
518
  $url = mc_build_url( array('time'=>'month'), array() );
519
  $toggle .= "<a href='$url'>".__('Month','my-calendar')."</a>";
520
+ $url = mc_build_url( array('time'=>'week','dy'=>$day,'month'=>$month, 'yr'=>$year ), array('dy','month','mc_id') );
521
  $toggle .= " <a href='$url'>".__('Week','my-calendar')."</a> ";
522
  $toggle .= __('Day','my-calendar');
523
  break;
524
  default:
525
  $toggle .= __('Month','my-calendar');
526
+ $url = mc_build_url( array('time'=>'week','dy'=>$day,'month'=>$month ), array('dy','month','mc_id') );
527
  $toggle .= " <a href='$url'>".__('Week','my-calendar')."</a> ";
528
  $url = mc_build_url( array('time'=>'day'), array() );
529
  $toggle .= "<a href='$url'>".__('Day','my-calendar')."</a>";
595
 
596
  function mc_search_results( $query ) {
597
  $limits = true;
 
598
  $before = apply_filters( 'mc_past_search_results', 0 );
599
  $after = apply_filters( 'mc_future_search_results', 10 ); // return only future events, nearest 10
600
+ if ( is_string($query) ) {
601
  $select_category = $limit_string = $select_author = $select_host = '';
602
+ $search = " MATCH(event_title,event_desc,event_short,event_label,event_city,event_postcode,event_registration) AGAINST ('$query' IN BOOLEAN MODE) AND ";
603
  } else {
604
+ extract($query);
605
+ $select_category = ( $category!='default' ) ? mc_select_category($category) : '';
606
  $limit_string = mc_limit_string();
607
+ $select_author = ( $author != 'default' ) ? mc_select_author($author) : '';
608
+ $select_host = ( $host != 'default' ) ? mc_select_host($host) : '';
609
+ $prefix = ( $select_category . $limit_string . $select_author . $select_host != '' ) ? ' AND':'';
610
+ $search = "$prefix MATCH(event_title,event_desc,event_short,event_label,event_city,event_postcode,event_registration) AGAINST ('$query' IN BOOLEAN MODE) AND ";
611
  }
612
  global $wpdb;
613
  $mcdb = $wpdb;
625
  ON (event_category=category_id) WHERE $select_category $select_author $select_host $limit_string $search event_approved = 1 AND event_flagged <> 1
626
  AND DATE(occur_begin) < '$date' ORDER BY occur_begin DESC LIMIT 0,$before");
627
  } else { $events1 = array(); }
628
+ $events3 = $mcdb->get_results("SELECT *, UNIX_TIMESTAMP(occur_begin) AS ts_occur_begin, UNIX_TIMESTAMP(occur_end) AS ts_occur_end
629
+ FROM " . MY_CALENDAR_EVENTS_TABLE . "
630
+ JOIN " . MY_CALENDAR_TABLE . "
631
+ ON (event_id=occur_event_id)
632
+ JOIN " . MY_CALENDAR_CATEGORIES_TABLE . "
633
+ ON (event_category=category_id) WHERE $select_category $select_author $select_host $limit_string $search event_approved = 1 AND event_flagged <> 1
634
+ AND DATE(occur_begin) = '$date'");
 
 
635
  if ( $after > 0 ) {
636
  $after = $after + 5;
637
  $events2 = $mcdb->get_results("SELECT *, UNIX_TIMESTAMP(occur_begin) AS ts_occur_begin, UNIX_TIMESTAMP(occur_end) AS ts_occur_end
643
  AND DATE(occur_begin) > '$date' ORDER BY occur_begin ASC LIMIT 0,$after");
644
  } else { $events2 = array(); }
645
  $arr_events = array();
646
+ if (!empty($events1) || !empty($events2) || !empty($events3) ) {
647
  $arr_events = array_merge( $events1, $events3, $events2);
648
  }
649
  if ( !get_option('mc_skip_holidays_category') || get_option('mc_skip_holidays_category') == '' ) {
662
  if ( !empty($event_array) ) {
663
  $template = '<strong>{date}</strong> {title} {details}';
664
  $template = apply_filters( 'mc_search_template', $template );
665
+ // no filters parameter prevents infinite looping on the_content filters.
666
+ $output = mc_produce_upcoming_events( $event_array,$template,'list','ASC',0,$before, $after, 'yes', 'nofilters' );
667
  } else {
668
+ $output = "<li class='no-results'>".__('Sorry, your search produced no results.','my-calendar')."</li>";
669
  }
670
+ return "<ol class='mc-search-results'>$output</ol>";
671
  }
672
 
673
+ add_filter( 'the_title', 'mc_search_results_title', 10, 2 );
674
+ function mc_search_results_title( $title, $id ) {
675
+ if ( isset( $_GET['mcs'] ) && ( is_page( $id ) || is_single( $id ) ) && in_the_loop() ) {
676
+ $query = esc_html( $_GET['mcs'] );
677
+ $title = sprintf( __('Events Search for &ldquo;%s&rdquo;','my-calendar' ), $query );
678
+ }
679
+ return $title;
680
+ }
681
 
682
+ add_filter( 'the_content','mc_show_search_results' );
683
  function mc_show_search_results( $content ) {
684
  // if this is the result of a search, show search output.
685
  $ret = false;
686
  if ( isset( $_GET['mcs'] ) ) { // simple search
687
  $ret = true;
688
  $query = $_GET['mcs'];
689
+ } else if ( isset ( $_POST['mcs'] ) ) { // advanced search
690
  $ret = true;
691
  $query = $_POST;
692
  }
697
  }
698
  }
699
 
700
+ add_filter( 'the_content','mc_show_event_template', 100 );
701
+ function mc_show_event_template( $content ) {
702
+ global $post;
703
+ if ( $post->post_type == 'mc-events' ) {
704
+ $content .= do_shortcode( get_post_meta( $post->ID, '_mc_event_shortcode', true ) ); // -> triggers an infinite loop when shortcode filters enabled in settings. If you're using this view, you have no reason to allow the_content filters.
705
+ }
706
+ return $content;
707
+ }
708
+
709
  // Actually do the printing of the calendar
710
+ function my_calendar( $name, $format, $category, $time='month', $ltype='', $lvalue='', $id='jd-calendar', $template='', $content='', $author=null, $host=null, $above='', $below='' ) {
711
  check_my_calendar();
712
  apply_filters("debug", "my_calendar( $name ) draw");
713
  $mc_toporder = array( 'nav','toggle','jump','print','timeframe' );
714
  $mc_bottomorder = array( 'key','feeds' );
715
  if ( $above != '' || $below != '' ) {
716
+ $aboves = ( $above == 'none' ) ? array() : array_map( 'trim', explode( ',',$above ) );
717
+ $belows = ( $below == 'none' ) ? array() : array_map( 'trim', explode( ',',$below ) );
718
  } else {
719
  $aboves = $mc_toporder;
720
  $belows = $mc_bottomorder;
721
  }
722
  $used = array_merge( $aboves, $belows );
723
+
 
 
 
 
724
  if ( isset($_GET['time']) && in_array( $_GET['time'], array( 'day','week','month' ) ) && $format != 'mini' ) {
725
  $time = $_GET['time'];
726
  }
729
  $offset = (60*60*get_option('gmt_offset'));
730
 
731
  if ( get_option( 'mc_remote' ) == 'true' && function_exists('mc_remote_db') ) { $mcdb = mc_remote_db(); }
732
+ $my_calendar_body = '';
733
  /* filter */
734
  if ( $time == 'day' ) { $format = 'list'; }
735
+ $args = array( 'name'=>$name,'format'=>$format,'category'=>$category,'above'=>$above,'below'=>$below,'time'=>$time,'ltype'=>$ltype,'lvalue'=>$lvalue, 'author'=>$author, 'id'=>$id );
736
  $my_calendar_body .= apply_filters('mc_before_calendar','',$args);
737
 
 
 
738
  $main_class = ( $name !='' )?sanitize_title($name):'all';
739
  $cid = ( isset( $_GET['cid'] ) )?esc_attr(strip_tags($_GET['cid'])):$main_class;
740
 
741
  // mc body wrapper
742
+ $mc_wrapper = "<div id=\"$id\" class=\"mc-main $format $time $main_class\" aria-live='assertive' aria-atomic='true'>";
743
  $mc_closer = "</div>";
744
 
745
  if ( get_option('mc_convert') == 'true' ) { $format = ( mc_is_mobile() )?'list':$format; }
803
  $c_month = (int) $_GET['month'];
804
  if ( !isset($_GET['dy']) ) { $c_day = 1; }
805
  } else {
806
+ $xnow = date( 'Y-m-d',time()+($offset) );
807
  $c_month = ($c_m == 0)?date("m",time()+($offset)):date("m",strtotime( $xnow.' -1 month'));
808
  }
809
+
810
+ $is_start_of_week = ( date('N', current_time( 'timestamp' ) ) == get_option( 'start_of_week' ) ) ? true : false;
811
  if ( isset($_GET['yr']) && $main_class == $cid ) {
812
  $c_year = (int) $_GET['yr'];
813
  } else {
814
+ // weeks suck. seriously.
815
+ if ( date("Y",current_time( 'timestamp' ) ) == date("Y", strtotime( date( 'Y-m-d', current_time( 'timestamp' ) ).'- 6 days' ) ) || $is_start_of_week ) {
816
+ $c_year = ( date("Y",current_time( 'timestamp' ) ) );
817
  } else {
818
+ $c_year = ( date("Y",current_time( 'timestamp' ) ) )-1;
819
  }
820
  }
821
  // Years get funny if we exceed 3000, so we use this check
831
  $c_day = apply_filters( 'mc_filter_day', $c_day, $args );
832
  }
833
  $c_day = ( $c_day == 0 )?1:$c_day; // c_day can't equal 0.
834
+ $n_month = ( $c_month + 1 > 12 ) ? 1 : $c_month+1;
835
+ $p_month = ( $c_month - 1 < 1 ) ? 12 : $c_month-1;
 
 
 
836
  $current_date = mktime( 0,0,0,$c_month,$c_day,$c_year );
837
  $c_month = str_pad( $c_month, 2, '0', STR_PAD_LEFT );
838
  $n_month = str_pad( $n_month, 2, '0', STR_PAD_LEFT );
839
  $p_month = str_pad( $p_month, 2, '0', STR_PAD_LEFT );
840
  //echo "<p>Debug:<br />Day: $c_day<br />Month: $c_month<br />Year: $c_year<br />Date: ".date('Y-m-d',$current_date)."</p>";
841
+ $num = get_option( 'mc_show_months' ) - 1; // the value is total months to show; need additional months to show.
842
 
843
  if ( $format == "list" && $time != 'week' ) { // grid calendar can't show multiple months
844
  if ( $num > 0 && $time != 'day' && $time != 'week' ) {
850
  $from = date( 'Y-m-d',mktime(0,0,0,$c_month,1,$c_year) );
851
  $to = date( 'Y-m-d',mktime(0,0,0,$c_month,date( 't',mktime(0,0,0,$c_month,1,$c_year) ),$c_year) );
852
  }
853
+ $this_dates = array( 'from'=>$from, 'to'=>$to );
854
  } else {
855
  $this_dates = mc_date_array( $current_date, $time, $num );
856
  }
857
  $from = $this_dates['from'];
858
  $to = $this_dates['to'];
859
  //echo "<pre>$num $from, $to ($c_month,$c_day,$c_year)</pre>";
860
+ apply_filters("debug", "my_calendar( $name ) pre get events");
861
+ $event_array = my_calendar_events( $from, $to, $category, $ltype, $lvalue, 'calendar', $author );
862
+ $no_events = ( empty( $event_array ) ) ? true : false;
863
+ apply_filters("debug", "my_calendar( $name ) post get events");
864
+
865
+ // define navigation element strings
866
+ $timeframe = $nav = $feeds = $jump = $mc_topnav = $mc_bottomnav = '';
867
+
 
 
 
 
 
 
 
 
 
 
 
 
 
868
  // setup print link
869
  $add = array( 'time'=>$time,'ltype'=>$ltype,'lvalue'=>$lvalue,'mcat'=>$category,'yr'=>$c_year,'month'=>$c_month,'dy'=>$c_day, 'cid'=>'print' );
870
  $subtract = array();
871
  if ( $ltype == '' ) { $subtract[] = 'ltype'; unset( $add['ltype'] ); }
872
+ if ( $lvalue == '' ) { $subtract[] = 'lvalue'; unset( $add['lvalue'] ); }
873
+ if ( $category == 'all' ) { $subtract[] = 'mcat'; unset( $add['mcat'] ); }
874
  $mc_print_url = mc_build_url( $add, $subtract, mc_feed_base() . 'my-calendar-print' );
875
  $print = "<div class='mc-print'><a href='$mc_print_url'>".__('Print View','my-calendar')."</a></div>";
876
  // set up format toggle
877
+ $toggle = ( in_array( 'toggle', $used ) ) ? mc_format_toggle( $format, 'yes' ) : '';
 
 
 
 
878
  // set up time toggle
879
  if ( in_array( 'timeframe', $used ) ) {
880
  // if dy parameter not set, use today's date instead of first day of month.
884
  $weeks_day = first_day_of_week( current_time( 'timestamp' ) );
885
  }
886
  $day = $weeks_day[0];
887
+ if ( isset($_GET['time'] ) && $_GET['time'] == 'day' ) {
888
+ // don't adjust day if viewing day format
889
+ } else {
890
+ if ( $day > 20 ) { $day = date( 'j', strtotime( "$from + 1 week" ) ); }
891
+ }
892
+ $timeframe = mc_time_toggle( $format, $time, 'yes', $day, $c_month, $c_year );
893
+ }
894
  // set up category key
895
+ $key = ( in_array( 'key', $used ) ) ? my_category_key( $category ) : '';
 
 
 
 
 
 
 
 
 
 
 
 
896
  // set up navigation links
897
+ if ( in_array( 'nav', $used ) ) {
898
  $pLink = my_calendar_prev_link($c_year,$c_month,$c_day,$format,$time);
899
  $nLink = my_calendar_next_link($c_year,$c_month,$c_day,$format,$time);
900
  $prevLink = mc_build_url( array( 'yr'=>$pLink['yr'],'month'=>$pLink['month'],'dy'=>$pLink['day'],'cid'=>$main_class ),array() );
908
  '.$next_link.'
909
  </ul>
910
  </div>';
911
+ }
912
+ // set up rss feeds
913
+ if ( $format != 'mini' ) {
914
+ $ical_m = (isset($_GET['month']))?(int) $_GET['month']:date('n');
915
+ $ical_y = (isset($_GET['yr']))?(int) $_GET['yr']:date('Y');
916
+ $feeds = mc_rss_links( $ical_y,$ical_m, $nLink );
917
+ }
918
  // set up date switcher
919
+ if ( in_array( 'jump', $used ) ) {
 
 
920
  $jump = ( $time != 'week' && $time != 'day' )?mc_build_date_switcher( $format, $main_class ):'';
921
+ }
 
 
922
  // set up above-calendar order of fields
923
  if ( get_option('mc_topnav') != '' ) { $mc_toporder = explode( ',', get_option('mc_topnav') ); }
924
  if ( $above != '' ) { $mc_toporder = explode( ',', $above ); }
 
925
  foreach ( $mc_toporder as $value ) {
926
  if ( $value != 'none' ) {
927
  $value = trim($value);
932
 
933
  if ( get_option('mc_bottomnav') != '' ) { $mc_bottomorder = explode( ',', get_option('mc_bottomnav') ); }
934
  if ( $below != '' ) { $mc_bottomorder = explode( ',', $below ); }
 
935
  foreach ( $mc_bottomorder as $value ) {
936
+ if ( $value != 'none' && $value !='stop' ) {
937
  $value = trim($value);
938
  $mc_bottomnav .= ${$value};
939
  }
941
  if ( $mc_bottomnav != '' ) { $mc_bottomnav = "<div class='mc_bottomnav'>$mc_bottomnav</div>"; }
942
 
943
  if ( $time == 'day' ) {
944
+ apply_filters("debug", "my_calendar( $name ) pre single-day parsing");
945
+
946
  $my_calendar_body .= "<div class='mc-main $format $time'>".$mc_topnav;
947
  // single day uses independent cycling.
948
+ $dayclass = strtolower( date_i18n( 'D', mktime( 0,0,0,$c_month,$c_day,$c_year ) ) );
949
  $from = $to = "$c_year-$c_month-$c_day";
950
  //echo "<p>Debug: $from, $to, $category, $ltype, $lvalue, $author</p>";
951
  $events = my_calendar_grab_events($from,$to,$category,$ltype,$lvalue,'calendar',$author);
966
  }
967
  } else {
968
  $mc_events .= __( 'No events scheduled for today!','my-calendar');
969
+ }
970
+ $heading_level = apply_filters('mc_heading_level','h3',$format,$time,$template );
971
  $my_calendar_body .= "
972
+ <$heading_level class='mc-single'>".date_i18n( apply_filters( 'mc_date_format', $date_format, 'grid' ),strtotime("$c_year-$c_month-$c_day"))."</$heading_level>".'
973
  <div id="mc-day" class="'.$dayclass.' '.$dateclass.' '.$events_class.'">'."$mc_events\n</div>
974
  </div>";
975
+ apply_filters("debug", "my_calendar( $name ) post single-day parsing");
976
  } else {
977
+ apply_filters("debug", "my_calendar( $name ) pre full parsing");
978
  // if showing multiple months, figure out how far we're going.
979
  $num_months = ($time == 'week')?1:get_option('mc_show_months');
980
  $through_date = mktime(0,0,0,$c_month+($num_months-1),$c_day,$c_year);
992
  if ($format == "calendar" || $format == "mini" ) {
993
  $my_calendar_body .= "\n<table class=\"my-calendar-table\">\n";
994
  $values = array( 'date'=>date('Y-m-d',$current_date) );
995
+ $week_template = ( get_option( 'mc_week_caption' ) != '' ) ? get_option( 'mc_week_caption' ) : 'Week of {date format="M jS"}';
996
+ $week_caption = jd_draw_template( $values, stripslashes( $week_template ) );
997
  $caption_heading = ($time != 'week')?$current_date_header.$caption_text:$week_caption.$caption_text;
998
  $my_calendar_body .= "<caption class=\"my-calendar-$time\">".$caption_heading."</caption>\n";
999
  } else {
1004
  $values = array( 'date'=>date('Y-m-d',$current_date) );
1005
  $list_heading = jd_draw_template( $values, stripslashes(get_option('mc_week_caption')) );
1006
  }
1007
+ $my_calendar_body .= "<h3 class=\"my-calendar-$time\">$list_heading</h3>\n";
1008
  }
1009
  // If in a calendar format, print the headings of the days of the week
1010
  if ( $format == "calendar" || $format == "mini" || $format == "list" ) {
1027
  $my_calendar_body .= "\n</tr>\n</thead>\n<tbody>";
1028
  }
1029
  $odd = 'odd';
1030
+ // get and display all the events
1031
  $show_all = false; // show all dates in list format.
1032
  if ( $no_events && $format == "list" && $show_all == false ) {
1033
+ // if there are no events in list format, just display that info.
1034
  $no_events = ( $content == '' )?__('There are no events scheduled during this period.','my-calendar'):$content;
1035
  $my_calendar_body .= "<li class='no-events'>$no_events</li>";
1036
  } else {
1052
  $week_date_format = date_i18n( $week_format,$start );
1053
  $thisday_heading = ($time == 'week')?"<small>$week_date_format</small>":date( 'j',$start );
1054
  $events = ( isset( $event_array[$date] ) )?$event_array[$date]:array();
1055
+ if ( !empty($events) ) {
1056
+ $event_output = my_calendar_draw_events( $events, $format, $date, $time, $template );
1057
  if ( $event_output === true ) { $event_output = ' '; }
1058
  $events_class = ( $event_output != '' )?mc_events_class($events):'no-events';
1059
  if ($format == 'mini' && $event_output != '' ) {
1061
  // yes, this is weird. it's from some old settings...
1062
  $target = array('yr'=>date('Y',$start),'month'=>date('m',$start),'dy'=>date( 'j',$start ),'time'=>'day' );
1063
  if ( $category != '' ) { $target['mcat'] = $category; }
1064
+ $day_url = mc_build_url( $target, array('month','dy','yr','ltype','loc','mcat','cid','mc_id'), apply_filters ( 'mc_modify_day_uri', get_option( 'mc_uri' ) ) );
1065
  $link = ( get_option('mc_uri') != '' && !is_numeric( get_option('mc_uri') ) )?$day_url:'#';
1066
  } else {
1067
  $atype = str_replace( 'anchor','',get_option('mc_open_day_uri') );
1068
  $ad = str_pad( date( 'j',$start ), 2, '0', STR_PAD_LEFT ); // need to match format in ID
1069
  $am = str_pad( $c_month, 2, '0', STR_PAD_LEFT );
1070
+ $date_url = mc_build_url( array('yr'=>$c_year,'month'=>$c_month,'dy'=>date( 'j',$start ) ), array('month','dy','yr','ltype','loc','mcat','cid','mc_id'), get_option( 'mc_mini_uri' ) );
1071
  $link = ( get_option('mc_mini_uri') != '' ) ?$date_url.'#'.$atype.'-'.$c_year.'-'.$am.'-'.$ad:'#';
1072
  }
1073
  $element = "a href='$link'";
1082
  if ( ( $is_weekend && get_option('mc_show_weekends') == 'true' ) || !$is_weekend ) {
1083
  $weekend_class = ( $is_weekend )?'weekend':'';
1084
  if ( $format == "list" ) {
1085
+ if ( get_option('mc_list_javascript') != 1 ) {
1086
  $is_anchor = "<a href='#'>";
1087
  $is_close_anchor = "</a>";
1088
  } else {
1092
  $title = ' - '.$is_anchor . mc_list_title($events) . $is_close_anchor;
1093
  } else {
1094
  $title = '';
1095
+ }
1096
  //if ( $monthclass != 'nextmonth' ) { // only show current month in list view.
1097
  if ( $event_output != '' ) {
1098
  $my_calendar_body .= "
1099
  <li id='$format-$date' class='mc-events $dayclass $dateclass $events_class $odd'>
1100
+ <strong class=\"event-date\">$is_anchor".date_i18n( apply_filters( 'mc_date_format', $date_format, 'list' ), $start )."$is_close_anchor"."$title</strong>".
1101
  $event_output."
1102
  </li>";
1103
  $odd = ( $odd == 'odd' )?'even':'odd';
1108
  <td id='$format-$date' class='$dayclass $dateclass $weekend_class $monthclass $events_class day-with-date'>"."
1109
  <$element class='mc-date $trigger'>$thisday_heading</$close>".
1110
  $event_output."
1111
+ </td>\n";
1112
  }
1113
  }
1114
  } else {
1135
  }
1136
  $start = strtotime( "+1 day",$start );
1137
 
1138
+ } while ( $start <= $end );
1139
  }
1140
  $my_calendar_body .= ( $format == "list" )?"\n</ul>":"\n</tbody>\n</table>";
1141
  } else {
1142
  $my_calendar_body .= __("Unrecognized calendar format. Please use one of 'list','calendar', or 'mini'.",'my-calendar')." '<code>$format</code>.'";
1143
  }
1144
  $my_calendar_body .= $mc_bottomnav;
1145
+ apply_filters("debug", "my_calendar( $name ) post full parsing");
1146
  }
1147
  }
1148
  // The actual printing is done by the shortcode function.
1149
+ $my_calendar_body .= apply_filters( 'mc_after_calendar', '', $args );
1150
  apply_filters("debug", "my_calendar( $name ) draw completed");
1151
+ return $mc_wrapper . apply_filters( 'my_calendar_body', $my_calendar_body ) . $mc_closer;
1152
  }
1153
 
1154
  function my_category_key( $category ) {
1163
  $sql = "SELECT * FROM " . MY_CALENDAR_CATEGORIES_TABLE . " $cat_limit ORDER BY category_name ASC";
1164
  $cat_details = $mcdb->get_results($sql);
1165
  $category_key .= '<div class="category-key">
1166
+ <h3>'.__('Categories','my-calendar')."</h3>\n<ul>\n";
1167
+ $subpath = (is_custom_icon())?'my-calendar-custom/':'my-calendar/images/icons/';
1168
  $path = str_replace( basename( $dir ) . '/','',$url) . $subpath;
1169
  foreach($cat_details as $cat_detail) {
1170
  $hex = ( strpos( $cat_detail->category_color,'#' ) !== 0 )?'#':'';
1171
  $title_class = sanitize_title($cat_detail->category_name);
1172
  if ( $cat_detail->category_private == 1 ) { $title_class .= " private"; }
1173
+ $url = add_query_arg( 'mcat',$cat_detail->category_id, mc_get_current_url() );
1174
  if ($cat_detail->category_icon != "" && get_option('mc_hide_icons')!='true') {
1175
+ $category_key .= '<li class="cat_'.$title_class.'"><a href="'.$url.'"><span class="category-color-sample"><img src="'.$path.$cat_detail->category_icon.'" alt="" style="background:'.$hex.$cat_detail->category_color.';" /></span>'.stripcslashes($cat_detail->category_name)."</a></li>\n";
1176
  } else {
1177
+ $category_key .= '<li class="cat_'.$title_class.'"><a href="'.$url.'"><span class="category-color-sample no-icon" style="background:'.$hex.$cat_detail->category_color.';"> &nbsp; </span>'.stripcslashes($cat_detail->category_name)."</a></li>\n";
1178
  }
1179
  }
1180
+ if ( isset( $_GET['mcat'] ) ) {
1181
+ $category_key .= "<li><a href='".mc_get_current_url()."'>".__('All Categories','my-calendar')."</a></li>";
1182
+ }
1183
  $category_key .= "</ul>\n</div>";
1184
  $category_key = apply_filters('mc_category_key',$category_key,$cat_details);
1185
  return $category_key;
1186
  }
1187
 
1188
+ function mc_rss_links( $y, $m, $next ) {
1189
+ global $wp_rewrite;
1190
  $feed = mc_feed_base().'my-calendar-rss';
1191
+ $end = "&amp;nyr=$next[yr]&amp;nmonth=$next[month]";
1192
+ $ics_extend = ( $wp_rewrite->using_permalinks() )?"my-calendar-ics/?yr=$y&amp;month=$m".$end:"my-calendar-ics&amp;yr=$y&amp;month=$m".$end;
1193
  $ics = mc_feed_base(). $ics_extend;
1194
+ $rss = "\n <li class='rss'><a href='".$feed."'>".__('Subscribe by <abbr title="Really Simple Syndication">RSS</abbr>','my-calendar')."</a></li>";
1195
+ $ical = "\n <li class='ics'><a href='".$ics."'>".__('Download as <abbr title="iCal Events Export">iCal</abbr>','my-calendar')."</a></li>";
1196
  $output = "\n
1197
+ <div class='mc-export'>
1198
+ <ul>$rss$ical</ul>
1199
+ </div>\n";
1200
  return $output;
1201
  }
1202
 
1215
  // Configure the "Next" link in the calendar
1216
  function my_calendar_next_link($cur_year,$cur_month,$cur_day,$format,$time='month') {
1217
  $next_year = $cur_year + 1;
1218
+ $next_events = ( get_option( 'mc_next_events') == '' )?__("Next",'my-calendar'):stripcslashes( get_option( 'mc_next_events') );
1219
  $num_months = get_option('mc_show_months');
1220
  $nYr = $cur_year;
1221
  if ($num_months <= 1 || $format != "list" ) {
1226
  }
1227
  } else {
1228
  $next_month = (($cur_month + $num_months) > 12)?(($cur_month + $num_months) - 12):($cur_month + $num_months);
1229
+ if ($cur_month >= (13-$num_months)) {
1230
+ $nMonth = $next_month;$nYr = $next_year;
1231
  } else {
1232
  $nMonth = $next_month;$nYr = $cur_year;
1233
+ }
1234
  }
1235
  $nDay = '';
1236
  if ( $nYr != $cur_year ) { $format = 'F, Y'; } else { $format = 'F'; }
1240
  $nDay = date('d',$nextdate);
1241
  $nYr = date('Y',$nextdate);
1242
  $nMonth = date('m',$nextdate);
1243
+ if ( $nYr != $cur_year ) { $format = 'F j, Y'; } else { $format = 'F j'; }
1244
+ $date = __('Week of ','my-calendar').date_i18n($format,mktime( 0,0,0,$nMonth,$nDay,$nYr ) );
1245
  }
1246
  if ( $time == 'day' ) {
1247
  $nextdate = strtotime( "$cur_year-$cur_month-$cur_day"."+ 1 days" );
1251
  if ( $nYr != $cur_year ) { $format = 'F j, Y'; } else { $format = 'F j'; }
1252
  $date = date_i18n($format,mktime( 0,0,0,$nMonth,$nDay,$nYr ) );
1253
  }
1254
+ $next_events = str_replace( '{date}', $date, $next_events );
1255
  $output = array('month'=>$nMonth,'yr'=>$nYr,'day'=>$nDay,'label'=>$next_events);
1256
  return $output;
1257
  }
1259
  // Configure the "Previous" link in the calendar
1260
  function my_calendar_prev_link($cur_year,$cur_month,$cur_day,$format,$time='month') {
1261
  $last_year = $cur_year - 1;
1262
+ $previous_events = ( get_option( 'mc_previous_events') == '' )?__("Previous",'my-calendar'):stripcslashes( get_option( 'mc_previous_events') );
1263
  $num_months = get_option('mc_show_months');
1264
  $pYr = $cur_year;
1265
  if ($num_months <= 1 || $format!="list" ) {
1284
  $pDay = date('d',$prevdate);
1285
  $pYr = date('Y',$prevdate);
1286
  $pMonth = date('m',$prevdate);
1287
+ if ( $pYr != $cur_year ) { $format = 'F j, Y'; } else { $format = 'F j'; }
1288
  $date = __('Week of ','my-calendar').date_i18n($format,mktime( 0,0,0,$pMonth,$pDay,$pYr ) );
1289
  }
1290
  if ( $time == 'day' ) {
1292
  $pDay = date('d',$prevdate);
1293
  $pYr = date('Y',$prevdate);
1294
  $pMonth = date('m',$prevdate);
1295
+ if ( $pYr != $cur_year ) { $format = 'F j, Y'; } else { $format = 'F j'; }
1296
  $date = date_i18n($format,mktime( 0,0,0,$pMonth,$pDay,$pYr ) );
1297
  }
1298
+ $previous_events = str_replace( '{date}', $date, $previous_events );
1299
  $output = array( 'month'=>$pMonth,'yr'=>$pYr,'day'=>$pDay,'label'=>$previous_events );
1300
  return $output;
1301
  }
1302
 
1303
+ function mc_filters( $args ) {
1304
+ $fields = explode( ',', $args );
1305
+ $return = false;
1306
+ $current_url = mc_get_current_url();
1307
+ $form = "
1308
+ <div id='mc_filters'>
1309
+ <form action='".$current_url."' method='get'>\n";
1310
+ $qsa = array();
1311
+ parse_str($_SERVER['QUERY_STRING'],$qsa);
1312
+ if ( !isset( $_GET['cid'] ) ) { $form .= '<input type="hidden" name="cid" value="all" />'; }
1313
+ foreach ($qsa as $name => $argument) {
1314
+ $name = esc_attr(strip_tags($name));
1315
+ $argument = esc_attr(strip_tags($argument));
1316
+ if ( $name == 'access' || $name == 'mcat' || $name == 'ltype' || $name == 'lvalue' && in_array( $name, $args ) ) {
1317
+ } else {
1318
+ $form .= ' <input type="hidden" name="'.$name.'" value="'.$argument.'" />'."\n";
1319
+ }
1320
+ }
1321
+ foreach ( $fields as $show ) {
1322
+ $show = trim($show);
1323
+ switch ( $show ) {
1324
+ case 'categories': $form .= my_calendar_categories_list( 'form','public','group' ); $return = true; break;
1325
+ case 'locations': $form .= my_calendar_locations_list( 'form','saved','name','group' ); $return = true; break;
1326
+ case 'access': $form .= mc_access_list( 'form','group' ); $return = true; break;
1327
+ }
1328
+ }
1329
+ $form .= "<p><input type='submit' value='".esc_attr( __( 'Filter Events','my-calendar' ) )."' /></p>
1330
+ </form></div>";
1331
+ if ( $return ) {
1332
+ return $form;
1333
+ }
1334
+ }
1335
+
1336
+ function my_calendar_categories_list( $show='list',$context='public',$group='single' ) {
1337
  global $wpdb;
1338
  $mcdb = $wpdb;
1339
  if ( get_option( 'mc_remote' ) == 'true' && function_exists('mc_remote_db') ) { $mcdb = mc_remote_db(); }
1340
+ if ( isset($_GET['mc_id']) ) { return; }
 
 
1341
  $output = '';
1342
  $current_url = mc_get_current_url();
1343
 
1344
+ $name = ($context == 'public')?'mcat':'category';
1345
+ $admin_fields = ($context == 'public')?' name="'.$name.'"':' multiple="multiple" size="5" name="'.$name.'[]" ';
1346
  $admin_label = ($context == 'public')?'':__('(select to include)','my-calendar');
1347
+ $form = ( $group == 'single' ) ? "<form action='".$current_url."' method='get'>
1348
+ <div>" : '';
1349
+ if ( $group == 'single' ) {
1350
  $qsa = array();
1351
  parse_str($_SERVER['QUERY_STRING'],$qsa);
1352
  if ( !isset( $_GET['cid'] ) ) { $form .= '<input type="hidden" name="cid" value="all" />'; }
1357
  $form .= ' <input type="hidden" name="'.$name.'" value="'.$argument.'" />'."\n";
1358
  }
1359
  }
1360
+ }
1361
+ $form .= ($show == 'list' || $group == 'group' )?'':'
1362
  </div><p>';
1363
  $public_form = ($context == 'public')?$form:'';
 
1364
 
1365
+ $categories = $mcdb->get_results( "SELECT * FROM " . MY_CALENDAR_CATEGORIES_TABLE . " ORDER BY category_id ASC" );
1366
+ if ( !empty( $categories ) && count( $categories ) >= 1 ) {
1367
  $output = "<div id='mc_categories'>\n";
1368
+ $url = mc_build_url( array( 'mcat'=>'all' ),array() );
1369
  $output .= ($show == 'list')?"
1370
  <ul>
1371
  <li><a href='$url'>".__('All Categories','my-calendar')."</a></li>":$public_form.'
1372
+ <label for="category">'.__('Categories','my-calendar').' '.$admin_label.'</label>
1373
+ <select'.$admin_fields.' id="category">
1374
  <option value="all" selected="selected">'.__('All Categories','my-calendar').'</option>'."\n";
1375
 
1376
  foreach ($categories as $category) {
1377
  $category_name = stripcslashes($category->category_name);
1378
+ $mcat = ( empty($_GET['mcat']) ) ? '' : (int) $_GET['mcat'];
 
 
 
 
1379
  if ($show == 'list') {
1380
+ $this_url = mc_build_url( array('mcat'=>$category->category_id ),array() );
1381
+ $selected = ($category->category_id == $mcat )?' class="selected"':'';
1382
+ $output .= " <li$selected><a rel='nofollow' href='$this_url'>$category_name</a></li>";
1383
+ } else {
1384
+ $selected = ($category->category_id == $mcat )?' selected="selected"':'';
1385
+ $output .= " <option$selected value='$category->category_id'>$category_name</option>\n";
1386
+ }
1387
+ }
1388
+ $output .= ( $show == 'list' )?'</ul>':'</select>';
1389
+ if ( $context != 'admin' && $show != 'list' ) {
1390
+ if ( $group == 'single' ) {
1391
+ $output .= "<input type='submit' value=".__('Submit','my-calendar')." /></p></form>";
1392
+ }
1393
+ }
1394
+ $output .= "\n</div>";
1395
+ }
1396
+ $output = apply_filters( 'mc_category_selector',$output,$categories );
1397
+ return $output;
1398
+ }
1399
+
1400
+ function mc_access_list( $show='list',$group='single' ) {
1401
+ global $wpdb;
1402
+ $mcdb = $wpdb;
1403
+ if ( get_option( 'mc_remote' ) == 'true' && function_exists('mc_remote_db') ) { $mcdb = mc_remote_db(); }
1404
+ if ( isset( $_GET['mc_id'] ) ) { return; }
1405
+ $output = '';
1406
+ $current_url = mc_get_current_url();
1407
+ $form = ( $group == 'single' ) ? "<form action='".$current_url."' method='get'>
1408
+ <div>" : '';
1409
+ if ( $group == 'single' ) {
1410
+ $qsa = array();
1411
+ parse_str($_SERVER['QUERY_STRING'],$qsa);
1412
+ if ( !isset( $_GET['cid'] ) ) { $form .= '<input type="hidden" name="cid" value="all" />'; }
1413
+ foreach ($qsa as $name => $argument) {
1414
+ $name = esc_attr(strip_tags($name));
1415
+ $argument = esc_attr(strip_tags($argument));
1416
+ if ( $name != 'access' ) {
1417
+ $form .= ' <input type="hidden" name="'.$name.'" value="'.$argument.'" />'."\n";
1418
+ }
1419
+ }
1420
+ }
1421
+ $form .= ( $show == 'list' || $group == 'group' )?'':'</div><p>';
1422
+
1423
+ $access_options = get_option( 'mc_event_access' );
1424
+ if ( !empty( $access_options ) && count( $access_options ) >= 1 ) {
1425
+ $output = "<div id='mc_access'>\n";
1426
+ $url = mc_build_url( array( 'access'=>'all' ),array() );
1427
+ $not_selected = ( !isset( $_GET['access'] ) ) ? 'selected="selected"' : '';
1428
+ $output .= ($show == 'list')?"
1429
+ <ul>
1430
+ <li><a href='$url'>".__('Accessibility Services','my-calendar')."</a></li>":$form.'
1431
+ <label for="access">'.__('Accessibility Services','my-calendar').'</label>
1432
+ <select name="access" id="access">
1433
+ <option value="all"'.$not_selected.'>'.__('No Limit','my-calendar').'</option>'."\n";
1434
+
1435
+ foreach ( $access_options as $key => $access ) {
1436
+ $access_name = $access;
1437
+ $this_access = ( empty($_GET['access']) ) ? '' : (int) $_GET['access'];
1438
+ if ( $show == 'list' ) {
1439
+ $this_url = mc_build_url( array( 'access'=>$key ),array() );
1440
+ $selected = ( $key == $this_access )?' class="selected"':'';
1441
+ $output .= " <li$selected><a rel='nofollow' href='$this_url'>$access_name</a></li>";
1442
  } else {
1443
+ $selected = ($this_access == $key )?' selected="selected"':'';
1444
+ $output .= " <option$selected value='$key'>$access_name</option>\n";
1445
  }
1446
  }
1447
  $output .= ($show == 'list')?'</ul>':'</select>';
1448
+ $output .= ( $show != 'list' && $group == 'single' )?"<p><input type='submit' value=".__('Limit by Access','my-calendar')." /></p></form>":'';
1449
  $output .= "\n</div>";
1450
  }
1451
+ $output = apply_filters('mc_access_selector',$output,$options);
1452
  return $output;
1453
  }
1454
+
1455
  // array $add == keys and values to add
1456
  // array $subtract == keys to subtract
 
1457
  function mc_build_url( $add, $subtract, $root='' ) {
1458
+ global $wp_rewrite;
1459
+ $home = '';
1460
  if ( $root != '' ) { $home = $root; }
1461
  if ( is_numeric( $root ) ) { $home = get_permalink( $root ); }
1462
  if ( $home == '' ) {
1463
  if ( is_front_page() ) {
1464
+ $home = get_bloginfo('url') . '/';
1465
  } else if ( is_home() ) {
1466
  $page = get_option('page_for_posts');
1467
+ $home = get_permalink( $page );
1468
  } else if ( is_archive() ) {
1469
  $home = ''; // an empty string seems to work best; leaving it open.
1470
  } else {
1473
  }
1474
  }
1475
  $variables = $_GET;
1476
+ $subtract = array_merge( $subtract, array( 'from','to','my-calendar-api' ) );
1477
+ foreach( $subtract as $value ) {
1478
+ unset( $variables[$value] );
1479
  }
1480
+ foreach ( $add as $key=>$value ) {
1481
  $variables[$key] = $value;
1482
  }
1483
+ unset( $variables['page_id'] );
1484
  if ( $root == '' ) {
1485
  // root is set to empty when I want to reference the current location
1486
  $char = ( $wp_rewrite->using_permalinks() || is_front_page() || is_archive() )?'?':'&amp;';
1487
  } else {
1488
  $char = ( $wp_rewrite->using_permalinks() )?'?':'&amp;'; // this doesn't work -- may *never* need to be &. Consider
1489
  }
1490
+ return $home.$char.http_build_query($variables, '', '&amp;');
1491
  }
1492
 
1493
+ function my_calendar_show_locations( $show='list',$datatype='name',$template='' ) {
1494
  global $wpdb;
1495
  $mcdb = $wpdb;
1496
+ if ( get_option( 'mc_remote' ) == 'true' && function_exists('mc_remote_db') ) { $mcdb = mc_remote_db(); }
1497
+ switch ( $datatype ) {
1498
+ case "name": case "location": $data = "location_label";break;
1499
+ case "city":$data = "location_city";break;
1500
+ case "state":$data = "location_state";break;
1501
+ case "zip":$data = "location_postcode";break;
1502
+ case "country":$data = "location_country";break;
1503
+ case "hcard":$data = "location_label";break;
1504
+ case "region":$data = "location_region";break;
1505
+ default:$data = "location_label";
1506
+ }
 
 
 
 
 
 
 
 
1507
  $locations = $mcdb->get_results("SELECT DISTINCT * FROM " . MY_CALENDAR_LOCATIONS_TABLE . " ORDER BY $data ASC" );
1508
  if ( $locations ) {
1509
  $output = "<ul class='mc-locations'>";
1538
  function my_calendar_searchform($type) {
1539
  $query = ( isset($_GET['mcs']) )?esc_attr($_GET['mcs']):'';
1540
  if ( $type == 'simple' ) {
1541
+ $url = ( get_option( 'mc_uri' ) != '' ) ? get_option( 'mc_uri' ) : home_url();
1542
+ return '
1543
+ <form role="search" method="get" id="mcsearchform" action="'.apply_filters( 'mc_search_page', $url ).'" >
1544
+ <div><label class="screen-reader-text" for="mcs">'.__('Search Events','my-calendar').'</label>
1545
+ <input type="text" value="'.stripslashes($query).'" name="mcs" id="mcs" />
1546
+ <input type="submit" id="searchsubmit" value="'.__('Search Events','my-calendar').'" />
1547
+ </div>
1548
+ </form>';
1549
  }
1550
  }
1551
 
1552
+ function my_calendar_locations_list( $show='list',$type='saved',$datatype='name', $group='single' ) {
1553
  global $wpdb;
1554
  $mcdb = $wpdb;
1555
  if ( get_option( 'mc_remote' ) == 'true' && function_exists('mc_remote_db') ) { $mcdb = mc_remote_db(); }
1556
  $output = '';
1557
+ if ( isset( $_GET['mc_id'] ) ) { return; }
 
 
1558
  if ( $type == 'saved' ) {
1559
  switch ( $datatype ) {
1560
+ case "name":$data = "location_label";break;
1561
+ case "city":$data = "location_city";break;
1562
+ case "state":$data = "location_state";break;
1563
+ case "zip":$data = "location_postcode";break;
1564
+ case "country":$data = "location_country";break;
1565
+ case "region":$data = "location_region";break;
 
 
 
 
 
 
1566
  default:$data = "location_label";
 
1567
  }
1568
  } else {
1569
  $data = $datatype;
1570
  }
1571
  $current_url = mc_get_current_url();
1572
+ if ( $type == 'saved' ) {
1573
  $locations = $mcdb->get_results("SELECT DISTINCT $data FROM " . MY_CALENDAR_LOCATIONS_TABLE . " ORDER BY $data ASC", ARRAY_A );
1574
  } else {
1575
  $data = get_option( 'mc_user_settings' );
1578
  $datatype = ($datatype=='label')?'name':$datatype;
1579
  $datatype = ($datatype=='postcode')?'zip':$datatype;
1580
  }
1581
+ if ( count( $locations ) > 1 ) {
1582
+ if ( $show == 'list' ) {
1583
  $url = mc_build_url( array('loc'=>'all','ltype'=>'all'),array() );
1584
  $output .= "<ul id='mc-locations-list'>
1585
  <li><a href='$url'>".__('Show all','my-calendar')."</a></li>\n";
1586
  } else {
1587
+ $ltype = ( !isset( $_GET['ltype'] ) ) ? $datatype : $_GET['ltype'];
1588
+ $output .= "<div id='mc_locations'>";
1589
+ $output .= ( $group == 'single' ) ? "
1590
  <form action='".$current_url."' method='get'>
1591
+ <div>" : '';
1592
+ $output .= "<input type='hidden' name='ltype' value='$ltype' />";
1593
+ if ( $group == 'single' ) {
1594
  $qsa = array();
1595
  parse_str($_SERVER['QUERY_STRING'],$qsa);
1596
+ if ( !isset( $_GET['cid'] ) ) { $output .= '<input type="hidden" name="cid" value="all" />'; }
1597
+ foreach ($qsa as $name => $argument) {
1598
+ $name = esc_attr(strip_tags($name));
1599
+ $argument = esc_attr(strip_tags($argument));
1600
+ if ($name != 'loc' && $name != 'ltype') {
1601
+ $output .= "\n ".'<input type="hidden" name="'.$name.'" value="'.$argument.'" />';
1602
+ }
1603
  }
1604
+ }
1605
  $output .= "
1606
+ <label for='mc-locations-list'>".__('Location','my-calendar')."</label>
1607
  <select name='loc' id='mc-locations-list'>
1608
  <option value='all'>".__('Show all','my-calendar')."</option>\n";
1609
  }
1612
  foreach ( $location as $key=>$value ) {
1613
  $vt = urlencode(trim($value));
1614
  $value = stripcslashes($value);
1615
+ if ( $value == '' ) continue;
1616
  if ( empty($_GET['loc']) ) {
1617
  $loc = '';
1618
  } else {
1621
  if ($show == 'list') {
1622
  $selected = ( $vt == $loc )?" class='selected'":'';
1623
  $this_url = mc_build_url( array('loc'=>$vt,'ltype'=>$datatype),array() );
1624
+ $output .= " <li$selected><a rel='nofollow' href='$this_url'>$value</a></li>\n";
1625
  } else {
1626
  $selected = ( $vt == $loc )?" selected='selected'":'';
1627
+ if ( $value != '' ) {
1628
+ $output .= " <option value='$vt'$selected>$value</option>\n";
1629
+ }
1630
  }
1631
  }
1632
  } else {
1633
  $vk = urlencode(trim($key));
1634
  $location = trim($location);
1635
+ if ( $location == '' ) continue;
1636
  if ($show == 'list') {
1637
  $selected = ($vk == $_GET['loc'])?" class='selected'":'';
1638
  $this_url = mc_build_url( array('loc'=>$vk,'ltype'=>$datatype),array() );
1639
+ $output .= " <li$selected><a rel='nofollow' href='$this_url'>$location</a></li>\n";
1640
  } else {
1641
+ $selected = ($vk == $_GET['loc'])?" selected='selected'":'';
1642
+ $output .= " <option value='$vk'$selected>$location</option>\n";
1643
+ }
1644
  }
1645
  }
1646
  if ($show == 'list') {
1647
  $output .= "</ul>";
1648
  } else {
1649
+ $output .= "</select>";
1650
+ $output .= ( $group == 'single' ) ? "<input type='submit' value=".__('Submit','my-calendar')." />
1651
+ </div>
1652
+ </form>" : '';
1653
+ $output .= "
1654
+ </div>";
1655
  }
1656
  $output = apply_filters('mc_location_selector',$output,$locations);
1657
  return $output;
my-calendar-rss.php DELETED
@@ -1,94 +0,0 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
-
4
- function my_calendar_rss() {
5
- // establish template
6
- if ( isset($_GET['mcat']) ) { $cat_id = (int) $_GET['mcat']; } else { $cat_id = false; }
7
- $template = "\n<item>
8
- <title>{title}</title>
9
- <link>{link}</link>
10
- <pubDate>{rssdate}</pubDate>
11
- <dc:creator>{author}</dc:creator>
12
- <description><![CDATA[{rss_description}]]></description>
13
- <content:encoded><![CDATA[<div class='vevent'>
14
- <h1 class='summary'>{rss_title}</h1>
15
- <div class='description'>{rss_description}</div>
16
- <p class='dtstart' title='{ical_start}'>Begins: {time} on {date}</p>
17
- <p class='dtend' title='{ical_end}'>Ends: {endtime} on {enddate}</p>
18
- <p>Recurrance: {recurs}</p>
19
- <p>Repetition: {repeats} times</p>
20
- <div class='location'>{rss_hcard}</div>
21
- {link_title}
22
- </div>]]></content:encoded>
23
- <dc:format xmlns:dc='http://purl.org/dc/elements/1.1/'>text/html</dc:format>
24
- <dc:source xmlns:dc='http://purl.org/dc/elements/1.1/'>".home_url()."</dc:source>
25
- {guid}
26
- </item>\n";
27
- if ( get_option( 'mc_use_rss_template' ) == 1 ) { $templates = get_option('mc_templates'); $template = $templates['rss']; }
28
- // add RSS headers
29
- $charset = get_bloginfo('charset');
30
- $output = '<?xml version="1.0" encoding="'.$charset.'"?>
31
- <rss version="2.0"
32
- xmlns:content="http://purl.org/rss/1.0/modules/content/"
33
- xmlns:dc="http://purl.org/dc/elements/1.1/"
34
- xmlns:atom="http://www.w3.org/2005/Atom"
35
- xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
36
- xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
37
- >
38
- <channel>
39
- <title>'. get_bloginfo('name') .' Calendar</title>
40
- <link>'. home_url() .'</link>
41
- <description>'. get_bloginfo('description') . ': My Calendar Events</description>
42
- <language>'. get_bloginfo('language') .'</language>
43
- <managingEditor>'. get_bloginfo('admin_email') .' (' . get_bloginfo('name') . ' Admin)</managingEditor>
44
- <generator>My Calendar WordPress Plugin http://www.joedolson.com/articles/my-calendar/</generator>
45
- <lastBuildDate>'. mysql2date('D, d M Y H:i:s +0000', current_time( 'timestamp' ) ) .'</lastBuildDate>
46
- <atom:link href="'. mc_get_current_url() .'" rel="self" type="application/rss+xml" />';
47
-
48
- $events = mc_get_rss_events( $cat_id );
49
- if ( is_array( $events) ) {
50
- //print_r($events);
51
- }
52
- $groups = array();
53
- foreach ( array_keys($events) as $key ) {
54
- $event =& $events[$key];
55
- if ( !in_array( $event->occur_group_id, $groups ) ) {
56
- $array = event_as_array($event);
57
- $output .= jd_draw_template( $array, $template, 'rss' );
58
- if ( $event->event_span == 1 ) {
59
- $groups[] = $event->occur_group_id;
60
- }
61
- }
62
- }
63
- $output .= '</channel>
64
- </rss>';
65
- header('Content-type: application/rss+xml');
66
- header("Pragma: no-cache");
67
- header("Expires: 0");
68
- echo mc_strip_to_xml($output);
69
- }
70
-
71
- // just a double check to try to ensure that the XML feed can be rendered.
72
- function mc_strip_to_xml($value) {
73
- $ret = "";
74
- $current;
75
- if (empty($value)) {
76
- return $ret;
77
- }
78
-
79
- $length = strlen($value);
80
- for ($i=0; $i < $length; $i++) {
81
- $current = ord($value{$i});
82
- if (($current == 0x9) ||
83
- ($current == 0xA) ||
84
- ($current == 0xD) ||
85
- (($current >= 0x20) && ($current <= 0xD7FF)) ||
86
- (($current >= 0xE000) && ($current <= 0xFFFD)) ||
87
- (($current >= 0x10000) && ($current <= 0x10FFFF))) {
88
- $ret .= chr($current);
89
- } else {
90
- $ret .= " ";
91
- }
92
- }
93
- return $ret;
94
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
my-calendar-settings.php CHANGED
@@ -1,21 +1,88 @@
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  // Display the admin configuration page
5
  function my_calendar_import() {
6
- if ( get_option('ko_calendar_imported') != 'true' ) {
7
  global $wpdb;
8
  $mcdb = $wpdb;
9
- define('KO_CALENDAR_TABLE', $mcdb->prefix . 'calendar');
10
- define('KO_CALENDAR_CATS', $mcdb->prefix . 'calendar_categories');
11
  $events = $mcdb->get_results("SELECT * FROM " . KO_CALENDAR_TABLE, 'ARRAY_A');
12
  $event_ids = array();
13
- foreach ($events as $key) {
14
- if ( $key['event_time'] == '00:00:00' ) {
15
- $endtime = '00:00:00';
16
- } else {
17
- $endtime = date('H:i:s',strtotime( "$key[event_time] +1 hour" ) );
18
- }
19
  $data = array(
20
  'event_title'=>$key['event_title'],
21
  'event_desc'=>$key['event_desc'],
@@ -34,17 +101,16 @@ function my_calendar_import() {
34
  $events_results = ( $update ) ? true : false;
35
  $event_ids[] = $mcdb->insert_id;
36
  }
37
-
38
  foreach ( $event_ids as $value ) { // propagate event instances.
39
- $sql = "SELECT event_begin, event_time, event_end, event_endtime FROM ".my_calendar_table()." WHERE event_id = $value";
40
- $event = $wpdb->get_results($sql);
41
- $event = $event[0];
42
- $dates = array( 'event_begin'=>$event->event_begin,'event_end'=>$event->event_end,'event_time'=>$event->event_time,'event_endtime'=>$event->event_endtime );
43
- $event = mc_increment_event( $value, $dates );
44
  }
45
  $cats = $mcdb->get_results("SELECT * FROM " . KO_CALENDAR_CATS, 'ARRAY_A');
46
  $catsql = "";
47
- foreach ($cats as $key) {
48
  $name = mysql_real_escape_string($key['category_name']);
49
  $color = mysql_real_escape_string($key['category_colour']);
50
  $id = (int) $key['category_id'];
@@ -57,10 +123,9 @@ function my_calendar_import() {
57
  category_color='".$color."';
58
  ";
59
  $cats_results = $mcdb->query($catsql);
60
- //$mcdb->print_error();
61
  }
62
- $message = ( $cats_results !== false )?__('Categories imported successfully.','my-calendar'):__('Categories not imported.','my-calendar');
63
- $e_message = ( $events_results !== false )?__('Events imported successfully.','my-calendar'):__('Events not imported.','my-calendar');
64
  $return = "<div id='message' class='updated fade'><ul><li>$message</li><li>$e_message</li></ul></div>";
65
  echo $return;
66
  if ( $cats_results !== false && $events_results !== false ) {
@@ -76,22 +141,21 @@ function mc_drop_table( $table ) {
76
  }
77
 
78
  function edit_my_calendar_config() {
79
- global $wpdb,$default_user_settings;
80
  $mcdb = $wpdb;
81
- // We can't use this page unless My Calendar is installed/upgraded
82
  check_my_calendar();
83
- if (!empty($_POST)) {
84
- $nonce=$_REQUEST['_wpnonce'];
85
  if (! wp_verify_nonce($nonce,'my-calendar-nonce') ) die("Security check failed");
86
  if ( isset($_POST['remigrate']) ) {
87
  echo "<div class='updated fade'><ol>";
88
- echo "<li>".__('Dropping occurrences database table','my-calendar')."</li>";
89
  mc_drop_table( 'my_calendar_event_table' ); sleep(1);
90
- echo "<li>".__('Reinstalling occurrences database table.','my-calendar')."</li>";
91
  mc_upgrade_db(); sleep(1);
92
- echo "<li>".__('Generating event occurrences.','my-calendar')."</li>";
93
  mc_migrate_db();
94
- echo "<li>".__('Event generation completed.','my-calendar')."</li>";
95
  echo "</ol></div>";
96
  }
97
  }
@@ -99,31 +163,32 @@ function edit_my_calendar_config() {
99
  // management
100
  $clear = '';
101
  $mc_event_approve = ( !empty($_POST['mc_event_approve']) && $_POST['mc_event_approve']=='on')?'true':'false';
 
102
  $mc_remote = ( !empty($_POST['mc_remote']) && $_POST['mc_remote']=='on')?'true':'false';
103
- if ( isset($_POST['mc_clear_cache']) && $_POST['mc_clear_cache'] == 'clear' ) { mc_delete_cache(); $clear = __('My Calendar Cache cleared','my-calendar'); }
104
  update_option('mc_event_approve',$mc_event_approve);
 
105
  update_option('mc_remote',$mc_remote);
106
  update_option('mc_default_sort',$_POST['mc_default_sort']);
107
-
108
  if ( get_site_option('mc_multisite') == 2 ) {
109
  $mc_current_table = (int) $_POST['mc_current_table'];
110
  update_option('mc_current_table',$mc_current_table);
111
  }
112
- echo "<div class='updated'><p><strong>".__('My Calendar Management Settings saved','my-calendar').". $clear</strong></p></div>";
113
  }
114
  if ( isset($_POST['mc_permissions'] ) ) {
115
  $perms = $_POST['mc_caps'];
116
  $caps = array(
117
- 'mc_add_events'=>__('Add Events','my-calendar'),
118
- 'mc_approve_events'=>__('Approve Events','my-calendar'),
119
- 'mc_manage_events'=>__('Manage Events','my-calendar'),
120
- 'mc_edit_cats'=>__('Edit Categories','my-calendar'),
121
- 'mc_edit_locations'=>__('Edit Locations','my-calendar'),
122
- 'mc_edit_styles'=>__('Edit Styles','my-calendar'),
123
- 'mc_edit_behaviors'=>__('Edit Behaviors','my-calendar'),
124
- 'mc_edit_templates'=>__('Edit Templates','my-calendar'),
125
- 'mc_edit_settings'=>__('Edit Settings','my-calendar'),
126
- 'mc_view_help'=>__('View Help','my-calendar')
127
  );
128
  foreach ( $perms as $key => $value ) {
129
  $role = get_role( $key );
@@ -137,29 +202,44 @@ function edit_my_calendar_config() {
137
  }
138
  }
139
  }
140
- echo "<div class='updated'><p><strong>".__('My Calendar Permissions Updated','my-calendar')."</strong></p></div>";
141
  }
142
  // output
143
- if (isset($_POST['mc_show_months']) ) {
144
-
145
- $mc_open_day_uri = ( !empty($_POST['mc_open_day_uri']) )?$_POST['mc_open_day_uri']:'';
146
- update_option('mc_uri',$_POST['mc_uri'] );
147
- update_option('mc_open_uri',( !empty($_POST['mc_open_uri']) && $_POST['mc_open_uri']=='on' && get_option('mc_uri') != '')?'true':'false');
148
  update_option('mc_mini_uri',$_POST['mc_mini_uri'] );
149
  update_option('mc_open_day_uri', $mc_open_day_uri );
150
- update_option('mc_skip_holidays_category',(int) $_POST['mc_skip_holidays_category']);
151
  update_option('mc_skip_holidays',( !empty($_POST['mc_skip_holidays']) && $_POST['mc_skip_holidays']=='on')?'true':'false');
152
  update_option('mc_display_author',( !empty($_POST['mc_display_author']) && $_POST['mc_display_author']=='on')?'true':'false');
153
  update_option('mc_show_event_vcal',( !empty($_POST['mc_show_event_vcal']) && $_POST['mc_show_event_vcal']=='on')?'true':'false');
154
- update_option('mc_show_gcal',( !empty($_POST['mc_show_gcal']) && $_POST['mc_show_gcal']=='on')?'true':'false');
155
  update_option('mc_display_jump',( !empty($_POST['mc_display_jump']) && $_POST['mc_display_jump']=='on')?'true':'false');
156
  update_option('mc_show_list_info',( !empty($_POST['mc_show_list_info']) && $_POST['mc_show_list_info']=='on')?'true':'false');
157
  update_option('mc_show_months',(int) $_POST['mc_show_months']);
158
- update_option('mc_bottomnav', $_POST['mc_bottomnav'] );
159
- update_option('mc_topnav', $_POST['mc_topnav'] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
  update_option('mc_show_map',( !empty($_POST['mc_show_map']) && $_POST['mc_show_map']=='on')?'true':'false');
161
  update_option('mc_show_address',( !empty($_POST['mc_show_address']) && $_POST['mc_show_address']=='on')?'true':'false');
162
- update_option('mc_hide_icons',( !empty($_POST['mc_hide_icons']) && $_POST['mc_hide_icons']=='on')?'false':'true');
163
  update_option('mc_event_link_expires',( !empty($_POST['mc_event_link_expires']) && $_POST['mc_event_link_expires']=='on')?'true':'false');
164
  update_option('mc_apply_color',$_POST['mc_apply_color']);
165
  update_option('mc_event_registration',( !empty($_POST['mc_event_registration']) && $_POST['mc_event_registration']=='on')?'true':'false');
@@ -172,9 +252,7 @@ function edit_my_calendar_config() {
172
  update_option('mc_show_weekends',( !empty($_POST['mc_show_weekends']) && $_POST['mc_show_weekends']=='on')?'true':'false');
173
  update_option('mc_convert',( !empty($_POST['mc_convert']) && $_POST['mc_convert']=='on')?'true':'false');
174
  update_option('mc_no_fifth_week',( !empty($_POST['mc_no_fifth_week']) && $_POST['mc_no_fifth_week']=='on')?'true':'false');
175
- $mc_ical_utc = ( !empty($_POST['mc_ical_utc']) && $_POST['mc_ical_utc']=='on')?'true':'false';
176
- update_option('mc_ical_utc',$mc_ical_utc);
177
- echo "<div class=\"updated\"><p><strong>".__('Output Settings saved','my-calendar')."</strong></p></div>";
178
  }
179
  // input
180
  if ( isset($_POST['mc_dates']) ) {
@@ -182,7 +260,9 @@ function edit_my_calendar_config() {
182
  update_option('mc_week_format',stripslashes($_POST['my_calendar_week_format']));
183
  update_option('mc_time_format',stripslashes($_POST['mc_time_format']));
184
  update_option('mc_month_format',stripslashes($_POST['mc_month_format']));
185
- echo "<div class=\"updated\"><p><strong>".__('Date/Time Format Settings saved','my-calendar')."</strong></p></div>";
 
 
186
  }
187
  if (isset($_POST['mc_input'])) {
188
  $mc_input_options_administrators = ( !empty($_POST['mc_input_options_administrators']) && $_POST['mc_input_options_administrators']=='on')?'true':'false';
@@ -196,20 +276,20 @@ function edit_my_calendar_config() {
196
  'event_open'=>( !empty($_POST['mci_event_open']) && $_POST['mci_event_open'])?'on':'',
197
  'event_location'=>( !empty($_POST['mci_event_location']) && $_POST['mci_event_location'])?'on':'',
198
  'event_location_dropdown'=>( !empty($_POST['mci_event_location_dropdown']) && $_POST['mci_event_location_dropdown'])?'on':'',
199
- 'event_use_editor'=>( !empty($_POST['mci_event_use_editor']) && $_POST['mci_event_use_editor'])?'on':'',
200
- 'event_specials'=>( !empty($_POST['mci_event_specials']) && $_POST['mci_event_specials'])?'on':''
201
  );
202
  update_option('mc_input_options',$mc_input_options);
203
  update_option('mc_input_options_administrators',$mc_input_options_administrators);
204
- echo "<div class=\"updated\"><p><strong>".__('Input Settings saved','my-calendar').".</strong></p></div>";
205
  }
206
- if ( current_user_can('manage_network') ) {
207
- if ( isset($_POST['mc_network']) ) {
208
  $mc_multisite = (int) $_POST['mc_multisite'];
209
- update_site_option('mc_multisite',$mc_multisite );
210
  $mc_multisite_show = (int) $_POST['mc_multisite_show'];
211
- update_site_option('mc_multisite_show',$mc_multisite_show );
212
- echo "<div class=\"updated\"><p><strong>".__('Multisite settings saved','my-calendar').".</strong></p></div>";
213
  }
214
  }
215
  // custom text
@@ -229,16 +309,16 @@ function edit_my_calendar_config() {
229
  $templates['title'] = $mc_title_template;
230
  $templates['label'] = $mc_details_label;
231
  $templates['link'] = $mc_link_label;
232
- update_option('mc_templates',$templates);
233
  update_option( 'mc_event_title_template', $mc_event_title_template );
234
- update_option('mc_notime_text',$mc_notime_text);
235
- update_option('mc_week_caption',$mc_week_caption);
236
- update_option('mc_next_events',$mc_next_events);
237
- update_option('mc_previous_events',$mc_previous_events);
238
- update_option('mc_caption',$my_calendar_caption);
239
- update_option('mc_event_open',$mc_event_open);
240
- update_option('mc_event_closed',$mc_event_closed);
241
- echo "<div class=\"updated\"><p><strong>".__('Custom text settings saved','my-calendar').".</strong></p></div>";
242
  }
243
  // Mail function by Roland
244
  if (isset($_POST['mc_email']) ) {
@@ -254,56 +334,24 @@ function edit_my_calendar_config() {
254
  update_option('mc_event_mail_message',$mc_event_mail_message);
255
  update_option('mc_event_mail',$mc_event_mail);
256
  update_option('mc_html_email',$mc_html_email);
257
- echo "<div class=\"updated\"><p><strong>".__('Email notice settings saved','my-calendar').".</strong></p></div>";
258
  }
259
  // Custom User Settings
260
- if (isset($_POST['mc_user'])) {
261
- $mc_user_settings_enabled = ( !empty($_POST['mc_user_settings_enabled']) && $_POST['mc_user_settings_enabled']=='on')?'true':'false';
262
- $mc_location_type = $_POST['mc_location_type'];
263
- $mc_user_settings = $_POST['mc_user_settings'];
264
- $mc_user_settings['my_calendar_tz_default']['values'] = csv_to_array($mc_user_settings['my_calendar_tz_default']['values']);
265
- $mc_user_settings['my_calendar_location_default']['values'] = csv_to_array($mc_user_settings['my_calendar_location_default']['values']);
266
- $mc_location_control = ( isset( $_POST['mc_location_control'] ) && $_POST['mc_location_control'] == 'on' )?'on':'';
267
- update_option( 'mc_location_control',$mc_location_control );
268
- update_option( 'mc_location_type',$mc_location_type );
269
- update_option( 'mc_user_settings_enabled',$mc_user_settings_enabled );
270
- update_option( 'mc_user_settings',$mc_user_settings );
271
- echo "<div class=\"updated\"><p><strong>".__('User custom settings saved','my-calendar').".</strong></p></div>";
272
- }
273
 
274
  apply_filters('mc_save_settings','', $_POST );
275
 
276
- // Pull known values out of the options table
277
- $allowed_group = get_option('mc_can_manage_events');
278
- $mc_show_months = get_option('mc_show_months');
279
- $mc_bottomnav = get_option('mc_bottomnav');
280
- $mc_topnav = get_option('mc_topnav');
281
- $mc_show_map = get_option('mc_show_map');
282
- $mc_show_address = get_option('mc_show_address');
283
- $disp_author = get_option('mc_display_author');
284
- $mc_event_link_expires = get_option('mc_event_link_expires');
285
- $mc_event_mail = get_option('mc_event_mail');
286
- $mc_event_mail_to = get_option('mc_event_mail_to');
287
- $mc_event_mail_from = get_option('mc_event_mail_from');
288
- $mc_event_mail_subject = get_option('mc_event_mail_subject');
289
- $mc_event_mail_message = get_option('mc_event_mail_message');
290
- $mc_event_approve = get_option('mc_event_approve');
291
- $mc_event_approve_perms = get_option('mc_event_approve_perms');
292
- $disp_jump = get_option('mc_display_jump');
293
- $mc_no_fifth_week = get_option('mc_no_fifth_week');
294
  $templates = get_option('mc_templates');
295
  $mc_title_template = $templates['title'];
296
  $mc_details_label = $templates['label'];
297
  $mc_link_label = $templates['link'];
298
- $mc_event_title_template = get_option('mc_event_title_template');
299
- $mc_mini_uri = get_option('mc_mini_uri');
300
  ?>
301
 
302
- <div class="wrap jd-my-calendar" id="mc_settings">
303
  <?php my_calendar_check_db();?>
304
  <div id="icon-options-general" class="icon32"><br /></div>
305
- <h2><?php _e('My Calendar Options','my-calendar'); ?></h2>
306
- <div class="postbox-container" style="width: 70%">
307
  <div class="metabox-holder">
308
  <?php
309
  //update_option( 'ko_calendar_imported','false' ); // for testing importing.
@@ -317,13 +365,13 @@ if ( get_option( 'ko_calendar_imported' ) != 'true' ) {
317
  ?>
318
  <div class='import upgrade-db'>
319
  <p>
320
- <?php _e('My Calendar has identified that you have the Calendar plugin by Kieran O\'Shea installed. You can import those events and categories into the My Calendar database. Would you like to import these events?','my-calendar'); ?>
321
  </p>
322
  <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-config"); ?>">
323
  <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div>
324
  <div>
325
  <input type="hidden" name="import" value="true" />
326
- <input type="submit" value="<?php _e('Import from Calendar','my-calendar'); ?>" name="import-calendar" class="button-primary" />
327
  </div>
328
  </form>
329
  </div>
@@ -334,20 +382,20 @@ if ( get_option( 'ko_calendar_imported' ) != 'true' ) {
334
 
335
  <div class="ui-sortable meta-box-sortables">
336
  <div class="postbox">
337
- <h3><?php _e('My Calendar Settings','my-calendar'); ?></h3>
338
  <div class="inside">
339
- <ul class="mc-settings">
340
- <li><a href="#my-calendar-manage"><?php _e('Management','my-calendar'); ?></a></li>
341
- <li><a href="#my-calendar-text"><?php _e('Customizable Text','my-calendar'); ?></a></li>
342
- <li><a href="#my-calendar-output"><?php _e('Output','my-calendar'); ?></a></li>
343
- <li><a href="#my-calendar-time"><?php _e('Date/Time','my-calendar'); ?></a></li>
344
- <li><a href="#my-calendar-input"><?php _e('Input','my-calendar'); ?></a></li>
345
  <?php if ( current_user_can('manage_network') ) { ?>
346
- <li><a href="#my-calendar-multisite"><?php _e('Multi-site','my-calendar'); ?></a></li>
347
  <?php } ?>
348
- <li><a href="#my-calendar-permissions"><?php _e('Permissions','my-calendar'); ?></a></li>
349
- <li><a href="#my-calendar-email"><?php _e('Email Notifications','my-calendar'); ?></a></li>
350
- <li><a href="#my-calendar-user"><?php _e('Individual Users','my-calendar'); ?></a></li>
351
  </ul>
352
  </div>
353
  </div>
@@ -355,64 +403,48 @@ if ( get_option( 'ko_calendar_imported' ) != 'true' ) {
355
 
356
  <div class="ui-sortable meta-box-sortables">
357
  <div class="postbox" id="my-calendar-manage">
358
- <h3><?php _e('My Calendar Management','my-calendar'); ?></h3>
359
  <div class="inside">
360
  <?php if ( current_user_can('administrator') ) { ?>
361
  <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-config"); ?>">
362
  <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div>
363
  <fieldset>
364
- <legend><?php _e('Calendar Options: Management','my-calendar'); ?></legend>
365
  <ul>
366
- <li><input type="checkbox" id="mc_remote" name="mc_remote" <?php mc_is_checked('mc_remote','true'); ?> /> <label for="mc_remote"><?php _e('Get data (events, categories and locations) from a remote database.','my-calendar'); ?></label></li>
367
  <?php if ( get_option('mc_remote') == 'true' ) { ?>
368
- <li><?php _e('Add this code to your theme\'s <code>functions.php</code> file:','my-calendar'); ?>
369
  <pre>function mc_remote_db() {
370
  $mcdb = new wpdb('DB_USER','DB_PASSWORD','DB_NAME','DB_ADDRESS');
371
  return $mcdb;
372
  }</pre>
373
- <?php _e('You will need to allow remote connections from this site to the site hosting your My Calendar events. Replace the above placeholders with the host-site information. The two sites must have the same WP table prefix. While this option is enabled, you may not enter or edit events through this installation.','my-calendar'); ?>
374
  </li>
375
  <?php } ?>
376
- <li><input type="checkbox" id="mc_event_approve" name="mc_event_approve" <?php mc_is_checked('mc_event_approve','true'); ?> /> <label for="mc_event_approve"><?php _e('Enable approval options.','my-calendar'); ?></label> </li>
 
377
  <?php
378
  if ( apply_filters( 'mc_caching_clear', false ) ) { ?>
379
- <li><input type="checkbox" id="mc_clear_cache" name="mc_clear_cache" value="clear" /> <label for="mc_clear_cache"><?php _e('Clear current cache. (Necessary if you edit shortcodes to change displayed categories, for example.)','my-calendar'); ?></label>
380
- </li>
381
  <?php } ?>
382
- <li>
383
- <label for="mc_default_sort"><?php _e('Default Sort order for Admin Events List','my-calendar'); ?></label>
384
- <select id="mc_default_sort" name="mc_default_sort">
385
- <option value='1' <?php mc_is_selected( 'mc_default_sort','1'); ?>><?php _e('Event ID','my-calendar'); ?></option>
386
- <option value='2' <?php mc_is_selected( 'mc_default_sort','2'); ?>><?php _e('Title','my-calendar'); ?></option>
387
- <option value='3' <?php mc_is_selected( 'mc_default_sort','3'); ?>><?php _e('Description','my-calendar'); ?></option>
388
- <option value='4' <?php mc_is_selected( 'mc_default_sort','4'); ?>><?php _e('Start Date','my-calendar'); ?></option>
389
- <option value='5' <?php mc_is_selected( 'mc_default_sort','5'); ?>><?php _e('Author','my-calendar'); ?></option>
390
- <option value='6' <?php mc_is_selected( 'mc_default_sort','6'); ?>><?php _e('Category','my-calendar'); ?></option>
391
- <option value='7' <?php mc_is_selected( 'mc_default_sort','7'); ?>><?php _e('Location Name','my-calendar'); ?></option>
392
- </select>
393
- </li>
394
- <?php if ( get_site_option('mc_multisite') == 2 && MY_CALENDAR_TABLE != MY_CALENDAR_GLOBAL_TABLE ) { ?>
395
- <li>
396
- <input type="radio" name="mc_current_table" id="mc0" value="0"<?php echo jd_option_selected(get_option('mc_current_table'),0); ?> /> <label for="mc0"><?php _e('Currently editing my local calendar','my-calendar'); ?></label>
397
- </li>
398
- <li>
399
- <input type="radio" name="mc_current_table" id="mc1" value="1"<?php echo jd_option_selected(get_option('mc_current_table'),1); ?> /> <label for="mc1"><?php _e('Currently editing the network calendar','my-calendar'); ?></label>
400
- </li>
401
- <?php } else { ?>
402
- <?php if ( get_option('mc_remote') != 'true' && current_user_can('manage_network') ) { ?>
403
- <li><?php _e('You are currently working in the primary site for this network; your local calendar is also the global table.','my-calendar'); ?></li>
404
- <?php } ?>
405
- <?php } ?>
406
- <li><input type="checkbox" id="remigrate" name="remigrate" value="migrate" /> <label for="remigrate"><?php _e('Re-generate event occurrences table.','my-calendar'); ?></label>
407
- </li>
408
  </ul>
409
  </fieldset>
410
  <p>
411
- <input type="submit" name="mc_manage" class="button-primary" value="<?php _e('Save Management Settings','my-calendar'); ?>" />
412
  </p>
413
  </form>
414
  <?php } else { ?>
415
- <?php _e('My Calendar management settings are only available to administrators.','my-calendar'); ?>
416
  <?php } ?>
417
  </div>
418
  </div>
@@ -420,43 +452,28 @@ if ( get_option( 'ko_calendar_imported' ) != 'true' ) {
420
 
421
  <div class="ui-sortable meta-box-sortables">
422
  <div class="postbox" id="my-calendar-text">
423
- <h3><?php _e('Calendar Text Settings','my-calendar'); ?></h3>
424
  <div class="inside">
425
  <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-config"); ?>">
426
  <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div>
427
  <fieldset>
428
- <legend><?php _e('Calendar Options: Customizable Text Fields','my-calendar'); ?></legend>
429
  <ul>
430
- <li><label for="mc_notime_text"><?php _e('Label for all-day events','my-calendar'); ?></label> <input type="text" id="mc_notime_text" name="mc_notime_text" size="30" value="<?php if ( get_option('mc_notime_text') == "") { _e('N/A','my-calendar'); } else { echo esc_attr( stripslashes( get_option('mc_notime_text') ) ); } ?>" /> </li>
431
- <li><label for="mc_previous_events"><?php _e('Previous events link','my-calendar'); ?></label> <input type="text" id="mc_previous_events" name="mc_previous_events" size="30" value="<?php if ( get_option('mc_previous_events') == "") { _e('Previous Events','my-calendar'); } else { echo esc_attr( stripslashes( get_option('mc_previous_events') ) ); } ?>" /> <?php _e('Use <code>{date}</code> to display the appropriate date in navigation.','my-calendar'); ?> </li>
432
- <li><label for="mc_next_events"><?php _e('Next events link','my-calendar'); ?></label> <input type="text" id="mc_next_events" name="mc_next_events" size="30" value="<?php if ( get_option('mc_next_events') == "") { _e('Next Events','my-calendar'); } else { echo esc_attr( stripslashes( get_option('mc_next_events') ) ); } ?>" /> <?php _e('Use <code>{date}</code> to display the appropriate date in navigation.','my-calendar'); ?> </li>
433
- <li><label for="mc_event_open"><?php _e('If events are open','my-calendar'); ?></label> <input type="text" id="mc_event_open" name="mc_event_open" size="30" value="<?php if ( get_option('mc_event_open') == "") { _e('Registration is open','my-calendar'); } else { echo esc_attr( stripslashes( get_option('mc_event_open') ) ); } ?>" /> </li>
434
- <li><label for="mc_event_closed"><?php _e('If events are closed','my-calendar'); ?></label> <input type="text" id="mc_event_closed" name="mc_event_closed" size="30" value="<?php if ( get_option('mc_event_closed') == "") { _e('Registration is closed','my-calendar'); } else { echo esc_attr( stripslashes( get_option('mc_event_closed') ) ); } ?>" /> </li>
435
- <li><label for="mc_week_caption"><?php _e('Week view caption:','my-calendar'); ?></label> <input type="text" id="mc_week_caption" name="mc_week_caption" size="30" value="<?php echo esc_attr( stripslashes( get_option('mc_week_caption') ) ); ?>" /> <?php _e('Available tag: <code>{date format=""}</code>','my-calendar'); ?></li>
436
- <li><label for="my_calendar_caption"><?php _e('Extended caption:','my-calendar'); ?></label> <input type="text" id="my_calendar_caption" name="my_calendar_caption" size="30" value="<?php echo esc_attr( stripslashes( get_option('mc_caption') ) ); ?>" /> <?php _e('Caption shows month/year in list/grid formats. Follows after month/year.','my-calendar'); ?></li>
437
- <li>
438
- <label for="mc_title_template"><?php _e('Event title template','my-calendar'); ?></label>
439
- <input type="text" name="mc_title_template" id="mc_title_template" size="30" value="<?php echo stripslashes(esc_attr($mc_title_template)); ?>" /> <?php _e('All template tags are available.','my-calendar'); ?></small>
440
- </li>
441
- <li>
442
- <label for="mc_details_label"><?php _e('Event details link text','my-calendar'); ?></label>
443
- <input type="text" name="mc_details_label" id="mc_details_label" size="30" value="<?php echo stripslashes(esc_attr($mc_details_label)); ?>" /><?php _e('Tags: <code>{title}</code>, <code>{location}</code>, <code>{color}</code>, <code>{icon}</code>, <code>{date}</code>, <code>{time}</code>.','my-calendar'); ?>
444
- </li>
445
- <li>
446
- <label for="mc_link_label"><?php _e('Event URL link text','my-calendar'); ?></label>
447
- <input type="text" name="mc_link_label" id="mc_link_label" size="30" value="<?php echo stripslashes(esc_attr($mc_link_label)); ?>" />
448
- <a href="<?php echo admin_url("admin.php?page=my-calendar-help#templates"); ?>"><?php _e("Templating Help",'my-calendar'); ?></a> <?php _e('All template tags are available.','my-calendar'); ?>
449
- </li>
450
- <li>
451
- <?php $mc_ett_current = ( $mc_event_title_template ) ? $mc_event_title_template : "{title} &raquo; {date}"; ?>
452
- <label for="mc_event_title_template"><?php _e('Title element template','my-calendar'); ?></label>
453
- <input type="text" name="mc_event_title_template" id="mc_event_title_template" size="30" value="<?php echo stripslashes(esc_attr($mc_event_title_template)); ?>" />
454
- <a href="<?php echo admin_url("admin.php?page=my-calendar-help#templates"); ?>"><?php _e("Templating Help",'my-calendar'); ?></a> <?php _e('All template tags are available.','my-calendar'); ?> <?php printf( __('Current: %s', 'my-calendar' ), "<code>$mc_ett_current</code>" ); ?>
455
- </li>
456
  </ul>
457
  </fieldset>
458
  <p>
459
- <input type="submit" name="save" class="button-primary" value="<?php _e('Save Custom Text Settings','my-calendar'); ?>" />
460
  </p>
461
  </form>
462
  </div>
@@ -465,175 +482,117 @@ if ( get_option( 'ko_calendar_imported' ) != 'true' ) {
465
 
466
  <div class="ui-sortable meta-box-sortables">
467
  <div class="postbox" id="my-calendar-output">
468
- <h3><?php _e('Calendar Output Settings','my-calendar'); ?></h3>
469
  <div class="inside">
470
- <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-config"); ?>">
471
  <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div>
472
  <fieldset>
473
- <legend><?php _e('Calendar Options: Customize the Output of your Calendar','my-calendar'); ?></legend>
474
- <fieldset>
475
- <legend><?php _e('Calendar Link Targets','my-calendar'); ?></legend>
476
  <ul>
477
- <li>
478
- <?php $guess = mc_guess_calendar(); $mc_uri = get_option( 'mc_uri' ); ?>
479
- <label for="mc_uri"><?php _e('Where is your main calendar page?','my-calendar'); ?></label>
480
- <input type="text" name="mc_uri" id="mc_uri" size="60" value="<?php echo esc_url($mc_uri); ?>" /><br /><small><?php _e('Can be any Page or Post which includes the <code>[my_calendar]</code> shortcode.','my-calendar'); ?> <?php echo $guess; ?></small>
481
- </li>
482
- <li>
483
- <label for="mc_mini_uri"><?php _e('Target <abbr title="Uniform resource locator">URL</abbr> for mini calendar date links:','my-calendar'); ?></label>
484
- <input type="text" name="mc_mini_uri" id="mc_mini_uri" size="60" value="<?php echo esc_url($mc_mini_uri); ?>" /><br /><small><?php _e('Can be any Page or Post which includes the <code>[my_calendar]</code> shortcode.','my-calendar'); ?></small>
485
- </li>
486
- <li><strong><?php _e('Modify date and event link behaviors:','my-calendar'); ?></strong></li>
487
- <li>
488
- <input type="checkbox" id="mc_open_uri" name="mc_open_uri"<?php if ( $mc_uri == '' ) { echo ' disabled="disabled"'; } ?> <?php mc_is_checked('mc_open_uri','true'); ?> /> <label for="mc_open_uri"><?php _e('Open calendar links to event details URL','my-calendar'); ?></label> (<?php _e('Replaces pop-up in grid view.','my-calendar'); ?>)
489
- </li>
490
- <li>
491
- <label for="mc_open_day_uri"><?php _e('Mini calendar widget date links to:','my-calendar'); ?></label> <select id="mc_open_day_uri" name="mc_open_day_uri"<?php if ( !$mc_uri && !$mc_mini_uri ) { echo ' disabled="disabled"'; } ?>>
492
- <option value='false'<?php echo jd_option_selected(get_option('mc_open_day_uri'),'false','option'); ?>><?php _e('jQuery pop-up view','my-calendar'); ?></option>
493
- <option value='true'<?php echo jd_option_selected(get_option('mc_open_day_uri'),'true','option'); ?>><?php _e('daily view page (above)','my-calendar'); ?></option>
494
- <option value='listanchor'<?php echo jd_option_selected(get_option('mc_open_day_uri'),'listanchor','option'); ?>><?php _e('in-page anchor on main calendar page (list)','my-calendar'); ?></option>
495
- <option value='calendaranchor'<?php echo jd_option_selected(get_option('mc_open_day_uri'),'calendaranchor','option'); ?>><?php _e('in-page anchor on main calendar page (grid)','my-calendar'); ?></option>
496
- </select>
497
- (<?php _e('Replaces pop-up in mini calendar','my-calendar'); ?>)
498
- </li>
499
- <li><input type="checkbox" id="mc_ical_utc" name="mc_ical_utc" <?php mc_is_checked('mc_ical_utc','true'); ?> /> <label for="mc_ical_utc"><?php _e('iCal times are UTC','my-calendar'); ?></label>
500
  </ul>
501
  <?php // End General Options // ?>
502
  </fieldset>
503
 
504
  <fieldset>
505
- <legend><?php _e('General Layout Options','my-calendar'); ?></legend>
506
- <p><?php _e('Comma-separated list to indicate what order the navigational elements of My Calendar should appear in.','my-calendar'); ?></p>
507
- <ul>
508
- <li>
509
- <label for="mc_topnav"><?php _e('Show above the calendar:','my-calendar'); ?></label><br />
510
- <input type="text" id="mc_topnav" name="mc_topnav" size="60" value="<?php echo esc_attr($mc_topnav); ?>" /> <?php _e('Default: <code>nav,toggle,jump,print,timeframe</code>','my-calendar'); ?>
511
- </li>
512
- <li>
513
- <label for="mc_bottomnav"><?php _e('Show below the calendar:','my-calendar'); ?></label><br />
514
- <input type="text" id="mc_bottomnav" name="mc_bottomnav" size="60" value="<?php echo esc_attr($mc_bottomnav); ?>" /> <?php _e('Default: <code>key,feeds</code>','my-calendar'); ?>
515
- </li>
516
- </ul>
517
- <?php // End Grid Options // ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
518
  </fieldset>
519
 
520
  <fieldset>
521
- <legend><?php _e('Grid Layout Options','my-calendar'); ?></legend>
522
  <ul>
523
- <li>
524
- <input type="checkbox" id="mc_show_weekends" name="mc_show_weekends" <?php mc_is_checked('mc_show_weekends','true'); ?> /> <label for="mc_show_weekends"><?php _e('Show Weekends on Calendar','my-calendar'); ?></label>
525
- </li>
526
- <li>
527
- <input type="checkbox" id="mc_convert" name="mc_convert" <?php mc_is_checked('mc_convert','true'); ?> /> <label for="mc_convert"><?php _e('Switch to list view on mobile devices','my-calendar'); ?></label>
528
- </li>
529
  </ul>
530
  <?php // End Grid Options // ?>
531
  </fieldset>
532
 
533
  <fieldset>
534
- <legend><?php _e('List Layout Options','my-calendar'); ?></legend>
535
  <ul>
536
- <li>
537
- <label for="mc_show_months"><?php _e('How many months of events to show at a time:','my-calendar'); ?></label> <input type="text" size="3" id="mc_show_months" name="mc_show_months" value="<?php echo $mc_show_months; ?>" />
538
- </li>
539
- <li>
540
- <input type="checkbox" id="mc_show_list_info" name="mc_show_list_info" <?php mc_is_checked( 'mc_show_list_info','true' ); ?> /> <label for="mc_show_list_info"><?php _e('Show the first event\'s title and the number of events that day next to the date.','my-calendar'); ?></label>
541
- </li>
542
  </ul>
543
  <?php // End List Options // ?>
544
  </fieldset>
545
 
546
  <fieldset>
547
- <legend><?php _e('Event Details Pop-up','my-calendar'); ?></legend>
548
- <p><?php _e('The checked items will be shown in your event details view. Does not apply if you are using a custom template','my-calendar'); ?>
549
- <ul class="columns">
550
- <li>
551
- <input type="checkbox" id="mc_display_author" name="mc_display_author" <?php mc_is_checked('mc_display_author','true'); ?> /> <label for="mc_display_jump"><?php _e('Author\'s name','my-calendar'); ?></label>
552
- </li>
553
- <li>
554
- <input type="checkbox" id="mc_show_event_vcal" name="mc_show_event_vcal" <?php mc_is_checked('mc_show_event_vcal','true'); ?> /> <label for="mc_show_event_vcal"><?php _e('Link to single event iCal download','my-calendar'); ?></label>
555
- </li>
556
- <li>
557
- <input type="checkbox" id="mc_show_gcal" name="mc_show_gcal" <?php mc_is_checked('mc_show_gcal','true'); ?> /> <label for="mc_show_gcal"><?php _e('Link to submit event to Google Calendar','my-calendar'); ?></label>
558
- </li>
559
- <li>
560
- <input type="checkbox" id="mc_hide_icons" name="mc_hide_icons" <?php mc_is_checked('mc_hide_icons','false'); ?> /> <label for="mc_hide_icons"><?php _e('Category icons','my-calendar'); ?></label>
561
- </li>
562
- <li>
563
- <input type="checkbox" id="mc_show_map" name="mc_show_map" <?php mc_is_checked('mc_show_map','true'); ?> /> <label for="mc_show_map"><?php _e('Link to Google Map','my-calendar'); ?></label>
564
- </li>
565
- <li>
566
- <input type="checkbox" id="mc_show_address" name="mc_show_address" <?php mc_is_checked('mc_show_address','true'); ?> /> <label for="mc_show_address"><?php _e('Event Address','my-calendar'); ?></label>
567
- </li>
568
- <li>
569
- <input type="checkbox" id="mc_short" name="mc_short" <?php mc_is_checked('mc_short','true'); ?> /> <label for="mc_short"><?php _e('Short description','my-calendar'); ?></label>
570
- </li>
571
- <li>
572
- <input type="checkbox" id="mc_desc" name="mc_desc" <?php mc_is_checked('mc_desc','true'); ?> /> <label for="mc_desc"><?php _e('Full description','my-calendar'); ?></label>
573
- </li>
574
- <li>
575
- <input type="checkbox" id="mc_process_shortcodes" name="mc_process_shortcodes" <?php mc_is_checked('mc_process_shortcodes','true'); ?> /> <label for="mc_process_shortcodes"><?php _e('Process WordPress shortcodes in descriptions','my-calendar'); ?></label>
576
- </li>
577
- <li>
578
- <input type="checkbox" id="mc_details" name="mc_details" <?php mc_is_checked('mc_details','true'); ?> /> <label for="mc_details"><?php _e('Link to event details (requires <a href=\'#mc_uri\'>URL</a>)','my-calendar'); ?></label>
579
- </li>
580
- <li>
581
- <input type="checkbox" id="mc_event_link" name="mc_event_link" <?php mc_is_checked('mc_event_link','true'); ?> /> <label for="mc_event_link"><?php _e('External link','my-calendar'); ?></label>
582
- </li>
583
- <li>
584
- <input type="checkbox" id="mc_event_registration" name="mc_event_registration" <?php mc_is_checked('mc_event_registration','true'); ?> /> <label for="mc_event_registration"><?php _e('Availability status','my-calendar'); ?></label>
585
- </li>
586
- <li>
587
- <input type="checkbox" id="mc_event_link_expires" name="mc_event_link_expires" <?php mc_is_checked('mc_event_link_expires','true'); ?> /> <label for="mc_event_link_expires"><?php _e('Event links expire after event passes.','my-calendar'); ?></label>
588
- </li>
589
- </ul>
590
  </fieldset>
591
  <fieldset>
592
- <legend><?php _e('Event Category Display','my-calendar'); ?></legend>
593
- <ul class='columns'>
594
- <li>
595
- <input type="radio" id="mc_acn" name="mc_apply_color" value="default" <?php if ( get_option('mc_apply_color' ) == '' ) { echo 'checked="checked"'; } else { mc_is_checked('mc_apply_color','default'); } ?> /> <label for="mc_acn"><?php _e('No category colors with titles.','my-calendar'); ?></label><br />
596
- <input type="radio" id="mc_act" name="mc_apply_color" value="font" <?php mc_is_checked('mc_apply_color','font'); ?> /> <label for="mc_act"><?php _e('Titles are in category colors.','my-calendar'); ?></label><br />
597
- <input type="radio" id="mc_abt" name="mc_apply_color" value="background" <?php mc_is_checked('mc_apply_color','background'); ?> /> <label for="mc_abt"><?php _e('Titles have category color as background.','my-calendar'); ?></label>
598
- </li>
599
- <li>
600
- <input type="checkbox" id="mc_inverse_color" name="mc_inverse_color" <?php mc_is_checked('mc_inverse_color','true'); ?> /> <label for="mc_inverse_color"><?php _e('Optimize contrast for category colors.','my-calendar'); ?></label>
601
- </li>
602
- </ul>
603
  <?php // End Event Options // ?>
604
  </fieldset>
605
  <fieldset>
606
- <legend><?php _e('Event Scheduling Defaults','my-calendar'); ?></legend>
607
- <ul>
608
- <li>
609
- <input type="checkbox" id="mc_no_fifth_week" name="mc_no_fifth_week" value="on" <?php mc_is_checked('mc_no_fifth_week','true'); ?> /> <label for="mc_no_fifth_week"><?php _e('Default setting for event input: If a recurring event is scheduled for a date which doesn\'t exist (such as the 5th Wednesday in February), move it back one week.','my-calendar'); ?></label>
610
- </li>
611
- <li>
612
- <label for="mc_shc"><?php _e('Holiday Category','my-calendar'); ?></label>
613
- <select id="mc_shc" name="mc_skip_holidays_category">
614
- <option value=''> -- <?php _e('None','my-calendar'); ?> -- </option>
615
- <?php
616
- // Grab all the categories and list them
617
- $sql = "SELECT * FROM " . my_calendar_categories_table();
618
- $cats = $mcdb->get_results($sql);
619
- foreach($cats as $cat) {
620
- echo '<option value="'.$cat->category_id.'"';
621
- if ( get_option('mc_skip_holidays_category') == $cat->category_id ){
622
- echo ' selected="selected"';
623
- }
624
- echo '>'.stripslashes($cat->category_name)."</option>\n";
625
- }
626
- ?>
627
- </select>
628
- </li>
629
- <li>
630
- <input type="checkbox" id="mc_skip_holidays" name="mc_skip_holidays" <?php mc_is_checked('mc_skip_holidays','true'); ?> /> <label for="mc_skip_holidays"><?php _e('Default setting for event input: If an event coincides with an event in the designated "Holiday" category, do not show the event.','my-calendar'); ?></label>
631
- </li>
632
- </ul>
633
  <?php // End Scheduling Options // ?>
634
  </fieldset>
635
- </fieldset>
636
- <p><input type="submit" name="save" class="button-primary" value="<?php _e('Save Output Settings','my-calendar'); ?>" /></p>
637
  </form>
638
  </div>
639
  </div>
@@ -641,32 +600,32 @@ if ( get_option( 'ko_calendar_imported' ) != 'true' ) {
641
 
642
  <div class="ui-sortable meta-box-sortables">
643
  <div class="postbox" id="my-calendar-time">
644
- <h3><?php _e('Calendar Time Formats','my-calendar'); ?></h3>
645
  <div class="inside">
646
  <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-config"); ?>">
647
  <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div>
648
  <fieldset>
649
- <legend><?php _e('Set default date/time formats','my-calendar'); ?></legend>
650
  <div><input type='hidden' name='mc_dates' value='true' /></div>
651
- <ul class="two-columns">
652
- <li class='mc-month-format'>
653
- <label for='mc_month_format'><?php _e('Month format (calendar headings)','my-calendar'); ?></label><br /><input type="text" id="mc_month_format" name="mc_month_format" value="<?php if ( get_option('mc_month_format') == "") { echo ''; } else { echo esc_attr( get_option( 'mc_month_format') ); } ?>" /> <code><?php _e('Now:','my-calendar'); ?> <?php if ( get_option('mc_month_format') == '') { echo date_i18n( 'F Y' ); } else { echo date_i18n( get_option('mc_month_format') ); } ?></code>
654
- <li class='mc-time-format'>
655
- <label for="mc_time_format"><?php _e('Time format','my-calendar'); ?></label><br /><input type="text" id="mc_time_format" name="mc_time_format" value="<?php if ( get_option('mc_time_format') == "") { echo ''; } else { echo esc_attr( get_option( 'mc_time_format') ); } ?>" /> <code><?php _e('Now:','my-calendar'); ?> <?php if ( get_option('mc_time_format') == '') { echo date_i18n( get_option('time_format') ); } else { echo date_i18n( get_option('mc_time_format') ); } ?></code>
656
- </li>
657
- <li class='mc-week-format'>
658
- <label for="mc_week_format"><?php _e('Date in grid mode, week view','my-calendar'); ?></label><br /><input type="text" id="mc_week_format" name="my_calendar_week_format" value="<?php if ( get_option('mc_week_format') == "") { echo ''; } else { echo esc_attr( get_option( 'mc_week_format') ); } ?>" /> <code><?php _e('Now:','my-calendar'); ?> <?php if ( get_option('mc_week_format') == '') { echo date_i18n('M j, \'y'); } else { echo date_i18n( get_option('mc_week_format') ); } ?></code>
659
- </li>
660
- <li class='mc-date-format'>
661
- <label for="mc_date_format"><?php _e('Date Format in other views','my-calendar'); ?></label><br /><input type="text" id="mc_date_format" name="mc_date_format" value="<?php if ( get_option('mc_date_format') == "") { echo esc_attr( get_option('date_format') ); } else { echo esc_attr( get_option( 'mc_date_format') ); } ?>" /> <code><?php _e('Now:','my-calendar'); ?> <?php if ( get_option('mc_date_format') == '') { echo date_i18n(get_option('date_format')); } else { echo date_i18n( get_option('mc_date_format') ); } ?></code>
662
- </li>
663
  <li>
664
- <?php _e('Date formats use the same syntax as the <a href="http://php.net/date">PHP <code>date()</code> function</a>. Save options to update sample output.','my-calendar'); ?>
665
- </li>
 
666
  </ul>
667
  </fieldset>
668
  <p>
669
- <input type="submit" name="save" class="button-primary" value="<?php _e('Save Date/Time Settings','my-calendar'); ?>" />
670
  </p>
671
  </form>
672
  </div>
@@ -676,35 +635,35 @@ if ( get_option( 'ko_calendar_imported' ) != 'true' ) {
676
 
677
  <div class="ui-sortable meta-box-sortables">
678
  <div class="postbox" id="my-calendar-input">
679
- <h3><?php _e('Calendar Input Settings','my-calendar'); ?></h3>
680
  <div class="inside">
681
  <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-config"); ?>">
682
  <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div>
683
  <fieldset>
684
- <legend><?php _e('Select which input fields will be available when adding or editing events.','my-calendar'); ?></legend>
685
  <div><input type='hidden' name='mc_input' value='true' /></div>
686
- <ul class="columns">
687
  <?php
688
  $input_options = get_option('mc_input_options');
689
- $input_labels = array('event_location_dropdown'=>__('Event Location Dropdown Menu','my-calendar'),'event_short'=>__('Event Short Description field','my-calendar'),'event_desc'=>__('Event Description Field','my-calendar'),'event_category'=>__('Event Category field','my-calendar'),'event_image'=>__('Event Image field','my-calendar'),'event_link'=>__('Event Link field','my-calendar'),'event_recurs'=>__('Event Recurrence Options','my-calendar'),'event_open'=>__('Event Registration options','my-calendar'),'event_location'=>__('Event Location fields','my-calendar'),'event_use_editor'=>__('Use HTML Editor in Event Description Field','my-calendar'),'event_specials'=>__('Set Special Scheduling options','my-calendar') );
690
  $output = '';
691
  // if input options isn't an array, we'll assume that this plugin wasn't upgraded properly, and reset them to the default.
692
  if ( !is_array($input_options) ) {
693
- update_option( 'mc_input_options',array('event_short'=>'on','event_desc'=>'on','event_category'=>'on','event_image'=>'on','event_link'=>'on','event_recurs'=>'on','event_open'=>'on','event_location'=>'on','event_location_dropdown'=>'on','event_use_editor'=>'on','event_specials'=>'on' ) );
694
  }
695
- foreach ($input_options as $key=>$value) {
696
  $checked = ($value == 'on')?"checked='checked'":'';
697
- $output .= "<li><input type=\"checkbox\" id=\"mci_$key\" name=\"mci_$key\" $checked /> <label for=\"mci_$key\">$input_labels[$key]</label></li>";
 
 
698
  }
699
  echo $output;
700
  ?>
701
- <li>
702
- <input type="checkbox" id="mc_input_options_administrators" name="mc_input_options_administrators" <?php mc_is_checked('mc_input_options_administrators','true'); ?> /> <label for="mc_input_options_administrators"><strong><?php _e('Administrators see all input options','my-calendar'); ?></strong></label>
703
- </li>
704
  </ul>
705
  </fieldset>
706
  <p>
707
- <input type="submit" name="save" class="button-primary" value="<?php _e('Save Input Settings','my-calendar'); ?>" />
708
  </p>
709
  </form>
710
  </div>
@@ -714,27 +673,27 @@ if ( get_option( 'ko_calendar_imported' ) != 'true' ) {
714
  <?php if ( current_user_can('manage_network') ) { ?>
715
  <div class="ui-sortable meta-box-sortables">
716
  <div class="postbox" id="my-calendar-multisite">
717
- <h3><?php _e('Multisite Settings (Network Administrators only)','my-calendar'); ?></h3>
718
  <div class="inside">
719
  <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-config"); ?>">
720
  <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div>
721
  <div><input type='hidden' name='mc_network' value='true' /></div>
722
  <fieldset>
723
- <legend><?php _e('Settings for WP MultiSite configurations','my-calendar'); ?></legend>
724
- <p><?php _e('The central calendar is the calendar associated with the primary site in your WordPress Multisite network.','my-calendar'); ?></p>
725
  <ul>
726
- <li><input type="radio" value="0" id="ms0" name="mc_multisite"<?php echo jd_option_selected(get_site_option('mc_multisite'),'0'); ?> /> <label for="ms0"><?php _e('Site owners may only post to their local calendar','my-calendar'); ?></label></li>
727
- <li><input type="radio" value="1" id="ms1" name="mc_multisite"<?php echo jd_option_selected(get_site_option('mc_multisite'),'1'); ?> /> <label for="ms1"><?php _e('Site owners may only post to the central calendar','my-calendar'); ?></label></li>
728
- <li><input type="radio" value="2" id="ms2" name="mc_multisite"<?php echo jd_option_selected(get_site_option('mc_multisite'),2); ?> /> <label for="ms2"><?php _e('Site owners may manage either calendar','my-calendar'); ?></label></li>
729
  </ul>
730
- <p class="notice"><strong>*</strong> <?php _e('Changes only effect input permissions. Public-facing calendars will be unchanged.','my-calendar'); ?></p>
731
  <ul>
732
- <li><input type="radio" value="0" id="mss0" name="mc_multisite_show"<?php echo jd_option_selected(get_site_option('mc_multisite_show'),'0'); ?> /> <label for="mss0"><?php _e('Sub-site calendars show events from their local calendar.','my-calendar'); ?></label></li>
733
- <li><input type="radio" value="1" id="mss1" name="mc_multisite_show"<?php echo jd_option_selected(get_site_option('mc_multisite_show'),'1'); ?> /> <label for="mss1"><?php _e('Sub-site calendars show events from the central calendar.','my-calendar'); ?></label></li>
734
  </ul>
735
  </fieldset>
736
  <p>
737
- <input type="submit" name="save" class="button-primary" value="<?php _e('Save Multisite Settings','my-calendar'); ?>" />
738
  </p>
739
  </form>
740
  </div>
@@ -744,14 +703,12 @@ if ( get_option( 'ko_calendar_imported' ) != 'true' ) {
744
 
745
  <div class="ui-sortable meta-box-sortables">
746
  <div class="postbox" id="my-calendar-permissions">
747
- <h3><?php _e('My Calendar Permissions','my-calendar'); ?></h3>
748
- <div class="inside">
749
  <?php if ( current_user_can('administrator') ) { ?>
750
 
751
  <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-config"); ?>">
752
  <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div>
753
- <fieldset>
754
- <legend><?php _e('Calendar Options: Permissions','my-calendar'); ?></legend>
755
  <?php
756
  function mc_check_caps($role,$cap) {
757
  $role = get_role($role);
@@ -763,35 +720,43 @@ if ( get_option( 'ko_calendar_imported' ) != 'true' ) {
763
  global $wp_roles;
764
  $roles = $wp_roles->get_names();
765
  $caps = array(
766
- 'mc_add_events'=>__('Add Events','my-calendar'),
767
- 'mc_approve_events'=>__('Approve Events','my-calendar'),
768
- 'mc_manage_events'=>__('Manage Events','my-calendar'),
769
- 'mc_edit_cats'=>__('Edit Categories','my-calendar'),
770
- 'mc_edit_locations'=>__('Edit Locations','my-calendar'),
771
- 'mc_edit_styles'=>__('Edit Styles','my-calendar'),
772
- 'mc_edit_behaviors'=>__('Edit Behaviors','my-calendar'),
773
- 'mc_edit_templates'=>__('Edit Templates','my-calendar'),
774
- 'mc_edit_settings'=>__('Edit Settings','my-calendar'),
775
- 'mc_view_help'=>__('View Help','my-calendar')
776
  );
 
777
  foreach ( $roles as $role=>$rolename ) {
778
  if ( $role == 'administrator' ) continue;
779
- echo "<fieldset id='mc_$role' class='roles'><legend>$rolename</legend><ul>";
780
- echo "<li><input type='hidden' value='none' name='mc_caps[".$role."][none]' /></li>";
 
 
781
  foreach( $caps as $cap=>$name ) {
782
- echo mc_cap_checkbox( $role, $cap,$name );
783
  }
784
- echo "</ul></fieldset>";
 
785
  }
 
 
 
 
 
786
 
787
  ?>
788
- </fieldset>
789
  <p>
790
- <input type="submit" name="mc_permissions" class="button-primary" value="<?php _e('Save Permissions','my-calendar'); ?>" />
791
  </p>
792
  </form>
793
  <?php } else { ?>
794
- <?php _e('My Calendar permission settings are only available to administrators.','my-calendar'); ?>
795
  <?php } ?>
796
  </div>
797
  </div>
@@ -799,141 +764,37 @@ if ( get_option( 'ko_calendar_imported' ) != 'true' ) {
799
 
800
  <div class="ui-sortable meta-box-sortables">
801
  <div class="postbox" id="my-calendar-email">
802
- <h3><?php _e('Calendar Email Settings','my-calendar'); ?></h3>
803
  <div class="inside">
804
  <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-config"); ?>">
805
  <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div>
806
  <fieldset>
807
- <legend><?php _e('Calendar Options: Email Notifications','my-calendar'); ?></legend>
808
- <div><input type='hidden' name='mc_email' value='true' /></div>
809
  <ul>
810
- <li>
811
- <input type="checkbox" id="mc_event_mail" name="mc_event_mail" <?php mc_is_checked('mc_event_mail','true'); ?> /> <label for="mc_event_mail"><strong><?php _e('Send Email Notifications when new events are scheduled or reserved.','my-calendar'); ?></strong></label>
812
- </li>
813
- <li>
814
- <label for="mc_event_mail_to"><?php _e('Notification messages are sent to: ','my-calendar'); ?></label> <input type="text" id="mc_event_mail_to" name="mc_event_mail_to" size="40" value="<?php if ( get_option('mc_event_mail_to') == "") { bloginfo('admin_email'); } else { echo stripslashes(esc_attr( get_option('mc_event_mail_to')) ); } ?>" />
815
- </li>
816
- <li>
817
- <label for="mc_event_mail_from"><?php _e('Notification messages are sent from: ','my-calendar'); ?></label> <input type="text" id="mc_event_mail_from" name="mc_event_mail_from" size="40" value="<?php if ( get_option('mc_event_mail_from') == "") { bloginfo('admin_email'); } else { echo stripslashes(esc_attr( get_option('mc_event_mail_from')) ); } ?>" />
818
- </li>
819
- <li>
820
- <label for="mc_event_mail_subject"><?php _e('Email subject','my-calendar'); ?></label> <input type="text" id="mc_event_mail_subject" name="mc_event_mail_subject" size="60" value="<?php if ( get_option('mc_event_mail_subject') == "") { bloginfo('name'); echo ': '; _e('New event Added','my-calendar'); } else { echo stripslashes(esc_attr( get_option('mc_event_mail_subject') ) ); } ?>" />
821
- </li>
822
- <li>
823
- <label for="mc_event_mail_message"><?php _e('Message Body','my-calendar'); ?></label><br /> <textarea rows="6" cols="80" id="mc_event_mail_message" name="mc_event_mail_message"><?php if ( get_option('mc_event_mail_message') == "") { _e('New Event:','my-calendar'); echo "\n{title}: {date}, {time} - {event_status}"; } else { echo stripslashes( esc_attr( get_option('mc_event_mail_message') ) ); } ?></textarea><br />
824
- <a href="<?php echo admin_url("admin.php?page=my-calendar-help#templates"); ?>"><?php _e("Shortcode Help",'my-calendar'); ?></a> <?php _e('All template shortcodes are available.','my-calendar'); ?>
825
- </li>
826
- <li>
827
- <input type="checkbox" id="mc_html_email" name="mc_html_email" <?php mc_is_checked('mc_html_email','true'); ?> /> <label for="mc_html_email"><?php _e('Send HTML email','my-calendar'); ?></label>
828
- </li>
829
  </ul>
830
  </fieldset>
831
  <p>
832
- <input type="submit" name="save" class="button-primary" value="<?php _e('Save Email Settings','my-calendar'); ?>" />
833
  </p>
834
  </form>
835
  </div>
836
  </div>
837
  </div>
838
 
839
- <div class="ui-sortable meta-box-sortables">
840
- <div class="postbox" id="my-calendar-user">
841
- <h3><?php _e('Calendar User Settings','my-calendar'); ?></h3>
842
- <div class="inside">
843
- <?php if ( current_user_can('edit_users') ) { ?>
844
- <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-config"); ?>">
845
- <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div>
846
- <div><input type='hidden' name='mc_user' value='true' /></div>
847
-
848
- <fieldset>
849
- <legend><?php _e('Settings which can be configured in registered user\'s accounts','my-calendar'); ?></legend>
850
- <p>
851
- <input type="checkbox" id="mc_user_settings_enabled" name="mc_user_settings_enabled" value="on" <?php mc_is_checked('mc_user_settings_enabled','true'); ?> /> <label for="mc_user_settings_enabled"><strong><?php _e('Allow registered users to provide timezone or location presets in their user profiles.','my-calendar'); ?></strong></label>
852
- </p>
853
-
854
- <?php
855
-
856
- $mc_user_settings = get_option('mc_user_settings');
857
- if (!is_array($mc_user_settings)) {
858
- update_option( 'mc_user_settings', $default_user_settings );
859
- $mc_user_settings = get_option('mc_user_settings');
860
- }
861
- ?>
862
- <fieldset>
863
- <legend><?php _e('Timezone Settings','my-calendar'); ?></legend>
864
- <p><?php _e('These settings provide registered users with the ability to select a time zone in their user profile. When they view your calendar, the times for events will display the time the event happens in their time zone as well as the entered value.','my-calendar'); ?></p>
865
- <p>
866
- <input type="checkbox" id="tz_enabled" name="mc_user_settings[my_calendar_tz_default][enabled]" <?php mc_is_checked('mc_user_settings','on','my_calendar_tz_default'); ?> /> <label for="tz_enabled"><?php _e('Enable Timezone','my-calendar'); ?></label>
867
- </p>
868
- <p>
869
- <label for="tz_label"><?php _e('Select Timezone Label','my-calendar'); ?></label> <input type="text" name="mc_user_settings[my_calendar_tz_default][label]" id="tz_label" value="<?php echo stripslashes(esc_attr($mc_user_settings['my_calendar_tz_default']['label'])); ?>" size="40" />
870
- </p>
871
- <p>
872
- <label for="tz_values"><?php _e('Timezone Options','my-calendar'); ?> (<?php _e('Value, Label; one per line','my-calendar'); ?>)</label><br />
873
- <?php
874
- $timezones = '';
875
- foreach ( $mc_user_settings['my_calendar_tz_default']['values'] as $key=>$value ) {
876
- $timezones .= stripslashes("$key,$value")."\n";
877
- }
878
- ?>
879
- <textarea name="mc_user_settings[my_calendar_tz_default][values]" id="tz_values" cols="80" rows="6"><?php echo trim($timezones); ?></textarea>
880
- </p>
881
- </fieldset>
882
-
883
- <fieldset>
884
- <legend><?php _e('Location Settings','my-calendar'); ?></legend>
885
- <p><?php _e('These settings provide registered users with the ability to select a location in their user profile. When they view your calendar, their initial view will be limited to locations which include that location parameter. These values can also be used to generate custom location filtering options using the <code>my_calendar_locations</code> shortcode. It is not necessary to enable these settings for users to use the custom filtering options.','my-calendar'); ?></p>
886
- <p>
887
- <input type="checkbox" id="loc_enabled" name="mc_user_settings[my_calendar_location_default][enabled]" <?php mc_is_checked('mc_user_settings','on','my_calendar_location_default'); ?> /> <label for="loc_enabled"><?php _e('Enable Location','my-calendar'); ?></label>
888
- </p>
889
- <p>
890
- <input type="checkbox" id="loc_control" name="mc_location_control" <?php mc_is_checked('mc_location_control','on' ); ?> /> <label for="loc_control"><?php _e('Use this location list as input control','my-calendar'); ?></label> (<?php _e('The normal text entry for this location type will be replaced by a drop down containing these choices.','my-calendar'); ?>)
891
- </p>
892
- <p>
893
- <label for="loc_label"><?php _e('Select Location Label','my-calendar'); ?></label> <input type="text" name="mc_user_settings[my_calendar_location_default][label]" id="loc_label" value="<?php echo stripslashes( esc_attr( $mc_user_settings['my_calendar_location_default']['label'] ) ); ?>" size="40" />
894
- </p>
895
- <p>
896
- <label for="loc_values"><?php _e('Location Options','my-calendar'); ?> (<?php _e('Value, Label; one per line','my-calendar'); ?>)</label><br />
897
- <?php
898
- $locations = '';
899
- foreach ( $mc_user_settings['my_calendar_location_default']['values'] as $key=>$value ) {
900
- $locations .= stripslashes("$key,$value")."\n";
901
- }
902
- ?>
903
- <textarea name="mc_user_settings[my_calendar_location_default][values]" id="loc_values" cols="80" rows="6"><?php echo trim($locations); ?></textarea>
904
- </p>
905
- <p>
906
- <label for="loc_type"><?php _e('Location Type','my-calendar'); ?></label><br />
907
- <select id="loc_type" name="mc_location_type">
908
- <option value="event_label" <?php mc_is_selected( 'mc_location_type','event_label' ); ?>><?php _e('Location Name','my-calendar'); ?></option>
909
- <option value="event_city" <?php mc_is_selected( 'mc_location_type','event_city' ); ?>><?php _e('City','my-calendar'); ?></option>
910
- <option value="event_state" <?php mc_is_selected( 'mc_location_type','event_state'); ?>><?php _e('State/Province','my-calendar'); ?></option>
911
- <option value="event_country" <?php mc_is_selected( 'mc_location_type','event_country'); ?>><?php _e('Country','my-calendar'); ?></option>
912
- <option value="event_postcode" <?php mc_is_selected( 'mc_location_type','event_postcode'); ?>><?php _e('Postal Code','my-calendar'); ?></option>
913
- <option value="event_region" <?php mc_is_selected( 'mc_location_type','event_region'); ?>><?php _e('Region','my-calendar'); ?></option>
914
- </select>
915
- </p>
916
- </fieldset>
917
- </fieldset>
918
- <p>
919
- <input type="submit" name="save" class="button-primary" value="<?php _e('Save User Settings','my-calendar'); ?>" />
920
- </p>
921
- </form>
922
- <?php } else { ?>
923
- <?php _e('Only users with the ability to edit user accounts may modify user settings.','my-calendar'); ?>
924
- <?php } ?>
925
- </div>
926
- </div>
927
-
928
- <?php $mc_settings = apply_filters( 'mc_after_settings','' ); echo $mc_settings; ?>
929
 
930
- </div>
931
  </div>
932
  </div>
933
 
934
- <?php jd_show_support_box(); ?>
935
 
936
  </div>
937
  <?php
938
- }
939
- ?>
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
 
4
+ function mc_settings_field( $name, $label, $default='', $note='', $atts=array( 'size'=>'30' ), $type='text' ) {
5
+ $options = $attributes = '';
6
+ if ( is_array( $atts ) && !empty( $atts ) ) {
7
+ foreach ( $atts as $key => $value ) { $attributes .= " $key='$value'"; }
8
+ }
9
+ $value = ( get_option( $name ) != '' ) ? stripslashes( esc_attr( get_option( $name ) ) ) : $default ;
10
+ switch ( $type ) {
11
+ case 'text':
12
+ case 'url':
13
+ case 'email':
14
+ if ( $note ) {
15
+ $note = sprintf( $note, "<code>$value</code>" );
16
+ $note = "<span id='$name-note'>$note</span>"; $aria = " aria-describedby='$name-note'";
17
+ } else {
18
+ $note = $aria = '';
19
+ }
20
+ echo "<label for='$name'>$label</label> <input type='$type' id='$name' name='$name' value='$value'$aria$attributes /> $note";
21
+ break;
22
+ case 'textarea':
23
+ if ( $note ) {
24
+ $note = sprintf( $note, "<code>$value</code>" );
25
+ $note = "<span id='$name-note'>$note</span>"; $aria = " aria-describedby='$name-note'";
26
+ } else {
27
+ $note = $aria = '';
28
+ }
29
+ echo "<label for='$name'>$label</label><br /><textarea id='$name' name='$name'$aria$attributes>$value</textarea>$note";
30
+ break;
31
+ case 'checkbox-single':
32
+ $checked = mc_is_checked( $name, 'true', '', true );
33
+ if ( $note ) {
34
+ $note = sprintf( $note, "<code>$value</code>" );
35
+ } else {
36
+ $note = '';
37
+ }
38
+ echo "<input type='checkbox' id='$name' name='$name' value='on' $checked$attributes /> <label for='$name' class='checkbox-label'>$label $note</label>";
39
+ break;
40
+ case 'checkbox':
41
+ case 'radio':
42
+ if ( $note ) {
43
+ $note = sprintf( $note, "<code>$value</code>" );
44
+ $note = "<span id='$name-note'>$note</span>"; $aria = " aria-describedby='$name-note'";
45
+ } else {
46
+ $note = $aria = '';
47
+ }
48
+ foreach ( $label as $k => $v ) {
49
+ $checked = ( $k == $value ) ? ' checked="checked"' : '';
50
+ $options .= "<li><input type='radio' id='$name-$k' value='$k' name='$name'$aria$attributes$checked /> <label for='$name-$k'>$v</label></li>";
51
+ }
52
+ echo "$options $note";
53
+ break;
54
+ case 'select':
55
+ if ( $note ) {
56
+ $note = sprintf( $note, "<code>$value</code>" );
57
+ $note = "<span id='$name-note'>$note</span>"; $aria = " aria-describedby='$name-note'";
58
+ } else {
59
+ $note = $aria = '';
60
+ }
61
+ foreach ( $default as $k => $v ) {
62
+ $checked = ( $k == $value ) ? ' selected="selected"' : '';
63
+ $options .= "<option value='$k'$checked>$v</option>";
64
+ }
65
+ echo "
66
+ <label for='$name'>$label</label>
67
+ <select id='$name' name='$name'$aria$attributes />
68
+ $options
69
+ </select>
70
+ $note";
71
+ break;
72
+ }
73
+ }
74
+
75
  // Display the admin configuration page
76
  function my_calendar_import() {
77
+ if ( get_option( 'ko_calendar_imported' ) != 'true' ) {
78
  global $wpdb;
79
  $mcdb = $wpdb;
80
+ define( 'KO_CALENDAR_TABLE', $mcdb->prefix . 'calendar' );
81
+ define( 'KO_CALENDAR_CATS', $mcdb->prefix . 'calendar_categories' );
82
  $events = $mcdb->get_results("SELECT * FROM " . KO_CALENDAR_TABLE, 'ARRAY_A');
83
  $event_ids = array();
84
+ foreach ( $events as $key ) {
85
+ $endtime = ( $key['event_time'] == '00:00:00' ) ? '00:00:00' : date( 'H:i:s',strtotime( "$key[event_time] +1 hour" ) );
 
 
 
 
86
  $data = array(
87
  'event_title'=>$key['event_title'],
88
  'event_desc'=>$key['event_desc'],
101
  $events_results = ( $update ) ? true : false;
102
  $event_ids[] = $mcdb->insert_id;
103
  }
 
104
  foreach ( $event_ids as $value ) { // propagate event instances.
105
+ $sql = "SELECT event_begin, event_time, event_end, event_endtime FROM ".my_calendar_table()." WHERE event_id = $value";
106
+ $event = $wpdb->get_results($sql);
107
+ $event = $event[0];
108
+ $dates = array( 'event_begin'=>$event->event_begin,'event_end'=>$event->event_end,'event_time'=>$event->event_time,'event_endtime'=>$event->event_endtime );
109
+ $event = mc_increment_event( $value, $dates );
110
  }
111
  $cats = $mcdb->get_results("SELECT * FROM " . KO_CALENDAR_CATS, 'ARRAY_A');
112
  $catsql = "";
113
+ foreach ( $cats as $key ) {
114
  $name = mysql_real_escape_string($key['category_name']);
115
  $color = mysql_real_escape_string($key['category_colour']);
116
  $id = (int) $key['category_id'];
123
  category_color='".$color."';
124
  ";
125
  $cats_results = $mcdb->query($catsql);
 
126
  }
127
+ $message = ( $cats_results !== false )?__( 'Categories imported successfully.','my-calendar' ):__( 'Categories not imported.','my-calendar' );
128
+ $e_message = ( $events_results !== false )?__( 'Events imported successfully.','my-calendar' ):__( 'Events not imported.','my-calendar' );
129
  $return = "<div id='message' class='updated fade'><ul><li>$message</li><li>$e_message</li></ul></div>";
130
  echo $return;
131
  if ( $cats_results !== false && $events_results !== false ) {
141
  }
142
 
143
  function edit_my_calendar_config() {
144
+ global $wpdb;
145
  $mcdb = $wpdb;
 
146
  check_my_calendar();
147
+ if ( !empty( $_POST ) ) {
148
+ $nonce = $_REQUEST['_wpnonce'];
149
  if (! wp_verify_nonce($nonce,'my-calendar-nonce') ) die("Security check failed");
150
  if ( isset($_POST['remigrate']) ) {
151
  echo "<div class='updated fade'><ol>";
152
+ echo "<li>".__( 'Dropping occurrences database table','my-calendar' )."</li>";
153
  mc_drop_table( 'my_calendar_event_table' ); sleep(1);
154
+ echo "<li>".__( 'Reinstalling occurrences database table.','my-calendar' )."</li>";
155
  mc_upgrade_db(); sleep(1);
156
+ echo "<li>".__( 'Generating event occurrences.','my-calendar' )."</li>";
157
  mc_migrate_db();
158
+ echo "<li>".__( 'Event generation completed.','my-calendar' )."</li>";
159
  echo "</ol></div>";
160
  }
161
  }
163
  // management
164
  $clear = '';
165
  $mc_event_approve = ( !empty($_POST['mc_event_approve']) && $_POST['mc_event_approve']=='on')?'true':'false';
166
+ $mc_api_enabled = ( !empty($_POST['mc_api_enabled']) && $_POST['mc_api_enabled']=='on')?'true':'false';
167
  $mc_remote = ( !empty($_POST['mc_remote']) && $_POST['mc_remote']=='on')?'true':'false';
168
+ if ( isset($_POST['mc_clear_cache']) && $_POST['mc_clear_cache'] == 'clear' ) { mc_delete_cache(); $clear = __( 'My Calendar Cache cleared','my-calendar' ); }
169
  update_option('mc_event_approve',$mc_event_approve);
170
+ update_option('mc_api_enabled',$mc_api_enabled);
171
  update_option('mc_remote',$mc_remote);
172
  update_option('mc_default_sort',$_POST['mc_default_sort']);
 
173
  if ( get_site_option('mc_multisite') == 2 ) {
174
  $mc_current_table = (int) $_POST['mc_current_table'];
175
  update_option('mc_current_table',$mc_current_table);
176
  }
177
+ echo "<div class='updated'><p><strong>".__( 'My Calendar Management Settings saved','my-calendar' ).". $clear</strong></p></div>";
178
  }
179
  if ( isset($_POST['mc_permissions'] ) ) {
180
  $perms = $_POST['mc_caps'];
181
  $caps = array(
182
+ 'mc_add_events'=>__( 'Add Events','my-calendar' ),
183
+ 'mc_approve_events'=>__( 'Approve Events','my-calendar' ),
184
+ 'mc_manage_events'=>__( 'Manage Events','my-calendar' ),
185
+ 'mc_edit_cats'=>__( 'Edit Categories','my-calendar' ),
186
+ 'mc_edit_locations'=>__( 'Edit Locations','my-calendar' ),
187
+ 'mc_edit_styles'=>__( 'Edit Styles','my-calendar' ),
188
+ 'mc_edit_behaviors'=>__( 'Edit Behaviors','my-calendar' ),
189
+ 'mc_edit_templates'=>__( 'Edit Templates','my-calendar' ),
190
+ 'mc_edit_settings'=>__( 'Edit Settings','my-calendar' ),
191
+ 'mc_view_help'=>__( 'View Help','my-calendar' )
192
  );
193
  foreach ( $perms as $key => $value ) {
194
  $role = get_role( $key );
202
  }
203
  }
204
  }
205
+ echo "<div class='updated'><p><strong>".__( 'My Calendar Permissions Updated','my-calendar' )."</strong></p></div>";
206
  }
207
  // output
208
+ if ( isset( $_POST['mc_show_months'] ) ) {
209
+ $mc_open_day_uri = ( !empty( $_POST['mc_open_day_uri'] ) ) ? $_POST['mc_open_day_uri'] : '';
210
+ update_option( 'mc_uri',$_POST['mc_uri'] );
211
+ update_option( 'mc_use_permalinks', ( !empty( $_POST['mc_use_permalinks'] ) ) ?'true' : 'false' );
212
+ update_option( 'mc_open_uri',( !empty($_POST['mc_open_uri']) && $_POST['mc_open_uri']=='on' && get_option('mc_uri') != '') ? 'true':'false' );
213
  update_option('mc_mini_uri',$_POST['mc_mini_uri'] );
214
  update_option('mc_open_day_uri', $mc_open_day_uri );
 
215
  update_option('mc_skip_holidays',( !empty($_POST['mc_skip_holidays']) && $_POST['mc_skip_holidays']=='on')?'true':'false');
216
  update_option('mc_display_author',( !empty($_POST['mc_display_author']) && $_POST['mc_display_author']=='on')?'true':'false');
217
  update_option('mc_show_event_vcal',( !empty($_POST['mc_show_event_vcal']) && $_POST['mc_show_event_vcal']=='on')?'true':'false');
218
+ update_option('mc_show_gcal',( !empty($_POST['mc_show_gcal']) && $_POST['mc_show_gcal']=='on')?'true':'false');
219
  update_option('mc_display_jump',( !empty($_POST['mc_display_jump']) && $_POST['mc_display_jump']=='on')?'true':'false');
220
  update_option('mc_show_list_info',( !empty($_POST['mc_show_list_info']) && $_POST['mc_show_list_info']=='on')?'true':'false');
221
  update_option('mc_show_months',(int) $_POST['mc_show_months']);
222
+ // calculate sequence for navigation elements
223
+ $top = $bottom = array();
224
+ $nav = $_POST['mc_nav'];
225
+ $set = 'top';
226
+ foreach ( $nav as $n ) {
227
+ if ( $n == 'calendar' ) {
228
+ $set = 'bottom';
229
+ } else {
230
+ if ( $set == 'top' ) {
231
+ $top[] = $n;
232
+ } else {
233
+ $bottom[] = $n;
234
+ }
235
+ }
236
+ if ( $n == 'stop' ) { break; }
237
+ }
238
+ update_option( 'mc_bottomnav', implode( ',' ,$bottom ) );
239
+ update_option( 'mc_topnav', implode( ',' ,$top ) );
240
  update_option('mc_show_map',( !empty($_POST['mc_show_map']) && $_POST['mc_show_map']=='on')?'true':'false');
241
  update_option('mc_show_address',( !empty($_POST['mc_show_address']) && $_POST['mc_show_address']=='on')?'true':'false');
242
+ update_option('mc_hide_icons',( !empty($_POST['mc_hide_icons']) && $_POST['mc_hide_icons']=='on')?'true':'false');
243
  update_option('mc_event_link_expires',( !empty($_POST['mc_event_link_expires']) && $_POST['mc_event_link_expires']=='on')?'true':'false');
244
  update_option('mc_apply_color',$_POST['mc_apply_color']);
245
  update_option('mc_event_registration',( !empty($_POST['mc_event_registration']) && $_POST['mc_event_registration']=='on')?'true':'false');
252
  update_option('mc_show_weekends',( !empty($_POST['mc_show_weekends']) && $_POST['mc_show_weekends']=='on')?'true':'false');
253
  update_option('mc_convert',( !empty($_POST['mc_convert']) && $_POST['mc_convert']=='on')?'true':'false');
254
  update_option('mc_no_fifth_week',( !empty($_POST['mc_no_fifth_week']) && $_POST['mc_no_fifth_week']=='on')?'true':'false');
255
+ echo "<div class=\"updated\"><p><strong>".__( 'Output Settings saved','my-calendar' )."</strong></p></div>";
 
 
256
  }
257
  // input
258
  if ( isset($_POST['mc_dates']) ) {
260
  update_option('mc_week_format',stripslashes($_POST['my_calendar_week_format']));
261
  update_option('mc_time_format',stripslashes($_POST['mc_time_format']));
262
  update_option('mc_month_format',stripslashes($_POST['mc_month_format']));
263
+ $mc_ical_utc = ( !empty($_POST['mc_ical_utc']) && $_POST['mc_ical_utc']=='on')?'true':'false';
264
+ update_option('mc_ical_utc',$mc_ical_utc);
265
+ echo "<div class=\"updated\"><p><strong>".__( 'Date/Time Format Settings saved','my-calendar' )."</strong></p></div>";
266
  }
267
  if (isset($_POST['mc_input'])) {
268
  $mc_input_options_administrators = ( !empty($_POST['mc_input_options_administrators']) && $_POST['mc_input_options_administrators']=='on')?'true':'false';
276
  'event_open'=>( !empty($_POST['mci_event_open']) && $_POST['mci_event_open'])?'on':'',
277
  'event_location'=>( !empty($_POST['mci_event_location']) && $_POST['mci_event_location'])?'on':'',
278
  'event_location_dropdown'=>( !empty($_POST['mci_event_location_dropdown']) && $_POST['mci_event_location_dropdown'])?'on':'',
279
+ 'event_specials'=>( !empty($_POST['mci_event_specials']) && $_POST['mci_event_specials'])?'on':'',
280
+ 'event_access'=>( !empty($_POST['mci_event_access']) && $_POST['mci_event_access'])?'on':''
281
  );
282
  update_option('mc_input_options',$mc_input_options);
283
  update_option('mc_input_options_administrators',$mc_input_options_administrators);
284
+ echo "<div class=\"updated\"><p><strong>".__( 'Input Settings saved','my-calendar' ).".</strong></p></div>";
285
  }
286
+ if ( current_user_can( 'manage_network' ) ) {
287
+ if ( isset( $_POST['mc_network'] ) ) {
288
  $mc_multisite = (int) $_POST['mc_multisite'];
289
+ update_site_option( 'mc_multisite',$mc_multisite );
290
  $mc_multisite_show = (int) $_POST['mc_multisite_show'];
291
+ update_site_option( 'mc_multisite_show',$mc_multisite_show );
292
+ echo "<div class=\"updated\"><p><strong>".__( 'Multisite settings saved','my-calendar' ).".</strong></p></div>";
293
  }
294
  }
295
  // custom text
309
  $templates['title'] = $mc_title_template;
310
  $templates['label'] = $mc_details_label;
311
  $templates['link'] = $mc_link_label;
312
+ update_option( 'mc_templates',$templates);
313
  update_option( 'mc_event_title_template', $mc_event_title_template );
314
+ update_option( 'mc_notime_text',$mc_notime_text );
315
+ update_option( 'mc_week_caption',$mc_week_caption );
316
+ update_option( 'mc_next_events',$mc_next_events );
317
+ update_option( 'mc_previous_events',$mc_previous_events );
318
+ update_option( 'mc_caption',$my_calendar_caption );
319
+ update_option( 'mc_event_open',$mc_event_open );
320
+ update_option( 'mc_event_closed',$mc_event_closed );
321
+ echo "<div class=\"updated\"><p><strong>".__( 'Custom text settings saved','my-calendar' ).".</strong></p></div>";
322
  }
323
  // Mail function by Roland
324
  if (isset($_POST['mc_email']) ) {
334
  update_option('mc_event_mail_message',$mc_event_mail_message);
335
  update_option('mc_event_mail',$mc_event_mail);
336
  update_option('mc_html_email',$mc_html_email);
337
+ echo "<div class=\"updated\"><p><strong>".__( 'Email notice settings saved','my-calendar' ).".</strong></p></div>";
338
  }
339
  // Custom User Settings
 
 
 
 
 
 
 
 
 
 
 
 
 
340
 
341
  apply_filters('mc_save_settings','', $_POST );
342
 
343
+ // pull templates for passing into functions.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
344
  $templates = get_option('mc_templates');
345
  $mc_title_template = $templates['title'];
346
  $mc_details_label = $templates['label'];
347
  $mc_link_label = $templates['link'];
 
 
348
  ?>
349
 
350
+ <div class="wrap jd-my-calendar mc-settings-page" id="mc_settings">
351
  <?php my_calendar_check_db();?>
352
  <div id="icon-options-general" class="icon32"><br /></div>
353
+ <h2><?php _e('My Calendar Options','my-calendar' ); ?></h2>
354
+ <div class="postbox-container jcd-wide">
355
  <div class="metabox-holder">
356
  <?php
357
  //update_option( 'ko_calendar_imported','false' ); // for testing importing.
365
  ?>
366
  <div class='import upgrade-db'>
367
  <p>
368
+ <?php _e('My Calendar has identified that you have the Calendar plugin by Kieran O\'Shea installed. You can import those events and categories into the My Calendar database. Would you like to import these events?','my-calendar' ); ?>
369
  </p>
370
  <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-config"); ?>">
371
  <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div>
372
  <div>
373
  <input type="hidden" name="import" value="true" />
374
+ <input type="submit" value="<?php _e('Import from Calendar','my-calendar' ); ?>" name="import-calendar" class="button-primary" />
375
  </div>
376
  </form>
377
  </div>
382
 
383
  <div class="ui-sortable meta-box-sortables">
384
  <div class="postbox">
385
+ <h3><?php _e('My Calendar Settings','my-calendar' ); ?></h3>
386
  <div class="inside">
387
+ <ul class="mc-settings checkboxes">
388
+ <li><a href="#my-calendar-manage"><?php _e('Management','my-calendar' ); ?></a></li>
389
+ <li><a href="#my-calendar-text"><?php _e('Customizable Text','my-calendar' ); ?></a></li>
390
+ <li><a href="#my-calendar-output"><?php _e('Output','my-calendar' ); ?></a></li>
391
+ <li><a href="#my-calendar-time"><?php _e('Date/Time','my-calendar' ); ?></a></li>
392
+ <li><a href="#my-calendar-input"><?php _e('Input','my-calendar' ); ?></a></li>
393
  <?php if ( current_user_can('manage_network') ) { ?>
394
+ <li><a href="#my-calendar-multisite"><?php _e('Multi-site','my-calendar' ); ?></a></li>
395
  <?php } ?>
396
+ <li><a href="#my-calendar-permissions"><?php _e('Permissions','my-calendar' ); ?></a></li>
397
+ <li><a href="#my-calendar-email"><?php _e('Email Notifications','my-calendar' ); ?></a></li>
398
+ <?php echo apply_filters( 'mc_settings_section_links', '' ); ?>
399
  </ul>
400
  </div>
401
  </div>
403
 
404
  <div class="ui-sortable meta-box-sortables">
405
  <div class="postbox" id="my-calendar-manage">
406
+ <h3><?php _e('My Calendar Management','my-calendar' ); ?></h3>
407
  <div class="inside">
408
  <?php if ( current_user_can('administrator') ) { ?>
409
  <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-config"); ?>">
410
  <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div>
411
  <fieldset>
412
+ <legend><?php _e('Management','my-calendar' ); ?></legend>
413
  <ul>
414
+ <li><?php mc_settings_field( 'mc_remote', __( 'Get data (events, categories and locations) from a remote database.','my-calendar' ), '', '', array(), 'checkbox-single' ); ?></li>
415
  <?php if ( get_option('mc_remote') == 'true' ) { ?>
416
+ <li><?php _e('Add this code to your theme\'s <code>functions.php</code> file:','my-calendar' ); ?>
417
  <pre>function mc_remote_db() {
418
  $mcdb = new wpdb('DB_USER','DB_PASSWORD','DB_NAME','DB_ADDRESS');
419
  return $mcdb;
420
  }</pre>
421
+ <?php _e('You will need to allow remote connections from this site to the site hosting your My Calendar events. Replace the above placeholders with the host-site information. The two sites must have the same WP table prefix. While this option is enabled, you may not enter or edit events through this installation.','my-calendar' ); ?>
422
  </li>
423
  <?php } ?>
424
+ <li><?php mc_settings_field( 'mc_event_approve', __( 'Enable approval options.','my-calendar' ), '', '', array(), 'checkbox-single' ); ?></li>
425
+ <li><?php mc_settings_field( 'mc_api_enabled', __( 'Enable external API.','my-calendar' ), '', '', array(), 'checkbox-single' ); ?></li>
426
  <?php
427
  if ( apply_filters( 'mc_caching_clear', false ) ) { ?>
428
+ <li><?php mc_settings_field( 'mc_clear_cache', __( 'Clear current cache. (Necessary if you edit shortcodes to change displayed categories, for example.)','my-calendar' ), '', '', array(), 'checkbox-single' ); ?></li>
 
429
  <?php } ?>
430
+ <li><?php mc_settings_field( 'mc_default_sort', __( 'Default Sort order for Admin Events List','my-calendar' ), array( '1'=>__( 'Event ID', 'my-calendar' ), '2'=>__( 'Title', 'my-calendar' ), '3'=>__( 'Description', 'my-calendar' ), '4'=>__( 'Start Date', 'my-calendar' ), '5'=>__( 'Author', 'my-calendar' ), '6'=>__( 'Category', 'my-calendar' ), '7'=>__( 'Location Name', 'my-calendar' ) ), '', array(), 'select' ); ?></li>
431
+ <?php
432
+ if ( get_site_option('mc_multisite') == 2 && MY_CALENDAR_TABLE != MY_CALENDAR_GLOBAL_TABLE ) {
433
+ mc_settings_field( 'mc_current_table', array( '0'=> __( 'Currently editing my local calendar','my-calendar' ), '1'=>__( 'Currently editing the network calendar','my-calendar' ) ), '0', '', array(), 'radio' );
434
+ } else {
435
+ if ( get_option('mc_remote') != 'true' && current_user_can( 'manage_network' ) ) { ?>
436
+ <li><?php _e('You are currently working in the primary site for this network; your local calendar is also the global table.','my-calendar' ); ?></li><?php
437
+ }
438
+ } ?>
439
+ <li><?php mc_settings_field( 'remigrate', __( 'Re-generate event occurrences table.','my-calendar' ), '', '', array(), 'checkbox-single' ); ?></li>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
440
  </ul>
441
  </fieldset>
442
  <p>
443
+ <input type="submit" name="mc_manage" class="button-primary" value="<?php _e('Save Management Settings','my-calendar' ); ?>" />
444
  </p>
445
  </form>
446
  <?php } else { ?>
447
+ <?php _e('My Calendar management settings are only available to administrators.','my-calendar' ); ?>
448
  <?php } ?>
449
  </div>
450
  </div>
452
 
453
  <div class="ui-sortable meta-box-sortables">
454
  <div class="postbox" id="my-calendar-text">
455
+ <h3><?php _e('Text Settings','my-calendar' ); ?></h3>
456
  <div class="inside">
457
  <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-config"); ?>">
458
  <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div>
459
  <fieldset>
460
+ <legend><?php _e('Customize Text Fields','my-calendar' ); ?></legend>
461
  <ul>
462
+ <li><?php mc_settings_field( 'mc_notime_text', __( 'Label for all-day events','my-calendar' ), 'N/A' ); ?></li>
463
+ <li><?php mc_settings_field( 'mc_previous_events', __( 'Previous events link','my-calendar' ), __( 'Previous','my-calendar' ), __( 'Use <code>{date}</code> to display date in navigation.','my-calendar' ) ); ?></li>
464
+ <li><?php mc_settings_field( 'mc_next_events', __( 'Next events link','my-calendar' ), __( 'Next', 'my-calendar' ), __( 'Use <code>{date}</code> to display date in navigation.','my-calendar' ) ); ?></li>
465
+ <li><?php mc_settings_field( 'mc_event_open', __( 'If events are open','my-calendar' ), __( 'Registration is open','my-calendar' ) ); ?></li>
466
+ <li><?php mc_settings_field( 'mc_event_closed', __( 'If events are closed','my-calendar' ), __( 'Registration is closed','my-calendar' ) ); ?></li>
467
+ <li><?php mc_settings_field( 'mc_week_caption', __( 'Week view caption:','my-calendar' ), '', __( 'Available tag: <code>{date format=""}</code>','my-calendar' ) ); ?></li>
468
+ <li><?php mc_settings_field( 'my_calendar_caption', __( 'Extended caption:','my-calendar' ), '', __( 'Follows month/year in list views.','my-calendar' ) ); ?></li>
469
+ <li><?php mc_settings_field( 'mc_title_template', __( 'Event title template','my-calendar' ), $mc_title_template, "<a href='".admin_url("admin.php?page=my-calendar-help#templates")."'>".__( "Templating Help",'my-calendar' ).'</a>' ); ?></li>
470
+ <li><?php mc_settings_field( 'mc_details_label', __( 'Event details link text','my-calendar' ), $mc_details_label, __( 'Tags: <code>{title}</code>, <code>{location}</code>, <code>{color}</code>, <code>{icon}</code>, <code>{date}</code>, <code>{time}</code>.','my-calendar' ) ); ?></li>
471
+ <li><?php mc_settings_field( 'mc_link_label', __( 'Event URL link text','my-calendar' ), $mc_link_label, "<a href='".admin_url("admin.php?page=my-calendar-help#templates")."'>".__( "Templating Help",'my-calendar' ).'</a>' ); ?></li>
472
+ <li><?php mc_settings_field( 'mc_event_title_template', __( 'Title element template','my-calendar' ), '{title} &raquo; {date}', __( 'Current: %s', 'my-calendar' ) ); ?></li>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
473
  </ul>
474
  </fieldset>
475
  <p>
476
+ <input type="submit" name="save" class="button-primary" value="<?php _e('Save Custom Text Settings','my-calendar' ); ?>" />
477
  </p>
478
  </form>
479
  </div>
482
 
483
  <div class="ui-sortable meta-box-sortables">
484
  <div class="postbox" id="my-calendar-output">
485
+ <h3><?php _e('Output Settings','my-calendar' ); ?></h3>
486
  <div class="inside">
487
+ <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-config"); ?>">
488
  <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div>
489
  <fieldset>
490
+ <legend><?php _e('Calendar Link Targets','my-calendar' ); ?></legend>
 
 
491
  <ul>
492
+ <?php /* <li><?php mc_settings_field( 'mc_use_permalinks', __( 'Use Pretty Permalinks for Events','my-calendar' ), '', '', array(), 'checkbox-single' ); ?></li> This just isn't ready; add in a point release. */ ?>
493
+ <?php $guess = mc_guess_calendar(); ?>
494
+ <li><?php mc_settings_field( 'mc_uri', __( 'Where is your main calendar page?','my-calendar' ), '', "<br /><small>".__( 'Can be any Page or Post which includes the <code>[my_calendar]</code> shortcode.','my-calendar' )." $guess</small>", array( 'size'=>'60' ), 'url' ); ?></li>
495
+ <li><?php mc_settings_field( 'mc_mini_uri', __( 'Target <abbr title="Uniform resource locator">URL</abbr> for mini calendar date links:','my-calendar' ), '', "<br /><small>".__( 'Can be any Page or Post which includes the <code>[my_calendar]</code> shortcode.','my-calendar' )."</small>", array( 'size'=>'60' ), 'url' ); ?></li>
496
+ <li><?php mc_settings_field( 'mc_open_uri', __( 'Open calendar links to event details URL','my-calendar' ), '', '', array(), 'checkbox-single' ); ?></li>
497
+ <?php
498
+ $disabled = ( !get_option( 'mc_uri' ) && !get_option( 'mc_mini_uri' ) ) ? array( 'disabled'=>'disabled' ) : array();
499
+ ?>
500
+ <li><?php mc_settings_field( 'mc_open_day_uri', __( 'Mini calendar widget date links to:','my-calendar' ), array( 'false'=>__( 'jQuery pop-up view', 'my-calendar' ), 'true'=>__( 'daily view page (above)', 'my-calendar' ), 'listanchor'=>__( 'in-page anchor on main calendar page (list)', 'my-calendar' ), 'calendaranchor'=>__( 'in-page anchor on main calendar page (grid)', 'my-calendar' ) ), '', $disabled, 'select' ); ?></li>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
501
  </ul>
502
  <?php // End General Options // ?>
503
  </fieldset>
504
 
505
  <fieldset>
506
+ <legend><?php _e('Set Default Navigation Element Order (can be overridden in shortcodes)','my-calendar' ); ?></legend>
507
+ <?php
508
+ $topnav = explode( ',', get_option( 'mc_topnav' ) );
509
+ $calendar = array( 'calendar' );
510
+ $botnav = explode( ',', get_option( 'mc_bottomnav' ) );
511
+ $order = array_merge( $topnav, $calendar, $botnav );
512
+ $nav_elements = array(
513
+ 'nav'=> '<div class="dashicons dashicons-arrow-left-alt2"></div> <div class="dashicons dashicons-arrow-right-alt2"></div> '.__( 'Primary Previous/Next Buttons', 'my-calendar' ),
514
+ 'toggle'=> '<div class="dashicons dashicons-list-view"></div> <div class="dashicons dashicons-calendar"></div> '.__( 'Switch between list and grid views','my-calendar' ),
515
+ 'jump'=> '<div class="dashicons dashicons-redo"></div> '.__( 'Jump to any other month/year','my-calendar' ),
516
+ 'print'=> '<div class="dashicons dashicons-list-view"></div> '.__( 'Link to printable view','my-calendar' ),
517
+ 'timeframe'=> '<div class="dashicons dashicons-clock"></div> '.__( 'Toggle between day, week, and month view','my-calendar' ),
518
+ 'calendar'=> '<div class="dashicons dashicons-calendar"></div> '.__( 'The calendar','my-calendar' ),
519
+ 'key'=> '<div class="dashicons dashicons-admin-network"></div> '.__( 'Categories','my-calendar' ),
520
+ 'feeds'=> '<div class="dashicons dashicons-rss"></div> '.__( 'Links to RSS and iCal output','my-calendar' ),
521
+ 'stop'=> '<div class="dashicons dashicons-no"></div> '.__( 'Elements below here will be hidden.' )
522
+ );
523
+ echo "<div id='mc-sortable-update' aria-live='polite'></div>";
524
+ echo "<ul id='mc-sortable'>";
525
+ foreach ( $order as $k) {
526
+ $k = trim($k);
527
+ $v = ( isset( $nav_elements[$k] ) ) ? $nav_elements[$k] : false;
528
+ if ( $v !== false ) {
529
+ $inserted[$k] = $v;
530
+ echo "<li class='ui-state-default mc-$k'><button class='up'><i class='dashicons dashicons-arrow-up'></i><span class='screen-reader-text'>Up</span></button> <button class='down'><i class='dashicons dashicons-arrow-down'></i><span class='screen-reader-text'>Down</span></button> <code>$k</code> $v <input type='hidden' name='mc_nav[]' value='$k' /></li>";
531
+ }
532
+ }
533
+ $missed = array_diff( $nav_elements, $inserted );
534
+ foreach ( $missed as $k=>$v ) {
535
+ echo "<li class='ui-state-default mc-$k'><button class='up'><i class='dashicons dashicons-arrow-up'></i><span class='screen-reader-text'>Up</span></button> <button class='down'><i class='dashicons dashicons-arrow-down'></i><span class='screen-reader-text'>Down</span></button> <code>$k</code> $v <input type='hidden' name='mc_nav[]' value='$k' /></li>";
536
+ }
537
+
538
+ echo "</ul>";
539
+ ?>
540
  </fieldset>
541
 
542
  <fieldset>
543
+ <legend><?php _e('Grid Layout Options','my-calendar' ); ?></legend>
544
  <ul>
545
+ <li><?php mc_settings_field( 'mc_show_weekends', __( 'Show Weekends on Calendar','my-calendar' ), '', '', array(), 'checkbox-single' ); ?></li>
546
+ <li><?php mc_settings_field( 'mc_convert', __( 'Switch to list view on mobile devices','my-calendar' ), '', '', array(), 'checkbox-single' ); ?></li>
 
 
 
 
547
  </ul>
548
  <?php // End Grid Options // ?>
549
  </fieldset>
550
 
551
  <fieldset>
552
+ <legend><?php _e('List Layout Options','my-calendar' ); ?></legend>
553
  <ul>
554
+ <li><?php mc_settings_field( 'mc_show_months', __( 'How many months of events to show at a time:','my-calendar' ), '', '', array( 'size'=>'3' ), 'text' ); ?></li>
555
+ <li><?php mc_settings_field( 'mc_show_list_info', __( 'Show the first event\'s title and the number of events that day next to the date.','my-calendar' ), '', '', array(), 'checkbox-single' ); ?></li>
 
 
 
 
556
  </ul>
557
  <?php // End List Options // ?>
558
  </fieldset>
559
 
560
  <fieldset>
561
+ <legend><?php _e('Event Details Pop-up','my-calendar' ); ?></legend>
562
+ <p><?php _e('The checked items will be shown in your event details view. Does not apply if you are using a custom template','my-calendar' ); ?>
563
+ <ul class="checkboxes">
564
+ <li><?php mc_settings_field( 'mc_display_author', __( 'Author\'s name','my-calendar' ), '', '', array(), 'checkbox-single' ); ?></li>
565
+ <li><?php mc_settings_field( 'mc_show_event_vcal', __( 'Link to single event iCal download','my-calendar' ), '', '', array(), 'checkbox-single' ); ?></li>
566
+ <li><?php mc_settings_field( 'mc_show_gcal', __( 'Link to submit event to Google Calendar','my-calendar' ), '', '', array(), 'checkbox-single' ); ?></li>
567
+ <li><?php mc_settings_field( 'mc_hide_icons', __( 'Hide Category icons','my-calendar' ), '', '', array(), 'checkbox-single' ); ?></li>
568
+ <li><?php mc_settings_field( 'mc_show_map', __( 'Link to Google Map','my-calendar' ), '', '', array(), 'checkbox-single' ); ?></li>
569
+ <li><?php mc_settings_field( 'mc_show_address', __( 'Event Address','my-calendar' ), '', '', array(), 'checkbox-single' ); ?></li>
570
+ <li><?php mc_settings_field( 'mc_short', __( 'Short description','my-calendar' ), '', '', array(), 'checkbox-single' ); ?></li>
571
+ <li><?php mc_settings_field( 'mc_desc', __( 'Full description','my-calendar' ), '', '', array(), 'checkbox-single' ); ?></li>
572
+ <li><?php mc_settings_field( 'mc_process_shortcodes', __( 'Process WordPress shortcodes in descriptions','my-calendar' ), '', '', array(), 'checkbox-single' ); ?></li>
573
+ <li><?php mc_settings_field( 'mc_details', __( 'Link to event details (requires <a href=\'#mc_uri\'>URL</a>)','my-calendar' ), '', '', array(), 'checkbox-single' ); ?></li>
574
+ <li><?php mc_settings_field( 'mc_event_link', __( 'External link','my-calendar' ), '', '', array(), 'checkbox-single' ); ?></li>
575
+ <li><?php mc_settings_field( 'mc_event_registration', __( 'Registration info','my-calendar' ), '', '', array(), 'checkbox-single' ); ?></li>
576
+ </ul>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
577
  </fieldset>
578
  <fieldset>
579
+ <legend><?php _e('Event Category Display','my-calendar' ); ?></legend>
580
+ <ul class='checkboxes'>
581
+ <?php mc_settings_field( 'mc_apply_color', array( 'default'=> __( 'No category colors with titles.','my-calendar' ), 'font'=>__( 'Titles are in category colors.','my-calendar' ), 'background'=>__( 'Titles have category color as background.','my-calendar' ) ), 'default', '', array(), 'radio' ); ?>
582
+ <li><?php mc_settings_field( 'mc_inverse_color', __( 'Optimize contrast for category colors.','my-calendar' ), '', '', array(), 'checkbox-single' ); ?></li>
583
+ </ul>
 
 
 
 
 
 
584
  <?php // End Event Options // ?>
585
  </fieldset>
586
  <fieldset>
587
+ <legend><?php _e('Event Scheduling Defaults','my-calendar' ); ?></legend>
588
+ <ul>
589
+ <li><?php mc_settings_field( 'mc_event_link_expires', __( 'Event links expire after event passes.','my-calendar' ), '', '', array(), 'checkbox-single' ); ?></li>
590
+ <li><?php mc_settings_field( 'mc_no_fifth_week', __( 'If a recurring event falls on a date that doesn\'t exist (like the 5th Wednesday in February), move it back one week.','my-calendar' ), '', '', array(), 'checkbox-single' ); ?></li>
591
+ <li><?php mc_settings_field( 'mc_skip_holidays', __( 'If an event coincides with an event in the designated "Holiday" category, do not show the event.','my-calendar' ), '', '', array(), 'checkbox-single' ); ?></li>
592
+ </ul>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
593
  <?php // End Scheduling Options // ?>
594
  </fieldset>
595
+ <p><input type="submit" name="save" class="button-primary" value="<?php _e('Save Output Settings','my-calendar' ); ?>" /></p>
 
596
  </form>
597
  </div>
598
  </div>
600
 
601
  <div class="ui-sortable meta-box-sortables">
602
  <div class="postbox" id="my-calendar-time">
603
+ <h3><?php _e('Calendar Time Formats','my-calendar' ); ?></h3>
604
  <div class="inside">
605
  <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-config"); ?>">
606
  <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div>
607
  <fieldset>
608
+ <legend><?php _e('Set default date/time formats','my-calendar' ); ?></legend>
609
  <div><input type='hidden' name='mc_dates' value='true' /></div>
610
+ <ul>
611
+ <?php
612
+ $month_format = ( get_option('mc_month_format') == '' ) ? date_i18n( 'F Y' ) : date_i18n( get_option('mc_month_format') );
613
+ $time_format = ( get_option('mc_time_format') == '' ) ? date_i18n( get_option( 'time_format' ) ) : date_i18n( get_option('mc_time_format') );
614
+ $week_format = ( get_option('mc_week_format') == '' ) ? date_i18n( 'M j, \'y' ) : date_i18n( get_option('mc_week_format') );
615
+ $date_format = ( get_option('mc_date_format') == '' ) ? date_i18n( get_option( 'date_format' ) ) : date_i18n( get_option('mc_date_format') );
616
+ ?>
617
+ <li><?php mc_settings_field( 'mc_month_format', __( 'Month format (calendar headings)','my-calendar' ), '', $month_format ); ?></li>
618
+ <li><?php mc_settings_field( 'mc_time_format', __( 'Time format','my-calendar' ), '', $time_format ); ?></li>
619
+ <li><?php mc_settings_field( 'mc_week_format', __( 'Date in grid mode, week view','my-calendar' ), '', $week_format ); ?></li>
620
+ <li><?php mc_settings_field( 'mc_date_format', __( 'Date Format in other views','my-calendar' ), '', $date_format ); ?></li>
 
621
  <li>
622
+ <?php _e('Date formats use syntax from the <a href="http://php.net/date">PHP <code>date()</code> function</a>. Save to update sample output.','my-calendar' ); ?>
623
+ </li>
624
+ <li><?php mc_settings_field( 'mc_ical_utc', __( 'iCal times are UTC','my-calendar' ), '', '', array(), 'checkbox-single' ); ?></li>
625
  </ul>
626
  </fieldset>
627
  <p>
628
+ <input type="submit" name="save" class="button-primary" value="<?php _e('Save Date/Time Settings','my-calendar' ); ?>" />
629
  </p>
630
  </form>
631
  </div>
635
 
636
  <div class="ui-sortable meta-box-sortables">
637
  <div class="postbox" id="my-calendar-input">
638
+ <h3><?php _e('Calendar Input Settings','my-calendar' ); ?></h3>
639
  <div class="inside">
640
  <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-config"); ?>">
641
  <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div>
642
  <fieldset>
643
+ <legend><?php _e('Select which input fields will be available when adding or editing events.','my-calendar' ); ?></legend>
644
  <div><input type='hidden' name='mc_input' value='true' /></div>
645
+ <ul class="checkboxes">
646
  <?php
647
  $input_options = get_option('mc_input_options');
648
+ $input_labels = array('event_location_dropdown'=>__( 'Event Location Dropdown Menu','my-calendar' ),'event_short'=>__( 'Event Short Description field','my-calendar' ),'event_desc'=>__( 'Event Description Field','my-calendar' ),'event_category'=>__( 'Event Category field','my-calendar' ),'event_image'=>__( 'Event Image field','my-calendar' ),'event_link'=>__( 'Event Link field','my-calendar' ),'event_recurs'=>__( 'Event Recurrence Options','my-calendar' ),'event_open'=>__( 'Event Registration options','my-calendar' ),'event_location'=>__( 'Event Location fields','my-calendar' ), 'event_specials'=>__( 'Set Special Scheduling options','my-calendar' ), 'event_access'=>__("Event Accessibility", 'my-calendar' ) );
649
  $output = '';
650
  // if input options isn't an array, we'll assume that this plugin wasn't upgraded properly, and reset them to the default.
651
  if ( !is_array($input_options) ) {
652
+ update_option( 'mc_input_options',array('event_short'=>'on','event_desc'=>'on','event_category'=>'on','event_image'=>'on','event_link'=>'on','event_recurs'=>'on','event_open'=>'on','event_location'=>'on','event_location_dropdown'=>'on','event_specials'=>'on', 'event_access'=>'on' ) );
653
  }
654
+ foreach ($input_options as $key=>$value) {
655
  $checked = ($value == 'on')?"checked='checked'":'';
656
+ if ( isset($input_labels[$key] ) ) {
657
+ $output .= "<li><input type=\"checkbox\" id=\"mci_$key\" name=\"mci_$key\" $checked /> <label for=\"mci_$key\">$input_labels[$key]</label></li>";
658
+ }
659
  }
660
  echo $output;
661
  ?>
662
+ <li><?php mc_settings_field( 'mc_input_options_administrators', __( 'Administrators see all input options','my-calendar' ), '', '', array(), 'checkbox-single' ); ?></li>
 
 
663
  </ul>
664
  </fieldset>
665
  <p>
666
+ <input type="submit" name="save" class="button-primary" value="<?php _e('Save Input Settings','my-calendar' ); ?>" />
667
  </p>
668
  </form>
669
  </div>
673
  <?php if ( current_user_can('manage_network') ) { ?>
674
  <div class="ui-sortable meta-box-sortables">
675
  <div class="postbox" id="my-calendar-multisite">
676
+ <h3><?php _e('Multisite Settings (Network Administrators only)','my-calendar' ); ?></h3>
677
  <div class="inside">
678
  <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-config"); ?>">
679
  <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div>
680
  <div><input type='hidden' name='mc_network' value='true' /></div>
681
  <fieldset>
682
+ <legend><?php _e('WP MultiSite configurations','my-calendar' ); ?></legend>
683
+ <p><?php _e('The central calendar is the calendar associated with the primary site in your WordPress Multisite network.','my-calendar' ); ?></p>
684
  <ul>
685
+ <li><input type="radio" value="0" id="ms0" name="mc_multisite"<?php echo jd_option_selected( get_site_option('mc_multisite'),'0' ); ?> /> <label for="ms0"><?php _e('Site owners may only post to their local calendar','my-calendar' ); ?></label></li>
686
+ <li><input type="radio" value="1" id="ms1" name="mc_multisite"<?php echo jd_option_selected( get_site_option('mc_multisite'),'1' ); ?> /> <label for="ms1"><?php _e('Site owners may only post to the central calendar','my-calendar' ); ?></label></li>
687
+ <li><input type="radio" value="2" id="ms2" name="mc_multisite"<?php echo jd_option_selected( get_site_option('mc_multisite'),2 ); ?> /> <label for="ms2"><?php _e('Site owners may manage either calendar','my-calendar' ); ?></label></li>
688
  </ul>
689
+ <p class="notice"><strong>*</strong> <?php _e('Changes only effect input permissions. Public-facing calendars will be unchanged.','my-calendar' ); ?></p>
690
  <ul>
691
+ <li><input type="radio" value="0" id="mss0" name="mc_multisite_show"<?php echo jd_option_selected( get_site_option('mc_multisite_show'),'0' ); ?> /> <label for="mss0"><?php _e('Sub-site calendars show events from their local calendar.','my-calendar' ); ?></label></li>
692
+ <li><input type="radio" value="1" id="mss1" name="mc_multisite_show"<?php echo jd_option_selected( get_site_option('mc_multisite_show'),'1' ); ?> /> <label for="mss1"><?php _e('Sub-site calendars show events from the central calendar.','my-calendar' ); ?></label></li>
693
  </ul>
694
  </fieldset>
695
  <p>
696
+ <input type="submit" name="save" class="button-primary" value="<?php _e('Save Multisite Settings','my-calendar' ); ?>" />
697
  </p>
698
  </form>
699
  </div>
703
 
704
  <div class="ui-sortable meta-box-sortables">
705
  <div class="postbox" id="my-calendar-permissions">
706
+ <h3><?php _e('My Calendar Permissions','my-calendar' ); ?></h3>
707
+ <div class="inside mc-tabs">
708
  <?php if ( current_user_can('administrator') ) { ?>
709
 
710
  <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-config"); ?>">
711
  <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div>
 
 
712
  <?php
713
  function mc_check_caps($role,$cap) {
714
  $role = get_role($role);
720
  global $wp_roles;
721
  $roles = $wp_roles->get_names();
722
  $caps = array(
723
+ 'mc_add_events'=>__( 'Add Events','my-calendar' ),
724
+ 'mc_approve_events'=>__( 'Approve Events','my-calendar' ),
725
+ 'mc_manage_events'=>__( 'Manage Events','my-calendar' ),
726
+ 'mc_edit_cats'=>__( 'Edit Categories','my-calendar' ),
727
+ 'mc_edit_locations'=>__( 'Edit Locations','my-calendar' ),
728
+ 'mc_edit_styles'=>__( 'Edit Styles','my-calendar' ),
729
+ 'mc_edit_behaviors'=>__( 'Edit Behaviors','my-calendar' ),
730
+ 'mc_edit_templates'=>__( 'Edit Templates','my-calendar' ),
731
+ 'mc_edit_settings'=>__( 'Edit Settings','my-calendar' ),
732
+ 'mc_view_help'=>__( 'View Help','my-calendar' )
733
  );
734
+ $role_tabs = $role_container = '';
735
  foreach ( $roles as $role=>$rolename ) {
736
  if ( $role == 'administrator' ) continue;
737
+ $role_tabs .= "<li><a href='#mc_$role'>$rolename</a></li>\n";
738
+ $role_container .= "<div class='wptab mc_$role' id='mc_$role' aria-live='polite'><fieldset id='mc_$role' class='roles'><legend>$rolename</legend>";
739
+ $role_container .= "<input type='hidden' value='none' name='mc_caps[".$role."][none]' />
740
+ <ul class='mc-settings checkboxes'>";
741
  foreach( $caps as $cap=>$name ) {
742
+ $role_container .= mc_cap_checkbox( $role, $cap,$name );
743
  }
744
+ $role_container .= "
745
+ </ul></fieldset></div>\n";
746
  }
747
+ echo "
748
+ <ul class='tabs'>
749
+ $role_tabs
750
+ </ul>
751
+ $role_container";
752
 
753
  ?>
 
754
  <p>
755
+ <input type="submit" name="mc_permissions" class="button-primary" value="<?php _e('Save Permissions','my-calendar' ); ?>" />
756
  </p>
757
  </form>
758
  <?php } else { ?>
759
+ <?php _e('My Calendar permission settings are only available to administrators.','my-calendar' ); ?>
760
  <?php } ?>
761
  </div>
762
  </div>
764
 
765
  <div class="ui-sortable meta-box-sortables">
766
  <div class="postbox" id="my-calendar-email">
767
+ <h3><?php _e('Calendar Email Settings','my-calendar' ); ?></h3>
768
  <div class="inside">
769
  <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-config"); ?>">
770
  <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div>
771
  <fieldset>
772
+ <legend><?php _e('Email Notifications','my-calendar' ); ?></legend>
773
+ <div><input type='hidden' name='mc_email' value='true' /></div>
774
  <ul>
775
+ <li><?php mc_settings_field( 'mc_event_mail', __( 'Send Email Notifications when new events are scheduled or reserved.','my-calendar' ), '', '', array(), 'checkbox-single' ); ?></li>
776
+ <li><?php mc_settings_field( 'mc_event_mail_to', __( 'Notification messages are sent to:','my-calendar' ), get_bloginfo( 'admin_email' ) ); ?></li>
777
+ <li><?php mc_settings_field( 'mc_event_mail_from', __( 'Notification messages are sent from:','my-calendar' ), get_bloginfo( 'admin_email' ) ); ?></li>
778
+ <li><?php mc_settings_field( 'mc_event_mail_subject', __( 'Email subject','my-calendar' ), get_bloginfo( 'name' ).': '.__( 'New event added', 'my-calendar' ), '', array( 'size'=>60 ) ); ?></li>
779
+ <li><?php mc_settings_field( 'mc_event_mail_message', __( 'Message Body','my-calendar' ), __( 'New Event:','my-calendar' )."\n{title}: {date}, {time} - {event_status}", "<br /><a href='".admin_url("admin.php?page=my-calendar-help#templates")."'>".__( "Templating Help",'my-calendar' ).'</a>', array( 'cols'=>60, 'rows'=>6 ), 'textarea' ); ?></li>
780
+ <li><?php mc_settings_field( 'mc_html_email', __( 'Send HTML email','my-calendar' ), '', '', array(), 'checkbox-single' ); ?></li>
 
 
 
 
 
 
 
 
 
 
 
 
 
781
  </ul>
782
  </fieldset>
783
  <p>
784
+ <input type="submit" name="save" class="button-primary" value="<?php _e('Save Email Settings','my-calendar' ); ?>" />
785
  </p>
786
  </form>
787
  </div>
788
  </div>
789
  </div>
790
 
791
+ <?php echo apply_filters( 'mc_after_settings', '' ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
792
 
 
793
  </div>
794
  </div>
795
 
796
+ <?php mc_show_sidebar(); ?>
797
 
798
  </div>
799
  <?php
800
+ }
 
my-calendar-shortcodes.php CHANGED
@@ -6,10 +6,6 @@ function my_calendar_insert($atts,$content=null) {
6
  'name' => 'all',
7
  'format' => 'calendar',
8
  'category' => 'all',
9
- 'showkey' => '',//deprecated
10
- 'shownav' => '',//deprecated
11
- 'showjump'=> '',//deprecated
12
- 'toggle' => '',//deprecated
13
  'time' => 'month',
14
  'ltype' => '',
15
  'lvalue' => '',
@@ -32,7 +28,7 @@ function my_calendar_insert($atts,$content=null) {
32
  if ( $host == 'current' ) {
33
  $host = apply_filters( 'mc_display_host', $user_ID, 'main' );
34
  }
35
- return my_calendar($name, $format, $category, $showkey, $shownav, $showjump, $toggle, $time, $ltype, $lvalue, $id, $template, $content, $author, $host, $above, $below );
36
  }
37
 
38
  function my_calendar_insert_upcoming($atts) {
@@ -47,7 +43,9 @@ function my_calendar_insert_upcoming($atts) {
47
  'skip' => '0',
48
  'show_today' => 'yes',
49
  'author' => 'default',
50
- 'host' => 'default'
 
 
51
  ), $atts, 'my_calendar_upcoming' ) );
52
  global $user_ID;
53
  if ( $author == 'current' ) {
@@ -56,7 +54,7 @@ function my_calendar_insert_upcoming($atts) {
56
  if ( $host == 'current' ) {
57
  $host = apply_filters( 'mc_display_host', $user_ID, 'upcoming' );
58
  }
59
- return my_calendar_upcoming_events($before, $after, $type, $category, $template, $fallback, $order, $skip, $show_today, $author, $host );
60
  }
61
 
62
  function my_calendar_insert_today($atts) {
@@ -74,7 +72,7 @@ function my_calendar_insert_today($atts) {
74
  if ( $host == 'current' ) {
75
  $host = apply_filters( 'mc_display_host', $user_ID, 'today' );
76
  }
77
- return my_calendar_todays_events($category, $template, $fallback, $author, $host);
78
  }
79
 
80
  function my_calendar_locations($atts) {
@@ -102,6 +100,21 @@ function my_calendar_categories($atts) {
102
  return my_calendar_categories_list( $show );
103
  }
104
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  function my_calendar_show_event($atts) {
106
  extract(shortcode_atts(array(
107
  'event' => '',
6
  'name' => 'all',
7
  'format' => 'calendar',
8
  'category' => 'all',
 
 
 
 
9
  'time' => 'month',
10
  'ltype' => '',
11
  'lvalue' => '',
28
  if ( $host == 'current' ) {
29
  $host = apply_filters( 'mc_display_host', $user_ID, 'main' );
30
  }
31
+ return my_calendar($name, $format, $category, $time, $ltype, $lvalue, $id, $template, $content, $author, $host, $above, $below );
32
  }
33
 
34
  function my_calendar_insert_upcoming($atts) {
43
  'skip' => '0',
44
  'show_today' => 'yes',
45
  'author' => 'default',
46
+ 'host' => 'default',
47
+ 'ltype' => '',
48
+ 'lvalue' => ''
49
  ), $atts, 'my_calendar_upcoming' ) );
50
  global $user_ID;
51
  if ( $author == 'current' ) {
54
  if ( $host == 'current' ) {
55
  $host = apply_filters( 'mc_display_host', $user_ID, 'upcoming' );
56
  }
57
+ return my_calendar_upcoming_events( $before, $after, $type, $category, $template, $fallback, $order, $skip, $show_today, $author, $host );
58
  }
59
 
60
  function my_calendar_insert_today($atts) {
72
  if ( $host == 'current' ) {
73
  $host = apply_filters( 'mc_display_host', $user_ID, 'today' );
74
  }
75
+ return my_calendar_todays_events( $category, $template, $fallback, $author, $host );
76
  }
77
 
78
  function my_calendar_locations($atts) {
100
  return my_calendar_categories_list( $show );
101
  }
102
 
103
+ function my_calendar_access($atts) {
104
+ extract(shortcode_atts(array(
105
+ 'show' => 'list'
106
+ ), $atts, 'my_calendar_access' ) );
107
+ return mc_access_list( $show );
108
+ }
109
+
110
+ function my_calendar_filters( $atts ) {
111
+ extract(shortcode_atts(array(
112
+ 'show' => 'categories,locations'
113
+ ), $atts, 'my_calendar_filters' ) );
114
+ return mc_filters( $show );
115
+ }
116
+
117
+
118
  function my_calendar_show_event($atts) {
119
  extract(shortcode_atts(array(
120
  'event' => '',
my-calendar-styles.php CHANGED
@@ -71,8 +71,7 @@ function edit_my_calendar_styles() {
71
  $dir = plugin_dir_path( __FILE__ );
72
  $mcdb = $wpdb;
73
  $wrote_styles = '';
74
- // We can't use this page unless My Calendar is installed/upgraded
75
- check_my_calendar();
76
  if ( isset( $_POST['mc_edit_style'] ) ) {
77
  $nonce=$_REQUEST['_wpnonce'];
78
  if (! wp_verify_nonce($nonce,'my-calendar-nonce') ) die("Security check failed");
@@ -83,6 +82,7 @@ function edit_my_calendar_styles() {
83
  $stylefile = mc_get_style_path($mc_css_file);
84
  $wrote_styles = ( $my_calendar_style !== false )?mc_write_styles($stylefile, $my_calendar_style):'disabled';
85
  if ( $wrote_styles == true ) {
 
86
  delete_option('mc_file_permissions');
87
  delete_option('mc_style');
88
  }
@@ -132,123 +132,107 @@ function edit_my_calendar_styles() {
132
  } else {
133
  $my_calendar_style = __('Sorry. The file you are looking for doesn\'t appear to exist. Please check your file name and location!', 'my-calendar');
134
  }
135
-
136
  ?>
137
  <div class="wrap jd-my-calendar">
138
- <?php
139
- my_calendar_check_db();
140
- ?>
141
  <h2><?php _e('My Calendar Styles','my-calendar'); ?></h2>
142
- <div class="postbox-container" style="width: 70%">
143
- <div class="metabox-holder">
144
-
145
- <div class="ui-sortable meta-box-sortables">
146
- <div class="postbox">
147
- <h3><?php _e('Calendar Style Settings','my-calendar'); ?></h3>
148
- <div class="inside">
149
-
150
- <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-styles"); ?>">
151
- <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div>
152
- <div><input type="hidden" value="true" name="mc_choose_style" /></div>
153
- <fieldset>
154
- <p>
155
- <label for="mc_css_file"><?php _e('Select My Calendar Theme','my-calendar'); ?></label>
156
- <select name="mc_css_file" id="mc_css_file">
157
- <?php
158
- $custom_directory = str_replace('/my-calendar/','',$dir) . '/my-calendar-custom/styles/';
159
- $directory = dirname(__FILE__).'/styles/';
160
-
161
- $files = @my_csslist($custom_directory);
162
- if (!empty($files)) {
163
- echo "<optgroup label='".__('Your Custom Stylesheets','my-calendar')."'>\n";
164
- foreach ($files as $value) {
165
- $test = "mc_custom_".$value;
166
- $selected = (get_option('mc_css_file') == $test )?" selected='selected'":"";
167
- echo "<option value='mc_custom_$value'$selected>$value</option>\n";
168
- }
169
- echo "</optgroup>";
170
- }
171
- $files = my_csslist($directory);
172
- echo "<optgroup label='".__('Installed Stylesheets','my-calendar')."'>\n";
173
- foreach ($files as $value) {
174
- $selected = (get_option('mc_css_file') == $value )?" selected='selected'":"";
175
- echo "<option value='$value'$selected>$value</option>\n";
176
- }
177
- echo "</optgroup>";
178
- ?>
179
- </select>
180
- <input type="submit" name="save" class="button-secondary" value="<?php _e('Choose Style','my-calendar'); ?>" />
181
- </p>
182
- </fieldset>
183
- </form>
184
- <hr />
185
- <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-styles"); ?>">
186
- <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div>
187
- <div><input type="hidden" value="true" name="mc_edit_style" />
188
- <input type="hidden" name="mc_css_file" value="<?php echo get_option('mc_css_file'); ?>" />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
189
  </div>
190
- <?php
191
- if ( get_option('mc_file_permissions') == 'false' ) {
192
- echo "<div id='my_calendar_old_styles'>
193
- <p>".__('My Calendar was unable to update your CSS files during the upgrade. Please check your file permissions if you wish to edit your My Calendar styles. Your previously stored styles are below. This message and these styles will be deleted from the database when you successfully update your stylesheet.','my-calendar')."</p><pre>";
194
- echo stripcslashes(get_option('mc_style'));
195
- echo get_option('mc_file_permission');
196
- echo "</pre>
197
- </div>";
198
- }
199
- ?>
200
- <fieldset style="position:relative;">
201
- <legend><?php _e('CSS Style Options','my-calendar'); ?></legend>
202
- <p>
203
- <label for="mc_show_css"><?php _e('Apply CSS on these pages (comma separated IDs)','my-calendar'); ?></label> <input type="text" id="mc_show_css" name="mc_show_css" value="<?php echo $mc_show_css; ?>" />
204
- </p>
205
- <p>
206
- <input type="checkbox" id="reset_styles" name="reset_styles" <?php if ( mc_is_custom_style( get_option('mc_css_file') ) ) { echo "disabled='disabled'"; } ?> /> <label for="reset_styles"><?php _e('Restore My Calendar stylesheet','my-calendar'); ?></label> <input type="checkbox" id="use_styles" name="use_styles" <?php mc_is_checked('mc_use_styles','true'); ?> /> <label for="use_styles"><?php _e('Disable My Calendar Stylesheet','my-calendar'); ?></label>
207
- </p>
208
- <p>
209
- <label for="style"><?php _e('Edit the stylesheet for My Calendar','my-calendar'); ?></label><br /><textarea class="style-editor" id="style" name="style" rows="30" cols="80"<?php if ( get_option('mc_use_styles') == 'true' ) { echo "disabled='disabled'"; } ?>><?php echo $my_calendar_style; ?></textarea>
210
- </p>
211
- <p>
212
- <input type="submit" name="save" class="button-primary button-adjust" value="<?php _e('Save Changes','my-calendar'); ?>" />
213
- </p>
214
- </fieldset>
215
- </form>
216
-
217
- <?php
218
- $left_string = normalize_whitespace($my_calendar_style);
219
- $right_string = normalize_whitespace($mc_current_style);
220
- if ( $right_string ) { // if right string is blank, there is no default
221
- if ( isset( $_GET['diff'] ) ) {
222
- echo '<div class="wrap jd-my-calendar" id="diff">';
223
- echo wp_text_diff( $left_string,$right_string, array( 'title' => __('Comparing Your Style with latest installed version of My Calendar','my-calendar'), 'title_right' => __('Latest (from plugin)','my-calendar'), 'title_left' => __('Current (in use)','my-calendar') ) );
224
- echo '</div>';
225
- } else if ( trim( $left_string )!=trim( $right_string ) ) {
226
- echo '<div class="wrap jd-my-calendar">';
227
- echo '<div class="updated"><p>'.__('There have been updates to the stylesheet.','my-calendar').' <a href="'.admin_url("admin.php?page=my-calendar-styles&amp;diff#diff").'">'.__('Compare Your Stylesheet with latest installed version of My Calendar.','my-calendar').'</a></p></div>';
228
- echo '</div>';
229
- } else {
230
- echo '
231
- <div class="wrap jd-my-calendar">
232
- <p>'.__('Your stylesheet matches that included with My Calendar.','my-calendar').'</p>
233
- </div>';
234
- }
235
- }
236
-
237
- ?>
238
-
239
- </div>
240
- </div>
241
- <p><?php _e('Resetting your stylesheet will set your stylesheet to the version of that style currently distributed with the plug-in.','my-calendar'); ?></p>
242
- </div>
243
- </div>
244
- </div>
245
-
246
- <?php jd_show_support_box(); ?>
247
-
248
- </div>
249
- <?php
250
-
251
-
252
- }
253
-
254
- ?>
71
  $dir = plugin_dir_path( __FILE__ );
72
  $mcdb = $wpdb;
73
  $wrote_styles = '';
74
+
 
75
  if ( isset( $_POST['mc_edit_style'] ) ) {
76
  $nonce=$_REQUEST['_wpnonce'];
77
  if (! wp_verify_nonce($nonce,'my-calendar-nonce') ) die("Security check failed");
82
  $stylefile = mc_get_style_path($mc_css_file);
83
  $wrote_styles = ( $my_calendar_style !== false )?mc_write_styles($stylefile, $my_calendar_style):'disabled';
84
  if ( $wrote_styles == true ) {
85
+ // updates from pre version 1.7.0
86
  delete_option('mc_file_permissions');
87
  delete_option('mc_style');
88
  }
132
  } else {
133
  $my_calendar_style = __('Sorry. The file you are looking for doesn\'t appear to exist. Please check your file name and location!', 'my-calendar');
134
  }
 
135
  ?>
136
  <div class="wrap jd-my-calendar">
137
+ <?php my_calendar_check_db(); ?>
 
 
138
  <h2><?php _e('My Calendar Styles','my-calendar'); ?></h2>
139
+ <div class="postbox-container jcd-wide">
140
+ <div class="metabox-holder">
141
+ <div class="ui-sortable meta-box-sortables">
142
+ <div class="postbox">
143
+ <h3><?php _e('Calendar Style Settings','my-calendar'); ?></h3>
144
+ <div class="inside">
145
+
146
+ <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-styles"); ?>">
147
+ <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div>
148
+ <div><input type="hidden" value="true" name="mc_choose_style" /></div>
149
+ <fieldset>
150
+ <p>
151
+ <label for="mc_css_file"><?php _e('Select My Calendar Theme','my-calendar'); ?></label>
152
+ <select name="mc_css_file" id="mc_css_file"><?php
153
+ $custom_directory = str_replace('/my-calendar/','',$dir) . '/my-calendar-custom/styles/';
154
+ $directory = dirname(__FILE__).'/styles/';
155
+
156
+ $files = @my_csslist($custom_directory);
157
+ if (!empty($files)) {
158
+ echo "<optgroup label='".__('Your Custom Stylesheets','my-calendar')."'>\n";
159
+ foreach ($files as $value) {
160
+ $test = "mc_custom_".$value;
161
+ $selected = (get_option('mc_css_file') == $test )?" selected='selected'":"";
162
+ echo "<option value='mc_custom_$value'$selected>$value</option>\n";
163
+ }
164
+ echo "</optgroup>";
165
+ }
166
+ $files = my_csslist($directory);
167
+ echo "<optgroup label='".__( 'Installed Stylesheets','my-calendar' )."'>\n";
168
+ foreach ( $files as $value ) {
169
+ $selected = (get_option('mc_css_file') == $value )?" selected='selected'":"";
170
+ echo "<option value='$value'$selected>$value</option>\n";
171
+ }
172
+ echo "</optgroup>"; ?>
173
+ </select>
174
+ <input type="submit" name="save" class="button-secondary" value="<?php _e('Choose Style','my-calendar'); ?>" />
175
+ </p>
176
+ </fieldset>
177
+ </form>
178
+ <hr />
179
+ <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-styles"); ?>">
180
+ <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div>
181
+ <div><input type="hidden" value="true" name="mc_edit_style" />
182
+ <input type="hidden" name="mc_css_file" value="<?php echo get_option('mc_css_file'); ?>" />
183
+ </div>
184
+ <?php
185
+ // update from pre version 1.7.0
186
+ if ( get_option('mc_file_permissions') == 'false' ) {
187
+ echo "<div id='my_calendar_old_styles'>
188
+ <p>".__('My Calendar was unable to update your CSS files during the upgrade. Please check your file permissions if you wish to edit your My Calendar styles. Your previously stored styles are below. This message and these styles will be deleted from the database when you successfully update your stylesheet.','my-calendar')."</p><pre>";
189
+ echo stripcslashes(get_option('mc_style'));
190
+ echo get_option('mc_file_permission');
191
+ echo "</pre>
192
+ </div>";
193
+ }
194
+ ?>
195
+ <fieldset style="position:relative;">
196
+ <legend><?php _e('CSS Style Options','my-calendar'); ?></legend>
197
+ <p>
198
+ <label for="mc_show_css"><?php _e('Apply CSS on these pages (comma separated IDs)','my-calendar'); ?></label> <input type="text" id="mc_show_css" name="mc_show_css" value="<?php echo $mc_show_css; ?>" />
199
+ </p>
200
+ <p>
201
+ <input type="checkbox" id="reset_styles" name="reset_styles" <?php if ( mc_is_custom_style( get_option('mc_css_file') ) ) { echo "disabled='disabled'"; } ?> /> <label for="reset_styles"><?php _e('Restore My Calendar stylesheet','my-calendar'); ?></label> <input type="checkbox" id="use_styles" name="use_styles" <?php mc_is_checked('mc_use_styles','true'); ?> /> <label for="use_styles"><?php _e('Disable My Calendar Stylesheet','my-calendar'); ?></label>
202
+ </p>
203
+ <p>
204
+ <label for="style"><?php _e('Edit the stylesheet for My Calendar','my-calendar'); ?></label><br /><textarea class="style-editor" id="style" name="style" rows="30" cols="80"<?php if ( get_option('mc_use_styles') == 'true' ) { echo "disabled='disabled'"; } ?>><?php echo $my_calendar_style; ?></textarea>
205
+ </p>
206
+ <p>
207
+ <input type="submit" name="save" class="button-primary button-adjust" value="<?php _e('Save Changes','my-calendar'); ?>" />
208
+ </p>
209
+ </fieldset>
210
+ </form>
211
+ <?php
212
+ $left_string = normalize_whitespace($my_calendar_style);
213
+ $right_string = normalize_whitespace($mc_current_style);
214
+ if ( $right_string ) { // if right string is blank, there is no default
215
+ if ( isset( $_GET['diff'] ) ) {
216
+ echo '<div class="wrap jd-my-calendar" id="diff">';
217
+ echo wp_text_diff( $left_string,$right_string, array( 'title' => __('Comparing Your Style with latest installed version of My Calendar','my-calendar'), 'title_right' => __('Latest (from plugin)','my-calendar'), 'title_left' => __('Current (in use)','my-calendar') ) );
218
+ echo '</div>';
219
+ } else if ( trim( $left_string )!=trim( $right_string ) ) {
220
+ echo '<div class="wrap jd-my-calendar">';
221
+ echo '<div class="updated"><p>'.__('There have been updates to the stylesheet.','my-calendar').' <a href="'.admin_url("admin.php?page=my-calendar-styles&amp;diff#diff").'">'.__('Compare Your Stylesheet with latest installed version of My Calendar.','my-calendar').'</a></p></div>';
222
+ echo '</div>';
223
+ } else {
224
+ echo '
225
+ <div class="wrap jd-my-calendar">
226
+ <p>'.__('Your stylesheet matches that included with My Calendar.','my-calendar').'</p>
227
+ </div>';
228
+ }
229
+ } ?>
230
+ </div>
231
+ </div>
232
+ <p><?php _e('Resetting your stylesheet will set your stylesheet to the version of that style currently distributed with the plug-in.','my-calendar'); ?></p>
233
+ </div>
234
  </div>
235
+ </div>
236
+ <?php mc_show_sidebar(); ?>
237
+ </div><?php
238
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
my-calendar-templates.php CHANGED
@@ -1,18 +1,17 @@
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
 
4
- function jd_draw_template($array,$template,$type='list') {
5
- //1st argument: array of details
6
- //2nd argument: template to print details into
7
- $template = stripcslashes($template);
8
  foreach ( $array as $key=>$value ) {
9
- if ( is_object($value) && !empty($value) ) {
10
  // null values return false...
11
  } else {
12
  if ( strpos( $template, "{".$key ) !== false ) {
13
- if ($type != 'list') {
14
- if ( $key == 'link' && $value == '') { $value = ( get_option('mc_uri') != '' && !is_numeric( get_option('mc_uri') ) )?get_option('mc_uri'):home_url(); }
15
- if ( $key != 'guid') { $value = htmlentities($value); }
16
  }
17
  if ( strpos( $template, "{".$key." " ) !== false ) { // only do preg_match if appropriate
18
  preg_match_all('/{'.$key.'\b(?>\s+(?:before="([^"]*)"|after="([^"]*)"|format="([^"]*)")|[^\s]+|\s+){0,2}}/', $template, $matches, PREG_PATTERN_ORDER );
@@ -20,8 +19,10 @@ function jd_draw_template($array,$template,$type='list') {
20
  $before = @$matches[1][0];
21
  $after = @$matches[2][0];
22
  $format = @$matches[3][0];
23
- if ( $format != '' ) { $value = date_i18n( stripslashes($format),strtotime(stripslashes($value)) ); }
24
- $value = ( $value == '' )?'':$before.$value.$after;
 
 
25
  $search = @$matches[0][0];
26
  $template = str_replace( $search, $value, $template );
27
  }
@@ -34,24 +35,28 @@ function jd_draw_template($array,$template,$type='list') {
34
  if ( strpos( $template, $rss_search ) !== false ) {
35
  $charset = get_option('blog_charset');
36
  if ( $charset == '' ) { $charset = 'UTF-8'; }
37
- //$value = htmlspecialchars( $value, ENT_QUOTES, $charset );
38
- //$value = htmlentities( $value, ENT_XML1, $charset );
39
- // if ( $key == 'description' ) { echo $value; }
40
- $value = xml_entities( $value, $charset );
41
- $value = xml_entity_decode( $value, $charset );
42
  $template = stripcslashes(str_replace($rss_search,$value,$template));
43
  }
44
  }
45
- }
46
- //$new = microtime( true );
47
- //$length = $new - $mtime;
48
- //echo $length . ' seconds<br />'; //DEBUG
49
  return stripslashes(trim($template));
50
  }
51
 
52
- function mc_maplink( $event, $request='map', $source='event' ) {
 
53
  if ( $source == 'event' ) {
54
  $map_string = $event->event_street.' '.$event->event_street2.' '.$event->event_city.' '.$event->event_state.' '.$event->event_postcode.' '.$event->event_country;
 
 
 
 
 
 
 
 
 
 
55
  if ( $request == 'gcal' ) { return $map_string; }
56
  $zoom = ( $event->event_zoom != 0 )?$event->event_zoom:'15';
57
  $map_string = str_replace(" ","+",$map_string);
@@ -60,7 +65,6 @@ function mc_maplink( $event, $request='map', $source='event' ) {
60
  $connector = '';
61
  }
62
  } else {
63
- $map_string = $event->location_street.' '.$event->location_street2.' '.$event->location_city.' '.$event->location_state.' '.$event->location_postcode.' '.$event->location_country;
64
  $zoom = ( $event->location_zoom != 0 )?$event->location_zoom:'15';
65
  $map_string = str_replace( " ","+",$map_string );
66
  if ( $event->location_longitude != '0.000000' && $event->location_latitude != '0.000000' ) {
@@ -79,6 +83,7 @@ function mc_maplink( $event, $request='map', $source='event' ) {
79
  return $map;
80
  }
81
 
 
82
  function mc_google_cal( $dtstart, $dtend, $url, $title, $location, $description ) {
83
  $source = "https://www.google.com/calendar/render?action=TEMPLATE";
84
  $base = "&dates=$dtstart/$dtend";
@@ -91,230 +96,317 @@ function mc_google_cal( $dtstart, $dtend, $url, $title, $location, $description
91
  return $source . $base;
92
  }
93
 
94
- function mc_hcard( $event, $address='true', $map='true', $source='event' ) {
 
95
  $the_map = mc_maplink( $event, 'url', $source );
96
- $event_url = ($source=='event')?$event->event_url:$event->location_url;
97
- $event_label = stripslashes( ($source=='event')?$event->event_label:$event->location_label );
98
- $event_street = stripslashes( ($source=='event')?$event->event_street:$event->location_street );
99
- $event_street2 = stripslashes( ($source=='event')?$event->event_street2:$event->location_street2 );
100
- $event_city = stripslashes( ($source=='event')?$event->event_city:$event->location_city );
101
- $event_state = stripslashes( ($source=='event')?$event->event_state:$event->location_state );
102
- $event_postcode = stripslashes( ($source=='event')?$event->event_postcode:$event->location_postcode );
103
- $event_country = stripslashes( ($source=='event')?$event->event_country:$event->location_country );
104
- $event_phone = stripslashes( ($source=='event')?$event->event_phone:$event->location_phone );
105
-
106
- if ( !$event_url && !$event_label && !$event_street && !$event_street2 && !$event_city && !$event_state && !$event_postcode && !$event_country && !$event_phone ) return;
107
-
108
- $sitelink_html = "<div class='url link'><a href='$event_url' class='location-link external'>".sprintf(__('Visit web site<span>: %s</span>','my-calendar'),$event_label)."</a></div>";
109
  $hcard = "<div class=\"address vcard\">";
110
  if ( $address == 'true' ) {
111
  $hcard .= "<div class=\"adr\">";
112
- if ($event_label != "") {$hcard .= "<strong class=\"org\">".$event_label."</strong><br />"; }
113
- $hcard .= ( $event_street.$event_street2.$event_city.$event_state.$event_postcode.$event_country.$event_phone == '' )?'':"<div class='sub-address'>";
114
- if ($event_street != "") {$hcard .= "<div class=\"street-address\">".$event_street."</div>";}
115
- if ($event_street2 != "") { $hcard .= "<div class=\"street-address\">".$event_street2."</div>"; }
116
- if ($event_city != "") {$hcard .= "<span class=\"locality\">".$event_city."</span><span class='sep'>, </span>";}
117
- if ($event_state != "") {$hcard .= "<span class=\"region\">".$event_state."</span> ";}
118
- if ($event_postcode != "") {$hcard .= " <span class=\"postal-code\">".$event_postcode."</span>";}
119
- if ($event_country != "") { $hcard .= "<div class=\"country-name\">".$event_country."</div>";}
120
- if ($event_phone != "") { $hcard .= "<div class=\"tel\">".$event_phone."</div>";}
121
- $hcard .= ( $event_street.$event_street2.$event_city.$event_state.$event_postcode.$event_country.$event_phone == '' )?'':"</div>";
122
  $hcard .= "</div>";
123
  }
124
  if ( $map == 'true' ) {
125
- $the_map = "<a href='$the_map' class='external'>$event_label</a>";
126
- $hcard .= ($the_map!='')?"<div class='url map'>$the_map</div>":'';
127
  }
128
- $hcard .= ($event_url!='')?$sitelink_html:'';
129
  $hcard .= "</div>";
130
  return $hcard;
131
  }
132
 
133
  // Produces the array of event details used for drawing templates
134
- function event_as_array($event,$type='html') {
135
- // My Calendar must be updated to run this function
136
- check_my_calendar();
137
- $details = array();
138
  $date_format = ( get_option('mc_date_format') != '' )?get_option('mc_date_format'):get_option('date_format');
139
- $dateid = $event->occur_id;
140
- $month_date = date( 'dS',strtotime( $event->occur_begin ) );
141
- $day_name = date_i18n( 'l',strtotime( $event->occur_begin ) );
142
- $week_number = mc_ordinal( week_of_month( date('j',strtotime($event->occur_begin) ) ) +1 );
143
- $id = $event->event_id;
144
- $offset = (60*60*get_option('gmt_offset'));
145
- $category_icon = esc_attr($event->category_icon);
146
- $path = ( is_custom_icon() )?plugins_url('/my-calendar-custom/'):plugins_url('icons',__FILE__).'/';
147
- $category_icon = $path . $category_icon;
148
- if ( $event->event_author != 0 ) {
149
- $e = get_userdata($event->event_author);
150
- $host = get_userdata($event->event_host);
151
- $details['author'] = $e->display_name;
152
- $details['gravatar'] = get_avatar( $e->user_email );
153
- $details['host'] = (!$host || $host->display_name == '')?$e->display_name:$host->display_name;
154
- $details['host_email'] = (!$host || $host->user_email == '')?$e->user_email:$host->user_email;
155
- $details['host_gravatar'] = ( !$host || $host->user_email == '' )?$details['gravatar']:get_avatar( $host->user_email );
156
- } else {
157
- $details['author'] = 'Public Submitter';
158
- $details['host'] = 'Public Submitter';
159
- $details['host_email'] = '';
160
- $details['gravatar'] = '';
161
- }
162
-
163
  $map = mc_maplink( $event );
164
  $map_url = mc_maplink( $event, 'url' );
165
- $hcard = mc_hcard( $event );
166
- $sitelink_html = "<div class='url link'><a href='$event->event_url' class='location-link external'>".sprintf(__('Visit web site<span>: %s</span>','my-calendar'),$event->event_label)."</a></div>";
167
- $details['sitelink_html'] = $sitelink_html;
168
- $details['sitelink'] = $event->event_url;
169
- $recurs = str_split( $event->event_recur, 1 );
170
- $recur = $recurs[0];
171
- $every = ( isset($recurs[1]) )?$recurs[1]:1;
172
- switch ( $recur ) {
173
- case 'S':$event_recur=__('Does not recur','my-calendar');break;
174
- case 'D':$event_recur=__('Daily','my-calendar');break;
175
- case 'E':$event_recur=__('Daily, weekdays only','my-calendar');break;
176
- case 'W':$event_recur=__('Weekly','my-calendar');break;
177
- case 'B':$event_recur=__('Bi-weekly','my-calendar');break;
178
- case 'M':$event_recur=sprintf(__('Date of Month (the %s of each month)','my-calendar'), $month_date );break;
179
- case 'U':$event_recur=sprintf(__('Day of Month (the %s %s of each month)','my-calendar'), $week_number, $day_name );break;
180
- case 'Y':$event_recur=__('Annually','my-calendar');break;
181
- }
182
- $details['began'] = $event->event_begin; // returns date of first occurrence of an event.
183
- $details['recurs'] = $event_recur;
184
- $details['repeats'] = $event->event_repeats;
185
  $real_end_date = $event->occur_end;
186
- $date = date_i18n( $date_format,strtotime( $event->occur_begin ) );
187
- $date_utc = date_i18n( $date_format, $event->ts_occur_begin );
188
- $date_end = date_i18n( $date_format,strtotime($real_end_date) );
189
- $date_end_utc = date_i18n( $date_format, $event->ts_occur_end );
190
- $details['date_utc'] = $date_utc;
191
- $details['date_end_utc'] = $date_end_utc;
192
- $details['image_url'] = ( $event->event_image != '' )?$event->event_image:'';
193
- $details['image'] = ( $event->event_image != '' )?"<img src='$event->event_image' alt='' class='mc-image' />":'';
194
- //$details['time'] = ( date( 'H:i:s', strtotime($event->occur_begin) ) == '00:00:00' )?get_option( 'mc_notime_text' ):date(get_option('mc_time_format'),strtotime($event->occur_begin));
195
- $details['time'] = ( date( 'H:i:s', strtotime( $event->occur_begin ) ) == '00:00:00' )?get_option( 'mc_notime_text' ):date(get_option('mc_time_format'), strtotime( $event->occur_begin ) );
196
- $endtime = ( date( 'H:i:s', strtotime($event->occur_end) ) == '00:00:00')?'23:59:00':date( 'H:i:s',strtotime($event->occur_end) );
197
- $details['endtime'] = ( $event->occur_end == $event->occur_begin || $event->event_hide_end == 1 )?'':date_i18n( get_option('mc_time_format'),strtotime( $endtime ));
198
  $tz = mc_user_timezone();
199
- if ($tz != '') {
 
200
  $local_begin = date_i18n( get_option('mc_time_format'), strtotime($event->occur_begin ."+$tz hours") );
201
  $local_end = date_i18n( get_option('mc_time_format'), strtotime($event->occur_end ."+$tz hours") );
202
- $details['usertime'] = "$local_begin";
203
- $details['endusertime'] = ( $local_begin == $local_end )?'':"$local_end";
204
  } else {
205
- $details['usertime'] = $details['time'];
206
- $details['endusertime'] = ( $details['time'] == $details['endtime'] )?'':$details['endtime'];
207
  }
208
- $offset = get_option('gmt_offset'); // reset offset in hours
209
- $os = strtotime($event->occur_begin);
210
- $oe = strtotime($event->occur_end);
211
- $dtstart = ( get_option('mc_ical_utc')=='true')?date("Ymd\THi00", (mktime(date('H',$os),date('i',$os), date('s',$os), date('m',$os),date('d',$os), date('Y',$os) ) - ($offset*60*60) ) )."Z":date("Ymd\THi00", (mktime(date('H',$os),date('i',$os), date('s',$os), date('m',$os),date('d',$os), date('Y',$os) ) ) );
212
- $dtend = ( get_option('mc_ical_utc')=='true')?date("Ymd\THi00", (mktime(date('H',$oe),date('i',$oe), date('s',$oe), date('m',$oe),date('d',$oe), date('Y',$oe) ) - ($offset*60*60) ) )."Z":date("Ymd\THi00", (mktime(date('H',$oe),date('i',$oe), date('s',$oe), date('m',$oe),date('d',$oe), date('Y',$oe) ) ) );
213
- $details['ical_start'] = $dtstart;
214
- $details['ical_end'] = $dtend;
215
- $ical_link = mc_build_url( array('vcal'=>$dateid), array('month','dy','yr','ltype','loc','mcat','format'), get_option( 'mc_uri' ) );
216
- $details['ical'] = $ical_link;
217
- $date_arr = array('occur_begin'=>$event->occur_begin,'occur_end'=>$event->occur_end );
218
- $date_obj = (object) $date_arr;
219
  if ( $event->event_span == 1 ) {
220
  $dates = mc_event_date_span( $event->event_group_id, $event->event_span, array( 0=>$date_obj ) );
221
  } else {
222
  $dates = array();
223
  }
224
- $details['ical_html'] = "<a class='ical' rel='nofollow' href='$ical_link'>".__('iCal','my-calendar')."</a>";
225
- $details['dtstart'] = date( 'Y-m-d\TH:i:s', strtotime( $event->occur_begin ) );// hcal formatted
226
- $details['dtend'] = date( 'Y-m-d\TH:i:s', strtotime($event->occur_end ) ); //hcal formatted end
227
- $details['rssdate'] = date( 'D, d M Y H:i:s +0000', strtotime( $event->event_added ) );
228
- $details['date'] = ($event->event_span != 1)?$date:mc_format_date_span( $dates, 'simple', $date );
229
- $details['enddate'] = $date_end;
230
- $details['daterange'] = ($date == $date_end)?$date:"<span class='mc_db'>$date</span> <span>&ndash;</span> <span class='mc_de'>$date_end</span>";
231
- $details['timerange'] = ( ($details['time'] == $details['endtime'] ) || $event->event_hide_end == 1 )?$details['time']:"<span class='mc_tb'>".$details['time']."</span> <span>&ndash;</span> <span class='mc_te'>".$details['endtime']."</span>";
232
- $details['cat_id'] = $event->event_category;
233
- $details['category'] = stripslashes($event->category_name);
234
- $details['title'] = stripcslashes($event->event_title);
235
- $details['skip_holiday'] = ($event->event_holiday == 0)?'false':'true';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
236
 
237
- if ( $event->event_link_expires == 0 ) {
238
- $details['link'] = $event->event_link;
 
 
 
 
 
239
  } else {
240
- if ( my_calendar_date_comp( date('Y-m-d',strtotime($real_end_date)), date('Y-m-d',time()+$offset ) ) ) {
241
- $details['link'] = '';
242
- } else {
243
- $details['link'] = $event->event_link;
244
- }
245
  }
246
- if ( $event->event_open == '1' ) {
247
- $event_open = get_option( 'mc_event_open' );
248
- } else if ( $event->event_open == '0' ) {
249
- $event_open = get_option( 'mc_event_closed' );
250
- } else {
251
- $event_open = '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
252
  }
253
-
254
- $details['description'] = ( get_option('mc_process_shortcodes') == 'true' )?apply_filters('the_content',$event->event_desc):wpautop(stripslashes($event->event_desc));
255
- $details['description_raw'] = stripslashes($event->event_desc);
256
- $details['description_stripped'] = strip_tags(stripslashes($event->event_desc));
257
- $details['link_title'] = ($details['link'] != '')?"<a href='".$event->event_link."'>".stripslashes($event->event_title)."</a>":stripslashes($event->event_title);
258
- $details['location'] = stripslashes($event->event_label);
259
- $details['street'] = stripslashes($event->event_street);
260
- $details['street2'] = stripslashes($event->event_street2);
261
- $details['phone'] = stripslashes($event->event_phone);
262
- $details['city'] = stripslashes($event->event_city);
263
- $details['state'] = stripslashes($event->event_state);
264
- $details['postcode'] = stripslashes($event->event_postcode);
265
- $details['country'] = stripslashes($event->event_country);
266
- $details['hcard'] = stripslashes($hcard);
267
- $details['link_map'] = $map;
268
- $details['map_url'] = $map_url;
269
- $details['shortdesc'] = ( get_option('mc_process_shortcodes') == 'true' )?apply_filters('the_content',$event->event_short):wpautop(stripslashes($event->event_short));
270
- $details['shortdesc_raw'] = stripslashes($event->event_short);
271
- $details['shortdesc_stripped'] = strip_tags(stripslashes($event->event_short));
272
- $details['event_open'] = $event_open;
273
- $details['icon'] = $category_icon;
274
- $details['icon_html'] = "<img src='$category_icon' class='mc-category-icon' alt='".__('Category','my-calendar').": ".esc_attr($event->category_name)."' />";
275
- $details['color'] = $event->category_color;
276
- $details['event_status'] = ( $event->event_approved == 1 )?__('Published','my-calendar'):__('Reserved','my-calendar');
277
- $templates = get_option('mc_templates');
278
- $details_template = ( !empty($templates['label']) )? stripcslashes($templates['label']):__('Details about','my-calendar').' {title}';
279
- $tags = array( "{title}","{location}","{color}","{icon}","{date}","{time}" );
280
- $replacements = array( stripslashes($event->event_title), stripslashes($event->event_label), $event->category_color, $event->category_icon, $details['date'], $details['time'] );
281
- $details_label = str_replace($tags,$replacements,$details_template );
282
- if ( $type == 'html' ) {
283
- $details_link = mc_build_url( array('mc_id'=>$event->occur_id), array('month','dy','yr','ltype','loc','mcat','format','feed','page_id','p','mcs'), get_option( 'mc_uri' ) );
284
- } else {
285
- $details_link = '';
286
  }
287
- $details['details_link'] = ( get_option( 'mc_uri' ) != '' && !is_numeric( get_option('mc_uri') ) )?$details_link:'';
288
- $details['details'] = ( get_option( 'mc_uri' ) != '' && !is_numeric( get_option('mc_uri') ) )?"<a href='$details_link' class='mc-details'>$details_label</a>":'';
289
- $details['linking'] = ( $event->event_url != '' )?$event->event_url:$details_link;
290
- $details['dateid'] = $dateid; // unique ID for this date of this event
291
- $details['id'] = $id;
292
- $details['group'] = $event->event_group_id;
293
- $details['event_span'] = $event->event_span;
294
- $details['datespan'] = ($event->event_span == 1 || ($details['date'] != $details['enddate']) )?mc_format_date_span( $dates ):$date;
295
- $details['multidate'] = mc_format_date_span( $dates, 'complex', "<span class='fallback-date'>$date</span><span class='separator'>,</span> <span class='fallback-time'>$details[time]</span>&ndash;<span class='fallback-endtime'>$details[endtime]</span>" );
296
- // RSS guid
297
- $details['region'] = $event->event_region;
298
- $details['guid'] =( get_option( 'mc_uri' ) != '' && !is_numeric( get_option('mc_uri') ) )?"<guid isPermaLink='true'>$details_link</guid>":"<guid isPermalink='false'>$details_link</guid>";
299
- /* ical format */
300
- $details['ical_location'] = $event->event_label .' '. $event->event_street .' '. $event->event_street2 .' '. $event->event_city .' '. $event->event_state .' '. $event->event_postcode;
301
- $ical_description = mc_newline_replace(strip_tags($event->event_desc));
302
- $details['ical_description'] = str_replace( "\r", "=0D=0A=", $event->event_desc );
303
- $details['ical_desc'] = $ical_description;
304
- // get URL, TITLE, LOCATION, DESCRIPTION strings
305
- $url = ( get_option( 'mc_uri' ) != '' && !is_numeric( get_option('mc_uri') ) )?$details_link:$event->event_url;
306
- $title = stripcslashes($event->event_title);
307
- $location = mc_maplink( $event, 'gcal' );
308
- $description = $ical_description;
309
- $details['gcal'] = mc_google_cal( $dtstart, $dtend, $url, $title, $location, $description );
310
- $details['gcal_link'] = "<a href='".mc_google_cal( $dtstart, $dtend, $url, $title, $location, $description )."'>".sprintf( __('<span class="screenreader">Send %1$s to </span>Google Calendar','my-calendar'), $title )."</a>";
311
- $details = apply_filters( 'mc_filter_shortcodes',$details,$event );
312
- return $details;
313
  }
314
 
315
  function mc_event_date_span( $group_id, $event_span, $dates=array() ) {
316
  global $wpdb;
317
  $mcdb = $wpdb;
 
 
 
 
318
  if ( get_option( 'mc_remote' ) == 'true' && function_exists('mc_remote_db') ) { $mcdb = mc_remote_db(); }
319
  $group_id = (int) $group_id;
320
  if ( $group_id == 0 && $event_span != 1 ) {
@@ -322,6 +414,7 @@ function mc_event_date_span( $group_id, $event_span, $dates=array() ) {
322
  } else {
323
  $sql = "SELECT occur_begin, occur_end FROM ".my_calendar_event_table()." WHERE occur_group_id = $group_id ORDER BY occur_begin ASC";
324
  $dates = $mcdb->get_results( $sql );
 
325
  return $dates;
326
  }
327
  }
@@ -332,16 +425,16 @@ function mc_format_date_span( $dates, $display='simple',$default='' ) {
332
  if ( $display == 'simple' ) {
333
  $begin = $dates[0]->occur_begin;
334
  $end = $dates[$last]->occur_end;
335
- $begin = date_i18n( get_option('mc_date_format'),strtotime( $begin ));
336
- $end = date_i18n( get_option('mc_date_format'),strtotime( $end ));
337
  $return = $begin . ' <span>&ndash;</span> ' . $end;
338
  } else {
339
  $return = "<ul class='multidate'>";
340
  foreach ($dates as $date ) {
341
  $begin = $date->occur_begin;
342
  $end = $date->occur_end;
343
- $day_begin = date( 'Y-m-d', $date->occur_begin );
344
- $day_end = date( 'Y-m-d', $date->occur_end );
345
  $bformat = "<span class='multidate-date'>".date_i18n( get_option('mc_date_format'),strtotime( $begin ) ).'</span> <span class="multidate-time">'.date_i18n( get_option('mc_time_format'), strtotime( $begin ) )."</span>";
346
  $endtimeformat = ($date->occur_end == '00:00:00')?'':' '.get_option('mc_time_format');
347
  $eformat = ( $day_begin != $day_end )?get_option('mc_date_format').$endtimeformat:$endtimeformat;
@@ -352,4 +445,81 @@ function mc_format_date_span( $dates, $display='simple',$default='' ) {
352
  $return .= "</ul>";
353
  }
354
  return $return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
355
  }
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
 
4
+ // draw array of information into a template with {$key} formatted tags
5
+ function jd_draw_template( $array,$template,$type='list' ) {
6
+ $template = stripcslashes( $template );
 
7
  foreach ( $array as $key=>$value ) {
8
+ if ( is_object( $value ) && !empty( $value ) ) {
9
  // null values return false...
10
  } else {
11
  if ( strpos( $template, "{".$key ) !== false ) {
12
+ if ( $type != 'list') {
13
+ if ( $key == 'link' && $value == '' ) { $value = ( get_option( 'mc_uri' ) != '' && !is_numeric( get_option( 'mc_uri' ) ) )?get_option( 'mc_uri' ):home_url(); }
14
+ if ( $key != 'guid') { $value = htmlentities( $value ); }
15
  }
16
  if ( strpos( $template, "{".$key." " ) !== false ) { // only do preg_match if appropriate
17
  preg_match_all('/{'.$key.'\b(?>\s+(?:before="([^"]*)"|after="([^"]*)"|format="([^"]*)")|[^\s]+|\s+){0,2}}/', $template, $matches, PREG_PATTERN_ORDER );
19
  $before = @$matches[1][0];
20
  $after = @$matches[2][0];
21
  $format = @$matches[3][0];
22
+ if ( $format != '' ) {
23
+ $value = date_i18n( stripslashes( $format ),strtotime( stripslashes( $value ) ) );
24
+ }
25
+ $value = ( $value == '' ) ? '' : $before.$value.$after;
26
  $search = @$matches[0][0];
27
  $template = str_replace( $search, $value, $template );
28
  }
35
  if ( strpos( $template, $rss_search ) !== false ) {
36
  $charset = get_option('blog_charset');
37
  if ( $charset == '' ) { $charset = 'UTF-8'; }
38
+ $value = ent2ncr($value); // WP native function.
 
 
 
 
39
  $template = stripcslashes(str_replace($rss_search,$value,$template));
40
  }
41
  }
42
+ }
 
 
 
43
  return stripslashes(trim($template));
44
  }
45
 
46
+ // setup string version of address data
47
+ function mc_map_string( $event, $source='event' ) {
48
  if ( $source == 'event' ) {
49
  $map_string = $event->event_street.' '.$event->event_street2.' '.$event->event_city.' '.$event->event_state.' '.$event->event_postcode.' '.$event->event_country;
50
+ } else {
51
+ $map_string = $event->location_street.' '.$event->location_street2.' '.$event->location_city.' '.$event->location_state.' '.$event->location_postcode.' '.$event->location_country;
52
+ }
53
+ return $map_string;
54
+ }
55
+
56
+ // set up link to Google Maps
57
+ function mc_maplink( $event, $request='map', $source='event' ) {
58
+ $map_string = mc_map_string( $event, $source );
59
+ if ( $source == 'event' ) {
60
  if ( $request == 'gcal' ) { return $map_string; }
61
  $zoom = ( $event->event_zoom != 0 )?$event->event_zoom:'15';
62
  $map_string = str_replace(" ","+",$map_string);
65
  $connector = '';
66
  }
67
  } else {
 
68
  $zoom = ( $event->location_zoom != 0 )?$event->location_zoom:'15';
69
  $map_string = str_replace( " ","+",$map_string );
70
  if ( $event->location_longitude != '0.000000' && $event->location_latitude != '0.000000' ) {
83
  return $map;
84
  }
85
 
86
+ // set up link to push events into Google Calendar.
87
  function mc_google_cal( $dtstart, $dtend, $url, $title, $location, $description ) {
88
  $source = "https://www.google.com/calendar/render?action=TEMPLATE";
89
  $base = "&dates=$dtstart/$dtend";
96
  return $source . $base;
97
  }
98
 
99
+ // set up hCard formatted address.
100
+ function mc_hcard( $event, $address='true', $map='true', $source='event', $context='event' ) {
101
  $the_map = mc_maplink( $event, 'url', $source );
102
+ $url = ( $source == 'event' ) ? $event->event_url : $event->location_url;
103
+ $label = stripslashes( ( $source=='event' ) ? $event->event_label : $event->location_label );
104
+ $street = stripslashes( ( $source=='event' ) ? $event->event_street : $event->location_street );
105
+ $street2 = stripslashes( ( $source=='event' ) ? $event->event_street2 : $event->location_street2 );
106
+ $city = stripslashes( ( $source=='event' ) ? $event->event_city : $event->location_city );
107
+ $state = stripslashes( ( $source=='event' ) ? $event->event_state : $event->location_state );
108
+ $zip = stripslashes( ( $source=='event' ) ? $event->event_postcode : $event->location_postcode );
109
+ $country = stripslashes( ( $source=='event' ) ? $event->event_country : $event->location_country );
110
+ $phone = stripslashes( ( $source=='event' ) ? $event->event_phone : $event->location_phone );
111
+ if ( !$url && !$label && !$street && !$street2 && !$city && !$state && !$zip && !$country && !$phone ) return;
112
+ $sitelink_html = ( $url != '' ) ? "<a href='$url' class='location-link external'>$label</a>" : $label;
 
 
113
  $hcard = "<div class=\"address vcard\">";
114
  if ( $address == 'true' ) {
115
  $hcard .= "<div class=\"adr\">";
116
+ if ( $label != "" ) { $hcard .= "<strong class=\"org\">".$sitelink_html."</strong><br />"; }
117
+ $hcard .= ( $street.$street2.$city.$state.$zip.$country.$phone == '' ) ? '' : "<div class='sub-address'>";
118
+ if ( $street != "" ) { $hcard .= "<div class=\"street-address\">".$street."</div>"; }
119
+ if ( $street2 != "" ) { $hcard .= "<div class=\"street-address\">".$street2."</div>"; }
120
+ if ( $city != "" ) { $hcard .= "<div><span class=\"locality\">".$city."</span><span class='sep'>, </span>"; }
121
+ if ( $state != "" ) { $hcard .= "<span class=\"region\">".$state."</span> "; }
122
+ if ( $zip != "" ) { $hcard .= " <span class=\"postal-code\">".$zip."</span></div>"; }
123
+ if ( $country != "" ) { $hcard .= "<div class=\"country-name\">".$country."</div>"; }
124
+ if ( $phone != "" ) { $hcard .= "<div class=\"tel\">".$phone."</div>"; }
125
+ $hcard .= ( $street.$street2.$city.$state.$zip.$country.$phone == '' ) ? '' : "</div>";
126
  $hcard .= "</div>";
127
  }
128
  if ( $map == 'true' ) {
129
+ $the_map = "<a href='$the_map' class='external'>".__('Map','my-calendar')."<span class='screen-reader-text'> $label</a></a>";
130
+ $hcard .= ( $the_map!='' ) ? "<div class='url map'>$the_map</div>" : '' ;
131
  }
 
132
  $hcard .= "</div>";
133
  return $hcard;
134
  }
135
 
136
  // Produces the array of event details used for drawing templates
137
+ function mc_create_tags( $event, $context='filters' ) {
138
+ $e = array();
139
+ $e['post'] = $event->event_post;
 
140
  $date_format = ( get_option('mc_date_format') != '' )?get_option('mc_date_format'):get_option('date_format');
141
+ $e = apply_filters( 'mc_insert_author_data', $e, $event );
142
+ $e = apply_filters( 'mc_filter_image_data', $e, $event );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
  $map = mc_maplink( $event );
144
  $map_url = mc_maplink( $event, 'url' );
145
+ $sitelink_html = "<div class='url link'><a href='$event->event_url' class='location-link external'>".sprintf(__('Visit web site<span class="screen-reader-text">: %s</span>','my-calendar'),$event->event_label)."</a></div>";
146
+ $e['sitelink_html'] = $sitelink_html;
147
+ $e['sitelink'] = $event->event_url;
148
+ $e['access'] = mc_expand( get_post_meta( $event->event_post, '_mc_event_access', true ) );
149
+
150
+ // date & time fields
151
+ $dtstart = mc_format_timestamp( strtotime($event->occur_begin) );
152
+ $dtend = mc_format_timestamp( strtotime($event->occur_end) );
 
 
 
 
 
 
 
 
 
 
 
 
153
  $real_end_date = $event->occur_end;
154
+ $e['date_utc'] = date_i18n( apply_filters( 'mc_date_format', $date_format, 'template_begin_ts' ) , $event->ts_occur_begin );
155
+ $e['date_end_utc'] = date_i18n( apply_filters( 'mc_date_format', $date_format, 'template_end_ts' ) , $event->ts_occur_end );
156
+ $e['time'] = ( date( 'H:i:s', strtotime( $event->occur_begin ) ) == '00:00:00' )?get_option( 'mc_notime_text' ):date(get_option('mc_time_format'), strtotime( $event->occur_begin ) );
157
+ $endtime = date( 'H:i:s', strtotime($event->occur_end) );
158
+ $e['endtime'] = ( $event->occur_end == $event->occur_begin || $event->event_hide_end == 1 )?'':date_i18n( get_option('mc_time_format'),strtotime( $endtime ));
 
 
 
 
 
 
 
159
  $tz = mc_user_timezone();
160
+ $e['runtime'] = mc_runtime( $event->ts_occur_begin, $event->ts_occur_end, $event );
161
+ if ( $tz != '') {
162
  $local_begin = date_i18n( get_option('mc_time_format'), strtotime($event->occur_begin ."+$tz hours") );
163
  $local_end = date_i18n( get_option('mc_time_format'), strtotime($event->occur_end ."+$tz hours") );
164
+ $e['usertime'] = "$local_begin";
165
+ $e['endusertime'] = ( $local_begin == $local_end )?'':"$local_end";
166
  } else {
167
+ $e['usertime'] = $e['time'];
168
+ $e['endusertime'] = ( $e['time'] == $e['endtime'] )?'':$e['endtime'];
169
  }
170
+ $e['dtstart'] = date( 'Y-m-d\TH:i:s', strtotime( $event->occur_begin ) );// hcal formatted
171
+ $e['dtend'] = date( 'Y-m-d\TH:i:s', strtotime($event->occur_end ) ); //hcal formatted end
172
+ $e['rssdate'] = date( 'D, d M Y H:i:s +0000', strtotime( $event->event_added ) );
173
+ $date = date_i18n( apply_filters( 'mc_date_format', $date_format, 'template_begin' ) ,strtotime( $event->occur_begin ) );
174
+ $date_end = date_i18n( apply_filters( 'mc_date_format', $date_format, 'template_end' ) ,strtotime($real_end_date) );
175
+ $date_arr = array( 'occur_begin'=>$event->occur_begin,'occur_end'=>$event->occur_end );
176
+ $date_obj = (object) $date_arr;
 
 
 
 
177
  if ( $event->event_span == 1 ) {
178
  $dates = mc_event_date_span( $event->event_group_id, $event->event_span, array( 0=>$date_obj ) );
179
  } else {
180
  $dates = array();
181
  }
182
+ $e['date'] = ($event->event_span != 1)?$date:mc_format_date_span( $dates, 'simple', $date );
183
+ $e['enddate'] = $date_end;
184
+ $e['daterange'] = ($date == $date_end)?$date:"<span class='mc_db'>$date</span> <span>&ndash;</span> <span class='mc_de'>$date_end</span>";
185
+ $e['timerange'] = ( ($e['time'] == $e['endtime'] ) || $event->event_hide_end == 1 )?$e['time']:"<span class='mc_tb'>".$e['time']."</span> <span>&ndash;</span> <span class='mc_te'>".$e['endtime']."</span>";
186
+ $e['datespan'] = ($event->event_span == 1 || ($e['date'] != $e['enddate']) )?mc_format_date_span( $dates ):$date;
187
+ $e['multidate'] = mc_format_date_span( $dates, 'complex', "<span class='fallback-date'>$date</span><span class='separator'>,</span> <span class='fallback-time'>$e[time]</span>&ndash;<span class='fallback-endtime'>$e[endtime]</span>" );
188
+ $e['began'] = $event->event_begin; // returns date of first occurrence of an event.
189
+ $e['recurs'] = mc_event_recur_string( $event );
190
+ $e['repeats'] = $event->event_repeats;
191
+
192
+ // category fields
193
+ $e['cat_id'] = $event->event_category;
194
+ $e['category'] = stripslashes($event->category_name);
195
+ $e['icon'] = mc_category_icon( $event,'img' );
196
+ $e['icon_html'] = "<img src='$e[icon]' class='mc-category-icon' alt='".__('Category','my-calendar').": ".esc_attr($event->category_name)."' />";
197
+ $e['color'] = $event->category_color;
198
+
199
+ // special
200
+ $e['skip_holiday'] = ($event->event_holiday == 0)?'false':'true';
201
+ $e['event_status'] = ( $event->event_approved == 1 )?__('Published','my-calendar'):__('Reserved','my-calendar');
202
+
203
+ // general text fields
204
+ $strip_desc = mc_newline_replace( strip_tags( $event->event_desc ) );
205
+ $e['title'] = stripcslashes( $event->event_title );
206
+ $e['description'] = ( get_option('mc_process_shortcodes') == 'true' && $context == 'filters' ) ? apply_filters( 'the_content', $event->event_desc ) : wpautop( stripslashes( $event->event_desc ) );
207
+ $e['description_raw'] = stripslashes($event->event_desc);
208
+ $e['description_stripped'] = strip_tags(stripslashes($event->event_desc));
209
+ $e['shortdesc'] = ( get_option( 'mc_process_shortcodes' ) == 'true' && $context == 'filters' ) ? apply_filters( 'the_content', $event->event_short ) : wpautop( stripslashes( $event->event_short ) );
210
+ $e['shortdesc_raw'] = stripslashes($event->event_short);
211
+ $e['shortdesc_stripped'] = strip_tags(stripslashes($event->event_short));
212
+
213
+ // registration fields
214
+ $e['event_open'] = mc_event_open( $event );
215
+ $e['event_tickets'] = $event->event_tickets;
216
+ $e['event_registration'] = stripslashes( wp_kses_data( $event->event_registration ) );
217
+
218
+ // links
219
+ $templates = get_option('mc_templates');
220
+ $e_template = ( !empty($templates['label']) )? stripcslashes($templates['label']):__('Details about','my-calendar').' {title}';
221
+ $tags = array( "{title}","{location}","{color}","{icon}","{date}","{time}" );
222
+ $replacements = array( stripslashes($event->event_title), stripslashes($event->event_label), $event->category_color, $event->category_icon, $e['date'], $e['time'] );
223
+ $e_label = str_replace($tags,$replacements,$e_template );
224
+ //$e_label = mc_get_details_label( $event, $e ); // recursive...hmmmm.
225
+ $e_link = mc_get_details_link( $event );
226
+ $e['link'] = mc_event_link( $event );
227
+ $e['link_title'] = ($e['link'] != '')?"<a href='".$event->event_link."'>".stripslashes($event->event_title)."</a>":stripslashes($event->event_title);
228
+ $e['details_link'] = ( get_option( 'mc_uri' ) != '' && !is_numeric( get_option('mc_uri') ) )?$e_link:'';
229
+ $e['details'] = ( get_option( 'mc_uri' ) != '' && !is_numeric( get_option('mc_uri') ) )?"<a href='$e_link' class='mc-details'>$e_label</a>":'';
230
+ $e['linking'] = ( $e['link'] != '' )?$event->event_url:$e_link;
231
+
232
+ // location fields
233
+ $e['location'] = stripslashes($event->event_label);
234
+ $e['street'] = stripslashes($event->event_street);
235
+ $e['street2'] = stripslashes($event->event_street2);
236
+ $e['phone'] = apply_filters( 'mc_phone_format', stripslashes( $event->event_phone ) );
237
+ $e['phone2'] = apply_filters( 'mc_phone_format', stripslashes( $event->event_phone2 ) );
238
+ $e['city'] = stripslashes($event->event_city);
239
+ $e['state'] = stripslashes($event->event_state);
240
+ $e['postcode'] = stripslashes($event->event_postcode);
241
+ $e['country'] = stripslashes($event->event_country);
242
+ $e['hcard'] = stripslashes( mc_hcard( $event ) );
243
+ $e['link_map'] = $map;
244
+ $e['map_url'] = $map_url;
245
+ $e['map'] = mc_generate_map( $event );
246
+ $url = ( get_option( 'mc_uri' ) != '' && !is_numeric( get_option( 'mc_uri' ) ) )?$e_link:$event->event_url;
247
+ $e['gcal'] = mc_google_cal( $dtstart, $dtend, $url, stripcslashes( $event->event_title ), mc_maplink( $event, 'gcal' ), $strip_desc );
248
+ $e['gcal_link'] = "<a href='".mc_google_cal( $dtstart, $dtend, $url, stripcslashes( $event->event_title ) , mc_maplink( $event, 'gcal' ), $strip_desc )."'>".sprintf( __('<span class="screen-reader-text">Send %1$s to </span>Google Calendar','my-calendar'), stripcslashes( $event->event_title ) )."</a>";
249
+ $e['location_access'] = mc_expand( unserialize( mc_location_data( 'location_access', $event->event_location ) ) );
250
+ $e['location_source'] = $event->event_location;
251
+
252
+ // IDs
253
+ $e['dateid'] = $event->occur_id; // unique ID for this date of this event
254
+ $e['id'] = $event->event_id;
255
+ $e['group'] = $event->event_group_id;
256
+ $e['event_span'] = $event->event_span;
257
+
258
+ // RSS guid
259
+ $e['region'] = $event->event_region;
260
+ $e['guid'] =( get_option( 'mc_uri' ) != '' && !is_numeric( get_option('mc_uri') ) )?"<guid isPermaLink='true'>$e_link</guid>":"<guid isPermalink='false'>$e_link</guid>";
261
+
262
+ // iCAL
263
+ $e['ical_location'] = $event->event_label .' '. $event->event_street .' '. $event->event_street2 .' '. $event->event_city .' '. $event->event_state .' '. $event->event_postcode;
264
+ $e['ical_description'] = str_replace( "\r", "=0D=0A=", $event->event_desc );
265
+ $e['ical_desc'] = $strip_desc;
266
+ $e['ical_start'] = $dtstart;
267
+ $e['ical_end'] = $dtend;
268
+ $ical_link = mc_build_url( array('vcal'=>$event->occur_id), array('month','dy','yr','ltype','loc','mcat','format'), get_option( 'mc_uri' ) );
269
+ $e['ical'] = $ical_link;
270
+ $e['ical_html'] = "<a class='ical' rel='nofollow' href='$ical_link'>".__('iCal','my-calendar')."</a>";
271
+
272
+ // get URL, TITLE, LOCATION, DESCRIPTION strings
273
+ $e = apply_filters( 'mc_filter_shortcodes',$e,$event );
274
+ return $e;
275
+ }
276
+
277
+ function mc_get_details_label( $event, $e ) {
278
+ $templates = get_option( 'mc_templates' );
279
+ $e_template = ( !empty($templates['label']) )? stripcslashes($templates['label']): sprintf( __('Event Details %s','my-calendar'), '<span class="screen-reader-text">about {title}</span> &raquo;' );
280
+ $e_label = wp_kses( jd_draw_template( $e, $e_template ), array( 'span'=>array( 'class'=>array('screen-reader-text') ), 'em', 'strong' ) );
281
+ return $e_label;
282
+ }
283
+
284
+ function mc_format_timestamp( $os ) {
285
+ $offset = (60*60*get_option('gmt_offset'));
286
+ $time = ( get_option('mc_ical_utc')=='true')?date("Ymd\THi00", (mktime(date('H',$os),date('i',$os), date('s',$os), date('m',$os),date('d',$os), date('Y',$os) ) - ($offset) ) )."Z":date("Ymd\THi00", (mktime(date('H',$os),date('i',$os), date('s',$os), date('m',$os),date('d',$os), date('Y',$os) ) ) );
287
+ return $time;
288
+ }
289
+
290
+ function mc_runtime( $start, $end, $event ) {
291
+ if ( $event->event_hide_end || $start == $end ) {
292
+ return;
293
+ } else {
294
+ return human_time_diff( $start, $end );
295
+ }
296
+ }
297
 
298
+ function mc_event_link( $event ) {
299
+ if ( $event->event_link_expires == 0 ) {
300
+ $link = esc_url( $event->event_link );
301
+ } else {
302
+ if ( my_calendar_date_xcomp( $event->occur_end, date('Y-m-d',current_time('timestamp') ) ) ) {
303
+ $link = '';
304
+ do_action( 'mc_event_expired', $event );
305
  } else {
306
+ $link = esc_url( $event->event_link );
 
 
 
 
307
  }
308
+ }
309
+ return $link;
310
+ }
311
+
312
+ function mc_event_open( $event ) {
313
+ if ( $event->event_open == '1' ) {
314
+ $event_open = get_option( 'mc_event_open' );
315
+ } else if ( $event->event_open == '0' ) {
316
+ $event_open = get_option( 'mc_event_closed' );
317
+ } else {
318
+ $event_open = '';
319
+ }
320
+ return apply_filters( 'mc_event_open_text', $event_open, $event );
321
+ }
322
+
323
+ function mc_generate_map( $event, $source='event' ) {
324
+ $id = rand();
325
+ $maptype = 'roadmap';
326
+ $zoom = ( $event->event_zoom != 0 )?$event->event_zoom:'15';
327
+ $category_icon = mc_category_icon( $event,'img' );
328
+ if ( !$category_icon ) { $category_icon = "//maps.google.com/mapfiles/marker_green.png"; }
329
+ $address = addslashes( mc_map_string( $event, $source ) );
330
+ if ( strlen($address) < 10 ) return;
331
+ $hcard = mc_hcard( $event, true, false, 'event','map' );
332
+ $hcard = wp_kses( str_replace( array('</div>','<br />','<br><br>' ),'<br>', $hcard ), array( 'br'=>array() ) );
333
+ $html = addslashes( apply_filters( 'mc_map_html', $hcard, $event ) );
334
+ $width= apply_filters( 'mc_map_height', '100%', $event );
335
+ $height = apply_filters( 'mc_map_height', '300px', $event );
336
+ $styles = " style='width: $width;height: $height'";
337
+ $value = "
338
+ <script type='text/javascript'>
339
+ (function ($) { 'use strict';
340
+ $(function () {
341
+ $('#mc_gmap_$id').gmap3(
342
+ {
343
+ marker:{
344
+ values:[{
345
+ address: '$address',
346
+ options: { icon: new google.maps.MarkerImage( '$category_icon', new google.maps.Size(32,32,'px','px') ) },
347
+ data:'$html'
348
+ }],
349
+ events:{
350
+ click: function( marker, event, context ){
351
+ var map = $(this).gmap3('get'),
352
+ infowindow = $(this).gmap3( { get:{name:'infowindow'} } );
353
+ if ( infowindow ){
354
+ infowindow.open(map, marker);
355
+ infowindow.setContent(context.data);
356
+ } else {
357
+ $(this).gmap3({
358
+ infowindow:{
359
+ anchor:marker,
360
+ options:{content: context.data}
361
+ }
362
+ });
363
+ }
364
+ }
365
+ }
366
+ },
367
+ map:{
368
+ options:{
369
+ zoom: $zoom,
370
+ mapTypeControl: true,
371
+ mapTypeControlOptions: {
372
+ style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
373
+ },
374
+ navigationControl: true,
375
+ scrollwheel: true,
376
+ streetViewControl: false
377
+ }
378
+ }
379
+ });
380
+ });
381
+ })(jQuery);
382
+ </script>
383
+ <div id='mc_gmap_$id' class='mc-gmap-fupup'$styles></div>";
384
+ return $value;
385
+ }
386
+
387
+ function mc_expand( $data ) {
388
+ $output = '';
389
+ if ( is_array( $data ) ) {
390
+ if ( isset( $data['notes'] ) ) {
391
+ unset( $data['notes'] );
392
  }
393
+ foreach ( $data as $key => $value ) {
394
+ $class = ( isset( $value ) ) ? sanitize_title( $value ) : '';
395
+ $label = ( isset( $value ) ) ? $value : false;
396
+ if ( !$label ) { continue; }
397
+ $output .= "<li class='$class'><span>$label</span></li>\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
398
  }
399
+ return "<ul class='mc-access'>".$output."</ul>";
400
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
401
  }
402
 
403
  function mc_event_date_span( $group_id, $event_span, $dates=array() ) {
404
  global $wpdb;
405
  $mcdb = $wpdb;
406
+ // cache as transient to save db queries.
407
+ if ( get_transient( 'mc_event_date_span_'.$group_id.'_'.$event_span ) ) {
408
+ return get_transient( 'mc_event_date_span_'.$group_id.'_'.$event_span );
409
+ }
410
  if ( get_option( 'mc_remote' ) == 'true' && function_exists('mc_remote_db') ) { $mcdb = mc_remote_db(); }
411
  $group_id = (int) $group_id;
412
  if ( $group_id == 0 && $event_span != 1 ) {
414
  } else {
415
  $sql = "SELECT occur_begin, occur_end FROM ".my_calendar_event_table()." WHERE occur_group_id = $group_id ORDER BY occur_begin ASC";
416
  $dates = $mcdb->get_results( $sql );
417
+ set_transient( 'mc_event_date_span_'.$group_id.'_'.$event_span, $dates, HOUR_IN_SECONDS );
418
  return $dates;
419
  }
420
  }
425
  if ( $display == 'simple' ) {
426
  $begin = $dates[0]->occur_begin;
427
  $end = $dates[$last]->occur_end;
428
+ $begin = date_i18n( apply_filters( 'mc_date_format', get_option('mc_date_format'), 'date_span_begin' ),strtotime( $begin ));
429
+ $end = date_i18n( apply_filters( 'mc_date_format', get_option('mc_date_format'), 'date_span_end' ),strtotime( $end ));
430
  $return = $begin . ' <span>&ndash;</span> ' . $end;
431
  } else {
432
  $return = "<ul class='multidate'>";
433
  foreach ($dates as $date ) {
434
  $begin = $date->occur_begin;
435
  $end = $date->occur_end;
436
+ $day_begin = date( 'Y-m-d', strtotime( $begin ) );
437
+ $day_end = date( 'Y-m-d', strtotime( $end ) );
438
  $bformat = "<span class='multidate-date'>".date_i18n( get_option('mc_date_format'),strtotime( $begin ) ).'</span> <span class="multidate-time">'.date_i18n( get_option('mc_time_format'), strtotime( $begin ) )."</span>";
439
  $endtimeformat = ($date->occur_end == '00:00:00')?'':' '.get_option('mc_time_format');
440
  $eformat = ( $day_begin != $day_end )?get_option('mc_date_format').$endtimeformat:$endtimeformat;
445
  $return .= "</ul>";
446
  }
447
  return $return;
448
+ }
449
+
450
+ add_filter( 'mc_insert_author_data', 'mc_author_data', 10, 2 );
451
+ function mc_author_data( $e, $event ) {
452
+ if ( $event->event_author != 0 ) {
453
+ $author = get_userdata($event->event_author);
454
+ $host = get_userdata($event->event_host);
455
+ $e['author'] = $author->display_name;
456
+ $e['gravatar'] = get_avatar( $author->user_email );
457
+ $e['author_email'] = $author->user_email;
458
+ $e['author_id'] = $event->event_author;
459
+ $e['host'] = (!$host || $host->display_name == '')?$author->display_name:$host->display_name;
460
+ $e['host_id'] = $event->event_host;
461
+ $e['host_email'] = (!$host || $host->user_email == '')?$author->user_email:$host->user_email;
462
+ $e['host_gravatar'] = ( !$host || $host->user_email == '' )?$e['gravatar']:get_avatar( $host->user_email );
463
+ } else {
464
+ $e['author'] = 'Public Submitter';
465
+ $e['host'] = 'Public Submitter';
466
+ $e['host_email'] = '';
467
+ $e['author_email'] = '';
468
+ $e['gravatar'] = '';
469
+ $e['host_gravatar'] = '';
470
+ $e['author_id'] = false;
471
+ $e['host_id'] = false;
472
+ }
473
+ return $e;
474
+ }
475
+
476
+ add_filter( 'mc_filter_shortcodes', 'mc_auto_excerpt', 10, 2 );
477
+ function mc_auto_excerpt( $e, $event ) {
478
+ $description = $e['description'];
479
+ $shortdesc = $e['shortdesc'];
480
+ $e['excerpt'] = $shortdesc;
481
+ if ( $description != '' ) { // if description is empty, this won't work, so skip it.
482
+ $num_words = apply_filters( 'mc_excerpt_length', 55 );
483
+ $excerpt = wp_trim_words( $description, $num_words );
484
+ $e['excerpt'] = ( $shortdesc == '' ) ? $excerpt : $shortdesc;
485
+ }
486
+ return $e;
487
+ }
488
+
489
+ add_filter( 'mc_filter_image_data', 'mc_image_data', 10, 2 );
490
+ function mc_image_data( $e, $event ) {
491
+ $atts = apply_filters( 'mc_post_thumbnail_atts', array( 'class'=>'mc-image' ) );
492
+ $e['full'] = get_the_post_thumbnail( $event->event_post );
493
+ $sizes = get_intermediate_image_sizes();
494
+ foreach ( $sizes as $size ) {
495
+ $e[$size] = get_the_post_thumbnail( $event->event_post, $size, $atts );
496
+ }
497
+ if ( is_numeric( $event->event_post ) && isset( $e['medium'] ) ) {
498
+ $e['image_url'] = strip_tags( $e['medium'] );
499
+ $e['image'] = $e['medium'];
500
+ } else {
501
+ $e['image_url'] = ( $event->event_image != '' )?$event->event_image:'';
502
+ $e['image'] = ( $event->event_image != '' )?"<img src='$event->event_image' alt='' class='mc-image' />":'';
503
+ }
504
+ return $e;
505
+ }
506
+
507
+ function mc_event_recur_string( $event ) {
508
+ $recurs = str_split( $event->event_recur, 1 );
509
+ $recur = $recurs[0];
510
+ $every = ( isset($recurs[1]) )?$recurs[1]:1;
511
+ $month_date = date( 'dS',strtotime( $event->occur_begin ) );
512
+ $day_name = date_i18n( 'l',strtotime( $event->occur_begin ) );
513
+ $week_number = mc_ordinal( week_of_month( date('j',strtotime($event->occur_begin) ) ) +1 );
514
+ switch ( $recur ) {
515
+ case 'S':$event_recur=__('Does not recur','my-calendar');break;
516
+ case 'D':$event_recur=__('Daily','my-calendar');break;
517
+ case 'E':$event_recur=__('Daily, weekdays only','my-calendar');break;
518
+ case 'W':$event_recur=__('Weekly','my-calendar');break;
519
+ case 'B':$event_recur=__('Bi-weekly','my-calendar');break;
520
+ case 'M':$event_recur=sprintf(__('the %s of each month','my-calendar'), $month_date );break;
521
+ case 'U':$event_recur=sprintf(__('the %s %s of each month','my-calendar'), $week_number, $day_name );break;
522
+ case 'Y':$event_recur=__('Annually','my-calendar');break;
523
+ }
524
+ return apply_filters( 'mc_event_recur_string', $event_recur, $event );
525
  }
my-calendar-templating.php CHANGED
@@ -5,50 +5,38 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
5
  function edit_mc_templates() {
6
  global $wpdb;
7
  $mcdb = $wpdb;
8
- // We can't use this page unless My Calendar is installed/upgraded
9
- check_my_calendar();
10
  $templates = get_option( 'mc_templates' );
11
 
 
 
 
 
 
12
  if ( isset($_POST['mc_grid_template'] ) ) {
13
- $nonce=$_REQUEST['_wpnonce'];
14
- if ( !wp_verify_nonce($nonce,'my-calendar-nonce') ) die("Security check failed");
15
-
16
  $mc_grid_template = $_POST['mc_grid_template'];
17
  $templates['grid'] = $mc_grid_template;
18
  update_option( 'mc_templates', $templates );
19
  update_option( 'mc_use_grid_template',( empty($_POST['mc_use_grid_template'])?0:1 ) );
20
-
21
  echo "<div class=\"updated\"><p><strong>".__('Grid Output Template saved','my-calendar').".</strong></p></div>";
22
  }
23
 
24
  if ( isset($_POST['mc_rss_template'] ) ) {
25
- $nonce=$_REQUEST['_wpnonce'];
26
- if ( !wp_verify_nonce($nonce,'my-calendar-nonce') ) die("Security check failed");
27
-
28
  $mc_rss_template = $_POST['mc_rss_template'];
29
  $templates['rss'] = $mc_rss_template;
30
  update_option( 'mc_templates', $templates );
31
  update_option( 'mc_use_rss_template',( empty($_POST['mc_use_rss_template'])?0:1 ) );
32
-
33
  echo "<div class=\"updated\"><p><strong>".__('RSS Feed Output Template saved','my-calendar').".</strong></p></div>";
34
  }
35
 
36
  if ( isset($_POST['mc_list_template'] ) ) {
37
- $nonce=$_REQUEST['_wpnonce'];
38
- if ( !wp_verify_nonce($nonce,'my-calendar-nonce') ) die("Security check failed");
39
-
40
  $mc_list_template = $_POST['mc_list_template'];
41
  $templates['list'] = $mc_list_template;
42
  update_option( 'mc_templates', $templates );
43
  update_option( 'mc_use_list_template',( empty($_POST['mc_use_list_template'])?0:1 ) );
44
-
45
  echo "<div class=\"updated\"><p><strong>".__('List Output Template saved','my-calendar').".</strong></p></div>";
46
  }
47
 
48
  if ( isset($_POST['mc_mini_template'] ) ) {
49
- $nonce=$_REQUEST['_wpnonce'];
50
- if ( !wp_verify_nonce($nonce,'my-calendar-nonce') ) die("Security check failed");
51
-
52
  $mc_mini_template = $_POST['mc_mini_template'];
53
  $templates['mini'] = $mc_mini_template;
54
  update_option( 'mc_templates', $templates );
@@ -56,40 +44,34 @@ function edit_mc_templates() {
56
  echo "<div class=\"updated\"><p><strong>".__('Mini Output Template saved','my-calendar').".</strong></p></div>";
57
  }
58
 
59
- if ( isset($_POST['mc_details_template'] ) ) {
60
- $nonce=$_REQUEST['_wpnonce'];
61
- if ( !wp_verify_nonce($nonce,'my-calendar-nonce') ) die("Security check failed");
62
-
63
  $mc_details_template = $_POST['mc_details_template'];
64
  $templates['details'] = $mc_details_template;
65
  update_option( 'mc_templates', $templates );
66
  update_option( 'mc_use_details_template',( empty($_POST['mc_use_details_template'])?0:1 ) );
67
  echo "<div class=\"updated\"><p><strong>".__('Event Details Template saved','my-calendar').".</strong></p></div>";
68
- }
 
69
  global $grid_template, $list_template, $mini_template, $single_template, $rss_template;
70
- $mc_grid_template = stripslashes( ($templates['grid']!='')?$templates['grid']:$grid_template );
71
- $mc_use_grid_template = get_option('mc_use_grid_template');
72
- $mc_rss_template = stripslashes( ($templates['rss']!='')?$templates['rss']:$rss_template );
73
  $mc_use_rss_template = get_option('mc_use_rss_template');
74
- $mc_list_template = stripslashes( ($templates['list']!='')?$templates['list']:$list_template );
75
- $mc_use_list_template = get_option('mc_use_list_template');
76
- $mc_mini_template = stripslashes( ($templates['mini']!='')?$templates['mini']:$mini_template );
77
- $mc_use_mini_template = get_option('mc_use_mini_template');
78
- $mc_details_template = stripslashes( ($templates['details']!='')?$templates['details']:$single_template );
79
- $mc_use_details_template = get_option('mc_use_details_template');
80
- ?>
81
  <div class="wrap jd-my-calendar">
82
-
83
-
84
- <?php my_calendar_check_db(); ?>
85
  <h2><?php _e('My Calendar Information Templates','my-calendar'); ?></h2>
86
 
87
- <div class="postbox-container" style="width: 70%">
88
  <div class="metabox-holder">
89
 
90
  <p><?php _e('Advanced users may customize the HTML template for each event. This page lets you create a customized view of your events in each context. All available template tags are documented on the Help page. These default templates are based on the default views with all output enabled. <strong>Custom templates will override any other output rules in your settings.</strong>','my-calendar'); ?> <a href="<?php echo admin_url("admin.php?page=my-calendar-help#templates"); ?>"><?php _e("Templates Help",'my-calendar'); ?></a> &raquo;</p>
91
 
92
-
93
  <div class="ui-sortable meta-box-sortables">
94
  <div class="postbox">
95
  <h3><?php _e('My Calendar: Grid Event Template','my-calendar'); ?></h3>
@@ -97,10 +79,10 @@ function edit_mc_templates() {
97
  <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-templates"); ?>">
98
  <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div>
99
  <p>
100
- <input type="checkbox" id="mc_use_grid_template" name="mc_use_grid_template" value="1" <?php mc_is_checked('mc_use_grid_template',1); ?>/> <label for="mc_use_grid_template"><?php _e('Use this grid event template','my-calendar'); ?></label>
101
  </p>
102
  <p>
103
- <label for="mc_grid_template"><?php _e('Your custom template for events in the calendar grid output.','my-calendar'); ?></label><br /><textarea id="mc_grid_template" name="mc_grid_template" class="template-editor" rows="12" cols="76"><?php echo $mc_grid_template; ?></textarea>
104
  </p>
105
  <p>
106
  <input type="submit" name="save" class="button-primary" value="<?php _e('Save Grid Template','my-calendar'); ?>" />
@@ -117,10 +99,10 @@ function edit_mc_templates() {
117
  <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-templates"); ?>">
118
  <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div>
119
  <p>
120
- <input type="checkbox" id="mc_use_list_template" name="mc_use_list_template" value="1" <?php mc_is_checked('mc_use_list_template',1); ?>/> <label for="mc_use_list_template"><?php _e('Use this list event template','my-calendar'); ?></label>
121
  </p>
122
  <p>
123
- <label for="mc_list_template"><?php _e('Your custom template for events in calendar list output.','my-calendar'); ?></label><br /><textarea id="mc_list_template" name="mc_list_template" class="template-editor" rows="12" cols="76"><?php echo $mc_list_template; ?></textarea>
124
  </p>
125
  <p>
126
  <input type="submit" name="save" class="button-primary" value="<?php _e('Save List Template','my-calendar'); ?>" />
@@ -137,10 +119,10 @@ function edit_mc_templates() {
137
  <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-templates"); ?>">
138
  <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div>
139
  <p>
140
- <input type="checkbox" id="mc_use_mini_template" name="mc_use_mini_template" value="1" <?php mc_is_checked('mc_use_mini_template',1); ?>/> <label for="mc_use_mini_template"><?php _e('Use this mini event template','my-calendar'); ?></label>
141
  </p>
142
  <p>
143
- <label for="mc_mini_template"><?php _e('Your custom template for events in sidebar/mini calendar output.','my-calendar'); ?></label><br /><textarea id="mc_mini_template" name="mc_mini_template" rows="12" cols="76" class="template-editor"><?php echo $mc_mini_template; ?></textarea>
144
  </p>
145
  <p>
146
  <input type="submit" name="save" class="button-primary" value="<?php _e('Save Mini Template','my-calendar'); ?>" />
@@ -157,10 +139,10 @@ function edit_mc_templates() {
157
  <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-templates"); ?>">
158
  <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div>
159
  <p>
160
- <input type="checkbox" id="mc_use_details_template" name="mc_use_details_template" value="1" <?php mc_is_checked('mc_use_details_template',1); ?>/> <label for="mc_use_details_template"><?php _e('Use this details template','my-calendar'); ?></label>
161
  </p>
162
  <p>
163
- <label for="mc_details_template"><?php _e('Your custom template for events on the event details page.','my-calendar'); ?></label><br /><textarea id="mc_details_template" name="mc_details_template" rows="12" cols="76" class="template-editor"><?php echo $mc_details_template; ?></textarea>
164
  </p>
165
  <p>
166
  <input type="submit" name="save" class="button-primary" value="<?php _e('Save Details Template','my-calendar'); ?>" />
@@ -178,10 +160,10 @@ function edit_mc_templates() {
178
  <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-templates"); ?>">
179
  <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div>
180
  <p>
181
- <input type="checkbox" id="mc_use_rss_template" name="mc_use_rss_template" value="1" <?php mc_is_checked('mc_use_rss_template',1); ?>/> <label for="mc_use_grid_template"><?php _e('Use this custom RSS event template','my-calendar'); ?></label>
182
  </p>
183
  <p>
184
- <label for="mc_rss_template"><?php _e('Your custom template for events in the RSS feed.','my-calendar'); ?></label><br /><textarea id="mc_rss_template" name="mc_rss_template" class="template-editor" rows="12" cols="76"><?php echo $mc_rss_template; ?></textarea>
185
  </p>
186
  <p>
187
  <input type="submit" name="save" class="button-primary" value="<?php _e('Save RSS Template','my-calendar'); ?>" />
@@ -189,13 +171,8 @@ function edit_mc_templates() {
189
  </form>
190
  </div>
191
  </div>
192
- </div>
193
-
194
  </div>
195
  </div>
196
-
197
- <?php jd_show_support_box('templates'); ?>
198
-
199
- <?php
200
- }
201
- ?>
5
  function edit_mc_templates() {
6
  global $wpdb;
7
  $mcdb = $wpdb;
 
 
8
  $templates = get_option( 'mc_templates' );
9
 
10
+ if ( !empty( $_POST ) ) {
11
+ $nonce = $_REQUEST['_wpnonce'];
12
+ if ( !wp_verify_nonce( $nonce,'my-calendar-nonce' ) ) die( "Security check failed" );
13
+ }
14
+
15
  if ( isset($_POST['mc_grid_template'] ) ) {
 
 
 
16
  $mc_grid_template = $_POST['mc_grid_template'];
17
  $templates['grid'] = $mc_grid_template;
18
  update_option( 'mc_templates', $templates );
19
  update_option( 'mc_use_grid_template',( empty($_POST['mc_use_grid_template'])?0:1 ) );
 
20
  echo "<div class=\"updated\"><p><strong>".__('Grid Output Template saved','my-calendar').".</strong></p></div>";
21
  }
22
 
23
  if ( isset($_POST['mc_rss_template'] ) ) {
 
 
 
24
  $mc_rss_template = $_POST['mc_rss_template'];
25
  $templates['rss'] = $mc_rss_template;
26
  update_option( 'mc_templates', $templates );
27
  update_option( 'mc_use_rss_template',( empty($_POST['mc_use_rss_template'])?0:1 ) );
 
28
  echo "<div class=\"updated\"><p><strong>".__('RSS Feed Output Template saved','my-calendar').".</strong></p></div>";
29
  }
30
 
31
  if ( isset($_POST['mc_list_template'] ) ) {
 
 
 
32
  $mc_list_template = $_POST['mc_list_template'];
33
  $templates['list'] = $mc_list_template;
34
  update_option( 'mc_templates', $templates );
35
  update_option( 'mc_use_list_template',( empty($_POST['mc_use_list_template'])?0:1 ) );
 
36
  echo "<div class=\"updated\"><p><strong>".__('List Output Template saved','my-calendar').".</strong></p></div>";
37
  }
38
 
39
  if ( isset($_POST['mc_mini_template'] ) ) {
 
 
 
40
  $mc_mini_template = $_POST['mc_mini_template'];
41
  $templates['mini'] = $mc_mini_template;
42
  update_option( 'mc_templates', $templates );
44
  echo "<div class=\"updated\"><p><strong>".__('Mini Output Template saved','my-calendar').".</strong></p></div>";
45
  }
46
 
47
+ if ( isset( $_POST['mc_details_template'] ) ) {
 
 
 
48
  $mc_details_template = $_POST['mc_details_template'];
49
  $templates['details'] = $mc_details_template;
50
  update_option( 'mc_templates', $templates );
51
  update_option( 'mc_use_details_template',( empty($_POST['mc_use_details_template'])?0:1 ) );
52
  echo "<div class=\"updated\"><p><strong>".__('Event Details Template saved','my-calendar').".</strong></p></div>";
53
+ }
54
+
55
  global $grid_template, $list_template, $mini_template, $single_template, $rss_template;
56
+ $mc_grid_template = stripslashes( ( $templates['grid']!='' ) ? $templates['grid'] : $grid_template );
57
+ $mc_use_grid_template = get_option( 'mc_use_grid_template' );
58
+ $mc_rss_template = stripslashes( ( $templates['rss']!='' ) ? $templates['rss'] : $rss_template );
59
  $mc_use_rss_template = get_option('mc_use_rss_template');
60
+ $mc_list_template = stripslashes( ( $templates['list']!='' ) ? $templates['list'] : $list_template );
61
+ $mc_use_list_template = get_option( 'mc_use_list_template' );
62
+ $mc_mini_template = stripslashes( ( $templates['mini']!='' ) ? $templates['mini'] : $mini_template );
63
+ $mc_use_mini_template = get_option( 'mc_use_mini_template' );
64
+ $mc_details_template = stripslashes( ( $templates['details']!='' ) ? $templates['details'] : $single_template );
65
+ $mc_use_details_template = get_option( 'mc_use_details_template' ); ?>
 
66
  <div class="wrap jd-my-calendar">
67
+ <?php my_calendar_check_db(); ?>
 
 
68
  <h2><?php _e('My Calendar Information Templates','my-calendar'); ?></h2>
69
 
70
+ <div class="postbox-container jcd-wide">
71
  <div class="metabox-holder">
72
 
73
  <p><?php _e('Advanced users may customize the HTML template for each event. This page lets you create a customized view of your events in each context. All available template tags are documented on the Help page. These default templates are based on the default views with all output enabled. <strong>Custom templates will override any other output rules in your settings.</strong>','my-calendar'); ?> <a href="<?php echo admin_url("admin.php?page=my-calendar-help#templates"); ?>"><?php _e("Templates Help",'my-calendar'); ?></a> &raquo;</p>
74
 
 
75
  <div class="ui-sortable meta-box-sortables">
76
  <div class="postbox">
77
  <h3><?php _e('My Calendar: Grid Event Template','my-calendar'); ?></h3>
79
  <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-templates"); ?>">
80
  <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div>
81
  <p>
82
+ <input type="checkbox" id="mc_use_grid_template" name="mc_use_grid_template" value="1" <?php mc_is_checked('mc_use_grid_template',1); ?>/> <label for="mc_use_grid_template"><?php _e('Use this grid event template','my-calendar'); ?></label>
83
  </p>
84
  <p>
85
+ <label for="mc_grid_template"><?php _e('Your custom template for events in the calendar grid output.','my-calendar'); ?></label><br /><textarea id="mc_grid_template" name="mc_grid_template" class="template-editor" rows="16" cols="76"><?php echo $mc_grid_template; ?></textarea>
86
  </p>
87
  <p>
88
  <input type="submit" name="save" class="button-primary" value="<?php _e('Save Grid Template','my-calendar'); ?>" />
99
  <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-templates"); ?>">
100
  <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div>
101
  <p>
102
+ <input type="checkbox" id="mc_use_list_template" name="mc_use_list_template" value="1" <?php mc_is_checked('mc_use_list_template',1); ?>/> <label for="mc_use_list_template"><?php _e('Use this list event template','my-calendar'); ?></label>
103
  </p>
104
  <p>
105
+ <label for="mc_list_template"><?php _e('Your custom template for events in calendar list output.','my-calendar'); ?></label><br /><textarea id="mc_list_template" name="mc_list_template" class="template-editor" rows="16" cols="76"><?php echo $mc_list_template; ?></textarea>
106
  </p>
107
  <p>
108
  <input type="submit" name="save" class="button-primary" value="<?php _e('Save List Template','my-calendar'); ?>" />
119
  <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-templates"); ?>">
120
  <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div>
121
  <p>
122
+ <input type="checkbox" id="mc_use_mini_template" name="mc_use_mini_template" value="1" <?php mc_is_checked('mc_use_mini_template',1); ?>/> <label for="mc_use_mini_template"><?php _e('Use this mini event template','my-calendar'); ?></label>
123
  </p>
124
  <p>
125
+ <label for="mc_mini_template"><?php _e('Your custom template for events in sidebar/mini calendar output.','my-calendar'); ?></label><br /><textarea id="mc_mini_template" name="mc_mini_template" rows="16" cols="76" class="template-editor"><?php echo $mc_mini_template; ?></textarea>
126
  </p>
127
  <p>
128
  <input type="submit" name="save" class="button-primary" value="<?php _e('Save Mini Template','my-calendar'); ?>" />
139
  <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-templates"); ?>">
140
  <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div>
141
  <p>
142
+ <input type="checkbox" id="mc_use_details_template" name="mc_use_details_template" value="1" <?php mc_is_checked('mc_use_details_template',1); ?>/> <label for="mc_use_details_template"><?php _e('Use this details template','my-calendar'); ?></label>
143
  </p>
144
  <p>
145
+ <label for="mc_details_template"><?php _e('Your custom template for events on the event details page.','my-calendar'); ?></label><br /><textarea id="mc_details_template" name="mc_details_template" rows="16" cols="76" class="template-editor"><?php echo $mc_details_template; ?></textarea>
146
  </p>
147
  <p>
148
  <input type="submit" name="save" class="button-primary" value="<?php _e('Save Details Template','my-calendar'); ?>" />
160
  <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-templates"); ?>">
161
  <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div>
162
  <p>
163
+ <input type="checkbox" id="mc_use_rss_template" name="mc_use_rss_template" value="1" <?php mc_is_checked('mc_use_rss_template',1); ?>/> <label for="mc_use_grid_template"><?php _e('Use this custom RSS event template','my-calendar'); ?></label>
164
  </p>
165
  <p>
166
+ <label for="mc_rss_template"><?php _e('Your custom template for events in the RSS feed.','my-calendar'); ?></label><br /><textarea id="mc_rss_template" name="mc_rss_template" class="template-editor" rows="16" cols="76"><?php echo $mc_rss_template; ?></textarea>
167
  </p>
168
  <p>
169
  <input type="submit" name="save" class="button-primary" value="<?php _e('Save RSS Template','my-calendar'); ?>" />
171
  </form>
172
  </div>
173
  </div>
174
+ </div>
 
175
  </div>
176
  </div>
177
+ <?php mc_show_sidebar('templates');
178
+ }
 
 
 
 
my-calendar-upgrade-db.php CHANGED
@@ -13,7 +13,7 @@ function my_calendar_check_db() {
13
  <p><?php _e('My Calendar Database is updated.','my-calendar'); ?></p>
14
  </div>
15
  <?php
16
- } else if ( !isset( $row->event_hide_end ) && isset( $row->event_id ) ) {
17
  if ( $_GET['page'] == 'my-calendar-config' ) { ?>
18
  <div class='upgrade-db error'>
19
  <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-config"); ?>">
13
  <p><?php _e('My Calendar Database is updated.','my-calendar'); ?></p>
14
  </div>
15
  <?php
16
+ } else if ( !isset( $row->event_tickets ) && isset( $row->event_id ) ) {
17
  if ( $_GET['page'] == 'my-calendar-config' ) { ?>
18
  <div class='upgrade-db error'>
19
  <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-config"); ?>">
my-calendar-user.php DELETED
@@ -1,57 +0,0 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
-
4
- function mc_user_profile() {
5
- global $user_ID;
6
- get_currentuserinfo();
7
- if ( isset($_GET['user_id']) ) {
8
- $user_ID = (int) $_GET['user_id'];
9
- }
10
- $mc_us = get_user_meta( $user_ID, 'my_calendar_user_settings', true );
11
- $options = get_option('mc_user_settings');
12
- if ( is_array( $options ) ) {
13
- foreach ($options as $key=>$value) {
14
- if ( isset($value['enabled']) && $value['enabled'] == 'on') {
15
- $name = $key;
16
- $label = $value['label'];
17
- $values = $value['values'];
18
- $form = "<input type='hidden' name='mc_users' value='1' />";
19
- $form .= "
20
- <tr>
21
- <th scope='row'><label for='my_calendar_user_settings'>$label</label></th>
22
- <td><select name='my_calendar_user_settings[$name]' id='my_calendar_user_settings'>
23
- <option value='none'>No preference</option>\n";
24
- foreach ($values as $optkey=>$optvalue) {
25
- if ( isset($mc_use[$name]) ) {
26
- $selected = ($mc_us[$name]==$optkey)?" selected='selected'":'';
27
- } else {
28
- $selected = '';
29
- }
30
- $form .= "<option value='$optkey'$selected>$optvalue</option>\n";
31
- }
32
- $form .= "</select></td>
33
- </tr>";
34
- }
35
- }
36
- }
37
- if ( get_option('mc_user_settings_enabled') == 'true' ) { ?>
38
- <h3><?php _e('My Calendar User Settings', 'my-calendar'); ?></h3>
39
- <table class="form-table">
40
- <?php
41
- echo $form;
42
- do_action( 'mc_update_user_form', $user_ID );
43
- ?>
44
- </table>
45
- <?php }
46
- }
47
-
48
- function mc_user_save_profile() {
49
- global $user_ID;
50
- get_currentuserinfo();
51
- if ( isset($_POST['user_id']) ) { $user_ID = (int) $_POST['user_id']; }
52
- if ( isset( $_POST['mc_users'] ) ) {
53
- update_user_meta($user_ID ,'my_calendar_user_settings' , $_POST['my_calendar_user_settings'] );
54
- do_action( 'mc_update_user_data', $_POST, $user_ID );
55
- }
56
- }
57
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
my-calendar-widgets.php CHANGED
@@ -6,11 +6,26 @@ class my_calendar_simple_search extends WP_Widget {
6
  parent::WP_Widget( false, $name=__('My Calendar: Simple Event Search','my-calendar') );
7
  }
8
  function widget($args,$instance) {
 
 
 
 
9
  echo my_calendar_searchform('simple');
 
10
  }
11
- function form( $instance ) {
 
 
 
 
 
 
 
12
  }
13
  function update( $new_instance, $old_instance ) {
 
 
 
14
  }
15
  }
16
 
@@ -22,7 +37,7 @@ class my_calendar_today_widget extends WP_Widget {
22
 
23
  function widget( $args, $instance ) {
24
  extract($args);
25
- $the_title = apply_filters('widget_title',$instance['my_calendar_today_title']);
26
  $the_template = $instance['my_calendar_today_template'];
27
  $the_substitute = $instance['my_calendar_no_events_text'];
28
  $the_category = ($instance['my_calendar_today_category']=='')?'default':esc_attr($instance['my_calendar_today_category']);
@@ -113,7 +128,7 @@ class my_calendar_upcoming_widget extends WP_Widget {
113
 
114
  function widget($args, $instance) {
115
  extract($args);
116
- $the_title = apply_filters('widget_title',$instance['my_calendar_upcoming_title']);
117
  $the_template = $instance['my_calendar_upcoming_template'];
118
  $the_substitute = $instance['my_calendar_no_events_text'];
119
  $before = ($instance['my_calendar_upcoming_before']!='')?esc_attr($instance['my_calendar_upcoming_before']):3;
@@ -130,7 +145,7 @@ class my_calendar_upcoming_widget extends WP_Widget {
130
  $widget_title = empty($the_title) ? '' : $the_title;
131
  $widget_title = ($widget_link=='') ? $widget_title : "<a href='$widget_link'>$widget_title</a>";
132
  $widget_title = ($widget_title!='') ? $before_title . $widget_title . $after_title : '';
133
- $the_events = my_calendar_upcoming_events($before,$after,$type,$the_category,$the_template,$the_substitute,$order,$skip, $show_today,$author,$host);
134
  if ($the_events != '') {
135
  echo $before_widget;
136
  echo $widget_title;
@@ -240,14 +255,14 @@ class my_calendar_upcoming_widget extends WP_Widget {
240
  }
241
 
242
  // Widget upcoming events
243
- function my_calendar_upcoming_events($before='default',$after='default',$type='default',$category='default',$template='default',$substitute='',$order='asc',$skip=0, $show_today='yes',$author='default',$host='default' ) {
244
  global $wpdb,$default_template,$defaults;
245
  $mcdb = $wpdb;
246
  if ( get_option( 'mc_remote' ) == 'true' && function_exists('mc_remote_db') ) { $mcdb = mc_remote_db(); }
247
  $output = '';
248
  $date_format = ( get_option('mc_date_format') != '' )?get_option('mc_date_format'):get_option('date_format');
249
- // This function cannot be called unless calendar is up to date
250
- check_my_calendar();
251
  $offset = (60*60*get_option('gmt_offset'));
252
  $widget_defaults = get_option('mc_widget_defaults');
253
  $widget_defaults = ( !is_array($widget_defaults) )?array():$widget_defaults; // get globals; check on mc_widget_des
@@ -260,6 +275,10 @@ function my_calendar_upcoming_events($before='default',$after='default',$type='d
260
  $before = ($before == 'default')?$widget_defaults['upcoming']['before']:$before;
261
  $before = ($before == '')?0:$before;
262
  $category = ($category == 'default')?'':$category;
 
 
 
 
263
  $template = ($template == 'default')?$widget_defaults['upcoming']['template']:$template;
264
  $template = ($template == '' )?$default_template:$template;
265
  $no_event_text = ($substitute == '')?$widget_defaults['upcoming']['text']:$substitute;
@@ -281,27 +300,21 @@ function my_calendar_upcoming_events($before='default',$after='default',$type='d
281
  $from = date( 'Y-1-1' );
282
  $to = date( 'Y-12-31' );
283
  }
284
- $events = my_calendar_grab_events( $from, $to, $category,'','','upcoming',$author, $host );
285
- if ( !get_option('mc_skip_holidays_category') || get_option('mc_skip_holidays_category') == '' ) {
286
- $holidays = array();
287
- } else {
288
- $holidays = my_calendar_grab_events( $from, $to, get_option('mc_skip_holidays_category'),'','', 'upcoming', $author, $host );
289
- $holiday_array = mc_set_date_array( $holidays );
290
- }
291
- // get events into an easily parseable set, keyed by date.
292
- if ( is_array( $events ) && !empty($events) ) {
293
- $no_events = false;
294
- $event_array = mc_set_date_array( $events );
295
- if ( is_array( $holidays ) && count($holidays) > 0 ) {
296
- $event_array = mc_holiday_limit( $event_array, $holiday_array ); // if there are holidays, rejigger.
297
- }
298
- }
299
  if (count($event_array) != 0) {
300
  foreach( $event_array as $key=>$value) {
301
  if ( is_array($value) ) {
302
  foreach ( $value as $k => $v ) {
303
- $event = event_as_array( $v );
304
- $temp_array[] = $event;
 
 
 
 
305
  }
306
  }
307
  }
@@ -310,6 +323,7 @@ function my_calendar_upcoming_events($before='default',$after='default',$type='d
310
  $last_item = '';
311
  $last_id = '';
312
  $last_date = '';
 
313
  foreach ( reverse_array($temp_array, true, $order) as $details ) {
314
  $item = jd_draw_template($details,$template);
315
  if ( $i < $skip && $skip != 0 ) {
@@ -317,9 +331,12 @@ function my_calendar_upcoming_events($before='default',$after='default',$type='d
317
  } else {
318
  // if same group, and same date, use it.
319
  if ( ( $details['group'] !== $last_id || $details['date'] == $last_date ) || $details['group'] == '0' ) {
320
- $output .= ( $item == $last_item )?'':"<li>$item</li>";
 
 
321
  }
322
  }
 
323
  $last_id = $details['group']; // prevent group events from displaying in a row. Not if there are intervening events.
324
  $last_item = $item;
325
  $last_date = $details['date'];
@@ -334,32 +351,37 @@ function my_calendar_upcoming_events($before='default',$after='default',$type='d
334
  $events = $cache[$category];
335
  $cache = false; // take cache out of memory
336
  } else {
337
- $events = mc_get_all_events($category, $before, $after, $show_today, $author, $host);
338
  $cache[$category] = $events;
339
  set_transient( 'mc_cache_upcoming', $cache, 60*30 );
340
  }
341
  } else {
342
- $events = mc_get_all_events($category, $before, $after, $show_today, $author, $host);
343
  $cache[$category] = $events;
344
  set_transient( 'mc_cache_upcoming', $cache, 60*30 );
345
  }
346
  } else {
347
- $events = mc_get_all_events($category, $before, $after, $show_today, $author, $host); // grab all events within reasonable proximity
348
  }
 
349
  if ( !get_option('mc_skip_holidays_category') || get_option('mc_skip_holidays_category') == '' ) {
350
  $holidays = array();
351
  } else {
352
  $holidays = mc_get_all_holidays( $before, $after, $show_today );
353
  $holiday_array = mc_set_date_array( $holidays );
354
  }
355
- if ( is_array( $events ) && !empty($events) ) {
356
- $no_events = false;
357
- $event_array = mc_set_date_array( $events );
358
- if ( is_array( $holidays ) && count($holidays) > 0 ) {
359
- $event_array = mc_holiday_limit( $event_array, $holiday_array ); // if there are holidays, rejigger.
360
- }
361
  }
362
- $output .= mc_produce_upcoming_events( $event_array,$template,'list',$order,$skip,$before, $after, $show_today );
 
 
 
 
 
363
  }
364
  if ($output != '') {
365
  $output = $header.$output.$footer;
@@ -368,10 +390,11 @@ function my_calendar_upcoming_events($before='default',$after='default',$type='d
368
  return stripcslashes( $no_event_text );
369
  }
370
  }
 
371
  function mc_span_time( $group_id ) {
372
- global $wpdb;
373
- $mcdb = $wpdb;
374
- if ( get_option( 'mc_remote' ) == 'true' && function_exists('mc_remote_db') ) { $mcdb = mc_remote_db(); }
375
  $group_id = (int) $group_id;
376
  $sql = "SELECT event_begin, event_time, event_end, event_endtime FROM ".my_calendar_table()." WHERE event_group_id = $group_id ORDER BY event_begin ASC";
377
  $dates = $mcdb->get_results( $sql );
@@ -381,11 +404,12 @@ global $wpdb;
381
  $end = $dates[$last]->event_end . ' ' . $dates[$last]->event_endtime;
382
  return array( $begin, $end );
383
  }
 
384
  // function generates the list of upcoming events by event
385
- function mc_produce_upcoming_events($events,$template,$type='list',$order='asc',$skip=0,$before, $after, $show_today='yes') {
386
  // $events has +5 before and +5 after if those values are non-zero.
387
- // $events equals array of events based on before/after queries. Nothing has been skipped, order is not set, holidays are removed.
388
- $output = '';$near_events = $temp_array = array();$past = $future = 1;
389
  $now = current_time( 'timestamp' );
390
  $today = date('Y',$now).'-'.date('m',$now).'-'.date('d',$now);
391
  @uksort( $events, "my_calendar_timediff_cmp" );// sort all events by proximity to current date
@@ -397,7 +421,7 @@ function mc_produce_upcoming_events($events,$template,$type='list',$order='asc',
397
  $extra = 0;
398
  $i = 0;
399
  // create near_events array
400
- $last_events = array();
401
  if ( is_array( $events ) ) {
402
  foreach ( $events as $k=>$event ) {
403
  if ( $i < $count ) {
@@ -429,8 +453,9 @@ function mc_produce_upcoming_events($events,$template,$type='list',$order='asc',
429
  }
430
  // end multi-day reduction
431
  if ( !$md ) {
432
- // check if this event instance has already been displayed
433
- $same_event = ( in_array($e->occur_id ,$last_events ) )?true:false;
 
434
  if ( $show_today == 'yes' && my_calendar_date_equal( $beginning, $current ) ) {
435
  $in_total = 'yes'; // count todays events in total
436
  if ( $in_total != 'no' ) {
@@ -439,22 +464,24 @@ function mc_produce_upcoming_events($events,$template,$type='list',$order='asc',
439
  } else {
440
  $near_events[] = $e;
441
  }
442
- } else if ( ( $past<=$before && $future<=$after ) ) {
443
  $near_events[] = $e; // if neither limit is reached, split off freely
444
  } else if ( $past <= $before && ( my_calendar_date_comp( $beginning,$current ) ) ) {
445
  $near_events[] = $e; // split off another past event
446
  } else if ( $future <= $after && ( !my_calendar_date_comp( $end,$current ) ) ) {
447
  $near_events[] = $e; // split off another future event
448
  }
 
449
  if ( my_calendar_date_comp( $beginning,$current ) ) {
450
- if ( !$same_event ) { $past++; } else { $extra++; }
451
- } else if ( my_calendar_date_equal( $beginning,$current ) ) {
452
  $present = 1;
453
  if ( $show_today == 'yes' ) { $extra++; }
454
- } else {
455
- if ( !$same_event ) { $future++; } else { $extra++;}
456
  }
457
  $last_events[] = $e->occur_id;
 
458
  $last_date = $beginning;
459
  }
460
  if ( $past > $before && $future > $after && $show_today != 'yes' ) {
@@ -478,12 +505,11 @@ function mc_produce_upcoming_events($events,$template,$type='list',$order='asc',
478
  array_pop($events);
479
  }
480
  }
481
-
482
  if ( is_array( $events ) ) {
483
  foreach( array_keys($events) as $key ) {
484
  $event =& $events[$key];
485
  //echo $event->event_title . " " . $event->event_group_id."<br />";
486
- $event_details = event_as_array( $event );
487
  if ( get_option( 'mc_event_approve' ) == 'true' ) {
488
  if ( $event->event_approved != 0 ) { $temp_array[] = $event_details; }
489
  } else {
@@ -530,7 +556,7 @@ function mc_produce_upcoming_events($events,$template,$type='list',$order='asc',
530
  }
531
 
532
  // Widget todays events
533
- function my_calendar_todays_events($category='default',$template='default',$substitute='',$author='all', $host='all') {
534
  $caching = apply_filters( 'mc_cache_enabled', false );
535
  $todays_cache = ($caching)? get_transient('mc_todays_cache') :'';
536
  if ( $caching && is_array($todays_cache) && @$todays_cache[$category] ) { return @$todays_cache[$category]; }
@@ -538,8 +564,7 @@ function my_calendar_todays_events($category='default',$template='default',$subs
538
  $mcdb = $wpdb;
539
  if ( get_option( 'mc_remote' ) == 'true' && function_exists('mc_remote_db') ) { $mcdb = mc_remote_db(); }
540
  $output = '';
541
- // This function cannot be called unless calendar is up to date
542
- check_my_calendar();
543
  $defaults = get_option('mc_widget_defaults');
544
  $template = ($template == 'default')?$defaults['today']['template']:$template;
545
  if ($template == '' ) { $template = "$default_template"; };
@@ -548,48 +573,38 @@ function my_calendar_todays_events($category='default',$template='default',$subs
548
  $no_event_text = ($substitute == '')?$defaults['today']['text']:$substitute;
549
 
550
  $from = $to = date( 'Y-m-d', current_time( 'timestamp' ) );
551
- $events = my_calendar_grab_events($from, $to,$category,'','','upcoming',$author, $host);
552
  $header = "<ul id='todays-events'>";
553
  $footer = "</ul>";
554
- $holiday_exists = false;
555
- @usort($events, "my_calendar_time_cmp");
556
- $groups = array();
557
  // quick loop through all events today to check for holidays
558
- if (is_array($events) ) {
559
- foreach( array_keys($events) as $key ) {
560
- $event =& $events[$key];
561
- if ( $event->event_category == get_option('mc_skip_holidays_category') ) { $holiday_exists = true; }
562
- }
563
  foreach( array_keys($events) as $key ) {
564
  $event =& $events[$key];
565
- if ( $event->category_private == 1 && !is_user_logged_in() ) {
566
- } else {
567
- if ( !in_array( $event->event_group_id, $groups ) ) {
568
- $event_details = event_as_array($event);
569
- $date = date_i18n(get_option('mc_date_format'), current_time( 'timestamp' ) );
570
-
571
- $this_event = '';
572
- if ( $event->event_holiday == 0 ) {
573
- if ( get_option( 'mc_event_approve' ) == 'true' ) {
574
- if ( $event->event_approved != 0 ) {$this_event = "<li>".jd_draw_template($event_details,$template)."</li>";}
575
- } else {
576
- $this_event = "<li>".jd_draw_template($event_details,$template)."</li>";
577
- }
578
  } else {
579
- // if we found a holiday earlier, then we know there is one today.
580
- if ( !$holiday_exists || ( $holiday_exists && $event->event_category == get_option('mc_skip_holidays_category') ) ) {
 
 
581
  if ( get_option( 'mc_event_approve' ) == 'true' ) {
582
- if ( $event->event_approved != 0 ) {$this_event = "<li>".jd_draw_template($event_details,$template)."</li>";}
 
 
583
  } else {
584
- $this_event = "<li>".jd_draw_template($event_details,$template)."</li>";
585
  }
586
  }
587
  }
588
- $output .= apply_filters( 'mc_event_today',$this_event,$event );
589
- }
590
  }
591
  }
592
-
 
 
 
 
 
593
  if (count($events) != 0) {
594
  $return = $header.$output.$footer;
595
  } else {
@@ -613,60 +628,41 @@ function my_calendar_mini_widget() {
613
 
614
  function widget($args, $instance) {
615
  extract($args);
 
616
  if ( !empty($instance) ) {
617
- $the_title = apply_filters('widget_title',$instance['my_calendar_mini_title']);
618
- $name = $format = 'mini';
619
  $category = ($instance['my_calendar_mini_category']=='')?'all':esc_attr($instance['my_calendar_mini_category']);
620
- $showkey = ($instance['my_calendar_mini_showkey']=='')?'no':esc_attr($instance['my_calendar_mini_showkey']);
621
- $showjump = ($instance['my_calendar_mini_showjump']=='')?'no':esc_attr($instance['my_calendar_mini_showjump']);
622
- $shownav = ($instance['my_calendar_mini_shownav']=='')?'no':esc_attr($instance['my_calendar_mini_shownav']);
623
  $time = ($instance['my_calendar_mini_time']=='')?'month':esc_attr($instance['my_calendar_mini_time']);
624
  $widget_link = ( !isset($instance['mc_link']) || $instance['mc_link']=='')?'':esc_url($instance['mc_link']);
625
- $above = (empty($instance['above']))?'none':esc_attr($instance['above']);
626
- $below = (empty($instance['below']))?'none':esc_attr($instance['below']);
627
- $author = ($instance['author']=='')?null:esc_attr($instance['author']);
628
- $host = ($instance['host']=='')?null:esc_attr($instance['host']);
629
  } else {
630
- $the_title = '';
631
- $name = 'mini';
632
- $category = '';
633
- $showkey = '';
634
- $shownav = '';
635
- $time = '';
636
- $widget_link = '';
637
- $above = '';
638
- $below = '';
639
  }
640
- $widget_title = empty($the_title) ? __('Calendar','my-calendar') : $the_title;
641
- $widget_title = ($widget_link!='') ? "<a href='$widget_link'>$widget_title</a>" : $widget_title;
642
- $widget_title = ($widget_title!='') ? $before_title . $widget_title . $after_title : '';
643
- $the_events = my_calendar( $name,$format,$category,$showkey,$shownav,$showjump,'no',$time,'','','jd-calendar','','',$author, $host, $above, $below );
644
- if ($the_events != '') {
645
- echo $before_widget;
646
- echo $widget_title;
647
- echo $the_events;
648
- echo $after_widget;
649
- }
650
  }
651
 
652
  function form($instance) {
653
- $widget_title = esc_attr($instance['my_calendar_mini_title']);
654
- if ( isset($instance['my_calendar_mini_showkey']) ) {
655
- $widget_key = esc_attr($instance['my_calendar_mini_showkey']); // deprecated
656
- $widget_jump = esc_attr($instance['my_calendar_mini_showjump']); // deprecated
657
- $widget_nav = esc_attr($instance['my_calendar_mini_shownav']); // deprecated
658
- }
659
- $widget_time = esc_attr($instance['my_calendar_mini_time']);
660
- $widget_category = esc_attr($instance['my_calendar_mini_category']);
661
  $above = ( isset($instance['above']) )?esc_attr($instance['above']):'';
662
  $below = ( isset($instance['below']) )?esc_attr($instance['below']):'';
663
  $widget_link = ( isset($instance['mc_link']) )?esc_url($instance['mc_link']):'';
664
  $host = ( isset($instance['host']) )?$instance['host']:'';
665
  $author = ( isset($instance['author']) )?$instance['author']:'';
666
- ?>
667
  <p>
668
  <label for="<?php echo $this->get_field_id('my_calendar_mini_title'); ?>"><?php _e('Title','my-calendar'); ?>:</label><br />
669
- <input class="widefat" type="text" id="<?php echo $this->get_field_id('my_calendar_mini_title'); ?>" name="<?php echo $this->get_field_name('my_calendar_mini_title'); ?>" value="<?php echo $widget_title; ?>"/>
670
  </p>
671
  <p>
672
  <label for="<?php echo $this->get_field_id('mc_link'); ?>"><?php _e('Widget Title Link','my-calendar'); ?>:</label><br />
@@ -676,14 +672,6 @@ function form($instance) {
676
  <label for="<?php echo $this->get_field_id('my_calendar_mini_category'); ?>"><?php _e('Category or categories to display:','my-calendar'); ?></label><br />
677
  <input class="widefat" type="text" id="<?php echo $this->get_field_id('my_calendar_mini_category'); ?>" name="<?php echo $this->get_field_name('my_calendar_mini_category'); ?>" value="<?php echo $widget_category; ?>" /></textarea>
678
  </p>
679
- <?php // NEW STUFF JCD ?>
680
- <?php if ( $above == '' && $below == '' ) { ?>
681
- <div>
682
- <input type="hidden" name="<?php echo $this->get_field_name('my_calendar_mini_shownav'); ?>" value="<?php $widget_nav; ?>" />
683
- <input type="hidden" name="<?php echo $this->get_field_name('my_calendar_mini_showjump'); ?>" value="<?php $widget_jump; ?>" />
684
- <input type="hidden" name="<?php echo $this->get_field_name('my_calendar_mini_showkey'); ?>" value="<?php $widget_key; ?>" />
685
- </div>
686
- <?php } ?>
687
  <p>
688
  <label for="<?php echo $this->get_field_name('above'); ?>"><?php _e('Navigation above calendar','my-calendar'); ?></label>
689
  <input type="text" class="widefat" name="<?php echo $this->get_field_name('above'); ?>" id="<?php echo $this->get_field_name('above'); ?>" value="<?php echo ( $above == '' )?'nav,jump,print':$above; ?>" />
@@ -706,7 +694,6 @@ function form($instance) {
706
  <?php echo mc_selected_users( $host ); ?>
707
  </select>
708
  </p>
709
- <?php // END NEW STUFF JCD ?>
710
  <p>
711
  <label for="<?php echo $this->get_field_id('my_calendar_mini_time'); ?>"><?php _e('Mini-Calendar Timespan:','my-calendar'); ?></label> <select id="<?php echo $this->get_field_id('my_calendar_mini_time'); ?>" name="<?php echo $this->get_field_name('my_calendar_mini_time'); ?>">
712
  <option value="month" <?php echo ($widget_time == 'month')?'selected="selected"':''; ?>><?php _e('Month','my-calendar') ?></option>
@@ -719,11 +706,6 @@ function form($instance) {
719
  function update($new_instance,$old_instance) {
720
  $instance = $old_instance;
721
  $instance['my_calendar_mini_title'] = strip_tags($new_instance['my_calendar_mini_title']);
722
- if ( isset($new_instance['my_calendar_mini_shownav']) ) {
723
- $instance['my_calendar_mini_showkey'] = $new_instance['my_calendar_mini_showkey'];
724
- $instance['my_calendar_mini_shownav'] = strip_tags($new_instance['my_calendar_mini_shownav']);
725
- $instance['my_calendar_mini_showjump'] = strip_tags($new_instance['my_calendar_mini_showjump']);
726
- }
727
  $instance['my_calendar_mini_time'] = strip_tags($new_instance['my_calendar_mini_time']);
728
  $instance['my_calendar_mini_category'] = strip_tags($new_instance['my_calendar_mini_category']);
729
  $instance['above'] = $new_instance['above'];
6
  parent::WP_Widget( false, $name=__('My Calendar: Simple Event Search','my-calendar') );
7
  }
8
  function widget($args,$instance) {
9
+ extract( $args );
10
+ $widget_title = apply_filters('widget_title',$instance['title'], $instance, $args );
11
+ echo $before_widget;
12
+ echo ( $instance['title'] != '' ) ? $widget_title : '';
13
  echo my_calendar_searchform('simple');
14
+ echo $after_widget;
15
  }
16
+ function form( $instance ) {
17
+ $widget_title = ( isset( $instance['title'] ) ) ? esc_attr( $instance['title'] ) : '';
18
+ ?>
19
+ <p>
20
+ <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title','my-calendar'); ?>:</label><br />
21
+ <input class="widefat" type="text" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo $widget_title; ?>"/>
22
+ </p>
23
+ <?php
24
  }
25
  function update( $new_instance, $old_instance ) {
26
+ $instance = $old_instance;
27
+ $instance['title'] = strip_tags( $new_instance['title'] );
28
+ return $instance;
29
  }
30
  }
31
 
37
 
38
  function widget( $args, $instance ) {
39
  extract($args);
40
+ $the_title = apply_filters('widget_title',$instance['my_calendar_today_title'], $instance, $args );
41
  $the_template = $instance['my_calendar_today_template'];
42
  $the_substitute = $instance['my_calendar_no_events_text'];
43
  $the_category = ($instance['my_calendar_today_category']=='')?'default':esc_attr($instance['my_calendar_today_category']);
128
 
129
  function widget($args, $instance) {
130
  extract($args);
131
+ $the_title = apply_filters('widget_title',$instance['my_calendar_upcoming_title'], $instance, $args );
132
  $the_template = $instance['my_calendar_upcoming_template'];
133
  $the_substitute = $instance['my_calendar_no_events_text'];
134
  $before = ($instance['my_calendar_upcoming_before']!='')?esc_attr($instance['my_calendar_upcoming_before']):3;
145
  $widget_title = empty($the_title) ? '' : $the_title;
146
  $widget_title = ($widget_link=='') ? $widget_title : "<a href='$widget_link'>$widget_title</a>";
147
  $widget_title = ($widget_title!='') ? $before_title . $widget_title . $after_title : '';
148
+ $the_events = my_calendar_upcoming_events($before,$after,$type,$the_category,$the_template,$the_substitute,$order,$skip,$show_today,$author,$host);
149
  if ($the_events != '') {
150
  echo $before_widget;
151
  echo $widget_title;
255
  }
256
 
257
  // Widget upcoming events
258
+ function my_calendar_upcoming_events( $before='default',$after='default',$type='default',$category='default',$template='default',$substitute='',$order='asc',$skip=0, $show_today='yes',$author='default',$host='default',$ltype='', $lvalue='' ) {
259
  global $wpdb,$default_template,$defaults;
260
  $mcdb = $wpdb;
261
  if ( get_option( 'mc_remote' ) == 'true' && function_exists('mc_remote_db') ) { $mcdb = mc_remote_db(); }
262
  $output = '';
263
  $date_format = ( get_option('mc_date_format') != '' )?get_option('mc_date_format'):get_option('date_format');
264
+ $date_format = apply_filters( 'mc_date_format', $date_format, 'upcoming_events' );
265
+
266
  $offset = (60*60*get_option('gmt_offset'));
267
  $widget_defaults = get_option('mc_widget_defaults');
268
  $widget_defaults = ( !is_array($widget_defaults) )?array():$widget_defaults; // get globals; check on mc_widget_des
275
  $before = ($before == 'default')?$widget_defaults['upcoming']['before']:$before;
276
  $before = ($before == '')?0:$before;
277
  $category = ($category == 'default')?'':$category;
278
+ // allow reference by file to external template.
279
+ if ( $template != '' && mc_file_exists( sanitize_file_name( $template ) ) ) {
280
+ $template = @file_get_contents( mc_get_file( sanitize_file_name( $template ) ) );
281
+ }
282
  $template = ($template == 'default')?$widget_defaults['upcoming']['template']:$template;
283
  $template = ($template == '' )?$default_template:$template;
284
  $no_event_text = ($substitute == '')?$widget_defaults['upcoming']['text']:$substitute;
300
  $from = date( 'Y-1-1' );
301
  $to = date( 'Y-12-31' );
302
  }
303
+ $from = apply_filters( 'mc_upcoming_date_from', $from );
304
+ $to = apply_filters( 'mc_upcoming_date_to', $to );
305
+
306
+ $event_array = my_calendar_events( $from, $to, $category, $ltype, $lvalue, 'upcoming', $author, $host );
307
+ $no_events = ( empty( $event_array ) ) ? true : false;
 
 
 
 
 
 
 
 
 
 
308
  if (count($event_array) != 0) {
309
  foreach( $event_array as $key=>$value) {
310
  if ( is_array($value) ) {
311
  foreach ( $value as $k => $v ) {
312
+ $event = mc_create_tags( $v );
313
+ if ( $v->category_private == 1 && !is_user_logged_in() ) {
314
+ // this event is private.
315
+ } else {
316
+ $temp_array[] = $event;
317
+ }
318
  }
319
  }
320
  }
323
  $last_item = '';
324
  $last_id = '';
325
  $last_date = '';
326
+ $skips = array();
327
  foreach ( reverse_array($temp_array, true, $order) as $details ) {
328
  $item = jd_draw_template($details,$template);
329
  if ( $i < $skip && $skip != 0 ) {
331
  } else {
332
  // if same group, and same date, use it.
333
  if ( ( $details['group'] !== $last_id || $details['date'] == $last_date ) || $details['group'] == '0' ) {
334
+ if ( !in_array( $details['dateid'], $skips ) ) {
335
+ $output .= ( $item == $last_item )?'':"<li>$item</li>";
336
+ }
337
  }
338
  }
339
+ $skips[] = $details['dateid']; // prevent the same event from showing more than once.
340
  $last_id = $details['group']; // prevent group events from displaying in a row. Not if there are intervening events.
341
  $last_item = $item;
342
  $last_date = $details['date'];
351
  $events = $cache[$category];
352
  $cache = false; // take cache out of memory
353
  } else {
354
+ $events = mc_get_all_events( $category, $before, $after, $show_today, $author, $host, $ltype, $lvalue );
355
  $cache[$category] = $events;
356
  set_transient( 'mc_cache_upcoming', $cache, 60*30 );
357
  }
358
  } else {
359
+ $events = mc_get_all_events( $category, $before, $after, $show_today, $author, $host, $ltype, $lvalue );
360
  $cache[$category] = $events;
361
  set_transient( 'mc_cache_upcoming', $cache, 60*30 );
362
  }
363
  } else {
364
+ $events = mc_get_all_events( $category, $before, $after, $show_today, $author, $host, $ltype, $lvalue ); // grab all events within reasonable proximity
365
  }
366
+
367
  if ( !get_option('mc_skip_holidays_category') || get_option('mc_skip_holidays_category') == '' ) {
368
  $holidays = array();
369
  } else {
370
  $holidays = mc_get_all_holidays( $before, $after, $show_today );
371
  $holiday_array = mc_set_date_array( $holidays );
372
  }
373
+ if ( is_array( $events ) && !empty($events) ) {
374
+ $no_events = false;
375
+ $event_array = mc_set_date_array( $events );
376
+ if ( is_array( $holidays ) && count($holidays) > 0 ) {
377
+ $event_array = mc_holiday_limit( $event_array, $holiday_array ); // if there are holidays, rejigger.
 
378
  }
379
+ }
380
+ if ( !empty( $event_array ) ) {
381
+ $output .= mc_produce_upcoming_events( $event_array,$template,'list',$order,$skip,$before, $after, $show_today );
382
+ } else {
383
+ $output = '';
384
+ }
385
  }
386
  if ($output != '') {
387
  $output = $header.$output.$footer;
390
  return stripcslashes( $no_event_text );
391
  }
392
  }
393
+
394
  function mc_span_time( $group_id ) {
395
+ global $wpdb;
396
+ $mcdb = $wpdb;
397
+ if ( get_option( 'mc_remote' ) == 'true' && function_exists('mc_remote_db') ) { $mcdb = mc_remote_db(); }
398
  $group_id = (int) $group_id;
399
  $sql = "SELECT event_begin, event_time, event_end, event_endtime FROM ".my_calendar_table()." WHERE event_group_id = $group_id ORDER BY event_begin ASC";
400
  $dates = $mcdb->get_results( $sql );
404
  $end = $dates[$last]->event_end . ' ' . $dates[$last]->event_endtime;
405
  return array( $begin, $end );
406
  }
407
+
408
  // function generates the list of upcoming events by event
409
+ function mc_produce_upcoming_events( $events, $template, $type='list', $order='asc', $skip=0, $before, $after, $show_today='yes', $context='filters' ) {
410
  // $events has +5 before and +5 after if those values are non-zero.
411
+ // $events equals array of events based on before/after queries. Nothing skipped, order is not set, holiday conflicts removed.
412
+ $output = ''; $near_events = $temp_array = array(); $past = $future = 1;
413
  $now = current_time( 'timestamp' );
414
  $today = date('Y',$now).'-'.date('m',$now).'-'.date('d',$now);
415
  @uksort( $events, "my_calendar_timediff_cmp" );// sort all events by proximity to current date
421
  $extra = 0;
422
  $i = 0;
423
  // create near_events array
424
+ $last_events = $last_group = array();
425
  if ( is_array( $events ) ) {
426
  foreach ( $events as $k=>$event ) {
427
  if ( $i < $count ) {
453
  }
454
  // end multi-day reduction
455
  if ( !$md ) {
456
+ // check if this event instance or this event group has already been displayed
457
+ $same_event = ( in_array( $e->occur_id ,$last_events ) )?true:false;
458
+ $same_group = ( in_array( $e->occur_group_id, $last_group ) )?true:false;
459
  if ( $show_today == 'yes' && my_calendar_date_equal( $beginning, $current ) ) {
460
  $in_total = 'yes'; // count todays events in total
461
  if ( $in_total != 'no' ) {
464
  } else {
465
  $near_events[] = $e;
466
  }
467
+ } else if ( ( $past <= $before && $future<=$after ) ) {
468
  $near_events[] = $e; // if neither limit is reached, split off freely
469
  } else if ( $past <= $before && ( my_calendar_date_comp( $beginning,$current ) ) ) {
470
  $near_events[] = $e; // split off another past event
471
  } else if ( $future <= $after && ( !my_calendar_date_comp( $end,$current ) ) ) {
472
  $near_events[] = $e; // split off another future event
473
  }
474
+
475
  if ( my_calendar_date_comp( $beginning,$current ) ) {
476
+ if ( !$same_event && !$same_group ) { $past++; } else { $extra++; }
477
+ } else if ( my_calendar_date_equal( $beginning, $current ) ) {
478
  $present = 1;
479
  if ( $show_today == 'yes' ) { $extra++; }
480
+ } else if ( !my_calendar_date_comp( $end,$current ) ) {
481
+ if ( !$same_event && !$same_group ) { $future++; } //else { $extra++; } // why was this here?
482
  }
483
  $last_events[] = $e->occur_id;
484
+ $last_group[] = $e->occur_group_id;
485
  $last_date = $beginning;
486
  }
487
  if ( $past > $before && $future > $after && $show_today != 'yes' ) {
505
  array_pop($events);
506
  }
507
  }
 
508
  if ( is_array( $events ) ) {
509
  foreach( array_keys($events) as $key ) {
510
  $event =& $events[$key];
511
  //echo $event->event_title . " " . $event->event_group_id."<br />";
512
+ $event_details = mc_create_tags( $event, $context );
513
  if ( get_option( 'mc_event_approve' ) == 'true' ) {
514
  if ( $event->event_approved != 0 ) { $temp_array[] = $event_details; }
515
  } else {
556
  }
557
 
558
  // Widget todays events
559
+ function my_calendar_todays_events($category='default',$template='default',$substitute='',$author='all', $host='all' ) {
560
  $caching = apply_filters( 'mc_cache_enabled', false );
561
  $todays_cache = ($caching)? get_transient('mc_todays_cache') :'';
562
  if ( $caching && is_array($todays_cache) && @$todays_cache[$category] ) { return @$todays_cache[$category]; }
564
  $mcdb = $wpdb;
565
  if ( get_option( 'mc_remote' ) == 'true' && function_exists('mc_remote_db') ) { $mcdb = mc_remote_db(); }
566
  $output = '';
567
+
 
568
  $defaults = get_option('mc_widget_defaults');
569
  $template = ($template == 'default')?$defaults['today']['template']:$template;
570
  if ($template == '' ) { $template = "$default_template"; };
573
  $no_event_text = ($substitute == '')?$defaults['today']['text']:$substitute;
574
 
575
  $from = $to = date( 'Y-m-d', current_time( 'timestamp' ) );
576
+ $events = my_calendar_events($from, $to,$category,'','','upcoming',$author, $host);
577
  $header = "<ul id='todays-events'>";
578
  $footer = "</ul>";
579
+ $groups = $todays_events = array();
 
 
580
  // quick loop through all events today to check for holidays
581
+ if ( is_array( $events ) ) {
 
 
 
 
582
  foreach( array_keys($events) as $key ) {
583
  $event =& $events[$key];
584
+ foreach ( $event as $e ) {
585
+ if ( $e->category_private == 1 && !is_user_logged_in() ) {
 
 
 
 
 
 
 
 
 
 
 
586
  } else {
587
+ if ( !in_array( $e->event_group_id, $groups ) ) {
588
+ $event_details = mc_create_tags($e);
589
+ $ts = $e->ts_occur_begin;
590
+ $date = date_i18n( apply_filters( 'mc_date_format', get_option('mc_date_format'), 'todays_events' ) , current_time( 'timestamp' ) );
591
  if ( get_option( 'mc_event_approve' ) == 'true' ) {
592
+ if ( $e->event_approved != 0 ) {
593
+ $todays_events[$ts][] = "<li>".jd_draw_template($event_details,$template)."</li>";
594
+ }
595
  } else {
596
+ $todays_events[$ts][] = "<li>".jd_draw_template($event_details,$template)."</li>";
597
  }
598
  }
599
  }
 
 
600
  }
601
  }
602
+ $todays_events = apply_filters( 'mc_event_today',$todays_events, $events );
603
+ foreach ( $todays_events as $k => $t ) {
604
+ foreach ( $t as $now ) {
605
+ $output .= $now;
606
+ }
607
+ }
608
  if (count($events) != 0) {
609
  $return = $header.$output.$footer;
610
  } else {
628
 
629
  function widget($args, $instance) {
630
  extract($args);
631
+ $name = $format = 'mini';
632
  if ( !empty($instance) ) {
633
+ $the_title = apply_filters('widget_title',$instance['my_calendar_mini_title'], $instance, $args );
 
634
  $category = ($instance['my_calendar_mini_category']=='')?'all':esc_attr($instance['my_calendar_mini_category']);
 
 
 
635
  $time = ($instance['my_calendar_mini_time']=='')?'month':esc_attr($instance['my_calendar_mini_time']);
636
  $widget_link = ( !isset($instance['mc_link']) || $instance['mc_link']=='')?'':esc_url($instance['mc_link']);
637
+ $above = ( empty($instance['above'] ) )?'none':esc_attr( $instance['above'] );
638
+ $below = ( empty($instance['below'] ) )?'none':esc_attr( $instance['below'] );
639
+ $author = ( $instance['author']=='' )?null:esc_attr( $instance['author'] );
640
+ $host = ( $instance['host']=='')?null:esc_attr( $instance['host'] );
641
  } else {
642
+ $the_title = $category = $time = $widget_link = $above = $below = '';
643
+ }
644
+ $title = empty($the_title) ? __('Calendar','my-calendar') : $the_title;
645
+ $title = ($widget_link!='') ? "<a href='$widget_link'>$title</a>" : $title;
646
+ $title = ( $title!='' ) ? $before_title . $title . $after_title : '';
647
+ $the_events = my_calendar( $name, $format, $category, $time,'','','jd-calendar','','',$author, $host, $above, $below );
648
+ if ( $the_events != '' ) {
649
+ echo $before_widget . $title . $the_events . $after_widget;
 
650
  }
 
 
 
 
 
 
 
 
 
 
651
  }
652
 
653
  function form($instance) {
654
+ $title = esc_attr(empty($instance['my_calendar_mini_title'])?'':$instance['my_calendar_mini_title']);
655
+ $widget_time = esc_attr(empty($instance['my_calendar_mini_time'])?'':$instance['my_calendar_mini_time']);
656
+ $widget_category = esc_attr(empty($instance['my_calendar_mini_category'])?'':$instance['my_calendar_mini_category']);
 
 
 
 
 
657
  $above = ( isset($instance['above']) )?esc_attr($instance['above']):'';
658
  $below = ( isset($instance['below']) )?esc_attr($instance['below']):'';
659
  $widget_link = ( isset($instance['mc_link']) )?esc_url($instance['mc_link']):'';
660
  $host = ( isset($instance['host']) )?$instance['host']:'';
661
  $author = ( isset($instance['author']) )?$instance['author']:'';
662
+ ?>
663
  <p>
664
  <label for="<?php echo $this->get_field_id('my_calendar_mini_title'); ?>"><?php _e('Title','my-calendar'); ?>:</label><br />
665
+ <input class="widefat" type="text" id="<?php echo $this->get_field_id('my_calendar_mini_title'); ?>" name="<?php echo $this->get_field_name('my_calendar_mini_title'); ?>" value="<?php echo $title; ?>"/>
666
  </p>
667
  <p>
668
  <label for="<?php echo $this->get_field_id('mc_link'); ?>"><?php _e('Widget Title Link','my-calendar'); ?>:</label><br />
672
  <label for="<?php echo $this->get_field_id('my_calendar_mini_category'); ?>"><?php _e('Category or categories to display:','my-calendar'); ?></label><br />
673
  <input class="widefat" type="text" id="<?php echo $this->get_field_id('my_calendar_mini_category'); ?>" name="<?php echo $this->get_field_name('my_calendar_mini_category'); ?>" value="<?php echo $widget_category; ?>" /></textarea>
674
  </p>
 
 
 
 
 
 
 
 
675
  <p>
676
  <label for="<?php echo $this->get_field_name('above'); ?>"><?php _e('Navigation above calendar','my-calendar'); ?></label>
677
  <input type="text" class="widefat" name="<?php echo $this->get_field_name('above'); ?>" id="<?php echo $this->get_field_name('above'); ?>" value="<?php echo ( $above == '' )?'nav,jump,print':$above; ?>" />
694
  <?php echo mc_selected_users( $host ); ?>
695
  </select>
696
  </p>
 
697
  <p>
698
  <label for="<?php echo $this->get_field_id('my_calendar_mini_time'); ?>"><?php _e('Mini-Calendar Timespan:','my-calendar'); ?></label> <select id="<?php echo $this->get_field_id('my_calendar_mini_time'); ?>" name="<?php echo $this->get_field_name('my_calendar_mini_time'); ?>">
699
  <option value="month" <?php echo ($widget_time == 'month')?'selected="selected"':''; ?>><?php _e('Month','my-calendar') ?></option>
706
  function update($new_instance,$old_instance) {
707
  $instance = $old_instance;
708
  $instance['my_calendar_mini_title'] = strip_tags($new_instance['my_calendar_mini_title']);
 
 
 
 
 
709
  $instance['my_calendar_mini_time'] = strip_tags($new_instance['my_calendar_mini_time']);
710
  $instance['my_calendar_mini_category'] = strip_tags($new_instance['my_calendar_mini_category']);
711
  $instance['above'] = $new_instance['above'];
my-calendar.php CHANGED
@@ -5,9 +5,11 @@ Plugin URI: http://www.joedolson.com/articles/my-calendar/
5
  Description: Accessible WordPress event calendar plugin. Show events from multiple calendars on pages, in posts, or in widgets.
6
  Author: Joseph C Dolson
7
  Author URI: http://www.joedolson.com
8
- Version: 2.2.13
 
 
9
  */
10
- /* Copyright 2009-2013 Joe Dolson (email : joe@joedolson.com)
11
 
12
  This program is free software; you can redistribute it and/or modify
13
  it under the terms of the GNU General Public License as published by
@@ -28,10 +30,10 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
28
  apply_filters("debug", "MC Started");
29
 
30
  global $mc_version, $wpdb;
31
- $mc_version = '2.2.13';
32
 
33
  // Define the tables used in My Calendar
34
- if ( function_exists('is_multisite') && is_multisite() && get_site_option('mc_multisite_show') == 1 ) {
35
  define('MY_CALENDAR_TABLE', $wpdb->base_prefix . 'my_calendar');
36
  define('MY_CALENDAR_EVENTS_TABLE', $wpdb->base_prefix . 'my_calendar_events');
37
  define('MY_CALENDAR_CATEGORIES_TABLE', $wpdb->base_prefix . 'my_calendar_categories');
@@ -43,7 +45,7 @@ if ( function_exists('is_multisite') && is_multisite() && get_site_option('mc_mu
43
  define('MY_CALENDAR_LOCATIONS_TABLE', $wpdb->prefix . 'my_calendar_locations');
44
  }
45
 
46
- if ( function_exists('is_multisite') && is_multisite() ) {
47
  // Define the tables used in My Calendar
48
  define('MY_CALENDAR_GLOBAL_TABLE', $wpdb->base_prefix . 'my_calendar');
49
  define('MY_CALENDAR_GLOBAL_EVENT_TABLE', $wpdb->base_prefix . 'my_calendar_events');
@@ -51,32 +53,39 @@ if ( function_exists('is_multisite') && is_multisite() ) {
51
  define('MY_CALENDAR_GLOBAL_LOCATIONS_TABLE', $wpdb->base_prefix . 'my_calendar_locations');
52
  }
53
 
54
- include(dirname(__FILE__).'/my-calendar-core.php' );
55
- include(dirname(__FILE__).'/my-calendar-install.php' );
56
- include(dirname(__FILE__).'/my-calendar-settings.php' );
57
- include(dirname(__FILE__).'/my-calendar-categories.php' );
58
- include(dirname(__FILE__).'/my-calendar-locations.php' );
59
- include(dirname(__FILE__).'/my-calendar-help.php' );
60
- include(dirname(__FILE__).'/my-calendar-event-manager.php' );
61
- include(dirname(__FILE__).'/my-calendar-styles.php' );
62
- include(dirname(__FILE__).'/my-calendar-behaviors.php' );
63
- include(dirname(__FILE__).'/my-calendar-widgets.php' );
64
- include(dirname(__FILE__).'/date-utilities.php' );
65
- include(dirname(__FILE__).'/my-calendar-upgrade-db.php' );
66
- include(dirname(__FILE__).'/my-calendar-user.php' );
67
- include(dirname(__FILE__).'/my-calendar-output.php' );
68
- include(dirname(__FILE__).'/my-calendar-templates.php' );
69
- include(dirname(__FILE__).'/my-calendar-rss.php' );
70
- include(dirname(__FILE__).'/my-calendar-ical.php' );
71
- include(dirname(__FILE__).'/my-calendar-events.php' );
72
- include(dirname(__FILE__).'/my-calendar-limits.php' );
73
- include(dirname(__FILE__).'/my-calendar-shortcodes.php' );
74
- include(dirname(__FILE__).'/my-calendar-templating.php' );
75
- include(dirname(__FILE__).'/my-calendar-group-manager.php' );
76
- include(dirname(__FILE__).'/my-calendar-export.php' );
77
-
78
- // Install on activation
79
- register_activation_hook( __FILE__, 'check_my_calendar' );
 
 
 
 
 
 
 
80
 
81
  // Enable internationalisation
82
  load_plugin_textdomain( 'my-calendar',false, dirname( plugin_basename( __FILE__ ) ) . '/lang' );
@@ -95,24 +104,21 @@ add_action( 'widgets_init', create_function('', 'return register_widget("my_cale
95
  add_action( 'widgets_init', create_function('', 'return register_widget("my_calendar_upcoming_widget");') );
96
  add_action( 'widgets_init', create_function('', 'return register_widget("my_calendar_mini_widget");') );
97
  add_action( 'widgets_init', create_function('', 'return register_widget("my_calendar_simple_search");') );
98
- add_action( 'show_user_profile', 'mc_user_profile' );
99
- add_action( 'edit_user_profile', 'mc_user_profile' );
100
- add_action( 'profile_update', 'mc_user_save_profile');
101
  add_action( 'init', 'my_calendar_add_feed' );
102
  add_action( 'admin_menu', 'my_calendar_add_javascript' );
103
  add_action( 'wp_footer','mc_footer_js' );
104
  add_action( 'wp_head','my_calendar_fouc' );
105
- add_action( 'init', 'my_calendar_export_vcal', 200 );
106
  // Add filters
107
  add_filter( 'widget_text', 'do_shortcode', 9 );
108
- add_filter('plugin_action_links', 'jd_calendar_plugin_action', -10, 2);
109
  add_filter( 'wp_title','mc_event_filter',10,3 );
110
 
111
- function mc_event_filter( $title, $sep, $seplocation ) {
112
  if ( isset($_GET['mc_id']) ) {
113
  $id = (int) $_GET['mc_id'];
114
  $event = mc_get_event( $id );
115
- $array = event_as_array( $event );
116
  $left_sep = ( $seplocation != 'right' ? ' ' . $sep . ' ' : '' );
117
  $right_sep = ( $seplocation != 'right' ? '' : ' ' . $sep . ' ' );
118
  $template = ( get_option( 'mc_event_title_template' ) != '' )? stripslashes( get_option( 'mc_event_title_template' ) ):"$left_sep {title} $sep {date} $right_sep ";
@@ -122,10 +128,15 @@ function mc_event_filter( $title, $sep, $seplocation ) {
122
  }
123
  }
124
 
 
 
 
 
 
125
  // produce admin support box
126
- function jd_show_support_box( $show='', $add=false, $remove=false ) {
127
  if ( current_user_can('mc_view_help') ) { ?>
128
- <div class="postbox-container" style="width:20%">
129
  <div class="metabox-holder">
130
  <?php if ( !$remove ) { ?>
131
  <?php if ( !function_exists('mcs_submit_exists') ) { ?>
@@ -133,7 +144,7 @@ function jd_show_support_box( $show='', $add=false, $remove=false ) {
133
  <div class="postbox support">
134
  <h3><strong><?php _e('My Calendar: Submissions','my-calendar'); ?></strong></h3>
135
  <div class="inside resources">
136
- <p class="mcsbuy"><img src="<?php echo plugins_url('my-calendar/images/submissions.png'); ?>" alt="My Calendar: Submissions" class="alignleft" /><?php _e("Buy the <a href='http://www.joedolson.com/articles/my-calendar/submissions/' rel='external'>My Calendar: Submissions add-on</a> &mdash; let your site's visitors help build your calendar.",'my-calendar'); ?></p>
137
  <p class="mc-button"><a href="http://www.joedolson.com/articles/my-calendar/submissions/" rel="external"><?php _e('Learn more!','my-calendar'); ?></a></p>
138
  </div>
139
  </div>
@@ -144,10 +155,10 @@ function jd_show_support_box( $show='', $add=false, $remove=false ) {
144
  <h3><strong><?php _e('Support This Plug-in','my-calendar'); ?></strong></h3>
145
  <div class="inside resources">
146
  <p>
147
- <a href="https://twitter.com/intent/tweet?screen_name=joedolson&text=My%20Calendar%20is%20great%20-%20Thanks!" class="twitter-mention-button" data-size="large" data-related="joedolson">Tweet to @joedolson</a>
148
  <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
149
  </p>
150
- <p class="mcbuy"><img src="<?php echo plugins_url('my-calendar/images/guide.png'); ?>" alt="My Calendar User's Guide" class="alignleft" /><?php _e('Help me help you:','my-calendar'); ?> <a href="http://www.joedolson.com/articles/my-calendar/users-guide/" rel="external"><?php _e("Buy the My Calendar User's Guide",'my-calendar'); ?></a></p>
151
  <p><?php _e('<strong>Or make a donation today!</strong> Every donation counts - donate $5, $20, or $100 and help me keep this plug-in running!','my-calendar'); ?></p>
152
  <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
153
  <p class="mcd">
@@ -155,8 +166,7 @@ function jd_show_support_box( $show='', $add=false, $remove=false ) {
155
  <input type="hidden" name="hosted_button_id" value="UZBQUG2LKKMRW" />
156
  <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" name="submit" alt="<?php _e('Make a Donation','my-calendar'); ?>" />
157
  <img alt="" src="https://www.paypalobjects.com/WEBSCR-640-20110429-1/en_US/i/scr/pixel.gif" width="1" height="1" />
158
- </p>
159
- <p class="mcd"><strong><a href="http://www.joedolson.com/donate.php" rel="external"><?php _e("Make a Donation",'my-calendar'); ?></a></strong></p>
160
  </form>
161
  </div>
162
  </div>
@@ -167,12 +177,14 @@ function jd_show_support_box( $show='', $add=false, $remove=false ) {
167
  <h3><?php _e('Get Help','my-calendar'); ?></h3>
168
  <div class="inside">
169
  <ul>
170
- <li><strong><a href="<?php echo admin_url("admin.php?page=my-calendar-help"); ?>#get-started"><?php _e("Getting Started",'my-calendar'); ?></strong></a></li>
 
171
  <li><a href="<?php echo admin_url("admin.php?page=my-calendar-help"); ?>#get-support"><?php _e("Get Support",'my-calendar'); ?></a></li>
172
- <li><a href="<?php echo admin_url("admin.php?page=my-calendar-help"); ?>"><?php _e("My Calendar Help",'my-calendar'); ?></a></li>
173
- <li><a href="http://profiles.wordpress.org/users/joedolson/"><?php _e('Check out my other plug-ins','my-calendar'); ?></a></li>
174
- <li><a href="http://wordpress.org/support/view/plugin-reviews/my-calendar"><?php _e('Rate this plug-in 5 stars!','my-calendar'); ?></a></li>
175
- <li><a href="http://translate.joedolson.com/projects/my-calendar"><?php _e('Help translate this plug-in!','my-calendar'); ?></a></li> </ul>
 
176
  </div>
177
  </div>
178
  </div>
@@ -205,18 +217,9 @@ function jd_show_support_box( $show='', $add=false, $remove=false ) {
205
  <dt><code>{time}</code></dt>
206
  <dd><?php _e('Start time for the event.','my-calendar'); ?></dd>
207
 
208
- <dt><code>{usertime}</code>/<code>{endusertime}</code></dt>
209
- <dd><?php _e('Event times adjusted to the current user\'s time zone if set.','my-calendar'); ?></dd>
210
-
211
  <dt><code>{date}</code></dt>
212
  <dd><?php _e('Date on which the event begins.','my-calendar'); ?></dd>
213
 
214
- <dt><code>{enddate}</code></dt>
215
- <dd><?php _e('Date on which the event ends.','my-calendar'); ?></dd>
216
-
217
- <dt><code>{endtime}</code></dt>
218
- <dd><?php _e('Time at which the event ends.','my-calendar'); ?></dd>
219
-
220
  <dt><code>{daterange}</code></dt>
221
  <dd><?php _e('Beginning date to end date; excludes end date if same as beginning.','my-calendar'); ?></dd>
222
 
@@ -229,9 +232,6 @@ function jd_show_support_box( $show='', $add=false, $remove=false ) {
229
  <dt><code>{host}</code></dt>
230
  <dd><?php _e('Name of the assigned host for the event.','my-calendar'); ?></dd>
231
 
232
- <dt><code>{host_email}</code></dt>
233
- <dd><?php _e('Email for the person assigned as host.','my-calendar'); ?></dd>
234
-
235
  <dt><code>{shortdesc}</code></dt>
236
  <dd><?php _e('Short event description.','my-calendar'); ?></dd>
237
 
@@ -253,8 +253,8 @@ function jd_show_support_box( $show='', $add=false, $remove=false ) {
253
  <dt><code>{event_status}</code></dt>
254
  <dd><?php _e('Current status of event: either "Published" or "Reserved."','my-calendar'); ?></dd>
255
  </dl>
 
256
  <h4><?php _e('Location Template Tags','my-calendar'); ?></h4>
257
-
258
  <dl>
259
  <dt><code>{location}</code></dt>
260
  <dd><?php _e('Name of the location of the event.','my-calendar'); ?></dd>
@@ -304,6 +304,9 @@ function jd_show_support_box( $show='', $add=false, $remove=false ) {
304
  <dt><code>{cat_id}</code></dt>
305
  <dd><?php _e('ID of the category of the event.','my-calendar'); ?></dd>
306
  </dl>
 
 
 
307
  </div>
308
  </div>
309
  </div>
@@ -318,35 +321,35 @@ function jd_show_support_box( $show='', $add=false, $remove=false ) {
318
  function my_calendar_menu() {
319
  global $wpdb;
320
  $mcdb = $wpdb;
321
- check_my_calendar();
322
  $icon_path = plugins_url('/my-calendar/images');
323
- if ( function_exists('add_object_page') ) {
324
  if ( get_option( 'mc_remote' ) != 'true' ) {
325
  add_object_page(__('My Calendar','my-calendar'), __('My Calendar','my-calendar'), 'mc_add_events', 'my-calendar', 'edit_my_calendar',$icon_path.'/icon.png' );
326
  } else {
327
  add_object_page(__('My Calendar','my-calendar'), __('My Calendar','my-calendar'), 'mc_edit_settings', 'my-calendar', 'edit_my_calendar_config',$icon_path.'/icon.png' );
328
  }
329
  } else {
330
- if ( function_exists('add_menu_page') ) {
331
  if ( get_option( 'mc_remote' ) != 'true' ) {
332
  add_menu_page(__('My Calendar','my-calendar'), __('My Calendar','my-calendar'), 'mc_add_events', 'my-calendar', 'edit_my_calendar',$icon_path.'/icon.png' );
333
  } else {
334
- add_menu_page(__('My Calendar','my-calendar'), __('My Calendar','my-calendar'), 'mc_edit_settings', 'my-calendar', 'edit_my_calendar_config',$icon_path.'/icon.png' );
335
  }
336
  }
337
  }
338
  if ( function_exists('add_submenu_page') ) {
339
  add_action( "admin_head", 'my_calendar_write_js' );
340
  add_action( "admin_head", 'my_calendar_add_styles' );
341
- if ( get_option( 'mc_remote' ) == 'true' && function_exists('mc_remote_db') ) {
342
  } else { // if we're accessing a remote page, remove these pages.
343
  $edit = add_submenu_page('my-calendar', __('Add New Event','my-calendar'), __('Add New Event','my-calendar'), 'mc_add_events', 'my-calendar', 'edit_my_calendar');
344
  add_action( "load-$edit", 'mc_event_editing' );
345
  $manage = add_submenu_page('my-calendar', __('Manage Events','my-calendar'), __('Manage Events','my-calendar'), 'mc_add_events', 'my-calendar-manage', 'manage_my_calendar');
346
  add_action( "load-$manage", 'mc_add_screen_option' );
347
- add_submenu_page('my-calendar', __('Manage Categories','my-calendar'), __('Manage Categories','my-calendar'), 'mc_edit_cats', 'my-calendar-categories', 'my_calendar_manage_categories');
348
- add_submenu_page('my-calendar', __('Manage Locations','my-calendar'), __('Manage Locations','my-calendar'), 'mc_edit_locations', 'my-calendar-locations', 'my_calendar_manage_locations');
349
- add_submenu_page('my-calendar', __('Manage Event Groups','my-calendar'), __('Manage Event Groups','my-calendar'), 'mc_manage_events', 'my-calendar-groups', 'edit_my_calendar_groups');
 
350
  }
351
  add_submenu_page('my-calendar', __('Style Editor','my-calendar'), __('Style Editor','my-calendar'), 'mc_edit_styles', 'my-calendar-styles', 'edit_my_calendar_styles');
352
  add_submenu_page('my-calendar', __('Script Editor','my-calendar'), __('Script Editor','my-calendar'), 'mc_edit_behaviors', 'my-calendar-behaviors', 'edit_my_calendar_behaviors');
@@ -361,13 +364,6 @@ function my_calendar_menu() {
361
  add_submenu_page('my-calendar', __('Event Submissions','my-calendar'), __('Event Submissions','my-calendar'), $permission, 'my-calendar-submissions', 'mcs_settings');
362
  add_submenu_page('my-calendar', __('Payments','my-calendar'), __('Payments','my-calendar'), $permission, 'my-calendar-payments', 'mcs_sales_page');
363
  }
364
- if ( function_exists( 'mcr_registrations' ) ) {
365
- $permission = apply_filters( 'mcr_registration_permissions', 'manage_options' );
366
- add_action( "admin_head", 'mcr_sub_js' );
367
- add_action( "admin_head", 'mcr_reg_styles' );
368
- add_submenu_page('my-calendar', __('Event Registrations','my-calendar'), __('Event Registrations','my-calendar'), $permission, 'my-calendar-registrations', 'mcr_settings');
369
- add_submenu_page('my-calendar', __('Registration Payments','my-calendar'), __('Registration Payments','my-calendar'), $permission, 'mcr-payments', 'mcr_sales_page');
370
- }
371
  }
372
 
373
  function mc_event_editing() {
@@ -388,16 +384,18 @@ function mc_show_event_editing( $status, $args ) {
388
  //$data = "<pre>".print_r( $args, 1 )."THESE:<br />".print_r($input_options, 1 )."</pre>";
389
  $settings_options = get_option('mc_input_options');
390
  if ( !is_array( $input_options ) ) { $input_options = $settings_options; }
391
- $input_labels = array('event_location_dropdown'=>__('Event Location Dropdown Menu','my-calendar'),'event_short'=>__('Event Short Description field','my-calendar'),'event_desc'=>__('Event Description Field','my-calendar'),'event_category'=>__('Event Category field','my-calendar'),'event_image'=>__('Event Image field','my-calendar'),'event_link'=>__('Event Link field','my-calendar'),'event_recurs'=>__('Event Recurrence Options','my-calendar'),'event_open'=>__('Event Registration options','my-calendar'),'event_location'=>__('Event Location fields','my-calendar'),'event_use_editor'=>__('Use HTML Editor in Event Description Field','my-calendar'),'event_specials'=>__('Set Special Scheduling options','my-calendar') );
392
  $output = '';
393
  foreach ($input_options as $key=>$value) {
394
  $checked = ($value == 'on')?"checked='checked'":'';
395
- $allowed = ( $settings_options[$key] == 'on' )?true:false;
396
- if ( !( current_user_can('manage_options') && get_option( 'mc_input_options_administrators' ) == 'true' ) && !$allowed ) {
397
  // don't display options if this user can't use them.
398
  $output .= "<input type='hidden' name='mc_show_on_page[$key]' value='off' />";
399
  } else {
400
- $output .= "<label for=\"mci_$key\"><input type=\"checkbox\" id=\"mci_$key\" name=\"mc_show_on_page[$key]\" value='on' $checked /> $input_labels[$key]</label>";
 
 
401
  }
402
  }
403
  $button = get_submit_button( __( 'Apply' ), 'button', 'screen-options-apply', false );
@@ -449,26 +447,16 @@ function mc_set_screen_option($status, $option, $value) {
449
  return $value;
450
  }
451
 
452
- // return a result for admin_url in 2.9.2
453
- if ( !function_exists( 'admin_url' ) ) {
454
- function admin_url() {
455
- return site_url().'/wp-admin/';
456
- }
457
- }
458
- if ( !function_exists( 'home_url' ) ) {
459
- function home_url() {
460
- return get_option('home');
461
- }
462
- }
463
-
464
  // add shortcode interpreters
465
  add_shortcode('my_calendar','my_calendar_insert');
466
  add_shortcode('my_calendar_upcoming','my_calendar_insert_upcoming');
467
  add_shortcode('my_calendar_today','my_calendar_insert_today');
468
  add_shortcode('my_calendar_locations','my_calendar_locations');
469
  add_shortcode('my_calendar_categories','my_calendar_categories');
 
 
470
  add_shortcode('my_calendar_show_locations','my_calendar_show_locations_list');
471
  add_shortcode('my_calendar_event','my_calendar_show_event');
472
  add_shortcode('my_calendar_search','my_calendar_search');
473
 
474
- apply_filters("debug", "MC Loaded");
5
  Description: Accessible WordPress event calendar plugin. Show events from multiple calendars on pages, in posts, or in widgets.
6
  Author: Joseph C Dolson
7
  Author URI: http://www.joedolson.com
8
+ Text Domain: my-calendar
9
+ Domain Path: lang
10
+ Version: 2.3.0
11
  */
12
+ /* Copyright 2009-2014 Joe Dolson (email : joe@joedolson.com)
13
 
14
  This program is free software; you can redistribute it and/or modify
15
  it under the terms of the GNU General Public License as published by
30
  apply_filters("debug", "MC Started");
31
 
32
  global $mc_version, $wpdb;
33
+ $mc_version = '2.3.0';
34
 
35
  // Define the tables used in My Calendar
36
+ if ( is_multisite() && get_site_option('mc_multisite_show') == 1 ) {
37
  define('MY_CALENDAR_TABLE', $wpdb->base_prefix . 'my_calendar');
38
  define('MY_CALENDAR_EVENTS_TABLE', $wpdb->base_prefix . 'my_calendar_events');
39
  define('MY_CALENDAR_CATEGORIES_TABLE', $wpdb->base_prefix . 'my_calendar_categories');
45
  define('MY_CALENDAR_LOCATIONS_TABLE', $wpdb->prefix . 'my_calendar_locations');
46
  }
47
 
48
+ if ( is_multisite() ) {
49
  // Define the tables used in My Calendar
50
  define('MY_CALENDAR_GLOBAL_TABLE', $wpdb->base_prefix . 'my_calendar');
51
  define('MY_CALENDAR_GLOBAL_EVENT_TABLE', $wpdb->base_prefix . 'my_calendar_events');
53
  define('MY_CALENDAR_GLOBAL_LOCATIONS_TABLE', $wpdb->base_prefix . 'my_calendar_locations');
54
  }
55
 
56
+ register_activation_hook( __FILE__, 'mc_plugin_activated' );
57
+ register_deactivation_hook( __FILE__, 'mc_plugin_deactivated' );
58
+ function mc_plugin_activated() {
59
+ flush_rewrite_rules();
60
+ mc_upgrade_db();
61
+ check_my_calendar();
62
+ }
63
+ function mc_plugin_deactivated() {
64
+ flush_rewrite_rules();
65
+ }
66
+ include( dirname(__FILE__).'/includes/date-utilities.php' );
67
+ include( dirname(__FILE__).'/my-calendar-core.php' );
68
+ include( dirname(__FILE__).'/my-calendar-install.php' );
69
+ include( dirname(__FILE__).'/my-calendar-settings.php' );
70
+ include( dirname(__FILE__).'/my-calendar-categories.php' );
71
+ include( dirname(__FILE__).'/my-calendar-locations.php' );
72
+ include( dirname(__FILE__).'/my-calendar-help.php' );
73
+ include( dirname(__FILE__).'/my-calendar-event-manager.php' );
74
+ include( dirname(__FILE__).'/my-calendar-styles.php' );
75
+ include( dirname(__FILE__).'/my-calendar-behaviors.php' );
76
+ include( dirname(__FILE__).'/my-calendar-events.php' );
77
+ include( dirname(__FILE__).'/my-calendar-widgets.php' );
78
+ include( dirname(__FILE__).'/my-calendar-upgrade-db.php' );
79
+ include( dirname(__FILE__).'/my-calendar-output.php' );
80
+ include( dirname(__FILE__).'/my-calendar-templates.php' );
81
+ include( dirname(__FILE__).'/my-calendar-ical.php' );
82
+ include( dirname(__FILE__).'/my-calendar-limits.php' );
83
+ include( dirname(__FILE__).'/my-calendar-shortcodes.php' );
84
+ include( dirname(__FILE__).'/my-calendar-templating.php' );
85
+ include( dirname(__FILE__).'/my-calendar-group-manager.php' );
86
+ include( dirname(__FILE__).'/my-calendar-export.php' );
87
+ include( dirname(__FILE__).'/my-calendar-api.php' );
88
+ include( dirname(__FILE__).'/my-calendar-generator.php' );
89
 
90
  // Enable internationalisation
91
  load_plugin_textdomain( 'my-calendar',false, dirname( plugin_basename( __FILE__ ) ) . '/lang' );
104
  add_action( 'widgets_init', create_function('', 'return register_widget("my_calendar_upcoming_widget");') );
105
  add_action( 'widgets_init', create_function('', 'return register_widget("my_calendar_mini_widget");') );
106
  add_action( 'widgets_init', create_function('', 'return register_widget("my_calendar_simple_search");') );
 
 
 
107
  add_action( 'init', 'my_calendar_add_feed' );
108
  add_action( 'admin_menu', 'my_calendar_add_javascript' );
109
  add_action( 'wp_footer','mc_footer_js' );
110
  add_action( 'wp_head','my_calendar_fouc' );
111
+ add_action( 'init', 'mc_export_vcal', 200 );
112
  // Add filters
113
  add_filter( 'widget_text', 'do_shortcode', 9 );
114
+ add_filter( 'plugin_action_links', 'mc_plugin_action', -10, 2 );
115
  add_filter( 'wp_title','mc_event_filter',10,3 );
116
 
117
+ function mc_event_filter( $title, $sep=' | ', $seplocation='right' ) {
118
  if ( isset($_GET['mc_id']) ) {
119
  $id = (int) $_GET['mc_id'];
120
  $event = mc_get_event( $id );
121
+ $array = mc_create_tags( $event );
122
  $left_sep = ( $seplocation != 'right' ? ' ' . $sep . ' ' : '' );
123
  $right_sep = ( $seplocation != 'right' ? '' : ' ' . $sep . ' ' );
124
  $template = ( get_option( 'mc_event_title_template' ) != '' )? stripslashes( get_option( 'mc_event_title_template' ) ):"$left_sep {title} $sep {date} $right_sep ";
128
  }
129
  }
130
 
131
+ // back compat
132
+ function jd_show_support_box() {
133
+ mc_show_sidebar();
134
+ }
135
+
136
  // produce admin support box
137
+ function mc_show_sidebar( $show='', $add=false, $remove=false ) {
138
  if ( current_user_can('mc_view_help') ) { ?>
139
+ <div class="postbox-container jcd-narrow">
140
  <div class="metabox-holder">
141
  <?php if ( !$remove ) { ?>
142
  <?php if ( !function_exists('mcs_submit_exists') ) { ?>
144
  <div class="postbox support">
145
  <h3><strong><?php _e('My Calendar: Submissions','my-calendar'); ?></strong></h3>
146
  <div class="inside resources">
147
+ <p class="mcsbuy"><?php _e("Buy the <a href='http://www.joedolson.com/articles/my-calendar/submissions/' rel='external'>My Calendar Submissions add-on</a> &mdash; let your audience build your calendar.",'my-calendar'); ?></p>
148
  <p class="mc-button"><a href="http://www.joedolson.com/articles/my-calendar/submissions/" rel="external"><?php _e('Learn more!','my-calendar'); ?></a></p>
149
  </div>
150
  </div>
155
  <h3><strong><?php _e('Support This Plug-in','my-calendar'); ?></strong></h3>
156
  <div class="inside resources">
157
  <p>
158
+ <a href="https://twitter.com/intent/follow?screen_name=joedolson" class="twitter-follow-button" data-size="small" data-related="joedolson">Follow @joedolson</a>
159
  <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
160
  </p>
161
+ <p class="mcbuy"><?php _e('Help me help you:','my-calendar'); ?> <a href="http://www.joedolson.com/articles/my-calendar/users-guide/" rel="external"><?php _e("Buy the My Calendar User's Guide",'my-calendar'); ?></a></p>
162
  <p><?php _e('<strong>Or make a donation today!</strong> Every donation counts - donate $5, $20, or $100 and help me keep this plug-in running!','my-calendar'); ?></p>
163
  <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
164
  <p class="mcd">
166
  <input type="hidden" name="hosted_button_id" value="UZBQUG2LKKMRW" />
167
  <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" name="submit" alt="<?php _e('Make a Donation','my-calendar'); ?>" />
168
  <img alt="" src="https://www.paypalobjects.com/WEBSCR-640-20110429-1/en_US/i/scr/pixel.gif" width="1" height="1" />
169
+ </p>
 
170
  </form>
171
  </div>
172
  </div>
177
  <h3><?php _e('Get Help','my-calendar'); ?></h3>
178
  <div class="inside">
179
  <ul>
180
+ <li><strong><a href="<?php echo admin_url("admin.php?page=my-calendar-help"); ?>#get-started"><?php _e("Getting Started",'my-calendar'); ?></strong></a></li>
181
+ <li><strong><a href="<?php echo admin_url("admin.php?page=my-calendar-help"); ?>#mc-generator"><?php _e("Shortcode Generator",'my-calendar'); ?></strong></a></li>
182
  <li><a href="<?php echo admin_url("admin.php?page=my-calendar-help"); ?>#get-support"><?php _e("Get Support",'my-calendar'); ?></a></li>
183
+ <li><div class="dashicons dashicons-editor-help"></div> <a href="<?php echo admin_url("admin.php?page=my-calendar-help"); ?>"><?php _e("My Calendar Help",'my-calendar'); ?></a></li>
184
+ <li><div class="dashicons dashicons-yes"></div> <a href="http://profiles.wordpress.org/users/joedolson/"><?php _e('Check out my other plug-ins','my-calendar'); ?></a></li>
185
+ <li><div class="dashicons dashicons-star-filled"></div> <a href="http://wordpress.org/support/view/plugin-reviews/my-calendar"><?php _e('Rate this plug-in 5 stars!','my-calendar'); ?></a></li>
186
+ <li><div class="dashicons dashicons-translation"></div> <a href="http://translate.joedolson.com/projects/my-calendar"><?php _e('Help translate this plug-in!','my-calendar'); ?></a></li>
187
+ </ul>
188
  </div>
189
  </div>
190
  </div>
217
  <dt><code>{time}</code></dt>
218
  <dd><?php _e('Start time for the event.','my-calendar'); ?></dd>
219
 
 
 
 
220
  <dt><code>{date}</code></dt>
221
  <dd><?php _e('Date on which the event begins.','my-calendar'); ?></dd>
222
 
 
 
 
 
 
 
223
  <dt><code>{daterange}</code></dt>
224
  <dd><?php _e('Beginning date to end date; excludes end date if same as beginning.','my-calendar'); ?></dd>
225
 
232
  <dt><code>{host}</code></dt>
233
  <dd><?php _e('Name of the assigned host for the event.','my-calendar'); ?></dd>
234
 
 
 
 
235
  <dt><code>{shortdesc}</code></dt>
236
  <dd><?php _e('Short event description.','my-calendar'); ?></dd>
237
 
253
  <dt><code>{event_status}</code></dt>
254
  <dd><?php _e('Current status of event: either "Published" or "Reserved."','my-calendar'); ?></dd>
255
  </dl>
256
+
257
  <h4><?php _e('Location Template Tags','my-calendar'); ?></h4>
 
258
  <dl>
259
  <dt><code>{location}</code></dt>
260
  <dd><?php _e('Name of the location of the event.','my-calendar'); ?></dd>
304
  <dt><code>{cat_id}</code></dt>
305
  <dd><?php _e('ID of the category of the event.','my-calendar'); ?></dd>
306
  </dl>
307
+ <p>
308
+ <a href="<?php echo admin_url( 'admin.php?page=my-calendar-help#templates' ); ?>"><?php _e('All Template Tags &raquo;','my-calendar'); ?></a>
309
+ </p>
310
  </div>
311
  </div>
312
  </div>
321
  function my_calendar_menu() {
322
  global $wpdb;
323
  $mcdb = $wpdb;
 
324
  $icon_path = plugins_url('/my-calendar/images');
325
+ if ( function_exists( 'add_object_page' ) ) {
326
  if ( get_option( 'mc_remote' ) != 'true' ) {
327
  add_object_page(__('My Calendar','my-calendar'), __('My Calendar','my-calendar'), 'mc_add_events', 'my-calendar', 'edit_my_calendar',$icon_path.'/icon.png' );
328
  } else {
329
  add_object_page(__('My Calendar','my-calendar'), __('My Calendar','my-calendar'), 'mc_edit_settings', 'my-calendar', 'edit_my_calendar_config',$icon_path.'/icon.png' );
330
  }
331
  } else {
332
+ if ( function_exists( 'add_menu_page' ) ) {
333
  if ( get_option( 'mc_remote' ) != 'true' ) {
334
  add_menu_page(__('My Calendar','my-calendar'), __('My Calendar','my-calendar'), 'mc_add_events', 'my-calendar', 'edit_my_calendar',$icon_path.'/icon.png' );
335
  } else {
336
+ add_menu_page(__('My Calendar','my-calendar'), __('My Calendar','my-calendar'), 'mc_edit_settings', 'my-calendar', 'edit_my_calendar_config',$icon_path.'/icon.png' );
337
  }
338
  }
339
  }
340
  if ( function_exists('add_submenu_page') ) {
341
  add_action( "admin_head", 'my_calendar_write_js' );
342
  add_action( "admin_head", 'my_calendar_add_styles' );
343
+ if ( get_option( 'mc_remote' ) == 'true' ) {
344
  } else { // if we're accessing a remote page, remove these pages.
345
  $edit = add_submenu_page('my-calendar', __('Add New Event','my-calendar'), __('Add New Event','my-calendar'), 'mc_add_events', 'my-calendar', 'edit_my_calendar');
346
  add_action( "load-$edit", 'mc_event_editing' );
347
  $manage = add_submenu_page('my-calendar', __('Manage Events','my-calendar'), __('Manage Events','my-calendar'), 'mc_add_events', 'my-calendar-manage', 'manage_my_calendar');
348
  add_action( "load-$manage", 'mc_add_screen_option' );
349
+ add_submenu_page('my-calendar', __('Event Categories','my-calendar'), __('Manage Categories','my-calendar'), 'mc_edit_cats', 'my-calendar-categories', 'my_calendar_manage_categories');
350
+ add_submenu_page('my-calendar', __('Event Locations','my-calendar'), __('Manage Locations','my-calendar'), 'mc_edit_locations', 'my-calendar-locations', 'my_calendar_manage_locations');
351
+ $groups = add_submenu_page('my-calendar', __('Event Groups','my-calendar'), __('Manage Event Groups','my-calendar'), 'mc_manage_events', 'my-calendar-groups', 'edit_my_calendar_groups');
352
+ add_action( "load-$groups", 'mc_add_screen_option' );
353
  }
354
  add_submenu_page('my-calendar', __('Style Editor','my-calendar'), __('Style Editor','my-calendar'), 'mc_edit_styles', 'my-calendar-styles', 'edit_my_calendar_styles');
355
  add_submenu_page('my-calendar', __('Script Editor','my-calendar'), __('Script Editor','my-calendar'), 'mc_edit_behaviors', 'my-calendar-behaviors', 'edit_my_calendar_behaviors');
364
  add_submenu_page('my-calendar', __('Event Submissions','my-calendar'), __('Event Submissions','my-calendar'), $permission, 'my-calendar-submissions', 'mcs_settings');
365
  add_submenu_page('my-calendar', __('Payments','my-calendar'), __('Payments','my-calendar'), $permission, 'my-calendar-payments', 'mcs_sales_page');
366
  }
 
 
 
 
 
 
 
367
  }
368
 
369
  function mc_event_editing() {
384
  //$data = "<pre>".print_r( $args, 1 )."THESE:<br />".print_r($input_options, 1 )."</pre>";
385
  $settings_options = get_option('mc_input_options');
386
  if ( !is_array( $input_options ) ) { $input_options = $settings_options; }
387
+ $input_labels = array('event_location_dropdown'=>__('Event Location Dropdown Menu','my-calendar'),'event_short'=>__('Event Short Description field','my-calendar'),'event_desc'=>__('Event Description Field','my-calendar'),'event_category'=>__('Event Category field','my-calendar'),'event_image'=>__('Event Image field','my-calendar'),'event_link'=>__('Event Link field','my-calendar'),'event_recurs'=>__('Event Recurrence Options','my-calendar'),'event_open'=>__('Event Registration options','my-calendar'),'event_location'=>__('Event Location fields','my-calendar'),'event_specials'=>__('Set Special Scheduling options','my-calendar'), 'event_access'=>__('Event Accessibility') );
388
  $output = '';
389
  foreach ($input_options as $key=>$value) {
390
  $checked = ($value == 'on')?"checked='checked'":'';
391
+ $allowed = ( isset( $settings_options[$key] ) && $settings_options[$key] == 'on' ) ? true:false;
392
+ if ( !( current_user_can( 'manage_options' ) && get_option( 'mc_input_options_administrators' ) == 'true' ) && !$allowed ) {
393
  // don't display options if this user can't use them.
394
  $output .= "<input type='hidden' name='mc_show_on_page[$key]' value='off' />";
395
  } else {
396
+ if ( isset( $input_labels[$key] ) ) { // don't show if label doesn't exist. That means I removed the option.
397
+ $output .= "<label for=\"mci_$key\"><input type=\"checkbox\" id=\"mci_$key\" name=\"mc_show_on_page[$key]\" value='on' $checked /> $input_labels[$key]</label>";
398
+ }
399
  }
400
  }
401
  $button = get_submit_button( __( 'Apply' ), 'button', 'screen-options-apply', false );
447
  return $value;
448
  }
449
 
 
 
 
 
 
 
 
 
 
 
 
 
450
  // add shortcode interpreters
451
  add_shortcode('my_calendar','my_calendar_insert');
452
  add_shortcode('my_calendar_upcoming','my_calendar_insert_upcoming');
453
  add_shortcode('my_calendar_today','my_calendar_insert_today');
454
  add_shortcode('my_calendar_locations','my_calendar_locations');
455
  add_shortcode('my_calendar_categories','my_calendar_categories');
456
+ add_shortcode('my_calendar_access','my_calendar_access');
457
+ add_shortcode('mc_filters','my_calendar_filters');
458
  add_shortcode('my_calendar_show_locations','my_calendar_show_locations_list');
459
  add_shortcode('my_calendar_event','my_calendar_show_event');
460
  add_shortcode('my_calendar_search','my_calendar_search');
461
 
462
+ apply_filters("debug", "MC Loaded");
readme.txt CHANGED
@@ -2,10 +2,10 @@
2
  Contributors: joedolson
3
  Donate link: http://www.joedolson.com/donate.php
4
  Tags: calendar, dates, times, events, scheduling, event manager, event calendar
5
- Requires at least: 3.3.0
6
- Tested up to: 3.7.0
7
  License: GPLv2 or later
8
- Stable tag: 2.2.12
9
 
10
  Accessible WordPress event calendar plugin. Show events from multiple calendars on pages, in posts, or in widgets.
11
 
@@ -20,38 +20,27 @@ Easy to use for anybody, My Calendar provides enormous potential for developers
20
 
21
  = Basic Features: =
22
 
23
- * Standard calendar grid or list views of events
24
  * Show events in monthly, weekly, or daily view.
25
  * Mini-calendar view for compact displays (as widget or as shortcode)
26
  * Widget to show today's events
27
  * Widget to show upcoming or past events
28
- * Widget to search events
29
  * Custom templates for event output
30
- * Limit by category/categories
31
- * Limit by location
32
- * Limit by author
33
  * Disable default CSS and default JavaScript or display only on specific Pages/Posts
34
  * Editable CSS styles and JavaScript behaviors
35
  * Schedule a wide variety of recurring events.
36
- * Individual occurrences of recurring events can be edited individually
37
- * Access to most aspects of My Calendar can be restricted by role. (Adding events, editing events, editing styles, changing settings, etc.)
38
- * Choose which of the following fields you want to enter and display for each event:
39
- * title,
40
- * description,
41
- * event image,
42
- * alternate description,
43
- * event host,
44
- * event category,
45
- * URL,
46
- * registration status (open, closed or irrelevant),
47
- * event location
48
  * Email notification to administrator when events are scheduled or reserved
49
  * Post to Twitter when events are created. (with [WP to Twitter](http://wordpress.org/extend/plugins/wp-to-twitter/))
50
  * Location Manager for frequently used venues
51
  * Fetch events from a remote MySQL database. (Sharing events in a network of sites.)
52
  * Import from [Kieran O'Shea's Calendar plugin](http://wordpress.org/extend/plugins/calendar/)
53
  * Integrated Help page to guide in use of shortcodes and template tags
54
- * New: [Developer Documentation](http://www.joedolson.com/articles/doc-category/my-calendar-3/)
 
55
 
56
  = Translations =
57
 
@@ -72,13 +61,15 @@ Translating my plug-ins is always appreciated. Visit <a href="http://translate.j
72
 
73
  3. Configure My Calendar using the following pages in the admin panel:
74
 
75
- My Calendar -> Add/Edit Events
76
  My Calendar -> Manage Categories
77
  My Calendar -> Manage Locations
78
- My Calendar -> Settings
79
- My Calendar -> Style Editor
80
- My Calendar -> Behavior Editor
81
  My Calendar -> Template Editor
 
 
82
 
83
  4. Edit or create a page on your blog which includes the shortcode [my_calendar] and visit
84
  the page you have edited or created. You should see your calendar. Visit My Calendar -> Help for assistance
@@ -86,6 +77,67 @@ Translating my plug-ins is always appreciated. Visit <a href="http://translate.j
86
 
87
  == Changelog ==
88
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  = 2.2.13 =
90
 
91
  * Bug fix: Threw error if network-activated (wp_is_mobile() not defined yet)
@@ -1119,7 +1171,7 @@ Because the majority of users end up on my web site asking for help anyway -- an
1119
 
1120
  = This plug-in is really complicated. Why can't you personally help me figure out how to use it? =
1121
 
1122
- I can! Just not in person. I've written a User's Guide for My Calendar, which you can [purchase at my web site](https://www.joedolson.com/articles/my-calendar/users-guide/) for $23. ($19 if you're not interested in getting updates.) This helps defray the thousand plus hours I've spent in developing the plug-in and providing support. Please, consider buying the User's Guide or [making a donation](https://www.joedolson.com/donate.php) before asking for support!
1123
 
1124
  = How can my site visitors or members submit events? =
1125
 
@@ -1140,5 +1192,6 @@ I've written a paid plug-in that adds this feature to My Calendar, called My Cal
1140
 
1141
  == Upgrade Notice ==
1142
 
1143
- = 2.2.12 =
1144
- Believe me, it's frustrating to me, too. Bug fix to jQuery time output.
 
2
  Contributors: joedolson
3
  Donate link: http://www.joedolson.com/donate.php
4
  Tags: calendar, dates, times, events, scheduling, event manager, event calendar
5
+ Requires at least: 3.4.2
6
+ Tested up to: 3.8.2
7
  License: GPLv2 or later
8
+ Stable tag: 2.3.0
9
 
10
  Accessible WordPress event calendar plugin. Show events from multiple calendars on pages, in posts, or in widgets.
11
 
20
 
21
  = Basic Features: =
22
 
23
+ * Standard calendar grid and list views of events
24
  * Show events in monthly, weekly, or daily view.
25
  * Mini-calendar view for compact displays (as widget or as shortcode)
26
  * Widget to show today's events
27
  * Widget to show upcoming or past events
28
+ * Event Search widget
29
  * Custom templates for event output
30
+ * Limit views by categories, location, author, or host
 
 
31
  * Disable default CSS and default JavaScript or display only on specific Pages/Posts
32
  * Editable CSS styles and JavaScript behaviors
33
  * Schedule a wide variety of recurring events.
34
+ * Edit individual occurrences of recurring events
35
+ * Rich permissions handling to restrict access to parts of My Calendar
 
 
 
 
 
 
 
 
 
 
36
  * Email notification to administrator when events are scheduled or reserved
37
  * Post to Twitter when events are created. (with [WP to Twitter](http://wordpress.org/extend/plugins/wp-to-twitter/))
38
  * Location Manager for frequently used venues
39
  * Fetch events from a remote MySQL database. (Sharing events in a network of sites.)
40
  * Import from [Kieran O'Shea's Calendar plugin](http://wordpress.org/extend/plugins/calendar/)
41
  * Integrated Help page to guide in use of shortcodes and template tags
42
+ * Shortcode Generator to help create customized views of My Calendar
43
+ * [Developer Documentation](http://www.joedolson.com/articles/doc-category/my-calendar-3/)
44
 
45
  = Translations =
46
 
61
 
62
  3. Configure My Calendar using the following pages in the admin panel:
63
 
64
+ My Calendar -> Add/Manage Events
65
  My Calendar -> Manage Categories
66
  My Calendar -> Manage Locations
67
+ My Calendar -> Manage Event Groups
68
+ My Calendar -> Style Editor
69
+ My Calendar -> Script Editor
70
  My Calendar -> Template Editor
71
+ My Calendar -> Settings
72
+ My Calendar -> Help
73
 
74
  4. Edit or create a page on your blog which includes the shortcode [my_calendar] and visit
75
  the page you have edited or created. You should see your calendar. Visit My Calendar -> Help for assistance
77
 
78
  == Changelog ==
79
 
80
+ = 2.3.0 =
81
+
82
+ This is a major revision.
83
+
84
+ * Bug fix: Manage events screen showed no data for users without manage_events permissions.
85
+ * Bug fix: if single event set, could not filter to time period views.
86
+ * Bug fix: 'single' template ID not passed into template filter.
87
+ * Bug fix: events in private categories appeared in time-based upcoming events lists.
88
+ * Bug fix: RSS feed encoding.
89
+ * Bug fix: Turn-of-year issues with week view.
90
+ * Bug fix: Added new locations multiple times if added with multiple occurrences of an event.
91
+ * Bug fix: In some browsers, time selector added invalid data.
92
+ * Bug fix: List of search results not wrapped in a list element.
93
+ * Bug fix: Trim spaces on above/below navigation strings.
94
+ * Bug fix: If an event ends at midnight, automatically end tomorrow unless set for a later date.
95
+ * Bug fix: Don't show events on both days if they end at midnight.
96
+ * Bug fix: Don't attempt to enqueue jquery.charcount.js if WP to Twitter not installed.
97
+ * Bug fix: Dates didn't strip links in list view when JS disabled for that view.
98
+
99
+ * New template tag: {runtime} to show human language version of length of event.
100
+ * New template tag: {excerpt} to create autoexcerpt from description field, using shortdesc if it exists.
101
+
102
+ * New feature: Accessibility features for locations.
103
+ * New feature: Specify accessibility services for events.
104
+ * New feature: ticketing link field
105
+ * New feature: event registration information fields
106
+ * New feature: my_calendar_event shortcode can query templates by keyword (list,mini,single,grid).
107
+ * New feature: filter events by available accessibility services
108
+ * New feature: Combined filter shortcode to group all filters into a single form. [mc_filters show='locations,categories,access']
109
+ * New feature: new API for adding custom fields to events.
110
+ * New feature: data API to fetch event data in JSON, CSV, or RSS formats.
111
+ * New feature: Archive events to hide from admin events list.
112
+ * New feature: Control input options for multiple types of location input data.
113
+ * New feature: Shortcode generator for primary, upcoming, and today's events shortcodes.
114
+ * New feature: admin-side event search
115
+ * New feature: category key now acts as quick links to filter by category
116
+ * New feature: Option to add title to Event Search widget.
117
+
118
+ * New filter: mc_date_format for customizing date formats.
119
+ * New filter: customize search results page: mc_search_page
120
+ * New filter: mc_use_permalinks to enable use of custom post type permalinks for single event pages.
121
+ * New filter: mc_post_template to customize template used in single event shortcode automatically inserted into custom post type pages.
122
+
123
+ * New design: new stylesheet available: twentyfourteen.css
124
+
125
+ * Updated: added more fields to search on events.
126
+ * Updated: updated image uploader to use add media panel and store attachment ID
127
+ * Updated: <title> template supports all template tags (but strips HTML.).
128
+ * Updated: Various aspects of UI
129
+ * Updated: Date/time selectors. See http://amsul.ca/pickadate.js/, MIT license.
130
+
131
+ * Reorganized default output template code.
132
+ * Import all used locations into location manager.
133
+ * Removed User settings fields.
134
+ * Moved Holiday category assignment to Category Manager.
135
+ * Improved get current URL function.
136
+ * iCal output in multiple-month view outputs all displayed months.
137
+ * {map} template tag to display a Google Map using the Google Maps API. (Not available in pop-up displays.)
138
+ * Scheduled removal of showkey, shownav, toggle, and showjump shortcode attributes.
139
+ * Removed upgrade support for 1.6.x & 1.7.x series of My Calendar.
140
+
141
  = 2.2.13 =
142
 
143
  * Bug fix: Threw error if network-activated (wp_is_mobile() not defined yet)
1171
 
1172
  = This plug-in is really complicated. Why can't you personally help me figure out how to use it? =
1173
 
1174
+ I can! Just not in person. I've written a User's Guide for My Calendar, which you can [purchase at my web site](https://www.joedolson.com/articles/my-calendar/users-guide/) for $25. This helps defray the thousand plus hours I've spent in developing the plug-in and providing support. Please, consider buying the User's Guide or [making a donation](https://www.joedolson.com/donate.php) before asking for support!
1175
 
1176
  = How can my site visitors or members submit events? =
1177
 
1192
 
1193
  == Upgrade Notice ==
1194
 
1195
+ = 2.3.0 =
1196
+
1197
+ This is a MAJOR update. Be sure to backup!
styles/dark.css CHANGED
@@ -33,7 +33,7 @@ border: 1px solid #222;
33
  #upcoming-events .today {color: #eee; }
34
  #upcoming-events .future-event {color: #bbb;}
35
  .mc-main caption {margin: 2px 0;font-weight:700;padding:2px;}
36
- .mc-main table {width:100%;line-height:1.2;border-collapse:collapse;}
37
  .mc-main td {
38
  vertical-align:top;
39
  text-align:left;
@@ -173,4 +173,4 @@ border: 1px solid #333;
173
  padding: 10px;
174
  float: right;
175
  }
176
- .screenreader { position: absolute; left: -999em; }
33
  #upcoming-events .today {color: #eee; }
34
  #upcoming-events .future-event {color: #bbb;}
35
  .mc-main caption {margin: 2px 0;font-weight:700;padding:2px;}
36
+ .mc-main table,.mc-main.calendar {width:100%;line-height:1.2;border-collapse:collapse;}
37
  .mc-main td {
38
  vertical-align:top;
39
  text-align:left;
173
  padding: 10px;
174
  float: right;
175
  }
176
+ .screen-reader-text { position: absolute; left: -999em; }
styles/inherit.css CHANGED
@@ -29,8 +29,8 @@ padding: 0;
29
  .mc-main .my-calendar-date-switcher .button {
30
  font-size: .9em;
31
  }
32
- .mc-main table {
33
- width:100%;
34
  line-height:1.2;
35
  border-collapse:collapse;
36
  }
@@ -243,4 +243,4 @@ font-size: .9em;
243
  padding: 10px;
244
  float: right;
245
  }
246
- .screenreader { position: absolute; left: -999em; }
29
  .mc-main .my-calendar-date-switcher .button {
30
  font-size: .9em;
31
  }
32
+ .mc-main table,.mc-main.calendar {
33
+ width:100%!important;
34
  line-height:1.2;
35
  border-collapse:collapse;
36
  }
243
  padding: 10px;
244
  float: right;
245
  }
246
+ .screen-reader-text { position: absolute; left: -999em; }
styles/light.css CHANGED
@@ -51,8 +51,8 @@ margin: 2px 0;
51
  font-weight:700;
52
  padding:2px;
53
  }
54
- .mc-main table {
55
- width:100%;
56
  line-height:1.2;
57
  border-collapse:collapse;
58
  }
@@ -268,4 +268,4 @@ background: #f6f6f6;
268
  padding: 10px;
269
  float: right;
270
  }
271
- .screenreader { position: absolute; left: -999em; }
51
  font-weight:700;
52
  padding:2px;
53
  }
54
+ .mc-main table,.mc-main.calendar {
55
+ width:100%!important;
56
  line-height:1.2;
57
  border-collapse:collapse;
58
  }
268
  padding: 10px;
269
  float: right;
270
  }
271
+ .screen-reader-text { position: absolute; left: -999em; }
styles/my-calendar.css CHANGED
@@ -56,8 +56,8 @@ margin: 2px 0;
56
  font-weight:700;
57
  padding:2px;
58
  }
59
- .mc-main table {
60
- width:100%;
61
  line-height:1.2;
62
  border-collapse:collapse;
63
  }
@@ -81,8 +81,8 @@ border-radius: 2px;
81
  font-size:10px!important;
82
  font-family: Arial, Verdana, sans-serif;
83
  font-weight:700;
84
- margin:3px 0;
85
- padding:0;
86
  width: 100%;
87
  border-radius: 3px;
88
  clear: none;
@@ -272,4 +272,4 @@ float: right;
272
  clear: right;
273
  width: 120px;
274
  }
275
- .screenreader { position: absolute; left: -999em; }
56
  font-weight:700;
57
  padding:2px;
58
  }
59
+ .mc-main table,.mc-main.calendar {
60
+ width:100%!important;
61
  line-height:1.2;
62
  border-collapse:collapse;
63
  }
81
  font-size:10px!important;
82
  font-family: Arial, Verdana, sans-serif;
83
  font-weight:700;
84
+ margin:2px 0!important;
85
+ padding:1px;
86
  width: 100%;
87
  border-radius: 3px;
88
  clear: none;
272
  clear: right;
273
  width: 120px;
274
  }
275
+ .screen-reader-text { position: absolute; left: -999em; }
styles/refresh.css CHANGED
@@ -46,7 +46,7 @@ border: 1px solid #eee;
46
  text-align: center;
47
  }
48
  .mc-main .mc-single {font-size: 1.1em!important; text-align: left; padding: 4px}
49
- .mc-main table {width:100%;line-height:1.2;border-collapse:collapse}
50
  .mc-main td {
51
  vertical-align:top;
52
  text-align:left;
@@ -62,7 +62,7 @@ border-radius: 2px;
62
  font-size:10px!important;
63
  font-family: Arial, sans-serif;
64
  font-weight:400;
65
- margin:1px 0;
66
  padding:1px 1px;
67
  clear: none;
68
  line-height: 1;
46
  text-align: center;
47
  }
48
  .mc-main .mc-single {font-size: 1.1em!important; text-align: left; padding: 4px}
49
+ .mc-main table,.mc-main.calendar {width:100%;line-height:1.2;border-collapse:collapse}
50
  .mc-main td {
51
  vertical-align:top;
52
  text-align:left;
62
  font-size:10px!important;
63
  font-family: Arial, sans-serif;
64
  font-weight:400;
65
+ margin:1px 0!important;
66
  padding:1px 1px;
67
  clear: none;
68
  line-height: 1;
styles/twentyfourteen.css ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* New theme for 2014 */
2
+ @import url(../css/reset.css);
3
+ .mc-main .my-calendar-header a, .mc-main .mc_bottomnav a { color: #333; text-decoration: none; background: linear-gradient(to bottom, rgba(240,240,240,.95) 0%,rgba(225,225,225,.95) 70%); }
4
+ .mc-main .my-calendar-header a:hover, .mc-main .mc_bottomnav a:hover, .mc-main .my-calendar-header a:focus, .mc-main .mc_bottomnav a:focus { color: #000; text-decoration: underline; background: linear-gradient(to bottom, rgba(225,225,225,.95) 0%,rgba(210,210,210,.95) 70%); }
5
+ .mc-main.calendar { width: 100%!important; }
6
+ .mc-main table { width: 100%; border-collapse: collapse; }
7
+ .mc-main tr td { width: 14.285714%; border: 1px solid #f6f6f6; padding: 0!important; height: 5em; }
8
+ .mc-main th { text-align: center; text-transform: uppercase; padding: 1em 0; background: rgba( 0,0,0,.8 ); color: #fff!important; }
9
+ .mc-main { position: relative; }
10
+ .mc-main table, .mc-main .mc-list { box-shadow: 0 0 2px; }
11
+ .mc-main table .current-day .mc-date { background: rgba( 0,0,0,.8 ); color: #fff; }
12
+ .mc-main caption { font-size: 1.5em; margin: 0!important; }
13
+ .mc-main.mini caption { font-size: 1.2em; margin: 6px 0!important; }
14
+ .mc-main .event-title { -ms-word-break: break-all; word-break: break-all; word-break: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; margin: 0!important; }
15
+ .mc-main .event-title a { display: block; line-height: 1.5; padding: 6px; font-size: .9em; }
16
+ .mc-main .event-title img { vertical-align: text-top; margin-right: 2px; width: auto; }
17
+ .mc-main .calendar-event .details, .mc-main .calendar-events { position:absolute; left: 5%; width:90%; padding:5px; z-index: 3; background: rgba( 255,255,255,.98 ); padding: 2em; box-shadow: 0 0 4px; color: #333; }
18
+ .mc-main .close { position: absolute; right: 1em; top: 1em; padding: 2px; }
19
+ .mc-main .close:hover, .mc-main .close:focus { outline: 1px solid #777; }
20
+ .mc-main .details img { width: 100%; height: auto; }
21
+ .mc-main .details img.alignleft { width: auto; float: left; margin: 0 1em .5em 0; }
22
+ .mc-main .details img.alignright { width: auto; float: left; margin: 0 0 .5em 1em; }
23
+ .mc-main .details img.aligncenter { width: auto; display: block; margin: 0 auto .5em; }
24
+ .mc-main .details p { margin: 0 0 1em; line-height: 1.7; }
25
+ .mc-main .details h2, .mc-main .details h3 { font-weight: 700; font-size: 1.4em; line-height: 1.3; }
26
+ .mc-main .details h4, .mc-main .details h5, .mc-main .details h6 { font-weight: 400; font-size: 1.1em; line-height: 1.5; }
27
+ .mc-main .details li { line-height: 1.5; }
28
+ /* Sharing */
29
+ .mc-main .details .sharing { padding: .5em; clear: both; }
30
+ .mc-main .details .sharing p { display: inline-block; margin: 0 1em 0 0; }
31
+ /* Date/times */
32
+ .mc-main .time-block p{ font-size: 1.2em; color: #000; margin: 0; }
33
+ .mc-main .mc-event-date { font-weight: 700; color: #333; }
34
+ .mc-main .mc-date { display: block; padding: 4px 2px; text-align: center; font-size: 1.2em; background: rgba( 240, 240, 240, .9 ); color: #111; }
35
+ .mc-main .mc-single { text-align: right; font-size: 1.4em; font-weight: 700; }
36
+ /* Header */
37
+ .mc-main .my-calendar-header { position: relative; height: 5em; z-index: 1; width: 100%; }
38
+ .mc-main .my-calendar-header:after { content: ''; display: table; clear: both; }
39
+ /* Navigation */
40
+ .my-calendar-nav { position: absolute; top: .5em; right: 0; }
41
+ .my-calendar-nav ul,.mc-main .category-key ul,.mc-main .mc-export ul, .mc-main .mc-list { margin: 0!important; padding: 0!important; }
42
+ .my-calendar-nav ul li,.mc-main .category-key ul li,.mc-main .mc-export ul li { display: inline-block; list-style-type: none; margin: 0 0 .3em; }
43
+ .my-calendar-nav li a { padding: .3em; }
44
+ .my-calendar-nav .my-calendar-prev a:before { content: '\25C0 '; }
45
+ .my-calendar-nav .my-calendar-next a:after { content: ' \25b6'; }
46
+ /* Time frame */
47
+ .mc-time { position: absolute; bottom: .75em; font-size: 1.2em; }
48
+ .mc-time a { margin-right: 1px; padding: .5em; }
49
+ /* Category Key */
50
+ .mc-main .category-key h3 { font-weight: 700; font-size: 1.4em; }
51
+ .mc-main .category-key { margin: .5em 0; }
52
+ .mc-main .category-key a { padding: .3em; }
53
+ .mc-main .no-icon { display: inline-block; width: 1.25em; margin-right: .25em; border-radius: 12px; }
54
+ .mc-main .category-color-sample img { padding: 2px; vertical-align: middle; border-radius: 3px; margin-right: .25em; }
55
+ /* hCard */
56
+ .mc-main .vcard { line-height: 1.5; margin: 0 0 1.5em 1.5em; float: right; padding: 2em; max-width: 50%; }
57
+ .mc-main .vcard .street-address { display: inline; }
58
+ .mc-main .vcard .street-address:nth-of-type(2):before { content: ', '; }
59
+ /* Jumpbox */
60
+ .mc-main .my-calendar-date-switcher label { clip: rect(1px 1px 1px 1px); clip: rect(1px, 1px, 1px, 1px); overflow: hi