Author Topic: How to completely change message list?  (Read 3491 times)

Offline nbaumann

  • Newbie
  • *
  • Posts: 7
How to completely change message list?
« on: September 28, 2010, 05:00:48 PM »
Hey,

I would like to completely restructure the message list. Could anyone point me in the right direction in terms of what files to edit? I've looked into the mail.html template, but that doesn't really allow me to do much, ie. the message list is a roundcube object.

What I would like to do is get rid of the table structure. I don't want a traditional vertical list, I want a horizontal one, kind of like a timeline.

Thanks for your help.

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,699
    • http://SKaero.com/
How to completely change message list?
« Reply #1 on: September 28, 2010, 05:19:25 PM »
The message list object is compiled in /program/steps/mail/func.inc in the function rcmail_message_list. Your project sounds interesting I would like to see what you end up with.

Offline nbaumann

  • Newbie
  • *
  • Posts: 7
How to completely change message list?
« Reply #2 on: September 28, 2010, 09:59:16 PM »
Yeah I've looked at that function and I tried to change the td/tr/tbody tags to other tags, and nothing displayed in the message list. Are these the only two pieces of code which generate the template for the message list? Where is the actual table rendered?

Yeah, we're looking into a completely new way of displaying emails, a completely new interface. Essentially a timeline built around priority and other factors associated with an email and we also plan on incorporating other streams of communication such Facebook, Twitter etc...

Feel free to contact me if you would like more info.

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,657
How to completely change message list?
« Reply #3 on: September 29, 2010, 01:52:12 AM »
The list of messages for a folder is ajax'd in after the page has loaded so you need to rewrite the add_message_row JS function to make it play with something that wasn't a table.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and moreā€¦

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,699
    • http://SKaero.com/
How to completely change message list?
« Reply #4 on: September 30, 2010, 01:40:13 PM »
The base table is created in the rcmail_message_list function but as JohnDoh pointed out the messages are actually in the JavaScript. You will most likely need to edit both parts. The table is rendered in the rcmail_message_list function, for example:
Code: [Select]
html::tag('td', array('class' => $cell['className'], 'id' => $cell['id']), $cell['html'])Outputs:
Code: [Select]
$cell['html']Its in a foreach loop that makes all of the td's and then puts them the thead witch goes into the table tag.

Offline nbaumann

  • Newbie
  • *
  • Posts: 7
How to completely change message list?
« Reply #5 on: September 30, 2010, 09:43:32 PM »
Thanks for the help, it got me a little closer. I'm assuming the rcmail_message_list function in func.inc only generates the table with the header and an empty tbody and that messages are appended to that tbody through JavaScript using list.js through an AJAX call?

What I haven't been able to find is where those messages are appended to the tbody. I've looked all over list.js and I can't pinpoint where those messages are being appended, ie subject, time, sender etc..

I'm sorry if those answers are a little obvious, but I'm pressed for time and it's always a little hard to jump in in a piece of software you have never used before and change the way it works.

Your help is much appreciated.

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,699
    • http://SKaero.com/
How to completely change message list?
« Reply #6 on: September 30, 2010, 11:07:20 PM »
There added in the JavaScript add_message_row function in /program/js/app.js

Offline nbaumann

  • Newbie
  • *
  • Posts: 7
How to completely change message list?
« Reply #7 on: October 02, 2010, 05:00:18 PM »
Where does the js get the messages from? What PHP page does it call?

If I wanted to add an additional piece of data associated to an email message, would the best way of doing that be adding it to the messages table in the database? Essentially that data is going to determine how each message is displayed in the interface and I'm pretty sure one can't add custom stuff to a message on an IMAP server? So I assume I'm going to have to work with the database on this one?

In relation to the database, I've managed to add the body to the messages in the database, but it has a bunch Unicode characters that display like =A0 and =3D, through what function does Roundcube handle this? Where exactly does it parse the body?

Thanks again for the help!

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,699
    • http://SKaero.com/
How to completely change message list?
« Reply #8 on: October 02, 2010, 05:32:28 PM »
The messages are added in the php function rcmail_js_message_list in /program/steps/mail/func.inc. The messages table in the database is just a way to catch messages, What is extra data you needed to attach to an email, is it something that is associated with just that email and where do you get that data from? The email is parsed in the rcmail_print_body function in /program/steps/mail/func.inc

Offline nbaumann

  • Newbie
  • *
  • Posts: 7
How to completely change message list?
« Reply #9 on: October 03, 2010, 11:32:12 PM »
Thanks for the reply.

That piece of data would essentially be set by the user. It's the cornerstone of the interface.

Offline beknur

  • Newbie
  • *
  • Posts: 2
Re: How to completely change message list?
« Reply #10 on: January 11, 2022, 05:23:53 AM »
Hi,
did you manage to go about your problem?