diff --git a/core/modules/forum/forum.admin.inc b/core/modules/forum/forum.admin.inc deleted file mode 100644 index b3d9bbc..0000000 --- a/core/modules/forum/forum.admin.inc +++ /dev/null @@ -1 +0,0 @@ -config = $config_factory->get('forum.settings'); + $this->forumConfig = $config_factory->get('forum.settings'); $this->entityManager = $entity_manager; } @@ -57,9 +56,7 @@ public function getFormID() { * {@inheritdoc} */ public function buildForm(array $form, array &$form_state) { - module_load_include('inc', 'taxonomy', 'taxonomy.admin'); - - $vid = $this->config->get('vocabulary'); + $vid = $this->forumConfig->get('vocabulary'); $vocabularies = $this->entityManager->getStorageController('taxonomy_vocabulary')->load(array($vid)); $vocabulary = isset($vocabularies[$vid]) ? $vocabularies[$vid] : FALSE; if (!$vocabulary) { @@ -67,22 +64,22 @@ public function buildForm(array $form, array &$form_state) { } // Build base taxonomy term overview. - $form = taxonomy_overview_terms($form, $form_state, $vocabulary); + $form = parent::buildForm($form, $form_state, $vocabulary); foreach (element_children($form) as $key) { if (isset($form[$key]['#term'])) { $term = $form[$key]['#term']; $form[$key]['view']['#href'] = 'forum/' . $term['tid']; unset($form[$key]['operations']['#links']['delete']); - if (in_array($form[$key]['#term']['tid'], $this->config->get('containers'))) { - $form[$key]['operations']['#links']['edit']['title'] = t('edit container'); + if (in_array($form[$key]['#term']['tid'], $this->forumConfig->get('containers'))) { + $form[$key]['operations']['#links']['edit']['title'] = $this->t('edit container'); $form[$key]['operations']['#links']['edit']['href'] = 'admin/structure/forum/edit/container/' . $term['tid']; // We don't want the redirect from the link so we can redirect the // delete action. unset($form[$key]['operations']['#links']['edit']['query']['destination']); } else { - $form[$key]['operations']['#links']['edit']['title'] = t('edit forum'); + $form[$key]['operations']['#links']['edit']['title'] = $this->t('edit forum'); $form[$key]['operations']['#links']['edit']['href'] = 'admin/structure/forum/edit/forum/' . $term['tid']; // We don't want the redirect from the link so we can redirect the // delete action. @@ -96,20 +93,9 @@ public function buildForm(array $form, array &$form_state) { // The form needs to have submit and validate handlers set explicitly. $form['#theme'] = 'taxonomy_overview_terms'; - $form['#submit'] = array('taxonomy_overview_terms_submit'); // Use the existing taxonomy overview submit handler. - $form['#empty_text'] = t('No containers or forums available. Add container or Add forum.', array('@container' => url('admin/structure/forum/add/container'), '@forum' => url('admin/structure/forum/add/forum'))); + $form['#submit'] = array(array($this, 'submitForm')); + $form['#empty_text'] = $this->t('No containers or forums available. Add container or Add forum.', array('@container' => url('admin/structure/forum/add/container'), '@forum' => url('admin/structure/forum/add/forum'))); return $form; } - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, array &$form_state) {} - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, array &$form_state) {} - } -