-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This class will handle configuration for sonata which is currently holded by Pool class. It adds a globaly twig "sonata_configuration" variable in order to replace the current "sonata_admin" variable which all its methods are deprecated.
- Loading branch information
Showing
23 changed files
with
501 additions
and
34 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
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,105 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the Sonata Project package. | ||
* | ||
* (c) Thomas Rabaix <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Sonata\AdminBundle\Admin; | ||
|
||
final class SonataConfiguration | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
private $title; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private $logo; | ||
|
||
/** | ||
* @var array | ||
* @phpstan-param array{ | ||
* html5_validate: bool, | ||
* sort_admins: bool, | ||
* confirm_exit: bool, | ||
* js_debug: bool, | ||
* skin: string, | ||
* use_select2: bool, | ||
* use_icheck: bool, | ||
* use_bootlint: bool, | ||
* use_stickyforms: bool, | ||
* pager_links: ?int, | ||
* form_type: string, | ||
* default_group: string, | ||
* default_label_catalogue: string, | ||
* default_icon: string, | ||
* dropdown_number_groups_per_colums: int, | ||
* title_mode: 'single_text'|'single_image'|'both', | ||
* lock_protection: bool, | ||
* mosaic_background: string, | ||
* lock_protection: bool, | ||
* legacy_twig_text_extension: bool, | ||
* } $options | ||
*/ | ||
private $options; | ||
|
||
/** | ||
* @phpstan-param array{ | ||
* html5_validate: bool, | ||
* sort_admins: bool, | ||
* confirm_exit: bool, | ||
* js_debug: bool, | ||
* skin: string, | ||
* use_select2: bool, | ||
* use_icheck: bool, | ||
* use_bootlint: bool, | ||
* use_stickyforms: bool, | ||
* pager_links: ?int, | ||
* form_type: string, | ||
* default_group: string, | ||
* default_label_catalogue: string, | ||
* default_icon: string, | ||
* dropdown_number_groups_per_colums: int, | ||
* title_mode: 'single_text'|'single_image'|'both', | ||
* lock_protection: bool, | ||
* mosaic_background: string, | ||
* lock_protection: bool, | ||
* legacy_twig_text_extension: bool, | ||
* } $options | ||
*/ | ||
public function __construct(string $title, string $logo, array $options) | ||
{ | ||
$this->title = $title; | ||
$this->logo = $logo; | ||
$this->options = $options; | ||
} | ||
|
||
public function getTitle(): string | ||
{ | ||
return $this->title; | ||
} | ||
|
||
public function getLogo(): string | ||
{ | ||
return $this->logo; | ||
} | ||
|
||
/** | ||
* @param mixed $default | ||
* | ||
* @return mixed | ||
*/ | ||
public function getOption(string $name, $default = null) | ||
{ | ||
return $this->options[$name] ?? $default; | ||
} | ||
} |
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
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
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
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
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
Oops, something went wrong.