Commit 0590fb05 authored by Pavan B S's avatar Pavan B S Committed by Dom.

Issue #2882034 by Pavan B S, Dom.: Remove @file tag docblock from all the .php...

Issue #2882034 by Pavan B S, Dom.: Remove @file tag docblock from all the .php files. & $this->t() should be used instead of t() for Drupal 8 version
parent e3d3e1c5
......@@ -55,13 +55,14 @@ class Masonry extends StylePluginBase {
$options = parent::defineOptions();
// Get default options from Masonry.
$default_options = \Drupal::service('masonry.service')->getMasonryDefaultOptions();
$default_options = \Drupal::service('masonry.service')
->getMasonryDefaultOptions();
// Set default values for Masonry
foreach ($default_options as $option => $default_value) {
$options[$option] = array(
$options[$option] = [
'default' => $default_value,
);
];
if (is_int($default_value)) {
$options[$option]['bool'] = TRUE;
}
......@@ -77,33 +78,35 @@ class Masonry extends StylePluginBase {
parent::buildOptionsForm($form, $form_state);
// Add Masonry options to views form
$form['masonry'] = array(
$form['masonry'] = [
'#type' => 'details',
'#title' => t('Masonry'),
'#title' => $this->t('Masonry'),
'#open' => TRUE,
);
];
if (\Drupal::service('masonry.service')->isMasonryInstalled()) {
$form += \Drupal::service('masonry.service')->buildSettingsForm($this->options);
$form += \Drupal::service('masonry.service')
->buildSettingsForm($this->options);
// Display each option within the Masonry fieldset
foreach (\Drupal::service('masonry.service')->getMasonryDefaultOptions() as $option => $default_value) {
foreach (\Drupal::service('masonry.service')
->getMasonryDefaultOptions() as $option => $default_value) {
$form[$option]['#fieldset'] = 'masonry';
}
// Views doesn't use FAPI states, so set dependencies instead
$form['masonry_animated']['#dependency'] = array(
'edit-style-options-masonry-resizable' => array(1),
);
$form['masonry_animation_duration']['#dependency'] = array(
'edit-style-options-masonry-animated' => array(1),
);
$form['masonry_animated']['#dependency'] = [
'edit-style-options-masonry-resizable' => [1],
];
$form['masonry_animation_duration']['#dependency'] = [
'edit-style-options-masonry-animated' => [1],
];
}
else {
// Disable Masonry as plugin is not installed
$form['masonry_disabled'] = array(
'#markup' => t('These options have been disabled as the jQuery Masonry plugin is not installed.'),
$form['masonry_disabled'] = [
'#markup' => $this->t('These options have been disabled as the jQuery Masonry plugin is not installed.'),
'#fieldset' => 'masonry',
);
];
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment