diff options
Diffstat (limited to 'views/default')
-rw-r--r-- | views/default/css/admin.php | 5 | ||||
-rw-r--r-- | views/default/js/admin.php | 20 | ||||
-rw-r--r-- | views/default/object/admin_notice.php | 11 | ||||
-rw-r--r-- | views/default/page/admin.php | 3 |
4 files changed, 36 insertions, 3 deletions
diff --git a/views/default/css/admin.php b/views/default/css/admin.php index 2a107b1ca..c896095df 100644 --- a/views/default/css/admin.php +++ b/views/default/css/admin.php @@ -1072,7 +1072,7 @@ ul.admin_plugins { color: black; border: 1px solid blue; font-weight: bold; - padding:3px 10px; + padding: 3px 0px 3px 10px; -webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45); -moz-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45); @@ -1083,6 +1083,9 @@ ul.admin_plugins { border-radius: 4px; } +.admin_notices a { + float: right; +} .add-user form { width:300px; diff --git a/views/default/js/admin.php b/views/default/js/admin.php index afffe95f0..2f2f59287 100644 --- a/views/default/js/admin.php +++ b/views/default/js/admin.php @@ -5,6 +5,7 @@ * @since 1.8 */ ?> +//<script> elgg.provide('elgg.admin'); elgg.admin.init = function () { @@ -45,6 +46,9 @@ elgg.admin.init = function () { handle: 'span.elgg-state-draggable', stop: elgg.admin.moveProfileField }); + + // admin notices delete ajax + $('a.elgg-admin-notice').click(elgg.admin.deleteNotice); } /** @@ -146,4 +150,20 @@ elgg.admin.moveProfileField = function(e, ui) { }); } +/** + * Fires the ajax action to delete the admin notice then hides the notice. + * + * @return void + */ +elgg.admin.deleteNotice = function(e) { + e.preventDefault(); + var $container = $(this).closest('p'); + + elgg.action($(this).attr('href'), { + success: function(json) { + $container.slideUp('medium'); + } + }); +} + elgg.register_hook_handler('init', 'system', elgg.admin.init, 1000);
\ No newline at end of file diff --git a/views/default/object/admin_notice.php b/views/default/object/admin_notice.php index 1a162ce4d..45485a1dc 100644 --- a/views/default/object/admin_notice.php +++ b/views/default/object/admin_notice.php @@ -6,6 +6,15 @@ if (isset($vars['entity']) && elgg_instanceof($vars['entity'], 'object', 'admin_notice')) { $notice = $vars['entity']; $message = $notice->description; - echo "<p>$message</p>"; + + $delete = elgg_view('output/url', array( + 'href' => "action/admin/delete_admin_notice?guid=$notice->guid", + 'text' => '<span class="elgg-icon elgg-icon-delete"></span>', + 'encode' => false, + 'is_action' => true, + 'class' => 'elgg-admin-notice' + )); + + echo "<p>$message$delete</p>"; } diff --git a/views/default/page/admin.php b/views/default/page/admin.php index b3871fe33..d0e7915cc 100644 --- a/views/default/page/admin.php +++ b/views/default/page/admin.php @@ -16,7 +16,8 @@ header("Content-type: text/html; charset=UTF-8"); $messages = $vars['sysmessages']; $notices_html = ''; -if ($notices = elgg_get_admin_notices()) { +$notices = elgg_get_admin_notices(); +if ($notices) { foreach ($notices as $notice) { $notices_html .= elgg_view_entity($notice); } |