コード例 #1
0
 /**
  * Handles profile action
  *
  * Callback for "tml_request_profile" in method Theme_My_Login::the_request()
  *
  * @see Theme_My_Login::the_request()
  * @since 6.0
  * @access public
  */
 function profile_action()
 {
     require_once ABSPATH . 'wp-admin/includes/user.php';
     require_once ABSPATH . 'wp-admin/includes/misc.php';
     if (version_compare($GLOBALS['wp_version'], '3.1', '<')) {
         require_once ABSPATH . WPINC . '/registration.php';
     }
     define('IS_PROFILE_PAGE', true);
     register_admin_color_schemes();
     wp_enqueue_style('password-strength', plugins_url('theme-my-login/modules/themed-profiles/themed-profiles.css'));
     $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '.dev' : '';
     wp_enqueue_script('user-profile', admin_url("js/user-profile{$suffix}.js"), array('jquery'), '', true);
     wp_enqueue_script('password-strength-meter', admin_url("js/password-strength-meter{$suffix}.js"), array('jquery'), '', true);
     wp_localize_script('password-strength-meter', 'pwsL10n', array('empty' => __('Strength indicator', 'theme-my-login'), 'short' => __('Very weak', 'theme-my-login'), 'bad' => __('Weak', 'theme-my-login'), 'good' => _x('Medium', 'password strength', 'theme-my-login'), 'strong' => __('Strong', 'theme-my-login'), 'l10n_print_after' => 'try{convertEntities(pwsL10n);}catch(e){};'));
     $current_user = wp_get_current_user();
     if ('POST' == $_SERVER['REQUEST_METHOD']) {
         check_admin_referer('update-user_' . $current_user->ID);
         if (!current_user_can('edit_user', $current_user->ID)) {
             wp_die(__('You do not have permission to edit this user.', 'theme-my-login'));
         }
         do_action('personal_options_update', $current_user->ID);
         $errors = edit_user($current_user->ID);
         if (!is_wp_error($errors)) {
             $redirect = add_query_arg(array('updated' => 'true'));
             wp_redirect($redirect);
             exit;
         }
         $GLOBALS['theme_my_login']->errors = $errors;
     }
     if (isset($_GET['updated']) && 'true' == $_GET['updated']) {
         $GLOBALS['theme_my_login']->errors->add('profile_updated', __('Profile updated.', 'theme-my-login'), 'message');
     }
 }
コード例 #2
0
ファイル: themed-profiles.php プロジェクト: dot2006/jobify
 /**
  * Handles profile action
  *
  * Callback for "tml_request_profile" in method Theme_My_Login::the_request()
  *
  * @see Theme_My_Login::the_request()
  * @since 6.0
  * @access public
  */
 public function tml_request_profile()
 {
     require_once ABSPATH . 'wp-admin/includes/user.php';
     require_once ABSPATH . 'wp-admin/includes/misc.php';
     define('IS_PROFILE_PAGE', true);
     load_textdomain('default', WP_LANG_DIR . '/admin-' . get_locale() . '.mo');
     register_admin_color_schemes();
     wp_enqueue_style('password-strength', plugins_url('theme-my-login/modules/themed-profiles/themed-profiles.css'));
     wp_enqueue_script('user-profile');
     $current_user = wp_get_current_user();
     if ('POST' == $_SERVER['REQUEST_METHOD']) {
         check_admin_referer('update-user_' . $current_user->ID);
         if (!current_user_can('edit_user', $current_user->ID)) {
             wp_die(__('You do not have permission to edit this user.'));
         }
         do_action('personal_options_update', $current_user->ID);
         $errors = edit_user($current_user->ID);
         if (!is_wp_error($errors)) {
             $args = array('updated' => 'true');
             if (!empty($_REQUEST['instance'])) {
                 $args['instance'] = $_REQUEST['instance'];
             }
             $redirect = add_query_arg($args);
             wp_redirect($redirect);
             exit;
         } else {
             Theme_My_Login::get_object()->errors = $errors;
         }
     }
 }
コード例 #3
0
 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();
 }
コード例 #4
0
    private function _set_color_scheme()
    {
        global $_wp_admin_css_colors;
        register_admin_color_schemes();
        $admin_color = get_user_option('admin_color');
        if (isset($_wp_admin_css_colors[$admin_color])) {
            $shadow = implode(', ', static::hex2rgb($_wp_admin_css_colors[$admin_color]->colors[1]));
            ?>
			<style>
				#builder-widget-overlay-clicked {
					-webkit-box-shadow: 0 0 0 9999px rgba(<?php 
            echo $shadow;
            ?>
, 0.5);
					box-shadow: 0 0 0 9999px rgba(<?php 
            echo $shadow;
            ?>
, 0.5);
				}
				#builder-widget-overlay-hovered {
					background-color: rgba(<?php 
            echo implode(', ', static::hex2rgb($_wp_admin_css_colors[$admin_color]->colors[0]));
            ?>
, 0.65);
					border: 1px solid <?php 
            echo $_wp_admin_css_colors[$admin_color]->colors[0];
            ?>
;
					text-shadow: 2px 2px <?php 
            echo $_wp_admin_css_colors[$admin_color]->colors[0];
            ?>
;
				}
			</style>
			<?php 
        }
    }
コード例 #5
0
 function import_choices($field_id)
 {
     if (!current_user_can('frm_edit_forms')) {
         return;
     }
     global $frm_ajax_url;
     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') and 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();
     $prepop[__('Countries', 'formidable')] = FrmAppHelper::get_countries();
     $states = FrmAppHelper::get_us_states();
     $prepop[__('U.S. States', 'formidable')] = array_values($states);
     $prepop[__('U.S. State Abbreviations', 'formidable')] = array_keys($states);
     $prepop[__('Age', 'formidable')] = array(__('Under 18', 'formidable'), __('18-24', 'formidable'), __('25-34', 'formidable'), __('35-44', 'formidable'), __('45-54', 'formidable'), __('55-64', 'formidable'), __('65 or Above', 'formidable'), __('Prefer Not to Answer', 'formidable'));
     $prepop[__('Satisfaction', 'formidable')] = array(__('Very Satisfied', 'formidable'), __('Satisfied', 'formidable'), __('Neutral', 'formidable'), __('Unsatisfied', 'formidable'), __('Very Unsatisfied', 'formidable'), __('N/A', 'formidable'));
     $prepop[__('Importance', 'formidable')] = array(__('Very Important', 'formidable'), __('Important', 'formidable'), __('Neutral', 'formidable'), __('Somewhat Important', 'formidable'), __('Not at all Important', 'formidable'), __('N/A', 'formidable'));
     $prepop[__('Agreement', 'formidable')] = array(__('Strongly Agree', 'formidable'), __('Agree', 'formidable'), __('Neutral', 'formidable'), __('Disagree', 'formidable'), __('Strongly Disagree', 'formidable'), __('N/A', 'formidable'));
     $field = FrmField::getOne($field_id);
     $field->options = stripslashes_deep(maybe_unserialize($field->options));
     $field->field_options = maybe_unserialize($field->field_options);
     include FRM_VIEWS_PATH . '/frm-fields/import_choices.php';
     die;
 }
コード例 #6
0
 public static function import_choices()
 {
     if (!current_user_can('frm_edit_forms')) {
         return;
     }
     $field_id = $_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();
     $prepop[__('Countries', 'formidable')] = FrmAppHelper::get_countries();
     $states = FrmAppHelper::get_us_states();
     $state_abv = array_keys($states);
     sort($state_abv);
     $prepop[__('U.S. State Abbreviations', 'formidable')] = $state_abv;
     $states = array_values($states);
     sort($states);
     $prepop[__('U.S. States', 'formidable')] = $states;
     unset($state_abv);
     unset($states);
     $prepop[__('Age', 'formidable')] = array(__('Under 18', 'formidable'), __('18-24', 'formidable'), __('25-34', 'formidable'), __('35-44', 'formidable'), __('45-54', 'formidable'), __('55-64', 'formidable'), __('65 or Above', 'formidable'), __('Prefer Not to Answer', 'formidable'));
     $prepop[__('Satisfaction', 'formidable')] = array(__('Very Satisfied', 'formidable'), __('Satisfied', 'formidable'), __('Neutral', 'formidable'), __('Unsatisfied', 'formidable'), __('Very Unsatisfied', 'formidable'), __('N/A', 'formidable'));
     $prepop[__('Importance', 'formidable')] = array(__('Very Important', 'formidable'), __('Important', 'formidable'), __('Neutral', 'formidable'), __('Somewhat Important', 'formidable'), __('Not at all Important', 'formidable'), __('N/A', 'formidable'));
     $prepop[__('Agreement', 'formidable')] = array(__('Strongly Agree', 'formidable'), __('Agree', 'formidable'), __('Neutral', 'formidable'), __('Disagree', 'formidable'), __('Strongly Disagree', 'formidable'), __('N/A', 'formidable'));
     $prepop = apply_filters('frm_bulk_field_choices', $prepop);
     $frm_field = new FrmField();
     $field = $frm_field->getOne($field_id);
     include FrmAppHelper::plugin_path() . '/classes/views/frm-fields/import_choices.php';
     die;
 }
コード例 #7
0
<?php

require_once preg_replace("/wp-content.*/", "wp-blog-header.php", __FILE__);
require_once preg_replace("/wp-content.*/", "/wp-admin/includes/admin.php", __FILE__);
header("HTTP/1.1 200 OK");
wp_enqueue_style('gf-admin', GFCommon::get_base_url() . '/css/admin.css');
wp_enqueue_script('jquery');
register_admin_color_schemes();
function show_table()
{
    if (isset($_REQUEST['leadid']) && isset($_REQUEST['form'])) {
        require_once "gravity-forms-addons.php";
        $transient = false;
        if (isset($_REQUEST['post'])) {
            $transient = get_transient('gf_form_' . $_REQUEST['form'] . '_post_' . $_REQUEST['post'] . '_showadminonly');
        }
        echo "<div class='wrap' style='padding:1.25em .5em'>" . apply_filters('kws_gf_directory_detail', apply_filters('kws_gf_directory_detail_' . (int) $_REQUEST['leadid'], GFDirectory::process_lead_detail(false, '', apply_filters('kws_gf_directory_showadminonly_lightbox', apply_filters('kws_gf_directory_showadminonly_lightbox_' . $_REQUEST['form'], $transient))))) . "</div>";
    }
}
wp_iframe('show_table');