Ignore:
Timestamp:
Dec 16, 2011 1:38:59 PM (17 months ago)
Author:
thomasb
Message:

Add more classes and options to HTML elements for better styleability

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/include/main.inc

    r5592 r5623  
    16091609 
    16101610/** 
     1611 * Generate CSS classes from mimetype and filename extension 
     1612 * 
     1613 * @param string Mimetype 
     1614 * @param string The filename 
     1615 * @return string CSS classes separated by space 
     1616 */ 
     1617function rcmail_filetype2classname($mimetype, $filename) 
     1618{ 
     1619  list($primary, $secondary) = explode('/', $mimetype); 
     1620 
     1621  $classes = array($primary ? $primary : 'unknown'); 
     1622  if ($secondary) 
     1623    $classes[] = $secondary; 
     1624  if (preg_match('/\.([a-z0-9]+)$/', $filename, $m)) 
     1625    $classes[] = $m[1]; 
     1626 
     1627  return join(" ", $classes); 
     1628} 
     1629 
     1630/** 
    16111631 * Output HTML editor scripts 
    16121632 * 
Note: See TracChangeset for help on using the changeset viewer.