Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
3f4f74fb
Commit
3f4f74fb
authored
Jan 28, 2008
by
Richard Mansfield
Browse files
Mark notifications as read when you click on the subject
parent
d1e59d9a
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/account/activity/index.json.php
View file @
3f4f74fb
...
...
@@ -32,6 +32,7 @@ require(dirname(dirname(dirname(__FILE__))) . '/init.php');
json_headers
();
$markasread
=
param_integer
(
'markasread'
,
0
);
$quiet
=
param_integer
(
'quiet'
,
0
);
if
(
$markasread
)
{
$count
=
0
;
...
...
@@ -49,6 +50,9 @@ if ($markasread) {
json_reply
(
'local'
,
get_string
(
'failedtomarkasread'
,
'activity'
)
.
': '
.
$e
->
getMessage
());
}
db_commit
();
if
(
$quiet
)
{
json_reply
(
false
,
null
);
}
json_reply
(
false
,
array
(
'message'
=>
get_string
(
'markedasread'
,
'activity'
),
'count'
=>
$count
));
}
...
...
htdocs/account/activity/index.php
View file @
3f4f74fb
...
...
@@ -48,6 +48,9 @@ if ($USER->get('admin')) {
$morestr
=
get_string
(
'more...'
);
$star
=
json_encode
(
theme_get_url
(
'images/star.png'
));
$unread
=
json_encode
(
get_string
(
'unread'
,
'activity'
));
$javascript
=
<<<JAVASCRIPT
var activitylist = new TableRenderer(
'activitylist',
...
...
@@ -127,6 +130,16 @@ function markread(form) {
function showHideMessage(id) {
if (getStyle('message-' + id, 'display') == 'none') {
var unread = getFirstElementByTagAndClassName('input', 'tocheck',
$('message-' + id).parentNode.parentNode);
if (unread) {
var pd = {'markasread':1, 'quiet':1};
pd['unread-'+id] = 1;
sendjsonrequest('index.json.php', pd, 'GET', function(data) {
return !!data.error;
});
swapDOM(unread, IMG({'src' : {$star}, 'alt' : {$unread}}));
}
showElement('message-' + id);
}
else {
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment