/** * {@inheritdoc} */ public function buildConfigurationForm(array $form, FormStateInterface $form_state) { $form = parent::buildConfigurationForm($form, $form_state); $form['width']['#required'] = FALSE; $form['height']['#required'] = FALSE; $form['upscale'] = array('#type' => 'checkbox', '#default_value' => $this->configuration['upscale'], '#title' => t('Allow Upscaling'), '#description' => t('Let scale make images larger than their original size')); return $form; }
/** * {@inheritdoc} */ public function buildConfigurationForm(array $form, FormStateInterface $form_state) { $form = parent::buildConfigurationForm($form, $form_state); $form['anchor'] = array('#type' => 'radios', '#title' => t('Anchor'), '#options' => array('left-top' => t('Top left'), 'center-top' => t('Top center'), 'right-top' => t('Top right'), 'left-center' => t('Center left'), 'center-center' => t('Center'), 'right-center' => t('Center right'), 'left-bottom' => t('Bottom left'), 'center-bottom' => t('Bottom center'), 'right-bottom' => t('Bottom right')), '#theme' => 'image_anchor', '#default_value' => $this->configuration['anchor'], '#description' => t('The part of the image that will be retained during the crop.')); return $form; }