PluginProbe
User Access Manager / 2.2.3
User Access Manager v2.2.3
2.3.20 2.3.19 2.3.18 2.3.17 2.3.16 2.3.15 2.3.14 2.3.13 trunk 0.6 0.6.1 0.6.2 0.7 0.7 Beta 0.7.0.1 0.8 0.8.0.1 0.8.0.2 0.9 0.9.1 0.9.1.1 0.9.1.2 0.9.1.3 0.9.1.4 1.0 All 136 releases
← All changes | src/Config/MainConfig.php +351 -116 2.3.202.2.3 View file →
@@ -1,5 +1,18 @@
1 1 <?php
2 +/**
3 + * Config.php
4 + *
5 + * The Config class file.
6 + *
7 + * PHP versions 5
8 + *
9 + * @author Alexander Schneider <alexanderschneider85@gmail.com>
10 + * @copyright 2008-2017 Alexander Schneider
11 + * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2
12 + * @version SVN: $id$
13 + * @link http://wordpress.org/extend/plugins/user-access-manager/
14 + */
2 15
3 16 declare(strict_types=1);
4 17
5 18 namespace UserAccessManager\Config;
@@ -5,92 +18,111 @@
5 18 namespace UserAccessManager\Config;
6 19
7 20 use Exception;
8 21 use UserAccessManager\Cache\Cache;
9 -use UserAccessManager\Config\Parameter\ConfigParameter;
10 -use UserAccessManager\Config\Parameter\ConfigParameterFactory;
11 22 use UserAccessManager\Object\ObjectHandler;
12 23 use UserAccessManager\Wrapper\Wordpress;
13 24
25 +/**
26 + * Class Config
27 + *
28 + * @package UserAccessManager\Config
29 + */
14 30 class MainConfig extends Config
15 31 {
16 - public const MAIN_CONFIG_KEY = 'uamAdminOptions';
17 - public const DEFAULT_TYPE = 'default';
18 - public const CACHE_PROVIDER_NONE = 'none';
32 + const MAIN_CONFIG_KEY = 'uamAdminOptions';
33 + const DEFAULT_TYPE = 'default';
34 + const CACHE_PROVIDER_NONE = 'none';
19 35
20 - public function __construct(
21 - Wordpress $wordpress,
22 - private ObjectHandler $objectHandler,
23 - private Cache $cache,
24 - private ConfigParameterFactory $configParameterFactory
25 - ) {
26 - parent::__construct($wordpress, self::MAIN_CONFIG_KEY);
27 - }
36 + /**
37 + * @var ObjectHandler
38 + */
39 + private $objectHandler;
28 40
29 41 /**
30 - * @throws Exception
42 + * @var Cache
31 43 */
32 - private function addBoolean(array &$configParameters, string $id, bool $defaultValue = false): void
33 - {
34 - $configParameters[$id] = $this->configParameterFactory->createBooleanConfigParameter($id, $defaultValue);
35 - }
44 + private $cache;
36 45
37 46 /**
38 - * @throws Exception
47 + * @var ConfigParameterFactory
39 48 */
40 - private function addString(array &$configParameters, string $id, string $defaultValue = ''): void
41 - {
42 - $configParameters[$id] = $this->configParameterFactory->createStringConfigParameter($id, $defaultValue);
43 - }
49 + protected $configParameterFactory;
44 50
45 51 /**
46 - * @throws Exception
52 + * MainConfig constructor.
53 + * @param Wordpress $wordpress
54 + * @param ObjectHandler $objectHandler
55 + * @param Cache $cache
56 + * @param ConfigParameterFactory $configParameterFactory
47 57 */
48 - private function addSelection(
49 - array &$configParameters,
50 - string $id,
51 - string $defaultValue,
52 - array $selections
53 - ): void {
54 - $configParameters[$id] = $this->configParameterFactory->createSelectionConfigParameter(
55 - $id,
56 - $defaultValue,
57 - $selections
58 - );
58 + public function __construct(
59 + Wordpress $wordpress,
60 + ObjectHandler $objectHandler,
61 + Cache $cache,
62 + ConfigParameterFactory $configParameterFactory
63 + ) {
64 + $this->objectHandler = $objectHandler;
65 + $this->cache = $cache;
66 + $this->configParameterFactory = $configParameterFactory;
67 +
68 + parent::__construct($wordpress, self::MAIN_CONFIG_KEY);
59 69 }
60 70
61 71 /**
72 + * Adds the default general config parameters to the config parameters.
73 + * @param array $configParameters
62 74 * @throws Exception
63 75 */
64 - private function addDefaultGeneralConfigParameters(array &$configParameters): void
76 + private function addDefaultGeneralConfigParameters(array &$configParameters)
65 77 {
66 - $this->addSelection(
67 - $configParameters,
68 - 'redirect',
78 + $id = 'redirect';
79 + $configParameters[$id] = $this->configParameterFactory->createSelectionConfigParameter(
80 + $id,
69 81 'false',
70 - ['false', 'blog', 'login', 'custom_page', 'custom_url', 'origin']
82 + ['false', 'blog', 'login', 'custom_page', 'custom_url']
71 83 );
72 - $this->addString($configParameters, 'redirect_custom_page');
73 - $this->addString($configParameters, 'redirect_custom_url');
74 - $this->addBoolean($configParameters, 'append_redirect_to_parameter');
75 - $this->addBoolean($configParameters, 'lock_recursive', true);
76 - $this->addBoolean($configParameters, 'authors_has_access_to_own', true);
77 - $this->addBoolean($configParameters, 'authors_can_add_posts_to_groups');
78 - $this->addBoolean($configParameters, 'blog_admin_hint', true);
79 - $this->addString($configParameters, 'blog_admin_hint_text', '[L]');
80 - $this->addBoolean($configParameters, 'show_assigned_groups', true);
81 - $this->addBoolean($configParameters, 'hide_edit_link_on_no_access', true);
82 - $this->addString($configParameters, 'extra_ip_header', 'HTTP_X_REAL_IP');
83 - $this->addBoolean($configParameters, 'protect_feed', true);
84 - $this->addSelection(
85 - $configParameters,
86 - 'full_access_role',
84 +
85 + $id = 'redirect_custom_page';
86 + $configParameters[$id] = $this->configParameterFactory->createStringConfigParameter($id);
87 +
88 + $id = 'redirect_custom_url';
89 + $configParameters[$id] = $this->configParameterFactory->createStringConfigParameter($id);
90 +
91 + $id = 'lock_recursive';
92 + $configParameters[$id] = $this->configParameterFactory->createBooleanConfigParameter($id, true);
93 +
94 + $id = 'authors_has_access_to_own';
95 + $configParameters[$id] = $this->configParameterFactory->createBooleanConfigParameter($id, true);
96 +
97 + $id = 'authors_can_add_posts_to_groups';
98 + $configParameters[$id] = $this->configParameterFactory->createBooleanConfigParameter($id);
99 +
100 + $id = 'blog_admin_hint';
101 + $configParameters[$id] = $this->configParameterFactory->createBooleanConfigParameter($id, true);
102 +
103 + $id = 'blog_admin_hint_text';
104 + $configParameters[$id] = $this->configParameterFactory->createStringConfigParameter($id, '[L]');
105 +
106 + $id = 'show_assigned_groups';
107 + $configParameters[$id] = $this->configParameterFactory->createBooleanConfigParameter($id, true);
108 +
109 + $id = 'hide_edit_link_on_no_access';
110 + $configParameters[$id] = $this->configParameterFactory->createBooleanConfigParameter($id, true);
111 +
112 + $id = 'protect_feed';
113 + $configParameters[$id] = $this->configParameterFactory->createBooleanConfigParameter($id, true);
114 +
115 + $id = 'full_access_role';
116 + $configParameters[$id] = $this->configParameterFactory->createSelectionConfigParameter(
117 + $id,
87 118 'administrator',
88 119 ['administrator', 'editor', 'author', 'contributor', 'subscriber']
89 120 );
90 - $this->addSelection(
91 - $configParameters,
92 - 'active_cache_provider',
121 +
122 + $id = 'active_cache_provider';
123 + $configParameters[$id] = $this->configParameterFactory->createSelectionConfigParameter(
124 + $id,
93 125 self::CACHE_PROVIDER_NONE,
94 126 array_merge([self::CACHE_PROVIDER_NONE], array_keys($this->cache->getRegisteredCacheProviders()))
95 127 );
96 128 }
@@ -95,11 +127,13 @@
95 127 );
96 128 }
97 129
98 130 /**
131 + * Adds the default post config parameters to the config parameters.
132 + * @param array $configParameters
99 133 * @throws Exception
100 134 */
101 - private function addDefaultPostConfigParameters(array &$configParameters): void
135 + private function addDefaultPostConfigParameters(array &$configParameters)
102 136 {
103 137 $postTypes = $this->objectHandler->getPostTypes();
104 138 array_unshift($postTypes, self::DEFAULT_TYPE);
105 139
@@ -108,30 +142,53 @@
108 142 continue;
109 143 }
110 144
111 145 if ($postType !== self::DEFAULT_TYPE) {
112 - $this->addBoolean($configParameters, "{$postType}_use_default");
146 + $id = "{$postType}_use_default";
147 + $configParameters[$id] = $this->configParameterFactory->createBooleanConfigParameter($id);
113 148 }
114 149
115 - $this->addBoolean($configParameters, "hide_$postType");
116 - $this->addBoolean($configParameters, "hide_{$postType}_title");
117 - $this->addString($configParameters, "{$postType}_title", TXT_UAM_SETTING_DEFAULT_NO_RIGHTS);
118 - $this->addString($configParameters, "{$postType}_content", TXT_UAM_SETTING_DEFAULT_NO_RIGHTS_FOR_ENTRY);
119 - $this->addBoolean($configParameters, "hide_{$postType}_comment");
120 - $this->addString(
121 - $configParameters,
122 - "{$postType}_comment_content",
150 + $id = "hide_{$postType}";
151 + $configParameters[$id] = $this->configParameterFactory->createBooleanConfigParameter($id);
152 +
153 + $id = "hide_{$postType}_title";
154 + $configParameters[$id] = $this->configParameterFactory->createBooleanConfigParameter($id);
155 +
156 + $id = "{$postType}_title";
157 + $configParameters[$id] = $this->configParameterFactory->createStringConfigParameter(
158 + $id,
159 + TXT_UAM_SETTING_DEFAULT_NO_RIGHTS
160 + );
161 +
162 + $id = "{$postType}_content";
163 + $configParameters[$id] = $this->configParameterFactory->createStringConfigParameter(
164 + $id,
165 + TXT_UAM_SETTING_DEFAULT_NO_RIGHTS_FOR_ENTRY
166 + );
167 +
168 + $id = "hide_{$postType}_comment";
169 + $configParameters[$id] = $this->configParameterFactory->createBooleanConfigParameter($id);
170 +
171 + $id = "{$postType}_comment_content";
172 + $configParameters[$id] = $this->configParameterFactory->createStringConfigParameter(
173 + $id,
123 174 TXT_UAM_SETTING_DEFAULT_NO_RIGHTS_FOR_COMMENTS
124 175 );
125 - $this->addBoolean($configParameters, "{$postType}_comments_locked");
126 - $this->addBoolean($configParameters, "show_{$postType}_content_before_more");
176 +
177 + $id = "{$postType}_comments_locked";
178 + $configParameters[$id] = $this->configParameterFactory->createBooleanConfigParameter($id);
179 +
180 + $id = "show_{$postType}_content_before_more";
181 + $configParameters[$id] = $this->configParameterFactory->createBooleanConfigParameter($id);
127 182 }
128 183 }
129 184
130 185 /**
186 + * Adds the default taxonomy config parameters to the config parameters.
187 + * @param array $configParameters
131 188 * @throws Exception
132 189 */
133 - private function addDefaultTaxonomyConfigParameters(array &$configParameters): void
190 + private function addDefaultTaxonomyConfigParameters(array &$configParameters)
134 191 {
135 192 $taxonomies = $this->objectHandler->getTaxonomies();
136 193 array_unshift($taxonomies, self::DEFAULT_TYPE);
137 194
@@ -136,256 +193,434 @@
136 193 array_unshift($taxonomies, self::DEFAULT_TYPE);
137 194
138 195 foreach ($taxonomies as $taxonomy) {
139 196 if ($taxonomy !== self::DEFAULT_TYPE) {
140 - $this->addBoolean($configParameters, "{$taxonomy}_use_default");
197 + $id = "{$taxonomy}_use_default";
198 + $configParameters[$id] = $this->configParameterFactory->createBooleanConfigParameter($id);
141 199 }
142 200
143 - $this->addBoolean($configParameters, "hide_empty_$taxonomy", true);
201 + $id = 'hide_empty_' . $taxonomy;
202 + $configParameters[$id] = $this->configParameterFactory->createBooleanConfigParameter($id, true);
144 203 }
145 204 }
146 205
147 206 /**
207 + * Adds the default file config parameters to the config parameters.
208 + * @param array $configParameters
148 209 * @throws Exception
149 210 */
150 - private function addDefaultFileConfigParameters(array &$configParameters): void
211 + private function addDefaultFileConfigParameters(array &$configParameters)
151 212 {
152 - $this->addBoolean($configParameters, 'lock_file');
153 - $this->addSelection($configParameters, 'download_type', 'fopen', ['xsendfile', 'fopen', 'normal']);
154 - $this->addString($configParameters, 'inline_files', 'pdf');
155 - $this->addSelection($configParameters, 'no_access_image_type', 'default', ['default', 'custom']);
156 - $this->addString($configParameters, 'custom_no_access_image');
157 - $this->addBoolean($configParameters, 'use_custom_file_handling_file');
158 - $this->addSelection($configParameters, 'locked_directory_type', 'wordpress', ['wordpress', 'all', 'custom']);
159 - $this->addString($configParameters, 'custom_locked_directories');
160 - $this->addSelection($configParameters, 'file_pass_type', 'random', ['random', 'user']);
161 - $this->addSelection($configParameters, 'lock_file_types', 'all', ['all', 'selected', 'not_selected']);
162 - $this->addString($configParameters, 'locked_file_types', 'zip,rar,tar,gz');
163 - $this->addString($configParameters, 'not_locked_file_types', 'gif,jpg,jpeg,png');
213 + $id = 'lock_file';
214 + $configParameters[$id] = $this->configParameterFactory->createBooleanConfigParameter($id);
215 +
216 + $id = 'download_type';
217 + $configParameters[$id] = $this->configParameterFactory->createSelectionConfigParameter(
218 + $id,
219 + 'fopen',
220 + ['xsendfile', 'fopen', 'normal']
221 + );
222 +
223 + $id = 'inline_files';
224 + $configParameters[$id] = $this->configParameterFactory->createStringConfigParameter($id, 'pdf');
225 +
226 + $id = 'no_access_image_type';
227 + $configParameters[$id] = $this->configParameterFactory->createSelectionConfigParameter(
228 + $id,
229 + 'default',
230 + ['default', 'custom']
231 + );
232 +
233 + $id = 'custom_no_access_image';
234 + $configParameters[$id] = $this->configParameterFactory->createStringConfigParameter($id);
235 +
236 + $id = 'use_custom_file_handling_file';
237 + $configParameters[$id] = $this->configParameterFactory->createBooleanConfigParameter($id);
238 +
239 + $id = 'locked_directory_type';
240 + $configParameters[$id] = $this->configParameterFactory->createSelectionConfigParameter(
241 + $id,
242 + 'wordpress',
243 + ['wordpress', 'all', 'custom']
244 + );
245 +
246 + $id = 'custom_locked_directories';
247 + $configParameters[$id] = $this->configParameterFactory->createStringConfigParameter($id);
248 +
249 + $id = 'file_pass_type';
250 + $configParameters[$id] = $this->configParameterFactory->createSelectionConfigParameter(
251 + $id,
252 + 'random',
253 + ['random', 'user']
254 + );
255 +
256 + $id = 'lock_file_types';
257 + $configParameters[$id] = $this->configParameterFactory->createSelectionConfigParameter(
258 + $id,
259 + 'all',
260 + ['all', 'selected', 'not_selected']
261 + );
262 +
263 + $id = 'locked_file_types';
264 + $configParameters[$id] = $this->configParameterFactory->createStringConfigParameter(
265 + $id,
266 + 'zip,rar,tar,gz'
267 + );
268 +
269 + $id = 'not_locked_file_types';
270 + $configParameters[$id] = $this->configParameterFactory->createStringConfigParameter(
271 + $id,
272 + 'gif,jpg,jpeg,png'
273 + );
164 274 }
165 275
166 276 /**
277 + * Returns the default config parameters settings
167 278 * @return ConfigParameter[]
168 279 * @throws Exception
169 280 */
170 281 protected function getDefaultConfigParameters(): array
171 282 {
172 - if ($this->defaultConfigParameters !== []) {
173 - return $this->defaultConfigParameters;
174 - }
283 + if ($this->defaultConfigParameters === []) {
284 + /**
285 + * @var ConfigParameter[] $configParameters
286 + */
287 + $configParameters = [];
175 288
176 - /**
177 - * @var ConfigParameter[] $configParameters
178 - */
179 - $configParameters = [];
289 + $this->addDefaultGeneralConfigParameters($configParameters);
290 + $this->addDefaultPostConfigParameters($configParameters);
291 + $this->addDefaultTaxonomyConfigParameters($configParameters);
292 + $this->addDefaultFileConfigParameters($configParameters);
180 293
181 - $this->addDefaultGeneralConfigParameters($configParameters);
182 - $this->addDefaultPostConfigParameters($configParameters);
183 - $this->addDefaultTaxonomyConfigParameters($configParameters);
184 - $this->addDefaultFileConfigParameters($configParameters);
294 + $this->defaultConfigParameters = $configParameters;
295 + }
185 296
186 - return $this->defaultConfigParameters = $configParameters;
297 + return $this->defaultConfigParameters;
187 298 }
188 299
300 + /**
301 + * Returns the object parameter name.
302 + * @param string $objectType
303 + * @param string $rawParameterName
304 + * @return ConfigParameter|null
305 + */
189 306 private function getObjectParameter(string $objectType, string $rawParameterName): ?ConfigParameter
190 307 {
191 308 $options = $this->getConfigParameters();
192 309 $parameterName = sprintf($rawParameterName, $objectType);
193 - $useDefaultParameter = $options["{$objectType}_use_default"] ?? null;
194 310
195 - if (isset($options[$parameterName]) === false || $useDefaultParameter?->getValue() === true) {
311 + if (isset($options[$parameterName]) === false
312 + || isset($options["{$objectType}_use_default"]) === true
313 + && $options["{$objectType}_use_default"]->getValue() === true
314 + ) {
196 315 $parameterName = sprintf($rawParameterName, self::DEFAULT_TYPE);
197 316 }
198 317
199 - return $options[$parameterName] ?? null;
318 + return (isset($options[$parameterName]) === true) ? $options[$parameterName] : null;
200 319 }
201 320
321 + /**
322 + * Returns the option value if the option exists otherwise true.
323 + * @param string $objectType
324 + * @param string $parameterName
325 + * @return bool
326 + */
202 327 private function hideObject(string $objectType, string $parameterName): bool
203 328 {
204 - return $this->getObjectParameter($objectType, $parameterName)?->getValue() ?? true;
329 + $parameter = $this->getObjectParameter($objectType, $parameterName);
330 + return ($parameter !== null) ? $parameter->getValue() : true;
205 331 }
206 332
207 - private function getObjectContent(string $objectType, string $parameterName): bool|string
333 + /**
334 + * Returns the option value if the option exists otherwise an empty string.
335 + * @param string $objectType
336 + * @param string $parameterName
337 + * @return bool|string
338 + */
339 + private function getObjectContent(string $objectType, string $parameterName)
208 340 {
209 - return $this->getObjectParameter($objectType, $parameterName)?->getValue() ?? '';
341 + $parameter = $this->getObjectParameter($objectType, $parameterName);
342 + return ($parameter !== null) ? $parameter->getValue() : '';
210 343 }
211 344
345 + /**
346 + * @param string $postType
347 + * @return bool
348 + */
212 349 public function hidePostType(string $postType): bool
213 350 {
214 351 return $this->hideObject($postType, 'hide_%s');
215 352 }
216 353
354 + /**
355 + * @param string $postType
356 + * @return bool
357 + */
217 358 public function hidePostTypeTitle(string $postType): bool
218 359 {
219 360 return $this->hideObject($postType, 'hide_%s_title');
220 361 }
221 362
363 + /**
364 + * @param string $postType
365 + * @return bool
366 + */
222 367 public function hidePostTypeComments(string $postType): bool
223 368 {
224 369 return $this->hideObject($postType, 'hide_%s_comment');
225 370 }
226 371
372 + /**
373 + * @param string $postType
374 + * @return bool
375 + */
227 376 public function lockPostTypeComments(string $postType): bool
228 377 {
229 378 return $this->hideObject($postType, '%s_comments_locked');
230 379 }
231 380
381 + /**
382 + * @param string $postType
383 + * @return string
384 + */
232 385 public function getPostTypeTitle(string $postType): string
233 386 {
234 387 return $this->getObjectContent($postType, '%s_title');
235 388 }
236 389
390 + /**
391 + * @param string $postType
392 + * @return string
393 + */
237 394 public function getPostTypeContent(string $postType): string
238 395 {
239 396 return $this->getObjectContent($postType, '%s_content');
240 397 }
241 398
399 + /**
400 + * @param string $postType
401 + * @return string
402 + */
242 403 public function getPostTypeCommentContent(string $postType): string
243 404 {
244 405 return $this->getObjectContent($postType, '%s_comment_content');
245 406 }
246 407
247 - public function showPostTypeContentBeforeMore(string $postType): bool
408 + /**
409 + * @param string $postType
410 + * @return bool
411 + */
412 + public function showPostTypeContentBeforeMore(string $postType)
248 413 {
249 414 return (bool) $this->getObjectContent($postType, 'show_%s_content_before_more');
250 415 }
251 416
417 + /**
418 + * @return string
419 + */
252 420 public function getRedirect(): ?string
253 421 {
254 422 return $this->getParameterValue('redirect');
255 423 }
256 424
425 + /**
426 + * @return string
427 + */
257 428 public function getRedirectCustomPage(): ?string
258 429 {
259 430 return $this->getParameterValue('redirect_custom_page');
260 431 }
261 432
433 + /**
434 + * @return string
435 + */
262 436 public function getRedirectCustomUrl(): ?string
263 437 {
264 438 return $this->getParameterValue('redirect_custom_url');
265 439 }
266 440
267 - public function appendRedirectToParameter(): bool
268 - {
269 - return (bool) $this->getParameterValue('append_redirect_to_parameter');
270 - }
271 -
441 + /**
442 + * @return bool
443 + */
272 444 public function lockRecursive(): bool
273 445 {
274 446 return (bool) $this->getParameterValue('lock_recursive');
275 447 }
276 448
449 + /**
450 + * @return bool
451 + */
277 452 public function authorsHasAccessToOwn(): bool
278 453 {
279 454 return (bool) $this->getParameterValue('authors_has_access_to_own');
280 455 }
281 456
457 + /**
458 + * @return bool
459 + */
282 460 public function authorsCanAddPostsToGroups(): bool
283 461 {
284 462 return (bool) $this->getParameterValue('authors_can_add_posts_to_groups');
285 463 }
286 464
465 + /**
466 + * @return bool
467 + */
287 468 public function lockFile(): bool
288 469 {
289 470 return (bool) $this->getParameterValue('lock_file');
290 471 }
291 472
473 + /**
474 + * @return string
475 + */
292 476 public function getInlineFiles(): ?string
293 477 {
294 478 return $this->getParameterValue('inline_files');
295 479 }
296 480
481 + /**
482 + * @return string
483 + */
297 484 public function getNoAccessImageType(): ?string
298 485 {
299 486 return $this->getParameterValue('no_access_image_type');
300 487 }
301 488
489 + /**
490 + * @return string
491 + */
302 492 public function getCustomNoAccessImage(): ?string
303 493 {
304 494 return $this->getParameterValue('custom_no_access_image');
305 495 }
306 496
497 + /**
498 + * @return bool
499 + */
307 500 public function useCustomFileHandlingFile(): bool
308 501 {
309 502 return (bool) $this->getParameterValue('use_custom_file_handling_file');
310 503 }
311 504
505 + /**
506 + * @return string
507 + */
312 508 public function getLockedDirectoryType(): ?string
313 509 {
314 510 return $this->getParameterValue('locked_directory_type');
315 511 }
316 512
513 + /**
514 + * @return string
515 + */
317 516 public function getCustomLockedDirectories(): ?string
318 517 {
319 518 return $this->getParameterValue('custom_locked_directories');
320 519 }
321 520
521 + /**
522 + * @return string
523 + */
322 524 public function getFilePassType(): ?string
323 525 {
324 526 return $this->getParameterValue('file_pass_type');
325 527 }
326 528
529 + /**
530 + * @return string
531 + */
327 532 public function getDownloadType(): ?string
328 533 {
329 534 return $this->getParameterValue('download_type');
330 535 }
331 536
537 + /**
538 + * @return string
539 + */
332 540 public function getLockedFileType(): ?string
333 541 {
334 542 return $this->getParameterValue('lock_file_types');
335 543 }
336 544
545 + /**
546 + * @return string
547 + */
337 548 public function getLockedFiles(): ?string
338 549 {
339 550 return $this->getParameterValue('locked_file_types');
340 551 }
341 552
553 + /**
554 + * @return string
555 + */
342 556 public function getNotLockedFiles(): ?string
343 557 {
344 558 return $this->getParameterValue('not_locked_file_types');
345 559 }
346 560
561 + /**
562 + * @return bool
563 + */
347 564 public function blogAdminHint(): bool
348 565 {
349 566 return (bool) $this->getParameterValue('blog_admin_hint');
350 567 }
351 568
569 + /**
570 + * @return string
571 + */
352 572 public function getBlogAdminHintText(): ?string
353 573 {
354 574 return $this->getParameterValue('blog_admin_hint_text');
355 575 }
356 576
577 + /**
578 + * @return bool
579 + */
357 580 public function showAssignedGroups(): bool
358 581 {
359 582 return (bool) $this->getParameterValue('show_assigned_groups');
360 583 }
361 584
585 + /**
586 + * @return bool
587 + */
362 588 public function hideEditLinkOnNoAccess(): bool
363 589 {
364 590 return (bool) $this->getParameterValue('hide_edit_link_on_no_access');
365 591 }
366 592
593 + /**
594 + * @param string $taxonomy
595 + * @return bool
596 + */
367 597 public function hideEmptyTaxonomy(string $taxonomy): bool
368 598 {
369 - return $this->getObjectParameter($taxonomy, 'hide_empty_%s')?->getValue() ?? false;
599 + $parameter = $this->getObjectParameter($taxonomy, 'hide_empty_%s');
600 + return ($parameter !== null) ? $parameter->getValue() : false;
370 601 }
371 602
603 + /**
604 + * @return bool
605 + */
372 606 public function protectFeed(): bool
373 607 {
374 608 return (bool) $this->getParameterValue('protect_feed');
375 609 }
376 610
611 + /**
612 + * @return string
613 + */
377 614 public function getFullAccessRole(): ?string
378 615 {
379 616 return $this->getParameterValue('full_access_role');
380 617 }
381 618
619 + /**
620 + * @return null|string
621 + */
382 622 public function getActiveCacheProvider(): ?string
383 623 {
384 624 return $this->getParameterValue('active_cache_provider');
385 - }
386 -
387 - public function getExtraIpHeader(): ?string
388 - {
389 - return $this->getParameterValue('extra_ip_header');
390 625 }
391 626 }