Feature 0001778: Thumbnails missing on NBM
Fix move_ccs_rules_to_body function git-svn-id: http://piwigo.org/svn/branches/2.1@6705 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
parent
2d37613246
commit
a9bd998a07
1 changed files with 5 additions and 4 deletions
|
@ -760,22 +760,23 @@ function move_ccs_rules_to_body($content)
|
||||||
$selectors[$select][] = $style;
|
$selectors[$select][] = $style;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($selectors as $selector => $style)
|
foreach ($selectors as $selector => $style)
|
||||||
{
|
{
|
||||||
if (!preg_match('/^(#|\.|)([A-Za-z0-9_-]*)$/', $selector, $matches))
|
if (!preg_match('/^(#|\.|)([A-Za-z0-9_-]*)$/', $selector, $matches))
|
||||||
{
|
{
|
||||||
$unknow_selectors .= $selector.' {'.implode('; ', $style).";}\n";
|
$unknow_selectors .= $selector.' {'.implode(";\n", $style).";}\n";
|
||||||
}
|
}
|
||||||
else switch ($matches[1])
|
else switch ($matches[1])
|
||||||
{
|
{
|
||||||
case '#':
|
case '#':
|
||||||
$content = preg_replace('|id="'.$matches[2].'"|', 'id="'.$matches[2].'" style="'.implode('; ', $style).';"', $content);
|
$content = preg_replace('|id="'.$matches[2].'"|', 'id="'.$matches[2].'" style="'.implode(";\n", $style).";\"\n", $content);
|
||||||
break;
|
break;
|
||||||
case '.':
|
case '.':
|
||||||
$content = preg_replace('|class="'.$matches[2].'"|', 'class="'.$matches[2].'" style="'.implode('; ', $style).';"', $content);
|
$content = preg_replace('|class="'.$matches[2].'"|', 'class="'.$matches[2].'" style="'.implode(";\n", $style).";\"\n", $content);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$content = preg_replace('#<'.$matches[2].'( |>)#', '<'.$matches[2].' style="'.implode('; ', $style).';"$1', $content);
|
$content = preg_replace('#<'.$matches[2].'( |>)#', '<'.$matches[2].' style="'.implode(";\n", $style).";\"\n$1", $content);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue