Chris@2: getValues();
Chris@2: $theme_name = \Drupal::theme()->getActiveTheme()->getName();
Chris@2:
Chris@2: // Validate our form #state required fields, #states are UI only.
Chris@2: // Bigscreen
Chris@2: if (empty($values['bigscreen_sidebar_first'])) {
Chris@2: form_set_error('bigscreen_sidebar_first', t('Standard Layout First sidebar width is empty - you must enter a value.'));
Chris@2: }
Chris@2: if (empty($values['bigscreen_sidebar_second'])) {
Chris@2: form_set_error('bigscreen_sidebar_second', t('Standard Layout Second sidebar width is empty - you must enter a value.'));
Chris@2: }
Chris@2:
Chris@2: // Tablet
Chris@2: if (empty($values['tablet_landscape_sidebar_first'])) {
Chris@2: form_set_error('tablet_landscape_sidebar_first', t('Tablet Landscape First sidebar width is empty - you must enter a value.'));
Chris@2: }
Chris@2: if ($values['tablet_landscape_layout'] === 'three_col_grail' || $values['tablet_landscape_layout'] === 'two_sidebars_left' || $values['tablet_landscape_layout'] === 'two_sidebars_right') {
Chris@2: if (empty($values['tablet_landscape_sidebar_second'])) {
Chris@2: form_set_error('tablet_landscape_sidebar_second', t('Tablet Landscape First sidebar width is empty - you must enter a value. The layout you selected requires values for both sidebars.'));
Chris@2: }
Chris@2: }
Chris@2:
Chris@2: // Smalltouch
Chris@2: if ($values['smalltouch_landscape_layout'] === 'one_col_vert') {
Chris@2: if (empty($values['smalltouch_landscape_sidebar_first'])) {
Chris@2: form_set_error('smalltouch_landscape_sidebar_first', t('Smalltouch First Sidebar width is empty - enter a value or choose another layout.'));
Chris@2: }
Chris@2: if (empty($values['smalltouch_landscape_sidebar_second'])) {
Chris@2: form_set_error('smalltouch_landscape_sidebar_second', t('Smalltouch Second Sidebar width is empty - enter a value or choose another layout.'));
Chris@2: }
Chris@2: }
Chris@2: }