You are here

ViewsMegarowConfig.php in Views Megarow 8

File

src/Form/ViewsMegarowConfig.php
View source
<?php

namespace Drupal\views_megarow\Form;

use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;

//class ViewsMegarowConfig extends ConfigFormBase {

//  public function getFormId() {
//    return 'views_megarow_settings';
//  }
//  public function buildForm(array $form, FormStateInterface $form_state) {
//    $config = \Drupal::config('views_megarow.settings');
//    $form['views_megarow_title'] = array(
//      '#type' => 'textfield',
//      '#title' => t('Megarow title'),
//      '#description' => t('Title of the megarow displayed on top of the content.'),
//      '#size' => 30,
//      '#default_value' => $config->get('title'),
//    );
//    $form['views_megarow_override'] = array(
//      '#type' => 'fieldset',
//      '#collapsible' => TRUE,
//      '#title' => t('Override settings'),
//    );
//    $form['views_megarow_override']['description'] = array(
//      '#markup' => t('<p>Disabling these overrides will allow other modules to override the menu paths. <br /> This is useful if you want some paths to be overriden by panels for instance.</p>')
//    );
//    $form['views_megarow_override']['views_megarow_override_node_edit'] = array(
//      '#type' => 'radios',
//      '#title' => t('Override the node edit form with Views Megarow'),
//      '#default_value' => $config->get('override_node_edit'),
//      '#options' => array(t('Disable'), t('Enable')),
//      '#description' => t('Allows Views Megarow to override the path node/%node/edit.'),
//    );
//    $form['views_megarow_override']['views_megarow_override_user_edit'] = array(
//      '#type' => 'radios',
//      '#title' => t('Override the user edit form with Views Megarow'),
//      '#default_value' => $config->get('override_user_edit'),
//      '#options' => array(t('Disable'), t('Enable')),
//      '#description' => t('Allows Views Megarow to override the path user/%user/edit.'),
//    );
//    return parent::buildForm($form, $form_state);
//  }
//
//  public function submitForm(array &$form, FormStateInterface $form_state) {

////    // Rebuild the menu cache in order to take into account the new configuration.

////    variable_set('menu_rebuild_needed', TRUE);

//    $data = array('title' => $form_state['values']['views_megarow_title'], 'override_node_edit' => $form_state['values']['views_megarow_override_node_edit'], 'override_user_edit' => $form_state['values']['views_megarow_override_user_edit']);
//    \Drupal::config('views_megarow.settings')->setData($data)->save();
//    parent::submitForm($form, $form_state);
//  }

//}