ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\components\File\Preview\Settings Class Reference
+ Inheritance diagram for ILIAS\components\File\Preview\Settings:
+ Collaboration diagram for ILIAS\components\File\Preview\Settings:

Public Member Functions

 __construct ()
 
 setPersisting (bool $a_value)
 
 isPersisting ()
 
 setTilePreviews (bool $a_value)
 
 hasTilePreviews ()
 
 isPreviewPossible ()
 
 setPreviewEnabled (bool $a_value)
 
 isPreviewEnabled ()
 
 setMaximumPreviews (int $max_previews)
 
 getMaximumPreviews ()
 
 setImageSize (int $image_size)
 
 getImageSize ()
 
 setImageQuality (int $quality)
 
 getImageQuality ()
 
- Public Member Functions inherited from ilSetting
 __construct (string $a_module="common", bool $a_disabled_cache=false)
 
 getModule ()
 
 read ()
 
 get (string $a_keyword, ?string $a_default_value=null)
 get setting More...
 
 deleteAll ()
 
 deleteLike (string $a_like)
 
 delete (string $a_keyword)
 
 getAll ()
 
 set (string $a_key, string $a_val)
 
 setScormDebug (string $a_key, string $a_val)
 
 getModule ()
 
 read ()
 
 get (string $a_keyword, ?string $a_default_value=null)
 
 deleteAll ()
 
 delete (string $a_keyword)
 
 getAll ()
 
 set (string $a_key, string $a_val)
 

Data Fields

const V_MAX_PREVIEWS_DEFAULT = 5
 
const V_MAX_PREVIEWS_MIN = 1
 
const V_MAX_PREVIEWS_MAX = 100
 
const V_IMAGE_SIZE_DEFAULT = 868
 
const V_IMAGE_SIZE_MIN = 50
 
const V_IMAGE_SIZE_MAX = 1000
 
const MODULE_NAME = 'preview'
 
- Data Fields inherited from ilSetting
array $setting = array()
 
string $module = ""
 

Private Member Functions

 adjustNumeric (int $value, int $min, int $max, int $default)
 
 strToBool (string $value)
 
 boolToStr (bool $value)
 
 intToStr (int $int)
 
 strToInt (string $str)
 

Private Attributes

const V_IMAGE_QUALITY_DEFAULT = 85
 
const V_IMAGE_QUALITY_MIN = 1
 
const V_IMAGE_QUALITY_MAX = 100
 
const F_PREVIEW_ENABLED = 'preview_enabled'
 
const F_MAX_PREVIEWS_PER_OBJECT = 'max_previews_per_object'
 
const F_PREVIEW_IMAGE_SIZE = 'preview_image_size'
 
const F_PREVIEW_PERSISTING = 'preview_persisting'
 
const F_PREVIEW_IMAGE_QUALITY = 'preview_image_quality'
 
const F_TILE_PREVIEWS = 'tile_previews'
 
ImagickEngine $imagick
 @readonly More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilSetting
static _lookupValue (string $a_module, string $a_keyword)
 
static _getValueType ()
 Get the type of the value column in the database. More...
 
static _changeValueType (string $a_new_type='text')
 change the type of the value column in the database More...
 
static _getLongerSettings (int $a_limit=4000)
 get a list of setting records with values loger than a limit More...
 
static _lookupValue (string $a_module, string $a_keyword)
 
- Protected Attributes inherited from ilSetting
ilDBInterface $db
 
bool $cache_disabled = false
 

Detailed Description

Author
Fabian Schmid fabia.nosp@m.n@sr.nosp@m..solu.nosp@m.tion.nosp@m.s

Definition at line 28 of file Settings.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\components\File\Preview\Settings::__construct ( )

Definition at line 82 of file Settings.php.

83 {
84 parent::__construct(self::MODULE_NAME, false);
85 $this->imagick = new ImagickEngine();
86 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ adjustNumeric()

ILIAS\components\File\Preview\Settings::adjustNumeric ( int  $value,
int  $min,
int  $max,
int  $default 
)
private

Definition at line 174 of file Settings.php.

174 : int
175 {
176 // is number?
177 if (is_numeric($value)) {
178 // don't allow to large numbers
179 $value = (int) $value;
180 if ($value < $min) {
181 $value = $min;
182 } elseif ($value > $max) {
183 $value = $max;
184 }
185 } else {
186 $value = $default;
187 }
188
189 return $value;
190 }

References ILIAS\Repository\int().

Referenced by ILIAS\components\File\Preview\Settings\setImageQuality(), ILIAS\components\File\Preview\Settings\setImageSize(), and ILIAS\components\File\Preview\Settings\setMaximumPreviews().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ boolToStr()

ILIAS\components\File\Preview\Settings::boolToStr ( bool  $value)
private

Definition at line 199 of file Settings.php.

199 : string
200 {
201 return $value ? '1' : '0';
202 }

Referenced by ILIAS\components\File\Preview\Settings\setPersisting(), ILIAS\components\File\Preview\Settings\setPreviewEnabled(), and ILIAS\components\File\Preview\Settings\setTilePreviews().

+ Here is the caller graph for this function:

◆ getImageQuality()

ILIAS\components\File\Preview\Settings::getImageQuality ( )

Definition at line 169 of file Settings.php.

169 : int
170 {
171 return $this->strToInt($this->get(self::F_PREVIEW_IMAGE_QUALITY, (string) self::V_IMAGE_QUALITY_DEFAULT));
172 }

References ILIAS\components\File\Preview\Settings\strToInt().

+ Here is the call graph for this function:

◆ getImageSize()

ILIAS\components\File\Preview\Settings::getImageSize ( )

Definition at line 153 of file Settings.php.

153 : int
154 {
155 return $this->strToInt($this->get(self::F_PREVIEW_IMAGE_SIZE, (string) self::V_IMAGE_SIZE_DEFAULT));
156 }

References ILIAS\components\File\Preview\Settings\strToInt().

+ Here is the call graph for this function:

◆ getMaximumPreviews()

ILIAS\components\File\Preview\Settings::getMaximumPreviews ( )

Definition at line 137 of file Settings.php.

137 : int
138 {
139 return $this->strToInt($this->get(self::F_MAX_PREVIEWS_PER_OBJECT, (string) self::V_MAX_PREVIEWS_DEFAULT));
140 }

References ILIAS\components\File\Preview\Settings\strToInt().

+ Here is the call graph for this function:

◆ hasTilePreviews()

ILIAS\components\File\Preview\Settings::hasTilePreviews ( )

Definition at line 103 of file Settings.php.

103 : bool
104 {
105 return $this->strToBool($this->get(self::F_TILE_PREVIEWS, '1'));
106 }

References ILIAS\components\File\Preview\Settings\strToBool().

+ Here is the call graph for this function:

◆ intToStr()

ILIAS\components\File\Preview\Settings::intToStr ( int  $int)
private

Definition at line 204 of file Settings.php.

204 : string
205 {
206 return (string) $int;
207 }

Referenced by ILIAS\components\File\Preview\Settings\setImageQuality(), ILIAS\components\File\Preview\Settings\setImageSize(), and ILIAS\components\File\Preview\Settings\setMaximumPreviews().

+ Here is the caller graph for this function:

◆ isPersisting()

ILIAS\components\File\Preview\Settings::isPersisting ( )

Definition at line 93 of file Settings.php.

93 : bool
94 {
95 return $this->strToBool($this->get(self::F_PREVIEW_PERSISTING, '1'));
96 }

References ILIAS\components\File\Preview\Settings\strToBool().

+ Here is the call graph for this function:

◆ isPreviewEnabled()

ILIAS\components\File\Preview\Settings::isPreviewEnabled ( )

Definition at line 118 of file Settings.php.

118 : bool
119 {
120 if (!$this->isPreviewPossible()) {
121 return false;
122 }
123 return $this->strToBool($this->get(self::F_PREVIEW_ENABLED, '1'));
124 }

References ILIAS\components\File\Preview\Settings\isPreviewPossible(), and ILIAS\components\File\Preview\Settings\strToBool().

+ Here is the call graph for this function:

◆ isPreviewPossible()

ILIAS\components\File\Preview\Settings::isPreviewPossible ( )

Definition at line 108 of file Settings.php.

108 : bool
109 {
110 return $this->imagick->isRunning(); // &&(new GDEngine())->isRunning();
111 }

Referenced by ILIAS\components\File\Preview\Settings\isPreviewEnabled().

+ Here is the caller graph for this function:

◆ setImageQuality()

ILIAS\components\File\Preview\Settings::setImageQuality ( int  $quality)

Definition at line 158 of file Settings.php.

158 : void
159 {
160 $quality = $this->adjustNumeric(
161 $quality,
162 self::V_IMAGE_QUALITY_MIN,
163 self::V_IMAGE_QUALITY_MAX,
164 self::V_IMAGE_QUALITY_DEFAULT
165 );
166 $this->set(self::F_PREVIEW_IMAGE_QUALITY, $this->intToStr($quality));
167 }
adjustNumeric(int $value, int $min, int $max, int $default)
Definition: Settings.php:174

References ILIAS\components\File\Preview\Settings\adjustNumeric(), ILIAS\components\File\Preview\Settings\F_PREVIEW_IMAGE_QUALITY, and ILIAS\components\File\Preview\Settings\intToStr().

+ Here is the call graph for this function:

◆ setImageSize()

ILIAS\components\File\Preview\Settings::setImageSize ( int  $image_size)

Definition at line 142 of file Settings.php.

142 : void
143 {
144 $image_size = $this->adjustNumeric(
145 $image_size,
146 self::V_IMAGE_SIZE_MIN,
147 self::V_IMAGE_SIZE_MAX,
148 self::V_IMAGE_SIZE_DEFAULT
149 );
150 $this->set(self::F_PREVIEW_IMAGE_SIZE, $this->intToStr($image_size));
151 }

References ILIAS\components\File\Preview\Settings\adjustNumeric(), ILIAS\components\File\Preview\Settings\F_PREVIEW_IMAGE_SIZE, and ILIAS\components\File\Preview\Settings\intToStr().

+ Here is the call graph for this function:

◆ setMaximumPreviews()

ILIAS\components\File\Preview\Settings::setMaximumPreviews ( int  $max_previews)

Definition at line 126 of file Settings.php.

126 : void
127 {
128 $max_previews = $this->adjustNumeric(
129 $max_previews,
130 self::V_MAX_PREVIEWS_MIN,
131 self::V_MAX_PREVIEWS_MAX,
132 self::V_MAX_PREVIEWS_DEFAULT
133 );
134 $this->set(self::F_MAX_PREVIEWS_PER_OBJECT, $this->intToStr($max_previews));
135 }

References ILIAS\components\File\Preview\Settings\adjustNumeric(), ILIAS\components\File\Preview\Settings\F_MAX_PREVIEWS_PER_OBJECT, and ILIAS\components\File\Preview\Settings\intToStr().

+ Here is the call graph for this function:

◆ setPersisting()

ILIAS\components\File\Preview\Settings::setPersisting ( bool  $a_value)

Definition at line 88 of file Settings.php.

88 : void
89 {
90 $this->set(self::F_PREVIEW_PERSISTING, $this->boolToStr($a_value));
91 }

References ILIAS\components\File\Preview\Settings\boolToStr(), and ILIAS\components\File\Preview\Settings\F_PREVIEW_PERSISTING.

+ Here is the call graph for this function:

◆ setPreviewEnabled()

ILIAS\components\File\Preview\Settings::setPreviewEnabled ( bool  $a_value)

Definition at line 113 of file Settings.php.

113 : void
114 {
115 $this->set(self::F_PREVIEW_ENABLED, $this->boolToStr($a_value));
116 }

References ILIAS\components\File\Preview\Settings\boolToStr(), and ILIAS\components\File\Preview\Settings\F_PREVIEW_ENABLED.

+ Here is the call graph for this function:

◆ setTilePreviews()

ILIAS\components\File\Preview\Settings::setTilePreviews ( bool  $a_value)

Definition at line 98 of file Settings.php.

98 : void
99 {
100 $this->set(self::F_TILE_PREVIEWS, $this->boolToStr($a_value));
101 }

References ILIAS\components\File\Preview\Settings\boolToStr(), and ILIAS\components\File\Preview\Settings\F_TILE_PREVIEWS.

+ Here is the call graph for this function:

◆ strToBool()

ILIAS\components\File\Preview\Settings::strToBool ( string  $value)
private

Definition at line 194 of file Settings.php.

194 : bool
195 {
196 return $value === '1';
197 }

Referenced by ILIAS\components\File\Preview\Settings\hasTilePreviews(), ILIAS\components\File\Preview\Settings\isPersisting(), and ILIAS\components\File\Preview\Settings\isPreviewEnabled().

+ Here is the caller graph for this function:

◆ strToInt()

ILIAS\components\File\Preview\Settings::strToInt ( string  $str)
private

Definition at line 209 of file Settings.php.

209 : int
210 {
211 return (int) $str;
212 }

Referenced by ILIAS\components\File\Preview\Settings\getImageQuality(), ILIAS\components\File\Preview\Settings\getImageSize(), and ILIAS\components\File\Preview\Settings\getMaximumPreviews().

+ Here is the caller graph for this function:

Field Documentation

◆ $imagick

ImagickEngine ILIAS\components\File\Preview\Settings::$imagick
private

@readonly

Definition at line 80 of file Settings.php.

◆ F_MAX_PREVIEWS_PER_OBJECT

const ILIAS\components\File\Preview\Settings::F_MAX_PREVIEWS_PER_OBJECT = 'max_previews_per_object'
private

◆ F_PREVIEW_ENABLED

const ILIAS\components\File\Preview\Settings::F_PREVIEW_ENABLED = 'preview_enabled'
private

◆ F_PREVIEW_IMAGE_QUALITY

const ILIAS\components\File\Preview\Settings::F_PREVIEW_IMAGE_QUALITY = 'preview_image_quality'
private

Definition at line 72 of file Settings.php.

Referenced by ILIAS\components\File\Preview\Settings\setImageQuality().

◆ F_PREVIEW_IMAGE_SIZE

const ILIAS\components\File\Preview\Settings::F_PREVIEW_IMAGE_SIZE = 'preview_image_size'
private

Definition at line 64 of file Settings.php.

Referenced by ILIAS\components\File\Preview\Settings\setImageSize().

◆ F_PREVIEW_PERSISTING

const ILIAS\components\File\Preview\Settings::F_PREVIEW_PERSISTING = 'preview_persisting'
private

Definition at line 68 of file Settings.php.

Referenced by ILIAS\components\File\Preview\Settings\setPersisting().

◆ F_TILE_PREVIEWS

const ILIAS\components\File\Preview\Settings::F_TILE_PREVIEWS = 'tile_previews'
private

Definition at line 76 of file Settings.php.

Referenced by ILIAS\components\File\Preview\Settings\setTilePreviews().

◆ MODULE_NAME

const ILIAS\components\File\Preview\Settings::MODULE_NAME = 'preview'

Definition at line 51 of file Settings.php.

◆ V_IMAGE_QUALITY_DEFAULT

const ILIAS\components\File\Preview\Settings::V_IMAGE_QUALITY_DEFAULT = 85
private

Definition at line 41 of file Settings.php.

◆ V_IMAGE_QUALITY_MAX

const ILIAS\components\File\Preview\Settings::V_IMAGE_QUALITY_MAX = 100
private

Definition at line 49 of file Settings.php.

◆ V_IMAGE_QUALITY_MIN

const ILIAS\components\File\Preview\Settings::V_IMAGE_QUALITY_MIN = 1
private

Definition at line 45 of file Settings.php.

◆ V_IMAGE_SIZE_DEFAULT

const ILIAS\components\File\Preview\Settings::V_IMAGE_SIZE_DEFAULT = 868

Definition at line 34 of file Settings.php.

◆ V_IMAGE_SIZE_MAX

const ILIAS\components\File\Preview\Settings::V_IMAGE_SIZE_MAX = 1000

Definition at line 36 of file Settings.php.

◆ V_IMAGE_SIZE_MIN

const ILIAS\components\File\Preview\Settings::V_IMAGE_SIZE_MIN = 50

Definition at line 35 of file Settings.php.

◆ V_MAX_PREVIEWS_DEFAULT

const ILIAS\components\File\Preview\Settings::V_MAX_PREVIEWS_DEFAULT = 5

Definition at line 30 of file Settings.php.

◆ V_MAX_PREVIEWS_MAX

const ILIAS\components\File\Preview\Settings::V_MAX_PREVIEWS_MAX = 100

Definition at line 32 of file Settings.php.

◆ V_MAX_PREVIEWS_MIN

const ILIAS\components\File\Preview\Settings::V_MAX_PREVIEWS_MIN = 1

Definition at line 31 of file Settings.php.


The documentation for this class was generated from the following file: