本文整理汇总了PHP中FrmAppHelper::load_admin_wide_js方法的典型用法代码示例。如果您正苦于以下问题:PHP FrmAppHelper::load_admin_wide_js方法的具体用法?PHP FrmAppHelper::load_admin_wide_js怎么用?PHP FrmAppHelper::load_admin_wide_js使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrmAppHelper
的用法示例。
在下文中一共展示了FrmAppHelper::load_admin_wide_js方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: import_choices
public static function import_choices()
{
if (!current_user_can('frm_edit_forms')) {
wp_die();
}
$field_id = absint($_REQUEST['field_id']);
global $current_screen, $hook_suffix;
// Catch plugins that include admin-header.php before admin.php completes.
if (empty($current_screen) && function_exists('set_current_screen')) {
$hook_suffix = '';
set_current_screen();
}
if (function_exists('register_admin_color_schemes')) {
register_admin_color_schemes();
}
$hook_suffix = $admin_body_class = '';
if (get_user_setting('mfold') == 'f') {
$admin_body_class .= ' folded';
}
if (function_exists('is_admin_bar_showing') && is_admin_bar_showing()) {
$admin_body_class .= ' admin-bar';
}
if (is_rtl()) {
$admin_body_class .= ' rtl';
}
$admin_body_class .= ' admin-color-' . sanitize_html_class(get_user_option('admin_color'), 'fresh');
$prepop = array();
FrmFieldsHelper::get_bulk_prefilled_opts($prepop);
$field = FrmField::getOne($field_id);
wp_enqueue_script('utils');
wp_enqueue_style('formidable-admin', FrmAppHelper::plugin_url() . '/css/frm_admin.css');
FrmAppHelper::load_admin_wide_js();
include FrmAppHelper::plugin_path() . '/classes/views/frm-fields/import_choices.php';
wp_die();
}
示例2: admin_js
public static function admin_js()
{
$version = FrmAppHelper::plugin_version();
FrmAppHelper::load_admin_wide_js(false);
wp_register_script('formidable_admin', FrmAppHelper::plugin_url() . '/js/formidable_admin.js', array('formidable_admin_global', 'formidable', 'jquery', 'jquery-ui-core', 'jquery-ui-draggable', 'jquery-ui-sortable', 'bootstrap_tooltip', 'bootstrap-multiselect'), $version, true);
wp_register_style('formidable-admin', FrmAppHelper::plugin_url() . '/css/frm_admin.css', array(), $version);
wp_register_script('bootstrap_tooltip', FrmAppHelper::plugin_url() . '/js/bootstrap.min.js', array('jquery'), '3.3.4');
// load multselect js
wp_register_script('bootstrap-multiselect', FrmAppHelper::plugin_url() . '/js/bootstrap-multiselect.js', array('jquery', 'bootstrap_tooltip'), '0.9.8', true);
$page = FrmAppHelper::simple_get('page', 'sanitize_title');
$post_type = FrmAppHelper::simple_get('post_type', 'sanitize_title');
global $pagenow;
if (strpos($page, 'formidable') === 0 || $pagenow == 'edit.php' && $post_type == 'frm_display') {
wp_enqueue_script('admin-widgets');
wp_enqueue_style('widgets');
wp_enqueue_script('formidable');
wp_enqueue_script('formidable_admin');
FrmAppHelper::localize_script('admin');
wp_enqueue_style('formidable-admin');
add_thickbox();
wp_register_script('formidable-editinplace', FrmAppHelper::plugin_url() . '/js/jquery/jquery.editinplace.packed.js', array('jquery'), '2.3.0');
} else {
if ($pagenow == 'post.php' || $pagenow == 'post-new.php' && $post_type == 'frm_display') {
if (isset($_REQUEST['post_type'])) {
$post_type = sanitize_title($_REQUEST['post_type']);
} else {
if (isset($_REQUEST['post']) && absint($_REQUEST['post'])) {
$post = get_post(absint($_REQUEST['post']));
if (!$post) {
return;
}
$post_type = $post->post_type;
} else {
return;
}
}
if ($post_type == 'frm_display') {
wp_enqueue_script('jquery-ui-draggable');
wp_enqueue_script('formidable_admin');
wp_enqueue_style('formidable-admin');
FrmAppHelper::localize_script('admin');
}
} else {
if ($pagenow == 'widgets.php') {
FrmAppHelper::load_admin_wide_js();
}
}
}
}
示例3: insert_form_popup
public static function insert_form_popup()
{
$page = basename(FrmAppHelper::get_server_value('PHP_SELF'));
if (!in_array($page, array('post.php', 'page.php', 'page-new.php', 'post-new.php'))) {
return;
}
FrmAppHelper::load_admin_wide_js();
$shortcodes = array('formidable' => array('name' => __('Form', 'formidable'), 'label' => __('Insert a Form', 'formidable')));
$shortcodes = apply_filters('frm_popup_shortcodes', $shortcodes);
include FrmAppHelper::plugin_path() . '/classes/views/frm-forms/insert_form_popup.php';
}