-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…ig providers
- Loading branch information
1 parent
17f7e51
commit 6549fdb
Showing
3 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (C) Ibexa AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Ibexa\AdminUi\UI\Config\Provider; | ||
|
||
use Exception; | ||
use Ibexa\Contracts\AdminUi\UI\Config\ProviderInterface; | ||
use Ibexa\Contracts\Core\Repository\UserPreferenceService; | ||
|
||
final class IsPageBuilderVisited implements ProviderInterface | ||
{ | ||
private UserPreferenceService $userPreferenceService; | ||
|
||
public function __construct(UserPreferenceService $userPreferenceService) | ||
{ | ||
$this->userPreferenceService = $userPreferenceService; | ||
} | ||
|
||
public function getConfig(): string | ||
{ | ||
try { | ||
return $this->userPreferenceService | ||
->getUserPreference('page_builder_visited') | ||
->value; | ||
} catch (Exception $e) { | ||
return 'false'; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (C) Ibexa AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Ibexa\AdminUi\UI\Config\Provider; | ||
|
||
use Ibexa\Contracts\AdminUi\UI\Config\ProviderInterface; | ||
use Ibexa\User\UserSetting\UserSettingService; | ||
|
||
final class OpenedBlockSettings implements ProviderInterface | ||
{ | ||
private UserSettingService $userSettingService; | ||
|
||
public function __construct(UserSettingService $userSettingService) | ||
{ | ||
$this->userSettingService = $userSettingService; | ||
} | ||
|
||
/** | ||
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException | ||
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException | ||
*/ | ||
public function getConfig(): string | ||
{ | ||
return $this->userSettingService | ||
->getUserSetting('block_settings') | ||
->value; | ||
} | ||
} |