class Overview
Same name in other branches
- 9 core/modules/forum/src/Form/Overview.php \Drupal\forum\Form\Overview
- 10 core/modules/forum/src/Form/Overview.php \Drupal\forum\Form\Overview
- 11.x core/modules/forum/src/Form/Overview.php \Drupal\forum\Form\Overview
Provides forum overview form for the forum vocabulary.
@internal
Hierarchy
- class \Drupal\Core\Form\FormBase implements \Drupal\Core\Form\FormInterface, \Drupal\Core\DependencyInjection\ContainerInjectionInterface uses \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Routing\LinkGeneratorTrait, \Drupal\Core\Logger\LoggerChannelTrait, \Drupal\Core\Messenger\MessengerTrait, \Drupal\Core\Routing\RedirectDestinationTrait, \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\Routing\UrlGeneratorTrait
- class \Drupal\taxonomy\Form\OverviewTerms extends \Drupal\Core\Form\FormBase uses \Drupal\Core\DependencyInjection\DeprecatedServicePropertyTrait
- class \Drupal\forum\Form\Overview extends \Drupal\taxonomy\Form\OverviewTerms
- class \Drupal\taxonomy\Form\OverviewTerms extends \Drupal\Core\Form\FormBase uses \Drupal\Core\DependencyInjection\DeprecatedServicePropertyTrait
Expanded class hierarchy of Overview
6 string references to 'Overview'
- content_moderation.links.task.yml in core/
modules/ content_moderation/ content_moderation.links.task.yml - core/modules/content_moderation/content_moderation.links.task.yml
- DbUpdateController::updateTasksList in core/
modules/ system/ src/ Controller/ DbUpdateController.php - Provides the update task list render array.
- forum.routing.yml in core/
modules/ forum/ forum.routing.yml - core/modules/forum/forum.routing.yml
- MigrateUpgradeFormBase::restartUpgradeForm in core/
modules/ migrate_drupal_ui/ src/ Form/ MigrateUpgradeFormBase.php - Helper to redirect to the Overview form.
- MigrateUpgradeFormStepsTest::testMigrateUpgradeReviewPage in core/
modules/ migrate_drupal_ui/ tests/ src/ Functional/ MigrateUpgradeFormStepsTest.php - Tests the flow of the Migrate Drupal UI form.
File
-
core/
modules/ forum/ src/ Form/ Overview.php, line 17
Namespace
Drupal\forum\FormView source
class Overview extends OverviewTerms {
/**
* {@inheritdoc}
*/
public function getFormId() {
return 'forum_overview';
}
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state, VocabularyInterface $taxonomy_vocabulary = NULL) {
$forum_config = $this->config('forum.settings');
$vid = $forum_config->get('vocabulary');
$vocabulary = $this->entityTypeManager
->getStorage('taxonomy_vocabulary')
->load($vid);
if (!$vocabulary) {
throw new NotFoundHttpException();
}
// Build base taxonomy term overview.
$form = parent::buildForm($form, $form_state, $vocabulary);
foreach (Element::children($form['terms']) as $key) {
if (isset($form['terms'][$key]['#term'])) {
/** @var \Drupal\taxonomy\TermInterface $term */
$term = $form['terms'][$key]['#term'];
$form['terms'][$key]['term']['#url'] = Url::fromRoute('forum.page', [
'taxonomy_term' => $term->id(),
]);
if (!empty($term->forum_container->value)) {
$title = $this->t('edit container');
$url = Url::fromRoute('entity.taxonomy_term.forum_edit_container_form', [
'taxonomy_term' => $term->id(),
]);
}
else {
$title = $this->t('edit forum');
$url = Url::fromRoute('entity.taxonomy_term.forum_edit_form', [
'taxonomy_term' => $term->id(),
]);
}
// Re-create the operations column and add only the edit link.
$form['terms'][$key]['operations'] = [
'#type' => 'operations',
'#links' => [
'edit' => [
'title' => $title,
'url' => $url,
],
],
];
}
}
// Remove the alphabetical reset.
unset($form['actions']['reset_alphabetical']);
// Use the existing taxonomy overview submit handler.
$form['terms']['#empty'] = $this->t('No containers or forums available. <a href=":container">Add container</a> or <a href=":forum">Add forum</a>.', [
':container' => Url::fromRoute('forum.add_container')->toString(),
':forum' => Url::fromRoute('forum.add_forum')->toString(),
]);
return $form;
}
}
Members
Title Sort descending | Deprecated | Modifiers | Object type | Summary | Overriden Title | Overrides |
---|---|---|---|---|---|---|
DependencySerializationTrait::$_entityStorages | protected | property | An array of entity type IDs keyed by the property name of their storages. | |||
DependencySerializationTrait::$_serviceIds | protected | property | An array of service IDs keyed by property name used for serialization. | |||
DependencySerializationTrait::__sleep | public | function | 1 | |||
DependencySerializationTrait::__wakeup | public | function | 2 | |||
DeprecatedServicePropertyTrait::__get | public | function | Allows to access deprecated/removed properties. | |||
FormBase::$configFactory | protected | property | The config factory. | 3 | ||
FormBase::$requestStack | protected | property | The request stack. | 1 | ||
FormBase::$routeMatch | protected | property | The route match. | |||
FormBase::config | protected | function | Retrieves a configuration object. | |||
FormBase::configFactory | protected | function | Gets the config factory for this form. | 3 | ||
FormBase::container | private | function | Returns the service container. | |||
FormBase::currentUser | protected | function | Gets the current user. | |||
FormBase::getRequest | protected | function | Gets the request object. | |||
FormBase::getRouteMatch | protected | function | Gets the route match. | |||
FormBase::logger | protected | function | Gets the logger for a specific channel. | |||
FormBase::redirect | protected | function | Returns a redirect response object for the specified route. | Overrides UrlGeneratorTrait::redirect | ||
FormBase::resetConfigFactory | public | function | Resets the configuration factory. | |||
FormBase::setConfigFactory | public | function | Sets the config factory for this form. | |||
FormBase::setRequestStack | public | function | Sets the request stack object to use. | |||
FormBase::validateForm | public | function | Form validation handler. | Overrides FormInterface::validateForm | 73 | |
LinkGeneratorTrait::$linkGenerator | protected | property | The link generator. | 1 | ||
LinkGeneratorTrait::getLinkGenerator | Deprecated | protected | function | Returns the link generator. | ||
LinkGeneratorTrait::l | Deprecated | protected | function | Renders a link to a route given a route name and its parameters. | ||
LinkGeneratorTrait::setLinkGenerator | Deprecated | public | function | Sets the link generator service. | ||
LoggerChannelTrait::$loggerFactory | protected | property | The logger channel factory service. | |||
LoggerChannelTrait::getLogger | protected | function | Gets the logger for a specific channel. | |||
LoggerChannelTrait::setLoggerFactory | public | function | Injects the logger channel factory. | |||
MessengerTrait::$messenger | protected | property | The messenger. | 17 | ||
MessengerTrait::messenger | public | function | Gets the messenger. | 17 | ||
MessengerTrait::setMessenger | public | function | Sets the messenger. | |||
Overview::buildForm | public | function | Form constructor. | Overrides OverviewTerms::buildForm | ||
Overview::getFormId | public | function | Returns a unique string identifying the form. | Overrides OverviewTerms::getFormId | ||
OverviewTerms::$deprecatedProperties | protected | property | ||||
OverviewTerms::$entityRepository | protected | property | The entity repository. | |||
OverviewTerms::$entityTypeManager | protected | property | The entity type manager. | |||
OverviewTerms::$moduleHandler | protected | property | The module handler service. | |||
OverviewTerms::$pagerManager | protected | property | The pager manager. | |||
OverviewTerms::$renderer | protected | property | The renderer service. | |||
OverviewTerms::$storageController | protected | property | The term storage handler. | |||
OverviewTerms::$termListBuilder | protected | property | The term list builder. | |||
OverviewTerms::create | public static | function | Instantiates a new instance of this class. | Overrides FormBase::create | ||
OverviewTerms::submitForm | public | function | Form submission handler. | Overrides FormInterface::submitForm | ||
OverviewTerms::submitReset | public | function | Redirects to confirmation form for the reset action. | |||
OverviewTerms::__construct | public | function | Constructs an OverviewTerms object. | |||
RedirectDestinationTrait::$redirectDestination | protected | property | The redirect destination service. | 1 | ||
RedirectDestinationTrait::getDestinationArray | protected | function | Prepares a 'destination' URL query parameter for use with \Drupal\Core\Url. | |||
RedirectDestinationTrait::getRedirectDestination | protected | function | Returns the redirect destination service. | |||
RedirectDestinationTrait::setRedirectDestination | public | function | Sets the redirect destination service. | |||
StringTranslationTrait::$stringTranslation | protected | property | The string translation service. | |||
StringTranslationTrait::formatPlural | protected | function | Formats a string containing a count of items. | |||
StringTranslationTrait::getNumberOfPlurals | protected | function | Returns the number of plurals supported by a given language. | |||
StringTranslationTrait::getStringTranslation | protected | function | Gets the string translation service. | |||
StringTranslationTrait::setStringTranslation | public | function | Sets the string translation service to use. | 2 | ||
StringTranslationTrait::t | protected | function | Translates a string to the current language or to a given language. | |||
UrlGeneratorTrait::$urlGenerator | protected | property | The url generator. | |||
UrlGeneratorTrait::getUrlGenerator | Deprecated | protected | function | Returns the URL generator service. | ||
UrlGeneratorTrait::setUrlGenerator | Deprecated | public | function | Sets the URL generator service. | ||
UrlGeneratorTrait::url | Deprecated | protected | function | Generates a URL or path for a specific route based on the given parameters. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.