Ejemplo n.º 1
0
function wpmp_ms_mobile_admin()
{
    $base = get_option('home');
    if (($user = wp_get_current_user()) == null || $user->ID == 0) {
        header("Location: {$base}/wp-login.php?redirect_to=" . urlencode($base) . "%2Fwp-admin%2F");
    }
    $menu = array(__("Overview", 'wpmp') => "/wp-admin/index.php", __("New post", 'wpmp') => "/wp-admin/post-new.php", __("Edit post", 'wpmp') => "/wp-admin/post.php?action=edit", __("Comments", 'wpmp') => "/wp-admin/edit-comments.php", "_" . __("Comment", 'wpmp') => "/wp-admin/comment.php", __("Switcher", 'wpmp') => "/wp-admin/themes.php", __("Settings", 'wpmp') => "/wp-admin/options-general.php");
    if (function_exists('wp_logout_url')) {
        $menu[__("Log out", 'wpmp')] = wp_logout_url();
    } else {
        $menu[__("Log out", 'wpmp')] = "/wp-login.php?action=logout";
    }
    $page = $_SERVER['REQUEST_URI'];
    $function = "";
    foreach ($menu as $link) {
        if (strpos(strtolower($page), strtolower($link)) !== false) {
            $function = substr($link, 10);
            $function = explode(".", $function);
            $function = str_replace("-", "_", $function[0]);
            $function = strtolower($function);
            break;
        }
    }
    if (!function_exists("wpmp_msma_{$function}")) {
        $function = "overview";
    }
    if (!current_user_can('manage_options')) {
        // harsh but fair
        $menu = array();
        $function = "junior";
    }
    wpmp_ms_mobile_top("Admin", $menu);
    call_user_func("wpmp_msma_{$function}", $menu);
    wpmp_ms_mobile_bottom();
}
Ejemplo n.º 2
0
" tabindex="100" />
		<input type="hidden" name="redirect_to" value="<?php 
            echo attribute_escape($redirect_to);
            ?>
" />
		<input type="hidden" name="testcookie" value="1" />
	</p>
<?php 
        } else {
            ?>
	<p>&nbsp;</p>
<?php 
        }
        ?>
</form>

<p id="backtoblog"><a href="<?php 
        bloginfo('url');
        ?>
/" title="<?php 
        _e('Are you lost?', 'wpmp');
        ?>
"><?php 
        print '&laquo; ' . sprintf(__('Back to %s', 'wpmp'), get_bloginfo('title', 'display'));
        ?>
</a></p>

<?php 
        wpmp_ms_mobile_bottom();
        break;
}