Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC Document new AdminController #598

Merged

Conversation

GuySartorelli
Copy link
Member

Mostly reflects the changes in silverstripe/silverstripe-admin#1836

There's a few minor improvements dotted in (adding backticks around code references, etc)

Issue

@GuySartorelli
Copy link
Member Author

Lint failure is unrelated

We'll now add an `Extension` subclass to `LeftAndMain`, which is the main CMS controller.
We'll now add an `Extension` subclass to `LeftAndMain`, which is the main CMS UI controller.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AdminController is the main CMS controller, but LeftAndMain is still the main CMS UI controller which is what this section is talking about.

Comment on lines -512 to +524
You can change the level of entropy required by passing one of the valid [minScore values](https://symfony.com/doc/current/reference/constraints/PasswordStrength.html#minscore) into [`api:SilverStripe\Forms\ConfirmedPasswordField::setMinPasswordStrength()`](ConfirmedPasswordField::setMinPasswordStrength()).
You can change the level of entropy required by passing one of the valid [minScore values](https://symfony.com/doc/current/reference/constraints/PasswordStrength.html#minscore) into [`ConfirmedPasswordField::setMinPasswordStrength()`](api:SilverStripe\Forms\ConfirmedPasswordField::setMinPasswordStrength()).
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated - link syntax was the wrong way around.


[`LeftAndMain`](api:SilverStripe\Admin\LeftAndMain) has historically been the superclass for all controllers routed in `/admin/*` (i.e. all controllers used in the CMS). That class includes a lot of boilerplate functionality for setting up a menu, edit form, etc which a lot of controllers don't need.

A new [`AdminController`](api:SilverStripe\Admin\AdminController) has been created which provides the `/admin/*` routing functionality and permission checks that `LeftAndMain` used to be responsible for. If you have a controller which needs to be routed through `/admin/*` with the relevant CMS permission checks, but which does *not* need a menu item on the left or an edit form, you should update that class to be a subclass of `AdminController` instead.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm over-simplifying here - no need to mention that AdminRootController does the actual routing part, I think.


[`LeftAndMain`](api:SilverStripe\Admin\LeftAndMain) has historically been the superclass for all controllers routed in `/admin/*` (i.e. all controllers used in the CMS). That class includes a lot of boilerplate functionality for setting up a menu, edit form, etc which a lot of controllers don't need.

A new [`AdminController`](api:SilverStripe\Admin\AdminController) has been created which provides the `/admin/*` routing functionality and permission checks that `LeftAndMain` used to be responsible for. If you have a controller which needs to be routed through `/admin/*` with the relevant CMS permission checks, but which does *not* need a menu item on the left or an edit form, you should update that class to be a subclass of `AdminController` instead.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also not mentioning anything about formschema here because there's a follow-up card which will change where that code lives and I don't want to write a bunch of doc and then change it immediately afterward.

@emteknetnz emteknetnz merged commit ca51cdf into silverstripe:6 Oct 20, 2024
2 of 3 checks passed
@emteknetnz emteknetnz deleted the pulls/6/new-admincontroller branch October 20, 2024 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants