aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mod/logbrowser/start.php2
-rw-r--r--mod/logbrowser/views/default/logbrowser/adminlinks.php5
-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
5 files changed, 15 insertions, 8 deletions
diff --git a/mod/logbrowser/start.php b/mod/logbrowser/start.php
index 26c2db90e..7fea458a2 100644
--- a/mod/logbrowser/start.php
+++ b/mod/logbrowser/start.php
@@ -26,7 +26,7 @@
// Extend context menu with admin logbrowsre link
if (isadminloggedin())
{
- extend_view('profile/menu/links','logbrowser/adminlinks',10000);
+ extend_view('profile/menu/adminlinks','logbrowser/adminlinks',10000);
}
}
diff --git a/mod/logbrowser/views/default/logbrowser/adminlinks.php b/mod/logbrowser/views/default/logbrowser/adminlinks.php
index 3754c5042..abe83707d 100644
--- a/mod/logbrowser/views/default/logbrowser/adminlinks.php
+++ b/mod/logbrowser/views/default/logbrowser/adminlinks.php
@@ -1,7 +1,4 @@
<?php
?>
-
-<p class="user_menu_admin">
- <a href="<?php echo $vars['url']; ?>mod/logbrowser/?user_guid=<?php echo $vars['entity']->guid; ?>"><?php echo elgg_echo("logbrowser:explore"); ?></a>
-</p> \ No newline at end of file
+<a href="<?php echo $vars['url']; ?>mod/logbrowser/?user_guid=<?php echo $vars['entity']->guid; ?>"><?php echo elgg_echo("logbrowser:explore"); ?></a> \ No newline at end of file
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