diff --git a/amp.module b/amp.module index 10fe31d..9999c4d 100644 --- a/amp.module +++ b/amp.module @@ -354,36 +354,6 @@ function amp_node_form_submit_with_warn(&$form, FormStateInterface $form_state) } /** -* Implements hook_form_BASE_FORM_ID_alter(). -*/ -function amp_form_node_type_edit_form_alter(&$form, FormStateInterface $form_state, $form_id) { - $enabled = node_type_get_names(); - $node_type = $form['type']['#default_value']; - - $form['workflow']['amp'] = array( - '#type' => 'select', - '#title' => t('Enable AMP pages for this content type'), - '#options' => array( - 0 => t('No'), - 1 => t('Yes'), - ), - '#default_value' => !empty($enabled[$node_type]) ? 1 : 0, - ); - - $form['actions']['submit']['#submit'][] = 'amp_node_settings_submit'; -} - -function amp_node_settings_submit(&$form, FormStateInterface $form_state) { - $amp_enabled = $form_state->getValue('amp'); - $content_type = $form['type']['#default_value']; - $config = \Drupal::service('config.factory')->getEditable('amp.settings'); - // Like on the configuration screen, use the content type for the value - // if it is set to true. - $config->set('node_types.' . $content_type, !empty($amp_enabled) ? $content_type : 0); - $config->save(); -} - -/** * Implements hook_form_alter(). */ function amp_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {