lekoala /
silverstripe-admini
| 1 | <?php |
||
| 2 | |||
| 3 | namespace LeKoala\Admini\Subsites; |
||
| 4 | |||
| 5 | use LeKoala\Admini\ModelAdmin; |
||
| 6 | use LeKoala\Admini\MaterialIcons; |
||
| 7 | use SilverStripe\Subsites\Model\Subsite; |
||
|
0 ignored issues
–
show
|
|||
| 8 | use SilverStripe\Subsites\State\SubsiteState; |
||
|
0 ignored issues
–
show
The type
SilverStripe\Subsites\State\SubsiteState was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 9 | |||
| 10 | /** |
||
| 11 | * Admin interface to manage and create {@link Subsite} instances. |
||
| 12 | * |
||
| 13 | * @package subsites |
||
| 14 | */ |
||
| 15 | class SubsiteAdmin extends ModelAdmin |
||
| 16 | { |
||
| 17 | private static $managed_models = [Subsite::class]; |
||
|
0 ignored issues
–
show
|
|||
| 18 | |||
| 19 | private static $url_segment = 'subsites'; |
||
| 20 | |||
| 21 | private static $menu_title = 'Subsites'; |
||
| 22 | |||
| 23 | private static $menu_icon = MaterialIcons::ACCOUNT_TREE; |
||
|
0 ignored issues
–
show
|
|||
| 24 | |||
| 25 | public $showImportForm = false; |
||
| 26 | |||
| 27 | private static $tree_class = Subsite::class; |
||
| 28 | |||
| 29 | private static $required_permission_codes = "CMS_ACCESS_SilverStripe\Subsites\Admin\SubsiteAdmin"; // inherit SS permissions |
||
| 30 | |||
| 31 | public function canView($member = null) |
||
| 32 | { |
||
| 33 | if (!class_exists(SubsiteState::class)) { |
||
| 34 | return false; |
||
| 35 | } |
||
| 36 | return parent::canView($member); |
||
| 37 | } |
||
| 38 | |||
| 39 | public function getEditForm($id = null, $fields = null) |
||
| 40 | { |
||
| 41 | $form = parent::getEditForm($id, $fields); |
||
| 42 | |||
| 43 | $grid = $form->Fields()->dataFieldByName(str_replace('\\', '-', Subsite::class)); |
||
| 44 | if ($grid) { |
||
| 45 | $grid->setItemRequestClass(TabulatorSubsiteDetailFormItemRequest::class); |
||
| 46 | } |
||
| 47 | |||
| 48 | return $form; |
||
| 49 | } |
||
| 50 | } |
||
| 51 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths