X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fblazy%2Fsrc%2FForm%2FBlazyAdminFormatter.php;fp=web%2Fmodules%2Fcontrib%2Fblazy%2Fsrc%2FForm%2FBlazyAdminFormatter.php;h=ddb5795020be934f710a4d41260199bd1601ab6b;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/web/modules/contrib/blazy/src/Form/BlazyAdminFormatter.php b/web/modules/contrib/blazy/src/Form/BlazyAdminFormatter.php new file mode 100644 index 000000000..ddb579502 --- /dev/null +++ b/web/modules/contrib/blazy/src/Form/BlazyAdminFormatter.php @@ -0,0 +1,49 @@ +openingForm($form, $definition); + $this->imageStyleForm($form, $definition); + $this->mediaSwitchForm($form, $definition); + + if (!empty($definition['grid_form']) && !isset($form['grid'])) { + $this->gridForm($form, $definition); + + // Blazy doesn't need complex grid with multiple groups. + unset($form['preserve_keys'], $form['visible_items']); + + if (isset($form['grid'])) { + $form['grid']['#description'] = $this->t('The amount of block grid columns for large monitors 64.063em+.
Requires:
  1. Display style.
  2. A reasonable amount of contents.
Leave empty to DIY, or to not build grids.'); + } + } + + if (!empty($definition['breakpoints'])) { + $this->breakpointsForm($form, $definition); + } + + if (isset($form['responsive_image_style'])) { + $form['responsive_image_style']['#description'] = $this->t('Not compatible with below breakpoints, aspect ratio, yet. However it can still lazyload by checking Responsive image option via Blazy UI. Leave empty to disable.'); + + if ($this->blazyManager()->getModuleHandler()->moduleExists('blazy_ui')) { + $form['responsive_image_style']['#description'] .= ' ' . $this->t('Enable lazyloading Responsive image.', [':url' => Url::fromRoute('blazy.settings')->toString()]); + } + } + + $this->closingForm($form, $definition); + } + +}