Issue Details (XML | Word | Printable)

Key: CONTRIB-822
Type: New Feature New Feature
Status: Open Open
Priority: Minor Minor
Assignee: Anthony Borrow
Reporter: Amr Hourani
Votes: 0
Watchers: 2
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Non-core contributed modules

Enhanced Messages Block

Created: 27/Oct/08 11:08 PM   Updated: 26/Apr/09 04:06 PM
Return to search
Component/s: Add a project here
Affects Version/s: 1.6, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.6.6, 1.7, 1.7.1, 1.7.2, 1.7.3, 1.7.4, 1.8, 1.8.1, 1.8.2, 1.8.3, 1.8.4, 1.8.5, 1.8.6, 1.8.7, 1.9, 1.9.1, 1.9.2, 1.9.3
Fix Version/s: None

File Attachments: 1. Zip Archive block_messages.zip (5 kB)
2. File messages.rar (4 kB)
3. File messages.rar (2 kB)
4. File messages.rar (2 kB)

Image Attachments:

1. screenshot-1.jpg
(26 kB)
Environment: ALL

URL: http://moodle.org/mod/data/view.php?d=13&rid=1869
Participants: Amr Hourani, Anthony Borrow and Martin Dougiamas
Security Level: None
Affected Branches: MOODLE_16_STABLE, MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE

Sub-Tasks  All   Open   
 Sub-Task Progress: 
No sub-tasks match this view.

 Description  « Hide
Enhanced Messages Block, retrieve messages automatically every 60 seconds, and display in title bar the messages, like google gmail.

No need to refresh the page to check if you got messages or not.

Just replace blocks/messages/ with attached code and enjoy smile

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Amr Hourani added a comment - 27/Oct/08 11:09 PM
screenshot

Anthony Borrow added a comment - 28/Oct/08 12:24 AM
Amr - Thanks for this and the other code you have added to the tracker. I've not had a chance to look at them yet but they are on my to do list. One thing I want to test with this is whether it refreshes the whole page of just the messages block. In particular, I'm thinking if someone is working on a forum post we would not want them to lose what they have been typing. Peace - Anthony

Amr Hourani added a comment - 28/Oct/08 12:34 AM
Hi anthony,

actually it doesnt refresh the whole page, it just graps the latest messages using ajax.

hope to include it in moodle core

thank you


Anthony Borrow added a comment - 28/Oct/08 12:50 AM
Excellent idea. I'll make sure to flag it as a messaging improvement for 2.0 and see what we can do to get it evaluate for consideration into core. Peace - Anthony

Amr Hourani added a comment - 28/Oct/08 01:38 AM
Great..
I will make sure to enhance it and add features to it.
and also am ready for auditing and code checking for any modification required..
thank you anthony!

Amr Hourani added a comment - 04/Nov/08 01:44 AM
Update: added session confirmation for a better security..

Anthony Borrow added a comment - 04/Nov/08 03:44 AM
Martin - I've added you as a watcher to this issue. Before adding this to something like contrib/patches/check_messages, I thought I would check and see how it might fit in with some of the GSOC work that you and Luis did this summer to enhance messaging. I like what Amr has done and the concept of refreshing the messages block periodically without doing a full page refresh (although I would recommend giving the site admin an option to set how often this occurs). I'm not sure if this might be a patch that you would want to work into HEAD for Moodle 2.0 or not so if you get a chance to look at it and comment here it would be helpful. Peace - Anthony

Amr Hourani added a comment - 04/Nov/08 05:43 AM
Update: adding settings page for defining time periods of refresh.
also adding english strings in message.php lang file, en_utf8

Anthony Borrow added a comment - 04/Nov/08 06:08 AM
Amr - Thanks for adding the setting, this is a nice patch which we may want to consider for Moodle 2.0. Nice work! Peace - Anthony

Anthony Borrow added a comment - 05/Nov/08 06:59 AM
Here is a messages block cleaning up language strings, created /lang/en_utf8 and some other minor changes

Amr Hourani added a comment - 06/Nov/08 08:07 AM
is this going to be added to moodle CVS?

Martin Dougiamas added a comment - 06/Nov/08 12:16 PM
I've not looked at the code yet sorry but two thoughts are:
  • what does it do when JS is off?
  • what kind of added load is it putting on the server?

Generally the way we do this now in Moodle is to leave the messages popup on screen ... it has a similar refresh cycle. The difference is that it only happens when users open this window ... if it happened by default for all users looking at course pages, my moodle pages etc, then it could mean a significant hit on the server load. So yes, it should be admin controlled and probably default to off.

I'm not sure what I think about changing the title bar on a course page .... it makes total sense to do that on the messaging popup, though ...

I'll try and look at the code soon. Thanks Amr!


Amr Hourani added a comment - 06/Nov/08 07:02 PM
Hi Martin,
  • if JS is disabled, the block will act like previous state, will not acquire new messages unless you refresh the page.
  • this depends on system admins who decide to enable disable since it has an admin stetting.. recent activities do much more load because logs table is growing very fast and most of users still use this feature regardless of how much it will consume from their hardware.

for the title bar thing, it just changed once you get messages, and in the next acquire within the same session, if there are no messages it will re caption it to the course name.

From point of view, it is not that major thing to be included but i wanted to share in moodle development in someway, and unfor. all what we can access as conrtib developer is just plugins so I cant play with anything but plugins.

I would love to work on something like messaging system, but I think I decided to do that too late because there are already developers who are working now on messaging.

anyway, its your call now
thanks for having time looking at it..
Amr


Anthony Borrow added a comment - 07/Nov/08 12:01 AM
Amr - It sounds like Moodle core opted to go with a separate popup page to deal with the refresh issue. I can definitely appreciate the performance load issue and suspect that your idea represents another option for handling the messages block. My impression is that the code for your messages block will wind up on CONTRIB as a patch for site administrators who want to take advantage of your approach. We can let Martin confirm that when he has a chance to look at the code. I knew that there was work done on the messaging system so I figured I would check with Martin to see where (or if) this might fit in with some of that work before adding it as a patch. Thanks for your patience as we look at how best to share this code with the rest of the Moodle community. Peace - Anthony

Anthony Borrow added a comment - 26/Apr/09 04:06 PM
Amr - Sorry, this just fell off my radar. Unless I hear from Martin, let's work on getting this added to CONTRIB as a patch. Peace - Anthony