コード例 #1
0
ファイル: booking-init.php プロジェクト: loevendahl/flexbil
function bizz_book_javascript()
{
    global $booking_settings, $wp_locale;
    // get booking settings
    $opt_s = $booking_settings->get_settings();
    // css
    wp_enqueue_style('jquery_ui_style', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/blitzer/jquery-ui.css');
    #header
    // js
    wp_enqueue_script('jquery-ui-datepicker');
    #header
    wp_enqueue_script('booking-js', get_stylesheet_directory_uri() . '/lib_theme/booking/booking.js', array('jquery'));
    # header
    wp_localize_script('booking-js', 'bizzlang', array('menu_select' => __('Select a page', 'bizzthemes'), 'book_empty' => __('Select a location first, then pick a date and time.', 'bizzthemes'), 'book_closed' => __('We are closed on this date, pick another one.', 'bizzthemes'), 'book_past' => __('We cannot book you for the past date, pick another one.', 'bizzthemes'), 'book_success' => __('Thanks, your booking has been received. Expect confirmation email shortly after someone reviews your booking.', 'bizzthemes'), 'book_nocars' => __('No vehicles found.', 'bizzthemes'), 'book_noextra' => __('No extras selected.', 'bizzthemes'), 'book_noextras' => __('No extras available for this vehicle.', 'bizzthemes'), 'book_required' => __('Required.', 'bizzthemes'), 'email_required' => __('Email is not valid.', 'bizzthemes'), 'thankyou_page' => $opt_s['pay_thankyou'], 'price_not_defined' => __('Not Available', 'bizzthemes'), 'free' => __('Free', 'bizzthemes')));
    // datepicker
    // read: http://jquery-ui.googlecode.com/svn/tags/latest/ui/i18n/ for all language translations
    wp_localize_script('booking-js', 'objectL10n', apply_filters('bizz_calendar_lang', array('minDateP' => 0, 'minDateR' => 1, 'closeText' => __('Done', 'bizzthemes'), 'currentText' => __('Today', 'bizzthemes'), 'monthNames' => strip_array_indices($wp_locale->month), 'monthNamesShort' => strip_array_indices($wp_locale->month_abbrev), 'monthStatus' => __('Show a different month', 'bizzthemes'), 'dayNames' => strip_array_indices($wp_locale->weekday), 'dayNamesShort' => strip_array_indices($wp_locale->weekday_abbrev), 'dayNamesMin' => strip_array_indices($wp_locale->weekday_initial), 'dateFormat' => dateformatsyntax_php2js(get_option('date_format', 'y-m-d')), 'firstDay' => get_option('start_of_week'), 'isRTL' => isset($wp_locale->is_rtl) ? $wp_locale->is_rtl : false)));
}
コード例 #2
0
function mfgigcal_admin_register_head()
{
    global $post, $wp_locale;
    date_default_timezone_set(get_option('timezone_string'));
    // add the jQuery UI elements shipped with WP
    wp_enqueue_script('jquery');
    wp_enqueue_script('jquery-ui-datepicker');
    // add the style
    wp_enqueue_style('jquery.ui.theme', plugins_url('/css/jquery-ui-1.9.2.custom.css', __FILE__));
    wp_enqueue_style('mfgigcal-css', plugins_url('/css/mf_gig_calendar_admin.css', __FILE__));
    // add mfgigcal js
    wp_enqueue_script('mfgigcal-admin', $siteurl . '/wp-content/plugins/' . basename(dirname(__FILE__)) . '/mf_gig_calendar_admin.js', array('jquery-ui-datepicker'));
    // localize our js for datepicker
    $aryArgs = array('closeText' => __('Done', 'mfgigcal'), 'currentText' => __('Today', 'mfgigcal'), 'monthNames' => strip_array_indices($wp_locale->month), 'monthNamesShort' => strip_array_indices($wp_locale->month_abbrev), 'monthStatus' => __('Show a different month', 'mfgigcal'), 'dayNames' => strip_array_indices($wp_locale->weekday), 'dayNamesShort' => strip_array_indices($wp_locale->weekday_abbrev), 'dayNamesMin' => strip_array_indices($wp_locale->weekday_initial), 'firstDay' => get_option('start_of_week'), 'isRTL' => $wp_locale->is_rtl);
    // Pass the translation array to the enqueued JS for datepicker
    wp_localize_script('mfgigcal-admin', 'objectL10n', $aryArgs);
}