PluginProbe
UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP / 1.1.2
UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP v1.1.2
1.2.72 1.2.71 1.2.70 1.2.69 1.2.68 1.2.67 1.2.66 1.2.65 1.2.64 1.2.63 trunk 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.20 1.0.21 1.0.22 1.0.23 All 172 releases
userswp / admin / class-admin.php

class-admin.php in UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP 1.1.2, at admin/class-admin.php

135 lines 5.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * The admin-specific functionality of the plugin.
4 *
5 * @link http://wpgeodirectory.com
6 * @since 1.0.0
7 *
8 * @package userswp
9 * @subpackage userswp/admin
10 */
11
12 /**
13 * The admin-specific functionality of the plugin.
14 *
15 * Defines the plugin name, version, and two examples hooks for how to
16 * enqueue the admin-specific stylesheet and JavaScript.
17 *
18 * @package userswp
19 * @subpackage userswp/admin
20 * @author GeoDirectory Team <info@wpgeodirectory.com>
21 */
22 class UsersWP_Admin {
23
24 /**
25 * Register all of the hooks related to the admin area functionality
26 * of the plugin.
27 *
28 * @since 1.0.0
29 */
30 public function __construct() {
31
32 }
33
34
35 /**
36 * Register the stylesheets for the admin area.
37 *
38 * @since 1.0.0
39 * @param $hook_suffix
40 */
41 public function enqueue_styles($hook_suffix) {
42
43 if ($hook_suffix == 'profile.php' || $hook_suffix == 'user-edit.php') {
44 wp_register_style('jquery-ui', USERSWP_PLUGIN_URL . 'assets/css/jquery-ui.css');
45 wp_enqueue_style( 'jquery-ui' );
46 wp_enqueue_style( 'jcrop' );
47 wp_enqueue_style( "userswp", USERSWP_PLUGIN_URL . 'assets/css/users-wp.css', array(), USERSWP_VERSION, 'all' );
48 wp_enqueue_style( "uwp_timepicker_css", USERSWP_PLUGIN_URL . 'assets/css/jquery.ui.timepicker.css', array(), USERSWP_VERSION, 'all' );
49 }
50 if ($hook_suffix == 'userswp_page_uwp_tools') {
51 wp_enqueue_style( "userswp", USERSWP_PLUGIN_URL . 'assets/css/users-wp.css', array(), USERSWP_VERSION, 'all' );
52 }
53 wp_enqueue_style( "userswp_admin_css", USERSWP_PLUGIN_URL . 'admin/assets/css/users-wp-admin.css', array(), USERSWP_VERSION, 'all' );
54 wp_enqueue_style( "select2", USERSWP_PLUGIN_URL . 'assets/css/select2/select2.css', array(), USERSWP_VERSION, 'all' );
55
56 if ($hook_suffix == 'toplevel_page_userswp') {
57 wp_enqueue_style( 'wp-color-picker' );
58 }
59
60 }
61
62 /**
63 * Register the JavaScript for the admin area.
64 *
65 * @since 1.0.0
66 * @param $hook_suffix
67 */
68 public function enqueue_scripts($hook_suffix) {
69
70 $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
71
72 if ($hook_suffix == 'profile.php' || $hook_suffix == 'user-edit.php') {
73
74 wp_enqueue_script( 'jquery-ui-datepicker', array( 'jquery' ) );
75 wp_enqueue_script( "uwp_timepicker", USERSWP_PLUGIN_URL . 'assets/js/jquery.ui.timepicker'.$suffix.'.js', array( 'jquery', 'jquery-ui-datepicker', 'jquery-ui-core' ), USERSWP_VERSION );
76 wp_enqueue_script( "userswp", USERSWP_PLUGIN_URL . 'assets/js/users-wp'.$suffix.'.js', array( 'jquery' ), USERSWP_VERSION, false );
77 $uwp_localize_data = uwp_get_localize_data();
78 wp_localize_script('userswp', 'uwp_localize_data', $uwp_localize_data);
79 wp_enqueue_script( 'jquery-ui-progressbar', array( 'jquery' ) );
80 wp_enqueue_script( 'jcrop', array( 'jquery' ) );
81 wp_enqueue_script( "country-select", USERSWP_PLUGIN_URL . 'assets/js/countrySelect'.$suffix.'.js', array( 'jquery' ), USERSWP_VERSION );
82
83
84 }
85 if ($hook_suffix == 'userswp_page_uwp_status') {
86 wp_enqueue_script( 'jquery-ui-progressbar', array( 'jquery' ) );
87 wp_enqueue_script( "uwp_status", USERSWP_PLUGIN_URL . 'admin/assets/js/system-status.js', array( 'jquery' ), USERSWP_VERSION, true );
88 }
89
90 wp_enqueue_script('jquery-ui-sortable');
91 wp_enqueue_script( "userswp_admin", USERSWP_PLUGIN_URL . 'admin/assets/js/users-wp-admin'.$suffix.'.js', array( 'jquery' ), USERSWP_VERSION, false );
92 wp_enqueue_script('select2', USERSWP_PLUGIN_URL . 'assets/js/select2/select2.full' . $suffix . '.js', array( 'jquery' ), USERSWP_VERSION );
93
94 wp_enqueue_script("jquery-ui-tooltip");
95 wp_enqueue_script('wp-color-picker');
96
97 $ajax_cons_data = array(
98 'url' => admin_url('admin-ajax.php'),
99 'custom_field_not_blank_var' => __('Field key must not be blank', 'userswp'),
100 'custom_field_options_not_blank_var' => __('Option Values must not be blank', 'userswp'),
101 'custom_field_not_special_char' => __('Please do not use special character and spaces in field key.', 'userswp'),
102 'custom_field_unique_name' => __('Field key should be a unique name.', 'userswp'),
103 'custom_field_delete' => __('Are you sure you wish to delete this field?', 'userswp'),
104 'custom_field_id_required' => __('This field is required.', 'userswp'),
105 'img_spacer' => admin_url( 'images/media-button-image.gif' ),
106 'txt_choose_image' => __( 'Choose an image', 'userswp' ),
107 'txt_use_image' => __( 'Use image', 'userswp' ),
108 );
109 wp_localize_script("userswp_admin", 'uwp_admin_ajax', $ajax_cons_data);
110
111 $country_data = uwp_get_country_data();
112 wp_localize_script(USERSWP_NAME, 'uwp_country_data', $country_data);
113
114 }
115
116 /**
117 * Adds UsersWP css to admin area
118 *
119 * @since 1.0.0
120 * @package userswp
121 *
122 * @return void
123 */
124 function uwp_admin_only_css() {
125 ?>
126 <style type="text/css">
127 .uwp_page .uwp-bs-modal input[type="submit"].button,
128 .uwp_page .uwp-bs-modal button.button {
129 padding: 0 10px 1px;
130 }
131 </style>
132 <?php
133 }
134
135 }