/** * Enqueues the page's scripts and styles, and localises them. */ function page_scripts() { global $wp_locale; wp_enqueue_script('eo_calendar'); //wp_enqueue_script( 'eo_event' ); wp_localize_script('eo_event', 'EO_Ajax_Event', array('ajaxurl' => admin_url('admin-ajax.php'), 'startday' => intval(get_option('start_of_week')), 'format' => eventorganiser_php2jquerydate(eventorganiser_get_option('dateformat')))); wp_localize_script('eo_calendar', 'EO_Ajax', array('ajaxurl' => admin_url('admin-ajax.php'), 'startday' => intval(get_option('start_of_week')), 'format' => eventorganiser_php2jquerydate(eventorganiser_get_option('dateformat')), 'timeFormat' => get_current_screen()->get_option('eofc_time_format', 'value') ? 'h:mmtt' : 'HH:mm', 'perm_edit' => current_user_can('edit_events'), 'categories' => get_terms('event-category', array('hide_empty' => 0)), 'venues' => get_terms('event-venue', array('hide_empty' => 0)), 'locale' => array('isrtl' => $wp_locale->is_rtl(), 'monthNames' => array_values($wp_locale->month), 'monthAbbrev' => array_values($wp_locale->month_abbrev), 'dayNames' => array_values($wp_locale->weekday), 'dayAbbrev' => array_values($wp_locale->weekday_abbrev), 'today' => __('today', 'eventorganiser'), 'day' => __('day', 'eventorganiser'), 'week' => __('week', 'eventorganiser'), 'month' => __('month', 'eventorganiser'), 'gotodate' => __('go to date', 'eventorganiser'), 'cat' => __('View all categories', 'eventorganiser'), 'venue' => __('View all venues', 'eventorganiser')))); }
/** * Enqueues the page's scripts and styles, and localises them. */ function page_scripts() { global $wp_locale; wp_enqueue_script('eo_calendar'); $edittime = defined('EVENT_ORGANISER_BETA_FEATURES') && EVENT_ORGANISER_BETA_FEATURES; $venues = $categories = $all_cats = $all_venues = false; if ($category_tax = get_taxonomy('event-category')) { $categories = get_terms('event-category', array('hide_empty' => 0)); $all_cats = $category_tax->labels->view_all_items; } if ($venue_tax = get_taxonomy('event-venue')) { $venues = get_terms('event-venue', array('hide_empty' => 0)); $all_venues = $venue_tax->labels->view_all_items; } wp_localize_script('eo_calendar', 'EO_Ajax', array('ajaxurl' => admin_url('admin-ajax.php'), 'startday' => intval(get_option('start_of_week')), 'format' => eventorganiser_php2jquerydate(eventorganiser_get_option('dateformat')), 'timeFormat' => get_current_screen()->get_option('eofc_time_format', 'value') ? 'h:mmtt' : 'HH:mm', 'perm_edit' => current_user_can('edit_events'), 'edit_time' => $edittime ? current_user_can('edit_events') : false, 'edit_nonce' => wp_create_nonce('edit_events'), 'categories' => $categories, 'venues' => $venues, 'locale' => array('isrtl' => $wp_locale->is_rtl(), 'monthNames' => array_values($wp_locale->month), 'monthAbbrev' => array_values($wp_locale->month_abbrev), 'dayNames' => array_values($wp_locale->weekday), 'dayAbbrev' => array_values($wp_locale->weekday_abbrev), 'today' => __('today', 'eventorganiser'), 'day' => __('day', 'eventorganiser'), 'week' => __('week', 'eventorganiser'), 'month' => __('month', 'eventorganiser'), 'gotodate' => __('go to date', 'eventorganiser'), 'cat' => $all_cats, 'venue' => $all_venues))); }
/** * Queues up the javascript / style scripts for Events custom page type * Hooked onto admin_enqueue_scripts * * @since 1.0.0 * @ignore * @access private */ function eventorganiser_add_admin_scripts($hook) { global $post, $current_screen, $wp_locale; if ($hook == 'post-new.php' || $hook == 'post.php') { if ($post->post_type == 'event') { wp_enqueue_script('eo-edit-event-controller'); wp_localize_script('eo_event', 'EO_Ajax_Event', array('ajaxurl' => admin_url('admin-ajax.php'), 'wpversion' => get_bloginfo('version'), 'startday' => intval(get_option('start_of_week')), 'format' => eventorganiser_php2jquerydate(eventorganiser_get_option('dateformat')), 'current_user_can' => array('manage_venues' => current_user_can('manage_venues')), 'is24hour' => eventorganiser_blog_is_24(), 'location' => get_option('timezone_string'), 'locale' => array('isrtl' => $wp_locale->is_rtl(), 'monthNames' => array_values($wp_locale->month), 'monthAbbrev' => array_values($wp_locale->month_abbrev), 'dayAbbrev' => array_values($wp_locale->weekday_abbrev), 'showDates' => __('Show dates', 'eventorganiser'), 'hideDates' => __('Hide dates', 'eventorganiser'), 'weekDay' => $wp_locale->weekday, 'meridian' => array($wp_locale->get_meridiem('am'), $wp_locale->get_meridiem('pm')), 'hour' => __('Hour', 'eventorganiser'), 'minute' => __('Minute', 'eventorganiser'), 'day' => __('day', 'eventorganiser'), 'days' => __('days', 'eventorganiser'), 'week' => __('week', 'eventorganiser'), 'weeks' => __('weeks', 'eventorganiser'), 'month' => __('month', 'eventorganiser'), 'months' => __('months', 'eventorganiser'), 'year' => __('year', 'eventorganiser'), 'years' => __('years', 'eventorganiser'), 'daySingle' => __('every day', 'eventorganiser'), 'dayPlural' => __('every %d days', 'eventorganiser'), 'weekSingle' => __('every week on', 'eventorganiser'), 'weekPlural' => __('every %d weeks on', 'eventorganiser'), 'monthSingle' => __('every month on the', 'eventorganiser'), 'monthPlural' => __('every %d months on the', 'eventorganiser'), 'yearSingle' => __('every year on the', 'eventorganiser'), 'yearPlural' => __('every %d years on the', 'eventorganiser'), 'summary' => __('This event will repeat', 'eventorganiser'), 'until' => __('until', 'eventorganiser'), 'occurrence' => array(__('first', 'eventorganiser'), __('second', 'eventorganiser'), __('third', 'eventorganiser'), __('fourth', 'eventorganiser'), __('last', 'eventorganiser'))))); wp_enqueue_script('eo_venue'); wp_enqueue_style('eventorganiser-style'); } } elseif ($current_screen->id == 'edit-event') { wp_enqueue_style('eventorganiser-style'); } }