diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-19 01:44:33 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-19 01:44:33 +0000 |
commit | abf3fcae3f90b4c52e40d3ef8bb11f92c7a03d1c (patch) | |
tree | 2f243448b156eb97b1b27a2efa38d791c1227bc5 /mod/tabbed_profile/views/default/profile/admin_menu.php | |
parent | fea009129f49f4f8d51654ceb569aae04387077b (diff) | |
download | elgg-abf3fcae3f90b4c52e40d3ef8bb11f92c7a03d1c.tar.gz elgg-abf3fcae3f90b4c52e40d3ef8bb11f92c7a03d1c.tar.bz2 |
rough widget profile plugin
git-svn-id: http://code.elgg.org/elgg/trunk@7676 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/tabbed_profile/views/default/profile/admin_menu.php')
-rwxr-xr-x | mod/tabbed_profile/views/default/profile/admin_menu.php | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/mod/tabbed_profile/views/default/profile/admin_menu.php b/mod/tabbed_profile/views/default/profile/admin_menu.php new file mode 100755 index 000000000..99ed3a4f5 --- /dev/null +++ b/mod/tabbed_profile/views/default/profile/admin_menu.php @@ -0,0 +1,42 @@ +<?php +/** + * This is the admin menu that appears on a user's profile page + **/ +global $CONFIG; + +if (isadminloggedin()){ + if (get_loggedin_userid()!=elgg_get_page_owner_guid()){ + $user = get_user(elgg_get_page_owner_guid()); + $url = elgg_get_site_url(); + $ts = time(); + $token = generate_action_token($ts); + +?> +<div class="owner_block_links clearfix"> +<ul class="admin_menu"> +<li><a href="#" onclick="elgg_slide_toggle(this,'.owner_block_links','.admin_menu_options');">Admin options…</a> + + <ul class="admin_menu_options"> + <li><a href="<?php echo $url; ?>pg/settings/user/<?php echo $user->username; ?>/"><?php echo elgg_echo('profile:editdetails'); ?></a></li> + <?php + if (!$user->isBanned()) { + echo "<li>".elgg_view('output/confirmlink', array('text' => elgg_echo("ban"), 'href' => "action/admin/user/ban?guid={$user->guid}&__elgg_token=$token&__elgg_ts=$ts")) . "</li>"; + } else { + echo "<li>".elgg_view('output/confirmlink', array('text' => elgg_echo("unban"), 'href' => "action/admin/user/unban?guid={$user->guid}&__elgg_token=$token&__elgg_ts=$ts")) . "</li>"; + } + echo "<li>".elgg_view('output/confirmlink', array('text' => elgg_echo("delete"), 'href' => "action/admin/user/delete?guid={$user->guid}&__elgg_token=$token&__elgg_ts=$ts")) . "</li>"; + echo "<li>".elgg_view('output/confirmlink', array('text' => elgg_echo("resetpassword"), 'href' => "action/admin/user/resetpassword?guid={$user->guid}&__elgg_token=$token&__elgg_ts=$ts")) . "</li>"; + if (!$vars['entity']->admin) { + echo "<li>".elgg_view('output/confirmlink', array('text' => elgg_echo("makeadmin"), 'href' => "action/admin/user/makeadmin?guid={$user->guid}&__elgg_token=$token&__elgg_ts=$ts")) . "</li>"; + } else { + echo "<li>".elgg_view('output/confirmlink', array('text' => elgg_echo("removeadmin"), 'href' => "action/admin/user/removeadmin?guid={$user->guid}&__elgg_token=$token&__elgg_ts=$ts")) . "</li>"; + } + ?> + </ul> +</li> +</ul> +</div> +<?php + } +} +?> |