aboutsummaryrefslogtreecommitdiff
path: root/mod/profile
diff options
context:
space:
mode:
Diffstat (limited to 'mod/profile')
-rw-r--r--mod/profile/start.php2
-rw-r--r--mod/profile/views/default/profile/menu/adminlinks.php3
-rw-r--r--mod/profile/views/default/profile/menu/adminwrapper.php11
3 files changed, 13 insertions, 3 deletions
diff --git a/mod/profile/start.php b/mod/profile/start.php
index 9ad88fab6..f47f44395 100644
--- a/mod/profile/start.php
+++ b/mod/profile/start.php
@@ -61,7 +61,7 @@
// Extend context menu with admin links
if (isadminloggedin())
{
- extend_view('profile/menu/links','profile/menu/adminlinks',10000);
+ extend_view('profile/menu/links','profile/menu/adminwrapper',10000);
}
}
diff --git a/mod/profile/views/default/profile/menu/adminlinks.php b/mod/profile/views/default/profile/menu/adminlinks.php
index f59059db8..c8f825949 100644
--- a/mod/profile/views/default/profile/menu/adminlinks.php
+++ b/mod/profile/views/default/profile/menu/adminlinks.php
@@ -15,7 +15,7 @@
if (isadminloggedin()){
if ($_SESSION['id']!=$vars['entity']->guid){
?>
- <p class="user_menu_admin"><?php
+ <?php
if ($vars['entity']->isEnabled()) {
?><a href="<?php echo $vars['url']; ?>actions/admin/user/ban?guid=<?php echo $vars['entity']->guid; ?>"><?php echo elgg_echo("ban"); ?></a><?php
} else {
@@ -24,7 +24,6 @@
?><a href="<?php echo $vars['url']; ?>actions/admin/user/delete?guid=<?php echo $vars['entity']->guid; ?>"><?php echo elgg_echo("delete"); ?></a>
<a href="<?php echo $vars['url']; ?>actions/admin/user/resetpassword?guid=<?php echo $vars['entity']->guid; ?>"><?php echo elgg_echo("resetpassword"); ?></a>
<?php if (!$vars['entity']->admin) { ?><a href="<?php echo $vars['url']; ?>actions/admin/user/makeadmin?guid=<?php echo $vars['entity']->guid; ?>"><?php echo elgg_echo("makeadmin"); ?></a> <?php } ?>
- </p>
<?php
}
diff --git a/mod/profile/views/default/profile/menu/adminwrapper.php b/mod/profile/views/default/profile/menu/adminwrapper.php
new file mode 100644
index 000000000..dbbf4b038
--- /dev/null
+++ b/mod/profile/views/default/profile/menu/adminwrapper.php
@@ -0,0 +1,11 @@
+<?php
+
+ $adminlinks = elgg_view('profile/menu/adminlinks',$vars);
+
+ if (!empty($adminlinks)) {
+
+ echo "<p class=\"user_menu_admin\">{$adminlinks}</p>";
+
+ }
+
+?> \ No newline at end of file