aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-17 00:24:04 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-17 00:24:04 +0000
commitfb143a5701f15a8e9792c25ec7c0a030786896d6 (patch)
treef014b07dad8e23d07959e2a25b1f19612d581d00 /views
parent3d3ecfa207a47198fca5658bb6aa6e27cb0f13da (diff)
downloadelgg-fb143a5701f15a8e9792c25ec7c0a030786896d6.tar.gz
elgg-fb143a5701f15a8e9792c25ec7c0a030786896d6.tar.bz2
Fixes #2242. Can now delete admin notices manually.
git-svn-id: http://code.elgg.org/elgg/trunk@8737 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views')
-rw-r--r--views/default/css/admin.php5
-rw-r--r--views/default/js/admin.php20
-rw-r--r--views/default/object/admin_notice.php11
-rw-r--r--views/default/page/admin.php3
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);
}