diff --git a/src/Plugin/views/style/Accordion.php b/src/Plugin/views/style/Accordion.php index d5562abd060c8793b81e70e6bee39ccf37c2bbab..2ca6ee223abf391f61f5d22661cedf6592fc1921 100644 --- a/src/Plugin/views/style/Accordion.php +++ b/src/Plugin/views/style/Accordion.php @@ -69,7 +69,8 @@ class Accordion extends DefaultStyle { '#type' => 'textfield', '#title' => t('Row Class'), '#description' => t('For Accordion, make sure you have set carousel-cern-item as one of the row classes'), - '#default_value' => (!empty($this->options['row_class'])) ? $this->options['row_class'] : 'carousel-cern-item', + '#default_value' => 'carousel-cern-item', + '#disabled' => true, ); // Option to set a color for the accordion title diff --git a/src/Plugin/views/style/CardGrid.php b/src/Plugin/views/style/CardGrid.php index 1a67ae704c36e39f142089482ce5d884acc3fdfe..5614e9c6408d23c00f2e195b90b0580aaf2cfd55 100644 --- a/src/Plugin/views/style/CardGrid.php +++ b/src/Plugin/views/style/CardGrid.php @@ -51,5 +51,25 @@ class CardGrid extends DefaultStyle { */ protected $usesgrouping = true; + /** + * Overrides the options form of Card Grid + * + * @param $form + * @param FormStateInterface $form_state + */ + public function buildOptionsForm(&$form, FormStateInterface $form_state) { + parent::buildOptionsForm($form, $form_state); -} \ No newline at end of file + $form['row_class'] = array( + '#type' => 'textfield', + '#title' => t('Row Class'), + '#description' => t(''), + '#default_value' => '', + '#disabled' => true, + ); + + } + + + + } \ No newline at end of file diff --git a/src/Plugin/views/style/Collision.php b/src/Plugin/views/style/Collision.php index 80444420c8af8529a5ad440a257fc8168d95a865..a9f6a7a00493066c43d0fbc83bd2dc2bbcec286e 100644 --- a/src/Plugin/views/style/Collision.php +++ b/src/Plugin/views/style/Collision.php @@ -33,23 +33,24 @@ class Collision extends DefaultStyle { */ protected function defineOptions(){ $options = parent::defineOptions(); - $options['row_class'] = array('default'=> 'events-collision-row') ; + $options['row_class'] = array('default'=> 'events-collision-row'); return $options; } /** - * Overrides the options form of HB + * Overrides the options form of Collision display format * * @param $form * @param FormStateInterface $form_state */ - public function buildOptionsForm(&$form, FormStateInterface $form_state) { + public function buildOptionsForm(&$form, FormStateInterface $form_state){ parent::buildOptionsForm($form, $form_state); $form['row_class'] = array( '#type' => 'textfield', '#title' => t('Row Class'), - '#default_value' => (!empty($this->options['row_class'])) ? $this->options['row_class'] : 'events-collision-row', + '#default_value' => 'events-collision-row', + '#disabled' => true, ); } diff --git a/src/Plugin/views/style/Countdown.php b/src/Plugin/views/style/Countdown.php index 5159e6d0fd9f54d96e451d7b48df02d8e91cf05c..307f363b3bb01f535e0f0d4ee5ff605cceb641a3 100644 --- a/src/Plugin/views/style/Countdown.php +++ b/src/Plugin/views/style/Countdown.php @@ -3,7 +3,7 @@ namespace Drupal\cern_display_formats\Plugin\views\style; - +use Drupal\core\form\FormStateInterface; use Drupal\views\Plugin\views\style\DefaultStyle; /** @@ -24,6 +24,11 @@ class Countdown extends DefaultStyle { protected $usesoptions = true; + protected $usesRowPlugin = true; + + //the format should not use row classes + protected $usesRowClass = true; + /** * Defines the initial options for Countdown format @@ -32,8 +37,18 @@ class Countdown extends DefaultStyle { */ protected function defineOptions(){ $options = parent::defineOptions(); + $options['row_class'] = array('default'=> ''); return $options; } + public function buildOptionsForm(&$form, FormStateInterface $form_state){ + parent::buildOptionsForm($form, $form_state); + $form['row_class'] = array( + '#type' => 'textfield', + '#title' => t('Row Class'), + '#default_value' => '', + '#disabled' => true, + ); + } } \ No newline at end of file diff --git a/src/Plugin/views/style/EventGrid.php b/src/Plugin/views/style/EventGrid.php index af00f81710502c1e99454e81c1fce60f8af470bb..e6a98344da7b3215d814241ade63c3d626acfbd1 100644 --- a/src/Plugin/views/style/EventGrid.php +++ b/src/Plugin/views/style/EventGrid.php @@ -34,5 +34,21 @@ class EventGrid extends DefaultStyle { protected $renderFields = true; - + /** + * Overrides the options form of Event Grid + * + * @param $form + * @param FormStateInterface $form_state + */ + public function buildOptionsForm(&$form, FormStateInterface $form_state) { + parent::buildOptionsForm($form, $form_state); + + $form['row_class'] = array( + '#type' => 'textfield', + '#title' => t('Row Class'), + '#description' => t(''), + '#default_value' => '', + '#disabled' => true, + ); + } } \ No newline at end of file diff --git a/src/Plugin/views/style/FeaturedBanner.php b/src/Plugin/views/style/FeaturedBanner.php index 32f830325c1f0f532b54bb8149e28fdf6c79b047..ebf804bde7ce34a91bed69ff2fe0954527adfe2d 100644 --- a/src/Plugin/views/style/FeaturedBanner.php +++ b/src/Plugin/views/style/FeaturedBanner.php @@ -5,6 +5,7 @@ namespace Drupal\cern_display_formats\Plugin\views\style; use Drupal\views\Plugin\views\style\DefaultStyle; +use Drupal\core\form\FormStateInterface; /** * Implements the Featured Banner display format @@ -22,8 +23,12 @@ use Drupal\views\Plugin\views\style\DefaultStyle; */ class FeaturedBanner extends DefaultStyle { + protected $usesoptions = true; + protected $usesRowPlugin = true; + + protected $usesRowClass = true; /** * Defines the initial options for the Featured Banner format @@ -35,5 +40,23 @@ class FeaturedBanner extends DefaultStyle { return $options; } + /** + * Overrides the options form of Featured Banner + * + * @param $form + * @param FormStateInterface $form_state + */ + public function buildOptionsForm(&$form, FormStateInterface $form_state) { + parent::buildOptionsForm($form, $form_state); + + $form['row_class'] = array( + '#type' => 'textfield', + '#title' => t('Row Class'), + '#description' => t(''), + '#default_value' => '', + '#disabled' => true, + ); + } + } \ No newline at end of file diff --git a/src/Plugin/views/style/HorizontalBoxes.php b/src/Plugin/views/style/HorizontalBoxes.php index afb842e603f768514a9f5b4f2a683a18a11bdb03..ab74973a6e3046df3e0e698247d08f70aefc29d9 100755 --- a/src/Plugin/views/style/HorizontalBoxes.php +++ b/src/Plugin/views/style/HorizontalBoxes.php @@ -59,7 +59,8 @@ class HorizontalBoxes extends DefaultStyle '#type' => 'textfield', '#title' => t('Row Class'), '#description' => t('For Horizontal Boxes, make sure you have set horizontal-boxes-row as one of the row classes'), - '#default_value' => (!empty($this->options['row_class'])) ? $this->options['row_class'] : 'horizontal-boxes-row', + '#default_value' => 'horizontal-boxes-row', + '#disabled' => true, ); } diff --git a/src/Plugin/views/style/TeaserList.php b/src/Plugin/views/style/TeaserList.php index f9594e4ab2c4e19d078f42476f7366ecf5ad079f..47fa4df767d4f7ba7c0f70b9370587b7e82c0f6d 100644 --- a/src/Plugin/views/style/TeaserList.php +++ b/src/Plugin/views/style/TeaserList.php @@ -39,6 +39,7 @@ class TeaserList extends DefaultStyle $options = parent::defineOptions(); $options['title_color'] = array('default'=> '#2574b9') ; $options['title_color_card'] = array('default' => '#FFFFFF'); + $options['row_class'] = array('default' => ''); return $options; } @@ -51,6 +52,14 @@ class TeaserList extends DefaultStyle public function buildOptionsForm(&$form, FormStateInterface $form_state) { parent::buildOptionsForm($form, $form_state); + $form['row_class'] = array( + '#type' => 'textfield', + '#title' => t('Row Class'), + '#description' => t(''), + '#default_value' => '', + '#disabled' => true, + ); + // Option to set a color for the teaser list title $form['title_color'] = array( '#type' => 'color', diff --git a/src/Plugin/views/style/VerticalBoxes.php b/src/Plugin/views/style/VerticalBoxes.php index 2ca695fb37eaa9ac71e2aed8400a4a82393bf171..357a42b3e54c10418c05388a2b4d3b068b30dedf 100644 --- a/src/Plugin/views/style/VerticalBoxes.php +++ b/src/Plugin/views/style/VerticalBoxes.php @@ -22,11 +22,20 @@ use Drupal\views\Plugin\views\style\DefaultStyle; */ class VerticalBoxes extends DefaultStyle { + /** + * {@inheritdoc} + */ + protected $usesRowPlugin = true; + + protected $usesRowClass = false; + protected $usesoptions = true; + protected $renderFields = true; + /** - * Defines the initial options for Countdown format + * Defines the initial options for Vertical Boxes format * * @return mixed */ @@ -35,5 +44,23 @@ class VerticalBoxes extends DefaultStyle { return $options; } + /** + * Overrides the options form of Vertical Boxes + * + * @param $form + * @param FormStateInterface $form_state + */ + public function buildOptionsForm(&$form, FormStateInterface $form_state) { + parent::buildOptionsForm($form, $form_state); + + $form['row_class'] = array( + '#type' => 'textfield', + '#title' => t('Row Class'), + '#description' => t(''), + '#default_value' => '', + '#disabled' => true, + ); + } + } \ No newline at end of file