Changeset 5695


Ignore:
Timestamp:
Apr 7, 2010, 10:09:30 AM (14 years ago)
Author:
patdenice
Message:

Fix some issues on NBM: move css rules to mail body if it's possible.
Remove fieldset on available plugins page.

Location:
trunk
Files:
1 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/themes/default/default-layout.css

    r5515 r5695  
    771771#helpContent P.nextStepLink {text-align:center; font-weight:bold; margin-bottom:20px;}
    772772
    773 #configContent FIELDSET {border:none;}
     773#configContent FIELDSET, #availablePlugins FIELDSET {border:none;}
    774774
    775775/**
  • trunk/admin/themes/default/template/plugins_new.tpl

    r5570 r5695  
    3131
    3232{if not empty($plugins)}
     33<div id="availablePlugins">
    3334<fieldset>
    3435<legend></legend>
     
    6768{/foreach}
    6869</fieldset>
     70</div>
    6971{else}
    7072<p>{'There is no other plugin available.'|@translate}</p>
  • trunk/include/functions_mail.inc.php

    r5208 r5695  
    772772}
    773773
     774function move_ccs_rules_to_body($content)
     775{
     776  // We search all css rules in style tags
     777  preg_match('#<style>(.*?)</style>#s', $content, $matches);
     778
     779  if (!empty($matches[1]))
     780  {
     781    preg_match_all('#([^\n]*?)\{(.*?)\}#s', $matches[1], $matches);
     782
     783    $selectors = array();
     784    $unknow_selectors = '';
     785
     786    foreach ($matches[1] as $key => $value)
     787    {
     788      $selects = explode(',', $value);
     789      $style = trim($matches[2][$key], ' ;');
     790
     791      foreach($selects as $select)
     792      {
     793        $select = trim($select);
     794        $selectors[$select][] = $style;
     795      }
     796    }
     797    foreach ($selectors as $selector => $style)
     798    {
     799      if (!preg_match('/^(#|\.|)([A-Za-z0-9_-]*)$/', $selector, $matches))
     800      {
     801        $unknow_selectors .= $selector.' {'.implode('; ', $style).";}\n";
     802      }
     803      else switch ($matches[1])
     804      {
     805        case '#':
     806          $content = preg_replace('|id="'.$matches[2].'"|', 'id="'.$matches[2].'" style="'.implode('; ', $style).';"', $content);
     807          break;
     808        case '.':
     809          $content = preg_replace('|class="'.$matches[2].'"|', 'class="'.$matches[2].'" style="'.implode('; ', $style).';"', $content);
     810          break;
     811        default:
     812          $content = preg_replace('#<'.$matches[2].'( |>)#', '<'.$matches[2].' style="'.implode('; ', $style).';"$1', $content);
     813          break;
     814      }
     815    }
     816
     817    // Keep unknow tags in page head
     818    if (!empty($unknow_selectors))
     819    {
     820      $content = preg_replace('#<style>.*?</style>#s', "<style type=\"text/css\">\n$unknow_selectors</style>", $content);
     821    }
     822    else
     823    {
     824      $content = preg_replace('#<style>.*?</style>#s', '', $content);
     825    }
     826  }
     827  return $content;
     828}
     829
    774830/*Testing block*/
    775831/*function pwg_send_mail_test($result, $to, $subject, $content, $headers, $args)
     
    801857
    802858add_event_handler('send_mail', 'pwg_send_mail', EVENT_HANDLER_PRIORITY_NEUTRAL, 5);
     859add_event_handler('send_mail_content', 'move_ccs_rules_to_body');
    803860trigger_action('functions_mail_included');
    804861
  • trunk/themes/Sylvia/mail-css.tpl

    r5125 r5695  
    22
    33body {ldelim} background-color:#111; color:#666;}
    4 #the_page {ldelim} }
    5 #content {ldelim} }
    6 #copyright {ldelim} background: transparent url({$ROOT_URL}themes/{$themeconf.theme}/images/bottom-left-bg.jpg) no-repeat scroll left bottom;
     4#copyright {ldelim} background: transparent url({$ROOT_URL}themes/Sylvia/images/bottom-left-bg.jpg) no-repeat scroll left bottom;
    75min-height: 220px; height: 220px; width: 100%; min-width: 100%; padding: 10px 100px 30px 100px; }
    8 h2 {ldelim} color:#f70;background: transparent url({$ROOT_URL}themes/{$themeconf.theme}/images/fillet.gif) repeat-x scroll left bottom; padding-bottom: 5px;}
     6h2 {ldelim} color:#f70;background: transparent url({$ROOT_URL}themes/Sylvia/images/fillet.gif) repeat-x scroll left bottom; padding-bottom: 5px;}
    97img {ldelim} margin: 16px; border: 16px solid #444; -moz-border-radius: 4px; border-radius: 4px 4px; }
    108img:hover {ldelim} padding: 15px; border: 0; background-color:#222;-moz-border-radius: 4px; border-radius: 4px 4px; }
  • trunk/themes/clear/mail-css.tpl

    r5125 r5695  
    22
    33body {ldelim} background-color:#fff; color:#696969;}
    4 #the_page {ldelim} background: #fff url({$ROOT_URL}themes/default/images/mail/mailbody-bg.png) repeat-y scroll left top;}
    5 #content {ldelim} background: transparent url({$ROOT_URL}themes/default/images/mail/header-bg.png) no-repeat scroll left top;}
    6 #copyright {ldelim} background: transparent url({$ROOT_URL}themes/default/images/mail/footer-bg.png) no-repeat scroll left bottom;
    7 color: #333;}
     4#copyright {ldelim} background: transparent; color: #333;}
    85h2 {ldelim} background-color: #ddd;}
    96img {ldelim} margin: 16px; border: 16px solid #aaa; -moz-border-radius: 4px; border-radius: 4px 4px; }
  • trunk/themes/dark/mail-css.tpl

    r5125 r5695  
    22
    33body {ldelim} background-color:#444; color:#fff;}
    4 #the_page {ldelim} background: #444 url({$ROOT_URL}themes/default/images/mail/mailbody-bg.png) repeat-y scroll left top;}
    5 #content {ldelim} background: transparent url({$ROOT_URL}themes/default/images/mail/header-bg.png) no-repeat scroll left top;}
    6 #copyright {ldelim} background: transparent url({$ROOT_URL}themes/default/images/mail/footer-bg.png) no-repeat scroll left bottom;
    7 color: #69c;}
    8 h2 {ldelim} background-color: #333;color:#fff48e;background-image: url({$ROOT_URL}themes/{$themeconf.theme}/images/tableh1_bg.png);}
     4#copyright {ldelim} color: #69c;}
     5h2 {ldelim} background-color: #333; color:#fff48e;}
    96img {ldelim} margin: 16px; border: 16px solid #111; -moz-border-radius: 4px; border-radius: 4px 4px; }
    107img:hover {ldelim} padding: 15px; border: 1px solid yellow;background-color:#444;-moz-border-radius: 4px; border-radius: 4px 4px; }
  • trunk/themes/default/template/mail/text/html/global-mail-css.tpl

    r5095 r5695  
    33body {ldelim} font-family: Univers, Helvetica, Optima; font-size:12px; margin:0px; padding:0px; }
    44#the_page {ldelim} margin:0px; padding:0px; text-align:left;}
    5 #content {ldelim} margin:0px; padding:82px 0px 0px 62px; width:732px;}
     5#content {ldelim} margin:0px; padding:30px 0px 0px 30px; width:732px;}
    66hr {ldelim} width:632px; margin-left:0;}
    77#copyright {ldelim} font-size:10px; margin:0px; padding:48px 0px 32px 62px;}
Note: See TracChangeset for help on using the changeset viewer.