Fix some issues on NBM: move css rules to mail body if it's possible.

Remove fieldset on available plugins page.

git-svn-id: http://piwigo.org/svn/trunk@5695 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
patdenice
2010-04-07 08:09:30 +00:00
parent 05fa1c12f7
commit e5f8722c33
11 changed files with 66 additions and 45 deletions
+1 -1
View File
@@ -770,7 +770,7 @@ h2:lang(en) { text-transform:capitalize; }
#helpContent LI, #ftpPage LI {margin-top:10px;}
#helpContent P.nextStepLink {text-align:center; font-weight:bold; margin-bottom:20px;}
#configContent FIELDSET {border:none;}
#configContent FIELDSET, #availablePlugins FIELDSET {border:none;}
/**
* Informations box in administration
@@ -30,6 +30,7 @@ jQuery().ready(function(){ldelim}
</div>
{if not empty($plugins)}
<div id="availablePlugins">
<fieldset>
<legend></legend>
{foreach from=$plugins item=plugin name=plugins_loop}
@@ -66,6 +67,7 @@ jQuery().ready(function(){ldelim}
</div>
{/foreach}
</fieldset>
</div>
{else}
<p>{'There is no other plugin available.'|@translate}</p>
{/if}
+57
View File
@@ -771,6 +771,62 @@ function pwg_send_mail($result, $to, $subject, $content, $headers)
}
}
function move_ccs_rules_to_body($content)
{
// We search all css rules in style tags
preg_match('#<style>(.*?)</style>#s', $content, $matches);
if (!empty($matches[1]))
{
preg_match_all('#([^\n]*?)\{(.*?)\}#s', $matches[1], $matches);
$selectors = array();
$unknow_selectors = '';
foreach ($matches[1] as $key => $value)
{
$selects = explode(',', $value);
$style = trim($matches[2][$key], ' ;');
foreach($selects as $select)
{
$select = trim($select);
$selectors[$select][] = $style;
}
}
foreach ($selectors as $selector => $style)
{
if (!preg_match('/^(#|\.|)([A-Za-z0-9_-]*)$/', $selector, $matches))
{
$unknow_selectors .= $selector.' {'.implode('; ', $style).";}\n";
}
else switch ($matches[1])
{
case '#':
$content = preg_replace('|id="'.$matches[2].'"|', 'id="'.$matches[2].'" style="'.implode('; ', $style).';"', $content);
break;
case '.':
$content = preg_replace('|class="'.$matches[2].'"|', 'class="'.$matches[2].'" style="'.implode('; ', $style).';"', $content);
break;
default:
$content = preg_replace('#<'.$matches[2].'( |>)#', '<'.$matches[2].' style="'.implode('; ', $style).';"$1', $content);
break;
}
}
// Keep unknow tags in page head
if (!empty($unknow_selectors))
{
$content = preg_replace('#<style>.*?</style>#s', "<style type=\"text/css\">\n$unknow_selectors</style>", $content);
}
else
{
$content = preg_replace('#<style>.*?</style>#s', '', $content);
}
}
return $content;
}
/*Testing block*/
/*function pwg_send_mail_test($result, $to, $subject, $content, $headers, $args)
{
@@ -800,6 +856,7 @@ add_event_handler('send_mail', 'pwg_send_mail_test', EVENT_HANDLER_PRIORITY_NEUT
add_event_handler('send_mail', 'pwg_send_mail', EVENT_HANDLER_PRIORITY_NEUTRAL, 5);
add_event_handler('send_mail_content', 'move_ccs_rules_to_body');
trigger_action('functions_mail_included');
?>
+2 -4
View File
@@ -1,11 +1,9 @@
/* Theme Sylvia mail css */
body {ldelim} background-color:#111; color:#666;}
#the_page {ldelim} }
#content {ldelim} }
#copyright {ldelim} background: transparent url({$ROOT_URL}themes/{$themeconf.theme}/images/bottom-left-bg.jpg) no-repeat scroll left bottom;
#copyright {ldelim} background: transparent url({$ROOT_URL}themes/Sylvia/images/bottom-left-bg.jpg) no-repeat scroll left bottom;
min-height: 220px; height: 220px; width: 100%; min-width: 100%; padding: 10px 100px 30px 100px; }
h2 {ldelim} color:#f70;background: transparent url({$ROOT_URL}themes/{$themeconf.theme}/images/fillet.gif) repeat-x scroll left bottom; padding-bottom: 5px;}
h2 {ldelim} color:#f70;background: transparent url({$ROOT_URL}themes/Sylvia/images/fillet.gif) repeat-x scroll left bottom; padding-bottom: 5px;}
img {ldelim} margin: 16px; border: 16px solid #444; -moz-border-radius: 4px; border-radius: 4px 4px; }
img:hover {ldelim} padding: 15px; border: 0; background-color:#222;-moz-border-radius: 4px; border-radius: 4px 4px; }
a {ldelim} color: #f70; background-color: transparent; border:0; text-decoration: none;}
+1 -4
View File
@@ -1,10 +1,7 @@
/* Theme clear mail css */
body {ldelim} background-color:#fff; color:#696969;}
#the_page {ldelim} background: #fff url({$ROOT_URL}themes/default/images/mail/mailbody-bg.png) repeat-y scroll left top;}
#content {ldelim} background: transparent url({$ROOT_URL}themes/default/images/mail/header-bg.png) no-repeat scroll left top;}
#copyright {ldelim} background: transparent url({$ROOT_URL}themes/default/images/mail/footer-bg.png) no-repeat scroll left bottom;
color: #333;}
#copyright {ldelim} background: transparent; color: #333;}
h2 {ldelim} background-color: #ddd;}
img {ldelim} margin: 16px; border: 16px solid #aaa; -moz-border-radius: 4px; border-radius: 4px 4px; }
img:hover {ldelim} padding: 15px; border: 1px solid yellow;background-color:#faebd7; -moz-border-radius: 4px; border-radius: 4px 4px; }
+2 -5
View File
@@ -1,11 +1,8 @@
/* Theme dark mail css */
body {ldelim} background-color:#444; color:#fff;}
#the_page {ldelim} background: #444 url({$ROOT_URL}themes/default/images/mail/mailbody-bg.png) repeat-y scroll left top;}
#content {ldelim} background: transparent url({$ROOT_URL}themes/default/images/mail/header-bg.png) no-repeat scroll left top;}
#copyright {ldelim} background: transparent url({$ROOT_URL}themes/default/images/mail/footer-bg.png) no-repeat scroll left bottom;
color: #69c;}
h2 {ldelim} background-color: #333;color:#fff48e;background-image: url({$ROOT_URL}themes/{$themeconf.theme}/images/tableh1_bg.png);}
#copyright {ldelim} color: #69c;}
h2 {ldelim} background-color: #333; color:#fff48e;}
img {ldelim} margin: 16px; border: 16px solid #111; -moz-border-radius: 4px; border-radius: 4px 4px; }
img:hover {ldelim} padding: 15px; border: 1px solid yellow;background-color:#444;-moz-border-radius: 4px; border-radius: 4px 4px; }
a {ldelim} color: #fff48e; background: transparent;border-bottom:1px dotted #005e89; }
Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

-30
View File
@@ -1,30 +0,0 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based picture gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2010 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
// Recursive call
$url = '../';
header( 'Request-URI: '.$url );
header( 'Content-Location: '.$url );
header( 'Location: '.$url );
exit();
?>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 924 B

@@ -2,7 +2,7 @@
body {ldelim} font-family: Univers, Helvetica, Optima; font-size:12px; margin:0px; padding:0px; }
#the_page {ldelim} margin:0px; padding:0px; text-align:left;}
#content {ldelim} margin:0px; padding:82px 0px 0px 62px; width:732px;}
#content {ldelim} margin:0px; padding:30px 0px 0px 30px; width:732px;}
hr {ldelim} width:632px; margin-left:0;}
#copyright {ldelim} font-size:10px; margin:0px; padding:48px 0px 32px 62px;}
.PWG {ldelim} font-family:verdana, sans-serif !important; font-size:0.9em; font-weight:normal; letter-spacing:0px;}