Changeset 683356
- Timestamp:
- 03/17/2013 06:49:15 PM (11 years ago)
- Location:
- event-organiser/trunk
- Files:
-
- 5 added
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
event-organiser/trunk/.gitignore
r677286 r683356 7 7 dist 8 8 externs.js 9 9 10 Makefile -
event-organiser/trunk/classes/class-eo-event-list-widget.php
r663974 r683356 72 72 </p> 73 73 <p> 74 <label for="<?php echo $this->get_field_id('template'); ?>"><?php _e('Template (leave blank for default)', 'eventorganiser'); ?> </label> 74 <label for="<?php echo $this->get_field_id('template'); ?>"> 75 <?php 76 _e('Template (leave blank for default)', 'eventorganiser'); 77 echo eventorganiser_inline_help( 78 __( 'Event list widget placeholders', 'eventorganiser' ), 79 sprintf( 80 __( 'You can use specified tags as placeholders for event information which you want to appear in the widget. <a href="%s" target="_blank"> Find out more</a>.', 'eventorganiser' ), 81 'http://wp-event-organiser.com/documentation/widgets/#whatistemplate' 82 ) 83 ); 84 ?> 85 </label> 75 86 <input id="<?php echo $this->get_field_id('template'); ?>" class="widefat" name="<?php echo $this->get_field_name('template'); ?>" type="text" value="<?php echo esc_attr($instance['template']);?>" /> 76 <small><a href="http://wp-event-organiser.com/documentation/widgets/#whatistemplate" target="_blank"><?php _e("What's this?","eventorganiser"); ?></a></small> 87 77 88 </p> 78 89 <p> -
event-organiser/trunk/classes/class-eventorganiser-shortcodes.php
r677286 r683356 63 63 ), $atts ) ); 64 64 65 $url = add_query_arg('feed','eo-events',site_url());65 $url = ); 66 66 67 67 $class = esc_attr($class); -
event-organiser/trunk/css/eventorganiser-admin-style.css
r663974 r683356 71 71 .eo-venue-combobox-buttons{position: absolute;width:4.5em;} 72 72 73 74 75 76 77 78 79 80 81 82 83 84 85 73 86 /* 74 87 * Timepicker stylesheet … … 90 103 .ui-timepicker-table td,.ui-timepicker-table th.periods{width:2.2em;padding:.1em} 91 104 .ui-timepicker .ui-timepicker-now,.ui-timepicker .ui-timepicker-deselect{float:left} 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 -
event-organiser/trunk/event-organiser-calendar.php
r677286 r683356 38 38 'ajaxurl' => admin_url( 'admin-ajax.php' ), 39 39 'startday' => intval( get_option( 'start_of_week' ) ), 40 'format' => eventorganiser_ get_option( 'dateformat' ).'-yy',40 'format' => eventorganiser_, 41 41 )); 42 42 wp_localize_script( 'eo_calendar', 'EO_Ajax', array( 43 43 'ajaxurl' => admin_url( 'admin-ajax.php' ), 44 44 'startday' => intval( get_option( 'start_of_week' ) ), 45 'format' => eventorganiser_ get_option( 'dateformat' ).'-yy',45 'format' => eventorganiser_, 46 46 'timeFormat' => ( get_current_screen()->get_option( 'eofc_time_format', 'value' ) ? 'h:mmtt' : 'HH:mm' ), 47 47 'perm_edit' => current_user_can( 'edit_events' ), -
event-organiser/trunk/event-organiser-edit.php
r677286 r683356 40 40 41 41 //Sets the format as php understands it, and textual. 42 if ( eventorganiser_get_option( 'dateformat' ) == 'dd-mm' ){43 $phpFormat = 'd-m-Y';42 43 44 44 $format = 'dd-mm-yyyy'; //Human form 45 } else { 46 $phpFormat = 'm-d-Y'; 45 } elseif( 'Y-m-d' == $phpFormat ) { 46 $format = 'yyyy-mm-dd'; //Human form 47 }else{ 47 48 $format = 'mm-dd-yyyy'; //Human form 48 49 } … … 322 323 if ( !empty( $arr ) ){ 323 324 foreach ( $arr as $date ): 324 $date_obj = _eventorganiser_check_datetime( $date . ' ' . $raw_data['StartTime'], true);325 $date_obj = _eventorganiser_check_datetime( $date . ' ' . $raw_data['StartTime'], ); 325 326 if( $date_obj ) 326 327 $in_ex[$key][] = $date_obj; -
event-organiser/trunk/event-organiser-settings.php
r677286 r683356 125 125 'name' => 'eventorganiser_options[dateformat]', 126 126 'options' => array( 127 'dd-mm' => __( 'dd-mm-yyyy', 'eventorganiser' ), 128 'mm-dd' => __( 'mm-dd-yyyy', 'eventorganiser' ), 127 'd-m-Y' => __( 'dd-mm-yyyy', 'eventorganiser' ), 128 'm-d-Y' => __( 'mm-dd-yyyy', 'eventorganiser' ), 129 'Y-m-d' => __( 'yyyy-mm-dd', 'eventorganiser' ), 129 130 ), 130 131 'help' => __("This alters the default format for inputting dates.", 'eventorganiser' ), … … 310 311 //Navigation menu - $addtomenu int 0 if no menu, menu databse ID otherwise 311 312 $clean['menu_item_db_id'] = $this->update_nav_menu( $clean['addtomenu'], $clean['navtitle'] ); 313 314 315 316 317 318 312 319 break; 313 320 -
event-organiser/trunk/event-organiser.php
r677286 r683356 3 3 Plugin Name: Event Organiser 4 4 Plugin URI: http://www.wp-event-organiser.com 5 Version: 1. 7.45 Version: 1. 6 6 Description: Creates a custom post type 'events' with features such as reoccurring events, venues, Google Maps, calendar views and events and venue pages 7 7 Author: Stephen Harris … … 42 42 */ 43 43 global $eventorganiser_db_version; 44 $eventorganiser_db_version = '1. 7.4';44 $eventorganiser_db_version = '1.'; 45 45 46 46 … … 132 132 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'custom-fields', 'comments', 'eventtag' ), 133 133 'event_redirect' => 'events', 134 'dateformat' => 'd d-mm',134 'dateformat' => 'd', 135 135 'prettyurl' => 1, 136 136 'templates' => 1, … … 147 147 if( $option === 'eventtag' ) 148 148 return in_array( 'eventtag', $options['supports'] ); 149 150 if( !isset($options[$option]) ) 151 return $default; 152 153 return $options[$option]; 149 150 if( $option === 'dateformat' ){ 151 //Backwards compatibility (migration from mm-dd/dd-mm to php format): 152 if( $options[$option] == 'mm-dd' ){ 153 $options[$option] = 'm-d-Y'; 154 }elseif( $options[$option] == 'dd-mm' ){ 155 $options[$option] = 'd-m-Y'; 156 } 157 } 158 159 if( !isset($options[$option]) ) 160 return $default; 161 162 return $options[$option]; 154 163 } 155 164 … … 200 209 require_once(EVENT_ORGANISER_DIR.'classes/class-eo-event-list-widget.php'); 201 210 require_once(EVENT_ORGANISER_DIR.'classes/class-eo-calendar-widget.php'); 211 212 202 213 require_once(EVENT_ORGANISER_DIR.'classes/class-eventorganiser-shortcodes.php'); 203 214 … … 208 219 register_widget( 'EO_Events_Agenda_Widget' ); 209 220 register_widget( 'EO_Calendar_Widget' ); 221 222 210 223 } 211 224 ?> -
event-organiser/trunk/includes/class-event-organiser-im-export.php
r638444 r683356 95 95 <div class="inside"> 96 96 <p><?php _e( 'Import an ICS file.', 'eventorganiser'); ?></p> 97 < input type="checkbox" name="eo_import_venue" value=1 /> <?php _e( 'Import venues', 'eventorganiser' ); ?>98 < input type="checkbox" name="eo_import_cat" value=1 /> <?php _e( 'Import categories', 'eventorganiser' ); ?>97 <> 98 <> 99 99 <p><input type="file" name="ics" /></p> 100 100 <?php wp_nonce_field('eventorganiser_import_events'); ?> … … 241 241 } 242 242 }?> 243 EXDATE<?php echo $vdate;?>:<?php echo implode(',',$exclude_strings); 244 245 endif;?>243 EXDATE<?php echo $vdate;?>:<?php echo implode(',',$exclude_strings); 244 245 ?> 246 246 <?php if( !empty($schedule_data['include']) ): 247 247 $include_strings = array(); … … 377 377 $event_count =0; 378 378 379 379 $event_array = array(); 380 380 $event_array['event'] = array(); 381 381 $event_array['event_post'] = array(); … … 421 421 //Otherwise, parse event property 422 422 try{ 423 424 425 426 423 427 $event_array = $this->parse_Event_Property($event_array,$property,$value,$modifiers,$blog_tz,$cal_tz); 424 428 … … 690 694 */ 691 695 function parse_icalText($text){ 692 $text = str_replace("\\r\\n","</br>",$text); 696 //Get rid of carriage returns: 697 $text = str_replace("\r\n","\n",$text); 698 $text = str_replace("\r","\n",$text); 699 700 //Some calendar apps break up text 701 $text = str_replace("\n ","",$text); 702 $text = str_replace("\r ","",$text); 703 704 //Any intended carriage returns/new-lines converted to HTML 705 $text = str_replace("\\r\\n","",$text); 693 706 $text = str_replace("\\n","</br>",$text); 694 707 $text = stripslashes($text); -
event-organiser/trunk/includes/event-organiser-archives.php
r677286 r683356 49 49 $venue = $query->get('venue'); 50 50 $query->set('event-venue',$venue); 51 51 52 } 52 53 //If event-venue, event-tag or event-category is being queried, we must be after events54 if(isset($query->query_vars['event-venue']) || isset($query->query_vars['event-category'] ) || isset($query->query_vars['event-tag']) || $query->is_feed('eo-events') ){55 $query->set('post_type', 'event');56 }57 53 58 54 //If querying for all events starting on given date, set the date parameters … … 85 81 86 82 //If not on event, stop here. 87 if( 'event'!= $query->get('post_type') )83 if() ) 88 84 return $query; 89 85 … … 265 261 global $wpdb; 266 262 267 if( 'event'== $query->get('post_type') ){263 if({ 268 264 $et =$wpdb->eo_events; 269 265 /* Include 'event_occurrence' for backwards compatibility. Will eventually be removed. */ … … 299 295 } 300 296 301 if( 'event'== $query->get('post_type') ):297 if(: 302 298 if(empty($groupby)) 303 299 return $groupby; … … 325 321 global $wpdb; 326 322 327 if( 'event'== $query->get('post_type') ){328 323 if({ 324 $join .=" LEFT JOIN $wpdb->eo_events ON $wpdb->posts.id = {$wpdb->eo_events}.post_id "; 329 325 } 330 326 return $join; 331 327 } 332 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 333 350 334 351 /** … … 347 364 348 365 //Only alter event queries 349 if( 'event'== $query->get('post_type') ):366 if() ): 350 367 351 368 //If we only want events (or occurrences of events) that belong to a particular 'event' … … 396 413 } 397 414 endif; 415 398 416 return $where; 399 417 } … … 433 451 endswitch; 434 452 435 }elseif( 'event'== $query->get('post_type') ){453 }elseif({ 436 454 //If no orderby is set, but we are querying events, return the default order for events; 437 455 $orderby = " {$wpdb->eo_events}.StartDate ASC, {$wpdb->eo_events}.StartTime ASC"; -
event-organiser/trunk/includes/event-organiser-cpt.php
r666587 r683356 855 855 } 856 856 add_filter('get_edit_term_link','eventorganiser_edit_venue_link',10,3); 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 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 857 1037 ?> -
event-organiser/trunk/includes/event-organiser-event-functions.php
r677286 r683356 812 812 */ 813 813 function eo_is_event_taxonomy(){ 814 return (is_tax(array('event-category','event-tag','event-venue'))); 814 $event_tax = get_object_taxonomies( 'event' ); 815 return ( is_tax( $event_tax ) ); 815 816 } 816 817 … … 991 992 'tooltip'=>true, 'weekends'=>true, 'mintime'=>'0', 'maxtime'=>'24', 'alldayslot'=>true, 992 993 'alldaytext'=>__('All Day','eventorganiser'), 'columnformatmonth'=>'D', 'columnformatweek'=>'D n/j', 'columnformatday'=>'l n/j', 994 993 995 ); 994 996 $args = shortcode_atts( $defaults, $args ); … … 997 999 998 1000 //Convert php time format into xDate time format 999 $date_attributes = array( 'timeformat', 'axisformat', 'columnformatday', 'columnformatweek', 'columnformatmonth' ); 1001 $date_attributes = array( 'timeformat', 'axisformat', 'columnformatday', 'columnformatweek', 'columnformatmonth', 1002 'titleformatmonth', 'titleformatday', 'titleformatweek' ); 1000 1003 $args['timeformatphp'] = $args['timeformat']; 1001 1004 foreach ( $date_attributes as $date_attribute ){ 1005 1006 1002 1007 $args[$date_attribute.'php'] = $args[$date_attribute]; 1003 1008 $args[$date_attribute] = eventorganiser_php2xdate( $args[$date_attribute] ); … … 1125 1130 $post = get_post( $post_id ); 1126 1131 setup_postdata( $post_id ); 1132 1133 1127 1134 1128 1135 $tax_input = array(); … … 1160 1167 $post_custom = get_post_custom( $post_id ); 1161 1168 foreach ( $post_custom as $meta_key => $meta_values ) { 1169 1162 1170 //Don't copy these 1163 if( in_array( $meta_key, array( '_edit_last', '_edit_last', '_edit_lock' ) ) ) 1171 $ignore_meta = array( '_eo_tickets', '_edit_last', '_edit_last', '_edit_lock' ) ; 1172 $ignore_meta = apply_filters( 'eventorganiser_breaking_occurrence_exclude_meta', $ignore_meta ); 1173 if( in_array( $meta_key, $ignore_meta ) ) 1164 1174 continue; 1165 1175 … … 1177 1187 } 1178 1188 _eventorganiser_delete_calendar_cache(); 1189 1190 1191 1179 1192 wp_reset_postdata(); 1180 1193 return $new_event_id; -
event-organiser/trunk/includes/event-organiser-install.php
r666587 r683356 8 8 *@ignore 9 9 */ 10 function eventorganiser_install(){ 11 global $wpdb, $eventorganiser_db_version; 10 function eventorganiser_install( $is_networkwide = false ){ 11 global $wpdb; 12 13 // Is this multisite and did the user click network activate? 14 $is_multisite = ( function_exists('is_multisite') && is_multisite() ); 15 16 if ($is_multisite && $is_networkwide) { 17 // Get the current blog so we can return to it. 18 $current_blog_id = get_current_blog_id(); 19 20 // Get a list of all blogs. 21 $blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" ); 22 if( $blog_ids ){ 23 foreach ( $blog_ids as $blog_id ) { 24 switch_to_blog( $blog_id ); 25 eventorganiser_site_install(); 26 } 27 switch_to_blog( $current_blog_id ); 28 }else{ 29 eventorganiser_site_install(); 30 } 31 }else { 32 eventorganiser_site_install(); 33 } 34 } 35 36 function eventorganiser_site_install(){ 37 global $wpdb, $eventorganiser_db_version; 12 38 13 39 eventorganiser_wpdb_fix(); … … 103 129 //Flush rewrite rules only on activation, and after CPT/CTs has been registered. 104 130 flush_rewrite_rules(); 105 106 131 } 107 132 … … 109 134 * Deactivate routine 110 135 * 111 * Clears cron jobs and flushes rewrite rules136 * 112 137 * 113 138 *@since 1.5 … … 116 141 */ 117 142 function eventorganiser_deactivate(){ 118 eventorganiser_clear_cron_jobs();119 143 flush_rewrite_rules(); 120 144 } … … 280 304 *@ignore 281 305 */ 282 function eventorganiser_uninstall(){ 306 function eventorganiser_uninstall( $is_networkwide = false ){ 307 global $wpdb; 308 309 // Is this multisite and did the user click network activate? 310 $is_multisite = ( function_exists('is_multisite') && is_multisite() ); 311 312 if ( $is_multisite && $is_networkwide ) { 313 // Get the current blog so we can return to it. 314 $current_blog_id = get_current_blog_id(); 315 316 // Get a list of all blogs. 317 $blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" ); 318 if( $blog_ids ){ 319 foreach ( $blog_ids as $blog_id ) { 320 switch_to_blog( $blog_id ); 321 eventorganiser_uninstall_install(); 322 } 323 switch_to_blog( $current_blog_id ); 324 }else{ 325 eventorganiser_uninstall_install(); 326 } 327 }else { 328 eventorganiser_uninstall_install(); 329 } 330 331 } 332 333 function eventorganiser_uninstall_site(){ 283 334 global $wpdb,$eventorganiser_roles, $wp_roles,$wp_taxonomies; 284 335 -
event-organiser/trunk/includes/event-organiser-register.php
r677286 r683356 10 10 function eventorganiser_register_script() { 11 11 global $wp_locale; 12 $version = '1. 7.4';12 $version = '1.'; 13 13 14 14 $ext = (defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG) ? '' : '.min'; … … 77 77 */ 78 78 function eventorganiser_register_scripts(){ 79 $version = '1. 7.4';79 $version = '1.'; 80 80 $ext = (defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG) ? '' : '.min'; 81 81 … … 108 108 109 109 /* Admin styling */ 110 wp_register_style('eventorganiser-style',EVENT_ORGANISER_URL.'css/eventorganiser-admin-style.css',array('eventorganiser-jquery-ui-style'),$version );110 wp_register_style('eventorganiser-style',EVENT_ORGANISER_URL.'css/eventorganiser-admin-style.css',array('eventorganiser-jquery-ui-style'),$version); 111 111 112 112 /* Inline Help */ 113 113 wp_register_script( 'eo-inline-help', EVENT_ORGANISER_URL.'js/inline-help.js',array( 'jquery', 'eo_qtip2' ), $version, true ); 114 114 } 115 add_action('admin_enqueue_scripts', 'eventorganiser_register_scripts',10); 116 115 add_action( 'admin_init', 'eventorganiser_register_scripts', 5 ); 116 117 118 /** 119 * The "Comprehensive Google Map Plugin" plug-in deregisters all other Google scripts registered 120 * by other plug-ins causing these plug-ins not to function. This plug-in removes that behaviour. 121 * 122 * Of course if two google scripts are loaded there may be problems, but this is better than always having 123 * experiencing a 'bug'. At time writing the function responsible `cgmp_google_map_deregister_scripts()` 124 * can be found here {@see https://github.com/azagniotov/Comprehensive-Google-Map-Plugin/blob/master/functions.php#L520 } 125 * 126 * @see https://github.com/stephenharris/Event-Organiser/issues/49 127 * @see http://wordpress.org/support/topic/googlemap-doesnt-shown-on-event-detail-page 128 * @since 1.7.4 129 * @ignore 130 * @access private 131 */ 132 function eventorganiser_cgmp_workaround(){ 133 remove_action( 'wp_head', 'cgmp_google_map_deregister_scripts', 200 ); 134 } 135 add_action( 'wp_head', 'eventorganiser_cgmp_workaround', 1 ); 117 136 118 137 /** … … 181 200 'ajaxurl' => admin_url( 'admin-ajax.php' ), 182 201 'startday'=>intval(get_option('start_of_week')), 183 'format'=> eventorganiser_ get_option('dateformat').'-yy',202 'format'=> eventorganiser_, 184 203 'current_user_can' => array( 185 204 'manage_venues' => current_user_can( 'manage_venues' ), … … 343 362 } 344 363 364 365 366 367 368 369 370 371 372 �� 373 374 375 376 377 378 379 380 381 382 383 384 385 345 386 346 387 /** … … 355 396 //Get expired events 356 397 $events = eo_get_events(array('showrepeats'=>0,'showpastevents'=>1,'eo_interval'=>'expired')); 398 357 399 if($events): 400 401 358 402 foreach($events as $event): 359 $now = new DateTime('now', eo_get_blog_timezone()); 360 $start = new DateTime($event->StartDate.' '.$event->StartTime, eo_get_blog_timezone()); 361 $end = new DateTime($event->EndDate.' '.$event->FinishTime, eo_get_blog_timezone()); 403 404 $start = eo_get_the_start( DATETIMEOBJ, $event->ID, null, $event->occurrence_id ); 405 $end = eo_get_the_end( DATETIMEOBJ, $event->ID, null, $event->occurrence_id ); 406 362 407 $expired = round(abs($end->format('U')-$start->format('U'))) + 24*60*60; //Duration + 24 hours 363 $finished = new DateTime($event->reoccurrence_end.' '.$event->StartTime, eo_get_blog_timezone()); 364 $finished->modify("+$expired seconds"); 365 408 409 $finished = eo_get_schedule_last( DATETIMEOBJ, $event->ID ); 410 $finished->modify("+$expired seconds");//24 horus after the last occurrence finishes 411 366 412 //Delete if 24 hours has passed 367 if($finished <= $now) :413 if($finished <= $now) 368 414 wp_trash_post((int) $event->ID); 369 endif; 415 } 416 370 417 endforeach; 371 418 endif; -
event-organiser/trunk/includes/event-organiser-templates.php
r667614 r683356 100 100 switch( $type ){ 101 101 case 'year': 102 if( _eventorganiser_check_datetime( $ondate.'-01-01 00:00',true) )102 if( _eventorganiser_check_datetime() ) 103 103 return true; 104 104 return false; 105 105 106 106 case 'month': 107 if( _eventorganiser_check_datetime( $ondate.'-01 00:00',true) )107 if( _eventorganiser_check_datetime() ) 108 108 return true; 109 109 return false; 110 110 111 111 case 'day': 112 if( _eventorganiser_check_datetime( $ondate.' 00:00',true) )112 if( _eventorganiser_check_datetime() ) 113 113 return true; 114 114 return false; … … 149 149 } 150 150 151 $ondate = _eventorganiser_check_datetime( $ondate.' 00:00',true);151 $ondate = _eventorganiser_check_datetime(); 152 152 return eo_format_datetime($ondate, $format); 153 153 } -
event-organiser/trunk/includes/event-organiser-utility-functions.php
r677286 r683356 458 458 459 459 * @param datetime_string - a datetime string 460 * @param (bool) $ymd_formated - whether the date is formated in the format YYYY-MM-DD or460 * @param 461 461 * @return int DateTime| false - the parsed datetime string as a DateTime object or false on error (incorrectly formatted for example) 462 462 */ 463 function _eventorganiser_check_datetime($datetime_string='',$ymd_formated=false){ 464 465 $formatString = eventorganiser_get_option('dateformat'); 466 467 //Get regulgar expression. 468 if( $ymd_formated ){ 463 function _eventorganiser_check_datetime( $datetime_string = '', $format = null ){ 464 465 if( is_null( $format ) ) 466 $format = eventorganiser_get_option('dateformat'); 467 468 //Backwards compatible - can probably remove 2.1+ 469 if( is_bool( $format ) ){ 470 _deprecated_argument('_eventorganiser_check_datetime', '1.8', 'This function no longer accepts a boolean, pass the format of the passed date-time string.'); 471 if( true === $format ) 472 $format = 'Y-m-d'; 473 else 474 $format = eventorganiser_get_option('dateformat'); 475 } 476 477 //Get regular expression. 478 if( $format == 'Y-m-d' ){ 469 479 $reg_exp = "/(?P<year>\d{4})[-.\/](?P<month>\d{1,})[-.\/](?P<day>\d{1,}) (?P<hour>\d{2}):(?P<minute>\d{2})/"; 470 480 471 }elseif( $formatString =='dd-mm' ){481 }elseif(' ){ 472 482 $reg_exp = "/(?P<day>\d{1,})[-.\/](?P<month>\d{1,})[-.\/](?P<year>\d{4}) (?P<hour>\d{2}):(?P<minute>\d{2})/"; 473 483 … … 564 574 565 575 $args = wp_parse_args($args,array( 566 'selected'=>'', 'help' => '', 'options'=>'', 'name'=>'', 'echo'=>1,576 'selected'=>'', 'help' => , 'options'=>'', 'name'=>'', 'echo'=>1, 567 577 'label_for'=>'','class'=>'','disabled'=>false,'multiselect'=>false, 578 568 579 )); 569 580 … … 571 582 $name = isset($args['name']) ? $args['name'] : ''; 572 583 $selected = $args['selected']; 573 $class = sanitize_html_class($args['class']); 584 $classes = array_map( 'sanitize_html_class', explode( ' ', $args['class'] ) ); 585 $class = implode( ' ', $classes ); 574 586 $multiselect = ($args['multiselect'] ? 'multiple' : '' ); 575 587 $disabled = ($args['disabled'] ? 'disabled="disabled"' : '' ); … … 595 607 } 596 608 } 597 $html .= '</select>' ;598 599 if( !empty($args['help'])){609 $html .= '</select>'; 610 611 if(){ 600 612 $html .= '<p class="description">'.esc_html($args['help']).'</p>'; 601 613 } … … 628 640 function eventorganiser_text_field($args){ 629 641 630 $args = wp_parse_args( $args,642 $args = wp_parse_args($args, 631 643 array( 632 'type' => 'text', 'value'=>'', 'placeholder' => '','label_for'=>'', 633 'size'=>false, 'min' => false, 'max' => false, 'style'=>false, 'echo'=>true, 644 'type' => 'text', 'value'=>'', 'placeholder' => '','label_for'=>'', 'inline_help' => false, 645 'size'=>false, 'min' => false, 'max' => false, 'style'=>false, 'echo'=>true, 'data'=>false, 646 'class' => false, 634 647 ) 635 648 ); … … 639 652 $value = $args['value']; 640 653 $type = $args['type']; 641 $class = isset($args['class']) ? esc_attr($args['class']) : ''; 654 $classes = array_map( 'sanitize_html_class', explode( ' ', $args['class'] ) ); 655 $class = implode( ' ', $classes ); 642 656 643 657 $min = ( $args['min'] !== false ? sprintf('min="%d"', $args['min']) : '' ); … … 647 661 $placeholder = ( !empty($args['placeholder']) ? sprintf('placeholder="%s"', $args['placeholder']) : ''); 648 662 $disabled = ( !empty($args['disabled']) ? 'disabled="disabled"' : '' ); 649 $attributes = array_filter(array($min,$max,$size,$placeholder,$disabled, $style)); 650 651 $html = sprintf('<input type="%s" name="%s" class="%s regular-text ltr" id="%s" value="%s" autocomplete="off" %s />', 652 esc_attr($type), 653 esc_attr($name), 654 sanitize_html_class($class), 655 esc_attr($id), 656 esc_attr($value), 657 implode(' ', $attributes) 663 664 //Custom data-* attributes 665 $data = ''; 666 if( !empty( $args['data'] ) && is_array( $args['data'] ) ){ 667 foreach( $args['data'] as $key => $attr_value ){ 668 $data .= sprintf( 'data-%s="%s"', esc_attr( $key ), esc_attr( $attr_value ) ); 669 } 670 } 671 672 $attributes = array_filter( array($min,$max,$size,$placeholder,$disabled, $style, $data ) ); 673 674 $html = sprintf('<input type="%s" name="%s" class="%s regular-text ltr" id="%s" value="%s" autocomplete="off" %s /> %s', 675 esc_attr( $type ), 676 esc_attr( $name ), 677 $class, 678 esc_attr( $id ), 679 esc_attr( $value ), 680 implode(' ', $attributes), 681 $args['inline_help'] 658 682 ); 659 683 … … 850 874 * @return string 851 875 */ 852 function eventorganiser_inline_help( $title, $content, $echo = false ){876 function eventorganiser_inline_help( $title, $content, $echo = false ){ 853 877 static $help = array(); 854 878 … … 859 883 860 884 wp_localize_script( 'eo-inline-help', 'eoHelp', $help ); 861 wp_enqueue_script( 'eo-inline-help' ); 862 wp_enqueue_style( 'eventorganiser-admin-style' ); 885 886 //Ensure style is called after WP styles 887 add_action( 'admin_footer', '_eventorganiser_enqueue_inline_help_scripts', 100 ); 863 888 864 889 $id = count($help)-1; 865 $src = EVENT_ORGANISER_URL.'css/images/help-14.png'; 866 867 $link = sprintf( '<a href="#" id="%s" class="eo-inline-help"><img src="%s" width="16" height="16"></a>', 'eo-inline-help-' . $id, $src ); 890 $src = EVENT_ORGANISER_URL."css/images/{$type}-14.png"; 891 892 $link = sprintf( '<a href="#" id="%s" class="eo-inline-help eo-%s-inline"><img src="%s" width="16" height="16"></a>', 893 'eo-inline-help-' . $id, 894 $type, 895 $src 896 ); 868 897 869 898 if( $echo ) … … 872 901 return $link; 873 902 } 874 903 function _eventorganiser_enqueue_inline_help_scripts(){ 904 wp_enqueue_script( 'eo-inline-help' ); 905 wp_enqueue_style( 'eventorganiser-style' ); 906 } 875 907 ?> -
event-organiser/trunk/includes/event-organiser-venue-functions.php
r677286 r683356 661 661 * is true. 662 662 */ 663 function eo_get_venue_meta($venue_id, $key , $single=true){663 function eo_get_venue_meta($venue_id, $key, $single=true){ 664 664 return get_metadata('eo_venue', $venue_id, $key, $single); 665 665 } -
event-organiser/trunk/includes/event.php
r663974 r683356 85 85 86 86 //Need to replace occurrences 87 if( $delete_existing ){87 if( $delete_existing ){ 88 88 //Generate occurrences 89 89 $event_data = _eventorganiser_generate_occurrences($event_data); -
event-organiser/trunk/js/frontend.js
r663974 r683356 81 81 calendars[i].venue =''; 82 82 } 83 84 83 $(calendar).fullCalendar({ 85 84 id: calendar, … … 109 108 week: calendars[i].columnformatweek, 110 109 day: calendars[i].columnformatday 110 111 112 113 114 111 115 }, 112 116 header: { -
event-organiser/trunk/js/frontend.min.js
r663974 r683356 4 4 a("#eo-upcoming-dates-more").click(function(b){b.preventDefault();a("#eo-upcoming-dates-less,#eo-upcoming-dates-pipe, #eo-upcoming-dates li:hidden:lt(5)").show();b=a("#eo-upcoming-dates-pipe").offset();a("html, body").animate({scrollTop:Math.max(b.top+40-a(window).height(),a(window).scrollTop())});a("#eo-upcoming-dates li:hidden").length==0&&a("#eo-upcoming-dates-more,#eo-upcoming-dates-pipe").hide()})}if(a(".eo-fullcalendar").length>0){e=EOAjax.calendars;for(var l,c=0;c<e.length;c++){var n="#eo_fullcalendar_"+ 5 5 (c+1);if(typeof e[c].category==="undefined")e[c].category="";if(typeof e[c].venue==="undefined")e[c].venue="";a(n).fullCalendar({id:n,category:e[c].event_category,venue:e[c].event_venue,customButtons:{category:f,venue:k,"goto":j},theme:true,categories:EOAjax.fullcal.categories,venues:EOAjax.fullcal.venues,timeFormatphp:e[c].timeformatphp,timeFormat:e[c].timeformat,editable:false,tooltip:e[c].tooltip,firstDay:parseInt(EOAjax.fullcal.firstDay),weekends:e[c].weekends,allDaySlot:e[c].alldayslot,allDayText:e[c].alldaytext, 6 axisFormat:e[c].axisformat,minTime:e[c].mintime,maxTime:e[c].maxtime,columnFormat:{month:e[c].columnformatmonth,week:e[c].columnformatweek,day:e[c].columnformatday}, header:{left:e[c].headerleft,center:e[c].headercenter,right:e[c].headerright},eventRender:function(b,d,g){var h=a(g.calendar.options.id).find(".filter-category .eo-cal-filter").val(),i=a(g.calendar.options.id).find(".filter-venue .eo-cal-filter").val();if(typeof h!=="undefined"&&h!=""&&a.inArray(h,b.category)<0)return"<div></div>";if(typeof i!==7 "undefined"&&i!=""&&i!=b.venue)return"<div></div>";g.calendar.options.tooltip&&a(d).qtip({content:{text:b.description,button:"x",title:b.title},position:{my:"top center",at:"bottom center"},hide:{fixed:true,delay:500,effect:function(){a(this).fadeOut("50")}},border:{radius:4,width:3},style:{classes:"ui-tooltip-shadow",widget:true,tip:"topMiddle"}})},buttonText:{today:EOAjaxFront.locale.today,month:EOAjaxFront.locale.month,week:EOAjaxFront.locale.week,day:EOAjaxFront.locale.day,cat:EOAjaxFront.locale.cat,8 venue:EOAjaxFront.locale.venue},monthNames:EOAjaxFront.locale.monthNames,monthNamesShort:EOAjaxFront.locale.monthAbbrev,dayNames:EOAjaxFront.locale.dayNames,dayNamesShort:EOAjaxFront.locale.dayAbbrev,eventColor:"#21759B",defaultView:e[c].defaultview,lazyFetching:"true",events:function(b,d,g,h){b={start:jQuery.fullCalendar.formatDate(b,"yyyy-MM-dd"),end:jQuery.fullCalendar.formatDate(d,"yyyy-MM-dd"),timeformat:h.timeFormatphp};if(typeof h.category!=="undefined"&&h.category!="")b.category=h.category;9 if(typeof h. venue!=="undefined"&&h.venue!="")b.venue=h.venue;jQuery.ajax({url:EOAjax.ajaxurl+"?action=eventorganiser-fullcal",dataType:"JSON",data:b,success:g})},selectable:false,weekMode:"variable",aspectRatio:1.5,loading:function(b){var d=a("#"+a(this).attr("id")+"_loading");if(b){window.clearTimeout(l);l=window.setTimeout(function(){d.show()},1E3)}else{window.clearTimeout(l);d.hide()}}})}a(".eo-cal-filter").change(function(){a(".eo-fullcalendar").fullCalendar("rerenderEvents")});a(".eo-mini-calendar").datepicker({dateFormat:"DD, d MM, yy",10 changeMonth:true,changeYear:true,dateFormat:"DD, d MM, yy",firstDay:parseInt(EOAjax.fullcal.firstDay),buttonText:EOAjaxFront.locale.gotodate,monthNamesShort:EOAjaxFront.locale.monthAbbrev,dayNamesMin:EOAjaxFront.locale.dayAbbrev,showOn:"button",onSelect:function(b){var d=a(this).parents("div.eo-fullcalendar").attr("id");a("#"+d).fullCalendar("gotoDate",new Date(Date.parse(b)))}})}if(a(".eo_widget_calendar").length>0){a(".eo_widget_calendar tfoot").unbind("click");a(".eo_widget_calendar tfoot a").die("click").live("click", 11 function(b){b.preventDefault();var d=a(this).closest(".eo_widget_calendar").attr("id");b={showpastevents:1};if(typeof EOAjax!=="undefined"&&typeof EOAjax.widget_calendars!=="undefined")b=EOAjax.widget_calendars[d];if(typeof eo_widget_cal!=="undefined")b=eo_widget_cal[d];b.eo_month=eveorg_getParameterByName("eo_month",a(this).attr("href"));a.getJSON(EOAjaxFront.adminajax+"?action=eo_widget_cal",b,function(g){a("#"+d+"_content").html(g)})})}if(a(".eo-agenda-widget").length>0){function o(b,d){a.ajax({url:EOAjaxFront.adminajax, 12 dataType:"JSON",data:{action:"eo_widget_agenda",instance_number:d.number,direction:b,start:d.StartDate,end:d.EndDate},success:function(g){if(!jQuery.isArray(g)||!g[0])return false;else{d.StartDate=g[0].StartDate;d.EndDate=g[g.length-1].StartDate;r(g,d)}}})}function r(b,d){var g=a("#"+d.id+"_container"),h=g.find("ul.dates"),i=h.find("li");a(i).remove();i="";for(c=0;c<b.length;c++){if(i==""||i!=b[c].StartDate&&d.mode=="day"){i=b[c].StartDate;var p=a('<li class="date" >'+b[c].display+'<ul class="a-date"></ul></li>'); 13 h.append(p)}var q=d.add_to_google?a('<li class="event"></li>').append('<span class="cat"></span><span><strong>'+b[c].time+": </strong></span>"+b[c].post_title).append('<div class="meta" style="display:none;"><span>'+b[c].link+"</span><span> \u00a0 </span><span>"+b[c].Glink+"</span></div>"):a('<li class="event"></li>').append("<a class='eo-agenda-event-permalink' href='"+b[c].event_url+"'><span class='cat'></span><span><strong>"+b[c].time+": </strong></span>"+b[c].post_title+"</a>");q.find("span.cat").css({background:b[c].color}); 14 p.append(q)}i=h.find("li");g.find("ul li.event").on("click",function(){a(this).find(".meta").toggle("400")})}for(var m in eo_widget_agenda){m=eo_widget_agenda[m];m.StartDate=a.fullCalendar.formatDate(new Date,"yyyy-MM-dd");m.EndDate=m.StartDate;o(1,m)}a(".eo-agenda-widget .agenda-nav span.button").click(function(b){var d=a(this).parents(".eo-agenda-widget").attr("id");m=eo_widget_agenda[d];b.preventDefault();b=a(this).hasClass("next")?"+1":a(this).hasClass("prev")?"-1":a(this).parent().hasClass("prev")? 15 "-1":"+1";o(b,m)})}})})(jQuery);function eveorg_getParameterByName(a,f){a=a.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");a=(new RegExp("[\\?&]"+a+"=([^&#]*)")).exec(f);return a==null?"":decodeURIComponent(a[1].replace(/\+/g," "))}6 axisFormat:e[c].axisformat,minTime:e[c].mintime,maxTime:e[c].maxtime,columnFormat:{month:e[c].columnformatmonth,week:e[c].columnformatweek,day:e[c].columnformatday}, 7 , 8 ; 9 if(typeof h. 10 a(".eo-mini-calendar").datepicker({dateFormat:"DD, d MM, yy",changeMonth:true,changeYear:true,dateFormat:"DD, d MM, yy",firstDay:parseInt(EOAjax.fullcal.firstDay),buttonText:EOAjaxFront.locale.gotodate,monthNamesShort:EOAjaxFront.locale.monthAbbrev,dayNamesMin:EOAjaxFront.locale.dayAbbrev,showOn:"button",onSelect:function(b){var d=a(this).parents("div.eo-fullcalendar").attr("id");a("#"+d).fullCalendar("gotoDate",new Date(Date.parse(b)))}})}if(a(".eo_widget_calendar").length>0){a(".eo_widget_calendar tfoot").unbind("click"); 11 a(".eo_widget_calendar tfoot a").die("click").live("click",function(b){b.preventDefault();var d=a(this).closest(".eo_widget_calendar").attr("id");b={showpastevents:1};if(typeof EOAjax!=="undefined"&&typeof EOAjax.widget_calendars!=="undefined")b=EOAjax.widget_calendars[d];if(typeof eo_widget_cal!=="undefined")b=eo_widget_cal[d];b.eo_month=eveorg_getParameterByName("eo_month",a(this).attr("href"));a.getJSON(EOAjaxFront.adminajax+"?action=eo_widget_cal",b,function(g){a("#"+d+"_content").html(g)})})}if(a(".eo-agenda-widget").length> 12 0){function o(b,d){a.ajax({url:EOAjaxFront.adminajax,dataType:"JSON",data:{action:"eo_widget_agenda",instance_number:d.number,direction:b,start:d.StartDate,end:d.EndDate},success:function(g){if(!jQuery.isArray(g)||!g[0])return false;else{d.StartDate=g[0].StartDate;d.EndDate=g[g.length-1].StartDate;r(g,d)}}})}function r(b,d){var g=a("#"+d.id+"_container"),h=g.find("ul.dates"),i=h.find("li");a(i).remove();i="";for(c=0;c<b.length;c++){if(i==""||i!=b[c].StartDate&&d.mode=="day"){i=b[c].StartDate;var p= 13 a('<li class="date" >'+b[c].display+'<ul class="a-date"></ul></li>');h.append(p)}var q=d.add_to_google?a('<li class="event"></li>').append('<span class="cat"></span><span><strong>'+b[c].time+": </strong></span>"+b[c].post_title).append('<div class="meta" style="display:none;"><span>'+b[c].link+"</span><span> \u00a0 </span><span>"+b[c].Glink+"</span></div>"):a('<li class="event"></li>').append("<a class='eo-agenda-event-permalink' href='"+b[c].event_url+"'><span class='cat'></span><span><strong>"+ 14 b[c].time+": </strong></span>"+b[c].post_title+"</a>");q.find("span.cat").css({background:b[c].color});p.append(q)}i=h.find("li");g.find("ul li.event").on("click",function(){a(this).find(".meta").toggle("400")})}for(var m in eo_widget_agenda){m=eo_widget_agenda[m];m.StartDate=a.fullCalendar.formatDate(new Date,"yyyy-MM-dd");m.EndDate=m.StartDate;o(1,m)}a(".eo-agenda-widget .agenda-nav span.button").click(function(b){var d=a(this).parents(".eo-agenda-widget").attr("id");m=eo_widget_agenda[d];b.preventDefault(); 15 "-1":"+1";o(b,m)})}})})(jQuery);function eveorg_getParameterByName(a,f){a=a.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");a=(new RegExp("[\\?&]"+a+"=([^&#]*)")).exec(f);return a==null?"":decodeURIComponent(a[1].replace(/\+/g," "))} 16 16 function eo_load_map(){for(var a=EOAjax.map,f=0;f<a.length;f++){var j=a[f].locations,k={zoom:a[f].zoom,scrollwheel:a[f].scrollwheel,zoomControl:a[f].zoomcontrol,rotateControl:a[f].rotatecontrol,panControl:a[f].pancontrol,overviewMapControl:a[f].overviewmapcontrol,streetViewControl:a[f].streetviewcontrol,draggable:a[f].draggable,mapTypeControl:a[f].maptypecontrol,mapTypeId:google.maps.MapTypeId[a[f].maptypeid]};k=new google.maps.Map(document.getElementById("eo_venue_map-"+(f+1)),k);for(var e=new google.maps.LatLngBounds, 17 17 l=[],c=0;c<j.length;c++){var n=j[c].lat,o=j[c].lng;if(n!==undefined&&o!=undefined){l.push(new google.maps.LatLng(n,o));e.extend(l[c]);n=new google.maps.Marker({position:l[c],map:k,content:j[c].tooltipContent});"false"!=a[f].tooltip&&google.maps.event.addListener(n,"click",eventorganiser_venue_tooltip)}}j.length>1?k.fitBounds(e):k.setCenter(l[0])}} -
event-organiser/trunk/js/inline-help.js
r677286 r683356 16 16 hide: 'unfocus', 17 17 style: { 18 classes: "ui-tooltip-shadow", 19 widget: true, 18 classes: 'qtip-wiki qtip-light qtip-shadow' 19 }, 20 position : { 21 viewport: $(window) 20 22 } 21 23 }); -
event-organiser/trunk/readme.md
r677286 r683356 5 5 **Requires at least:** 3.3 6 6 **Tested up to:** 3.5 7 **Stable tag:** 1. 7.37 **Stable tag:** 1. 8 8 **License:** GPLv3 9 9 … … 65 65 * Russian - [Sergei](www.vortexinter.ru) 66 66 * Hungarian - Csaba Erdei 67 67 68 68 69 ## Installation ## … … 148 149 * `[eo_fullcalendar]` - displays a calendar, similiar to the admin calendar, with optional month, week and day views and category and venue filters. 149 150 * `[eo_venue_map]` - displays a Google map of the current venue, or of a particular venue given as an attribute. 150 * **`[eo_subscribe]` - wraps the content in a link which allows visitors to subscribe to your events; there are two types:** 'Google' and 'Webcal'.151 * `[eo_subscribe]` - wraps the content in a link which allows visitors to subscribe to your events; there are two types:** 'Google' and 'Webcal'. 151 152 152 153 More information on shortcodes is [available here](http://wp-event-organiser.com/documentation/shortcodes/) … … 174 175 175 176 ## Changelog ## 177 178 179 180 181 182 183 184 185 176 186 177 187 ### 1.7.4 ### -
event-organiser/trunk/readme.txt
r677286 r683356 5 5 Requires at least: 3.3 6 6 Tested up to: 3.5 7 Stable tag: 1. 7.47 Stable tag: 1. 8 8 License: GPLv3 9 9 … … 65 65 * Russian - [Sergei](www.vortexinter.ru) 66 66 * Hungarian - Csaba Erdei 67 67 68 68 69 == Installation == … … 162 163 163 164 == Changelog == 165 166 167 168 169 170 171 172 173 164 174 165 175 = 1.7.4 = -
event-organiser/trunk/templates/shortcode-event-list.php
r677286 r683356 49 49 ?> 50 50 51 <li class="<? echo esc_attr(implode(' ',$eo_event_classes)); ?>" >51 <li class="<? echo esc_attr(implode(' ',$eo_event_classes)); ?>" > 52 52 <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" ><?php the_title(); ?></a> <?php echo __('on','eventorganiser') . ' '.eo_get_the_start($format); ?> 53 53 </li> -
event-organiser/trunk/templates/widget-event-list.php
r677286 r683356 46 46 ?> 47 47 48 <li class="<? echo esc_attr(implode(' ',$eo_event_classes)); ?>" >48 <li class="<? echo esc_attr(implode(' ',$eo_event_classes)); ?>" > 49 49 <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" ><?php the_title(); ?></a> <?php echo __('on','eventorganiser') . ' '.eo_get_the_start($format); ?> 50 50 </li>
Note: See TracChangeset
for help on using the changeset viewer.