Skip to content
Snippets Groups Projects

coding standards issues

6 files
+ 17
16
Compare changes
  • Side-by-side
  • Inline

Files

@@ -6,9 +6,10 @@ use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;
/**
* Class CollapsiblockGlobalSettings.
* Defines CollapsiblockGlobalSettings class.
*
* @package Drupal\collapsiblock\Form.
* Defines the form
*/
class CollapsiblockGlobalSettings extends ConfigFormBase {
@@ -36,21 +37,21 @@ class CollapsiblockGlobalSettings extends ConfigFormBase {
$form['default_action'] = [
'#type' => 'radios',
'#title' => t('Default block collapse behavior'),
'#options' => unserialize(COLLAPSIBLOCK_ACTION_OPTIONS),
'#title' => $this->t('Default block collapse behavior'),
'#options' => json_encode(COLLAPSIBLOCK_ACTION_OPTIONS),
'#default_value' => $config->get('default_action'),
];
$form['active_pages'] = [
'#type' => 'checkbox',
'#title' => t('Remember collapsed state on active pages'),
'#title' => $this->t('Remember collapsed state on active pages'),
'#default_value' => $config->get('active_pages'),
'#description' => t('Block can collapse even if it contains an active link (such as in menu blocks).'),
'#description' => $this->t('Block can collapse even if it contains an active link (such as in menu blocks).'),
];
$form['slide_type'] = [
'#type' => 'radios',
'#title' => t('Default animation type'),
'#options' => [1 => t('Slide'), 2 => t('Fade and slide')],
'#description' => t('Slide is the Drupal default while Fade and slide adds a nice fade effect.'),
'#title' => $this->t('Default animation type'),
'#options' => [1 => $this->t('Slide'), 2 => $this->t('Fade and slide')],
'#description' => $this->t('Slide is the Drupal default while Fade and slide adds a nice fade effect.'),
'#default_value' => $config->get('slide_type'),
];
$options = [
@@ -66,9 +67,9 @@ class CollapsiblockGlobalSettings extends ConfigFormBase {
];
$form['slide_speed'] = [
'#type' => 'select',
'#title' => t('Animation speed'),
'#title' => $this->t('Animation speed'),
'#options' => array_combine($options, $options),
'#description' => t('The animation speed in milliseconds.'),
'#description' => $this->t('The animation speed in milliseconds.'),
'#default_value' => $config->get('slide_speed'),
];
Loading