Commit 77ba7d21 authored by Richard Mansfield's avatar Richard Mansfield
Browse files
parents c629eeda d5987ce2
mahara (0.4.4-1) unstable; urgency=low
* Bugfix release
-- Martyn Smith <martyn@catalyst.net.nz> Fri, 26 Jan 2007 10:50:38 +1300
mahara (0.4.3-1) unstable; urgency=low
* Bugfix release
-- Martyn Smith <martyn@catalyst.net.nz> Thu, 25 Jan 2007 11:49:18 +1300
mahara (0.4.2-1) unstable; urgency=low mahara (0.4.2-1) unstable; urgency=low
* Bugfix release * Bugfix release
......
...@@ -15,6 +15,7 @@ if (typeof(dojo) != 'undefined') { ...@@ -15,6 +15,7 @@ if (typeof(dojo) != 'undefined') {
} }
if (typeof(JSAN) != 'undefined') { if (typeof(JSAN) != 'undefined') {
JSAN.use('MochiKit.Base', []); JSAN.use('MochiKit.Base', []);
JSAN.use('MochiKit.DOM', []);
} }
try { try {
......
...@@ -1233,6 +1233,9 @@ function searchform() { ...@@ -1233,6 +1233,9 @@ function searchform() {
function get_loggedin_string() { function get_loggedin_string() {
global $USER; global $USER;
$str = get_string('youareloggedinas', 'mahara', display_name($USER));
safe_require('notification', 'internal'); safe_require('notification', 'internal');
$count = call_static_method(generate_class_name('notification', 'internal'), 'unread_count', $USER->get('id')); $count = call_static_method(generate_class_name('notification', 'internal'), 'unread_count', $USER->get('id'));
if ($count == 1) { if ($count == 1) {
...@@ -1241,11 +1244,14 @@ function get_loggedin_string() { ...@@ -1241,11 +1244,14 @@ function get_loggedin_string() {
else { else {
$key = 'unreadmessages'; $key = 'unreadmessages';
} }
// these spans are here so that on the ajax page that marks messages as read, the contents can be updated.
$str = get_string('youareloggedinas', 'mahara', display_name($USER)) . if ($count > 0) {
' (<a href="' . get_config('wwwroot') . 'account/activity/">' . // these spans are here so that on the ajax page that marks messages as read, the contents can be updated.
'<span id="headerunreadmessagecount">' . $count . '</span> ' . $str .=
'<span id="headerunreadmessages">' . get_string($key) . '</span></a>)'; ' (<a href="' . get_config('wwwroot') . 'account/activity/">' .
'<span id="headerunreadmessagecount">' . $count . '</span> ' .
'<span id="headerunreadmessages">' . get_string($key) . '</span></a>)';
}
return $str; return $str;
} }
......
...@@ -15,9 +15,13 @@ ...@@ -15,9 +15,13 @@
return; return;
} }
var members = new Array(); var members = {};
var counter = 0;
forEach($('{{$name}}_members').childNodes, function(node) { forEach($('{{$name}}_members').childNodes, function(node) {
members[node.value] = 1; if (node.nodeName == 'OPTION') {
members[node.value] = 1;
counter++;
}
}); });
replaceChildNodes('{{$name}}_potential'); replaceChildNodes('{{$name}}_potential');
...@@ -29,7 +33,14 @@ ...@@ -29,7 +33,14 @@
}); });
if(users.count > users.limit) { if(users.count > users.limit) {
replaceChildNodes('{{$name}}_messages', DIV(null, 'Only showing first ' + users.limit + ' results of ' + users.count)); replaceChildNodes('{{$name}}_messages',
DIV(null,
'Only showing first ',
SPAN({'id': '{{$name}}_userlimit'}, users.limit),
' results of ',
SPAN({'id': '{{$name}}_usercount'}, users.count - counter)
)
);
} }
}, },
function (err) { function (err) {
...@@ -70,6 +81,18 @@ ...@@ -70,6 +81,18 @@
node.selected = false; node.selected = false;
}); });
// Update the counters if they are present
if ($('{{$name}}_userlimit')) {
if (from.id == '{{$name}}_potential') {
replaceChildNodes('{{$name}}_userlimit', parseInt($('{{$name}}_userlimit').innerHTML) - list.length);
replaceChildNodes('{{$name}}_usercount', parseInt($('{{$name}}_usercount').innerHTML) - list.length);
}
else {
replaceChildNodes('{{$name}}_userlimit', parseInt($('{{$name}}_userlimit').innerHTML) + list.length);
replaceChildNodes('{{$name}}_usercount', parseInt($('{{$name}}_usercount').innerHTML) + list.length);
}
}
var members = new Array(); var members = new Array();
forEach($('{{$name}}_members').childNodes, function(node) { forEach($('{{$name}}_members').childNodes, function(node) {
if (typeof(node) == 'object' && typeof(node.value) == 'string') { if (typeof(node) == 'object' && typeof(node.value) == 'string') {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment