Version Description
- Added event display builder feature, which vastly improves the customization possibilities of the plugin. This feature encompasses many of the most requested features, such as:
- All-day events can be handled differently than 'normal' events
- Start and end times / dates can be displayed on the same line (as can any other event information)
- HTML (and Markdown) entered in Google Calendar fields can be properly parsed
- Start and end times for retrieval of events are now much more flexible
- A custom error message for non-admin users can now be specified
- No longer loads SimplePie when it is not required
Download this release
Release Info
Developer | rosshanney |
Plugin | Simple Calendar – Google Calendar Plugin |
Version | 0.5 |
Comparing to | |
See all releases |
Code changes from version 0.4.1 to 0.5
- admin/add.php +138 -24
- admin/edit.php +135 -24
- admin/main.php +8 -1
- admin/timezone-choices.php +402 -402
- css/gce-style.css +1 -7
- google-calendar-events.php +77 -38
- inc/gce-feed.php +311 -5
- inc/gce-parser.php +77 -103
- inc/simplepie-gcalendar.php +4 -11
- js/gce-admin-script.js +29 -0
- languages/google-calendar-events.pot +241 -212
- readme.txt +18 -10
- screenshot-1.jpg +0 -0
- screenshot-2.jpg +0 -0
- widget/gce-widget.php +27 -5
admin/add.php
CHANGED
@@ -11,9 +11,9 @@ add_settings_section('gce_add', __('Add a Feed', GCE_TEXT_DOMAIN), 'gce_add_main
|
|
11 |
add_settings_field('gce_add_id_field', __('Feed ID', GCE_TEXT_DOMAIN), 'gce_add_id_field', 'add_feed', 'gce_add');
|
12 |
add_settings_field('gce_add_title_field', __('Feed Title', GCE_TEXT_DOMAIN), 'gce_add_title_field', 'add_feed', 'gce_add');
|
13 |
add_settings_field('gce_add_url_field', __('Feed URL', GCE_TEXT_DOMAIN), 'gce_add_url_field', 'add_feed', 'gce_add');
|
14 |
-
add_settings_field('
|
|
|
15 |
add_settings_field('gce_add_max_events_field', __('Maximum number of events to retrieve', GCE_TEXT_DOMAIN), 'gce_add_max_events_field', 'add_feed', 'gce_add');
|
16 |
-
add_settings_field('gce_add_day_limit_field', __('Number of days in the future to retrieve events for', GCE_TEXT_DOMAIN), 'gce_add_day_limit_field', 'add_feed', 'gce_add');
|
17 |
add_settings_field('gce_add_date_format_field', __('Date format', GCE_TEXT_DOMAIN), 'gce_add_date_format_field', 'add_feed', 'gce_add');
|
18 |
add_settings_field('gce_add_time_format_field', __('Time format', GCE_TEXT_DOMAIN), 'gce_add_time_format_field', 'add_feed', 'gce_add');
|
19 |
add_settings_field('gce_add_timezone_field', __('Timezone adjustment', GCE_TEXT_DOMAIN), 'gce_add_timezone_field', 'add_feed', 'gce_add');
|
@@ -21,12 +21,18 @@ add_settings_field('gce_add_cache_duration_field', __('Cache duration', GCE_TE
|
|
21 |
add_settings_field('gce_add_multiple_field', __('Show multiple day events on each day?', GCE_TEXT_DOMAIN), 'gce_add_multiple_field', 'add_feed', 'gce_add');
|
22 |
|
23 |
add_settings_section('gce_add_display', __('Display Options', GCE_TEXT_DOMAIN), 'gce_add_display_main_text', 'add_display');
|
24 |
-
add_settings_field('
|
25 |
-
|
26 |
-
|
27 |
-
add_settings_field('
|
28 |
-
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
//Main text
|
32 |
function gce_add_main_text(){
|
@@ -70,37 +76,56 @@ function gce_add_url_field(){
|
|
70 |
<?php
|
71 |
}
|
72 |
|
73 |
-
//
|
74 |
-
function
|
75 |
?>
|
76 |
-
<span class="description"><?php _e('
|
77 |
<br />
|
78 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
<?php
|
80 |
}
|
81 |
|
82 |
-
//
|
83 |
-
function
|
84 |
?>
|
85 |
-
<span class="description"><?php _e('
|
86 |
<br />
|
87 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
<?php
|
89 |
}
|
90 |
|
91 |
-
//
|
92 |
-
function
|
93 |
?>
|
94 |
-
<span class="description"><?php _e('
|
95 |
<br />
|
96 |
-
<input type="text" name="gce_options[
|
97 |
<?php
|
98 |
}
|
99 |
|
100 |
//Date format
|
101 |
function gce_add_date_format_field(){
|
102 |
?>
|
103 |
-
<span class="description"><?php _e('In <a href="http://php.net/manual/en/function.date.php">PHP date format</a>. Leave this blank if you\'d rather stick with the default format for your blog.', GCE_TEXT_DOMAIN); ?></span>
|
104 |
<br />
|
105 |
<input type="text" name="gce_options[date_format]" />
|
106 |
<?php
|
@@ -109,7 +134,7 @@ function gce_add_date_format_field(){
|
|
109 |
//Time format
|
110 |
function gce_add_time_format_field(){
|
111 |
?>
|
112 |
-
<span class="description"><?php _e('In <a href="http://php.net/manual/en/function.date.php">PHP date format</a>. Again, leave this blank to stick with the default.', GCE_TEXT_DOMAIN); ?></span>
|
113 |
<br />
|
114 |
<input type="text" name="gce_options[time_format]" />
|
115 |
<?php
|
@@ -140,7 +165,7 @@ function gce_add_cache_duration_field(){
|
|
140 |
//Multiple day events
|
141 |
function gce_add_multiple_field(){
|
142 |
?>
|
143 |
-
<span class="description"><?php _e('Show events that span multiple days on each day that they span (There are some <a href="http://www.rhanney.co.uk/2010/08/19/google-calendar-events-0-4#multiday">limitations</a> of this feature to be aware of).', GCE_TEXT_DOMAIN); ?></span>
|
144 |
<br />
|
145 |
<input type="checkbox" name="gce_options[multiple_day]" value="true" />
|
146 |
<br /><br />
|
@@ -152,7 +177,96 @@ function gce_add_multiple_field(){
|
|
152 |
function gce_add_display_main_text(){
|
153 |
?>
|
154 |
<p><?php _e('These settings control what information will be displayed for this feed in the tooltip (for grids), or in a list.', GCE_TEXT_DOMAIN); ?></p>
|
155 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
156 |
<?php
|
157 |
}
|
158 |
|
11 |
add_settings_field('gce_add_id_field', __('Feed ID', GCE_TEXT_DOMAIN), 'gce_add_id_field', 'add_feed', 'gce_add');
|
12 |
add_settings_field('gce_add_title_field', __('Feed Title', GCE_TEXT_DOMAIN), 'gce_add_title_field', 'add_feed', 'gce_add');
|
13 |
add_settings_field('gce_add_url_field', __('Feed URL', GCE_TEXT_DOMAIN), 'gce_add_url_field', 'add_feed', 'gce_add');
|
14 |
+
add_settings_field('gce_add_retrieve_from_field', __('Retrieve events from', GCE_TEXT_DOMAIN), 'gce_add_retrieve_from_field', 'add_feed', 'gce_add');
|
15 |
+
add_settings_field('gce_add_retrieve_until_field', __('Retrieve events until', GCE_TEXT_DOMAIN), 'gce_add_retrieve_until_field', 'add_feed', 'gce_add');
|
16 |
add_settings_field('gce_add_max_events_field', __('Maximum number of events to retrieve', GCE_TEXT_DOMAIN), 'gce_add_max_events_field', 'add_feed', 'gce_add');
|
|
|
17 |
add_settings_field('gce_add_date_format_field', __('Date format', GCE_TEXT_DOMAIN), 'gce_add_date_format_field', 'add_feed', 'gce_add');
|
18 |
add_settings_field('gce_add_time_format_field', __('Time format', GCE_TEXT_DOMAIN), 'gce_add_time_format_field', 'add_feed', 'gce_add');
|
19 |
add_settings_field('gce_add_timezone_field', __('Timezone adjustment', GCE_TEXT_DOMAIN), 'gce_add_timezone_field', 'add_feed', 'gce_add');
|
21 |
add_settings_field('gce_add_multiple_field', __('Show multiple day events on each day?', GCE_TEXT_DOMAIN), 'gce_add_multiple_field', 'add_feed', 'gce_add');
|
22 |
|
23 |
add_settings_section('gce_add_display', __('Display Options', GCE_TEXT_DOMAIN), 'gce_add_display_main_text', 'add_display');
|
24 |
+
add_settings_field('gce_add_use_builder_field', __('Select display customization method', GCE_TEXT_DOMAIN), 'gce_add_use_builder_field', 'add_display', 'gce_add_display');
|
25 |
+
|
26 |
+
add_settings_section('gce_add_builder', __('Event Display Builder'), 'gce_add_builder_main_text', 'add_builder');
|
27 |
+
add_settings_field('gce_add_builder_field', __('Event display builder HTML and shortcodes', GCE_TEXT_DOMAIN), 'gce_add_builder_field', 'add_builder', 'gce_add_builder');
|
28 |
+
|
29 |
+
add_settings_section('gce_add_simple_display', __('Simple Display Options'), 'gce_add_simple_display_main_text', 'add_simple_display');
|
30 |
+
add_settings_field('gce_add_display_start_field', __('Display start time / date?', GCE_TEXT_DOMAIN), 'gce_add_display_start_field', 'add_simple_display', 'gce_add_simple_display');
|
31 |
+
add_settings_field('gce_add_display_end_field', __('Display end time / date?', GCE_TEXT_DOMAIN), 'gce_add_display_end_field', 'add_simple_display', 'gce_add_simple_display');
|
32 |
+
add_settings_field('gce_add_display_separator_field', __('Separator text / characters', GCE_TEXT_DOMAIN), 'gce_add_display_separator_field', 'add_simple_display', 'gce_add_simple_display');
|
33 |
+
add_settings_field('gce_add_display_location_field', __('Display location?', GCE_TEXT_DOMAIN), 'gce_add_display_location_field', 'add_simple_display', 'gce_add_simple_display');
|
34 |
+
add_settings_field('gce_add_display_desc_field', __('Display description?', GCE_TEXT_DOMAIN), 'gce_add_display_desc_field', 'add_simple_display', 'gce_add_simple_display');
|
35 |
+
add_settings_field('gce_add_display_link_field', __('Display link to event?', GCE_TEXT_DOMAIN), 'gce_add_display_link_field', 'add_simple_display', 'gce_add_simple_display');
|
36 |
|
37 |
//Main text
|
38 |
function gce_add_main_text(){
|
76 |
<?php
|
77 |
}
|
78 |
|
79 |
+
//Retrieve events from
|
80 |
+
function gce_add_retrieve_from_field(){
|
81 |
?>
|
82 |
+
<span class="description"><?php _e('The point in time at which to start retrieving events. Use the text-box to specify an additional offset from you chosen start point. The offset should be provided in seconds (3600 = 1 hour, 86400 = 1 day) and can be negative. If you have selected the \'Specific date / time\' option, enter a <a href="http://www.timestampgenerator.com" target="_blank">UNIX timestamp</a> in the text-box.', GCE_TEXT_DOMAIN); ?></span>
|
83 |
<br />
|
84 |
+
<select name="gce_options[retrieve_from]">
|
85 |
+
<option value="now">Now</option>
|
86 |
+
<option value="today" selected="selected">00:00 today</option>
|
87 |
+
<option value="week">Start of current week</option>
|
88 |
+
<option value="month-start">Start of current month</option>
|
89 |
+
<option value="month-end">End of current month</option>
|
90 |
+
<option value="any">The beginning of time</option>
|
91 |
+
<option value="date">Specific date / time</option>
|
92 |
+
</select>
|
93 |
+
<input type="text" name="gce_options[retrieve_from_value]" value="0" />
|
94 |
<?php
|
95 |
}
|
96 |
|
97 |
+
//Retrieve events until
|
98 |
+
function gce_add_retrieve_until_field(){
|
99 |
?>
|
100 |
+
<span class="description"><?php _e('The point in time at which to stop retrieving events. The instructions for the above option also apply here.', GCE_TEXT_DOMAIN); ?></span>
|
101 |
<br />
|
102 |
+
<select name="gce_options[retrieve_until]">
|
103 |
+
<option value="now">Now</option>
|
104 |
+
<option value="today">00:00 today</option>
|
105 |
+
<option value="week">Start of current week</option>
|
106 |
+
<option value="month-start">Start of current month</option>
|
107 |
+
<option value="month-end">End of current month</option>
|
108 |
+
<option value="any" selected="selected">The end of time</option>
|
109 |
+
<option value="date">Specific date / time</option>
|
110 |
+
|
111 |
+
</select>
|
112 |
+
<input type="text" name="gce_options[retrieve_until_value]" value="0" />
|
113 |
<?php
|
114 |
}
|
115 |
|
116 |
+
//Max events
|
117 |
+
function gce_add_max_events_field(){
|
118 |
?>
|
119 |
+
<span class="description"><?php _e('Set this to a few more than you actually want to display (due to caching and timezone issues). The exact number to display can be configured per shortcode / widget.', GCE_TEXT_DOMAIN); ?></span>
|
120 |
<br />
|
121 |
+
<input type="text" name="gce_options[max_events]" value="25" size="3" />
|
122 |
<?php
|
123 |
}
|
124 |
|
125 |
//Date format
|
126 |
function gce_add_date_format_field(){
|
127 |
?>
|
128 |
+
<span class="description"><?php _e('In <a href="http://php.net/manual/en/function.date.php" target="_blank">PHP date format</a>. Leave this blank if you\'d rather stick with the default format for your blog.', GCE_TEXT_DOMAIN); ?></span>
|
129 |
<br />
|
130 |
<input type="text" name="gce_options[date_format]" />
|
131 |
<?php
|
134 |
//Time format
|
135 |
function gce_add_time_format_field(){
|
136 |
?>
|
137 |
+
<span class="description"><?php _e('In <a href="http://php.net/manual/en/function.date.php" target="_blank">PHP date format</a>. Again, leave this blank to stick with the default.', GCE_TEXT_DOMAIN); ?></span>
|
138 |
<br />
|
139 |
<input type="text" name="gce_options[time_format]" />
|
140 |
<?php
|
165 |
//Multiple day events
|
166 |
function gce_add_multiple_field(){
|
167 |
?>
|
168 |
+
<span class="description"><?php _e('Show events that span multiple days on each day that they span (There are some <a href="http://www.rhanney.co.uk/2010/08/19/google-calendar-events-0-4#multiday" target="_blank">limitations</a> of this feature to be aware of).', GCE_TEXT_DOMAIN); ?></span>
|
169 |
<br />
|
170 |
<input type="checkbox" name="gce_options[multiple_day]" value="true" />
|
171 |
<br /><br />
|
177 |
function gce_add_display_main_text(){
|
178 |
?>
|
179 |
<p><?php _e('These settings control what information will be displayed for this feed in the tooltip (for grids), or in a list.', GCE_TEXT_DOMAIN); ?></p>
|
180 |
+
<?php
|
181 |
+
}
|
182 |
+
|
183 |
+
function gce_add_use_builder_field(){
|
184 |
+
?>
|
185 |
+
<span class="description"><?php _e('It is recommended that you use the event display builder option, as it provides much more flexibility than the simple display options. The event display builder can do everything the simple display options can, plus lots more!', GCE_TEXT_DOMAIN); ?></span>
|
186 |
+
<br />
|
187 |
+
<select name="gce_options[use_builder]">
|
188 |
+
<option value="true" selected="selected">Event display builder</option>
|
189 |
+
<option value="false">Simple display options</option>
|
190 |
+
</select>
|
191 |
+
<?php
|
192 |
+
}
|
193 |
+
|
194 |
+
//Event display builder
|
195 |
+
function gce_add_builder_main_text(){
|
196 |
+
?>
|
197 |
+
<p class="gce-event-builder">Use the event display builder to customize how event information will be displayed in the grid tooltips and in lists. Use HTML and the shortcodes (explained below) to display the information you require. A basic example display format is provided as a starting point. For more information, take a look at the <a href="http://www.rhanney.co.uk/plugins/google-calendar-events/event-display-builder" target="_blank">event display builder guide</a>.</p>
|
198 |
+
<?php
|
199 |
+
}
|
200 |
+
|
201 |
+
function gce_add_builder_field(){
|
202 |
+
?>
|
203 |
+
<textarea name="gce_options[builder]" rows="10" cols="80">
|
204 |
+
<p class="gce-list-event gce-tooltip-event">[event-title]</p>
|
205 |
+
<p><span>Starts:</span> [start-time]</p>
|
206 |
+
<p><span>Ends:</span> [end-date] - [end-time]</p>
|
207 |
+
[if-location]<p><span>Location:</span> [location]</p>[/if-location]
|
208 |
+
[if-description]<p><span>Description:</span> [description]</p>[/if-description]
|
209 |
+
<p>[link newwindow="true"]More details...[/link]</p>
|
210 |
+
</textarea>
|
211 |
+
<br />
|
212 |
+
<p style="margin-top:20px;">(More information on all of the below shortcodes and attributes, and working examples, can be found in the <a href="http://www.rhanney.co.uk/plugins/google-calendar-events/event-display-builder" target="_blank">event display builder guide</a>)</p>
|
213 |
+
<h4>Event information shortcodes:</h4>
|
214 |
+
<ul>
|
215 |
+
<li><code>[event-title]</code><span class="description"> - The event title (possible attributes: <code>html</code>, <code>markdown</code>)</span></li>
|
216 |
+
<li><code>[start-time]</code><span class="description"> - The event start time. Will use the time format specified in the above settings</span></li>
|
217 |
+
<li><code>[start-date]</code><span class="description"> - The event start date. Will use the date format specified in the above settings</span></li>
|
218 |
+
<li><code>[start-custom]</code><span class="description"> - The event start date / time. Will use the format specified in the <code>format</code> attribute (possible attributes: <code>format</code>)</span></li>
|
219 |
+
<li><code>[start-human]</code><span class="description"> - The difference between the start time of the event and the time now, in human-readable format, such as '1 hour', '4 days', '15 mins'</span></li>
|
220 |
+
<li><code>[end-time]</code><span class="description"> - The event end time. Will use the time format specified in the above settings</span></li>
|
221 |
+
<li><code>[end-date]</code><span class="description"> - The event end date. Will use the date format specified in the above settings</span></li>
|
222 |
+
<li><code>[end-custom]</code><span class="description"> - The event end date / time. Will use the format specified in the <code>format</code> attribute (possible attributes: <code>format</code>)</span></li>
|
223 |
+
<li><code>[end-human]</code><span class="description"> - The difference between the end time of the event and the time now, in human-readable format, such as '1 hour', '4 days', '15 mins'</span></li>
|
224 |
+
<li><code>[location]</code><span class="description"> - The event location (possible attributes: <code>html</code>, <code>markdown</code>)</span></li>
|
225 |
+
<li><code>[maps-link]…[/maps-link]</code><span class="description"> - Anything between the opening and closing shortcode tags (inlcuding further shortcodes) will be linked to Google Maps, using the event location as a search parameter (possible attributes: <code>newwindow</code>)</span></li>
|
226 |
+
<li><code>[description]</code><span class="description"> - The event description (possible attributes: <code>html</code>, <code>markdown</code>, <code>limit</code>)</span></li>
|
227 |
+
<li><code>[link]…[/link]</code><span class="description"> - Anything between the opening and closing shortcode tags (inlcuding further shortcodes) will be linked to the Google Calendar page for the event (possible attributes: <code>newwindow</code>)</span></li>
|
228 |
+
<li><code>[link-path]</code><span class="description"> - The raw URL to the Google Calendar page for the event</span></li>
|
229 |
+
</ul>
|
230 |
+
<h4>Feed information shortcodes:</h4>
|
231 |
+
<ul>
|
232 |
+
<li><code>[feed-title]</code><span class="description"> - The title of the feed from which the event comes</span></li>
|
233 |
+
<li><code>[feed-id]</code><span class="description"> - The ID of the feed from which the event comes</span></li>
|
234 |
+
</ul>
|
235 |
+
<h4>Conditional shortcodes:</h4>
|
236 |
+
<p class="description" style="margin-bottom:18px;">Anything entered between the opening and closing tags of each of the following shortcodes will only be displayed if its condition (below) is met.</p>
|
237 |
+
<ul>
|
238 |
+
<li><code>[if-all-day]…[/if-all-day]</code><span class="description"> - The event is an all-day event</span></li>
|
239 |
+
<li><code>[if-not-all-day]…[/if-not-all-day]</code><span class="description"> - The event is not an all-day event</span></li>
|
240 |
+
<li><code>[if-title]…[/if-title]</code><span class="description"> - The event has a title</span></li>
|
241 |
+
<li><code>[if-description]…[/if-description]</code><span class="description"> - The event has a description</span></li>
|
242 |
+
<li><code>[if-location]…[/if-location]</code><span class="description"> - The event has a location</span></li>
|
243 |
+
<li><code>[if-tooltip]…[/if-tooltip]</code><span class="description"> - The event is to be displayed in a tooltip (not a list)</span></li>
|
244 |
+
<li><code>[if-list]…[/if-list]</code><span class="description"> - The event is to be displayed in a list (not a tooltip)</span></li>
|
245 |
+
<li><code>[if-now]…[/if-now]</code><span class="description"> - The event is taking place now (after the start time, but before the end time)</span></li>
|
246 |
+
<li><code>[if-not-now]…[/if-not-now]</code><span class="description"> - The event is not taking place now (may have ended or not yet started)</span></li>
|
247 |
+
<li><code>[if-started]…[/if-started]</code><span class="description"> - The event has started (even if it has also ended)</span></li>
|
248 |
+
<li><code>[if-not-started]…[/if-not-started]</code><span class="description"> - The event has not started</span></li>
|
249 |
+
<li><code>[if-ended]…[/if-ended]</code><span class="description"> - The event has ended</span></li>
|
250 |
+
<li><code>[if-not-ended]…[/if-not-ended]</code><span class="description"> - The event has not ended (even if it hasn't started)</span></li>
|
251 |
+
<li><code>[if-first]…[/if-first]</code><span class="description"> - The event is the first of the day</span></li>
|
252 |
+
<li><code>[if-not-first]…[/if-not-first]</code><span class="description"> - The event is not the first of the day</span></li>
|
253 |
+
</ul>
|
254 |
+
<h4>Attributes:</h4>
|
255 |
+
<p class="description" style="margin-bottom:18px;">The possible attributes mentioned above are explained here:</p>
|
256 |
+
<ul>
|
257 |
+
<li><code>html</code><span class="description"> - Whether or not to parse HTML that has been entered in the relevant field. Can be <code>true</code> or <code>false</code></span></li>
|
258 |
+
<li><code>markdown</code><span class="description"> - Whether or not parse <a href="http://daringfireball.net/projects/markdown" target="_blank">Markdown</a> that has been entered in the relevant field. <a href="http://michelf.com/projects/php-markdown" target="_blank">PHP Markdown</a> must be installed for this to work. Can be <code>true</code> or <code>false</code></span></li>
|
259 |
+
<li><code>limit</code><span class="description"> - The word limit for the field. Should be specified as a positive integer</span></li>
|
260 |
+
<li><code>format</code><span class="description"> - The date / time format to use. Should specified as a <a href="http://php.net/manual/en/function.date.php" target="_blank">PHP date format</a> string</span></li>
|
261 |
+
<li><code>newwindow</code><span class="description"> - Whether or not the link should open in a new window / tab. Can be <code>true</code> or <code>false</code></span></li>
|
262 |
+
</ul>
|
263 |
+
<?php
|
264 |
+
}
|
265 |
+
|
266 |
+
//Simple display options
|
267 |
+
function gce_add_simple_display_main_text(){
|
268 |
+
?>
|
269 |
+
<p class="gce-simple-display-options"><?php _e('You can use some HTML in the text fields, but ensure it is valid or things might go wonky. Text fields can be empty too.', GCE_TEXT_DOMAIN); ?></p>
|
270 |
<?php
|
271 |
}
|
272 |
|
admin/edit.php
CHANGED
@@ -11,9 +11,9 @@ add_settings_section('gce_edit', __('Edit Feed', GCE_TEXT_DOMAIN), 'gce_edit_mai
|
|
11 |
add_settings_field('gce_edit_id_field', __('Feed ID', GCE_TEXT_DOMAIN), 'gce_edit_id_field', 'edit_feed', 'gce_edit');
|
12 |
add_settings_field('gce_edit_title_field', __('Feed Title', GCE_TEXT_DOMAIN), 'gce_edit_title_field', 'edit_feed', 'gce_edit');
|
13 |
add_settings_field('gce_edit_url_field', __('Feed URL', GCE_TEXT_DOMAIN), 'gce_edit_url_field', 'edit_feed', 'gce_edit');
|
14 |
-
add_settings_field('
|
|
|
15 |
add_settings_field('gce_edit_max_events_field', __('Maximum number of events to retrieve', GCE_TEXT_DOMAIN), 'gce_edit_max_events_field', 'edit_feed', 'gce_edit');
|
16 |
-
add_settings_field('gce_edit_day_limit_field', __('Number of days in the future to retrieve events for', GCE_TEXT_DOMAIN), 'gce_edit_day_limit_field', 'edit_feed', 'gce_edit');
|
17 |
add_settings_field('gce_edit_date_format_field', __('Date format', GCE_TEXT_DOMAIN), 'gce_edit_date_format_field', 'edit_feed', 'gce_edit');
|
18 |
add_settings_field('gce_edit_time_format_field', __('Time format', GCE_TEXT_DOMAIN), 'gce_edit_time_format_field', 'edit_feed', 'gce_edit');
|
19 |
add_settings_field('gce_edit_timezone_field', __('Timezone adjustment', GCE_TEXT_DOMAIN), 'gce_edit_timezone_field', 'edit_feed', 'gce_edit');
|
@@ -21,12 +21,18 @@ add_settings_field('gce_edit_cache_duration_field', __('Cache duration', GCE_T
|
|
21 |
add_settings_field('gce_edit_multiple_field', __('Show multiple day events on each day?', GCE_TEXT_DOMAIN), 'gce_edit_multiple_field', 'edit_feed', 'gce_edit');
|
22 |
|
23 |
add_settings_section('gce_edit_display', __('Display Options', GCE_TEXT_DOMAIN), 'gce_edit_display_main_text', 'edit_display');
|
24 |
-
add_settings_field('
|
25 |
-
|
26 |
-
|
27 |
-
add_settings_field('
|
28 |
-
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
//Main text
|
32 |
function gce_edit_main_text(){
|
@@ -67,36 +73,55 @@ function gce_edit_url_field(){
|
|
67 |
<?php
|
68 |
}
|
69 |
|
70 |
-
//
|
71 |
-
function
|
72 |
$options = get_option(GCE_OPTIONS_NAME);
|
73 |
$options = $options[$_GET['id']];
|
74 |
?>
|
75 |
-
<span class="description"><?php _e('
|
76 |
<br />
|
77 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
<?php
|
79 |
}
|
80 |
|
81 |
-
//
|
82 |
-
function
|
83 |
$options = get_option(GCE_OPTIONS_NAME);
|
84 |
$options = $options[$_GET['id']];
|
85 |
?>
|
86 |
-
<span class="description"><?php _e('
|
87 |
<br />
|
88 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
<?php
|
90 |
}
|
91 |
|
92 |
-
//
|
93 |
-
function
|
94 |
$options = get_option(GCE_OPTIONS_NAME);
|
95 |
$options = $options[$_GET['id']];
|
96 |
?>
|
97 |
-
<span class="description"><?php _e('
|
98 |
<br />
|
99 |
-
<input type="text" name="gce_options[
|
100 |
<?php
|
101 |
}
|
102 |
|
@@ -105,7 +130,7 @@ function gce_edit_date_format_field(){
|
|
105 |
$options = get_option(GCE_OPTIONS_NAME);
|
106 |
$options = $options[$_GET['id']];
|
107 |
?>
|
108 |
-
<span class="description"><?php _e('In <a href="http://php.net/manual/en/function.date.php">PHP date format</a>. Leave this blank if you\'d rather stick with the default format for your blog.', GCE_TEXT_DOMAIN); ?></span>
|
109 |
<br />
|
110 |
<input type="text" name="gce_options[date_format]" value="<?php echo $options['date_format']; ?>" />
|
111 |
<?php
|
@@ -116,7 +141,7 @@ function gce_edit_time_format_field(){
|
|
116 |
$options = get_option(GCE_OPTIONS_NAME);
|
117 |
$options = $options[$_GET['id']];
|
118 |
?>
|
119 |
-
<span class="description"><?php _e('In <a href="http://php.net/manual/en/function.date.php">PHP date format</a>. Again, leave this blank to stick with the default.', GCE_TEXT_DOMAIN); ?></span>
|
120 |
<br />
|
121 |
<input type="text" name="gce_options[time_format]" value="<?php echo $options['time_format']; ?>" />
|
122 |
<?php
|
@@ -153,7 +178,7 @@ function gce_edit_multiple_field(){
|
|
153 |
$options = get_option(GCE_OPTIONS_NAME);
|
154 |
$options = $options[$_GET['id']];
|
155 |
?>
|
156 |
-
<span class="description"><?php _e('Show events that span multiple days on each day that they span (There are some <a href="http://www.rhanney.co.uk/2010/08/19/google-calendar-events-0-4#multiday">limitations</a> of this feature to be aware of).', GCE_TEXT_DOMAIN); ?></span>
|
157 |
<br />
|
158 |
<input type="checkbox" name="gce_options[multiple_day]" value="true"<?php checked($options['multiple_day'], 'true'); ?> />
|
159 |
<br /><br />
|
@@ -165,7 +190,93 @@ function gce_edit_multiple_field(){
|
|
165 |
function gce_edit_display_main_text(){
|
166 |
?>
|
167 |
<p><?php _e('These settings control what information will be displayed for this feed in the tooltip (for grids), or in a list.', GCE_TEXT_DOMAIN); ?></p>
|
168 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
169 |
<?php
|
170 |
}
|
171 |
|
11 |
add_settings_field('gce_edit_id_field', __('Feed ID', GCE_TEXT_DOMAIN), 'gce_edit_id_field', 'edit_feed', 'gce_edit');
|
12 |
add_settings_field('gce_edit_title_field', __('Feed Title', GCE_TEXT_DOMAIN), 'gce_edit_title_field', 'edit_feed', 'gce_edit');
|
13 |
add_settings_field('gce_edit_url_field', __('Feed URL', GCE_TEXT_DOMAIN), 'gce_edit_url_field', 'edit_feed', 'gce_edit');
|
14 |
+
add_settings_field('gce_edit_retrieve_from_field', __('Retrieve events from', GCE_TEXT_DOMAIN), 'gce_edit_retrieve_from_field', 'edit_feed', 'gce_edit');
|
15 |
+
add_settings_field('gce_edit_retrieve_until_field', __('Retrieve events until', GCE_TEXT_DOMAIN), 'gce_edit_retrieve_until_field', 'edit_feed', 'gce_edit');
|
16 |
add_settings_field('gce_edit_max_events_field', __('Maximum number of events to retrieve', GCE_TEXT_DOMAIN), 'gce_edit_max_events_field', 'edit_feed', 'gce_edit');
|
|
|
17 |
add_settings_field('gce_edit_date_format_field', __('Date format', GCE_TEXT_DOMAIN), 'gce_edit_date_format_field', 'edit_feed', 'gce_edit');
|
18 |
add_settings_field('gce_edit_time_format_field', __('Time format', GCE_TEXT_DOMAIN), 'gce_edit_time_format_field', 'edit_feed', 'gce_edit');
|
19 |
add_settings_field('gce_edit_timezone_field', __('Timezone adjustment', GCE_TEXT_DOMAIN), 'gce_edit_timezone_field', 'edit_feed', 'gce_edit');
|
21 |
add_settings_field('gce_edit_multiple_field', __('Show multiple day events on each day?', GCE_TEXT_DOMAIN), 'gce_edit_multiple_field', 'edit_feed', 'gce_edit');
|
22 |
|
23 |
add_settings_section('gce_edit_display', __('Display Options', GCE_TEXT_DOMAIN), 'gce_edit_display_main_text', 'edit_display');
|
24 |
+
add_settings_field('gce_edit_use_builder_field', __('Select display customization method', GCE_TEXT_DOMAIN), 'gce_edit_use_builder_field', 'edit_display', 'gce_edit_display');
|
25 |
+
|
26 |
+
add_settings_section('gce_edit_builder', __('Event Display Builder'), 'gce_edit_builder_main_text', 'edit_builder');
|
27 |
+
add_settings_field('gce_edit_builder_field', __('Event display builder HTML and shortcodes', GCE_TEXT_DOMAIN), 'gce_edit_builder_field', 'edit_builder', 'gce_edit_builder');
|
28 |
+
|
29 |
+
add_settings_section('gce_edit_simple_display', __('Simple Display Options'), 'gce_edit_simple_display_main_text', 'edit_simple_display');
|
30 |
+
add_settings_field('gce_edit_display_start_field', __('Display start time / date?', GCE_TEXT_DOMAIN), 'gce_edit_display_start_field', 'edit_simple_display', 'gce_edit_simple_display');
|
31 |
+
add_settings_field('gce_edit_display_end_field', __('Display end time / date?', GCE_TEXT_DOMAIN), 'gce_edit_display_end_field', 'edit_simple_display', 'gce_edit_simple_display');
|
32 |
+
add_settings_field('gce_edit_display_separator_field', __('Separator text / characters', GCE_TEXT_DOMAIN), 'gce_edit_display_separator_field', 'edit_simple_display', 'gce_edit_simple_display');
|
33 |
+
add_settings_field('gce_edit_display_location_field', __('Display location?', GCE_TEXT_DOMAIN), 'gce_edit_display_location_field', 'edit_simple_display', 'gce_edit_simple_display');
|
34 |
+
add_settings_field('gce_edit_display_desc_field', __('Display description?', GCE_TEXT_DOMAIN), 'gce_edit_display_desc_field', 'edit_simple_display', 'gce_edit_simple_display');
|
35 |
+
add_settings_field('gce_edit_display_link_field', __('Display link to event?', GCE_TEXT_DOMAIN), 'gce_edit_display_link_field', 'edit_simple_display', 'gce_edit_simple_display');
|
36 |
|
37 |
//Main text
|
38 |
function gce_edit_main_text(){
|
73 |
<?php
|
74 |
}
|
75 |
|
76 |
+
//Retrieve events from
|
77 |
+
function gce_edit_retrieve_from_field(){
|
78 |
$options = get_option(GCE_OPTIONS_NAME);
|
79 |
$options = $options[$_GET['id']];
|
80 |
?>
|
81 |
+
<span class="description"><?php _e('The point in time at which to start retrieving events. Use the text-box to specify an additional offset from you chosen start point. The offset should be provided in seconds (3600 = 1 hour, 86400 = 1 day) and can be negative. If you have selected the \'Specific date / time\' option, enter a <a href="http://www.timestampgenerator.com" target="_blank">UNIX timestamp</a> in the text-box.', GCE_TEXT_DOMAIN); ?></span>
|
82 |
<br />
|
83 |
+
<select name="gce_options[retrieve_from]">
|
84 |
+
<option value="now"<?php selected($options['retrieve_from'], 'now'); ?>>Now</option>
|
85 |
+
<option value="today"<?php selected($options['retrieve_from'], 'today'); ?>>00:00 today</option>
|
86 |
+
<option value="week"<?php selected($options['retrieve_from'], 'week'); ?>>Start of current week</option>
|
87 |
+
<option value="month-start"<?php selected($options['retrieve_from'], 'month-start'); ?>>Start of current month</option>
|
88 |
+
<option value="month-end"<?php selected($options['retrieve_from'], 'month-end'); ?>>End of current month</option>
|
89 |
+
<option value="any"<?php selected($options['retrieve_from'], 'any'); ?>>The beginning of time</option>
|
90 |
+
<option value="date"<?php selected($options['retrieve_from'], 'date'); ?>>Specific date / time</option>
|
91 |
+
</select>
|
92 |
+
<input type="text" name="gce_options[retrieve_from_value]" value="<?php echo $options['retrieve_from_value']; ?>" />
|
93 |
<?php
|
94 |
}
|
95 |
|
96 |
+
//Retrieve events until
|
97 |
+
function gce_edit_retrieve_until_field(){
|
98 |
$options = get_option(GCE_OPTIONS_NAME);
|
99 |
$options = $options[$_GET['id']];
|
100 |
?>
|
101 |
+
<span class="description"><?php _e('The point in time at which to stop retrieving events. The instructions for the above option also apply here.', GCE_TEXT_DOMAIN); ?></span>
|
102 |
<br />
|
103 |
+
<select name="gce_options[retrieve_until]">
|
104 |
+
<option value="now"<?php selected($options['retrieve_until'], 'now'); ?>>Now</option>
|
105 |
+
<option value="today"<?php selected($options['retrieve_until'], 'today'); ?>>00:00 today</option>
|
106 |
+
<option value="week"<?php selected($options['retrieve_until'], 'week'); ?>>Start of current week</option>
|
107 |
+
<option value="month-start"<?php selected($options['retrieve_until'], 'month-start'); ?>>Start of current month</option>
|
108 |
+
<option value="month-end"<?php selected($options['retrieve_until'], 'month-end'); ?>>End of current month</option>
|
109 |
+
<option value="any"<?php selected($options['retrieve_until'], 'any'); ?>>The end of time</option>
|
110 |
+
<option value="date"<?php selected($options['retrieve_until'], 'date'); ?>>Specific date / time</option>
|
111 |
+
|
112 |
+
</select>
|
113 |
+
<input type="text" name="gce_options[retrieve_until_value]" value="<?php echo $options['retrieve_until_value']; ?>" />
|
114 |
<?php
|
115 |
}
|
116 |
|
117 |
+
//Max events
|
118 |
+
function gce_edit_max_events_field(){
|
119 |
$options = get_option(GCE_OPTIONS_NAME);
|
120 |
$options = $options[$_GET['id']];
|
121 |
?>
|
122 |
+
<span class="description"><?php _e('Set this to a few more than you actually want to display (due to caching and timezone issues). The exact number to display can be configured per shortcode / widget.', GCE_TEXT_DOMAIN); ?></span>
|
123 |
<br />
|
124 |
+
<input type="text" name="gce_options[max_events]" value="<?php echo $options['max_events']; ?>" size="3" />
|
125 |
<?php
|
126 |
}
|
127 |
|
130 |
$options = get_option(GCE_OPTIONS_NAME);
|
131 |
$options = $options[$_GET['id']];
|
132 |
?>
|
133 |
+
<span class="description"><?php _e('In <a href="http://php.net/manual/en/function.date.php" target="_blank">PHP date format</a>. Leave this blank if you\'d rather stick with the default format for your blog.', GCE_TEXT_DOMAIN); ?></span>
|
134 |
<br />
|
135 |
<input type="text" name="gce_options[date_format]" value="<?php echo $options['date_format']; ?>" />
|
136 |
<?php
|
141 |
$options = get_option(GCE_OPTIONS_NAME);
|
142 |
$options = $options[$_GET['id']];
|
143 |
?>
|
144 |
+
<span class="description"><?php _e('In <a href="http://php.net/manual/en/function.date.php" target="_blank">PHP date format</a>. Again, leave this blank to stick with the default.', GCE_TEXT_DOMAIN); ?></span>
|
145 |
<br />
|
146 |
<input type="text" name="gce_options[time_format]" value="<?php echo $options['time_format']; ?>" />
|
147 |
<?php
|
178 |
$options = get_option(GCE_OPTIONS_NAME);
|
179 |
$options = $options[$_GET['id']];
|
180 |
?>
|
181 |
+
<span class="description"><?php _e('Show events that span multiple days on each day that they span (There are some <a href="http://www.rhanney.co.uk/2010/08/19/google-calendar-events-0-4#multiday" target="_blank">limitations</a> of this feature to be aware of).', GCE_TEXT_DOMAIN); ?></span>
|
182 |
<br />
|
183 |
<input type="checkbox" name="gce_options[multiple_day]" value="true"<?php checked($options['multiple_day'], 'true'); ?> />
|
184 |
<br /><br />
|
190 |
function gce_edit_display_main_text(){
|
191 |
?>
|
192 |
<p><?php _e('These settings control what information will be displayed for this feed in the tooltip (for grids), or in a list.', GCE_TEXT_DOMAIN); ?></p>
|
193 |
+
<?php
|
194 |
+
}
|
195 |
+
|
196 |
+
function gce_edit_use_builder_field(){
|
197 |
+
$options = get_option(GCE_OPTIONS_NAME);
|
198 |
+
$options = $options[$_GET['id']];
|
199 |
+
?>
|
200 |
+
<span class="description"><?php _e('It is recommended that you use the event display builder option, as it provides much more flexibility than the simple display options. The event display builder can do everything the simple display options can, plus lots more!', GCE_TEXT_DOMAIN); ?></span>
|
201 |
+
<br />
|
202 |
+
<select name="gce_options[use_builder]">
|
203 |
+
<option value="true"<?php selected($options['use_builder'], 'true'); ?>>Event display builder</option>
|
204 |
+
<option value="false"<?php selected($options['use_builder'], 'false'); ?>>Simple display options</option>
|
205 |
+
</select>
|
206 |
+
<?php
|
207 |
+
}
|
208 |
+
|
209 |
+
//Event display builder
|
210 |
+
function gce_edit_builder_main_text(){
|
211 |
+
?>
|
212 |
+
<p class="gce-event-builder">Use the event display builder to customize how event information will be displayed in the grid tooltips and in lists. Use HTML and the shortcodes (explained below) to display the information you require. A basic example display format is provided as a starting point. For more information, take a look at the <a href="http://www.rhanney.co.uk/plugins/google-calendar-events/event-display-builder" target="_blank">event display builder guide</a>.</p>
|
213 |
+
<?php
|
214 |
+
}
|
215 |
+
|
216 |
+
function gce_edit_builder_field(){
|
217 |
+
$options = get_option(GCE_OPTIONS_NAME);
|
218 |
+
$options = $options[$_GET['id']];
|
219 |
+
?>
|
220 |
+
<textarea name="gce_options[builder]" rows="10" cols="80"><?php echo $options['builder']; ?></textarea>
|
221 |
+
<br />
|
222 |
+
<p style="margin-top:20px;">(More information on all of the below shortcodes and attributes, and working examples, can be found in the <a href="http://www.rhanney.co.uk/plugins/google-calendar-events/event-display-builder" target="_blank">event display builder guide</a>)</p>
|
223 |
+
<h4>Event information shortcodes:</h4>
|
224 |
+
<ul>
|
225 |
+
<li><code>[event-title]</code><span class="description"> - The event title (possible attributes: <code>html</code>, <code>markdown</code>)</span></li>
|
226 |
+
<li><code>[start-time]</code><span class="description"> - The event start time. Will use the time format specified in the above settings</span></li>
|
227 |
+
<li><code>[start-date]</code><span class="description"> - The event start date. Will use the date format specified in the above settings</span></li>
|
228 |
+
<li><code>[start-custom]</code><span class="description"> - The event start date / time. Will use the format specified in the <code>format</code> attribute (possible attributes: <code>format</code>)</span></li>
|
229 |
+
<li><code>[start-human]</code><span class="description"> - The difference between the start time of the event and the time now, in human-readable format, such as '1 hour', '4 days', '15 mins'</span></li>
|
230 |
+
<li><code>[end-time]</code><span class="description"> - The event end time. Will use the time format specified in the above settings</span></li>
|
231 |
+
<li><code>[end-date]</code><span class="description"> - The event end date. Will use the date format specified in the above settings</span></li>
|
232 |
+
<li><code>[end-custom]</code><span class="description"> - The event end date / time. Will use the format specified in the <code>format</code> attribute (possible attributes: <code>format</code>)</span></li>
|
233 |
+
<li><code>[end-human]</code><span class="description"> - The difference between the end time of the event and the time now, in human-readable format, such as '1 hour', '4 days', '15 mins'</span></li>
|
234 |
+
<li><code>[location]</code><span class="description"> - The event location (possible attributes: <code>html</code>, <code>markdown</code>)</span></li>
|
235 |
+
<li><code>[maps-link]…[/maps-link]</code><span class="description"> - Anything between the opening and closing shortcode tags (inlcuding further shortcodes) will be linked to Google Maps, using the event location as a search parameter (possible attributes: <code>newwindow</code>)</span></li>
|
236 |
+
<li><code>[description]</code><span class="description"> - The event description (possible attributes: <code>html</code>, <code>markdown</code>, <code>limit</code>)</span></li>
|
237 |
+
<li><code>[link]…[/link]</code><span class="description"> - Anything between the opening and closing shortcode tags (inlcuding further shortcodes) will be linked to the Google Calendar page for the event (possible attributes: <code>newwindow</code>)</span></li>
|
238 |
+
<li><code>[link-path]</code><span class="description"> - The raw URL to the Google Calendar page for the event</span></li>
|
239 |
+
</ul>
|
240 |
+
<h4>Feed information shortcodes:</h4>
|
241 |
+
<ul>
|
242 |
+
<li><code>[feed-title]</code><span class="description"> - The title of the feed from which the event comes</span></li>
|
243 |
+
<li><code>[feed-id]</code><span class="description"> - The ID of the feed from which the event comes</span></li>
|
244 |
+
</ul>
|
245 |
+
<h4>Conditional shortcodes:</h4>
|
246 |
+
<p class="description" style="margin-bottom:18px;">Anything entered between the opening and closing tags of each of the following shortcodes will only be displayed if its condition (below) is met.</p>
|
247 |
+
<ul>
|
248 |
+
<li><code>[if-all-day]…[/if-all-day]</code><span class="description"> - The event is an all-day event</span></li>
|
249 |
+
<li><code>[if-not-all-day]…[/if-not-all-day]</code><span class="description"> - The event is not an all-day event</span></li>
|
250 |
+
<li><code>[if-title]…[/if-title]</code><span class="description"> - The event has a title</span></li>
|
251 |
+
<li><code>[if-description]…[/if-description]</code><span class="description"> - The event has a description</span></li>
|
252 |
+
<li><code>[if-location]…[/if-location]</code><span class="description"> - The event has a location</span></li>
|
253 |
+
<li><code>[if-tooltip]…[/if-tooltip]</code><span class="description"> - The event is to be displayed in a tooltip (not a list)</span></li>
|
254 |
+
<li><code>[if-list]…[/if-list]</code><span class="description"> - The event is to be displayed in a list (not a tooltip)</span></li>
|
255 |
+
<li><code>[if-now]…[/if-now]</code><span class="description"> - The event is taking place now (after the start time, but before the end time)</span></li>
|
256 |
+
<li><code>[if-not-now]…[/if-not-now]</code><span class="description"> - The event is not taking place now (may have ended or not yet started)</span></li>
|
257 |
+
<li><code>[if-started]…[/if-started]</code><span class="description"> - The event has started (even if it has also ended)</span></li>
|
258 |
+
<li><code>[if-not-started]…[/if-not-started]</code><span class="description"> - The event has not started</span></li>
|
259 |
+
<li><code>[if-ended]…[/if-ended]</code><span class="description"> - The event has ended</span></li>
|
260 |
+
<li><code>[if-not-ended]…[/if-not-ended]</code><span class="description"> - The event has not ended (even if it hasn't started)</span></li>
|
261 |
+
<li><code>[if-first]…[/if-first]</code><span class="description"> - The event is the first of the day</span></li>
|
262 |
+
<li><code>[if-not-first]…[/if-not-first]</code><span class="description"> - The event is not the first of the day</span></li>
|
263 |
+
</ul>
|
264 |
+
<h4>Attributes:</h4>
|
265 |
+
<p class="description" style="margin-bottom:18px;">The possible attributes mentioned above are explained here:</p>
|
266 |
+
<ul>
|
267 |
+
<li><code>html</code><span class="description"> - Whether or not to parse HTML that has been entered in the relevant field. Can be <code>true</code> or <code>false</code></span></li>
|
268 |
+
<li><code>markdown</code><span class="description"> - Whether or not parse <a href="http://daringfireball.net/projects/markdown" target="_blank">Markdown</a> that has been entered in the relevant field. <a href="http://michelf.com/projects/php-markdown" target="_blank">PHP Markdown</a> must be installed for this to work. Can be <code>true</code> or <code>false</code></span></li>
|
269 |
+
<li><code>limit</code><span class="description"> - The word limit for the field. Should be specified as a positive integer</span></li>
|
270 |
+
<li><code>format</code><span class="description"> - The date / time format to use. Should specified as a <a href="http://php.net/manual/en/function.date.php" target="_blank">PHP date format</a> string</span></li>
|
271 |
+
<li><code>newwindow</code><span class="description"> - Whether or not the link should open in a new window / tab. Can be <code>true</code> or <code>false</code></span></li>
|
272 |
+
</ul>
|
273 |
+
<?php
|
274 |
+
}
|
275 |
+
|
276 |
+
//Simple display options
|
277 |
+
function gce_edit_simple_display_main_text(){
|
278 |
+
?>
|
279 |
+
<p class="gce-simple-display-options"><?php _e('You can use some HTML in the text fields, but ensure it is valid or things might go wonky. Text fields can be empty too.', GCE_TEXT_DOMAIN); ?></p>
|
280 |
<?php
|
281 |
}
|
282 |
|
admin/main.php
CHANGED
@@ -79,10 +79,17 @@
|
|
79 |
</tr><tr>
|
80 |
<th scope="row"><?php _e('Loading text', GCE_TEXT_DOMAIN); ?></th>
|
81 |
<td>
|
82 |
-
<span class="description"><?php _e('Text to display while calendar data is loading (on AJAX requests)', GCE_TEXT_DOMAIN); ?></span>
|
83 |
<br />
|
84 |
<input type="text" name="gce_general[loading]" value="<?php echo $options['loading']; ?>" />
|
85 |
</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
</tr>
|
87 |
</table>
|
88 |
|
79 |
</tr><tr>
|
80 |
<th scope="row"><?php _e('Loading text', GCE_TEXT_DOMAIN); ?></th>
|
81 |
<td>
|
82 |
+
<span class="description"><?php _e('Text to display while calendar data is loading (on AJAX requests).', GCE_TEXT_DOMAIN); ?></span>
|
83 |
<br />
|
84 |
<input type="text" name="gce_general[loading]" value="<?php echo $options['loading']; ?>" />
|
85 |
</td>
|
86 |
+
</tr><tr>
|
87 |
+
<th scope="row"><?php _e('Error message', GCE_TEXT_DOMAIN); ?></th>
|
88 |
+
<td>
|
89 |
+
<span class="description"><?php _e('An error message to display to non-admin users if events cannot be displayed for any reason (admins will see a message indicating the cause of the problem).', GCE_TEXT_DOMAIN); ?></span>
|
90 |
+
<br />
|
91 |
+
<input type="text" name="gce_general[error]" value="<?php echo $options['error']; ?>" size="100" />
|
92 |
+
</td>
|
93 |
</tr>
|
94 |
</table>
|
95 |
|
admin/timezone-choices.php
CHANGED
@@ -4,425 +4,425 @@ function gce_get_timezone_choices(){
|
|
4 |
<select name="gce_options[timezone]">
|
5 |
<option value="default">Default</option>
|
6 |
<optgroup label="Africa">
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
</optgroup>
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
</optgroup>
|
199 |
<optgroup label="Antarctica">
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
</optgroup>
|
211 |
<optgroup label="Arctic">
|
212 |
-
|
213 |
</optgroup>
|
214 |
<optgroup label="Asia">
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
</optgroup>
|
291 |
<optgroup label="Atlantic">
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
</optgroup>
|
303 |
<optgroup label="Australia">
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
</optgroup>
|
317 |
<optgroup label="Europe">
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
</optgroup>
|
374 |
<optgroup label="Indian">
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
</optgroup>
|
387 |
<optgroup label="Pacific">
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
</optgroup>
|
427 |
</select>';
|
428 |
}
|
4 |
<select name="gce_options[timezone]">
|
5 |
<option value="default">Default</option>
|
6 |
<optgroup label="Africa">
|
7 |
+
<option value="Africa/Abidjan">Abidjan</option>
|
8 |
+
<option value="Africa/Accra">Accra</option>
|
9 |
+
<option value="Africa/Addis_Ababa">Addis Ababa</option>
|
10 |
+
<option value="Africa/Algiers">Algiers</option>
|
11 |
+
<option value="Africa/Asmara">Asmara</option>
|
12 |
+
<option value="Africa/Bamako">Bamako</option>
|
13 |
+
<option value="Africa/Bangui">Bangui</option>
|
14 |
+
<option value="Africa/Banjul">Banjul</option>
|
15 |
+
<option value="Africa/Bissau">Bissau</option>
|
16 |
+
<option value="Africa/Blantyre">Blantyre</option>
|
17 |
+
<option value="Africa/Brazzaville">Brazzaville</option>
|
18 |
+
<option value="Africa/Bujumbura">Bujumbura</option>
|
19 |
+
<option value="Africa/Cairo">Cairo</option>
|
20 |
+
<option value="Africa/Casablanca">Casablanca</option>
|
21 |
+
<option value="Africa/Ceuta">Ceuta</option>
|
22 |
+
<option value="Africa/Conakry">Conakry</option>
|
23 |
+
<option value="Africa/Dakar">Dakar</option>
|
24 |
+
<option value="Africa/Dar_es_Salaam">Dar es Salaam</option>
|
25 |
+
<option value="Africa/Djibouti">Djibouti</option>
|
26 |
+
<option value="Africa/Douala">Douala</option>
|
27 |
+
<option value="Africa/El_Aaiun">El Aaiun</option>
|
28 |
+
<option value="Africa/Freetown">Freetown</option>
|
29 |
+
<option value="Africa/Gaborone">Gaborone</option>
|
30 |
+
<option value="Africa/Harare">Harare</option>
|
31 |
+
<option value="Africa/Johannesburg">Johannesburg</option>
|
32 |
+
<option value="Africa/Kampala">Kampala</option>
|
33 |
+
<option value="Africa/Khartoum">Khartoum</option>
|
34 |
+
<option value="Africa/Kigali">Kigali</option>
|
35 |
+
<option value="Africa/Kinshasa">Kinshasa</option>
|
36 |
+
<option value="Africa/Lagos">Lagos</option>
|
37 |
+
<option value="Africa/Libreville">Libreville</option>
|
38 |
+
<option value="Africa/Lome">Lome</option>
|
39 |
+
<option value="Africa/Luanda">Luanda</option>
|
40 |
+
<option value="Africa/Lubumbashi">Lubumbashi</option>
|
41 |
+
<option value="Africa/Lusaka">Lusaka</option>
|
42 |
+
<option value="Africa/Malabo">Malabo</option>
|
43 |
+
<option value="Africa/Maputo">Maputo</option>
|
44 |
+
<option value="Africa/Maseru">Maseru</option>
|
45 |
+
<option value="Africa/Mbabane">Mbabane</option>
|
46 |
+
<option value="Africa/Mogadishu">Mogadishu</option>
|
47 |
+
<option value="Africa/Monrovia">Monrovia</option>
|
48 |
+
<option value="Africa/Nairobi">Nairobi</option>
|
49 |
+
<option value="Africa/Ndjamena">Ndjamena</option>
|
50 |
+
<option value="Africa/Niamey">Niamey</option>
|
51 |
+
<option value="Africa/Nouakchott">Nouakchott</option>
|
52 |
+
<option value="Africa/Ouagadougou">Ouagadougou</option>
|
53 |
+
<option value="Africa/Porto-Novo">Porto-Novo</option>
|
54 |
+
<option value="Africa/Sao_Tome">Sao Tome</option>
|
55 |
+
<option value="Africa/Tripoli">Tripoli</option>
|
56 |
+
<option value="Africa/Tunis">Tunis</option>
|
57 |
+
<option value="Africa/Windhoek">Windhoek</option>
|
58 |
</optgroup>
|
59 |
+
<optgroup label="America">
|
60 |
+
<option value="America/Adak">Adak</option>
|
61 |
+
<option value="America/Anchorage">Anchorage</option>
|
62 |
+
<option value="America/Anguilla">Anguilla</option>
|
63 |
+
<option value="America/Antigua">Antigua</option>
|
64 |
+
<option value="America/Araguaina">Araguaina</option>
|
65 |
+
<option value="America/Argentina/Buenos_Aires">Argentina - Buenos Aires</option>
|
66 |
+
<option value="America/Argentina/Catamarca">Argentina - Catamarca</option>
|
67 |
+
<option value="America/Argentina/Cordoba">Argentina - Cordoba</option>
|
68 |
+
<option value="America/Argentina/Jujuy">Argentina - Jujuy</option>
|
69 |
+
<option value="America/Argentina/La_Rioja">Argentina - La Rioja</option>
|
70 |
+
<option value="America/Argentina/Mendoza">Argentina - Mendoza</option>
|
71 |
+
<option value="America/Argentina/Rio_Gallegos">Argentina - Rio Gallegos</option>
|
72 |
+
<option value="America/Argentina/Salta">Argentina - Salta</option>
|
73 |
+
<option value="America/Argentina/San_Juan">Argentina - San Juan</option>
|
74 |
+
<option value="America/Argentina/San_Luis">Argentina - San Luis</option>
|
75 |
+
<option value="America/Argentina/Tucuman">Argentina - Tucuman</option>
|
76 |
+
<option value="America/Argentina/Ushuaia">Argentina - Ushuaia</option>
|
77 |
+
<option value="America/Aruba">Aruba</option>
|
78 |
+
<option value="America/Asuncion">Asuncion</option>
|
79 |
+
<option value="America/Atikokan">Atikokan</option>
|
80 |
+
<option value="America/Bahia">Bahia</option>
|
81 |
+
<option value="America/Barbados">Barbados</option>
|
82 |
+
<option value="America/Belem">Belem</option>
|
83 |
+
<option value="America/Belize">Belize</option>
|
84 |
+
<option value="America/Blanc-Sablon">Blanc-Sablon</option>
|
85 |
+
<option value="America/Boa_Vista">Boa Vista</option>
|
86 |
+
<option value="America/Bogota">Bogota</option>
|
87 |
+
<option value="America/Boise">Boise</option>
|
88 |
+
<option value="America/Cambridge_Bay">Cambridge Bay</option>
|
89 |
+
<option value="America/Campo_Grande">Campo Grande</option>
|
90 |
+
<option value="America/Cancun">Cancun</option>
|
91 |
+
<option value="America/Caracas">Caracas</option>
|
92 |
+
<option value="America/Cayenne">Cayenne</option>
|
93 |
+
<option value="America/Cayman">Cayman</option>
|
94 |
+
<option value="America/Chicago">Chicago</option>
|
95 |
+
<option value="America/Chihuahua">Chihuahua</option>
|
96 |
+
<option value="America/Costa_Rica">Costa Rica</option>
|
97 |
+
<option value="America/Cuiaba">Cuiaba</option>
|
98 |
+
<option value="America/Curacao">Curacao</option>
|
99 |
+
<option value="America/Danmarkshavn">Danmarkshavn</option>
|
100 |
+
<option value="America/Dawson">Dawson</option>
|
101 |
+
<option value="America/Dawson_Creek">Dawson Creek</option>
|
102 |
+
<option value="America/Denver">Denver</option>
|
103 |
+
<option value="America/Detroit">Detroit</option>
|
104 |
+
<option value="America/Dominica">Dominica</option>
|
105 |
+
<option value="America/Edmonton">Edmonton</option>
|
106 |
+
<option value="America/Eirunepe">Eirunepe</option>
|
107 |
+
<option value="America/El_Salvador">El Salvador</option>
|
108 |
+
<option value="America/Fortaleza">Fortaleza</option>
|
109 |
+
<option value="America/Glace_Bay">Glace Bay</option>
|
110 |
+
<option value="America/Godthab">Godthab</option>
|
111 |
+
<option value="America/Goose_Bay">Goose Bay</option>
|
112 |
+
<option value="America/Grand_Turk">Grand Turk</option>
|
113 |
+
<option value="America/Grenada">Grenada</option>
|
114 |
+
<option value="America/Guadeloupe">Guadeloupe</option>
|
115 |
+
<option value="America/Guatemala">Guatemala</option>
|
116 |
+
<option value="America/Guayaquil">Guayaquil</option>
|
117 |
+
<option value="America/Guyana">Guyana</option>
|
118 |
+
<option value="America/Halifax">Halifax</option>
|
119 |
+
<option value="America/Havana">Havana</option>
|
120 |
+
<option value="America/Hermosillo">Hermosillo</option>
|
121 |
+
<option value="America/Indiana/Indianapolis">Indiana - Indianapolis</option>
|
122 |
+
<option value="America/Indiana/Knox">Indiana - Knox</option>
|
123 |
+
<option value="America/Indiana/Marengo">Indiana - Marengo</option>
|
124 |
+
<option value="America/Indiana/Petersburg">Indiana - Petersburg</option>
|
125 |
+
<option value="America/Indiana/Tell_City">Indiana - Tell City</option>
|
126 |
+
<option value="America/Indiana/Vevay">Indiana - Vevay</option>
|
127 |
+
<option value="America/Indiana/Vincennes">Indiana - Vincennes</option>
|
128 |
+
<option value="America/Indiana/Winamac">Indiana - Winamac</option>
|
129 |
+
<option value="America/Inuvik">Inuvik</option>
|
130 |
+
<option value="America/Iqaluit">Iqaluit</option>
|
131 |
+
<option value="America/Jamaica">Jamaica</option>
|
132 |
+
<option value="America/Juneau">Juneau</option>
|
133 |
+
<option value="America/Kentucky/Louisville">Kentucky - Louisville</option>
|
134 |
+
<option value="America/Kentucky/Monticello">Kentucky - Monticello</option>
|
135 |
+
<option value="America/La_Paz">La Paz</option>
|
136 |
+
<option value="America/Lima">Lima</option>
|
137 |
+
<option value="America/Los_Angeles">Los Angeles</option>
|
138 |
+
<option value="America/Maceio">Maceio</option>
|
139 |
+
<option value="America/Managua">Managua</option>
|
140 |
+
<option value="America/Manaus">Manaus</option>
|
141 |
+
<option value="America/Marigot">Marigot</option>
|
142 |
+
<option value="America/Martinique">Martinique</option>
|
143 |
+
<option value="America/Mazatlan">Mazatlan</option>
|
144 |
+
<option value="America/Menominee">Menominee</option>
|
145 |
+
<option value="America/Merida">Merida</option>
|
146 |
+
<option value="America/Mexico_City">Mexico City</option>
|
147 |
+
<option value="America/Miquelon">Miquelon</option>
|
148 |
+
<option value="America/Moncton">Moncton</option>
|
149 |
+
<option value="America/Monterrey">Monterrey</option>
|
150 |
+
<option value="America/Montevideo">Montevideo</option>
|
151 |
+
<option value="America/Montreal">Montreal</option>
|
152 |
+
<option value="America/Montserrat">Montserrat</option>
|
153 |
+
<option value="America/Nassau">Nassau</option>
|
154 |
+
<option value="America/New_York">New York</option>
|
155 |
+
<option value="America/Nipigon">Nipigon</option>
|
156 |
+
<option value="America/Nome">Nome</option>
|
157 |
+
<option value="America/Noronha">Noronha</option>
|
158 |
+
<option value="America/North_Dakota/Center">North Dakota - Center</option>
|
159 |
+
<option value="America/North_Dakota/New_Salem">North Dakota - New Salem</option>
|
160 |
+
<option value="America/Panama">Panama</option>
|
161 |
+
<option value="America/Pangnirtung">Pangnirtung</option>
|
162 |
+
<option value="America/Paramaribo">Paramaribo</option>
|
163 |
+
<option value="America/Phoenix">Phoenix</option>
|
164 |
+
<option value="America/Port-au-Prince">Port-au-Prince</option>
|
165 |
+
<option value="America/Port_of_Spain">Port of Spain</option>
|
166 |
+
<option value="America/Porto_Velho">Porto Velho</option>
|
167 |
+
<option value="America/Puerto_Rico">Puerto Rico</option>
|
168 |
+
<option value="America/Rainy_River">Rainy River</option>
|
169 |
+
<option value="America/Rankin_Inlet">Rankin Inlet</option>
|
170 |
+
<option value="America/Recife">Recife</option>
|
171 |
+
<option value="America/Regina">Regina</option>
|
172 |
+
<option value="America/Resolute">Resolute</option>
|
173 |
+
<option value="America/Rio_Branco">Rio Branco</option>
|
174 |
+
<option value="America/Santarem">Santarem</option>
|
175 |
+
<option value="America/Santiago">Santiago</option>
|
176 |
+
<option value="America/Santo_Domingo">Santo Domingo</option>
|
177 |
+
<option value="America/Sao_Paulo">Sao Paulo</option>
|
178 |
+
<option value="America/Scoresbysund">Scoresbysund</option>
|
179 |
+
<option value="America/Shiprock">Shiprock</option>
|
180 |
+
<option value="America/St_Barthelemy">St Barthelemy</option>
|
181 |
+
<option value="America/St_Johns">St Johns</option>
|
182 |
+
<option value="America/St_Kitts">St Kitts</option>
|
183 |
+
<option value="America/St_Lucia">St Lucia</option>
|
184 |
+
<option value="America/St_Thomas">St Thomas</option>
|
185 |
+
<option value="America/St_Vincent">St Vincent</option>
|
186 |
+
<option value="America/Swift_Current">Swift Current</option>
|
187 |
+
<option value="America/Tegucigalpa">Tegucigalpa</option>
|
188 |
+
<option value="America/Thule">Thule</option>
|
189 |
+
<option value="America/Thunder_Bay">Thunder Bay</option>
|
190 |
+
<option value="America/Tijuana">Tijuana</option>
|
191 |
+
<option value="America/Toronto">Toronto</option>
|
192 |
+
<option value="America/Tortola">Tortola</option>
|
193 |
+
<option value="America/Vancouver">Vancouver</option>
|
194 |
+
<option value="America/Whitehorse">Whitehorse</option>
|
195 |
+
<option value="America/Winnipeg">Winnipeg</option>
|
196 |
+
<option value="America/Yakutat">Yakutat</option>
|
197 |
+
<option value="America/Yellowknife">Yellowknife</option>
|
198 |
</optgroup>
|
199 |
<optgroup label="Antarctica">
|
200 |
+
<option value="Antarctica/Casey">Casey</option>
|
201 |
+
<option value="Antarctica/Davis">Davis</option>
|
202 |
+
<option value="Antarctica/DumontDUrville">DumontDUrville</option>
|
203 |
+
<option value="Antarctica/Mawson">Mawson</option>
|
204 |
+
<option value="Antarctica/McMurdo">McMurdo</option>
|
205 |
+
<option value="Antarctica/Palmer">Palmer</option>
|
206 |
+
<option value="Antarctica/Rothera">Rothera</option>
|
207 |
+
<option value="Antarctica/South_Pole">South Pole</option>
|
208 |
+
<option value="Antarctica/Syowa">Syowa</option>
|
209 |
+
<option value="Antarctica/Vostok">Vostok</option>
|
210 |
</optgroup>
|
211 |
<optgroup label="Arctic">
|
212 |
+
<option value="Arctic/Longyearbyen">Longyearbyen</option>
|
213 |
</optgroup>
|
214 |
<optgroup label="Asia">
|
215 |
+
<option value="Asia/Aden">Aden</option>
|
216 |
+
<option value="Asia/Almaty">Almaty</option>
|
217 |
+
<option value="Asia/Amman">Amman</option>
|
218 |
+
<option value="Asia/Anadyr">Anadyr</option>
|
219 |
+
<option value="Asia/Aqtau">Aqtau</option>
|
220 |
+
<option value="Asia/Aqtobe">Aqtobe</option>
|
221 |
+
<option value="Asia/Ashgabat">Ashgabat</option>
|
222 |
+
<option value="Asia/Baghdad">Baghdad</option>
|
223 |
+
<option value="Asia/Bahrain">Bahrain</option>
|
224 |
+
<option value="Asia/Baku">Baku</option>
|
225 |
+
<option value="Asia/Bangkok">Bangkok</option>
|
226 |
+
<option value="Asia/Beirut">Beirut</option>
|
227 |
+
<option value="Asia/Bishkek">Bishkek</option>
|
228 |
+
<option value="Asia/Brunei">Brunei</option>
|
229 |
+
<option value="Asia/Choibalsan">Choibalsan</option>
|
230 |
+
<option value="Asia/Chongqing">Chongqing</option>
|
231 |
+
<option value="Asia/Colombo">Colombo</option>
|
232 |
+
<option value="Asia/Damascus">Damascus</option>
|
233 |
+
<option value="Asia/Dhaka">Dhaka</option>
|
234 |
+
<option value="Asia/Dili">Dili</option>
|
235 |
+
<option value="Asia/Dubai">Dubai</option>
|
236 |
+
<option value="Asia/Dushanbe">Dushanbe</option>
|
237 |
+
<option value="Asia/Gaza">Gaza</option>
|
238 |
+
<option value="Asia/Harbin">Harbin</option>
|
239 |
+
<option value="Asia/Ho_Chi_Minh">Ho Chi Minh</option>
|
240 |
+
<option value="Asia/Hong_Kong">Hong Kong</option>
|
241 |
+
<option value="Asia/Hovd">Hovd</option>
|
242 |
+
<option value="Asia/Irkutsk">Irkutsk</option>
|
243 |
+
<option value="Asia/Jakarta">Jakarta</option>
|
244 |
+
<option value="Asia/Jayapura">Jayapura</option>
|
245 |
+
<option value="Asia/Jerusalem">Jerusalem</option>
|
246 |
+
<option value="Asia/Kabul">Kabul</option>
|
247 |
+
<option value="Asia/Kamchatka">Kamchatka</option>
|
248 |
+
<option value="Asia/Karachi">Karachi</option>
|
249 |
+
<option value="Asia/Kashgar">Kashgar</option>
|
250 |
+
<option value="Asia/Kathmandu">Kathmandu</option>
|
251 |
+
<option value="Asia/Kolkata">Kolkata</option>
|
252 |
+
<option value="Asia/Krasnoyarsk">Krasnoyarsk</option>
|
253 |
+
<option value="Asia/Kuala_Lumpur">Kuala Lumpur</option>
|
254 |
+
<option value="Asia/Kuching">Kuching</option>
|
255 |
+
<option value="Asia/Kuwait">Kuwait</option>
|
256 |
+
<option value="Asia/Macau">Macau</option>
|
257 |
+
<option value="Asia/Magadan">Magadan</option>
|
258 |
+
<option value="Asia/Makassar">Makassar</option>
|
259 |
+
<option value="Asia/Manila">Manila</option>
|
260 |
+
<option value="Asia/Muscat">Muscat</option>
|
261 |
+
<option value="Asia/Nicosia">Nicosia</option>
|
262 |
+
<option value="Asia/Novosibirsk">Novosibirsk</option>
|
263 |
+
<option value="Asia/Omsk">Omsk</option>
|
264 |
+
<option value="Asia/Oral">Oral</option>
|
265 |
+
<option value="Asia/Phnom_Penh">Phnom Penh</option>
|
266 |
+
<option value="Asia/Pontianak">Pontianak</option>
|
267 |
+
<option value="Asia/Pyongyang">Pyongyang</option>
|
268 |
+
<option value="Asia/Qatar">Qatar</option>
|
269 |
+
<option value="Asia/Qyzylorda">Qyzylorda</option>
|
270 |
+
<option value="Asia/Rangoon">Rangoon</option>
|
271 |
+
<option value="Asia/Riyadh">Riyadh</option>
|
272 |
+
<option value="Asia/Sakhalin">Sakhalin</option>
|
273 |
+
<option value="Asia/Samarkand">Samarkand</option>
|
274 |
+
<option value="Asia/Seoul">Seoul</option>
|
275 |
+
<option value="Asia/Shanghai">Shanghai</option>
|
276 |
+
<option value="Asia/Singapore">Singapore</option>
|
277 |
+
<option value="Asia/Taipei">Taipei</option>
|
278 |
+
<option value="Asia/Tashkent">Tashkent</option>
|
279 |
+
<option value="Asia/Tbilisi">Tbilisi</option>
|
280 |
+
<option value="Asia/Tehran">Tehran</option>
|
281 |
+
<option value="Asia/Thimphu">Thimphu</option>
|
282 |
+
<option value="Asia/Tokyo">Tokyo</option>
|
283 |
+
<option value="Asia/Ulaanbaatar">Ulaanbaatar</option>
|
284 |
+
<option value="Asia/Urumqi">Urumqi</option>
|
285 |
+
<option value="Asia/Vientiane">Vientiane</option>
|
286 |
+
<option value="Asia/Vladivostok">Vladivostok</option>
|
287 |
+
<option value="Asia/Yakutsk">Yakutsk</option>
|
288 |
+
<option value="Asia/Yekaterinburg">Yekaterinburg</option>
|
289 |
+
<option value="Asia/Yerevan">Yerevan</option>
|
290 |
</optgroup>
|
291 |
<optgroup label="Atlantic">
|
292 |
+
<option value="Atlantic/Azores">Azores</option>
|
293 |
+
<option value="Atlantic/Bermuda">Bermuda</option>
|
294 |
+
<option value="Atlantic/Canary">Canary</option>
|
295 |
+
<option value="Atlantic/Cape_Verde">Cape Verde</option>
|
296 |
+
<option value="Atlantic/Faroe">Faroe</option>
|
297 |
+
<option value="Atlantic/Madeira">Madeira</option>
|
298 |
+
<option value="Atlantic/Reykjavik">Reykjavik</option>
|
299 |
+
<option value="Atlantic/South_Georgia">South Georgia</option>
|
300 |
+
<option value="Atlantic/Stanley">Stanley</option>
|
301 |
+
<option value="Atlantic/St_Helena">St Helena</option>
|
302 |
</optgroup>
|
303 |
<optgroup label="Australia">
|
304 |
+
<option value="Australia/Adelaide">Adelaide</option>
|
305 |
+
<option value="Australia/Brisbane">Brisbane</option>
|
306 |
+
<option value="Australia/Broken_Hill">Broken Hill</option>
|
307 |
+
<option value="Australia/Currie">Currie</option>
|
308 |
+
<option value="Australia/Darwin">Darwin</option>
|
309 |
+
<option value="Australia/Eucla">Eucla</option>
|
310 |
+
<option value="Australia/Hobart">Hobart</option>
|
311 |
+
<option value="Australia/Lindeman">Lindeman</option>
|
312 |
+
<option value="Australia/Lord_Howe">Lord Howe</option>
|
313 |
+
<option value="Australia/Melbourne">Melbourne</option>
|
314 |
+
<option value="Australia/Perth">Perth</option>
|
315 |
+
<option value="Australia/Sydney">Sydney</option>
|
316 |
</optgroup>
|
317 |
<optgroup label="Europe">
|
318 |
+
<option value="Europe/Amsterdam">Amsterdam</option>
|
319 |
+
<option value="Europe/Andorra">Andorra</option>
|
320 |
+
<option value="Europe/Athens">Athens</option>
|
321 |
+
<option value="Europe/Belgrade">Belgrade</option>
|
322 |
+
<option value="Europe/Berlin">Berlin</option>
|
323 |
+
<option value="Europe/Bratislava">Bratislava</option>
|
324 |
+
<option value="Europe/Brussels">Brussels</option>
|
325 |
+
<option value="Europe/Bucharest">Bucharest</option>
|
326 |
+
<option value="Europe/Budapest">Budapest</option>
|
327 |
+
<option value="Europe/Chisinau">Chisinau</option>
|
328 |
+
<option value="Europe/Copenhagen">Copenhagen</option>
|
329 |
+
<option value="Europe/Dublin">Dublin</option>
|
330 |
+
<option value="Europe/Gibraltar">Gibraltar</option>
|
331 |
+
<option value="Europe/Guernsey">Guernsey</option>
|
332 |
+
<option value="Europe/Helsinki">Helsinki</option>
|
333 |
+
<option value="Europe/Isle_of_Man">Isle of Man</option>
|
334 |
+
<option value="Europe/Istanbul">Istanbul</option>
|
335 |
+
<option value="Europe/Jersey">Jersey</option>
|
336 |
+
<option value="Europe/Kaliningrad">Kaliningrad</option>
|
337 |
+
<option value="Europe/Kiev">Kiev</option>
|
338 |
+
<option value="Europe/Lisbon">Lisbon</option>
|
339 |
+
<option value="Europe/Ljubljana">Ljubljana</option>
|
340 |
+
<option value="Europe/London">London</option>
|
341 |
+
<option value="Europe/Luxembourg">Luxembourg</option>
|
342 |
+
<option value="Europe/Madrid">Madrid</option>
|
343 |
+
<option value="Europe/Malta">Malta</option>
|
344 |
+
<option value="Europe/Mariehamn">Mariehamn</option>
|
345 |
+
<option value="Europe/Minsk">Minsk</option>
|
346 |
+
<option value="Europe/Monaco">Monaco</option>
|
347 |
+
<option value="Europe/Moscow">Moscow</option>
|
348 |
+
<option value="Europe/Oslo">Oslo</option>
|
349 |
+
<option value="Europe/Paris">Paris</option>
|
350 |
+
<option value="Europe/Podgorica">Podgorica</option>
|
351 |
+
<option value="Europe/Prague">Prague</option>
|
352 |
+
<option value="Europe/Riga">Riga</option>
|
353 |
+
<option value="Europe/Rome">Rome</option>
|
354 |
+
<option value="Europe/Samara">Samara</option>
|
355 |
+
<option value="Europe/San_Marino">San Marino</option>
|
356 |
+
<option value="Europe/Sarajevo">Sarajevo</option>
|
357 |
+
<option value="Europe/Simferopol">Simferopol</option>
|
358 |
+
<option value="Europe/Skopje">Skopje</option>
|
359 |
+
<option value="Europe/Sofia">Sofia</option>
|
360 |
+
<option value="Europe/Stockholm">Stockholm</option>
|
361 |
+
<option value="Europe/Tallinn">Tallinn</option>
|
362 |
+
<option value="Europe/Tirane">Tirane</option>
|
363 |
+
<option value="Europe/Uzhgorod">Uzhgorod</option>
|
364 |
+
<option value="Europe/Vaduz">Vaduz</option>
|
365 |
+
<option value="Europe/Vatican">Vatican</option>
|
366 |
+
<option value="Europe/Vienna">Vienna</option>
|
367 |
+
<option value="Europe/Vilnius">Vilnius</option>
|
368 |
+
<option value="Europe/Volgograd">Volgograd</option>
|
369 |
+
<option value="Europe/Warsaw">Warsaw</option>
|
370 |
+
<option value="Europe/Zagreb">Zagreb</option>
|
371 |
+
<option value="Europe/Zaporozhye">Zaporozhye</option>
|
372 |
+
<option value="Europe/Zurich">Zurich</option>
|
373 |
</optgroup>
|
374 |
<optgroup label="Indian">
|
375 |
+
<option value="Indian/Antananarivo">Antananarivo</option>
|
376 |
+
<option value="Indian/Chagos">Chagos</option>
|
377 |
+
<option value="Indian/Christmas">Christmas</option>
|
378 |
+
<option value="Indian/Cocos">Cocos</option>
|
379 |
+
<option value="Indian/Comoro">Comoro</option>
|
380 |
+
<option value="Indian/Kerguelen">Kerguelen</option>
|
381 |
+
<option value="Indian/Mahe">Mahe</option>
|
382 |
+
<option value="Indian/Maldives">Maldives</option>
|
383 |
+
<option value="Indian/Mauritius">Mauritius</option>
|
384 |
+
<option value="Indian/Mayotte">Mayotte</option>
|
385 |
+
<option value="Indian/Reunion">Reunion</option>
|
386 |
</optgroup>
|
387 |
<optgroup label="Pacific">
|
388 |
+
<option value="Pacific/Apia">Apia</option>
|
389 |
+
<option value="Pacific/Auckland">Auckland</option>
|
390 |
+
<option value="Pacific/Chatham">Chatham</option>
|
391 |
+
<option value="Pacific/Easter">Easter</option>
|
392 |
+
<option value="Pacific/Efate">Efate</option>
|
393 |
+
<option value="Pacific/Enderbury">Enderbury</option>
|
394 |
+
<option value="Pacific/Fakaofo">Fakaofo</option>
|
395 |
+
<option value="Pacific/Fiji">Fiji</option>
|
396 |
+
<option value="Pacific/Funafuti">Funafuti</option>
|
397 |
+
<option value="Pacific/Galapagos">Galapagos</option>
|
398 |
+
<option value="Pacific/Gambier">Gambier</option>
|
399 |
+
<option value="Pacific/Guadalcanal">Guadalcanal</option>
|
400 |
+
<option value="Pacific/Guam">Guam</option>
|
401 |
+
<option value="Pacific/Honolulu">Honolulu</option>
|
402 |
+
<option value="Pacific/Johnston">Johnston</option>
|
403 |
+
<option value="Pacific/Kiritimati">Kiritimati</option>
|
404 |
+
<option value="Pacific/Kosrae">Kosrae</option>
|
405 |
+
<option value="Pacific/Kwajalein">Kwajalein</option>
|
406 |
+
<option value="Pacific/Majuro">Majuro</option>
|
407 |
+
<option value="Pacific/Marquesas">Marquesas</option>
|
408 |
+
<option value="Pacific/Midway">Midway</option>
|
409 |
+
<option value="Pacific/Nauru">Nauru</option>
|
410 |
+
<option value="Pacific/Niue">Niue</option>
|
411 |
+
<option value="Pacific/Norfolk">Norfolk</option>
|
412 |
+
<option value="Pacific/Noumea">Noumea</option>
|
413 |
+
<option value="Pacific/Pago_Pago">Pago Pago</option>
|
414 |
+
<option value="Pacific/Palau">Palau</option>
|
415 |
+
<option value="Pacific/Pitcairn">Pitcairn</option>
|
416 |
+
<option value="Pacific/Ponape">Ponape</option>
|
417 |
+
<option value="Pacific/Port_Moresby">Port Moresby</option>
|
418 |
+
<option value="Pacific/Rarotonga">Rarotonga</option>
|
419 |
+
<option value="Pacific/Saipan">Saipan</option>
|
420 |
+
<option value="Pacific/Tahiti">Tahiti</option>
|
421 |
+
<option value="Pacific/Tarawa">Tarawa</option>
|
422 |
+
<option value="Pacific/Tongatapu">Tongatapu</option>
|
423 |
+
<option value="Pacific/Truk">Truk</option>
|
424 |
+
<option value="Pacific/Wake">Wake</option>
|
425 |
+
<option value="Pacific/Wallis">Wallis</option>
|
426 |
</optgroup>
|
427 |
</select>';
|
428 |
}
|
css/gce-style.css
CHANGED
@@ -220,10 +220,4 @@
|
|
220 |
font-weight:bold;
|
221 |
}
|
222 |
|
223 |
-
/* Also available: .gce-tooltip-start, .gce-tooltip-end, .gce-tooltip-loc, .gce-tooltip-desc, .gce-tooltip-link */
|
224 |
-
|
225 |
-
|
226 |
-
/* Sort of fixes weird list stuff in old default theme */
|
227 |
-
.entry .gce-page-list li:before, #sidebar .gce-widget-list ul li:before {
|
228 |
-
content:none;
|
229 |
-
}
|
220 |
font-weight:bold;
|
221 |
}
|
222 |
|
223 |
+
/* Also available: .gce-tooltip-start, .gce-tooltip-end, .gce-tooltip-loc, .gce-tooltip-desc, .gce-tooltip-link */
|
|
|
|
|
|
|
|
|
|
|
|
google-calendar-events.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Google Calendar Events
|
4 |
Plugin URI: http://www.rhanney.co.uk/plugins/google-calendar-events
|
5 |
Description: Parses Google Calendar feeds and displays the events as a calendar grid or list on a page, post or widget.
|
6 |
-
Version: 0.
|
7 |
Author: Ross Hanney
|
8 |
Author URI: http://www.rhanney.co.uk
|
9 |
License: GPL2
|
@@ -37,12 +37,6 @@ require_once 'inc/gce-parser.php';
|
|
37 |
|
38 |
if(!class_exists('Google_Calendar_Events')){
|
39 |
class Google_Calendar_Events{
|
40 |
-
//PHP 4 constructor
|
41 |
-
function Google_Calendar_Events(){
|
42 |
-
$this->__construct();
|
43 |
-
}
|
44 |
-
|
45 |
-
//PHP 5 constructor
|
46 |
function __construct(){
|
47 |
add_action('activate_google-calendar-events/google-calendar-events.php', array($this, 'activate_plugin'));
|
48 |
add_action('init', array($this, 'init_plugin'));
|
@@ -55,6 +49,7 @@ if(!class_exists('Google_Calendar_Events')){
|
|
55 |
add_action('wp_ajax_nopriv_gce_ajax', array($this, 'gce_ajax'));
|
56 |
add_filter('plugin_action_links_' . plugin_basename(__FILE__), array($this, 'add_settings_link'));
|
57 |
add_shortcode('google-calendar-events', array($this, 'shortcode_handler'));
|
|
|
58 |
}
|
59 |
|
60 |
//If any new options have been added between versions, this will update any saved feeds with defaults for new options (shouldn't overwrite anything saved)
|
@@ -72,9 +67,11 @@ if(!class_exists('Google_Calendar_Events')){
|
|
72 |
'id' => 1,
|
73 |
'title' => '',
|
74 |
'url' => '',
|
75 |
-
'
|
|
|
|
|
|
|
76 |
'max_events' => 25,
|
77 |
-
'day_limit' => '',
|
78 |
'date_format' => '',
|
79 |
'time_format' => '',
|
80 |
'timezone' => 'default',
|
@@ -92,9 +89,18 @@ if(!class_exists('Google_Calendar_Events')){
|
|
92 |
'display_desc_limit' => '',
|
93 |
'display_link_text' => 'More details',
|
94 |
'display_link_target' => '',
|
95 |
-
'display_separator' => ', '
|
|
|
|
|
96 |
);
|
97 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
//Update old display_start / display_end values
|
99 |
if(!isset($saved_feed_options['display_start']))
|
100 |
$saved_feed_options['display_start'] = 'none';
|
@@ -124,7 +130,8 @@ if(!class_exists('Google_Calendar_Events')){
|
|
124 |
$defaults = array(
|
125 |
'stylesheet' => '',
|
126 |
'javascript' => false,
|
127 |
-
'loading' => 'Loading...'
|
|
|
128 |
);
|
129 |
|
130 |
$old_stylesheet_option = get_option('gce_stylesheet');
|
@@ -139,6 +146,7 @@ if(!class_exists('Google_Calendar_Events')){
|
|
139 |
|
140 |
if(isset($options['javascript'])) $defaults['javascript'] = $options['javascript'];
|
141 |
if(isset($options['loading'])) $defaults['loading'] = $options['loading'];
|
|
|
142 |
|
143 |
//Save general options
|
144 |
update_option(GCE_GENERAL_OPTIONS_NAME, $defaults);
|
@@ -163,33 +171,22 @@ if(!class_exists('Google_Calendar_Events')){
|
|
163 |
|
164 |
//Prints admin settings page
|
165 |
function admin_page(){
|
166 |
-
|
167 |
-
if(isset($_GET['updated'])){
|
168 |
-
switch($_GET['updated']){
|
169 |
-
case 'added':
|
170 |
-
?><div class="updated"><p><strong><?php _e('New Feed Added Successfully.', GCE_TEXT_DOMAIN); ?></strong></p></div><?php
|
171 |
-
break;
|
172 |
-
case 'edited':
|
173 |
-
?><div class="updated"><p><strong><?php _e('Feed Details Updated Successfully.', GCE_TEXT_DOMAIN); ?></strong></p></div><?php
|
174 |
-
break;
|
175 |
-
case 'deleted':
|
176 |
-
?><div class="updated"><p><strong><?php _e('Feed Deleted Successfully.', GCE_TEXT_DOMAIN); ?></strong></p></div><?php
|
177 |
-
}
|
178 |
-
}?>
|
179 |
-
|
180 |
<div class="wrap">
|
181 |
<div id="icon-options-general" class="icon32"><br /></div>
|
182 |
|
183 |
<h2><?php _e('Google Calendar Events', GCE_TEXT_DOMAIN); ?></h2>
|
184 |
<form method="post" action="options.php" id="test-form">
|
185 |
<?php
|
186 |
-
if(isset($_GET['action'])){
|
187 |
switch($_GET['action']){
|
188 |
//Add feed section
|
189 |
case 'add':
|
190 |
settings_fields('gce_options');
|
191 |
do_settings_sections('add_feed');
|
192 |
do_settings_sections('add_display');
|
|
|
|
|
193 |
?><p class="submit"><input type="submit" class="button-primary submit" value="<?php _e('Add Feed', GCE_TEXT_DOMAIN); ?>" /></p>
|
194 |
<p><a href="<?php echo admin_url('options-general.php?page=' . GCE_PLUGIN_NAME . '.php'); ?>" class="button-secondary"><?php _e('Cancel', GCE_TEXT_DOMAIN); ?></a></p><?php
|
195 |
break;
|
@@ -198,6 +195,8 @@ if(!class_exists('Google_Calendar_Events')){
|
|
198 |
settings_fields('gce_options');
|
199 |
do_settings_sections('edit_feed');
|
200 |
do_settings_sections('edit_display');
|
|
|
|
|
201 |
?><p class="submit"><input type="submit" class="button-primary submit" value="<?php _e('Save Changes', GCE_TEXT_DOMAIN); ?>" /></p>
|
202 |
<p><a href="<?php echo admin_url('options-general.php?page=' . GCE_PLUGIN_NAME . '.php'); ?>" class="button-secondary"><?php _e('Cancel', GCE_TEXT_DOMAIN); ?></a></p><?php
|
203 |
break;
|
@@ -216,7 +215,7 @@ if(!class_exists('Google_Calendar_Events')){
|
|
216 |
?>
|
217 |
</form>
|
218 |
</div>
|
219 |
-
|
220 |
}
|
221 |
|
222 |
//Initialize admin stuff
|
@@ -244,14 +243,32 @@ if(!class_exists('Google_Calendar_Events')){
|
|
244 |
$id = absint($input['id']);
|
245 |
//Escape title text
|
246 |
$title = esc_html($input['title']);
|
247 |
-
//Escape feed url
|
248 |
-
$url = esc_url($input['url']);
|
249 |
-
|
250 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
251 |
//Check max events is a positive integer. If absint returns 0, reset to default (25)
|
252 |
$max_events = (absint($input['max_events']) == 0 ? 25 : absint($input['max_events']));
|
253 |
-
//Check day limit is a positive integer. If not (or 0) set to ''
|
254 |
-
$day_limit = absint($input['day_limit']) == 0 ? '' : absint($input['day_limit']);
|
255 |
|
256 |
$date_format = wp_filter_kses($input['date_format']);
|
257 |
$time_format = wp_filter_kses($input['time_format']);
|
@@ -285,14 +302,19 @@ if(!class_exists('Google_Calendar_Events')){
|
|
285 |
|
286 |
$display_desc_limit = absint($input['display_desc_limit']) == 0 ? '' : absint($input['display_desc_limit']);
|
287 |
|
|
|
|
|
|
|
288 |
//Fill options array with validated values
|
289 |
$options[$id] = array(
|
290 |
'id' => $id,
|
291 |
'title' => $title,
|
292 |
'url' => $url,
|
293 |
-
'
|
|
|
|
|
|
|
294 |
'max_events' => $max_events,
|
295 |
-
'day_limit' => $day_limit,
|
296 |
'date_format' => $date_format,
|
297 |
'time_format' => $time_format,
|
298 |
'timezone' => $timezone,
|
@@ -310,7 +332,9 @@ if(!class_exists('Google_Calendar_Events')){
|
|
310 |
'display_desc_limit' => $display_desc_limit,
|
311 |
'display_link_text' => $display_link_text,
|
312 |
'display_link_target' => $display_link_target,
|
313 |
-
'display_separator' => $display_separator
|
|
|
|
|
314 |
);
|
315 |
}
|
316 |
|
@@ -324,6 +348,7 @@ if(!class_exists('Google_Calendar_Events')){
|
|
324 |
$options['stylesheet'] = esc_url($input['stylesheet']);
|
325 |
$options['javascript'] = (isset($input['javascript']) ? true : false);
|
326 |
$options['loading'] = esc_html($input['loading']);
|
|
|
327 |
|
328 |
return $options;
|
329 |
}
|
@@ -409,6 +434,8 @@ if(!class_exists('Google_Calendar_Events')){
|
|
409 |
'ajaxurl' => admin_url('admin-ajax.php'),
|
410 |
'loading' => $options['loading']
|
411 |
));
|
|
|
|
|
412 |
}
|
413 |
}
|
414 |
|
@@ -436,7 +463,13 @@ function gce_print_list($feed_ids, $title_text, $max_events, $grouped = false){
|
|
436 |
if(count($list->get_errors()) == 0){
|
437 |
return '<div class="gce-page-list">' . $list->get_list($grouped) . '</div>';
|
438 |
}else{
|
439 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
440 |
}
|
441 |
}
|
442 |
|
@@ -453,7 +486,13 @@ function gce_print_grid($feed_ids, $title_text, $max_events, $ajaxified = false,
|
|
453 |
|
454 |
return $markup . $grid->get_grid($year, $month, $ajaxified) . '</div>';
|
455 |
}else{
|
456 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
457 |
}
|
458 |
}
|
459 |
|
3 |
Plugin Name: Google Calendar Events
|
4 |
Plugin URI: http://www.rhanney.co.uk/plugins/google-calendar-events
|
5 |
Description: Parses Google Calendar feeds and displays the events as a calendar grid or list on a page, post or widget.
|
6 |
+
Version: 0.5
|
7 |
Author: Ross Hanney
|
8 |
Author URI: http://www.rhanney.co.uk
|
9 |
License: GPL2
|
37 |
|
38 |
if(!class_exists('Google_Calendar_Events')){
|
39 |
class Google_Calendar_Events{
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
function __construct(){
|
41 |
add_action('activate_google-calendar-events/google-calendar-events.php', array($this, 'activate_plugin'));
|
42 |
add_action('init', array($this, 'init_plugin'));
|
49 |
add_action('wp_ajax_nopriv_gce_ajax', array($this, 'gce_ajax'));
|
50 |
add_filter('plugin_action_links_' . plugin_basename(__FILE__), array($this, 'add_settings_link'));
|
51 |
add_shortcode('google-calendar-events', array($this, 'shortcode_handler'));
|
52 |
+
add_shortcode('gce-start', array($this, 'boom'));
|
53 |
}
|
54 |
|
55 |
//If any new options have been added between versions, this will update any saved feeds with defaults for new options (shouldn't overwrite anything saved)
|
67 |
'id' => 1,
|
68 |
'title' => '',
|
69 |
'url' => '',
|
70 |
+
'retrieve_from' => 'today',
|
71 |
+
'retrieve_from_value' => 0,
|
72 |
+
'retrieve_until' => 'any',
|
73 |
+
'retrieve_until_value' => 0,
|
74 |
'max_events' => 25,
|
|
|
75 |
'date_format' => '',
|
76 |
'time_format' => '',
|
77 |
'timezone' => 'default',
|
89 |
'display_desc_limit' => '',
|
90 |
'display_link_text' => 'More details',
|
91 |
'display_link_target' => '',
|
92 |
+
'display_separator' => ', ',
|
93 |
+
'use_builder' => 'false',
|
94 |
+
'builder' => ''
|
95 |
);
|
96 |
|
97 |
+
//If necessary, copy saved behaviour of old show_past_events and day_limit options into the new from / until options
|
98 |
+
if(isset($saved_feed_options['show_past_events']) && $saved_feed_options['show_past_events'] == 'true') $saved_feed_options['retrieve_from'] = 'month-start';
|
99 |
+
if(isset($saved_feed_options['day_limit']) && $saved_feed_options['day_limit'] != ''){
|
100 |
+
$saved_feed_options['retrieve_until'] = 'today';
|
101 |
+
$saved_feed_options['retrieve_until_value'] = (int)$saved_feed_options['day_limit'] * 86400;
|
102 |
+
}
|
103 |
+
|
104 |
//Update old display_start / display_end values
|
105 |
if(!isset($saved_feed_options['display_start']))
|
106 |
$saved_feed_options['display_start'] = 'none';
|
130 |
$defaults = array(
|
131 |
'stylesheet' => '',
|
132 |
'javascript' => false,
|
133 |
+
'loading' => 'Loading...',
|
134 |
+
'error' => 'Events cannot currently be displayed, sorry! Please check back later.'
|
135 |
);
|
136 |
|
137 |
$old_stylesheet_option = get_option('gce_stylesheet');
|
146 |
|
147 |
if(isset($options['javascript'])) $defaults['javascript'] = $options['javascript'];
|
148 |
if(isset($options['loading'])) $defaults['loading'] = $options['loading'];
|
149 |
+
if(isset($options['error'])) $defaults['error'] = $options['error'];
|
150 |
|
151 |
//Save general options
|
152 |
update_option(GCE_GENERAL_OPTIONS_NAME, $defaults);
|
171 |
|
172 |
//Prints admin settings page
|
173 |
function admin_page(){
|
174 |
+
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
<div class="wrap">
|
176 |
<div id="icon-options-general" class="icon32"><br /></div>
|
177 |
|
178 |
<h2><?php _e('Google Calendar Events', GCE_TEXT_DOMAIN); ?></h2>
|
179 |
<form method="post" action="options.php" id="test-form">
|
180 |
<?php
|
181 |
+
if(isset($_GET['action']) && !isset($_GET['settings-updated'])){
|
182 |
switch($_GET['action']){
|
183 |
//Add feed section
|
184 |
case 'add':
|
185 |
settings_fields('gce_options');
|
186 |
do_settings_sections('add_feed');
|
187 |
do_settings_sections('add_display');
|
188 |
+
do_settings_sections('add_builder');
|
189 |
+
do_settings_sections('add_simple_display');
|
190 |
?><p class="submit"><input type="submit" class="button-primary submit" value="<?php _e('Add Feed', GCE_TEXT_DOMAIN); ?>" /></p>
|
191 |
<p><a href="<?php echo admin_url('options-general.php?page=' . GCE_PLUGIN_NAME . '.php'); ?>" class="button-secondary"><?php _e('Cancel', GCE_TEXT_DOMAIN); ?></a></p><?php
|
192 |
break;
|
195 |
settings_fields('gce_options');
|
196 |
do_settings_sections('edit_feed');
|
197 |
do_settings_sections('edit_display');
|
198 |
+
do_settings_sections('edit_builder');
|
199 |
+
do_settings_sections('edit_simple_display');
|
200 |
?><p class="submit"><input type="submit" class="button-primary submit" value="<?php _e('Save Changes', GCE_TEXT_DOMAIN); ?>" /></p>
|
201 |
<p><a href="<?php echo admin_url('options-general.php?page=' . GCE_PLUGIN_NAME . '.php'); ?>" class="button-secondary"><?php _e('Cancel', GCE_TEXT_DOMAIN); ?></a></p><?php
|
202 |
break;
|
215 |
?>
|
216 |
</form>
|
217 |
</div>
|
218 |
+
<?php
|
219 |
}
|
220 |
|
221 |
//Initialize admin stuff
|
243 |
$id = absint($input['id']);
|
244 |
//Escape title text
|
245 |
$title = esc_html($input['title']);
|
246 |
+
//Escape feed url. Replace https:// with http:// as SimplePie doesn't seem to support https:// Google Calendar feed URLs at present
|
247 |
+
$url = str_replace('https://', 'http://', esc_url($input['url']));
|
248 |
+
|
249 |
+
//Array of valid options for retrieve_from and retrieve_until settings
|
250 |
+
$valid_retrieve_options = array('now', 'today', 'week', 'month-start', 'month-end', 'any', 'date');
|
251 |
+
|
252 |
+
$retrieve_from = 'today';
|
253 |
+
$retrieve_from_value = 0;
|
254 |
+
|
255 |
+
//Ensure retrieve_from is valid
|
256 |
+
if(in_array($input['retrieve_from'], $valid_retrieve_options)){
|
257 |
+
$retrieve_from = $input['retrieve_from'];
|
258 |
+
$retrieve_from_value = (int)$input['retrieve_from_value'];
|
259 |
+
}
|
260 |
+
|
261 |
+
$retrieve_until = 'any';
|
262 |
+
$retrieve_until_value = 0;
|
263 |
+
|
264 |
+
//Ensure retrieve_until is valid
|
265 |
+
if(in_array($input['retrieve_until'], $valid_retrieve_options)){
|
266 |
+
$retrieve_until = $input['retrieve_until'];
|
267 |
+
$retrieve_until_value = (int)$input['retrieve_until_value'];
|
268 |
+
}
|
269 |
+
|
270 |
//Check max events is a positive integer. If absint returns 0, reset to default (25)
|
271 |
$max_events = (absint($input['max_events']) == 0 ? 25 : absint($input['max_events']));
|
|
|
|
|
272 |
|
273 |
$date_format = wp_filter_kses($input['date_format']);
|
274 |
$time_format = wp_filter_kses($input['time_format']);
|
302 |
|
303 |
$display_desc_limit = absint($input['display_desc_limit']) == 0 ? '' : absint($input['display_desc_limit']);
|
304 |
|
305 |
+
$use_builder = (($input['use_builder'] == 'false') ? 'false' : 'true');
|
306 |
+
$builder = wp_kses_post($input['builder']);
|
307 |
+
|
308 |
//Fill options array with validated values
|
309 |
$options[$id] = array(
|
310 |
'id' => $id,
|
311 |
'title' => $title,
|
312 |
'url' => $url,
|
313 |
+
'retrieve_from' => $retrieve_from,
|
314 |
+
'retrieve_until' => $retrieve_until,
|
315 |
+
'retrieve_from_value' => $retrieve_from_value,
|
316 |
+
'retrieve_until_value' => $retrieve_until_value,
|
317 |
'max_events' => $max_events,
|
|
|
318 |
'date_format' => $date_format,
|
319 |
'time_format' => $time_format,
|
320 |
'timezone' => $timezone,
|
332 |
'display_desc_limit' => $display_desc_limit,
|
333 |
'display_link_text' => $display_link_text,
|
334 |
'display_link_target' => $display_link_target,
|
335 |
+
'display_separator' => $display_separator,
|
336 |
+
'use_builder' => $use_builder,
|
337 |
+
'builder' => $builder
|
338 |
);
|
339 |
}
|
340 |
|
348 |
$options['stylesheet'] = esc_url($input['stylesheet']);
|
349 |
$options['javascript'] = (isset($input['javascript']) ? true : false);
|
350 |
$options['loading'] = esc_html($input['loading']);
|
351 |
+
$options['error'] = wp_filter_kses($input['error']);
|
352 |
|
353 |
return $options;
|
354 |
}
|
434 |
'ajaxurl' => admin_url('admin-ajax.php'),
|
435 |
'loading' => $options['loading']
|
436 |
));
|
437 |
+
}else{
|
438 |
+
wp_enqueue_script('gce_scripts', WP_PLUGIN_URL . '/' . GCE_PLUGIN_NAME . '/js/gce-admin-script.js', array('jquery'));
|
439 |
}
|
440 |
}
|
441 |
|
463 |
if(count($list->get_errors()) == 0){
|
464 |
return '<div class="gce-page-list">' . $list->get_list($grouped) . '</div>';
|
465 |
}else{
|
466 |
+
//If current user is an admin, display an error message explaining problem. Otherwise, display a 'nice' error messsage
|
467 |
+
if(current_user_can('manage_options')){
|
468 |
+
return sprintf(__('The following feeds were not parsed successfully: %s. Please check that the feed URLs are correct and that the feeds have public sharing enabled.'), implode(', ', $list->get_errors()));
|
469 |
+
}else{
|
470 |
+
$options = get_option(GCE_GENERAL_OPTIONS_NAME);
|
471 |
+
return $options['error'];
|
472 |
+
}
|
473 |
}
|
474 |
}
|
475 |
|
486 |
|
487 |
return $markup . $grid->get_grid($year, $month, $ajaxified) . '</div>';
|
488 |
}else{
|
489 |
+
//If current user is an admin, display an error message explaining problem. Otherwise, display a 'nice' error messsage
|
490 |
+
if(current_user_can('manage_options')){
|
491 |
+
return sprintf(__('The following feeds were not parsed successfully: %s. Please check that the feed URLs are correct and that the feeds have public sharing enabled.'), implode(', ', $grid->get_errors()));
|
492 |
+
}else{
|
493 |
+
$options = get_option(GCE_GENERAL_OPTIONS_NAME);
|
494 |
+
return $options['error'];
|
495 |
+
}
|
496 |
}
|
497 |
}
|
498 |
|
inc/gce-feed.php
CHANGED
@@ -1,18 +1,17 @@
|
|
1 |
<?php
|
2 |
require_once(ABSPATH . WPINC . '/class-feed.php');
|
3 |
-
require_once('simplepie-gcalendar.php');
|
4 |
|
5 |
class GCE_Feed extends SimplePie_GCalendar{
|
6 |
private $feed_id;
|
|
|
7 |
private $d_format;
|
8 |
private $t_format;
|
9 |
private $display_opts;
|
10 |
private $multi_day;
|
11 |
private $feed_start;
|
12 |
-
|
13 |
-
|
14 |
-
$this->__construct();
|
15 |
-
}
|
16 |
|
17 |
function __construct(){
|
18 |
parent::__construct();
|
@@ -20,12 +19,21 @@ class GCE_Feed extends SimplePie_GCalendar{
|
|
20 |
$this->set_file_class('WP_SimplePie_File');
|
21 |
}
|
22 |
|
|
|
|
|
|
|
|
|
|
|
23 |
//Setters
|
24 |
|
25 |
function set_feed_id($id){
|
26 |
$this->feed_id = $id;
|
27 |
}
|
28 |
|
|
|
|
|
|
|
|
|
29 |
function set_date_format($format_string){
|
30 |
$this->d_format = $format_string;
|
31 |
}
|
@@ -47,12 +55,24 @@ class GCE_Feed extends SimplePie_GCalendar{
|
|
47 |
parent::set_start_date($start_date);
|
48 |
}
|
49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
//Getters
|
51 |
|
52 |
function get_feed_id(){
|
53 |
return $this->feed_id;
|
54 |
}
|
55 |
|
|
|
|
|
|
|
|
|
56 |
function get_date_format(){
|
57 |
return $this->d_format;
|
58 |
}
|
@@ -72,5 +92,291 @@ class GCE_Feed extends SimplePie_GCalendar{
|
|
72 |
function get_start_date(){
|
73 |
return $this->feed_start;
|
74 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
}
|
76 |
?>
|
1 |
<?php
|
2 |
require_once(ABSPATH . WPINC . '/class-feed.php');
|
3 |
+
if(!class_exists('SimplePie_GCalendar')) require_once('simplepie-gcalendar.php');
|
4 |
|
5 |
class GCE_Feed extends SimplePie_GCalendar{
|
6 |
private $feed_id;
|
7 |
+
private $feed_title;
|
8 |
private $d_format;
|
9 |
private $t_format;
|
10 |
private $display_opts;
|
11 |
private $multi_day;
|
12 |
private $feed_start;
|
13 |
+
private $use_builder;
|
14 |
+
private $builder;
|
|
|
|
|
15 |
|
16 |
function __construct(){
|
17 |
parent::__construct();
|
19 |
$this->set_file_class('WP_SimplePie_File');
|
20 |
}
|
21 |
|
22 |
+
function init(){
|
23 |
+
parent::init();
|
24 |
+
$this->set_item_class('GCE_Event');
|
25 |
+
}
|
26 |
+
|
27 |
//Setters
|
28 |
|
29 |
function set_feed_id($id){
|
30 |
$this->feed_id = $id;
|
31 |
}
|
32 |
|
33 |
+
function set_feed_title($title){
|
34 |
+
$this->feed_title = $title;
|
35 |
+
}
|
36 |
+
|
37 |
function set_date_format($format_string){
|
38 |
$this->d_format = $format_string;
|
39 |
}
|
55 |
parent::set_start_date($start_date);
|
56 |
}
|
57 |
|
58 |
+
function set_use_builder($b){
|
59 |
+
$this->use_builder = $b;
|
60 |
+
}
|
61 |
+
|
62 |
+
function set_builder($b){
|
63 |
+
$this->builder = $b;
|
64 |
+
}
|
65 |
+
|
66 |
//Getters
|
67 |
|
68 |
function get_feed_id(){
|
69 |
return $this->feed_id;
|
70 |
}
|
71 |
|
72 |
+
function get_feed_title(){
|
73 |
+
return $this->feed_title;
|
74 |
+
}
|
75 |
+
|
76 |
function get_date_format(){
|
77 |
return $this->d_format;
|
78 |
}
|
92 |
function get_start_date(){
|
93 |
return $this->feed_start;
|
94 |
}
|
95 |
+
|
96 |
+
function get_timezone(){
|
97 |
+
return $this->timezone;
|
98 |
+
}
|
99 |
+
|
100 |
+
function get_use_builder(){
|
101 |
+
return $this->use_builder;
|
102 |
+
}
|
103 |
+
|
104 |
+
function get_builder(){
|
105 |
+
return $this->builder;
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
class GCE_Event extends SimplePie_Item_GCalendar{
|
110 |
+
private $type;
|
111 |
+
private $num_in_day;
|
112 |
+
|
113 |
+
//Returns the markup for this event, so that it can be used in the construction of a grid / list
|
114 |
+
function get_event_markup($display_type, $event_num){
|
115 |
+
//Set the display type (either tooltip or list)
|
116 |
+
$this->type = $display_type;
|
117 |
+
|
118 |
+
//Set which number event this is in day (first in day etc)
|
119 |
+
$this->num_in_day = $event_num;
|
120 |
+
|
121 |
+
//Use the builder or the old display options to create the markup, depending on user choice
|
122 |
+
if($this->get_feed()->get_use_builder()) return $this->use_builder();
|
123 |
+
return $this->use_old_display_options();
|
124 |
+
}
|
125 |
+
|
126 |
+
//Return the event markup using the builder
|
127 |
+
function use_builder(){
|
128 |
+
//Array of valid shortcodes
|
129 |
+
$shortcodes =
|
130 |
+
'event-title|' . //The event title
|
131 |
+
'start-time|' . //The start time of the event (uses the time format from the feed options, if it is set. Otherwise uses the default WordPress time format)
|
132 |
+
'start-date|' . //The start date of the event (uses the date format from the feed options, if it is set. Otherwise uses the default WordPress date format)
|
133 |
+
'start-custom|' . //The start time / date of the event (uses a custom PHP date format, specified in the 'format' attribute)
|
134 |
+
'start-human|' . //The difference between the start time of the event and the time now, in human-readable format, such as '1 hour', '4 days', '15 mins'
|
135 |
+
'end-time|' . //The end time of the event (uses the time format from the feed options, if it is set. Otherwise uses the default WordPress time format)
|
136 |
+
'end-date|' . //The end date of the event (uses the date format from the feed options, if it is set. Otherwise uses the default WordPress date format)
|
137 |
+
'end-custom|' . //The end time / date of the event (uses a custom PHP date format, specified in the 'format' attribute)
|
138 |
+
'end-human|' . //The difference between the end time of the event and the time now, in human-readable format, such as '1 hour', '4 days', '15 mins'
|
139 |
+
'location|' . //The event location
|
140 |
+
'description|' . //The event deescription (number of words can be limited by the 'limit' attribute)
|
141 |
+
'link|' . //Anything within this shortcode (including further shortcodes) will be linked to the Google Calendar page for this event
|
142 |
+
'link-path|' . //The raw link URL to the Google Calendar page for this event (can be used to construct more customized links)
|
143 |
+
'feed-id|' . //The ID of this feed (Can be useful for constructing feed specific CSS classes)
|
144 |
+
'feed-title|' . //The feed title
|
145 |
+
'maps-link|' . //Anything within this shortcode (including further shortcodes) will be linked to a Google Maps page based on whatever is specified for the event location
|
146 |
+
|
147 |
+
//Anything between the opening and closing tags of the following logical shortcodes (including further shortcodes) will only be displayed if:
|
148 |
+
|
149 |
+
'if-all-day|' . //This is an all-day event
|
150 |
+
'if-not-all-day|' . //This is not an all-day event
|
151 |
+
'if-title|' . //The event has a title
|
152 |
+
'if-description|' . //The event has a description
|
153 |
+
'if-location|' . //The event has a location
|
154 |
+
'if-tooltip|' . //The current display type is 'tooltip'
|
155 |
+
'if-list|' . //The current display type is 'list'
|
156 |
+
'if-now|' . //The event is taking place now (after the start time, but before the end time)
|
157 |
+
'if-not-now|' . //The event is not taking place now (may have ended or not yet started)
|
158 |
+
'if-started|' . //The event has started (and even if it has ended)
|
159 |
+
'if-not-started|' . //The event has not yet started
|
160 |
+
'if-ended|' . //The event has ended
|
161 |
+
'if-not-ended|' . //The event has not ended (and even if it hasn't started)
|
162 |
+
'if-first|' . //This event is the first in the day
|
163 |
+
'if-not-first'; //This event is not the first in the day
|
164 |
+
|
165 |
+
$markup = $this->get_feed()->get_builder();
|
166 |
+
|
167 |
+
$count = 0;
|
168 |
+
|
169 |
+
//Go through the builder text looking for valid shortcodes. If one is found, send it to parse_shortcodes(). Once $count reaches 0, there are no un-parsed shortcodes
|
170 |
+
//left, so return the markup (which now contains all the appropriate event information)
|
171 |
+
do{
|
172 |
+
$markup = preg_replace_callback('/(.?)\[(' . $shortcodes . ')\b(.*?)(?:(\/))?\](?:(.+?)\[\/\2\])?(.?)/s', array($this, 'parse_shortcode'), $markup, -1, $count);
|
173 |
+
}while($count > 0);
|
174 |
+
|
175 |
+
return $markup;
|
176 |
+
}
|
177 |
+
|
178 |
+
//Parse a shortcode, returning the appropriate event information
|
179 |
+
//Much of this code is 'borrowed' from WordPress' own shortcode handling stuff!
|
180 |
+
function parse_shortcode($m){
|
181 |
+
if($m[1] == '[' && $m[6] == ']' ) return substr($m[0], 1, -1);
|
182 |
+
|
183 |
+
//Extract any attributes contained in the shortcode
|
184 |
+
extract(shortcode_atts(array(
|
185 |
+
'newwindow' => 'false',
|
186 |
+
'format' => '',
|
187 |
+
'limit' => '0',
|
188 |
+
'html' => 'false',
|
189 |
+
'markdown' => 'false'
|
190 |
+
), shortcode_parse_atts($m[3])));
|
191 |
+
|
192 |
+
//Sanitize the attributes
|
193 |
+
$format = esc_attr($format);
|
194 |
+
$limit = absint($limit);
|
195 |
+
|
196 |
+
//If this is an all-day event
|
197 |
+
$is_all_day = ($this->get_day_type() == $this->SINGLE_WHOLE_DAY || $this->get_day_type() == $this->MULTIPLE_WHOLE_DAY);
|
198 |
+
|
199 |
+
//Do the appropriate stuff depending on which shortcode we're looking at. See valid shortcode list (above) for explanation of each shortcode
|
200 |
+
switch($m[2]){
|
201 |
+
case 'event-title':
|
202 |
+
$title = esc_html($this->get_title());
|
203 |
+
|
204 |
+
//Handle markdown / HTML if required
|
205 |
+
if($markdown == 'true' && function_exists('Markdown')) $title = Markdown($title);
|
206 |
+
if($html == 'true') $title = wp_kses_post(html_entity_decode($title));
|
207 |
+
|
208 |
+
return $m[1] . $title . $m[6];
|
209 |
+
case 'start-time':
|
210 |
+
return $m[1] . date_i18n($this->get_feed()->get_time_format(), $this->get_start_date()) . $m[6];
|
211 |
+
case 'start-date':
|
212 |
+
return $m[1] . date_i18n($this->get_feed()->get_date_format(), $this->get_start_date()) . $m[6];
|
213 |
+
case 'start-custom':
|
214 |
+
return $m[1] . date_i18n($format, $this->get_start_date()) . $m[6];
|
215 |
+
case 'start-human':
|
216 |
+
return $m[1] . human_time_diff($this->get_start_date()) . $m[6];
|
217 |
+
case 'end-time':
|
218 |
+
return $m[1] . date_i18n($this->get_feed()->get_time_format(), $this->get_end_date()) . $m[6];
|
219 |
+
case 'end-date':
|
220 |
+
return $m[1] . date_i18n($this->get_feed()->get_date_format(), $this->get_end_date()) . $m[6];
|
221 |
+
case 'end-custom':
|
222 |
+
return $m[1] . date_i18n($format, $this->get_end_date()) . $m[6];
|
223 |
+
case 'end-human':
|
224 |
+
return $m[1] . human_time_diff($this->get_end_date()) . $m[6];
|
225 |
+
case 'location':
|
226 |
+
$location = esc_html($this->get_location());
|
227 |
+
|
228 |
+
//Handle markdown / HTML if required
|
229 |
+
if($markdown == 'true' && function_exists('Markdown')) $location = Markdown($location);
|
230 |
+
if($html == 'true') $location = wp_kses_post(html_entity_decode($location));
|
231 |
+
|
232 |
+
return $m[1] . $location . $m[6];
|
233 |
+
case 'description':
|
234 |
+
$description = esc_html($this->get_description());
|
235 |
+
|
236 |
+
//If a word limit has been set, trim the description to the required length
|
237 |
+
if($limit != 0){
|
238 |
+
preg_match('/([\S]+\s*){0,' . $limit . '}/', esc_html($this->get_description()), $description);
|
239 |
+
$description = trim($description[0]);
|
240 |
+
}
|
241 |
+
|
242 |
+
//Handle markdown / HTML if required
|
243 |
+
if($markdown == 'true' && function_exists('Markdown')) $description = Markdown($description);
|
244 |
+
if($html == 'true') $description = wp_kses_post(html_entity_decode($description));
|
245 |
+
|
246 |
+
return $m[1] . $description . $m[6];
|
247 |
+
case 'link':
|
248 |
+
$new_window = ($newwindow == 'true') ? ' target="_blank"' : '';
|
249 |
+
return $m[1] . '<a href="' . $this->get_link() . '"' . $new_window . '>' . $m[5] . '</a>' . $m[6];
|
250 |
+
case 'link-path':
|
251 |
+
return $m[1] . $this->get_link() . $m[6];
|
252 |
+
case 'feed-id':
|
253 |
+
return $m[1] . $this->get_feed()->get_feed_id() . $m[6];
|
254 |
+
case 'feed-title':
|
255 |
+
return $m[1] . $this->get_feed()->get_feed_title() . $m[6];
|
256 |
+
case 'maps-link':
|
257 |
+
$new_window = ($newwindow == 'true') ? ' target="_blank"' : '';
|
258 |
+
return $m[1] . '<a href="http://maps.google.com?q=' . urlencode($this->get_location()) . '"' . $new_window . '>' . $m[5] . '</a>' . $m[6];
|
259 |
+
case 'if-all-day':
|
260 |
+
if($is_all_day) return $m[1] . $m[5] . $m[6];
|
261 |
+
return '';
|
262 |
+
case 'if-not-all-day':
|
263 |
+
if(!$is_all_day) return $m[1] . $m[5] . $m[6];
|
264 |
+
return '';
|
265 |
+
case 'if-title':
|
266 |
+
if($this->get_title() != '') return $m[1] . $m[5] . $m[6];
|
267 |
+
return '';
|
268 |
+
case 'if-description':
|
269 |
+
if($this->get_description() != '') return $m[1] . $m[5] . $m[6];
|
270 |
+
return '';
|
271 |
+
case 'if-location':
|
272 |
+
if($this->get_location() != '') return $m[1] . $m[5] . $m[6];
|
273 |
+
return '';
|
274 |
+
case 'if-tooltip':
|
275 |
+
if($this->type == 'tooltip') return $m[1] . $m[5] . $m[6];
|
276 |
+
return '';
|
277 |
+
case 'if-list':
|
278 |
+
if($this->type == 'list') return $m[1] . $m[5] . $m[6];
|
279 |
+
return '';
|
280 |
+
case 'if-now':
|
281 |
+
$s = $this->get_start_date();
|
282 |
+
$e = $this->get_end_date();
|
283 |
+
|
284 |
+
if(time() >= $s && time() < $e) return $m[1] . $m[5] . $m[6];
|
285 |
+
return '';
|
286 |
+
case 'if-not-now':
|
287 |
+
$s = $this->get_start_date();
|
288 |
+
$e = $this->get_end_date();
|
289 |
+
|
290 |
+
if($e < time() || $s > time()) return $m[1] . $m[5] . $m[6];
|
291 |
+
return '';
|
292 |
+
case 'if-started':
|
293 |
+
if($this->get_start_date() < time()) return $m[1] . $m[5] . $m[6];
|
294 |
+
return '';
|
295 |
+
case 'if-not-started':
|
296 |
+
if($this->get_start_date() > time()) return $m[1] . $m[5] . $m[6];
|
297 |
+
return '';
|
298 |
+
case 'if-ended':
|
299 |
+
if($this->get_end_date() < time()) return $m[1] . $m[5] . $m[6];
|
300 |
+
return '';
|
301 |
+
case 'if-not-ended':
|
302 |
+
if($this->get_end_date() > time()) return $m[1] . $m[5] . $m[6];
|
303 |
+
return '';
|
304 |
+
case 'if-first':
|
305 |
+
if($this->num_in_day == 0) return $m[1] . $m[5] . $m[6];
|
306 |
+
return '';
|
307 |
+
case 'if-not-first':
|
308 |
+
if($this->num_in_day != 0) return $m[1] . $m[5] . $m[6];
|
309 |
+
return '';
|
310 |
+
}
|
311 |
+
}
|
312 |
+
|
313 |
+
//Return the event markup using the old display options
|
314 |
+
function use_old_display_options(){
|
315 |
+
//Get the feed from which this event comes
|
316 |
+
$feed = $this->get_feed();
|
317 |
+
|
318 |
+
$display_options = $feed->get_display_options();
|
319 |
+
|
320 |
+
$markup = '<p class="gce-' . $this->type . '-event">' . esc_html($this->get_title()) . '</p>';
|
321 |
+
|
322 |
+
$start_end = array();
|
323 |
+
|
324 |
+
//If start date / time should be displayed, set up array of start date and time
|
325 |
+
if($display_options['display_start'] != 'none'){
|
326 |
+
$sd = $this->get_start_date();
|
327 |
+
$start_end['start'] = array('time' => date_i18n($feed->get_time_format(), $sd), 'date' => date_i18n($feed->get_date_format(), $sd));
|
328 |
+
}
|
329 |
+
|
330 |
+
//If end date / time should be displayed, set up array of end date and time
|
331 |
+
if($display_options['display_end'] != 'none'){
|
332 |
+
$ed = $this->get_end_date();
|
333 |
+
$start_end['end'] = array('time' => date_i18n($feed->get_time_format(), $ed), 'date' => date_i18n($feed->get_date_format(), $ed));
|
334 |
+
}
|
335 |
+
|
336 |
+
//Add the correct start / end, date / time information to $markup
|
337 |
+
foreach($start_end as $start_or_end => $info){
|
338 |
+
$markup .= '<p class="gce-' . $this->type . '-' . $start_or_end . '"><span>' . $display_options['display_' . $start_or_end . '_text'] . '</span> ';
|
339 |
+
|
340 |
+
switch($display_options['display_' . $start_or_end]){
|
341 |
+
case 'time': $markup .= $info['time'];
|
342 |
+
break;
|
343 |
+
case 'date': $markup .= $info['date'];
|
344 |
+
break;
|
345 |
+
case 'time-date': $markup .= $info['time'] . $display_options['display_separator'] . $info['date'];
|
346 |
+
break;
|
347 |
+
case 'date-time': $markup .= $info['date'] . $display_options['display_separator'] . $info['time'];
|
348 |
+
}
|
349 |
+
|
350 |
+
$markup .= '</p>';
|
351 |
+
}
|
352 |
+
|
353 |
+
//If location should be displayed (and is not empty) add to $markup
|
354 |
+
if(isset($display_options['display_location'])){
|
355 |
+
$event_location = $this->get_location();
|
356 |
+
if($event_location != '') $markup .= '<p class="gce-' . $this->type . '-loc"><span>' . $display_options['display_location_text'] . '</span> ' . esc_html($event_location) . '</p>';
|
357 |
+
}
|
358 |
+
|
359 |
+
//If description should be displayed (and is not empty) add to $markup
|
360 |
+
if(isset($display_options['display_desc'])){
|
361 |
+
$event_desc = $this->get_description();
|
362 |
+
|
363 |
+
if($event_desc != ''){
|
364 |
+
//Limit number of words of description to display, if required
|
365 |
+
if($display_options['display_desc_limit'] != ''){
|
366 |
+
preg_match('/([\S]+\s*){0,' . $display_options['display_desc_limit'] . '}/', $this->get_description(), $event_desc);
|
367 |
+
$event_desc = trim($event_desc[0]);
|
368 |
+
}
|
369 |
+
|
370 |
+
$markup .= '<p class="gce-' . $this->type . '-desc"><span>' . $display_options['display_desc_text'] . '</span> ' . make_clickable(nl2br(esc_html($event_desc))) . '</p>';
|
371 |
+
}
|
372 |
+
}
|
373 |
+
|
374 |
+
//If link should be displayed add to $markup
|
375 |
+
if(isset($display_options['display_link'])){ //Below: add target="_blank" if required
|
376 |
+
$markup .= '<p class="gce-' . $this->type . '-link"><a href="' . $this->get_link() . '&ctz=' . $feed->get_timezone() . '"' . (isset($display_options['display_link_target']) ? ' target="_blank"' : '') . '>' . $display_options['display_link_text'] . '</a></p>';
|
377 |
+
}
|
378 |
+
|
379 |
+
return $markup;
|
380 |
+
}
|
381 |
}
|
382 |
?>
|
inc/gce-parser.php
CHANGED
@@ -1,17 +1,13 @@
|
|
1 |
<?php
|
2 |
-
require_once('gce-feed.php');
|
3 |
-
|
4 |
class GCE_Parser{
|
5 |
var $feeds = array();
|
6 |
var $merged_feed_data = array();
|
7 |
var $title = null;
|
8 |
var $max_events_display = 0;
|
9 |
|
10 |
-
function GCE_Parser($feed_ids, $title_text = null, $max_events = 0){
|
11 |
-
$this->__construct($feed_ids, $title_text, $max_events);
|
12 |
-
}
|
13 |
-
|
14 |
function __construct($feed_ids, $title_text = null, $max_events = 0){
|
|
|
|
|
15 |
$this->title = $title_text;
|
16 |
$this->max_events_display = $max_events;
|
17 |
|
@@ -26,19 +22,62 @@ class GCE_Parser{
|
|
26 |
$feed = new GCE_Feed();
|
27 |
|
28 |
$feed->set_feed_id($feed_options['id']);
|
|
|
29 |
$feed->set_feed_url($feed_options['url']);
|
30 |
$feed->set_max_events($feed_options['max_events']);
|
31 |
-
//If day limit is not blank, set end date to specified number of days in the future, including today
|
32 |
-
if($feed_options['day_limit'] != '') $feed->set_end_date(mktime(0, 0, 0, date('n'), date('j'), date('Y')) + (86400 * $feed_options['day_limit']));
|
33 |
$feed->set_cache_duration($feed_options['cache_duration']);
|
|
|
34 |
//Set the timezone if anything other than default
|
35 |
if($feed_options['timezone'] != 'default') $feed->set_timezone($feed_options['timezone']);
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
}
|
|
|
42 |
//Set date and time formats. If they have not been set by user, set to global WordPress formats
|
43 |
$feed->set_date_format($feed_options['date_format'] == '' ? get_option('date_format') : $feed_options['date_format']);
|
44 |
$feed->set_time_format($feed_options['time_format'] == '' ? get_option('time_format') : $feed_options['time_format']);
|
@@ -62,6 +101,9 @@ class GCE_Parser{
|
|
62 |
'display_separator' => $feed_options['display_separator']
|
63 |
));
|
64 |
|
|
|
|
|
|
|
65 |
//SimplePie does the hard work
|
66 |
$feed->init();
|
67 |
|
@@ -154,15 +196,22 @@ class GCE_Parser{
|
|
154 |
//If event_days is empty, then there are no events in the feed(s), so set ajaxified to false (Prevents AJAX calendar from allowing to endlessly click through months with no events)
|
155 |
if(count((array)$event_days) == 0) $ajaxified = false;
|
156 |
|
157 |
-
$
|
|
|
|
|
|
|
|
|
158 |
|
159 |
$today = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
|
160 |
|
161 |
foreach($event_days as $key => $event_day){
|
162 |
//If event day is in the month and year specified (by $month and $year)
|
163 |
if(date('mY', $key) == $m_y){
|
164 |
-
//If this event day is the last in $event_days, there are no more events so set $
|
165 |
-
if($event_day ===
|
|
|
|
|
|
|
166 |
|
167 |
//Create array of CSS classes. Add gce-has-events
|
168 |
$css_classes = array('gce-has-events');
|
@@ -175,13 +224,8 @@ class GCE_Parser{
|
|
175 |
|
176 |
$markup .= '<ul>';
|
177 |
|
178 |
-
foreach($event_day as $event){
|
179 |
-
$markup .=
|
180 |
-
'<li class="gce-tooltip-feed-' . $event->get_feed()->get_feed_id() . '">' .
|
181 |
-
//Add the event title
|
182 |
-
'<p class="gce-tooltip-event">' . esc_html($event->get_title()) . '</p>' .
|
183 |
-
$this->get_event_info_markup($event, 'tooltip') .
|
184 |
-
'</li>';
|
185 |
|
186 |
//Add CSS class for the feed from which this event comes. If there are multiple events from the same feed on the same day, the CSS class will only be added once.
|
187 |
$css_classes['feed-' . $event->get_feed()->get_feed_id()] = 'gce-feed-' . $event->get_feed()->get_feed_id();
|
@@ -209,13 +253,13 @@ class GCE_Parser{
|
|
209 |
|
210 |
//Only add previous / next functionality if AJAX grid is enabled
|
211 |
if($ajaxified){
|
212 |
-
//If
|
213 |
-
$prev_key = ($
|
214 |
-
$prev = ($
|
215 |
|
216 |
-
//If $
|
217 |
-
$next_key = ($
|
218 |
-
$next = ($
|
219 |
|
220 |
//Array of previous and next link stuff for use in gce_generate_calendar (below)
|
221 |
$pn = array($prev_key => $prev, $next_key => $next);
|
@@ -244,15 +288,14 @@ class GCE_Parser{
|
|
244 |
'<ul>';
|
245 |
}
|
246 |
|
247 |
-
foreach($event_day as $event){
|
248 |
//Create the markup for this event
|
249 |
$markup .=
|
250 |
-
'<li>' .
|
251 |
//If this isn't a grouped list and a date title should be displayed, add the date title
|
252 |
((!$grouped && isset($this->title)) ? '<p class="gce-list-title">' . $this->title . ' ' . date_i18n($event->get_feed()->get_date_format(), $key) . '</p>' : '') .
|
253 |
-
//Add the event
|
254 |
-
'
|
255 |
-
$this->get_event_info_markup($event, 'list') .
|
256 |
'</li>';
|
257 |
}
|
258 |
|
@@ -264,74 +307,5 @@ class GCE_Parser{
|
|
264 |
|
265 |
return $markup;
|
266 |
}
|
267 |
-
|
268 |
-
//Returns the event information markup for the specified event (type = tooltip or list)
|
269 |
-
function get_event_info_markup($event, $type){
|
270 |
-
//Get the feed from which this event comes
|
271 |
-
$feed = $event->get_feed();
|
272 |
-
|
273 |
-
$display_options = $feed->get_display_options();
|
274 |
-
|
275 |
-
$markup = '';
|
276 |
-
|
277 |
-
$start_end = array();
|
278 |
-
|
279 |
-
//If start date / time should be displayed, set up array of start date and time
|
280 |
-
if($display_options['display_start'] != 'none'){
|
281 |
-
$sd = $event->get_start_date();
|
282 |
-
$start_end['start'] = array('time' => date_i18n($feed->get_time_format(), $sd), 'date' => date_i18n($feed->get_date_format(), $sd));
|
283 |
-
}
|
284 |
-
|
285 |
-
//If end date / time should be displayed, set up array of end date and time
|
286 |
-
if($display_options['display_end'] != 'none'){
|
287 |
-
$ed = $event->get_end_date();
|
288 |
-
$start_end['end'] = array('time' => date_i18n($feed->get_time_format(), $ed), 'date' => date_i18n($feed->get_date_format(), $ed));
|
289 |
-
}
|
290 |
-
|
291 |
-
//Add the correct start / end, date / time information to $markup
|
292 |
-
foreach($start_end as $start_or_end => $info){
|
293 |
-
$markup .= '<p class="gce-' . $type . '-' . $start_or_end . '"><span>' . $display_options['display_' . $start_or_end . '_text'] . '</span> ';
|
294 |
-
|
295 |
-
switch($display_options['display_' . $start_or_end]){
|
296 |
-
case 'time': $markup .= $info['time'];
|
297 |
-
break;
|
298 |
-
case 'date': $markup .= $info['date'];
|
299 |
-
break;
|
300 |
-
case 'time-date': $markup .= $info['time'] . $display_options['display_separator'] . $info['date'];
|
301 |
-
break;
|
302 |
-
case 'date-time': $markup .= $info['date'] . $display_options['display_separator'] . $info['time'];
|
303 |
-
}
|
304 |
-
|
305 |
-
$markup .= '</p>';
|
306 |
-
}
|
307 |
-
|
308 |
-
//If location should be displayed (and is not empty) add to $markup
|
309 |
-
if(isset($display_options['display_location'])){
|
310 |
-
$event_location = $event->get_location();
|
311 |
-
if($event_location != '') $markup .= '<p class="gce-' . $type . '-loc"><span>' . $display_options['display_location_text'] . '</span> ' . esc_html($event_location) . '</p>';
|
312 |
-
}
|
313 |
-
|
314 |
-
//If description should be displayed (and is not empty) add to $markup
|
315 |
-
if(isset($display_options['display_desc'])){
|
316 |
-
$event_desc = $event->get_description();
|
317 |
-
|
318 |
-
if($event_desc != ''){
|
319 |
-
//Limit number of words of desc to display, if required
|
320 |
-
if($display_options['display_desc_limit'] != ''){
|
321 |
-
preg_match('/([\S]+\s*){0,' . $display_options['display_desc_limit'] . '}/', $event->get_description(), $event_desc);
|
322 |
-
$event_desc = trim($event_desc[0]);
|
323 |
-
}
|
324 |
-
|
325 |
-
$markup .= '<p class="gce-' . $type . '-desc"><span>' . $display_options['display_desc_text'] . '</span> ' . make_clickable(nl2br(esc_html($event_desc))) . '</p>';
|
326 |
-
}
|
327 |
-
}
|
328 |
-
|
329 |
-
//If link should be displayed add to $markup
|
330 |
-
if(isset($display_options['display_link'])){ //Below: add target="_blank" if required
|
331 |
-
$markup .= '<p class="gce-' . $type . '-link"><a href="' . $event->get_link() . '&ctz=' . $feed->get_timezone() . '"' . (isset($display_options['display_link_target']) ? ' target="_blank"' : '') . '>' . $display_options['display_link_text'] . '</a></p>';
|
332 |
-
}
|
333 |
-
|
334 |
-
return $markup;
|
335 |
-
}
|
336 |
}
|
337 |
?>
|
1 |
<?php
|
|
|
|
|
2 |
class GCE_Parser{
|
3 |
var $feeds = array();
|
4 |
var $merged_feed_data = array();
|
5 |
var $title = null;
|
6 |
var $max_events_display = 0;
|
7 |
|
|
|
|
|
|
|
|
|
8 |
function __construct($feed_ids, $title_text = null, $max_events = 0){
|
9 |
+
require_once('gce-feed.php');
|
10 |
+
|
11 |
$this->title = $title_text;
|
12 |
$this->max_events_display = $max_events;
|
13 |
|
22 |
$feed = new GCE_Feed();
|
23 |
|
24 |
$feed->set_feed_id($feed_options['id']);
|
25 |
+
$feed->set_feed_title($feed_options['title']);
|
26 |
$feed->set_feed_url($feed_options['url']);
|
27 |
$feed->set_max_events($feed_options['max_events']);
|
|
|
|
|
28 |
$feed->set_cache_duration($feed_options['cache_duration']);
|
29 |
+
|
30 |
//Set the timezone if anything other than default
|
31 |
if($feed_options['timezone'] != 'default') $feed->set_timezone($feed_options['timezone']);
|
32 |
+
|
33 |
+
//Set the start date to the appropriate value based on the retrieve_from option
|
34 |
+
switch($feed_options['retrieve_from']){
|
35 |
+
case 'now':
|
36 |
+
$feed->set_start_date(time() + $feed_options['retrieve_from_value'] - date('Z'));
|
37 |
+
break;
|
38 |
+
case 'today':
|
39 |
+
$feed->set_start_date(mktime(0, 0, 0, date('m'), date('j'), date('Y')) + $feed_options['retrieve_from_value'] - date('Z'));
|
40 |
+
break;
|
41 |
+
case 'week':
|
42 |
+
$feed->set_start_date(mktime(0, 0, 0, date('m'), (date('j') - date('w') + get_option('start_of_week')), date('Y')) + $feed_options['retrieve_from_value'] - date('Z'));
|
43 |
+
break;
|
44 |
+
case 'month-start':
|
45 |
+
$feed->set_start_date(mktime(0, 0, 0, date('m'), 1, date('Y')) + $feed_options['retrieve_from_value'] - date('Z'));
|
46 |
+
break;
|
47 |
+
case 'month-end':
|
48 |
+
$feed->set_start_date(mktime(0, 0, 0, date('m') + 1, 1, date('Y')) + $feed_options['retrieve_from_value'] - date('Z'));
|
49 |
+
break;
|
50 |
+
case 'date':
|
51 |
+
$feed->set_start_date($feed_options['retrieve_from_value']);
|
52 |
+
break;
|
53 |
+
case 'any':
|
54 |
+
$feed->set_show_past_events(true);
|
55 |
+
}
|
56 |
+
|
57 |
+
//Set the end date to the appropriate value based on the retrieve_until option
|
58 |
+
switch($feed_options['retrieve_until']){
|
59 |
+
case 'now':
|
60 |
+
$feed->set_end_date(time() + $feed_options['retrieve_until_value'] - date('Z'));
|
61 |
+
break;
|
62 |
+
case 'today':
|
63 |
+
$feed->set_end_date(mktime(0, 0, 0, date('m'), date('j'), date('Y')) + $feed_options['retrieve_until_value'] - date('Z'));
|
64 |
+
break;
|
65 |
+
case 'week':
|
66 |
+
$feed->set_end_date(mktime(0, 0, 0, date('m'), (date('j') - date('w') + get_option('start_of_week')), date('Y')) + $feed_options['retrieve_until_value'] - date('Z'));
|
67 |
+
break;
|
68 |
+
case 'month-start':
|
69 |
+
$feed->set_end_date(mktime(0, 0, 0, date('m'), 1, date('Y')) + $feed_options['retrieve_until_value'] - date('Z'));
|
70 |
+
break;
|
71 |
+
case 'month-end':
|
72 |
+
$feed->set_end_date(mktime(0, 0, 0, date('m') + 1, 1, date('Y')) + $feed_options['retrieve_until_value'] - date('Z'));
|
73 |
+
break;
|
74 |
+
case 'date':
|
75 |
+
$feed->set_end_date($feed_options['retrieve_until_value']);
|
76 |
+
break;
|
77 |
+
case 'any':
|
78 |
+
$feed->set_show_past_events(true);
|
79 |
}
|
80 |
+
|
81 |
//Set date and time formats. If they have not been set by user, set to global WordPress formats
|
82 |
$feed->set_date_format($feed_options['date_format'] == '' ? get_option('date_format') : $feed_options['date_format']);
|
83 |
$feed->set_time_format($feed_options['time_format'] == '' ? get_option('time_format') : $feed_options['time_format']);
|
101 |
'display_separator' => $feed_options['display_separator']
|
102 |
));
|
103 |
|
104 |
+
$feed->set_use_builder($feed_options['use_builder'] == 'true' ? true : false);
|
105 |
+
$feed->set_builder($feed_options['builder']);
|
106 |
+
|
107 |
//SimplePie does the hard work
|
108 |
$feed->init();
|
109 |
|
196 |
//If event_days is empty, then there are no events in the feed(s), so set ajaxified to false (Prevents AJAX calendar from allowing to endlessly click through months with no events)
|
197 |
if(count((array)$event_days) == 0) $ajaxified = false;
|
198 |
|
199 |
+
$at_last_event = false;
|
200 |
+
$at_first_event = false;
|
201 |
+
|
202 |
+
$last_event = end($event_days);
|
203 |
+
$first_event = reset($event_days);
|
204 |
|
205 |
$today = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
|
206 |
|
207 |
foreach($event_days as $key => $event_day){
|
208 |
//If event day is in the month and year specified (by $month and $year)
|
209 |
if(date('mY', $key) == $m_y){
|
210 |
+
//If this event day is the last in $event_days, there are no more events in the future so set $at_last_event to true
|
211 |
+
if($event_day === $last_event) $at_last_event = true;
|
212 |
+
|
213 |
+
//If this event day is the first in $event_days, there are no more events in the past so set $at_first_event to true
|
214 |
+
if($event_day === $first_event) $at_first_event = true;
|
215 |
|
216 |
//Create array of CSS classes. Add gce-has-events
|
217 |
$css_classes = array('gce-has-events');
|
224 |
|
225 |
$markup .= '<ul>';
|
226 |
|
227 |
+
foreach($event_day as $event_num => $event){
|
228 |
+
$markup .= '<li class="gce-tooltip-feed-' . $event->get_feed()->get_feed_id() . '">' . $event->get_event_markup('tooltip', $event_num) . '</li>';
|
|
|
|
|
|
|
|
|
|
|
229 |
|
230 |
//Add CSS class for the feed from which this event comes. If there are multiple events from the same feed on the same day, the CSS class will only be added once.
|
231 |
$css_classes['feed-' . $event->get_feed()->get_feed_id()] = 'gce-feed-' . $event->get_feed()->get_feed_id();
|
253 |
|
254 |
//Only add previous / next functionality if AJAX grid is enabled
|
255 |
if($ajaxified){
|
256 |
+
//If $at_first_event don't add previous month link. Otherwise, do add previous month link
|
257 |
+
$prev_key = ($at_first_event ? ' ' : '«');
|
258 |
+
$prev = ($at_first_event ? null : date('m-Y', mktime(0, 0, 0, $month - 1, 1, $year)));
|
259 |
|
260 |
+
//If $at_last_event don't add next month link. Otherwise, do add next month link
|
261 |
+
$next_key = ($at_last_event ? ' ' : '»');
|
262 |
+
$next = ($at_last_event ? null : date('m-Y', mktime(0, 0, 0, $month + 1, 1, $year)));
|
263 |
|
264 |
//Array of previous and next link stuff for use in gce_generate_calendar (below)
|
265 |
$pn = array($prev_key => $prev, $next_key => $next);
|
288 |
'<ul>';
|
289 |
}
|
290 |
|
291 |
+
foreach($event_day as $event_num => $event){
|
292 |
//Create the markup for this event
|
293 |
$markup .=
|
294 |
+
'<li class="gce-feed-' . $event->get_feed()->get_feed_id() . '">' .
|
295 |
//If this isn't a grouped list and a date title should be displayed, add the date title
|
296 |
((!$grouped && isset($this->title)) ? '<p class="gce-list-title">' . $this->title . ' ' . date_i18n($event->get_feed()->get_date_format(), $key) . '</p>' : '') .
|
297 |
+
//Add the event markup
|
298 |
+
$event->get_event_markup('list', $event_num) .
|
|
|
299 |
'</li>';
|
300 |
}
|
301 |
|
307 |
|
308 |
return $markup;
|
309 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
310 |
}
|
311 |
?>
|
inc/simplepie-gcalendar.php
CHANGED
@@ -106,15 +106,8 @@ class SimplePie_GCalendar extends SimplePie {
|
|
106 |
*
|
107 |
* @param $value must php timestamp
|
108 |
*/
|
109 |
-
function set_start_date($value = 0){
|
110 |
-
|
111 |
-
//$test = str_replace('+', '+', $test);
|
112 |
-
//$blah = strftime('%Y-%m-%dT%H:%M:%S',$value);
|
113 |
-
//$this->start_date = $blah . $test;
|
114 |
-
//echo $this->start_date;
|
115 |
-
//$this->start_date = date('c');
|
116 |
-
|
117 |
-
$this->start_date = strftime('%Y-%m-%dT%H:%M:%S',$value);
|
118 |
}
|
119 |
|
120 |
/**
|
@@ -360,8 +353,8 @@ class SimplePie_Item_GCalendar extends SimplePie_Item {
|
|
360 |
*/
|
361 |
function get_status(){
|
362 |
if(!$this->gc_status){
|
363 |
-
$
|
364 |
-
$this->gc_status = substr( $gd_status[0]['attribs']['']['value'], -
|
365 |
}
|
366 |
return $this->gc_status;
|
367 |
}
|
106 |
*
|
107 |
* @param $value must php timestamp
|
108 |
*/
|
109 |
+
function set_start_date($value = 0){
|
110 |
+
$this->start_date = strftime('%Y-%m-%dT%H:%M:%S',$value);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
}
|
112 |
|
113 |
/**
|
353 |
*/
|
354 |
function get_status(){
|
355 |
if(!$this->gc_status){
|
356 |
+
$gd_status = $this->get_item_tags(SIMPLEPIE_NAMESPACE_GOOGLE_CALENDAR_ITEM, 'eventStatus');
|
357 |
+
$this->gc_status = substr( $gd_status[0]['attribs']['']['value'], -9);
|
358 |
}
|
359 |
return $this->gc_status;
|
360 |
}
|
js/gce-admin-script.js
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
function correct_options(){
|
2 |
+
val = jQuery('select[name="gce_options[use_builder]"]').val();
|
3 |
+
|
4 |
+
if(val == 'true'){
|
5 |
+
jQuery('.gce-simple-display-options').next('.form-table').hide();
|
6 |
+
jQuery('.gce-simple-display-options').hide();
|
7 |
+
jQuery('.gce-simple-display-options').prev('h3').hide();
|
8 |
+
|
9 |
+
jQuery('.gce-event-builder').next('.form-table').show();
|
10 |
+
jQuery('.gce-event-builder').show();
|
11 |
+
jQuery('.gce-event-builder').prev('h3').show();
|
12 |
+
}else{
|
13 |
+
jQuery('.gce-simple-display-options').next('.form-table').show();
|
14 |
+
jQuery('.gce-simple-display-options').show();
|
15 |
+
jQuery('.gce-simple-display-options').prev('h3').show();
|
16 |
+
|
17 |
+
jQuery('.gce-event-builder').next('.form-table').hide();
|
18 |
+
jQuery('.gce-event-builder').hide();
|
19 |
+
jQuery('.gce-event-builder').prev('h3').hide();
|
20 |
+
}
|
21 |
+
}
|
22 |
+
|
23 |
+
jQuery(document).ready(function(){
|
24 |
+
correct_options();
|
25 |
+
|
26 |
+
jQuery('select[name="gce_options[use_builder]"]').change(function(e){
|
27 |
+
correct_options();
|
28 |
+
});
|
29 |
+
});
|
languages/google-calendar-events.pot
CHANGED
@@ -1,20 +1,150 @@
|
|
1 |
-
#
|
2 |
-
# Copyright (C) 2010 Ross Hanney
|
3 |
# This file is distributed under the same license as the Google Calendar Events package.
|
4 |
-
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
|
5 |
-
#
|
6 |
-
#, fuzzy
|
7 |
msgid ""
|
8 |
msgstr ""
|
9 |
-
"Project-Id-Version: Google Calendar Events 0.
|
10 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/google-calendar-events\n"
|
11 |
-
"POT-Creation-Date:
|
|
|
|
|
|
|
12 |
"PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n"
|
13 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
15 |
-
|
16 |
-
|
17 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
#: admin/add.php:9
|
20 |
msgid "Add a Feed"
|
@@ -33,15 +163,15 @@ msgid "Feed URL"
|
|
33 |
msgstr ""
|
34 |
|
35 |
#: admin/add.php:14 admin/edit.php:14
|
36 |
-
msgid "Retrieve
|
37 |
msgstr ""
|
38 |
|
39 |
#: admin/add.php:15 admin/edit.php:15
|
40 |
-
msgid "
|
41 |
msgstr ""
|
42 |
|
43 |
#: admin/add.php:16 admin/edit.php:16
|
44 |
-
msgid "
|
45 |
msgstr ""
|
46 |
|
47 |
#: admin/add.php:17 admin/edit.php:17
|
@@ -69,205 +199,232 @@ msgid "Display Options"
|
|
69 |
msgstr ""
|
70 |
|
71 |
#: admin/add.php:24 admin/edit.php:24
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
msgid "Display start time / date?"
|
73 |
msgstr ""
|
74 |
|
75 |
-
#: admin/add.php:
|
76 |
msgid "Display end time / date?"
|
77 |
msgstr ""
|
78 |
|
79 |
-
#: admin/add.php:
|
80 |
msgid "Separator text / characters"
|
81 |
msgstr ""
|
82 |
|
83 |
-
#: admin/add.php:
|
84 |
msgid "Display location?"
|
85 |
msgstr ""
|
86 |
|
87 |
-
#: admin/add.php:
|
88 |
msgid "Display description?"
|
89 |
msgstr ""
|
90 |
|
91 |
-
#: admin/add.php:
|
92 |
msgid "Display link to event?"
|
93 |
msgstr ""
|
94 |
|
95 |
-
#: admin/add.php:
|
96 |
msgid "Enter the feed details below, then click the Add Feed button."
|
97 |
msgstr ""
|
98 |
|
99 |
-
#: admin/add.php:
|
100 |
msgid "Anything you like. 'Upcoming Club Events', for example."
|
101 |
msgstr ""
|
102 |
|
103 |
-
#: admin/add.php:
|
104 |
msgid ""
|
105 |
"This will probably be something like: <code>http://www.google.com/calendar/"
|
106 |
"feeds/your-email@gmail.com/public/full</code>."
|
107 |
msgstr ""
|
108 |
|
109 |
-
#: admin/add.php:
|
110 |
msgid ""
|
111 |
-
"
|
112 |
-
"
|
|
|
|
|
|
|
|
|
113 |
msgstr ""
|
114 |
|
115 |
-
#: admin/add.php:
|
116 |
msgid ""
|
117 |
-
"The
|
118 |
-
"
|
119 |
msgstr ""
|
120 |
|
121 |
-
#: admin/add.php:
|
122 |
msgid ""
|
123 |
-
"
|
124 |
-
"
|
|
|
125 |
msgstr ""
|
126 |
|
127 |
-
#: admin/add.php:
|
128 |
msgid ""
|
129 |
-
"In <a href=\"http://php.net/manual/en/function.date.php\"
|
130 |
-
"a>. Leave this blank if you'd rather stick with the
|
131 |
-
"blog."
|
132 |
msgstr ""
|
133 |
|
134 |
-
#: admin/add.php:
|
135 |
msgid ""
|
136 |
-
"In <a href=\"http://php.net/manual/en/function.date.php\"
|
137 |
-
"a>. Again, leave this blank to stick with the default."
|
138 |
msgstr ""
|
139 |
|
140 |
-
#: admin/add.php:
|
141 |
msgid ""
|
142 |
"If you are having problems with dates and times displaying in the wrong "
|
143 |
"timezone, select a city in your required timezone here."
|
144 |
msgstr ""
|
145 |
|
146 |
-
#: admin/add.php:
|
147 |
msgid ""
|
148 |
"The length of time, in seconds, to cache the feed (43200 = 12 hours). If "
|
149 |
"this feed changes regularly, you may want to reduce the cache duration."
|
150 |
msgstr ""
|
151 |
|
152 |
-
#: admin/add.php:
|
153 |
msgid ""
|
154 |
"Show events that span multiple days on each day that they span (There are "
|
155 |
-
"some
|
|
|
|
|
156 |
msgstr ""
|
157 |
|
158 |
-
#: admin/add.php:
|
159 |
msgid ""
|
160 |
"These settings control what information will be displayed for this feed in "
|
161 |
"the tooltip (for grids), or in a list."
|
162 |
msgstr ""
|
163 |
|
164 |
-
#: admin/add.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
165 |
msgid ""
|
166 |
"You can use some HTML in the text fields, but ensure it is valid or things "
|
167 |
"might go wonky. Text fields can be empty too."
|
168 |
msgstr ""
|
169 |
|
170 |
-
#: admin/add.php:
|
171 |
msgid "Select how to display the start date / time."
|
172 |
msgstr ""
|
173 |
|
174 |
-
#: admin/add.php:
|
175 |
msgid "Don't display start time or date"
|
176 |
msgstr ""
|
177 |
|
178 |
-
#: admin/add.php:
|
179 |
msgid "Display start time"
|
180 |
msgstr ""
|
181 |
|
182 |
-
#: admin/add.php:
|
183 |
msgid "Display start date"
|
184 |
msgstr ""
|
185 |
|
186 |
-
#: admin/add.php:
|
187 |
msgid "Display start time and date (in that order)"
|
188 |
msgstr ""
|
189 |
|
190 |
-
#: admin/add.php:
|
191 |
msgid "Display start date and time (in that order)"
|
192 |
msgstr ""
|
193 |
|
194 |
-
#: admin/add.php:
|
195 |
msgid "Text to display before the start time."
|
196 |
msgstr ""
|
197 |
|
198 |
-
#: admin/add.php:
|
199 |
msgid "Select how to display the end date / time."
|
200 |
msgstr ""
|
201 |
|
202 |
-
#: admin/add.php:
|
203 |
msgid "Don't display end time or date"
|
204 |
msgstr ""
|
205 |
|
206 |
-
#: admin/add.php:
|
207 |
msgid "Display end time"
|
208 |
msgstr ""
|
209 |
|
210 |
-
#: admin/add.php:
|
211 |
msgid "Display end date"
|
212 |
msgstr ""
|
213 |
|
214 |
-
#: admin/add.php:
|
215 |
msgid "Display end time and date (in that order)"
|
216 |
msgstr ""
|
217 |
|
218 |
-
#: admin/add.php:
|
219 |
msgid "Display end date and time (in that order)"
|
220 |
msgstr ""
|
221 |
|
222 |
-
#: admin/add.php:
|
223 |
msgid "Text to display before the end time."
|
224 |
msgstr ""
|
225 |
|
226 |
-
#: admin/add.php:
|
227 |
msgid ""
|
228 |
"If you have chosen to display both the time and date above, enter the text / "
|
229 |
"characters to display between the time and date here (including any spaces)."
|
230 |
msgstr ""
|
231 |
|
232 |
-
#: admin/add.php:
|
233 |
msgid "Show the location of events?"
|
234 |
msgstr ""
|
235 |
|
236 |
-
#: admin/add.php:
|
237 |
msgid "Text to display before the location."
|
238 |
msgstr ""
|
239 |
|
240 |
-
#: admin/add.php:
|
241 |
msgid ""
|
242 |
"Show the description of events? (URLs in the description will be made into "
|
243 |
"links)."
|
244 |
msgstr ""
|
245 |
|
246 |
-
#: admin/add.php:
|
247 |
msgid "Text to display before the description."
|
248 |
msgstr ""
|
249 |
|
250 |
-
#: admin/add.php:
|
251 |
msgid ""
|
252 |
"Maximum number of words to show from description. Leave blank for no limit."
|
253 |
msgstr ""
|
254 |
|
255 |
-
#: admin/add.php:
|
256 |
msgid "Show a link to the Google Calendar page for an event?"
|
257 |
msgstr ""
|
258 |
|
259 |
-
#: admin/add.php:
|
260 |
msgid "Links open in a new window / tab?"
|
261 |
msgstr ""
|
262 |
|
263 |
-
#: admin/add.php:
|
264 |
msgid "The link text to be displayed."
|
265 |
msgstr ""
|
266 |
|
267 |
-
#: admin/delete.php:9 google-calendar-events.php:201
|
268 |
-
msgid "Delete Feed"
|
269 |
-
msgstr ""
|
270 |
-
|
271 |
#: admin/delete.php:17
|
272 |
msgid ""
|
273 |
"Are you want you want to delete this feed? (Remember to remove / adjust any "
|
@@ -278,192 +435,64 @@ msgstr ""
|
|
278 |
msgid "Edit Feed"
|
279 |
msgstr ""
|
280 |
|
281 |
-
#: admin/edit.php:
|
282 |
msgid ""
|
283 |
"Make any changes you require to the feed details below, then click the Save "
|
284 |
"Changes button."
|
285 |
msgstr ""
|
286 |
|
287 |
-
#: admin/edit.php:
|
288 |
msgid ""
|
289 |
"Show the description of events? (URLs in the description will be made into "
|
290 |
"links)."
|
291 |
msgstr ""
|
292 |
|
293 |
-
#: admin/main.php:2
|
294 |
-
msgid "Add a New Feed"
|
295 |
-
msgstr ""
|
296 |
-
|
297 |
-
#: admin/main.php:4
|
298 |
-
msgid "Click here to add a new feed"
|
299 |
-
msgstr ""
|
300 |
-
|
301 |
-
#: admin/main.php:4 google-calendar-events.php:186
|
302 |
-
msgid "Add Feed"
|
303 |
-
msgstr ""
|
304 |
-
|
305 |
-
#: admin/main.php:7
|
306 |
-
msgid "Current Feeds"
|
307 |
-
msgstr ""
|
308 |
-
|
309 |
-
#: admin/main.php:16
|
310 |
-
msgid "You haven't added any Google Calendar feeds yet."
|
311 |
-
msgstr ""
|
312 |
-
|
313 |
-
#: admin/main.php:24 admin/main.php:32
|
314 |
-
msgid "ID"
|
315 |
-
msgstr ""
|
316 |
-
|
317 |
-
#: admin/main.php:25 admin/main.php:33
|
318 |
-
msgid "Title"
|
319 |
-
msgstr ""
|
320 |
-
|
321 |
-
#: admin/main.php:26 admin/main.php:34
|
322 |
-
msgid "URL"
|
323 |
-
msgstr ""
|
324 |
-
|
325 |
-
#: admin/main.php:47
|
326 |
-
msgid "Edit"
|
327 |
-
msgstr ""
|
328 |
-
|
329 |
-
#: admin/main.php:47
|
330 |
-
msgid "Delete"
|
331 |
-
msgstr ""
|
332 |
-
|
333 |
-
#: admin/main.php:61
|
334 |
-
msgid "General Options"
|
335 |
-
msgstr ""
|
336 |
-
|
337 |
-
#: admin/main.php:65
|
338 |
-
msgid "Custom stylesheet URL"
|
339 |
-
msgstr ""
|
340 |
-
|
341 |
-
#: admin/main.php:67
|
342 |
-
msgid ""
|
343 |
-
"If you want to make changes to the default CSS, make a copy of <code>google-"
|
344 |
-
"calendar-events/css/gce-style.css</code> on your server. Make any \r\n"
|
345 |
-
"\t\t\t\tchanges to the copy. Enter the URL to the copied file below."
|
346 |
-
msgstr ""
|
347 |
-
|
348 |
-
#: admin/main.php:73
|
349 |
-
msgid "Add JavaScript to footer?"
|
350 |
-
msgstr ""
|
351 |
-
|
352 |
-
#: admin/main.php:75
|
353 |
-
msgid ""
|
354 |
-
"If you are having issues with tooltips not appearing or the AJAX "
|
355 |
-
"functionality not working, try ticking the checkbox below."
|
356 |
-
msgstr ""
|
357 |
-
|
358 |
-
#: admin/main.php:80
|
359 |
-
msgid "Loading text"
|
360 |
-
msgstr ""
|
361 |
-
|
362 |
-
#: admin/main.php:82
|
363 |
-
msgid "Text to display while calendar data is loading (on AJAX requests)"
|
364 |
-
msgstr ""
|
365 |
-
|
366 |
-
#: admin/main.php:91
|
367 |
-
msgid "Save"
|
368 |
-
msgstr ""
|
369 |
-
|
370 |
-
#: google-calendar-events.php:148
|
371 |
-
msgid "Settings"
|
372 |
-
msgstr ""
|
373 |
-
|
374 |
-
#: google-calendar-events.php:163
|
375 |
-
msgid "New Feed Added Successfully."
|
376 |
-
msgstr ""
|
377 |
-
|
378 |
-
#: google-calendar-events.php:166
|
379 |
-
msgid "Feed Details Updated Successfully."
|
380 |
-
msgstr ""
|
381 |
-
|
382 |
-
#: google-calendar-events.php:169
|
383 |
-
msgid "Feed Deleted Successfully."
|
384 |
-
msgstr ""
|
385 |
-
|
386 |
-
#. #-#-#-#-# plugin.pot (Google Calendar Events 0.3.1) #-#-#-#-#
|
387 |
-
#. Plugin Name of the plugin/theme
|
388 |
-
#: google-calendar-events.php:176 widget/gce-widget.php:6
|
389 |
-
msgid "Google Calendar Events"
|
390 |
-
msgstr ""
|
391 |
-
|
392 |
-
#: google-calendar-events.php:187 google-calendar-events.php:195
|
393 |
-
#: google-calendar-events.php:202
|
394 |
-
msgid "Cancel"
|
395 |
-
msgstr ""
|
396 |
-
|
397 |
-
#: google-calendar-events.php:194
|
398 |
-
msgid "Save Changes"
|
399 |
-
msgstr ""
|
400 |
-
|
401 |
-
#: google-calendar-events.php:353
|
402 |
-
msgid ""
|
403 |
-
"No valid Feed IDs have been entered for this shortcode. Please check that "
|
404 |
-
"you have entered the IDs correctly and that the Feeds have not been deleted."
|
405 |
-
msgstr ""
|
406 |
-
|
407 |
-
#: google-calendar-events.php:369 widget/gce-widget.php:76
|
408 |
-
msgid ""
|
409 |
-
"No feeds have been added yet. You can add a feed in the Google Calendar "
|
410 |
-
"Events settings."
|
411 |
-
msgstr ""
|
412 |
-
|
413 |
-
#: google-calendar-events.php:428 google-calendar-events.php:445
|
414 |
-
#: widget/gce-widget.php:146 widget/gce-widget.php:158
|
415 |
-
#, php-format
|
416 |
-
msgid ""
|
417 |
-
"The following feeds were not parsed successfully: %s. Please check that the "
|
418 |
-
"feed URLs are correct and that the feeds have public sharing enabled."
|
419 |
-
msgstr ""
|
420 |
-
|
421 |
-
#: inc/gce-parser.php:213
|
422 |
-
msgid "There are currently no upcoming events."
|
423 |
-
msgstr ""
|
424 |
-
|
425 |
#: widget/gce-widget.php:6
|
426 |
msgid ""
|
427 |
"Display a list or calendar grid of events from one or more Google Calendar "
|
428 |
"feeds you have added"
|
429 |
msgstr ""
|
430 |
|
431 |
-
#: widget/gce-widget.php:
|
432 |
msgid ""
|
433 |
"No valid Feed IDs have been entered for this widget. Please check that you "
|
434 |
"have entered the IDs correctly and that the Feeds have not been deleted."
|
435 |
msgstr ""
|
436 |
|
437 |
-
#: widget/gce-widget.php:
|
438 |
msgid ""
|
439 |
"No feeds have been added yet. You can add feeds in the Google Calendar "
|
440 |
"Events settings."
|
441 |
msgstr ""
|
442 |
|
443 |
-
#: widget/gce-widget.php:
|
444 |
msgid "Feed IDs to display in this widget, separated by commas (e.g. 1, 2, 4):"
|
445 |
msgstr ""
|
446 |
|
447 |
-
#: widget/gce-widget.php:
|
448 |
msgid "Display as:"
|
449 |
msgstr ""
|
450 |
|
451 |
-
#: widget/gce-widget.php:
|
452 |
msgid "Calendar Grid"
|
453 |
msgstr ""
|
454 |
|
455 |
-
#: widget/gce-widget.php:
|
456 |
msgid "Calendar Grid - with AJAX"
|
457 |
msgstr ""
|
458 |
|
459 |
-
#: widget/gce-widget.php:
|
460 |
msgid "List"
|
461 |
msgstr ""
|
462 |
|
463 |
-
#: widget/gce-widget.php:
|
464 |
msgid "List - grouped by date"
|
465 |
msgstr ""
|
466 |
|
|
|
|
|
|
|
|
|
467 |
#. Plugin URI of the plugin/theme
|
468 |
msgid "http://www.rhanney.co.uk/plugins/google-calendar-events"
|
469 |
msgstr ""
|
1 |
+
# Copyright (C) 2010 Google Calendar Events
|
|
|
2 |
# This file is distributed under the same license as the Google Calendar Events package.
|
|
|
|
|
|
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Google Calendar Events 0.5\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/google-calendar-events\n"
|
7 |
+
"POT-Creation-Date: 2011-04-18 14:26:48+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: 2010-MO-DA HO:MI+ZONE\n"
|
12 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
+
|
15 |
+
#: inc/gce-parser.php:276
|
16 |
+
msgid "There are currently no upcoming events."
|
17 |
+
msgstr ""
|
18 |
+
|
19 |
+
#: google-calendar-events.php:163
|
20 |
+
msgid "Settings"
|
21 |
+
msgstr ""
|
22 |
+
|
23 |
+
#. #-#-#-#-# plugin.pot (Google Calendar Events 0.5) #-#-#-#-#
|
24 |
+
#. Plugin Name of the plugin/theme
|
25 |
+
#: google-calendar-events.php:178 widget/gce-widget.php:6
|
26 |
+
msgid "Google Calendar Events"
|
27 |
+
msgstr ""
|
28 |
+
|
29 |
+
#: google-calendar-events.php:190 admin/main.php:4
|
30 |
+
msgid "Add Feed"
|
31 |
+
msgstr ""
|
32 |
+
|
33 |
+
#: google-calendar-events.php:191 google-calendar-events.php:201
|
34 |
+
#: google-calendar-events.php:208
|
35 |
+
msgid "Cancel"
|
36 |
+
msgstr ""
|
37 |
+
|
38 |
+
#: google-calendar-events.php:200
|
39 |
+
msgid "Save Changes"
|
40 |
+
msgstr ""
|
41 |
+
|
42 |
+
#: google-calendar-events.php:207 admin/delete.php:9
|
43 |
+
msgid "Delete Feed"
|
44 |
+
msgstr ""
|
45 |
+
|
46 |
+
#: google-calendar-events.php:389
|
47 |
+
msgid ""
|
48 |
+
"No valid Feed IDs have been entered for this shortcode. Please check that "
|
49 |
+
"you have entered the IDs correctly and that the Feeds have not been deleted."
|
50 |
+
msgstr ""
|
51 |
+
|
52 |
+
#: google-calendar-events.php:405 widget/gce-widget.php:85
|
53 |
+
msgid ""
|
54 |
+
"No feeds have been added yet. You can add a feed in the Google Calendar "
|
55 |
+
"Events settings."
|
56 |
+
msgstr ""
|
57 |
+
|
58 |
+
#: google-calendar-events.php:468 google-calendar-events.php:491
|
59 |
+
#: widget/gce-widget.php:166 widget/gce-widget.php:184
|
60 |
+
msgid ""
|
61 |
+
"The following feeds were not parsed successfully: %s. Please check that the "
|
62 |
+
"feed URLs are correct and that the feeds have public sharing enabled."
|
63 |
+
msgstr ""
|
64 |
+
|
65 |
+
#: admin/main.php:2
|
66 |
+
msgid "Add a New Feed"
|
67 |
+
msgstr ""
|
68 |
+
|
69 |
+
#: admin/main.php:4
|
70 |
+
msgid "Click here to add a new feed"
|
71 |
+
msgstr ""
|
72 |
+
|
73 |
+
#: admin/main.php:7
|
74 |
+
msgid "Current Feeds"
|
75 |
+
msgstr ""
|
76 |
+
|
77 |
+
#: admin/main.php:16
|
78 |
+
msgid "You haven't added any Google Calendar feeds yet."
|
79 |
+
msgstr ""
|
80 |
+
|
81 |
+
#: admin/main.php:24 admin/main.php:32
|
82 |
+
msgid "ID"
|
83 |
+
msgstr ""
|
84 |
+
|
85 |
+
#: admin/main.php:25 admin/main.php:33
|
86 |
+
msgid "Title"
|
87 |
+
msgstr ""
|
88 |
+
|
89 |
+
#: admin/main.php:26 admin/main.php:34
|
90 |
+
msgid "URL"
|
91 |
+
msgstr ""
|
92 |
+
|
93 |
+
#: admin/main.php:47
|
94 |
+
msgid "Edit"
|
95 |
+
msgstr ""
|
96 |
+
|
97 |
+
#: admin/main.php:47
|
98 |
+
msgid "Delete"
|
99 |
+
msgstr ""
|
100 |
+
|
101 |
+
#: admin/main.php:61
|
102 |
+
msgid "General Options"
|
103 |
+
msgstr ""
|
104 |
+
|
105 |
+
#: admin/main.php:65
|
106 |
+
msgid "Custom stylesheet URL"
|
107 |
+
msgstr ""
|
108 |
+
|
109 |
+
#: admin/main.php:67
|
110 |
+
msgid ""
|
111 |
+
"If you want to make changes to the default CSS, make a copy of <code>google-"
|
112 |
+
"calendar-events/css/gce-style.css</code> on your server. Make any \r\n"
|
113 |
+
"\t\t\t\tchanges to the copy. Enter the URL to the copied file below."
|
114 |
+
msgstr ""
|
115 |
+
|
116 |
+
#: admin/main.php:73
|
117 |
+
msgid "Add JavaScript to footer?"
|
118 |
+
msgstr ""
|
119 |
+
|
120 |
+
#: admin/main.php:75
|
121 |
+
msgid ""
|
122 |
+
"If you are having issues with tooltips not appearing or the AJAX "
|
123 |
+
"functionality not working, try ticking the checkbox below."
|
124 |
+
msgstr ""
|
125 |
+
|
126 |
+
#: admin/main.php:80
|
127 |
+
msgid "Loading text"
|
128 |
+
msgstr ""
|
129 |
+
|
130 |
+
#: admin/main.php:82
|
131 |
+
msgid "Text to display while calendar data is loading (on AJAX requests)."
|
132 |
+
msgstr ""
|
133 |
+
|
134 |
+
#: admin/main.php:87
|
135 |
+
msgid "Error message"
|
136 |
+
msgstr ""
|
137 |
+
|
138 |
+
#: admin/main.php:89
|
139 |
+
msgid ""
|
140 |
+
"An error message to display to non-admin users if events cannot be displayed "
|
141 |
+
"for any reason (admins will see a message indicating the cause of the "
|
142 |
+
"problem)."
|
143 |
+
msgstr ""
|
144 |
+
|
145 |
+
#: admin/main.php:98
|
146 |
+
msgid "Save"
|
147 |
+
msgstr ""
|
148 |
|
149 |
#: admin/add.php:9
|
150 |
msgid "Add a Feed"
|
163 |
msgstr ""
|
164 |
|
165 |
#: admin/add.php:14 admin/edit.php:14
|
166 |
+
msgid "Retrieve events from"
|
167 |
msgstr ""
|
168 |
|
169 |
#: admin/add.php:15 admin/edit.php:15
|
170 |
+
msgid "Retrieve events until"
|
171 |
msgstr ""
|
172 |
|
173 |
#: admin/add.php:16 admin/edit.php:16
|
174 |
+
msgid "Maximum number of events to retrieve"
|
175 |
msgstr ""
|
176 |
|
177 |
#: admin/add.php:17 admin/edit.php:17
|
199 |
msgstr ""
|
200 |
|
201 |
#: admin/add.php:24 admin/edit.php:24
|
202 |
+
msgid "Select display customization method"
|
203 |
+
msgstr ""
|
204 |
+
|
205 |
+
#: admin/add.php:26 admin/edit.php:26
|
206 |
+
msgid "Event Display Builder"
|
207 |
+
msgstr ""
|
208 |
+
|
209 |
+
#: admin/add.php:27 admin/edit.php:27
|
210 |
+
msgid "Event display builder HTML and shortcodes"
|
211 |
+
msgstr ""
|
212 |
+
|
213 |
+
#: admin/add.php:29 admin/edit.php:29
|
214 |
+
msgid "Simple Display Options"
|
215 |
+
msgstr ""
|
216 |
+
|
217 |
+
#: admin/add.php:30 admin/edit.php:30
|
218 |
msgid "Display start time / date?"
|
219 |
msgstr ""
|
220 |
|
221 |
+
#: admin/add.php:31 admin/edit.php:31
|
222 |
msgid "Display end time / date?"
|
223 |
msgstr ""
|
224 |
|
225 |
+
#: admin/add.php:32 admin/edit.php:32
|
226 |
msgid "Separator text / characters"
|
227 |
msgstr ""
|
228 |
|
229 |
+
#: admin/add.php:33 admin/edit.php:33
|
230 |
msgid "Display location?"
|
231 |
msgstr ""
|
232 |
|
233 |
+
#: admin/add.php:34 admin/edit.php:34
|
234 |
msgid "Display description?"
|
235 |
msgstr ""
|
236 |
|
237 |
+
#: admin/add.php:35 admin/edit.php:35
|
238 |
msgid "Display link to event?"
|
239 |
msgstr ""
|
240 |
|
241 |
+
#: admin/add.php:40
|
242 |
msgid "Enter the feed details below, then click the Add Feed button."
|
243 |
msgstr ""
|
244 |
|
245 |
+
#: admin/add.php:64 admin/edit.php:59
|
246 |
msgid "Anything you like. 'Upcoming Club Events', for example."
|
247 |
msgstr ""
|
248 |
|
249 |
+
#: admin/add.php:73 admin/edit.php:70
|
250 |
msgid ""
|
251 |
"This will probably be something like: <code>http://www.google.com/calendar/"
|
252 |
"feeds/your-email@gmail.com/public/full</code>."
|
253 |
msgstr ""
|
254 |
|
255 |
+
#: admin/add.php:82 admin/edit.php:81
|
256 |
msgid ""
|
257 |
+
"The point in time at which to start retrieving events. Use the text-box to "
|
258 |
+
"specify an additional offset from you chosen start point. The offset should "
|
259 |
+
"be provided in seconds (3600 = 1 hour, 86400 = 1 day) and can be negative. "
|
260 |
+
"If you have selected the 'Specific date / time' option, enter a <a href="
|
261 |
+
"\"http://www.timestampgenerator.com\" target=\"_blank\">UNIX timestamp</a> "
|
262 |
+
"in the text-box."
|
263 |
msgstr ""
|
264 |
|
265 |
+
#: admin/add.php:100 admin/edit.php:101
|
266 |
msgid ""
|
267 |
+
"The point in time at which to stop retrieving events. The instructions for "
|
268 |
+
"the above option also apply here."
|
269 |
msgstr ""
|
270 |
|
271 |
+
#: admin/add.php:119 admin/edit.php:122
|
272 |
msgid ""
|
273 |
+
"Set this to a few more than you actually want to display (due to caching and "
|
274 |
+
"timezone issues). The exact number to display can be configured per "
|
275 |
+
"shortcode / widget."
|
276 |
msgstr ""
|
277 |
|
278 |
+
#: admin/add.php:128 admin/edit.php:133
|
279 |
msgid ""
|
280 |
+
"In <a href=\"http://php.net/manual/en/function.date.php\" target=\"_blank"
|
281 |
+
"\">PHP date format</a>. Leave this blank if you'd rather stick with the "
|
282 |
+
"default format for your blog."
|
283 |
msgstr ""
|
284 |
|
285 |
+
#: admin/add.php:137 admin/edit.php:144
|
286 |
msgid ""
|
287 |
+
"In <a href=\"http://php.net/manual/en/function.date.php\" target=\"_blank"
|
288 |
+
"\">PHP date format</a>. Again, leave this blank to stick with the default."
|
289 |
msgstr ""
|
290 |
|
291 |
+
#: admin/add.php:150 admin/edit.php:159
|
292 |
msgid ""
|
293 |
"If you are having problems with dates and times displaying in the wrong "
|
294 |
"timezone, select a city in your required timezone here."
|
295 |
msgstr ""
|
296 |
|
297 |
+
#: admin/add.php:159 admin/edit.php:170
|
298 |
msgid ""
|
299 |
"The length of time, in seconds, to cache the feed (43200 = 12 hours). If "
|
300 |
"this feed changes regularly, you may want to reduce the cache duration."
|
301 |
msgstr ""
|
302 |
|
303 |
+
#: admin/add.php:168 admin/edit.php:181
|
304 |
msgid ""
|
305 |
"Show events that span multiple days on each day that they span (There are "
|
306 |
+
"some <a href=\"http://www.rhanney.co.uk/2010/08/19/google-calendar-events-0-"
|
307 |
+
"4#multiday\" target=\"_blank\">limitations</a> of this feature to be aware "
|
308 |
+
"of)."
|
309 |
msgstr ""
|
310 |
|
311 |
+
#: admin/add.php:179 admin/edit.php:192
|
312 |
msgid ""
|
313 |
"These settings control what information will be displayed for this feed in "
|
314 |
"the tooltip (for grids), or in a list."
|
315 |
msgstr ""
|
316 |
|
317 |
+
#: admin/add.php:185 admin/edit.php:200
|
318 |
+
msgid ""
|
319 |
+
"It is recommended that you use the event display builder option, as it "
|
320 |
+
"provides much more flexibility than the simple display options. The event "
|
321 |
+
"display builder can do everything the simple display options can, plus lots "
|
322 |
+
"more!"
|
323 |
+
msgstr ""
|
324 |
+
|
325 |
+
#: admin/add.php:269 admin/edit.php:279
|
326 |
msgid ""
|
327 |
"You can use some HTML in the text fields, but ensure it is valid or things "
|
328 |
"might go wonky. Text fields can be empty too."
|
329 |
msgstr ""
|
330 |
|
331 |
+
#: admin/add.php:275 admin/edit.php:287
|
332 |
msgid "Select how to display the start date / time."
|
333 |
msgstr ""
|
334 |
|
335 |
+
#: admin/add.php:278 admin/edit.php:290
|
336 |
msgid "Don't display start time or date"
|
337 |
msgstr ""
|
338 |
|
339 |
+
#: admin/add.php:279 admin/edit.php:291
|
340 |
msgid "Display start time"
|
341 |
msgstr ""
|
342 |
|
343 |
+
#: admin/add.php:280 admin/edit.php:292
|
344 |
msgid "Display start date"
|
345 |
msgstr ""
|
346 |
|
347 |
+
#: admin/add.php:281 admin/edit.php:293
|
348 |
msgid "Display start time and date (in that order)"
|
349 |
msgstr ""
|
350 |
|
351 |
+
#: admin/add.php:282 admin/edit.php:294
|
352 |
msgid "Display start date and time (in that order)"
|
353 |
msgstr ""
|
354 |
|
355 |
+
#: admin/add.php:285 admin/edit.php:297
|
356 |
msgid "Text to display before the start time."
|
357 |
msgstr ""
|
358 |
|
359 |
+
#: admin/add.php:293 admin/edit.php:307
|
360 |
msgid "Select how to display the end date / time."
|
361 |
msgstr ""
|
362 |
|
363 |
+
#: admin/add.php:296 admin/edit.php:310
|
364 |
msgid "Don't display end time or date"
|
365 |
msgstr ""
|
366 |
|
367 |
+
#: admin/add.php:297 admin/edit.php:311
|
368 |
msgid "Display end time"
|
369 |
msgstr ""
|
370 |
|
371 |
+
#: admin/add.php:298 admin/edit.php:312
|
372 |
msgid "Display end date"
|
373 |
msgstr ""
|
374 |
|
375 |
+
#: admin/add.php:299 admin/edit.php:313
|
376 |
msgid "Display end time and date (in that order)"
|
377 |
msgstr ""
|
378 |
|
379 |
+
#: admin/add.php:300 admin/edit.php:314
|
380 |
msgid "Display end date and time (in that order)"
|
381 |
msgstr ""
|
382 |
|
383 |
+
#: admin/add.php:303 admin/edit.php:317
|
384 |
msgid "Text to display before the end time."
|
385 |
msgstr ""
|
386 |
|
387 |
+
#: admin/add.php:311 admin/edit.php:327
|
388 |
msgid ""
|
389 |
"If you have chosen to display both the time and date above, enter the text / "
|
390 |
"characters to display between the time and date here (including any spaces)."
|
391 |
msgstr ""
|
392 |
|
393 |
+
#: admin/add.php:320 admin/edit.php:338
|
394 |
msgid "Show the location of events?"
|
395 |
msgstr ""
|
396 |
|
397 |
+
#: admin/add.php:322 admin/edit.php:340
|
398 |
msgid "Text to display before the location."
|
399 |
msgstr ""
|
400 |
|
401 |
+
#: admin/add.php:331
|
402 |
msgid ""
|
403 |
"Show the description of events? (URLs in the description will be made into "
|
404 |
"links)."
|
405 |
msgstr ""
|
406 |
|
407 |
+
#: admin/add.php:333 admin/edit.php:353
|
408 |
msgid "Text to display before the description."
|
409 |
msgstr ""
|
410 |
|
411 |
+
#: admin/add.php:337 admin/edit.php:357
|
412 |
msgid ""
|
413 |
"Maximum number of words to show from description. Leave blank for no limit."
|
414 |
msgstr ""
|
415 |
|
416 |
+
#: admin/add.php:346 admin/edit.php:368
|
417 |
msgid "Show a link to the Google Calendar page for an event?"
|
418 |
msgstr ""
|
419 |
|
420 |
+
#: admin/add.php:349 admin/edit.php:371
|
421 |
msgid "Links open in a new window / tab?"
|
422 |
msgstr ""
|
423 |
|
424 |
+
#: admin/add.php:351 admin/edit.php:373
|
425 |
msgid "The link text to be displayed."
|
426 |
msgstr ""
|
427 |
|
|
|
|
|
|
|
|
|
428 |
#: admin/delete.php:17
|
429 |
msgid ""
|
430 |
"Are you want you want to delete this feed? (Remember to remove / adjust any "
|
435 |
msgid "Edit Feed"
|
436 |
msgstr ""
|
437 |
|
438 |
+
#: admin/edit.php:40
|
439 |
msgid ""
|
440 |
"Make any changes you require to the feed details below, then click the Save "
|
441 |
"Changes button."
|
442 |
msgstr ""
|
443 |
|
444 |
+
#: admin/edit.php:351
|
445 |
msgid ""
|
446 |
"Show the description of events? (URLs in the description will be made into "
|
447 |
"links)."
|
448 |
msgstr ""
|
449 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
450 |
#: widget/gce-widget.php:6
|
451 |
msgid ""
|
452 |
"Display a list or calendar grid of events from one or more Google Calendar "
|
453 |
"feeds you have added"
|
454 |
msgstr ""
|
455 |
|
456 |
+
#: widget/gce-widget.php:42
|
457 |
msgid ""
|
458 |
"No valid Feed IDs have been entered for this widget. Please check that you "
|
459 |
"have entered the IDs correctly and that the Feeds have not been deleted."
|
460 |
msgstr ""
|
461 |
|
462 |
+
#: widget/gce-widget.php:113
|
463 |
msgid ""
|
464 |
"No feeds have been added yet. You can add feeds in the Google Calendar "
|
465 |
"Events settings."
|
466 |
msgstr ""
|
467 |
|
468 |
+
#: widget/gce-widget.php:128
|
469 |
msgid "Feed IDs to display in this widget, separated by commas (e.g. 1, 2, 4):"
|
470 |
msgstr ""
|
471 |
|
472 |
+
#: widget/gce-widget.php:132
|
473 |
msgid "Display as:"
|
474 |
msgstr ""
|
475 |
|
476 |
+
#: widget/gce-widget.php:134
|
477 |
msgid "Calendar Grid"
|
478 |
msgstr ""
|
479 |
|
480 |
+
#: widget/gce-widget.php:135
|
481 |
msgid "Calendar Grid - with AJAX"
|
482 |
msgstr ""
|
483 |
|
484 |
+
#: widget/gce-widget.php:136
|
485 |
msgid "List"
|
486 |
msgstr ""
|
487 |
|
488 |
+
#: widget/gce-widget.php:137
|
489 |
msgid "List - grouped by date"
|
490 |
msgstr ""
|
491 |
|
492 |
+
#: widget/gce-widget.php:140
|
493 |
+
msgid "Maximum no. events to display. Enter 0 to show all retrieved."
|
494 |
+
msgstr ""
|
495 |
+
|
496 |
#. Plugin URI of the plugin/theme
|
497 |
msgid "http://www.rhanney.co.uk/plugins/google-calendar-events"
|
498 |
msgstr ""
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: rosshanney
|
|
3 |
Donate link: http://www.rhanney.co.uk/plugins/google-calendar-events/#donate
|
4 |
Tags: google, google calendar, calendar, event, events, ajax, widget
|
5 |
Requires at least: 2.9.2
|
6 |
-
Tested up to: 3.1
|
7 |
-
Stable tag: 0.
|
8 |
|
9 |
Parses Google Calendar feeds and displays the events as a calendar grid or list on a page, post or widget.
|
10 |
|
@@ -18,8 +18,8 @@ Parses Google Calendar feeds and displays the events as a calendar grid or list
|
|
18 |
* Displays events as a list or within a calendar grid
|
19 |
* Events from multiple Google Calendar feeds can be shown in a single list / grid
|
20 |
* Lists and grids can be displayed in posts, pages or within a widget
|
21 |
-
* Options to change the number of events retrieved, date / time format, cache duration etc
|
22 |
-
*
|
23 |
* Calendar grids can have the ability to change the month displayed, utilising AJAX
|
24 |
|
25 |
Please visit the plugin homepage for how to get started and other help:
|
@@ -30,13 +30,13 @@ There is also a demonstration page showing the plugin in action:
|
|
30 |
|
31 |
* [Demo Page](http://www.rhanney.co.uk/plugins/google-calendar-events/gce-demo)
|
32 |
|
33 |
-
|
34 |
|
35 |
-
* [0.
|
36 |
|
37 |
== Installation ==
|
38 |
|
39 |
-
Use the automatic installer from within the WordPress
|
40 |
|
41 |
1. Download the `.zip` file by clicking on the Download button on the right
|
42 |
1. Unzip the file
|
@@ -56,8 +56,16 @@ You can now start adding feeds. Visit the [plugin homepage](http://www.rhanney.c
|
|
56 |
|
57 |
== Changelog ==
|
58 |
|
59 |
-
= 0.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
|
|
|
61 |
* Fix / workaround for the long-running timezone bug. Please take a look at [this](http://www.rhanney.co.uk/2011/01/16/google-calendar-events-0-4-1) for more information.
|
62 |
* Added additional 'Maximum no. events to display' option to widget / shortcode (mainly to address a further issue caused by the above fix)
|
63 |
* i18n related bug fix
|
@@ -114,8 +122,8 @@ You can now start adding feeds. Visit the [plugin homepage](http://www.rhanney.c
|
|
114 |
|
115 |
== Upgrade Notice ==
|
116 |
|
117 |
-
= 0.
|
118 |
-
|
119 |
|
120 |
== Frequently Asked Questions ==
|
121 |
|
3 |
Donate link: http://www.rhanney.co.uk/plugins/google-calendar-events/#donate
|
4 |
Tags: google, google calendar, calendar, event, events, ajax, widget
|
5 |
Requires at least: 2.9.2
|
6 |
+
Tested up to: 3.1.1
|
7 |
+
Stable tag: 0.5
|
8 |
|
9 |
Parses Google Calendar feeds and displays the events as a calendar grid or list on a page, post or widget.
|
10 |
|
18 |
* Displays events as a list or within a calendar grid
|
19 |
* Events from multiple Google Calendar feeds can be shown in a single list / grid
|
20 |
* Lists and grids can be displayed in posts, pages or within a widget
|
21 |
+
* Options to change the number of events retrieved, date / time format, cache duration etc
|
22 |
+
* Complete customisation of the event information displayed
|
23 |
* Calendar grids can have the ability to change the month displayed, utilising AJAX
|
24 |
|
25 |
Please visit the plugin homepage for how to get started and other help:
|
30 |
|
31 |
* [Demo Page](http://www.rhanney.co.uk/plugins/google-calendar-events/gce-demo)
|
32 |
|
33 |
+
I've also written a post explaining the new features and changes in version 0.5:
|
34 |
|
35 |
+
* [0.5 Features](http://www.rhanney.co.uk/2011/04/18/google-calendar-events-0-5)
|
36 |
|
37 |
== Installation ==
|
38 |
|
39 |
+
Use the automatic installer from within the WordPress admin, or:
|
40 |
|
41 |
1. Download the `.zip` file by clicking on the Download button on the right
|
42 |
1. Unzip the file
|
56 |
|
57 |
== Changelog ==
|
58 |
|
59 |
+
= 0.5 =
|
60 |
+
* Added [event display builder](http://www.rhanney.co.uk/plugins/google-calendar-events/event-display-builder) feature, which vastly improves the customization possibilities of the plugin. This feature encompasses many of the most requested features, such as:
|
61 |
+
- All-day events can be handled differently than 'normal' events
|
62 |
+
- Start and end times / dates can be displayed on the same line (as can any other event information)
|
63 |
+
- HTML (and Markdown) entered in Google Calendar fields can be properly parsed
|
64 |
+
* Start and end times for retrieval of events are now much more flexible
|
65 |
+
* A custom error message for non-admin users can now be specified
|
66 |
+
* No longer loads SimplePie when it is not required
|
67 |
|
68 |
+
= 0.4.1 =
|
69 |
* Fix / workaround for the long-running timezone bug. Please take a look at [this](http://www.rhanney.co.uk/2011/01/16/google-calendar-events-0-4-1) for more information.
|
70 |
* Added additional 'Maximum no. events to display' option to widget / shortcode (mainly to address a further issue caused by the above fix)
|
71 |
* i18n related bug fix
|
122 |
|
123 |
== Upgrade Notice ==
|
124 |
|
125 |
+
= 0.5 =
|
126 |
+
Event retrieval date / time range is now much more flexible. Also adds event display builder, which allows much greater customization of the event information displayed.
|
127 |
|
128 |
== Frequently Asked Questions ==
|
129 |
|
screenshot-1.jpg
CHANGED
Binary file
|
screenshot-2.jpg
CHANGED
Binary file
|
widget/gce-widget.php
CHANGED
@@ -38,14 +38,19 @@ class GCE_Widget extends WP_Widget{
|
|
38 |
|
39 |
//Check that at least one valid feed id has been entered
|
40 |
if(count((array)$feed_ids) == 0 || $no_feeds_exist){
|
41 |
-
|
|
|
|
|
|
|
|
|
|
|
42 |
}else{
|
43 |
//Turns feed_ids back into string or feed ids delimited by '-' ('1-2-3-4' for example)
|
44 |
$feed_ids = implode('-', $feed_ids);
|
45 |
|
46 |
$title_text = $instance['display_title'] ? $instance['display_title_text'] : null;
|
47 |
|
48 |
-
$max_events = $instance['max_events'];
|
49 |
|
50 |
//Output correct widget content based on display type chosen
|
51 |
switch($instance['display_type']){
|
@@ -76,7 +81,12 @@ class GCE_Widget extends WP_Widget{
|
|
76 |
}
|
77 |
}
|
78 |
}else{
|
79 |
-
|
|
|
|
|
|
|
|
|
|
|
80 |
}
|
81 |
|
82 |
//Output after widget stuff
|
@@ -151,7 +161,13 @@ function gce_widget_content_grid($feed_ids, $title_text, $max_events, $widget_id
|
|
151 |
|
152 |
echo $grid->get_grid($year, $month, $ajaxified);
|
153 |
}else{
|
154 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
155 |
}
|
156 |
}
|
157 |
|
@@ -163,7 +179,13 @@ function gce_widget_content_list($feed_ids, $title_text, $max_events, $grouped =
|
|
163 |
if(count($list->get_errors()) == 0){
|
164 |
echo $list->get_list($grouped);
|
165 |
}else{
|
166 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
167 |
}
|
168 |
}
|
169 |
?>
|
38 |
|
39 |
//Check that at least one valid feed id has been entered
|
40 |
if(count((array)$feed_ids) == 0 || $no_feeds_exist){
|
41 |
+
if(current_user_can('manage_options')){
|
42 |
+
_e('No valid Feed IDs have been entered for this widget. Please check that you have entered the IDs correctly and that the Feeds have not been deleted.', GCE_TEXT_DOMAIN);
|
43 |
+
}else{
|
44 |
+
$options = get_option(GCE_GENERAL_OPTIONS_NAME);
|
45 |
+
echo $options['error'];
|
46 |
+
}
|
47 |
}else{
|
48 |
//Turns feed_ids back into string or feed ids delimited by '-' ('1-2-3-4' for example)
|
49 |
$feed_ids = implode('-', $feed_ids);
|
50 |
|
51 |
$title_text = $instance['display_title'] ? $instance['display_title_text'] : null;
|
52 |
|
53 |
+
$max_events = (isset($instance['max_events']) ? $instance['max_events'] : 0);
|
54 |
|
55 |
//Output correct widget content based on display type chosen
|
56 |
switch($instance['display_type']){
|
81 |
}
|
82 |
}
|
83 |
}else{
|
84 |
+
if(current_user_can('manage_options')){
|
85 |
+
_e('No feeds have been added yet. You can add a feed in the Google Calendar Events settings.', GCE_TEXT_DOMAIN);
|
86 |
+
}else{
|
87 |
+
$options = get_option(GCE_GENERAL_OPTIONS_NAME);
|
88 |
+
echo $options['error'];
|
89 |
+
}
|
90 |
}
|
91 |
|
92 |
//Output after widget stuff
|
161 |
|
162 |
echo $grid->get_grid($year, $month, $ajaxified);
|
163 |
}else{
|
164 |
+
//If current user is an admin, display an error message explaining problem. Otherwise, display a 'nice' error messsage
|
165 |
+
if(current_user_can('manage_options')){
|
166 |
+
printf(__('The following feeds were not parsed successfully: %s. Please check that the feed URLs are correct and that the feeds have public sharing enabled.'), implode(', ', $grid->get_errors()));
|
167 |
+
}else{
|
168 |
+
$options = get_option(GCE_GENERAL_OPTIONS_NAME);
|
169 |
+
echo $options['error'];
|
170 |
+
}
|
171 |
}
|
172 |
}
|
173 |
|
179 |
if(count($list->get_errors()) == 0){
|
180 |
echo $list->get_list($grouped);
|
181 |
}else{
|
182 |
+
//If current user is an admin, display an error message explaining problem. Otherwise, display a 'nice' error messsage
|
183 |
+
if(current_user_can('manage_options')){
|
184 |
+
printf(__('The following feeds were not parsed successfully: %s. Please check that the feed URLs are correct and that the feeds have public sharing enabled.'), implode(', ', $list->get_errors()));
|
185 |
+
}else{
|
186 |
+
$options = get_option(GCE_GENERAL_OPTIONS_NAME);
|
187 |
+
echo $options['error'];
|
188 |
+
}
|
189 |
}
|
190 |
}
|
191 |
?>
|