1: <?php
2: 3: 4: 5: 6: 7: 8: 9:
10: class Ansel_Factory_Styles extends Horde_Core_Factory_Injector
11: {
12: public function create (Horde_Injector $injector)
13: {
14:
15: $styles = Horde::loadConfiguration('styles.php', 'styles', 'ansel');
16:
17:
18: if (empty($GLOBALS['conf']['image']['prettythumbs'])) {
19: $test = $styles;
20: foreach ($test as $key => $style) {
21: if ($style['thumbstyle'] != 'Thumb') {
22: unset($styles[$key]);
23: }
24: }
25: }
26:
27:
28: if ($GLOBALS['browser']->hasQuirk('png_transparency') ||
29: $GLOBALS['conf']['image']['type'] != 'png') {
30:
31: $test = $styles;
32: foreach ($test as $key => $style) {
33: if (!empty($style['requires_png'])) {
34: if (!empty($style['fallback'])) {
35: $styles[$key] = $styles[$style['fallback']];
36: } else {
37: unset($styles[$key]);
38: }
39: }
40: }
41: }
42:
43: return $styles;
44: }
45:
46: }
47: