From 654fa5a6813a94a045c4b655d5b0f0d66d061a38 Mon Sep 17 00:00:00 2001 From: Benjamin Blake Date: Tue, 5 Jul 2022 20:11:20 -0600 Subject: [PATCH] CMSMain - Linting changes + Added Docblock + Made the linting changes requested by @GuySartorelli + Added method documentation for BatchActionParameters() --- code/Controllers/CMSMain.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/code/Controllers/CMSMain.php b/code/Controllers/CMSMain.php index 741fed45..1401ca86 100644 --- a/code/Controllers/CMSMain.php +++ b/code/Controllers/CMSMain.php @@ -2112,13 +2112,22 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr return new CMSBatchActionHandler($this, 'batchactions'); } + /** + * Returns a LiteralField containing parameter field HTML + * for batch actions + * + * Used by {@link LeftAndMain} to render batch actions in + * the BatchActionsForm + * + * @return LiteralField + */ public function BatchActionParameters() { $batchActions = $this->batchactions()->registeredActions(); $forms = []; foreach ($batchActions as $urlSegment => $batchAction) { - $SNG_action = singleton($batchAction["class"]); + $SNG_action = singleton($batchAction['class']); if ($SNG_action->canView() && $fieldList = $SNG_action->getParameterFields()) { $formHtml = ''; /** @var FormField $field */ @@ -2130,10 +2139,11 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr } $pageHtml = ''; foreach ($forms as $urlSegment => $html) { - $pageHtml .= "
$html
\n\n"; + $pageHtml .= ''; } - return new LiteralField("BatchActionParameters", ''); + return new LiteralField('BatchActionParameters', ''); } + /** * Returns a list of batch actions */