This repository has been archived by the owner on Mar 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsettings.php
1911 lines (1869 loc) · 111 KB
/
settings.php
1
2
3
4
5
6
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
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
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
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
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
374
375
376
377
378
379
380
381
382
383
384
385
386
387
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
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
add_action('init', 'qem_settings_init');
add_action("admin_menu","event_page_init");
add_action("save_post", "save_event_details");
add_action("admin_notices","qem_admin_notice");
add_action("add_meta_boxes","action_add_meta_boxes", 0 );
add_action("manage_posts_custom_column","event_custom_columns");
add_action( 'admin_menu', 'qem_admin_pages' );
add_filter("manage_event_posts_columns","event_edit_columns");
add_filter("manage_edit-event_sortable_columns","event_date_column_register_sortable");
add_filter("request","event_date_column_orderby");
add_action('plugin_row_meta', 'qem_plugin_row_meta', 10, 2 );
function qem_tabbed_page() {
echo '<h1>Quick Event Manager</h1>';
if ( isset ($_GET['tab'])) {
qem_admin_tabs($_GET['tab']);
$tab = $_GET['tab'];
} else {
qem_admin_tabs('setup'); $tab = 'setup';
}
switch ($tab) {
case 'setup' : qem_setup(); break;
case 'settings' : qem_event_settings(); break;
case 'display' : qem_display_page(); break;
case 'calendar' : qem_calendar(); break;
case 'styles' : qem_styles(); break;
case 'register' : qem_register(); break;
case 'payment' : qem_payment(); break;
case 'template' : qem_template(); break;
case 'coupon' : qem_coupon_codes(); break;
case 'donate' : qem_donate_page(); break;
case 'auto' : qem_autoresponse_page(); break;
}
}
function qem_admin_tabs($current = 'settings') {
$tabs = array(
'setup' => __('Setup', 'quick-event-manager'),
'settings' => __('Event Settings', 'quick-event-manager'),
'display' => __('Event Display', 'quick-event-manager'),
'styles' => __('Styling', 'quick-event-manager'),
'calendar' => __('Calendar', 'quick-event-manager'),
'register' => __('Registration', 'quick-event-manager'),
'auto' => __('Auto Responder', 'quick-event-manager'),
'payment' => __('Payments', 'quick-event-manager'),
'template' => __('Template', 'quick-event-manager')
);
echo '<div id="icon-themes" class="icon32"><br></div>';
echo '<h2 class="nav-tab-wrapper">';
foreach( $tabs as $tab => $name ) {
$class = ( $tab == $current ) ? ' nav-tab-active' : '';
echo "<a class='nav-tab$class' href='?page=quick-event-manager/settings.php&tab=$tab'>$name</a>";
}
echo '</h2>';
}
function qem_setup() {
$content = '<div class="qem-settings"><div class="qem-options">
<h2>'.__('Setting up and using the plugin', 'quick-event-manager').'</h2>
<p><span style="color:red; font-weight:bold;">'. __('Important!', 'quick-event-manager').'</span> '.__('If you get an error when trying to view events, resave your', 'quick-event-manager').' <a href="options-permalink.php">permalinks</a>.</p>
<p>'.__('Create new events using the', 'quick-event-manager').' <a href="edit.php?post_type=event">Events</a> '.__('link on your dashboard menu', 'quick-event-manager').'.</p>
<p>'.__('To display a list of events on your posts or pages use the shortcode: [qem]', 'quick-event-manager').'.</p>
<p>'.__('If you prefer to display your events as a calendar use the shortcode', 'quick-event-manager').': [qemcalendar].</p>
<p>'.__('More shortcodes on the right', 'quick-event-manager').'.</p>
<p>'.__('That's pretty much it. All you need to do now is', 'quick-event-manager').' <a href="edit.php?post_type=event">'.__('create some events', 'quick-event-manager').'</a>.</p>
<h2>'.__('Help and Support', 'quick-event-manager').'</h2>
<p>'.__('Help at', 'quick-event-manager').' <a href="http://quick-plugins.com/quick-event-manager/" target="_blank">quick-plugins.com</a> '.__('along with a feedback form. Or you can email me at ', 'quick-event-manager').'<a href="mailto:mail@quick-plugins.com">mail@quick-plugins.com</a>.</p>'.qemdonate_loop().'
<h2>'.__('Translations', 'quick-event-manager').'</h2>
<p>Brazilian: Julias - <a href ="http://www.juliusmiranda.com/">juliusmiranda.com</a></p>
<p>Czech: Augustin - <a href ="http://zidek.eu/">zidek.eu</a></p>
<p>French: Bernard - <a href ="http://sorties-en-creuse.fr/">sorties-en-creuse.fr</a></p>
<p>German: Tameer - <a href ="bloc-rockers-eifel.de">bloc-rockers-eifel.de</a></p>
<p>Russian: Alexey - <a href ="http://hakuna-matata.spb.ru/">hakuna-matata.spb.ru</a></p>
</div>
<div class="qem-options" style="float:right">
<h2>'.__('Event Manager Role', 'quick-event-manager').'</h2>
<p>'.__('There is a user role called <em>Event Manager</em>. Users with this role only have access to events, they cannot edit posts or pages.', 'quick-event-manager').'</p>
<h2>'.__('Settings', 'quick-event-manager').'</h2>
<h3><a href="?page=quick-event-manager/settings.php&tab=settings">'.__('Event Settings', 'quick-event-manager').'</a></h3>
<p>'.__('Select which fields are displayed in the event list and event page. Change actions and style of each field', 'quick-event-manager').'</p>
<h3><a href="?page=quick-event-manager/settings.php&tab=display">'.__('Event Display', 'quick-event-manager').'</a></h3>
<p>'.__('Edit event messages and display options', 'quick-event-manager').'</p>
<h3><a href="?page=quick-event-manager/settings.php&tab=styles">'.__('Event Styling', 'quick-event-manager').'</a></h3>
<p>'.__('Styling options for the date icon and overall event layout', 'quick-event-manager').'</p>
<h3><a href="?page=quick-event-manager/settings.php&tab=calendar">'.__('Calendar Options', 'quick-event-manager').'</a></h3>
<p>'.__('Show events as a calendar. Some styling and display options', 'quick-event-manager').'.</p>
<h3><a href="?page=quick-event-manager/settings.php&tab=register">'.__('Event Registration', 'quick-event-manager').'</a></h3>
<p>'.__('Add a registration form and attendee reports to your events', 'quick-event-manager').'.</p>
<h3><a href="?page=quick-event-manager/settings.php&tab=payment">'.__('Event Payments', 'quick-event-manager').'</a></h3>
<p>'.__('Configure event payments', 'quick-event-manager').'</p>
<h3><a href="?page=quick-event-manager/quick-event-messages.php">'.__('Registration Report', 'quick-event-manager').'</a></h3>
<p>'.__('View, edit and download event registrations', 'quick-event-manager').'. '.__('Access using the <b>Registration</b> link on your dashboard menu', 'quick-event-manager').'.</p>
<h2>'.__('Primary Shortcodes', 'quick-event-manager').'</h2>
<table>
<tbody>
<tr>
<td>[qem]</td>
<td>'.__('Standard event list', 'quick-event-manager').'</td>
</tr>
<tr>
<td>[qemcalendar]</td>
<td>'.__('Calendar view', 'quick-event-manager').'</td>
</tr>
<tr>
<td>[qem posts=\'99\']</td>
<td>'.__('Set the number of events to display', 'quick-event-manager').'</td>
</tr>
<tr>
<td>[qem id=\'archive\']</td>
<td>'.__('Show old events', 'quick-event-manager').'</td>
</tr>
<tr>
<td>[qem category=\'name\']</td>
<td>'.__('List events by category', 'quick-event-manager').'</td>
</tr>
</tbody>
</table>
<p>'.__('There are loads more shortcode options listed on the', 'quick-event-manager').' <a href="http://quick-plugins.com/quick-event-manager/all-the-shortcodes/" target="_blank">'.__('Plugin Website', 'quick-event-manager').'</a> ('.__('link opens in a new tab', 'quick-event-manager').').';
$content .= '</div></div>';
echo $content;
}
function qem_event_settings() {
$active_buttons = array('field1','field2','field3','field4','field5','field6','field7');
if( isset( $_POST['Submit']) && check_admin_referer("save_qem")) {
foreach ( $active_buttons as $item) {
$event['active_buttons'][$item] = (isset($_POST['event_settings_active_'.$item]) and $_POST['event_settings_active_'.$item] =='on') ? true : false;
$event['summary'][$item] = (isset( $_POST['summary_'.$item]) );
$event['bold'][$item] = (isset( $_POST['bold_'.$item]) );
$event['italic'][$item] = (isset( $_POST['italic_'.$item]) );
$event['colour'][$item] = filter_var($_POST['colour_'.$item],FILTER_SANITIZE_STRING);
$event['size'][$item] = filter_var($_POST['size_'.$item],FILTER_SANITIZE_STRING);
if (!empty ( $_POST['label_'.$item])) {
$event['label'][$item] = stripslashes($_POST['label_'.$item]);
filter_var($event['label'][$item],FILTER_SANITIZE_STRING);
}
}
$option = array(
'sort',
'description_label',
'address_label',
'url_label',
'cost_label',
'start_label',
'finish_label',
'location_label',
'organiser_label',
'show_telephone',
'show_map',
'target_link',
'publicationdate'
);
foreach ($option as $item) {
$event[$item] = stripslashes($_POST[$item]);
$event[$item] = filter_var($event[$item],FILTER_SANITIZE_STRING);
}
update_option( 'event_settings', $event);
qem_admin_notice(__('The form settings have been updated', 'quick-event-manager'));
}
if( isset( $_POST['Reset']) && check_admin_referer("save_qem")) {
delete_option('event_settings');
qem_create_css_file ('update');
qem_admin_notice (__('The event settings have been reset', 'quick-event-manager')) ;
}
$event = event_get_stored_options();
$$event['dateformat'] = 'checked';
$$event['date_background'] = 'checked';
$$event['event_order'] = 'checked';
$$event['publicationdate'] = 'checked';
if ($event['show_map'] == 'checked') $map = 'checked';
$content = '<script>
jQuery(function() {var qem_sort = jQuery( "#qem_sort" ).sortable({axis: "y",update:function(e,ui) {var order = qem_sort.sortable("toArray").join();jQuery("#qem_settings_sort").val(order);}});});
</script>
<div class ="qem-options" style="width:98%">
<form id="event_settings_form" method="post" action="">
<p>'.__('Use the check boxes to select which fields to display in the event post and the event list', 'quick-event-manager').'.</p>
<p>'.__('Drag and drop to change the order of the fields', 'quick-event-manager').'.</p>
<p>'.__('The fields with the blue border are for optional captions. For example: <span style="border:1px solid blue;">The cost is</span> {cost} will display as <em>The cost is 20 Zlotys</em>. If you leave it blank just <em>20 Zlotys</em> will display', 'quick-event-manager').'.</p>
<table id="sorting">
<thead>
<tr>
<th width="15%">'.__('Show in event post', 'quick-event-manager').'</th>
<th width="10%">'.__('Show in<br>event list', 'quick-event-manager').'</th>
<th width="15%">'.__('Colour', 'quick-event-manager').'</th>
<th width="5%">'.__('Font<br>size', 'quick-event-manager').'</th>
<th width="10%">'.__('Font<br>attributes', 'quick-event-manager').'</th>
<th>'.__('Caption and display options', 'quick-event-manager').':</th>
</tr>
</thead><tbody id="qem_sort">';
$sort = explode(",", $event['sort']);
foreach (explode( ',',$event['sort']) as $name) {
$checked = ( $event['active_buttons'][$name]) ? 'checked' : '';
$summary = ( $event['summary'][$name]) ? 'checked' : '';
$bold = ( $event['bold'][$name]) ? 'checked' : '';
$italic = ( $event['italic'][$name]) ? 'checked' : '';
$options = '';
switch ( $name ) {
case 'field1':
$options = '<input type="text" style="border:1px solid blue; width:10em; padding: 1px; margin:0;" name="description_label" . value ="' . $event['description_label'] . '" /> {'.__('description', 'quick-event-manager').'}';
break;
case 'field2':
$options = '<input type="text" style="border:1px solid blue; width:6em; padding: 1px; margin:0;" name="start_label" . value ="' . $event['start_label'] . '" /> {'.__('start time', 'quick-event-manager').'} <input type="text" style="border:1px solid blue; width:6em; padding: 1px; margin:0;" name="finish_label" . value ="' . $event['finish_label'] . '" /> {'.__('end time', 'quick-event-manager').'}';
break;
case 'field3':
$options = '<input type="text" style="border:1px solid blue; width:6em; padding: 1px; margin:0;" name="location_label" . value ="' . $event['location_label'] . '" /> {'.__('venue', 'quick-event-manager').'}';
break;
case 'field4':
$options = '<input type="text" style="border:1px solid blue; width:10em; padding: 1px; margin:0;" name="address_label" . value ="' . $event['address_label'] . '" /> {'.__('address', 'quick-event-manager').'} <input type="checkbox" name="show_map"' . $event['show_map'] . ' value="checked" /> '.__('Show map (if address is given)', 'quick-event-manager').' ';
break;
case 'field5':
$options = '<input type="text" style="border:1px solid blue; width:10em; padding: 1px; margin:0;" name="url_label" . value ="' . $event['url_label'] . '" /> {url}';
break;
case 'field6':
$options = '<input type="text" style="border:1px solid blue; width:10em; padding: 1px; margin:0;" name="cost_label" . value ="' . $event['cost_label'] . '" /> {'.__('cost', 'quick-event-manager').'}';
break;
case 'field7':
$options = '<input type="text" style="border:1px solid blue; width:10em; padding: 1px; margin:0;" name="organiser_label" . value ="' . $event['organiser_label'] . '" /> {'.__('organiser', 'quick-event-manager').'} <input type="checkbox" name="show_telephone"' . $event['show_telephone'] . ' value="checked" /> '.__('Show orgainser\'s contact details', 'quick-event-manager').' ';;
break;
}
$li_class = ( $checked) ? 'button_active' : 'button_inactive';
$content .= '<tr class="ui-state-default '.$li_class.' '.$first.'" id="' . $name . '"><td>
<input type="checkbox" class="button_activate" style="border: none; padding: 0; margin:0;" name="event_settings_active_'.$name.'" '.$checked.' />
<b>' . $event['label'][$name] . '</b></td>
<td><input type="checkbox" style="border: none; padding: 0; margin:0;" name="summary_'.$name.'" '.$summary.' /></td>
<td><input type="text" class="qem-color" name="colour_'.$name.'" value ="' . $event['colour'][$name].'" /></td>
<td><input type="text" style="padding:1px;width:3em;border: 1px solid #343838;" name="size_'.$name.'" value ="'.$event['size'][$name].'" />%</td>
<td><input type="checkbox" style="border: none; padding: 0; margin:0;" name="bold_'.$name.'" '.$bold.' /> Bold <input type="checkbox" style="border: none; padding: 0; margin:0;" name="italic_'.$name.'" '.$italic.' /> Italic</td>
<td>'.$options.'</td>
</tr>';
}
$content .='</tbody></table>
<h2>Publication Date</h2>
<p><input type="checkbox" style="border: none; padding: 0; margin:0;" name="publicationdate" value="checked" ' . $event['publicationdate'] . ' /></td><td> '.__('Make publication date the same as the event date', 'quick-event-manager').'</p>
<input type="hidden" id="qem_settings_sort" name="sort" value="'.$event['sort'].'" />
<p><input type="submit" name="Submit" class="button-primary" style="color: #FFF;" value="'.__('Save Changes', 'quick-event-manager').'" /> <input type="submit" name="Reset" class="button-primary" style="color: #FFF;" value="'.__('Reset', 'quick-event-manager').'" onclick="return window.confirm( \' '.__('Are you sure you want to reset the display settings?', 'quick-event-manager').'\' );"/></p>';
$content .= wp_nonce_field("save_qem");
$content .= '</form>
<h2>'.__('Shortcode and Widget Field Selection', 'quick-event-manager').'</h2>
<p>'.__('If you want a custom layout for a specific list you can use the shortcode [qem fields=1,2,5].', 'quick-event-manager').' '.__('On the <a href="/wp-admin/widgets.php">widget</a> just enter the field numbers seperated with commas.', 'quick-event-manager').'<p>
<p>'.__('The numbers correspond to the fields like this', 'quick-event-manager').': <p>
<ol>
<li>'.__('Short description', 'quick-event-manager').'</li>
<li>'.__('Event Time', 'quick-event-manager').'</li>
<li>'.__('Cost', 'quick-event-manager').'</li>
<li>'.__('Venue', 'quick-event-manager').'</li>
<li>'.__('Address', 'quick-event-manager').'</li>
<li>'.__('Website', 'quick-event-manager').'</li>
<li>'.__('Organiser', 'quick-event-manager').'</li>
</ol>
<p>'.__('The order of the fields and other options is set using the drag and drop selectors above', 'quick-event-manager').'</p></div>';
echo $content;
}
function qem_display_page() {
if( isset( $_POST['Submit']) && check_admin_referer("save_qem")) {
$option = array(
'show_end_date',
'read_more',
'noevent',
'event_archive',
'event_descending',
'external_link',
'external_link_target',
'linkpopup',
'recentposts',
'event_image',
'back_to_list',
'back_to_list_caption',
'back_to_url',
'map_width',
'map_height',
'map_in_list',
'map_and_image',
'map_and_image_size',
'map_target',
'event_image_width',
'image_width',
'combined',
'monthheading',
'useics',
'uselistics',
'useicsbutton',
'usetimezone',
'timezonebefore',
'timezoneafter',
'amalgamated',
'vertical',
'norepeat',
'monthtype',
'categorylocation',
'showcategory',
'readmorelink',
'titlelink'
);
foreach ($option as $item) {
$display[$item] = stripslashes($_POST[$item]);
$display[$item] = filter_var($display[$item],FILTER_SANITIZE_STRING);
}
update_option('qem_display', $display);
qem_create_css_file ('update');
qem_admin_notice (__('The display settings have been updated', 'quick-event-manager'));
}
if( isset( $_POST['Reset']) && check_admin_referer("save_qem")) {
delete_option('qem_display');
qem_create_css_file ('update');
qem_admin_notice (__('The display settings have been reset', 'quick-event-manager')) ;
}
$short = $full = $title = $date = '';
$display = event_get_stored_display();
$$display['event_order'] = 'checked';
$$display['show_end_date'] = 'checked';
$$display['localization'] = 'selected';
$$display['monthtype'] = 'checked';
$$display['categorylocation'] = 'checked';
if ( $display['event_archive'] == "checked") $archive = "checked";
$content = '<style>'.qem_generate_css().'</style>
<div class="qem-settings">
<div class="qem-options">
<form id="event_settings_form" method="post" action="">
<table>
<tr>
<td colspan="2"><h2>'.__('End Date Display', 'quick-event-manager').'</h2></td>
</tr>
<tr>
<td width="5%"><input type="checkbox" style="border: none; padding: 0; margin:0;" name="show_end_date" value="checked" ' . $display['show_end_date'] . ' /></td><td width="95%"> '.__('Show end date in event list', 'quick-event-manager').'</td>
</tr>
<tr>
<td><input type="checkbox" style="border: none; padding: 0; margin:0;" name="combined" value="checked" ' . $display['combined'] . ' /></td><td> '.__('Combine Start and End dates into one box', 'quick-event-manager').'</td>
</tr>
<tr>
<td><input type="checkbox" style="border: none; padding: 0; margin:0;" name="amalgamated" value="checked" ' . $display['amalgamated'] . ' /></td><td> '.__('Show combined Start and End dates if in the same month', 'quick-event-manager').'</td>
</tr>
<tr>
<td><input type="checkbox" style="border: none; padding: 0; margin:0;" name="norepeat" value="checked" ' . $display['norepeat'] . ' /></td><td> '.__('Only show icon on first event if more than one event on that day', 'quick-event-manager').'</td>
</tr>
<tr>
<td><input type="checkbox" style="border: none; padding: 0; margin:0;" name="vertical" value="checked" ' . $display['vertical'] . ' /></td><td> '.__('Show start and end dates above one another', 'quick-event-manager').'</td>
</tr>
<tr>
<td colspan="2"><h2>'.__('Event Messages', 'quick-event-manager').'</h2></td>
</tr>
<tr>
<td colspan="2">'.__('Read more caption', 'quick-event-manager').': <input type="text" style="width:20em;" label="read_more" name="read_more" value="' . $display['read_more'] . '" /></td>
</tr>
<tr>
<td colspan="2">'.__('No events message', 'quick-event-manager').': <input type="text" style="width:20em;" label="noevent" name="noevent" value="' . $display['noevent'] . '" /></td>
</tr>
<tr>
<td colspan="2"><h2>'.__('Event List Options', 'quick-event-manager').'</h2></td>
</tr>
<tr>
<td><input type="checkbox" style="border: none; padding: 0; margin:0;" name="event_descending" value="checked" ' . $display['event_descending'] . ' /></td>
<td> '.__('List events in reverse order (from future to past)', 'quick-event-manager').'</td>
</tr>
<tr>
<td><input type="checkbox" style="border: none; padding: 0; margin:0;" name="event_archive" value="checked" ' . $display['event_archive'] . ' /></td>
<td> '.__('Show past events in the events list', 'quick-event-manager').'<br><span class="description">'.__('If you only want to display past events use the shortcode: [qem id="archive"]', 'quick-event-manager').'.</span></td>
</tr>
<tr>
<td><input type="checkbox" style="border: none; padding: 0; margin:0;" name="monthheading" value="checked" ' . $display['monthheading'] . ' /></td>
<td> '.__('Split the list into month/year sections', 'quick-event-manager').'</td>
</tr>
<tr>
<td></td>
<td><input type="radio" name="monthtype" value="short" ' . $short . ' /> '.__('Short (Aug)', 'quick-event-manager').' <input type="radio" name="monthtype" value="full" ' . $full . ' /> '.__('Full (August)', 'quick-event-manager').'</td>
</tr>
<tr>
<td><input type="checkbox" name="recentposts"' . $display['recentposts'] . ' value="checked" /></td>
<td>'.__('Show events in recent posts list', 'quick-event-manager').'</td>
</tr>
<tr>
<td><input type="checkbox" style="border: none; padding: 0; margin:0;" name="showcategory" value="checked" ' . $display['showcategory'] . ' /></td>
<td> '.__('Show category', 'quick-event-manager').'</td>
</tr>
<tr>
<td></td>
<td><input type="radio" name="categorylocation" value="title" ' . $title . ' /> '.__('Next to title', 'quick-event-manager').' <input type="radio" name="categorylocation" value="date" ' . $date . ' /> '.__('Next to date (if no icon styling)', 'quick-event-manager').'</td>
</tr>
<tr>
<td></td>
<td>Add an Event Category key to your list using the settings on the <a href="?page=quick-event-manager/settings.php&tab=styles">Event Styling</a> page.</td>
</tr>
<tr>
<td colspan="2"><h2>Download to Calendar</h2>
<p>Download event as a calender file.</p></td>
</tr>
<tr>
<td><input type="checkbox" style="border: none; padding: 0; margin:0;" name="useics" value="checked" ' . $display['useics'] . ' /></td>
<td> '.__('Add download button to event', 'quick-event-manager').'</td>
</tr>
<tr>
<td><input type="checkbox" style="border: none; padding: 0; margin:0;" name="uselistics" value="checked" ' . $display['uselistics'] . ' /></td>
<td> '.__('Add download button to event list', 'quick-event-manager').'</td>
</tr>
<tr>
<td></td>
<td>'.__('Button text:', 'quick-event-manager').' <input type="text" style="width:50%;" label="useicsbutton" name="useicsbutton" value="' . $display['useicsbutton'] . '" /></td>
</tr>
<tr>
<td colspan="2"><h2>Event Linking Options</h2></td>
</tr>
<tr>
<td><input type="checkbox" style="border: none; padding: 0; margin:0;" name="external_link" value="checked" ' . $display['external_link'] . ' /></td>
<td> '.__('Link to external website from event list', 'quick-event-manager').'</td>
</tr>
<tr>
<td><input type="checkbox" name="external_link_target"' . $display['external_link_target'] . ' value="checked" /></td>
<td>'.__('Open external links in new tab/page', 'quick-event-manager').'</td>
</tr>
<tr>
<td><input type="checkbox" name="linkpopup"' . $display['linkpopup'] . ' value="checked" /></td>
<td>'.__('Open event in lightbox', 'quick-event-manager').' ('.__('Warning: doesn\'t always behave as expected on small screens', 'quick-event-manager').').</td>
</tr>
<tr>
<td><input type="checkbox" style="border: none; padding: 0; margin:0;" name="titlelink" value="checked" ' . $display['titlelink'] . ' /></td>
<td> '.__('Remove link from event title and event image', 'quick-event-manager').'</td>
</tr>
<tr>
<td><input type="checkbox" style="border: none; padding: 0; margin:0;" name="readmorelink" value="checked" ' . $display['readmorelink'] . ' /></td>
<td> '.__('Hide Read More link', 'quick-event-manager').'</td>
</tr>
<tr>
<td><input type="checkbox" style="border: none; padding: 0; margin:0;" name="back_to_list" value="checked" ' . $display['back_to_list'] . ' /></td>
<td> '.__('Add a link to events to go back to the event list', 'quick-event-manager').'</td>
</tr>
<tr>
<td></td>
<td>'.__('Enter URL to link to a specific page. Leave blank to just go back one page', 'quick-event-manager').':<br>
<input type="text" style="" label="back_to_url" name="back_to_url" value="' . $display['back_to_url'] . '" /></td>
</tr>
<tr>
<td></td>
<td>'.__('Link caption', 'quick-event-manager').': <input type="text" style="width:50%;" label="back_to_list_caption" name="back_to_list_caption" value="' . $display['back_to_list_caption'] . '" /></td>
</tr>
<tr>
<td colspan="2"><h2>'.__('Maps and Images', 'quick-event-manager').'</h2><td>
</tr>
<tr>
<td colspan="2">'.__('The map will only display if you have a valid address and the ’show map’ checkbox is ticked on the <a href="?page=quick-event-manager/settings.php&tab=settings">Event Settings</a> page. If you add an image to the event it will replace the map unless you use the option to display both.', 'quick-event-manager').'</td>
</tr>
<tr>
<td colspan="2">'.__('Map Width', 'quick-event-manager').': <input type="text" style=" width:3em; padding: 1px; margin:0;" name="map_width" . value ="' . $display['map_width'] . '" /> px '.__('Map Height', 'quick-event-manager').': <input type="text" style=" width:3em; padding: 1px; margin:0;" name="map_height" . value ="' . $display['map_height'] . '" /> px</td>
</tr>
<tr>
<td><input type="checkbox" style="border: none; padding: 0; margin:0;" name="map_in_list" value="checked" ' . $display['map_in_list'] . ' /></td>
<td>'.__('Show map in event list', 'quick-event-manager').'</td>
</tr>
<tr>
<td><input type="checkbox" style="border: none; padding: 0; margin:0;" name="map_target" value="checked" ' . $display['map_target'] . ' /></td>
<td>'.__('Open map in new tab/window', 'quick-event-manager').'</td>
</tr>
<tr>
<td colspan="2">'.__('Event Image Max Width', 'quick-event-manager').': <input type="text" style=" width:3em; padding: 1px; margin:0;" name="event_image_width" . value ="' . $display['event_image_width'] . '" /> px</td>
</tr>
<tr>
<td><input type="checkbox" style="border: none; padding: 0; margin:0;" name="event_image" value="checked" ' . $display['event_image'] . ' /></td>
<td>'.__('Show event image in event list', 'quick-event-manager').'. '.__('Max Width', 'quick-event-manager').': <input type="text" style=" width:3em; padding: 1px; margin:0;" name="image_width" . value ="' . $display['image_width'] . '" /> px</td>
</tr>
<tr>
<td><input type="checkbox" style="border: none; padding: 0; margin:0;" name="map_and_image" value="checked" ' . $display['map_and_image'] . ' /></td>
<td>'.__('Show event map and image', 'quick-event-manager').'</td>
</tr>
<tr>
<td><input type="checkbox" style="border: none; padding: 0; margin:0;" name="map_and_image_size" value="checked" ' . $display['map_and_image_size'] . ' /></td>
<td>'.__('Make image the same width as the map', 'quick-event-manager').'</td>
</tr>
<tr>
<td colspan="2"><h2>'.__('Timezones', 'quick-event-manager').'</h2></td>
</tr>
<tr>
<td><input type="checkbox" name="usetimezone"' . $display['usetimezone'] . ' value="checked" /></td>
<td>'.__('Show timeszones on your events', 'quick-event-manager').'</td>
</tr>
<tr>
<td colspan="2"><input type="text" style="width:40%;" name="timezonebefore" value="' . $display['timezonebefore'] . '" /> {timezone} <input type="text" style="width:40%;" name="timezoneafter" value="' . $display['timezoneafter'] . '" /><br>
<span class="description">'.__('This doesn\'t change the time of the event, it just shows the name of the local timeszone. Set the event timezone in the event editor.', 'quick-event-manager').'</span></td>
</tr>
<tr>
<td colspan="2"><input type="submit" name="Submit" class="button-primary" style="color: #FFF;" value="'.__('Save Changes', 'quick-event-manager').'" /> <input type="submit" name="Reset" class="button-primary" style="color: #FFF;" value="'.__('Reset', 'quick-event-manager').'" onclick="return window.confirm( \' '.__('Are you sure you want to reset the display settings?', 'quick-event-manager').'\' );"/></td>
</tr>
</table>';
$content .= wp_nonce_field("save_qem");
$content .= '</form>
</div>
<div class="qem-options" style="float:right">
<h2>'.__('Event List Preview', 'quick-event-manager').'</h2>';
$atts = array('posts' => '3');
$content .= qem_event_shortcode($atts,'');
$content .= '</div></div>';
echo $content;
}
function qem_styles() {
if( isset( $_POST['Submit']) && check_admin_referer("save_qem")) {
$options = array(
'use_head',
'font',
'font-family',
'font-size',
'header-size',
'header-colour',
'width',
'widthtype',
'event_background',
'event_backgroundhex',
'date_colour',
'date_background',
'date_backgroundhex',
'month_background',
'month_backgroundhex',
'month_colour',
'use_custom',
'custom',
'date_bold',
'date_italic',
'date_border_width',
'date_border_colour',
'calender_size',
'event_border',
'icon_corners',
'event_margin',
'line_margin',
'use_dayname',
'use_dayname_inline',
'iconorder',
'cat_border',
'vanilla',
'vanillawidget',
'linktocategories',
'showuncategorised',
'showkeyabove',
'showkeybelow',
'keycaption',
'showcategory',
'showcategorycaption',
'uselabels',
'startlabel',
'finishlabel',
'catallevents',
'catalleventscaption'
);
foreach ( $options as $item) {
$style[$item] = stripslashes($_POST[$item]);
$style[$item] = filter_var($style[$item],FILTER_SANITIZE_STRING);
}
update_option('qem_style', $style);
qem_create_css_file ('update');
qem_admin_notice (__('The form styles have been updated', 'quick-event-manager'));
}
if( isset( $_POST['Reset']) && check_admin_referer("save_qem")) {
delete_option('qem_style');
qem_create_css_file ('update');
qem_admin_notice (__('The style settings have been reset', 'quick-event-manager'));
}
$style = qem_get_stored_style();
$$style['font'] = 'checked';
$$style['widthtype'] = 'checked';
$$style['background'] = 'checked';
$$style['event_background'] = 'checked';
$$style['date_background'] = 'checked';
$$style['month_background'] = 'checked';
$$style['icon_corners'] = 'checked';
$$style['iconorder'] = 'checked';
$$style['calender_size'] = 'checked';
$content = '<style>'.qem_generate_css().'</style>
<div class="qem-settings">
<div class="qem-options">
<form method="post" action="">
<table>
<tr>
<td colspan="2"><h2>'.__('Event Width', 'quick-event-manager').'</h2></td></tr>
<tr>
<td colspan="2"><input type="radio" name="widthtype" value="percent" ' . $percent . ' /> '.__('100% (fill the available space)', 'quick-event-manager').'<br />
<input type="radio" name="widthtype" value="pixel" ' . $pixel . ' /> '.__('Pixel (fixed)', 'quick-event-manager').'<br />
'.__('Enter the max-width ', 'quick-event-manager').': <input type="text" style="width:4em;" label="width" name="width" value="' . $style['width'] . '" />px '.__('(Just enter the value, no need to add \'px\')', 'quick-event-manager').'.</td></tr>
<tr>
<td colspan="2"><h2>'.__('Font Options', 'quick-event-manager').'</h2></td>
</tr>
<tr>
<td colspan="2"><input type="radio" name="font" value="theme" ' . $theme . ' /> '.__('Use your theme font styles', 'quick-event-manager').'<br />
<input type="radio" name="font" value="plugin" ' . $plugin . ' /> '.__('Use Plugin font styles (enter font family and size below)', 'quick-event-manager').'</td></tr>
<tr>
<td>'.__('Font Family', 'quick-event-manager').':</td>
<td><input type="text" style="" label="font-family" name="font-family" value="' . $style['font-family'] . '" /></td></tr>
<tr>
<td>'.__('Font Size', 'quick-event-manager').':</td>
<td><input type="text" style="width:4em;" label="font-size" name="font-size" value="' . $style['font-size'] . '" /><br>
<span class="description">This is the base font size, you can set the sizes of each part of the listing in the Event Settings.</span></td></tr>
<tr>
<td>'.__('Header Size', 'quick-event-manager').':</td>
<td><input type="text" style="width:4em;" label="header-size" name="header-size" value="' . $style['header-size'] . '" /> '.__('This the size of the title in the event list', 'quick-event-manager').'.</td>
</tr>
<tr>
<td>'.__('Header Colour', 'quick-event-manager').':</td>
<td><input type="text" class="qem-color" label="header-colour" name="header-colour" value="' . $style['header-colour'] . '" /></td>
</tr>
<tr>
<td colspan="2"><h2>'.__('Calender Icon', 'quick-event-manager').'</h2></td>
</tr>
<tr>
<td>'.__('Remove styles', 'quick-event-manager').'</td>
<td><input type="checkbox" style="margin:0; padding: 0; border: none" name="vanilla"' . $style['vanilla'] . ' value="checked" /> '.__('Do not style the calendar icon', 'quick-event-manager').'</td>
</tr>
<tr>
<td style="vertical-align:top;">'.__('Size', 'quick-event-manager').'</td>
<td>
<input type="radio" name="calender_size" value="small" ' . $small . ' /> '.__('Small', 'quick-event-manager').' (40px)<br />
<input type="radio" name="calender_size" value="medium" ' . $medium . ' /> '.__('Medium', 'quick-event-manager').' (60px)<br />
<input type="radio" name="calender_size" value="large" ' . $large . ' /> '.__('Large', 'quick-event-manager').'(80px)</td>
</tr>
<tr>
<td>'.__('Corners', 'quick-event-manager').'</td>
<td>
<input type="radio" name="icon_corners" value="square" ' . $square . ' /> '.__('Square', 'quick-event-manager').'
<input type="radio" name="icon_corners" value="rounded" ' . $rounded . ' /> '.__('Rounded', 'quick-event-manager').'</td>
</tr>
<tr>
<td>'.__('Border Thickness', 'quick-event-manager').'</td>
<td><input type="text" style="width:2em;" label="calendar border" name="date_border_width" value="' . $style['date_border_width'] . '" /> px</td>
</tr>
<tr>
<td>'.__('Border Colour', 'quick-event-manager').':</td>
<td><input type="text" class="qem-color" label="calendar border" name="date_border_colour" value="' . $style['date_border_colour'] . '" /><br><span class="description">'.__('There is an option below to use category colours for the icon border', 'quick-event-manager').'.</span></td>
</tr>
<tr>
<td>'.__('Calendar Icon Order', 'quick-event-manager').'</td>
<td>
<input type="radio" name="iconorder" value="default" ' . $default . ' /> '.__('DMY', 'quick-event-manager').' <input type="radio" name="iconorder" value="month" ' . $month . ' /> '.__('MDY', 'quick-event-manager').'
<input type="radio" name="iconorder" value="year" ' . $year . ' /> '.__('YDM', 'quick-event-manager').'
<input type="radio" name="iconorder" value="dm" ' . $dm . ' /> '.__('DM', 'quick-event-manager').' <input type="radio" name="iconorder" value="md" ' . $md . ' /> '.__('MD', 'quick-event-manager').'</td>
</tr>
<tr>
<td>'.__('Start/Finish Labels', 'quick-event-manager').'</td>
<td><input type="checkbox" style="margin:0; padding: 0; border: none" name="uselabels"' . $style['uselabels'] . ' value="checked" /> '.__('Show start/finish labels', 'quick-event-manager').'<br>
'.__('Start', 'quick-event-manager').': <input type="text" style="width:7em;" name="startlabel" value="' . $style['startlabel'] . '" /> '.__('Finish', 'quick-event-manager').': <input type="text" style="width:7em;" name="finishlabel" value="' . $style['finishlabel'] . '" /></td>
</tr>
<tr>
<td>'.__('Day Name', 'quick-event-manager').'</td>
<td><input type="checkbox" style="margin:0; padding: 0; border: none" name="use_dayname"' . $style['use_dayname'] . ' value="checked" /> '.__('Show day name', 'quick-event-manager').'<br>
<input type="checkbox" style="margin:0; padding: 0; border: none" name="use_dayname_inline"' . $style['use_dayname_inline'] . ' value="checked" /> '.__('Show day name inline with date', 'quick-event-manager').'</td>
</tr>
<tr>
<td style="vertical-align:top;">'.__('Date Background colour', 'quick-event-manager').'</td>
<td>
<input type="radio" name="date_background" value="grey" ' . $grey . ' /> '.__('Grey', 'quick-event-manager').'<br />
<input type="radio" name="date_background" value="red" ' . $red . ' /> '.__('Red', 'quick-event-manager').'<br />
<input type="radio" name="date_background" value="color" ' . $color . ' /> '.__('Set your own', 'quick-event-manager').'<br />
<input type="text" class="qem-color" label="background" name="date_backgroundhex" value="' . $style['date_backgroundhex'] . '" /></td>
</tr>
<tr>
<td>'.__('Date Text Colour', 'quick-event-manager').'</td>
<td><input type="text" class="qem-color" label="date colour" name="date_colour" value="' . $style['date_colour'] . '" /></td>
</tr>
<tr>
<td style="vertical-align:top;">'.__('Month Background colour', 'quick-event-manager').'</td>
<td>
<input type="radio" name="month_background" value="mwhite" ' . $mwhite . ' /> '.__('White', 'quick-event-manager').'<br />
<input type="radio" name="month_background" value="colour" ' . $colour . ' /> '.__('Set your own', 'quick-event-manager').'<br />
<input type="text" class="qem-color" name="month_backgroundhex" value="' . $style['month_backgroundhex'] . '" /></td>
</tr>
<tr>
<td>'.__('Month Text Colour', 'quick-event-manager').'</td>
<td><input type="text" class="qem-color" label="month colour" name="month_colour" value="' . $style['month_colour'] . '" /></td>
</tr>
<tr>
<td>'.__('Month Text Style', 'quick-event-manager').'</td>
<td><input type="checkbox" name="date_bold" value="checked" ' . $style['date_bold'] . ' /> '.__('Bold', 'quick-event-manager').'
<input type="checkbox" name="date_italic" value="checked" ' . $style['date_italic'] . ' /> '.__('Italic', 'quick-event-manager').'</td>
</tr>
<tr>
<td colspan="2"><h2>'.__('Event Content', 'quick-event-manager').'</h2></td>
</tr>
<tr>
<td style="vertical-align:top;">'.__('Event Border', 'quick-event-manager').'</td>
<td><input type="checkbox" style="margin:0; padding: 0; border: none" name="event_border"' . $style['event_border'] . ' value="checked" /> '.__('Add a border to the event post', 'quick-event-manager').'<br /><span class="description">'.__('Thickness and colour will be the same as the calendar icon', 'quick-event-manager').'.</span></td>
</tr>
<tr>
<td style="vertical-align:top;">'.__('Event Background Colour', 'quick-event-manager').'</td>
<td><input type="radio" name="event_background" value="bgwhite" ' . $bgwhite . ' /> '.__('White', 'quick-event-manager').'<br />
<input type="radio" name="event_background" value="bgtheme" ' . $bgtheme . ' /> '.__('Use theme colours', 'quick-event-manager').'<br />
<input type="radio" name="event_background" value="bgcolor" ' . $bgcolor . ' /> '.__('Set your own', 'quick-event-manager').'<br />
<input type="text" class="qem-color" label="background" name="event_backgroundhex" value="' . $style['event_backgroundhex'] . '" /></td>
</tr>
<tr>
<td style="vertical-align:top;">'.__('Margins and Padding', 'quick-event-manager').'</td>
<td><span class="description">'.__('Set the margins and padding of each bit using CSS shortcodes', 'quick-event-manager').':</span><br><input type="text" label="line margin" name="line_margin" value="' . $style['line_margin'] . '" /></td>
</tr>
<tr>
<td style="vertical-align:top;">'.__('Event Margin', 'quick-event-manager').'</td>
<td><span class="description">'.__('Set the margin or each event using CSS shortcodes', 'quick-event-manager').':</span><br>
<input type="text" label="margin" name="event_margin" value="' . $style['event_margin'] . '" /></td>
</tr>
<tr>
<td colspan="2"><h2>'.__('Categories', 'quick-event-manager').'</h2></td>
</tr>
<tr>
<td width="30%">'.__('Display category key', 'quick-event-manager').'</td>
<td><input type="checkbox" style="margin:0; padding: 0; border: none" name="showkeyabove" ' . $style['showkeyabove'] . ' value="checked" /> '.__('Show above event list', 'quick-event-manager').'<br>
<input type="checkbox" style="margin:0; padding: 0; border: none" name="showkeybelow" ' . $style['showkeybelow'] . ' value="checked" /> '.__('Show below event list', 'quick-event-manager').'</td>
</tr>
<tr>
<td width="30%">'.__('Caption', 'quick-event-manager').'</td>
<td><input type="text" style="" label="text" name="keycaption" value="' . $style['keycaption'] . '" /></td>
</tr>
<tr>
<td width="30%">'.__('Add link back to all events', 'quick-event-manager').'</td>
<td><input type="checkbox" style="margin:0; padding: 0; border: none" name="catallevents" ' . $style['catallevents'] . ' value="checked" /><br><span class="description">'.__('This uses the URL set on the', 'quick-event-manager').' <a href="?page=quick-event-manager/settings.php&tab=display">'.__('Event Display', 'quick-event-manager').'</a> '.__('page', 'quick-event-manager').'.</span></td>
</tr>
<tr>
<td width="30%">'.__('Caption', 'quick-event-manager').'</td>
<td><input type="text" style="" label="text" name="catalleventscaption" value="' . $style['catalleventscaption'] . '" /></td>
</tr>
<tr>
<td style="vertical-align:top;">'.__('Category Colours', 'quick-event-manager').'</td><td><input type="checkbox" style="margin:0; padding: 0; border: none" name="cat_border"' . $style['cat_border'] . ' value="checked" /> '.__('Use category colours for the event border', 'quick-event-manager').'<br />
<span class="description">'.__('Options are set on the','quick-event-manager').' <a href="?page=quick-event-manager/settings.php&tab=calendar">'.__('Calendar Settings','quick-event-manager').'</a> '.__('page', 'quick-event-manager').'.</span></td>
</tr>
<tr>
<td width="30%"></td><td><input type="checkbox" style="margin:0; padding: 0; border: none" name="showcategory" ' . $style['showcategory'] . ' value="checked" /> '.__('Show name of current category', 'quick-event-manager').'</td>
</tr>
<tr>
<td width="30%"></td>
<td>'.__('Current category label', 'quick-event-manager').':<br><input type="text" style="" label="text" name="showcategorycaption" value="' . $style['showcategorycaption'] . '" /></td>
</tr>
<tr>
<td>'.__('Linking', 'quick-event-manager').'</td>
<td><input type="checkbox" style="margin:0; padding: 0; border: none" name="linktocategories" ' . $style['linktocategories'] . ' value="checked" /> '.__('Link keys to categories', 'quick-event-manager').'<br>
<input type="checkbox" style="margin:0; padding: 0; border: none" name="showuncategorised" ' . $style['showuncategorised'] . ' value="checked" /> '.__('Show uncategorised key', 'quick-event-manager').'</td>
</tr>
</table>
<h2>'.__('Custom CSS', 'quick-event-manager').'</h2>
<p><input type="checkbox" style="margin:0; padding: 0; border: none" name="use_head"' . $style['use_head'] . ' value="checked" /> '.__('Add styles to document head', 'quick-event-manager').'. '.__('Use this option if you are unable to create or save a stylesheet for the plugin', 'quick-event-manager').'</p>
<p><input type="checkbox" style="margin:0; padding: 0; border: none" name="use_custom"' . $style['use_custom'] . ' value="checked" /> '.__('Use Custom CSS', 'quick-event-manager').'</p>
<p><textarea style="width:100%;height:100px;" name="custom">' . $style['custom'] . '</textarea></p>
<p>'.__('To see all the styling use the', 'quick-event-manager').' <a href="plugin-editor.php?file=quick-event-manager/quick-event-manager.css">'.__('CSS editor', 'quick-event-manager').'</a>.</p>
<p>'.__('The main style wrapper is the <code>.qem</code> class.', 'quick-event-manager').'</p>
<p><input type="submit" name="Submit" class="button-primary" style="color: #FFF;" value="'.__('Save Changes', 'quick-event-manager').'" /> <input type="submit" name="Reset" class="button-primary" style="color: #FFF;" value="'.__('Reset', 'quick-event-manager').'" onclick="return window.confirm( \''.__('Are you sure you want to reset the style settings?', 'quick-event-manager').'\' );"/></p>';
$content .= wp_nonce_field("save_qem");
$content .= '</form>
</div>
</div>
<div class="qem-options" style="float:right">
<h2>'.__('Event List Preview', 'quick-event-manager').'</h2>
<p>'.__('Check the event list in your site as the Wordpress Dashboard can do funny things with styles', 'quick-event-manager').'</p>';
$atts = array('posts' => '3');
$content .= qem_event_shortcode($atts,'');
$content .= '</div>';
echo $content;
}
function qem_calendar() {
if( isset( $_POST['Submit']) && check_admin_referer("save_qem")) {
$options = array(
'calday',
'caldaytext',
'day',
'eventday',
'oldday',
'eventhover',
'eventdaytext',
'eventlink',
'connect',
'calendar_text',
'calendar_url',
'eventlist_text',
'eventlist_url',
'startday',
'eventlength',
'archive',
'archivelinks',
'smallicon',
'unicode',
'eventbold',
'eventitalic',
'eventbackground',
'eventtext',
'eventborder',
'showmultiple',
'keycaption',
'showkeyabove',
'showkeybelow',
'prevmonth',
'nextmonth',
'navicon',
'leftunicode',
'rightunicode',
'linktocategories',
'showuncategorised',
'cellspacing',
'tdborder',
'header',
'headerstyle',
'eventimage',
'imagewidth',
'usetooltip',
'event_corner',
'fixeventborder',
'showmonthsabove',
'showmonthsbelow',
'monthscaption',
'hidenavigation',
'jumpto'
);
foreach ( $options as $item) {
$cal[$item] = stripslashes($_POST[$item]);
$cal[$item] = filter_var($cal[$item],FILTER_SANITIZE_STRING);
}
$arr = array('a','b','c','d','e','f','g','h','i','j');
foreach ($arr as $i) {
$cal['cat'.$i] = $_POST['cat'.$i];
$cal['cat'.$i.'back'] = $_POST['cat'.$i.'back'];
$cal['cat'.$i.'text'] = $_POST['cat'.$i.'text'];
}
update_option('qem_calendar', $cal);
qem_create_css_file ('update');
qem_admin_notice (__('The calendar settings have been updated', 'quick-event-manager'));
}
if( isset( $_POST['Reset']) && check_admin_referer("save_qem")) {
delete_option('qem_calendar');
qem_create_css_file ('update');
qem_admin_notice (__('The calendar settings have been reset', 'quick-event-manager'));
}
$calendar = qem_get_stored_calendar();
$$calendar['eventlink'] = 'checked';
$$calendar['startday'] = 'checked';
$$calendar['smallicon'] = 'checked';
$$calendar['navicon'] = 'checked';
$$calendar['header'] = 'checked';
$$calendar['event_corner'] = 'checked';
if ($cal['navicon'] == 'arrows') {
$leftnavicon = '◄ ';
$rightnavicon = ' ►';
}
if ($cal['navicon'] == 'unicodes') {
$leftnavicon = $cal['leftunicode'].' ';
$rightnavicon = ' '.$cal['rightunicode'];
}
$content = '<style>'.qem_generate_css().'</style>
<div class="qem-settings"><div class="qem-options">
<h2>'.__('Using the Calendar', 'quick-event-manager').'</h2>
<p>'.__('To add a calendar to your site use the shortcode: [qemcalendar]', 'quick-event-manager').'.</p>
<form method="post" action="">
<table width="100%">
<tr>
<td colspan="2"><h2>'.__('General Settings', 'quick-event-manager').'</h2></td>
</tr>
<tr>
<td style="vertical-align:top;">'.__('Linking to Events', 'quick-event-manager').'</td>
<td><input type="radio" name="eventlink" value="linkpopup" ' . $linkpopup . ' /> '.__('Link opens event summary in a popup', 'quick-event-manager').'<br />
<input type="radio" name="eventlink" value="linkpage" ' . $linkpage . ' /> '.__('Link opens event page' ,'quick-event-manager').'</td>
</tr>
<tr>
<td width="30%">'.__('Old Events', 'quick-event-manager').'</td>
<td><input type="checkbox" style="margin:0; padding: 0; border: none" name="archive" ' . $calendar['archive'] . ' value="checked" /> '.__('Show past events in the calendar', 'quick-event-manager').'.</td>
</tr>
<tr>
<td width="30%">'.__('Linking Calendar to the Event List', 'quick-event-manager').'</td>
<td><input type="checkbox" style="margin:0; padding: 0; border: none" name="connect"' . $calendar['connect'] . ' value="checked" /> '.__('Link Event List to Calendar Page', 'quick-event-manager').'.<br>
<span class="description">'.__('You will need to create pages for the calendar and the event list', 'quick-event-manager').'.</span>
</td>
</tr>
<tr>
<td width="30%">'.__('Calendar link text', 'quick-event-manager').'</td><td><input type="text" style="" label="calendar_text" name="calendar_text" value="' . $calendar['calendar_text'] . '" /></td></tr>
<tr><td width="30%">'.__('Calendar page URL', 'quick-event-manager').'</td><td><input type="text" style="" label="calendar_url" name="calendar_url" value="' . $calendar['calendar_url'] . '" /></td></tr>
<tr><td width="30%">'.__('Event list link text', 'quick-event-manager').'</td><td><input type="text" style="" label="eventlist_text" name="eventlist_text" value="' . $calendar['eventlist_text'] . '" /></td></tr>
<tr>
<td width="30%">'.__('Event list page', 'quick-event-manager').' URL</td>
<td><input type="text" style="" label="eventlist_url" name="eventlist_url" value="' . $calendar['eventlist_url'] . '" /></td></tr>
<tr>
<td width="30%">Navigation Labels</td>
<td><input type="text" style="width:50%;" label="text" name="prevmonth" value="' . $calendar['prevmonth'] . '" /><input type="text" style="text-align:right;width:50%;" label="text" name="nextmonth" value="' . $calendar['nextmonth'] . '" /></td>
</tr>
<tr>
<td width="30%">'.__('Navigation Icons', 'quick-event-manager').'</td>
<td>
<input type="radio" name="navicon" value="none" ' . $none . ' /> '.__('None', 'quick-event-manager').'
<input type="radio" name="navicon" value="arrows" ' . $arrows . ' /> ◄ ►
<input type="radio" name="navicon" value="unicodes" ' . $unicodes . ' />'.__('Other', 'quick-event-manager').' ('.__('enter', 'quick-event-manager').' <a href="http://character-code.com/arrows-html-codes.php" target="_blank">'.__('hex code', 'quick-event-manager').'</a> '.__('below', 'quick-event-manager').').<br />
Left: <input type="text" style="width:6em;" label="text" name="leftunicode" value="' . $calendar['leftunicode'] . '" /> Right: <input type="text" style="width:6em;" label="text" name="rightunicode" value="' . $calendar['rightunicode'] . '" /></td>
</tr>
<tr>
<td width="30%">'.__('Jump to links', 'quick-event-manager').'</td>
<td><input type="checkbox" style="margin:0; padding: 0; border: none" name="jumpto"' . $calendar['jumpto'] . ' value="checked" /> '.__('Jump to the top of the calendar when linking to a new month.', 'quick-event-manager').'</td>
</tr>
<tr>
<td colspan="2"><h2>'.__('Calendar Options', 'quick-event-manager').'</h2></td>
</tr>
<tr>
<td style="vertical-align:top;">'.__('Month and Date Header', 'quick-event-manager').'</td>
<td><input type="radio" name="header" value="h2" ' . $h2 . ' /> H2 <input type="radio" name="header" value="h3" ' . $h3 . ' /> H3 <input type="radio" name="header" value="h4" ' . $h4 . ' /> H4<br>
Header CSS:<br>
<input type="text" style="" name="headerstyle" value="' . $calendar['headerstyle'] . '" /></td>
</tr>
<tr>
<td width="30%">'.__('Day Border', 'quick-event-manager').'</td>
<td><input type="text" style="width:12em;" label="tdborder" name="tdborder" value="' . $calendar['tdborder'] . '" /> Example: 1px solid red</td>
</tr>
<tr>
<td width="30%">'.__('Cellspacing', 'quick-event-manager').'</td>
<td><input type="text" style="width:2em;" label="cellspacing" name="cellspacing" value="' . $calendar['cellspacing'] . '" /></td>
</tr>
<tr>
<td colspan="2"><h2>'.__('Months', 'quick-event-manager').'</h2></td>
</tr>
<tr>
<td width="30%">'.__('Display 12 Mavigation', 'quick-event-manager').'</td>
<td><input type="checkbox" style="margin:0; padding: 0; border: none" name="showmonthsabove" ' . $calendar['showmonthsabove'] . ' value="checked" /> '.__('Show above calendar', 'quick-event-manager').'<br>
<input type="checkbox" style="margin:0; padding: 0; border: none" name="showmonthsbelow" ' . $calendar['showmonthsbelow'] . ' value="checked" /> '.__('Show below calendar', 'quick-event-manager').'</td>
</tr>
<tr>
<td width="30%">'.__('Caption', 'quick-event-manager').'</td>
<td><input type="text" style="" label="text" name="monthscaption" value="' . $calendar['monthscaption'] . '" /></td>
</tr>
<tr>
<td width="30%">'.__('Hide navigation', 'quick-event-manager').'</td>
<td><input type="checkbox" style="margin:0; padding: 0; border: none" name="hidenavigation" ' . $calendar['hidenavigation'] . ' value="checked" /> '.__('Remove Prev and Next links', 'quick-event-manager').'</td>
</tr>
<tr>
<td colspan="2"><h2>'.__('Event Options', 'quick-event-manager').'</h2></td>
</tr>
<tr>
<td width="30%">'.__('Multi-day Events', 'quick-event-manager').'</td>
<td><input type="checkbox" style="margin:0; padding: 0; border: none" name="showmultiple" ' . $calendar['showmultiple'] . ' value="checked" /> '.__('Show event on all days', 'quick-event-manager').'</td>
</tr>
<tr>
<td width="30%">'.__('Event Border', 'quick-event-manager').'</td>
<td><input type="text" style="width:12em;" label="eventborder" name="eventborder" value="' . $calendar['eventborder'] . '" /> enter \'none\' to remove border</td>
</tr>
<tr>
<td width="30%"></td>
<td><input type="checkbox" style="margin:0; padding: 0; border: none" name="fixeventborder" ' . $calendar['fixeventborder'] . ' value="checked" /> '.__('Lock border colour (ignore category colours)', 'quick-event-manager').'</td>
</tr>
<tr>
<td>'.__('Corners', 'quick-event-manager').'</td>
<td>
<input type="radio" name="event_corner" value="square" ' . $square . ' /> '.__('Square', 'quick-event-manager').'
<input type="radio" name="event_corner" value="rounded" ' . $rounded . ' /> '.__('Rounded', 'quick-event-manager').'</td>
</tr>
<tr>
<td width="30%">'.__('Character Number', 'quick-event-manager').'</td>
<td><input type="text" style="width:4em;" label="text" name="eventlength" value="' . $calendar['eventlength'] . '" /><span class="description"> Number of characters to display in event box</span></td>
</tr>
<tr>
<td style="vertical-align:top;">'.__('Small Screens', 'quick-event-manager').'</td>
<td><span class="description">'.__('What to display on small screens', 'quick-event-manager').':</span><br>
<input type="radio" name="smallicon" value="trim" ' . $trim . ' /> '.__('Full message', 'quick-event-manager').' <input type="radio" name="smallicon" value="arrow" ' . $arrow . ' /> '.__('▶', 'quick-event-manager').' <input type="radio" name="smallicon" value="box" ' . $box . ' /> '.__('□', 'quick-event-manager').' <input type="radio" name="smallicon" value="square" ' . $square . ' /> '.__('■', 'quick-event-manager').' <input type="radio" name="smallicon" value="asterix" ' . $asterix . ' /> '.__('★', 'quick-event-manager').'
<input type="radio" name="smallicon" value="blank" ' . $blank . ' /> '.__('Blank', 'quick-event-manager').'
<input type="radio" name="smallicon" value="other" ' . $other . ' /> '.__('Other', 'quick-event-manager').' ('.__('enter escaped', 'quick-event-manager').' <a href="http://www.fileformat.info/info/unicode/char/search.htm" target="blank">unicode</a> '.__('or hex code below', 'quick-event-manager').').<br />
<input type="text" style="width:6em;" label="text" name="unicode" value="' . $calendar['unicode'] . '" /></td>
</tr>
<tr><td width="30%">'.__('Background', 'quick-event-manager').'</td>
<td><input type="text" class="qem-color" label="background" name="eventbackground" value="' . $calendar['eventbackground'] . '" /><br><span class="description">Select clear to use day colour</span></td>
</tr>
<tr>
<td width="30%">'.__('Text', 'quick-event-manager').'</td>
<td><input type="text" class="qem-color" label="text" name="eventtext" value="' . $calendar['eventtext'] . '" /></td>
</tr>
<tr>
<td width="30%">'.__('Text Styles', 'quick-event-manager').'</td>
<td><input type="checkbox" style="margin:0; padding: 0; border: none" name="eventbold" ' . $calendar['eventbold'] . ' value="checked" /> '.__('Bold', 'quick-event-manager').'<input type="checkbox" style="margin:0; padding: 0; border: none" name="eventitalic" ' . $calendar['eventitalic'] . ' value="checked" /> '.__('Italic', 'quick-event-manager').'</td>
</tr>
<tr>
<td width="30%">'.__('Event Hover', 'quick-event-manager').'</td>
<td><input type="text" class="qem-color" label="background" name="eventhover" value="' . $calendar['eventhover'] . '" /></td>
</tr>
<tr>
<td width="30%">'.__('Event Image', 'quick-event-manager').'</td>
<td><input type="checkbox" style="margin:0; padding: 0; border: none" name="eventimage" ' . $calendar['eventimage'] . ' value="checked" /> '.__('Show event image on the calendar', 'quick-event-manager').'<br>'.__('Image Width', 'quick-event-manager').'<input type="text" style="width:3em;" label="text" name="imagewidth" value="' . $calendar['imagewidth'] . '" /> px</td>
</tr>
<tr>
<td width="30%">'.__('Hover Message', 'quick-event-manager').'</td>
<td><input type="checkbox" style="margin:0; padding: 0; border: none" name="usetooltip" ' . $calendar['usetooltip'] . ' value="checked" /> '.__('Show full event title on hover', 'quick-event-manager').'</td>
</tr>
</table>
<h2>'.__('Calendar Colours', 'quick-event-manager').'</h2>
<div class="qem-calcolor">
<p style="font-weight:bold"><span style="float:left;width:10em;">'.__('Items', 'quick-event-manager').'</span>'.__('Background', 'quick-event-manager').' / '.__('Text', 'quick-event-manager').'</p>
<p><span style="float:left;width:10em">'.__('Days of the Week', 'quick-event-manager').'</span> <input type="text" class="qem-color" label="background" name="calday" value="' . $calendar['calday'] . '" /><input type="text" class="qem-color" label="text" name="caldaytext" value="' . $calendar['caldaytext'] . '" /></p>
<p><span style="float:left;width:10em">'.__('Normal Day', 'quick-event-manager').'</span> <input type="text" class="qem-color" label="background" name="day" value="' . $calendar['day'] . '" /></p>
<p><span style="float:left;width:10em">'.__('Event Day', 'quick-event-manager').'</span> <input type="text" class="qem-color" label="background" name="eventday" value="' . $calendar['eventday'] . '" /><input type="text" class="qem-color" label="text" name="eventdaytext" value="' . $calendar['eventdaytext'] . '" /></p>
<p><span style="float:left;width:10em">'.__('Past Day', 'quick-event-manager').'</span> <input type="text" class="qem-color" label="background" name="oldday" value="' . $calendar['oldday'] . '" /></p>
</div>
<h2>'.__('Event Category Colours', 'quick-event-manager').'</h2>
<p style="font-weight:bold"><span style="float:left;width:8em;">'.__('Category', 'quick-event-manager').'</span>'.__('Background', 'quick-event-manager').' / '.__('Text', 'quick-event-manager').'</p>
<div class="qem-calcolor">';
$arr = array('a','b','c','d','e','f','g','h','i','j');
foreach ($arr as $i) {
$content .= '<p>'.qem_categories ('cat'.$i,$calendar['cat'.$i]).'