Пример #1
0
/**
 * Add the scripts needed for the page for this plugin.
 */
function WPCW_addCustomScripts_BackEnd()
{
    // Shown on all admin pages
    wp_enqueue_script('wpcw-admin-users', WPCW_plugin_getPluginPath() . 'js/wpcw_admin_users.js', array('jquery'), WPCW_DATABASE_VERSION);
    // Variable declarations for admin pages
    wp_localize_script('wpcw-admin-users', 'wpcw_js_consts_usr', array('confirm_bulk_change' => __('Are you sure you wish to reset the progress of the selected users? This CANNOT be undone.', 'wp_courseware'), 'confirm_single_change' => __('Are you sure you wish to reset the progress of this user? This CANNOT be undone.', 'wp_courseware'), 'confirm_whole_course_reset' => __('Are you sure you wish to reset the progress of all users on this course? This CANNOT be undone.', 'wp_courseware'), 'confirm_access_change_users' => __('Are you sure you wish to add access for this course for all users?', 'wp_courseware'), 'confirm_access_change_admins' => __('Are you sure you wish to add access for this course for all admins?', 'wp_courseware'), 'msg_question_duplicate' => __('That question already exists in this quiz, so cannot be added again.', 'wp_courseware'), 'status_copying' => __('Copying...', 'wp_courseware'), 'name_tag_whole_pool' => __('Entire Question Pool', 'wp_courseware'), 'title_tb_edit_rand_qu' => __('Edit Random Question Selection', 'wp_courseware')));
    if (!WPCW_areWeOnPluginPage()) {
        return;
    }
    wp_enqueue_media();
    // Our plugin-specific JS
    wp_enqueue_script('wpcw-admin', WPCW_plugin_getPluginPath() . 'js/wpcw_admin.js', array('jquery', 'media-upload', 'thickbox', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-mouse', 'jquery-ui-sortable', 'jquery-ui-spinner'), WPCW_DATABASE_VERSION);
    // Variable declarations
    wp_localize_script('wpcw-admin', 'wpcw_js_consts_adm', array('order_nonce' => wp_create_nonce('wpcw-order-nonce')));
}
Пример #2
0
/**
 * Add the scripts needed for the page for this plugin.
 */
function WPCW_addCustomScripts_BackEnd()
{
    if (!WPCW_areWeOnPluginPage()) {
        return;
    }
    wp_enqueue_media();
    // Our plugin-specific JS
    wp_enqueue_script('wpcw-admin', WPCW_plugin_getPluginPath() . 'js/wpcw_admin.js', array('jquery', 'media-upload', 'thickbox', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-mouse', 'jquery-ui-sortable'), WPCW_DATABASE_VERSION);
    // Variable declarations
    wp_localize_script('wpcw-admin', 'wpcw_be_ajax', array('order_nonce' => wp_create_nonce('wpcw-order-nonce')));
}