extend c0c6e8a to only emit backend karma css where we need it (untested)

I need to see this happen on DEV blog though
This commit is contained in:
Ian 2014-07-05 14:06:40 +02:00
parent c0c6e8aebc
commit ab27481094

View File

@ -827,6 +827,7 @@ function vote(karmaVote,karmaId) {
// CSS generation hooks // CSS generation hooks
case 'backend_header': case 'backend_header':
if ($serendipity['GET']['adminModule'] == 'event_display' && $serendipity['GET']['adminAction'] == 'karmalog') {
// Generate the CSS for the graphical rating bar selector // Generate the CSS for the graphical rating bar selector
// //
// The CSS appears to be generated in a completely // The CSS appears to be generated in a completely
@ -863,8 +864,9 @@ function vote(karmaVote,karmaId) {
"); ");
if ($serendipity['version'][0] > 1) { if ($serendipity['version'][0] > 1) {
print("\n</style>\n"); print("\n</style>\n");
break;
} }
}
if ($serendipity['version'][0] > 1) break;
case 'css': case 'css':
// Some CSS notes: // Some CSS notes:
@ -1071,14 +1073,13 @@ END_IMG_CSS;
$karmacss = ob_get_contents(); $karmacss = ob_get_contents();
ob_end_clean(); ob_end_clean();
if ($serendipity['version'][0] > 1) { if ($serendipity['version'][0] > 1 && $event == 'backend_header' && $serendipity['GET']['adminModule'] == 'event_display' && $serendipity['GET']['adminAction'] == 'karmalog') {
// add replaced css content to the end of serendipity_admin.css, since with 2.0 the cached issue should be removed // add replaced css content to the end of serendipity_admin.css, since with 2.0 the cached issue should be removed
$this->cssEventData($eventData, $karmacss); $this->cssEventData($eventData, $karmacss);
} else { } else {
echo $karmacss; echo $karmacss;
} }
if ($event == 'backend_header' && $serendipity['version'][0] < 2) { if ($event == 'backend_header' && $serendipity['version'][0] < 2) {
print("\n</style>\n"); print("\n</style>\n");
} }