Skip to content
Snippets Groups Projects
Commit f658ab7e authored by Tyler Struyk's avatar Tyler Struyk Committed by Lily Yan
Browse files

ISTWMCS-4651: Add 2 forgotten parent calls that add and save label form element

parent 71a0b85a
No related branches found
No related tags found
1 merge request!60Feature/istwcms 4651 tstruyk admin label multi column
......@@ -14,6 +14,9 @@ class Uw2ColumnLayout extends UwColumnLayoutBase {
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
// Get Parents configuration form (which by default adds the Admin Label).
$form = parent::buildConfigurationForm($form, $form_state);
// Get the config for this layout.
$configuration = $this->getConfiguration();
......@@ -25,7 +28,7 @@ class Uw2ColumnLayout extends UwColumnLayoutBase {
];
// The form element for the column widths.
$form['layout_settings']['column_class'] = [
$form['column_class'] = [
'#type' => 'select',
'#title' => $this->t('Column widths'),
'#default_value' => !empty($configuration['column_class']) ? $configuration['column_class'] : 'even-split',
......
......@@ -14,6 +14,9 @@ class Uw3ColumnLayout extends UwColumnLayoutBase {
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
// Get Parents configuration form (which by default adds the Admin Label).
$form = parent::buildConfigurationForm($form, $form_state);
// Get the config for this layout.
$configuration = $this->getConfiguration();
......@@ -28,7 +31,7 @@ class Uw3ColumnLayout extends UwColumnLayoutBase {
];
// The form element for the column widths.
$form['layout_settings']['column_class'] = [
$form['column_class'] = [
'#type' => 'select',
'#title' => $this->t('Column widths'),
'#default_value' => !empty($configuration['column_class']) ? $configuration['column_class'] : 'even-split',
......
......@@ -14,6 +14,9 @@ class Uw4ColumnLayout extends UwColumnLayoutBase {
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
// Get Parents configuration form (which by default adds the Admin Label).
$form = parent::buildConfigurationForm($form, $form_state);
// Get the config for this layout.
$configuration = $this->getConfiguration();
......@@ -28,7 +31,7 @@ class Uw4ColumnLayout extends UwColumnLayoutBase {
];
// The form element for the column widths.
$form['layout_settings']['column_class'] = [
$form['column_class'] = [
'#type' => 'select',
'#title' => $this->t('Column widths'),
'#default_value' => !empty($configuration['column_class']) ? $configuration['column_class'] : 'even-split',
......
......@@ -14,6 +14,9 @@ class Uw5ColumnLayout extends UwColumnLayoutBase {
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
// Get Parents configuration form (which by default adds the Admin Label).
$form = parent::buildConfigurationForm($form, $form_state);
// Get the config for this layout.
$configuration = $this->getConfiguration();
......@@ -29,7 +32,7 @@ class Uw5ColumnLayout extends UwColumnLayoutBase {
];
// The form element for the column widths.
$form['layout_settings']['column_class'] = [
$form['column_class'] = [
'#type' => 'select',
'#title' => $this->t('Column widths'),
'#default_value' => !empty($configuration['column_class']) ? $configuration['column_class'] : 'even-split',
......
......@@ -16,9 +16,12 @@ class UwColumnLayoutBase extends LayoutDefault implements PluginFormInterface {
*/
public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
// Call parent and let it do its thing (like set the label).
parent::submitConfigurationForm($form, $form_state);
// Set the column class in the config.
$this->configuration['column_class'] = $form_state->getValue(
['layout_settings', 'column_class'],
['column_class'],
NULL
);
}
......@@ -39,5 +42,4 @@ class UwColumnLayoutBase extends LayoutDefault implements PluginFormInterface {
return $build;
}
}
......@@ -14,6 +14,9 @@ class UwInvertedLLeftLayout extends UwColumnLayoutBase {
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
// Get Parents configuration form (which by default adds the Admin Label).
$form = parent::buildConfigurationForm($form, $form_state);
// Get the config for this layout.
$configuration = $this->getConfiguration();
......@@ -25,7 +28,7 @@ class UwInvertedLLeftLayout extends UwColumnLayoutBase {
];
// The form element for the column widths.
$form['layout_settings']['column_class'] = [
$form['column_class'] = [
'#type' => 'select',
'#title' => $this->t('Column widths for top row'),
'#default_value' => !empty($configuration['column_class']) ? $configuration['column_class'] : 'even-split',
......
......@@ -14,6 +14,9 @@ class UwInvertedLRightLayout extends UwColumnLayoutBase {
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
// Get Parents configuration form (which by default adds the Admin Label).
$form = parent::buildConfigurationForm($form, $form_state);
// Get the config for this layout.
$configuration = $this->getConfiguration();
......@@ -25,7 +28,7 @@ class UwInvertedLRightLayout extends UwColumnLayoutBase {
];
// The form element for the column widths.
$form['layout_settings']['column_class'] = [
$form['column_class'] = [
'#type' => 'select',
'#title' => $this->t('Column widths for top row'),
'#default_value' => !empty($configuration['column_class']) ? $configuration['column_class'] : 'even-split',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment