Пример #1
0
/**
 * user_avatar_add_photo function.
 * The content inside the iframe 
 * Description: Creating panels for the different steps users take to upload a file and checking their uploads.
 * @access public
 * @return void
 */
function user_avatar_add_photo()
{
    global $current_user;
    if (($_GET['uid'] == $current_user->ID || is_super_admin($current_user->ID)) && is_numeric($_GET['uid'])) {
        $uid = $_GET['uid'];
        ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php 
        do_action('admin_xml_ns');
        ?>
 <?php 
        language_attributes();
        ?>
>
<head>
<meta http-equiv="Content-Type" content="<?php 
        bloginfo('html_type');
        ?>
; charset=<?php 
        echo get_option('blog_charset');
        ?>
" />
<title><?php 
        bloginfo('name');
        ?>
 &rsaquo; <?php 
        _e('Uploads');
        ?>
 &#8212; <?php 
        _e('WordPress');
        ?>
</title>
<?php 
        wp_enqueue_style('global');
        wp_enqueue_style('wp-admin');
        wp_enqueue_style('colors');
        wp_enqueue_style('ie');
        wp_enqueue_style('imgareaselect');
        wp_enqueue_script('imgareaselect');
        do_action('user_avatar_iframe_head');
        do_action('admin_print_styles');
        do_action('admin_print_scripts');
        do_action('admin_head');
        ?>
</head>
<body>
<?php 
        switch ($_GET['step']) {
            case 1:
                user_avatar_add_photo_step1($uid);
                break;
            case 2:
                user_avatar_add_photo_step2($uid);
                break;
            case 3:
                user_avatar_add_photo_step3($uid);
                break;
        }
        do_action('admin_print_footer_scripts');
        ?>
<script type="text/javascript">if(typeof wpOnload=='function')wpOnload();</script>
</body>
</html>
<?php 
    } else {
        wp_die("You are not allowed to do that.");
    }
    die;
}
Пример #2
0
/**
 * user_avatar_add_photo function.
 * The content inside the iframe 
 * Description: Creating panels for the different steps users take to upload a file and checking their uploads.
 * @access public
 * @return void
 */
function user_avatar_add_photo()
{
    global $current_user;
    if (($_GET['uid'] == $current_user->ID || current_user_can('edit_users')) && is_numeric($_GET['uid'])) {
        $uid = $_GET['uid'];
        ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php 
        do_action('admin_xml_ns');
        ?>
 <?php 
        language_attributes();
        ?>
>
<head>
<meta http-equiv="Content-Type" content="<?php 
        bloginfo('html_type');
        ?>
; charset=<?php 
        echo get_option('blog_charset');
        ?>
" />
<title><?php 
        bloginfo('name');
        ?>
 &rsaquo; <?php 
        _e('Uploads');
        ?>
 &#8212; <?php 
        _e('WordPress');
        ?>
</title>
<script type="text/javascript">
//<![CDATA[
addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
var userSettings = {
		'url': '<?php 
        echo SITECOOKIEPATH;
        ?>
',
		'uid': '<?php 
        if (!isset($current_user)) {
            $current_user = wp_get_current_user();
        }
        echo $current_user->ID;
        ?>
',
		'time':'<?php 
        echo time();
        ?>
'
	},
	ajaxurl = '<?php 
        echo admin_url('admin-ajax.php');
        ?>
',
	pagenow = '<?php 
        echo $current_screen->id;
        ?>
',
	typenow = '<?php 
        if (isset($current_screen->post_type)) {
            echo $current_screen->post_type;
        }
        ?>
',
	adminpage = '<?php 
        echo $admin_body_class;
        ?>
',
	thousandsSeparator = '<?php 
        echo addslashes($wp_locale->number_format['thousands_sep']);
        ?>
',
	decimalPoint = '<?php 
        echo addslashes($wp_locale->number_format['decimal_point']);
        ?>
',
	isRtl = <?php 
        echo (int) is_rtl();
        ?>
;
//]]>
</script>
<?php 
        do_action('user_avatar_iframe_head');
        ?>

</head>
<body>
<?php 
        switch ($_GET['step']) {
            case 1:
                user_avatar_add_photo_step1($uid);
                break;
            case 2:
                user_avatar_add_photo_step2($uid);
                break;
            case 3:
                user_avatar_add_photo_step3($uid);
                break;
        }
        do_action('admin_print_footer_scripts');
        ?>
<script type="text/javascript">if(typeof wpOnload=='function')wpOnload();</script>
</body>
</html>
<?php 
    } else {
        wp_die(__("You are not allowed to do that.", 'user-avatar'));
    }
    die;
}