69 $this->preview_enabled = $this->
settings->get(
'preview_enabled',
false) ==
true;
70 $this->max_previews = $this->
settings->get(
'max_previews_per_object', self::MAX_PREVIEWS_DEFAULT);
81 $instance->preview_enabled = $a_value ==
true;
92 return self::getInstance()->preview_enabled;
103 $instance->max_previews = self::adjustNumeric($a_value, self::MAX_PREVIEWS_MIN, self::MAX_PREVIEWS_MAX, self::MAX_PREVIEWS_DEFAULT);
114 return self::getInstance()->max_previews;
125 $instance->image_size = self::adjustNumeric($a_value, self::IMAGE_SIZE_MIN, self::IMAGE_SIZE_MAX, self::IMAGE_SIZE_DEFAULT);
136 return self::getInstance()->image_size;
147 $instance->image_quality = self::adjustNumeric($a_value, self::IMAGE_QUALITY_MIN, self::IMAGE_QUALITY_MAX, self::IMAGE_QUALITY_DEFAULT);
158 return self::getInstance()->image_quality;
167 if (self::$instance == null) {
171 return self::$instance;
187 if (is_numeric($value)) {
189 $value = (int) $value;
192 } elseif ($value > $max) {
static setMaximumPreviews($a_value)
Sets the maximum number of preview pictures per object.
static getImageQuality()
Gets the quality (compression) of the preview images (1-100).
static adjustNumeric($value, $min, $max, $default)
Adjusts the numeric value to fit between the specified minimum and maximum.
static setImageSize($a_value)
Sets the size of the preview images in pixels.
static getInstance()
Gets the instance of the ilPreviewSettings.
static setImageQuality($a_value)
Sets the quality (compression) of the preview images (1-100).
const IMAGE_QUALITY_DEFAULT
__construct()
Private constructor.
static getMaximumPreviews()
Gets the maximum number of preview pictures per object.
static isPreviewEnabled()
Gets whether the preview functionality is enabled.
static getImageSize()
Gets the size of the preview images in pixels.
static setPreviewEnabled($a_value)
Sets whether the preview functionality is enabled.
const MAX_PREVIEWS_DEFAULT