/usr/share/horde/ansel/lib/Factory/Styles.php is in php-horde-ansel 3.0.5+debian0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | <?php
/**
* Factory for getting list of all available pre-defined styles.
*
* @author Michael J. Rubinsky <mrubinsk@horde.org>
* @category Horde
* @license http://www.horde.org/licenses/gpl GPL
* @package Ansel
*/
class Ansel_Factory_Styles extends Horde_Core_Factory_Injector
{
public function create (Horde_Injector $injector)
{
/* Brings in the $styles array in this scope only */
$styles = Horde::loadConfiguration('styles.php', 'styles', 'ansel');
/* No prettythumbs allowed at all by admin choice */
if (empty($GLOBALS['conf']['image']['prettythumbs'])) {
$test = $styles;
foreach ($test as $key => $style) {
if ($style['thumbstyle'] != 'Thumb') {
unset($styles[$key]);
}
}
}
/* Check if the browser / server has png support */
if ($GLOBALS['conf']['image']['type'] != 'png') {
$test = $styles;
foreach ($test as $key => $style) {
if (!empty($style['requires_png'])) {
if (!empty($style['fallback'])) {
$styles[$key] = $styles[$style['fallback']];
} else {
unset($styles[$key]);
}
}
}
}
return $styles;
}
}
|