X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Foutside_in%2Fsrc%2FBlock%2FBlockEntityOffCanvasForm.php;fp=web%2Fcore%2Fmodules%2Foutside_in%2Fsrc%2FBlock%2FBlockEntityOffCanvasForm.php;h=0000000000000000000000000000000000000000;hp=f97f79ae05e51fb89129a283b5758de7281cb8e7;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/web/core/modules/outside_in/src/Block/BlockEntityOffCanvasForm.php b/web/core/modules/outside_in/src/Block/BlockEntityOffCanvasForm.php deleted file mode 100644 index f97f79ae0..000000000 --- a/web/core/modules/outside_in/src/Block/BlockEntityOffCanvasForm.php +++ /dev/null @@ -1,112 +0,0 @@ - once - // https://www.drupal.org/node/2359901 is fixed. - return $this->t('Configure @block', ['@block' => $block->getPlugin()->getPluginDefinition()['admin_label']]); - } - - /** - * {@inheritdoc} - */ - public function form(array $form, FormStateInterface $form_state) { - $form = parent::form($form, $form_state); - - // Create link to full block form. - $query = []; - if ($destination = $this->getRequest()->query->get('destination')) { - $query['destination'] = $destination; - } - $form['advanced_link'] = [ - '#type' => 'link', - '#title' => $this->t('Advanced block options'), - '#url' => $this->entity->toUrl('edit-form', ['query' => $query]), - '#weight' => 1000, - ]; - - // Remove the ID and region elements. - unset($form['id'], $form['region'], $form['settings']['admin_label']); - - if (isset($form['settings']['label_display']) && isset($form['settings']['label'])) { - // Only show the label input if the label will be shown on the page. - $form['settings']['label_display']['#weight'] = -100; - $form['settings']['label']['#states']['visible'] = [ - ':input[name="settings[label_display]"]' => ['checked' => TRUE], - ]; - - // Relabel to "Block title" because on the front-end this may be confused - // with page title. - $form['settings']['label']['#title'] = $this->t("Block title"); - $form['settings']['label_display']['#title'] = $this->t("Display block title"); - } - return $form; - } - - /** - * {@inheritdoc} - */ - protected function actions(array $form, FormStateInterface $form_state) { - $actions = parent::actions($form, $form_state); - $actions['submit']['#value'] = $this->t('Save @block', ['@block' => $this->entity->getPlugin()->getPluginDefinition()['admin_label']]); - $actions['delete']['#access'] = FALSE; - return $actions; - } - - /** - * {@inheritdoc} - */ - protected function buildVisibilityInterface(array $form, FormStateInterface $form_state) { - // Do not display the visibility. - return []; - } - - /** - * {@inheritdoc} - */ - protected function validateVisibility(array $form, FormStateInterface $form_state) { - // Intentionally empty. - } - - /** - * {@inheritdoc} - */ - protected function submitVisibility(array $form, FormStateInterface $form_state) { - // Intentionally empty. - } - - /** - * {@inheritdoc} - */ - protected function getPluginForm(BlockPluginInterface $block) { - if ($block instanceof PluginWithFormsInterface) { - return $this->pluginFormFactory->createInstance($block, 'off_canvas', 'configure'); - } - return $block; - } - -}