Roundcube Community Forum

Release Support => Release Discussion => Topic started by: Julius Caesar on November 14, 2008, 07:34:06 AM

Title: Config based on skin
Post by: Julius Caesar on November 14, 2008, 07:34:06 AM
The current skins for RoundCube require each there own settings in the configuration file main.inc.php. However this file is used by all skins.

How can you apply a configuration settings for a specific skin, without interfering with a setting for another skin?
Title: Config based on skin
Post by: xyanide on November 14, 2008, 03:43:55 PM
Hi Julius,

You`d might get a better response to your question through the developers mailing lists (RoundCube Mailing Lists (http://lists.roundcube.net/dev/) or users mailing list [email protected]).

The devs don`t seem to visit this forum very often :).


- Xyanide
Title: Config based on skin
Post by: dano on November 15, 2008, 11:51:40 AM
There aren't any skin specific options in the main.inc.php file so I am a bit confused by your question
Title: Config based on skin
Post by: Julius Caesar on November 15, 2008, 01:04:14 PM
Quote from: dano;15269There aren't any skin specific options in the main.inc.php file so I am a bit confused by your question

I know that. That's why I asked this question. To help you a little:

For skin MVISION:
$rcmail_config['list_cols'] = array('subject', 'from', 'date');

For skin GROUPVISE:
$rcmail_config['list_cols'] = array('flag', 'size', 'from', 'subject', 'date');

Different settings for different skins. So I want to know, how I can apply these settings, so I can use both themes in one installation.
Title: Config based on skin
Post by: Julius Caesar on November 19, 2008, 08:46:14 AM
I've found a solution to this:

Modify the ./program/steps/mail/func.inc

Old:

function rcmail_js_message_list($a_headers, $insert_top=FALSE)
  {
  global $CONFIG, $IMAP, $OUTPUT;

  $a_show_cols = is_array($CONFIG['list_cols']) ? $CONFIG['list_cols'] : array('subject');


New:

function rcmail_js_message_list($a_headers, $insert_top=FALSE)
  {
  global $CONFIG, $IMAP, $OUTPUT;

  if (!strlen($_SESSION['columns']))
    $a_show_cols = is_array($CONFIG['list_cols']) ? $CONFIG['list_cols'] : array('subject');
  else
    $a_show_cols = $_SESSION['list_columns'];



Old:

  // define list of cols to be displayed
  $a_show_cols = is_array($CONFIG['list_cols']) ? $CONFIG['list_cols'] : array('subject');
  $a_sort_cols = array('subject', 'date', 'from', 'to', 'size');


New:
   // define list of cols to be displayed
  if (!strlen($attrib['columns']))
    $a_show_cols = is_array($CONFIG['list_cols']) ? $CONFIG['list_cols'] : array('subject');
  else
    $a_show_cols = explode(',', $attrib['columns']);

  $_SESSION['list_columns'] = $a_show_cols;
  $a_sort_cols = array('subject', 'date', 'from', 'to', 'size');


With these modifications, you can provide columns in the mail.html:
<roundcube:object name=messages&quot;
  id=&quot;messagelist&quot;
  cellspacing=&quot;0&quot;
  summary=&quot;Message list&quot;
  [B][COLOR=&quot;Red]columns=&quot;flag,size,from,subject,date&quot;[/COLOR][/B]
  messageIcon=&quot;/images/icons/dot.png&quot;
  unreadIcon=&quot;/images/icons/unread.png&quot;
  deletedIcon=&quot;/images/icons/deleted.png&quot;
  repliedIcon=&quot;/images/icons/replied.png&quot;
  forwardedIcon=&quot;/images/icons/forwarded.png&quot;
  forwardedrepliedIcon=&quot;/images/icons/forwarded_replied.png&quot;
  attachmentIcon=&quot;/images/icons/attachment.png&quot;
  flaggedIcon=&quot;/images/icons/flagged.png&quot;
  unflaggedIcon=&quot;/images/icons/unflagged.png&quot; />
</div>